yumapro  20.10-12
YumaPro SDK
xml_parse.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 - 2021, YumaWorks, Inc., All Rights Reserved.
3  *
4  * Unless required by applicable law or agreed to in writing,
5  * software distributed under the License is distributed on an
6  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
7  * KIND, either express or implied. See the License for the
8  * specific language governing permissions and limitations
9  * under the License.
10  */
11 #ifndef _H_xml_parse
12 #define _H_xml_parse
13 
14 /* FILE: xml_parse.c
15 
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
29 /*********************************************************************
30 * *
31 * C H A N G E H I S T O R Y *
32 * *
33 *********************************************************************
34 
35 date init comment
36 ----------------------------------------------------------------------
37 15apr20 am begun
38 */
39 
40 #ifndef _H_obj
41 #include "obj.h"
42 #endif
43 
44 #ifndef _H_ses
45 #include "ses.h"
46 #endif
47 
48 #ifndef _H_status
49 #include "status.h"
50 #endif
51 
52 #ifndef _H_xml_msg
53 #include "xml_msg.h"
54 #endif
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 /********************************************************************
61 * *
62 * F U N C T I O N S *
63 * *
64 *********************************************************************/
65 
95 extern status_t
96  xml_parse_btype_nc (ses_cb_t *scb,
97  xml_msg_hdr_t *msg,
98  obj_template_t *obj,
99  const xml_node_t *startnode,
100  ncx_data_class_t parentdc,
101  val_value_t *retval);
102 
103 
122 extern status_t
123  xml_parse_consume_node (ses_cb_t *scb,
124  boolean advance,
125  xml_node_t *node,
126  ncx_layer_t layer,
127  xml_msg_hdr_t *msghdr,
128  boolean eoferr,
129  boolean nserr);
130 
131 
142 extern status_t
143  xml_parse_buffer (xmlChar *buff,
144  obj_template_t *obj,
145  dlq_hdr_t *returnQ);
146 
147 
151 #ifdef __cplusplus
152 } /* end extern 'C' */
153 #endif
154 
155 #endif /* _H_xml_parse */
ncx_str.h
NCX Module Library String Utility Functions.
obj_first_child
obj_template_t * obj_first_child(obj_template_t *obj)
Get the first child object if the specified object has any children.
Definition: obj.c:6687
typ_get_basetype
ncx_btype_t typ_get_basetype(const typ_def_t *typdef)
Get the final base type of the specified typ_def_t.
Definition: typ.c:1764
ses.h
NETCONF Session Common definitions module.
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
ncx_owner_store_name
status_t ncx_owner_store_name(const xmlChar *name, ncx_owner_id_t *id)
Add an owner name to the registry; return the ID,.
Definition: ncx_owner.c:173
xml_strlen
uint32 xml_strlen(const xmlChar *str)
Get the String len for xmlChar.
Definition: xml_util.c:1406
obj_first_metadata
obj_metadata_t * obj_first_metadata(const obj_template_t *obj)
Get the first object metadata definition in the object.
Definition: obj.c:15159
NCX_NT_STRING
@ NCX_NT_STRING
xmlChar *, error only
Definition: ncxtypes.h:279
val_child_add_last
status_t val_child_add_last(val_value_t *child, val_value_t *parent)
Add a child value node as last node to a parent value node.
Definition: val_child.c:1583
NCX_NF_OCTAL
@ NCX_NF_OCTAL
YANG octal format.
Definition: ncxtypes.h:334
VAL_REMOVE_META
#define VAL_REMOVE_META(M)
Remove a metadata value node.
Definition: val.h:568
NCX_BT_INT32
@ NCX_BT_INT32
int32
Definition: ncxtypes.h:209
xpath_free_pcb
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
ERR_NCX_WRONG_NODETYP
@ ERR_NCX_WRONG_NODETYP
282
Definition: status_enum.h:325
NCX_BT_CASE
@ NCX_BT_CASE
internal, not a real type
Definition: ncxtypes.h:227
xml_msg_clean_hdr
void xml_msg_clean_hdr(xml_msg_hdr_t *msg)
Clean all the memory used by the specified xml_msg_hdr_t but do not free the struct itself.
Definition: xml_msg.c:438
OBJ_TYP_LIST
@ OBJ_TYP_LIST
list: last real database object
Definition: obj.h:617
NCX_BT_BINARY
@ NCX_BT_BINARY
binary (base64)
Definition: ncxtypes.h:218
ncx_convert_dec64
status_t ncx_convert_dec64(const xmlChar *numstr, ncx_numfmt_t numfmt, uint8 digits, ncx_num_t *val)
Convert a number string to a decimal64 number.
Definition: ncx_num.c:1039
obj_get_typdef
typ_def_t * obj_get_typdef(obj_template_t *obj)
Get the typdef for the leaf or leaf-list.
Definition: obj.c:11991
ERR_NCX_MISSING_INDEX
@ ERR_NCX_MISSING_INDEX
306
Definition: status_enum.h:349
OP_EDITOP_NONE
@ OP_EDITOP_NONE
not set
Definition: op.h:123
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
XML_MSG_ANYXML_TRACK
#define XML_MSG_ANYXML_TRACK(M)
Check if anyxml tracking is active.
Definition: xml_msg.h:249
val_find_meta
val_value_t * val_find_meta(val_value_t *val, xmlns_id_t nsid, const xmlChar *name)
Get the corresponding meta data node.
Definition: val.c:5532
ERR_NCX_EXTRA_ATTR
@ ERR_NCX_EXTRA_ATTR
308
Definition: status_enum.h:351
val_gen_key_entry
status_t val_gen_key_entry(val_value_t *keyval)
Create a key record within an index comp.
Definition: val_util.c:2561
xml_clean_node
void xml_clean_node(xml_node_t *node)
Clean an xml_node_t struct.
Definition: xml_util.c:266
NCX_IQUAL_ONE
@ NCX_IQUAL_ONE
no iqual == 1
Definition: ncxtypes.h:297
ses_new_dummy_scb
ses_cb_t * ses_new_dummy_scb(void)
Create a new dummy session control block.
Definition: ses.c:2100
OP_INSOP_AFTER
@ OP_INSOP_AFTER
insert after foo
Definition: op.h:142
val_new_child_val
val_value_t * val_new_child_val(xmlns_id_t nsid, const xmlChar *name, boolean copyname, val_value_t *parent, op_editop_t editop, obj_template_t *obj)
Internal function used by server to create a new child value.
Definition: val_util.c:3368
VAL_NSID
#define VAL_NSID(V)
Access the namespace ID.
Definition: val.h:396
OP_INSOP_BEFORE
@ OP_INSOP_BEFORE
insert before foo
Definition: op.h:141
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
NCX_LAYER_NONE
@ NCX_LAYER_NONE
not set
Definition: ncxtypes.h:343
xml_msg_record_attr_error_fn_t
void(* xml_msg_record_attr_error_fn_t)(ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_attr_t *xmlattr, const xml_node_t *xmlnode, const xmlChar *badns, ncx_node_t nodetyp, void *errnode)
Generate an rpc_err_rec_t and save it in the msg.
Definition: xml_msg.h:687
val_union_ok_ex
status_t val_union_ok_ex(typ_def_t *typdef, const xmlChar *strval, val_value_t *retval, ncx_errinfo_t **errinfo, ncx_module_t *mod, typ_def_t **match_typdef)
Check a union to make sure the string is valid based on the specified typdef, and convert the string ...
Definition: val.c:4943
obj_is_leaf_list
boolean obj_is_leaf_list(const obj_template_t *obj)
Check if object is a proper leaf-list.
Definition: obj.c:13336
NCX_BT_BOOLEAN
@ NCX_BT_BOOLEAN
boolean
Definition: ncxtypes.h:206
val.h
Value Node Basic Support.
NCX_BT_INSTANCE_ID
@ NCX_BT_INSTANCE_ID
instance-identifier
Definition: ncxtypes.h:219
xml_util.h
XML Utilities.
NCX_BT_IDREF
@ NCX_BT_IDREF
identityref
Definition: ncxtypes.h:222
ncx_get_save_owners
boolean ncx_get_save_owners(void)
Get the save_owners flag.
Definition: ncx.c:15197
op_insertop_id
op_insertop_t op_insertop_id(const xmlChar *opstr)
Get the ID for the insert operation from its keyword.
Definition: op.c:234
NCX_LAYER_OPERATION
@ NCX_LAYER_OPERATION
protocol operation layer
Definition: ncxtypes.h:346
val_idref_ok
status_t val_idref_ok(typ_def_t *typdef, const xmlChar *qname, xmlns_id_t nsid, const xmlChar **name, ncx_identity_t **id)
Check if an identityref QName is valid for the typedef.
Definition: val.c:3717
NCX_BT_LEAFREF
@ NCX_BT_LEAFREF
leafref (needs special processing)
Definition: ncxtypes.h:221
tk.h
NCX Syntax Token Handler.
log_debug3
void void void void void void void void void void void log_debug3(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG3 log entry.
ncx_num.h
NCX Module Library Number Utility Functions.
NCX_DEF_MODULE
#define NCX_DEF_MODULE
Internal default module for NETCONF.
Definition: ncxconst.h:292
val_get_mod_name
const xmlChar * val_get_mod_name(const val_value_t *val)
Get the module name associated with this value node.
Definition: val.c:12223
ncx_nmda_get_origin_enum
ncx_nmda_origin_t ncx_nmda_get_origin_enum(const xmlChar *or_name)
Get the standard origin enum for the string.
Definition: ncx_nmda.c:420
OP_INSOP_FIRST
@ OP_INSOP_FIRST
insert first
Definition: op.h:139
ncx_check_delete_all_allowed
boolean ncx_check_delete_all_allowed(obj_template_t *testobj)
Check if the delete-all or remove-all operation is enabled for for specified object.
Definition: ncx.c:15128
XML_NT_END
@ XML_NT_END
end-tag of an element
Definition: xml_util.h:193
val_list_ok_errinfo
status_t val_list_ok_errinfo(typ_def_t *typdef, ncx_btype_t btyp, ncx_list_t *list, ncx_errinfo_t **errinfo)
Check a list to make sure the all the strings are valid based on the specified typdef.
Definition: val.c:3384
ERR_LAST_SYS_ERR
@ ERR_LAST_SYS_ERR
124 – not really used
Definition: status_enum.h:236
val_set_withdef_default
void val_set_withdef_default(val_value_t *val)
Set the value flags as having the wd:default attribute.
Definition: val.c:12610
xml_isspace_str
boolean xml_isspace_str(const xmlChar *str)
Check if an xmlChar string is all whitespace chars.
Definition: xml_util.c:1923
obj_is_key
boolean obj_is_key(const obj_template_t *obj)
Check if object is being used as a key leaf within a list.
Definition: obj.c:14278
NCX_BT_ANYDATA
@ NCX_BT_ANYDATA
YANG 1.1 anydata.
Definition: ncxtypes.h:229
typ_userdef_canonical
status_t typ_userdef_canonical(val_value_t *val)
Invoke the canonical callback function for a user defined type if it exists.
Definition: typ_userdef.c:245
VAL_SET_EXTERNAL
#define VAL_SET_EXTERNAL(V)
flag the value as an external value Not sure why this is different than NCX_BT_EXTERN
Definition: val.h:597
typ_userdef.h
User Defined Types.
obj_get_child_node
status_t obj_get_child_node(obj_template_t *obj, obj_template_t *chobj, const xml_node_t *curnode, boolean xmlorder, dlq_hdr_t *force_modQ, obj_template_t **rettop, obj_template_t **retobj)
Get the correct child node for the specified parent and current XML node.
Definition: obj.c:12875
VAL_NAME
#define VAL_NAME(V)
Access the value name.
Definition: val.h:399
ncxconst.h
Contains NCX constants.
val_set_origin
void val_set_origin(val_value_t *val, ncx_nmda_origin_t origin)
Set the NMDA value origin.
Definition: val_util.c:7974
obj_get_mod_prefix
const xmlChar * obj_get_mod_prefix(const obj_template_t *obj)
Get the module prefix for this object.
Definition: obj.c:12125
NCX_DC_CONFIG
@ NCX_DC_CONFIG
persistent config
Definition: ncxtypes.h:192
obj_template_t_::nsid
xmlns_id_t nsid
namespace ID assigned to the object at run-time
Definition: obj.h:1118
VAL_INS_MODE_KEY
@ VAL_INS_MODE_KEY
YANG key attribute.
Definition: val.h:767
NCX_NF_DEC
@ NCX_NF_DEC
YANG deciaml format.
Definition: ncxtypes.h:335
xml_copy_clean_string
xmlChar * xml_copy_clean_string(const xmlChar *str)
Get a malloced string contained the converted string from the input.
Definition: xml_util.c:2119
NCX_BT_UINT8
@ NCX_BT_UINT8
uint8
Definition: ncxtypes.h:211
val_set_xpathpcb
status_t val_set_xpathpcb(val_value_t *val, xpath_pcb_t *xpathpcb)
Set the xpathpcb field with passed field;.
Definition: val_util.c:4324
obj_is_list
boolean obj_is_list(const obj_template_t *obj)
Check if object is a YANG list.
Definition: obj.c:13349
xml_msg_record_error_fn_t
void(* xml_msg_record_error_fn_t)(ses_cb_t *scb, xml_msg_hdr_t *mhdr, ncx_layer_t layer, status_t res, const xml_node_t *xmlnode, ncx_node_t parmtyp, const void *error_info, ncx_node_t nodetyp, void *error_path)
Generate an rpc_err_rec_t and save it in the msg.
Definition: xml_msg.h:624
obj_is_action
boolean obj_is_action(const obj_template_t *obj)
Check if the object is a YANG 1.1 action.
Definition: obj.c:14028
xmlns_get_module
const xmlChar * xmlns_get_module(xmlns_id_t nsid)
get the module name of the namespace ID
Definition: xmlns.c:1126
log_info
void void void void void log_info(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_INFO log entry.
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
xmlns_yang_id
xmlns_id_t xmlns_yang_id(void)
Get the ID for the YANG namespace or 0 if it doesn't exist.
Definition: xmlns.c:1017
val_remove_child
void val_remove_child(val_value_t *child)
Remove a child value node from its parent value node.
Definition: val.c:8316
ERR_NCX_MISSING_PARM
@ ERR_NCX_MISSING_PARM
233
Definition: status_enum.h:272
log_debug2
void void void void void void void void void log_debug2(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG2 log entry.
typ_get_basetype_typdef
typ_def_t * typ_get_basetype_typdef(ncx_btype_t btyp)
Get the default typdef for the specified base type.
Definition: typ.c:2039
xpath1.h
XPath 1.0 expression support.
VAL_SET_FIXED_VALUE
#define VAL_SET_FIXED_VALUE(V)
flag the value as a fixed key value for GETNEXT processing
Definition: val.h:573
def_reg.h
Definition Registry module.
xml_get_reader_from_buff
status_t xml_get_reader_from_buff(const xmlChar *buff, xmlTextReaderPtr *reader)
Get a new xmlTextReader for parsing a debug test file.
Definition: xml_util.c:305
xmlns_ywattrs_id
xmlns_id_t xmlns_ywattrs_id(void)
Get the ID for the YumaWorks attributes namespace or 0 if it doesn't exist.
Definition: xmlns.c:1090
NCX_BT_ENUM
@ NCX_BT_ENUM
enumeration
Definition: ncxtypes.h:204
ERR_NCX_MISSING_ATTR
@ ERR_NCX_MISSING_ATTR
309
Definition: status_enum.h:352
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
NCX_BT_LIST
@ NCX_BT_LIST
internal, YANG list
Definition: ncxtypes.h:228
ncx_get_gen_anyxml
obj_template_t * ncx_get_gen_anyxml(void)
Get the object template for the NCX generic anyxml container.
Definition: ncx.c:6664
xml_val.h
Utility functions for creating value structs.
NC_MODULE
#define NC_MODULE
Internal NETCONF YANG module.
Definition: ncxconst.h:71
NCX_BT_UINT64
@ NCX_BT_UINT64
uint64
Definition: ncxtypes.h:214
NCX_NF_REAL
@ NCX_NF_REAL
internal format for XPath
Definition: ncxtypes.h:337
xml_check_ns
status_t xml_check_ns(xmlTextReaderPtr reader, const xmlChar *elname, xmlns_id_t *id, uint32 *pfix_len, const xmlChar **badns)
Check a namespace during parsing.
Definition: xml_util.c:2248
log_debug4
void void void void void void void void void void void void void log_debug4(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG4 log entry.
obj_get_name
const xmlChar * obj_get_name(const obj_template_t *obj)
Get the name field for this obj.
Definition: obj.c:10511
XML_NT_STRING
@ XML_NT_STRING
string content node
Definition: xml_util.h:194
ses_get_protocol
ncx_protocol_t ses_get_protocol(const ses_cb_t *scb)
Get the NETCONF protocol set (or unset) for this session.
Definition: ses.c:3854
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
ERR_NCX_WRONG_NODETYP_SIM
@ ERR_NCX_WRONG_NODETYP_SIM
283
Definition: status_enum.h:326
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
xpath_free_result
void xpath_free_result(xpath_result_t *result)
Free a malloced XPath result struct.
Definition: xpath.c:3107
OP_EDITOP_DELETE
@ OP_EDITOP_DELETE
edit op is delete
Definition: op.h:127
log_warn
void void void log_warn(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_WARN log entry.
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
xmlns_wda_id
xmlns_id_t xmlns_wda_id(void)
Get the ID for the wd:default XML attribute namespace or 0 if it doesn't exist.
Definition: xmlns.c:1071
dlq_remove
void dlq_remove(void *nodeP)
remove the queue entry from its queue list entry MUST have been enqueued somehow before this function...
Definition: dlq.c:519
val_child_add
status_t val_child_add(val_value_t *child, val_value_t *parent)
Add a child value node to a parent value node.
Definition: val_child.c:1542
xml_msg_record_error_errinfo_fn_t
void(* xml_msg_record_error_errinfo_fn_t)(ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_node_t *xmlnode, ncx_node_t parmtyp, const void *error_info, ncx_node_t nodetyp, void *error_path, const ncx_errinfo_t *errinfo)
Generate an rpc_err_rec_t and save it in the msg Use the provided error info record for <rpc-error> f...
Definition: xml_msg.h:656
val_util.h
Value Node Utilities.
ncx_get_with_canonical
boolean ncx_get_with_canonical(void)
Get the with_canonical flag.
Definition: ncx.c:15166
obj_template_t_::parent
struct obj_template_t_ * parent
backptr to parent
Definition: obj.h:1079
ncx_get_gen_container
obj_template_t * ncx_get_gen_container(void)
Get the object template for the NCX generic container.
Definition: ncx.c:6678
NCX_BT_INT64
@ NCX_BT_INT64
int64
Definition: ncxtypes.h:210
xml_parse_consume_node
status_t xml_parse_consume_node(ses_cb_t *scb, boolean advance, xml_node_t *node, ncx_layer_t layer, xml_msg_hdr_t *msghdr, boolean eoferr, boolean nserr)
Internal consume XML node function.
Definition: xml_parse.c:4240
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
ncx_is_true
boolean ncx_is_true(const xmlChar *str)
Check if an xmlChar string is a string OK for XSD boolean.
Definition: ncx.c:7691
ncx_finish_list
status_t ncx_finish_list(typ_def_t *typdef, ncx_list_t *list)
2nd pass of parsing a ncx_list_t Finish converting the list members to the proper format
Definition: ncx_list.c:862
obj_next_child
obj_template_t * obj_next_child(obj_template_t *obj)
Get the next child object if the specified object has any children.
Definition: obj.c:6860
NCX_NT_QNAME
@ NCX_NT_QNAME
xmlns_qname_t *, error only
Definition: ncxtypes.h:282
NCX_BT_EMPTY
@ NCX_BT_EMPTY
empty
Definition: ncxtypes.h:205
NCX_BT_UINT16
@ NCX_BT_UINT16
uint16
Definition: ncxtypes.h:212
ncx_check_startup_prune
boolean ncx_check_startup_prune(ses_cb_t *scb)
Check if the namespace error can be skipped.
Definition: ncx.c:15000
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
xml_strncmp
int xml_strncmp(const xmlChar *s1, const xmlChar *s2, uint32 maxlen)
String compare for xmlChar for at most 'maxlen' xmlChars.
Definition: xml_util.c:1824
val_match_metaval
boolean val_match_metaval(const xml_attr_t *attr, xmlns_id_t nsid, const xmlChar *name)
Match the specific attribute value and namespace ID.
Definition: val.c:11790
XML_NT_NONE
@ XML_NT_NONE
not set
Definition: xml_util.h:190
val_child.h
Value Node Child Access Support.
OP_INSOP_NONE
@ OP_INSOP_NONE
not set
Definition: op.h:138
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
ncx_obj_is_generic
boolean ncx_obj_is_generic(const obj_template_t *obj)
Check if the object is 1 of the gen_foo object templates.
Definition: ncx.c:13013
NCX_BT_CONTAINER
@ NCX_BT_CONTAINER
internal container
Definition: ncxtypes.h:225
typ_get_listtyp
typ_template_t * typ_get_listtyp(typ_def_t *typdef)
Return the typ_template for the list type, if the supplied.
Definition: typ.c:3803
typ.h
Parameter Type Handler.
xml_next_attr
xml_attr_t * xml_next_attr(xml_attr_t *attr)
get the next attribute in the list
Definition: xml_util.c:1218
tk_get_btype_sym
const char * tk_get_btype_sym(ncx_btype_t btyp)
Get the symbolic token symbol for one of the base types.
Definition: tk.c:3324
ERR_XML_READER_NULLNAME
@ ERR_XML_READER_NULLNAME
215
Definition: status_enum.h:254
val_all_whitespace
boolean val_all_whitespace(const xmlChar *str)
Check if a string is all whitespace.
Definition: val.c:11719
yangconst.h
Contains YANG constants separated to prevent H file include loops.
ncx_get_numfmt
ncx_numfmt_t ncx_get_numfmt(const xmlChar *numstr)
Get the number format of the specified string.
Definition: ncx_num.c:2164
ncx_set_list
status_t ncx_set_list(ncx_btype_t btyp, const xmlChar *strval, ncx_list_t *list)
consume a generic string list with base type checking Parse the XML input as an NCX_BT_SLIST
Definition: ncx_list.c:751
val_add_meta
status_t val_add_meta(val_value_t *metaval, val_value_t *val)
Add a meta value to a value node.
Definition: val.c:15157
xml_parse.h
XML Parser functions.
xml_free_attr
void xml_free_attr(xml_attr_t *attr)
free an attribute
Definition: xml_util.c:785
ERR_NCX_EOF
@ ERR_NCX_EOF
244
Definition: status_enum.h:283
val_set_binary
status_t val_set_binary(const xmlChar *valstr, uint32 valstrlen, val_value_t *val)
set and decode base64 value.
Definition: val.c:6758
ERR_NCX_INVALID_XPATH_EXPR
@ ERR_NCX_INVALID_XPATH_EXPR
348
Definition: status_enum.h:391
obj_get_fraction_digits
uint8 obj_get_fraction_digits(const obj_template_t *obj)
Get the fraction-digits field from the object typdef.
Definition: obj.c:13187
NCX_PROTO_YCONTROL
@ NCX_PROTO_YCONTROL
YumaPro Internal Control 1.0.
Definition: ncxtypes.h:787
OP_EDITOP_DELETE_ALL
@ OP_EDITOP_DELETE_ALL
delete-all, yumapro only
Definition: op.h:131
val_new_editvars
status_t val_new_editvars(val_value_t *val)
Malloc and initialize the val->editvars field.
Definition: val.c:13350
OBJ_TYP_LEAF_LIST
@ OBJ_TYP_LEAF_LIST
leaf-list
Definition: obj.h:616
OP_INSOP_LAST
@ OP_INSOP_LAST
insert last (default)
Definition: op.h:140
ERR_XML_READER_NULLVAL
@ ERR_XML_READER_NULLVAL
216
Definition: status_enum.h:255
NCX_DC_STATE
@ NCX_DC_STATE
state or statistics
Definition: ncxtypes.h:193
NCX_BT_UNION
@ NCX_BT_UNION
union (needs special processing)
Definition: ncxtypes.h:220
xpath_yang.h
YANG-specific Xpath support.
xml_msg_init_hdr
void xml_msg_init_hdr(xml_msg_hdr_t *msg)
Initialize a new xml_msg_hdr_t struct.
Definition: xml_msg.c:393
xml_msg.h
XML and JSON Message send and receive support.
ncx_nmda.h
NMDA Data Support.
xpath_yang_validate_xmlpath
status_t xpath_yang_validate_xmlpath(xmlTextReaderPtr reader, xpath_pcb_t *pcb, obj_template_t *pathobj, boolean logerrors, obj_template_t **targobj)
Validate an instance-identifier expression (XML path) within an XML PDU context.
Definition: xpath_yang.c:2651
val_parse_meta
status_t val_parse_meta(ses_cb_t *scb, typ_def_t *typdef, xml_attr_t *attr, val_value_t *retval)
Parse the metadata descriptor against the typdef Check only that the value is ok, not instance count.
ERR_NCX_UNKNOWN_OBJECT
@ ERR_NCX_UNKNOWN_OBJECT
293
Definition: status_enum.h:336
obj_get_mod_name
const xmlChar * obj_get_mod_name(const obj_template_t *obj)
Get the module name for this object.
Definition: obj.c:12176
typ_is_simple
boolean typ_is_simple(ncx_btype_t btyp)
Check if this is a simple data type.
Definition: typ.c:3107
NCX_BT_ANY
@ NCX_BT_ANY
anyxml
Definition: ncxtypes.h:202
NCX_BT_SLIST
@ NCX_BT_SLIST
ncx:xsdlist extension (internal, deprecated)
Definition: ncxtypes.h:223
val_enum_ok
status_t val_enum_ok(typ_def_t *typdef, const xmlChar *enumval, int32 *retval, const xmlChar **retstr)
Check an enumerated integer string to make sure the value is valid based on the specified typdef.
Definition: val.c:3455
EMPTY_STRING
#define EMPTY_STRING
empty string used to get const xmlChar * cast
Definition: ncxconst.h:289
obj_find_child
obj_template_t * obj_find_child(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname)
Find a child object with the specified Qname.
Definition: obj.c:6116
NCX_NT_OBJ
@ NCX_NT_OBJ
obj_template_t
Definition: ncxtypes.h:277
ncx_find_any_object
obj_template_t * ncx_find_any_object(const xmlChar *objname)
Find any top-level object in any YANG module.
Definition: ncx.c:4025
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
xml_check_qname_content
void xml_check_qname_content(xmlTextReaderPtr reader, xml_node_t *node)
Check if the string node content is a likely QName.
Definition: xml_util.c:2307
ERR_NCX_WRONG_NUMTYP
@ ERR_NCX_WRONG_NUMTYP
289
Definition: status_enum.h:332
val_get_next_child
val_value_t * val_get_next_child(const val_value_t *curchild)
Get the next child node.
Definition: val.c:8496
val_range_ok_errinfo
status_t val_range_ok_errinfo(typ_def_t *typdef, ncx_btype_t btyp, const ncx_num_t *num, ncx_errinfo_t **errinfo)
Check a number to see if it is in range or not; get errinfo Could be a number or size range.
Definition: val.c:4216
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
log.h
NCX System Logging Manager.
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
obj_template_t_::objtype
obj_type_t objtype
object type (def)
Definition: obj.h:1058
obj_is_leaf
boolean obj_is_leaf(const obj_template_t *obj)
Check if object is a proper leaf.
Definition: obj.c:13323
ERR_XML_READER_INTERNAL
@ ERR_XML_READER_INTERNAL
121
Definition: status_enum.h:233
ncx_get_trim_whitespace
boolean ncx_get_trim_whitespace(void)
Get the trim_whitespace flag.
Definition: ncx.c:14917
xmlns_nc_id
xmlns_id_t xmlns_nc_id(void)
Get the ID for the NETCONF namespace or 0 if it doesn't exist.
Definition: xmlns.c:880
NC_OPERATION_ATTR_NAME
#define NC_OPERATION_ATTR_NAME
NETCONF edit-config operation attribute name.
Definition: ncxconst.h:118
ERR_NCX_UNKNOWN_NS
@ ERR_NCX_UNKNOWN_NS
229
Definition: status_enum.h:268
ncx_get_gen_empty
obj_template_t * ncx_get_gen_empty(void)
Get the object template for the NCX generic empty leaf.
Definition: ncx.c:6706
val_set_anyxml_tracking
void val_set_anyxml_tracking(val_value_t *val, obj_template_t *obj)
Set the anyxml tracking data for this node.
Definition: val_util.c:8018
XML_MSG_ACTIONVAL
#define XML_MSG_ACTIONVAL(M)
Get YANG 1.1 action value node.
Definition: xml_msg.h:264
XML_NT_START
@ XML_NT_START
start-tag of an element
Definition: xml_util.h:192
obj_is_schema_instance_string
boolean obj_is_schema_instance_string(const obj_template_t *obj)
Check if object is a schema-instance string.
Definition: obj.c:14420
val_set_string
status_t val_set_string(val_value_t *val, const xmlChar *valname, const xmlChar *valstr)
set a generic string using the builtin string typdef Set an initialized val_value_t as a simple type ...
Definition: val.c:6622
typ_userdef_validate
status_t typ_userdef_validate(val_value_t *val)
Invoke the validate callback function for a user defined type if it exists.
Definition: typ_userdef.c:202
XML_MSG_PRUNE_BAD_DATA
#define XML_MSG_PRUNE_BAD_DATA(M)
prune bad data
Definition: xml_msg.h:298
OP_EDITOP_REMOVE
@ OP_EDITOP_REMOVE
remove, base:1.1 only
Definition: op.h:130
VAL_INS_MODE_VALUE
@ VAL_INS_MODE_VALUE
YANG value attribute.
Definition: val.h:768
xml_get_node_name
const char * xml_get_node_name(int nodeval)
get the node type according to the xmlElementType enum list in /usr/include/libxml/libxml/tree....
Definition: xml_util.c:475
NCX_BT_BITS
@ NCX_BT_BITS
bits
Definition: ncxtypes.h:203
NCX_NT_VAL
@ NCX_NT_VAL
val_value_t
Definition: ncxtypes.h:276
ncx_list.h
NCX Module Library List Utility Functions.
NCX_BT_FLOAT64
@ NCX_BT_FLOAT64
hidden: just for XPath
Definition: ncxtypes.h:216
NCX_BT_UINT32
@ NCX_BT_UINT32
uint32
Definition: ncxtypes.h:213
val_get_first_child
val_value_t * val_get_first_child(const val_value_t *parent)
Get the first child node.
Definition: val.c:8477
NCX_NT_NONE
@ NCX_NT_NONE
not set
Definition: ncxtypes.h:273
obj_find_metadata
obj_metadata_t * obj_find_metadata(const obj_template_t *obj, const xmlChar *name)
Find the object metadata definition in the object.
Definition: obj.c:15119
XML_MSG_ANYXML_OBJ
#define XML_MSG_ANYXML_OBJ(M)
Access the anyxml tracking object.
Definition: xml_msg.h:258
ncx_get_gen_string
obj_template_t * ncx_get_gen_string(void)
Get the object template for the NCX generic string leaf.
Definition: ncx.c:6692
VAL_TYPE
#define VAL_TYPE(V)
Access the base type : same as VAL_BTYPE.
Definition: val.h:387
obj_get_basetype
ncx_btype_t obj_get_basetype(const obj_template_t *obj)
Get the NCX base type enum for the object type.
Definition: obj.c:12077
NCX_IQUAL_OPT
@ NCX_IQUAL_OPT
'?' == 0 or 1
Definition: ncxtypes.h:298
XML_MSG_CLR_ANYXML_TRACK
#define XML_MSG_CLR_ANYXML_TRACK(M)
Clear flag that anyxml tracking is active.
Definition: xml_msg.h:255
ERR_XML_READER_EOF
@ ERR_XML_READER_EOF
221
Definition: status_enum.h:260
NCX_LAYER_CONTENT
@ NCX_LAYER_CONTENT
application layer
Definition: ncxtypes.h:347
val_new_value
val_value_t * val_new_value(void)
Malloc and initialize the fields in a val_value_t.
Definition: val.c:2697
val_string_ok_errinfo
status_t val_string_ok_errinfo(typ_def_t *typdef, ncx_btype_t btyp, const xmlChar *strval, ncx_errinfo_t **errinfo)
retrieve the YANG custom error info if any
Definition: val.c:3038
xml_parse_buffer
status_t xml_parse_buffer(xmlChar *buff, obj_template_t *obj, dlq_hdr_t *returnQ)
Parse buffer of XML into val_value_t structs.
Definition: xml_parse.c:4498
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
xml_attrs_t
dlq_hdr_t xml_attrs_t
queue of xml_attr_t
Definition: xml_util.h:151
OP_EDITOP_REMOVE_ALL
@ OP_EDITOP_REMOVE_ALL
remove-all, yumapro only
Definition: op.h:132
obj.h
Data Object Support.
ncx_is_false
boolean ncx_is_false(const xmlChar *str)
Check if an xmlChar string is a string OK for XSD boolean.
Definition: ncx.c:7714
obj_next_metadata
obj_metadata_t * obj_next_metadata(const obj_metadata_t *meta)
Get the next object metadata definition in the object.
Definition: obj.c:15187
xml_find_ro_attr
const xml_attr_t * xml_find_ro_attr(const xml_node_t *node, xmlns_id_t nsid, const xmlChar *attrname)
Find a read-only attribute.
Definition: xml_util.c:1367
xml_parse_btype_nc
status_t xml_parse_btype_nc(ses_cb_t *scb, xml_msg_hdr_t *msg, obj_template_t *obj, const xml_node_t *startnode, ncx_data_class_t parentdc, val_value_t *retval)
Parse the XML node.
Definition: xml_parse.c:4051
xml_get_first_attr
xml_attr_t * xml_get_first_attr(const xml_node_t *node)
get the first attribute in the attrs list, from an xml_node_t param
Definition: xml_util.c:1192
val_metadata_inst_count
uint32 val_metadata_inst_count(val_value_t *val, xmlns_id_t nsid, const xmlChar *name)
Get the number of instances of the specified attribute.
Definition: val.c:5639
xpath1_eval_xmlexpr
xpath_result_t * xpath1_eval_xmlexpr(xmlTextReaderPtr reader, xpath_pcb_t *pcb, val_value_t *val, val_value_t *docroot, boolean logerrors, boolean configonly, status_t *res)
Evaluate an XML document expression.
Definition: xpath1.c:5643
XML_MSG_SET_ANYXML_TRACK
#define XML_MSG_SET_ANYXML_TRACK(M)
Set flag that anyxml tracking is active.
Definition: xml_msg.h:252
CHK_EXIT
#define CHK_EXIT(res, retres)
used in parser routines to decide if processing can continue will exit the function if critical error...
Definition: yangconst.h:221
val_init_from_template
void val_init_from_template(val_value_t *val, struct obj_template_t_ *obj)
Initialize a value node from its object template.
ERR_NCX_UNKNOWN_ATTRIBUTE
@ ERR_NCX_UNKNOWN_ATTRIBUTE
262
Definition: status_enum.h:303
ncx_find_object_nsid
obj_template_t * ncx_find_object_nsid(xmlns_id_t nsid, const xmlChar *objname)
Find a top level module object by module NSID.
Definition: ncx.c:4363
val_binary_ok_errinfo
status_t val_binary_ok_errinfo(typ_def_t *typdef, const xmlChar *strval, val_value_t *val, ncx_errinfo_t **errinfo)
retrieve the YANG custom error info for binary val, if any
Definition: val.c:3070
xpath_find_schema_target_int
status_t xpath_find_schema_target_int(const xmlChar *target, obj_template_t **targobj)
@
Definition: xpath.c:2475
dlq_enque
void dlq_enque(REG void *newP, REG dlq_hdrT *listP)
add a queue node to the end of a queue list Add newP to listP
Definition: dlq.c:246
ncx_convert_num
status_t ncx_convert_num(const xmlChar *numstr, ncx_numfmt_t numfmt, ncx_btype_t btyp, ncx_num_t *val)
Convert a number string to a numeric type.
Definition: ncx_num.c:717
xpath_new_session_pcb
xpath_pcb_t * xpath_new_session_pcb(ses_cb_t *scb, const xmlChar *expr, status_t *res)
Get a new XPath parser control block for a session.
Definition: xpath.c:4669
xmlns_inv_id
xmlns_id_t xmlns_inv_id(void)
Get the INVALID namespace ID.
Definition: xmlns.c:931
obj_get_config_flag2
boolean obj_get_config_flag2(const obj_template_t *obj, boolean *setflag)
Get the config flag for an obj_template_t Return the explicit value or the inherited value Also retur...
Definition: obj.c:11213
VAL_STR
#define VAL_STR(V)
Access the value as a string ONLY if typ_is_string() is true.
Definition: val.h:464
ncx_owner.h
NETCONF Server owner registry for NMDA support.
ses_free_scb
void ses_free_scb(ses_cb_t *scb)
Free a session control block.
Definition: ses.c:2221
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
XML_NT_EMPTY
@ XML_NT_EMPTY
standalone empty node
Definition: xml_util.h:191
xml_init_node
void xml_init_node(xml_node_t *node)
Init an xml_node_t struct.
Definition: xml_util.c:229
SES_ST_INIT
@ SES_ST_INIT
initialization state
Definition: ses.h:354
xmlns_ncx_id
xmlns_id_t xmlns_ncx_id(void)
Get the ID for the NETCONF Extensions namespace or 0 if it doesn't exist.
Definition: xmlns.c:897
NCX_BT_DECIMAL64
@ NCX_BT_DECIMAL64
decimal64
Definition: ncxtypes.h:215
obj_is_xpath_string
boolean obj_is_xpath_string(const obj_template_t *obj)
Check if object is an XPath string.
Definition: obj.c:14394
NCX_BT_CHOICE
@ NCX_BT_CHOICE
internal choice, not really used
Definition: ncxtypes.h:226
ERR_NCX_UNKNOWN_NAMESPACE
@ ERR_NCX_UNKNOWN_NAMESPACE
266
Definition: status_enum.h:307
ERR_NCX_WRONG_NODETYP_CPX
@ ERR_NCX_WRONG_NODETYP_CPX
284
Definition: status_enum.h:327
NCX_BT_STRING
@ NCX_BT_STRING
string
Definition: ncxtypes.h:217
xmlns_find_ns_by_name
xmlns_id_t xmlns_find_ns_by_name(const xmlChar *name)
Find the NS ID from its name.
Definition: xmlns.c:797
xml_add_qattr
xml_attr_t * xml_add_qattr(xml_attrs_t *attrs, xmlns_id_t ns_id, const xmlChar *attr_qname, uint32 plen, const xmlChar *attr_val, status_t *res)
add a qualified attribute to an attribute list with a prefix
Definition: xml_util.c:872
val_child_add_force
status_t val_child_add_force(val_value_t *child, val_value_t *parent)
Add a child value node to a parent value node Force add even if Tree Insersion fails.
Definition: val_child.c:1624
val_set_simval
status_t val_set_simval(val_value_t *val, typ_def_t *typdef, xmlns_id_t nsid, const xmlChar *valname, const xmlChar *valstr)
set any simple value with any typdef Set an initialized val_value_t as a simple type
Definition: val.c:6836
xpath_yang_validate_xmlkey
status_t xpath_yang_validate_xmlkey(xmlTextReaderPtr reader, xpath_pcb_t *pcb, obj_template_t *obj, boolean logerrors)
Validate a key XML attribute value given in (XML Key)
Definition: xpath_yang.c:2756
NCX_BT_INT8
@ NCX_BT_INT8
int8
Definition: ncxtypes.h:207
xml_endnode_match
status_t xml_endnode_match(const xml_node_t *startnode, const xml_node_t *endnode)
check if a specific node is the proper endnode match for a given startnode
Definition: xml_util.c:592
xmlns.h
XML namespace support.
val_free_value
void val_free_value(val_value_t *val)
Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct it...
Definition: val.c:2842
obj_get_iqualval
ncx_iqual_t obj_get_iqualval(obj_template_t *obj)
Get the instance qualifier for this object.
Definition: obj.c:12427
status.h
Global error messages for status code enumerations.
NCX_BT_NONE
@ NCX_BT_NONE
base type not set
Definition: ncxtypes.h:201
xml_dump_node
void xml_dump_node(const xml_node_t *node, log_debug_t lvl)
Debug function to printf xml_node_t contents.
Definition: xml_util.c:661
obj_get_nsid
xmlns_id_t obj_get_nsid(const obj_template_t *obj)
Get the namespace ID for this object.
Definition: obj.c:12395
dlq.h
dlq provides general double-linked list and queue support:
op_editop_id
op_editop_t op_editop_id(const xmlChar *opstr)
Get the ID for the editop from its keyword.
Definition: op.c:146
ncx_get_xmlorder
boolean ncx_get_xmlorder(void)
Get the xmlorder flag.
Definition: ncx.c:15047
xml_node_match
status_t xml_node_match(const xml_node_t *node, xmlns_id_t nsid, const xmlChar *elname, xml_nodetyp_t nodetyp)
check if a specific node is the proper owner, name, and type
Definition: xml_util.c:545
xml_consume_node
status_t xml_consume_node(xmlTextReaderPtr reader, xml_node_t *xmlnode, boolean nserr, boolean adv)
parse function for YIN input
Definition: xml_util.c:2447
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
xmlns_origin_id
xmlns_id_t xmlns_origin_id(void)
Get the ID for the ietf-origin namespace or 0 if it doesn't exist.
Definition: xmlns.c:1108
NCX_BT_INT16
@ NCX_BT_INT16
int16
Definition: ncxtypes.h:208