yumapro  20.10-12
YumaPro SDK
xpath_yang.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_xpath_yang
13 #define _H_xpath_yang
14 
15 /* FILE: xpath_yang.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
27 /*********************************************************************
28 * *
29 * C H A N G E H I S T O R Y *
30 * *
31 *********************************************************************
32 
33 date init comment
34 ----------------------------------------------------------------------
35 13-nov-08 abb Begun
36 
37 */
38 
39 #include <xmlstring.h>
40 #include <xmlreader.h>
41 #include <xmlregexp.h>
42 
43 #ifndef _H_dlq
44 #include "dlq.h"
45 #endif
46 
47 #ifndef _H_ncxtypes
48 #include "ncxtypes.h"
49 #endif
50 
51 #ifndef _H_status
52 #include "status.h"
53 #endif
54 
55 #ifndef _H_obj
56 #include "obj.h"
57 #endif
58 
59 #ifndef _H_tk
60 #include "tk.h"
61 #endif
62 
63 #ifndef _H_val
64 #include "val.h"
65 #endif
66 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
71 /********************************************************************
72 * *
73 * F U N C T I O N S *
74 * *
75 *********************************************************************/
76 
77 
110 extern status_t
111  xpath_yang_parse_path (tk_chain_t *tkc,
112  ncx_module_t *mod,
113  xpath_source_t source,
114  xpath_pcb_t *pcb);
115 
116 
117 
146 extern status_t
147  xpath_yang_parse_path_ex (tk_chain_t *tkc,
148  ncx_module_t *mod,
149  xpath_source_t source,
150  xpath_pcb_t *pcb,
151  boolean logerrors,
152  ncx_leafref_class_t *leafref_class);
153 
154 
185 extern status_t
186  xpath_yang_parse_path_ex2 (tk_chain_t *tkc,
187  ncx_module_t *mod,
188  xpath_source_t source,
189  xpath_pcb_t *pcb,
190  boolean logerrors,
191  boolean is_xpath,
192  ncx_leafref_class_t *leafref_class);
193 
194 
195 
227 extern status_t
228  xpath_yang_validate_path (ncx_module_t *mod,
229  obj_template_t *obj,
230  xpath_pcb_t *pcb,
231  boolean schemainst,
232  obj_template_t **leafobj);
233 
234 
270 extern status_t
271  xpath_yang_validate_path_ex (ncx_module_t *mod,
272  obj_template_t *obj,
273  xpath_pcb_t *pcb,
274  boolean schemainst,
275  obj_template_t **leafobj,
276  boolean logerrors,
277  boolean is_xpath);
278 
279 
324 extern status_t
325  xpath_yang_validate_path_dev (ncx_module_t *mod,
326  obj_template_t *obj,
327  xpath_pcb_t *pcb,
328  boolean schemainst,
329  obj_template_t **leafobj,
330  boolean logerrors,
331  boolean is_xpath,
332  ncx_module_t *rootmod);
333 
334 
355 extern status_t
356  xpath_yang_validate_xmlpath (xmlTextReaderPtr reader,
357  xpath_pcb_t *pcb,
358  obj_template_t *pathobj,
359  boolean logerrors,
360  obj_template_t **targobj);
361 
362 
386 extern status_t
387  xpath_yang_validate_xmlkey (xmlTextReaderPtr reader,
388  xpath_pcb_t *pcb,
389  obj_template_t *obj,
390  boolean logerrors);
391 
392 
410 extern val_value_t *
411  xpath_yang_make_instanceid_val (xpath_pcb_t *pcb,
412  status_t *retres,
413  val_value_t **deepest);
414 
415 
437 extern status_t
438  xpath_yang_get_namespaces (const xpath_pcb_t *pcb,
439  ncx_prefix_info_t *nsid_array,
440  uint32 max_nsids,
441  uint32 *num_nsids);
442 
443 
459 extern val_value_t *
460  xpath_yang_make_instanceid_str (const xmlChar *target,
461  status_t *retres,
462  val_value_t **targval);
463 
464 
468 #ifdef __cplusplus
469 } /* end extern 'C' */
470 #endif
471 
472 #endif /* _H_xpath_yang */
ERR_NCX_NOT_CONFIG
@ ERR_NCX_NOT_CONFIG
342
Definition: status_enum.h:385
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
TK_TT_RBRACK
@ TK_TT_RBRACK
right bracket ']'
Definition: tk.h:292
xpath_yang_validate_path_ex
status_t xpath_yang_validate_path_ex(ncx_module_t *mod, obj_template_t *obj, xpath_pcb_t *pcb, boolean schemainst, obj_template_t **leafobj, boolean logerrors, boolean is_xpath)
Validate the previously parsed leafref path (extended)
Definition: xpath_yang.c:2395
TK_TT_TSTRING
@ TK_TT_TSTRING
token string
Definition: tk.h:319
tk_next_typ
tk_type_t tk_next_typ(tk_chain_t *tkc)
Get the token type of the next token.
Definition: tk.c:3349
TK_TT_DNUM
@ TK_TT_DNUM
decimal number
Definition: tk.h:331
TK_NSID
#define TK_NSID(T)
return the token namespace ID value
Definition: tk.h:101
xpath_free_pcb
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
tk_tokenize_xpath_string
tk_chain_t * tk_tokenize_xpath_string(ncx_module_t *mod, xmlChar *str, uint32 curlinenum, uint32 curlinepos, status_t *res)
The specified XPath string is parsed into tokens.
Definition: tk.c:3980
OBJ_TYP_LIST
@ OBJ_TYP_LIST
list: last real database object
Definition: obj.h:617
val_set_simval_obj
status_t val_set_simval_obj(val_value_t *val, obj_template_t *obj, const xmlChar *valstr)
Set an initialized val_value_t as a simple type.
Definition: val_util.c:4444
XPATH_DISABLED_OBJ_OK
#define XPATH_DISABLED_OBJ_OK(P)
check the disabled_obj_ok flag
Definition: xpath.h:331
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
tk_get_token_name
const char * tk_get_token_name(tk_type_t ttyp)
Get the symbolic token name.
Definition: tk.c:3280
ncx_warning_enabled
boolean ncx_warning_enabled(status_t res)
Check if a specific status_t code is enabled.
Definition: ncx.c:9394
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
xmlns_find_ns_by_prefix
xmlns_id_t xmlns_find_ns_by_prefix(const xmlChar *pfix)
Find the NS ID from its prefix.
Definition: xmlns.c:755
ERR_NCX_DEF_NOT_FOUND
@ ERR_NCX_DEF_NOT_FOUND
250
Definition: status_enum.h:289
xml_get_namespace_id
status_t xml_get_namespace_id(xmlTextReaderPtr reader, const xmlChar *prefix, uint32 prefixlen, boolean register_missing, xmlns_id_t *retnsid)
Get the namespace for the specified prefix (may be NULL) Use the current XML reader context to resolv...
Definition: xml_util.c:2360
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
typ_get_constrained
boolean typ_get_constrained(const typ_def_t *typdef)
Get the constrained true/false field for the data type leafref or instance-identifier constrained fla...
Definition: typ.c:4884
obj_is_rpc
boolean obj_is_rpc(const obj_template_t *obj)
Check if the object is an RPC method.
Definition: obj.c:13983
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_get_modname
const xmlChar * ncx_get_modname(const ncx_module_t *mod)
Get the main module name.
Definition: ncx.c:4834
val.h
Value Node Basic Support.
NCX_BT_INSTANCE_ID
@ NCX_BT_INSTANCE_ID
instance-identifier
Definition: ncxtypes.h:219
ncxmod_load_imodule
status_t ncxmod_load_imodule(const xmlChar *modname, const xmlChar *revision, yang_pcb_t *pcb, yang_parsetype_t ptyp, ncx_module_t *parent, ncx_module_t **retmod)
Load an import module (special compiler processing)
Definition: ncxmod.c:4828
ERR_NCX_MISSING_KEY
@ ERR_NCX_MISSING_KEY
383
Definition: status_enum.h:426
xpath_expr_scan_predicates
boolean xpath_expr_scan_predicates(xpath_pcb_t *pcb)
Check if any predicates parsed in the expression.
Definition: xpath.c:4916
obj_find_template_top_lrcheck
obj_template_t * obj_find_template_top_lrcheck(ncx_module_t *mod, const xmlChar *modname, const xmlChar *objname)
Check if an obj_template_t in the mod->datadefQ or any of the include files visible to this module (L...
Definition: obj.c:5998
NCX_LEAFREF_CLASS_INSTANCE
@ NCX_LEAFREF_CLASS_INSTANCE
the 'instance' class will have the same result for 1 or more instances of a specific object node (sta...
Definition: ncxtypes.h:1307
obj_next_key
obj_key_t * obj_next_key(obj_key_t *objkey)
Get the next key record.
Definition: obj.c:9559
ERR_NCX_EXTRA_VAL_INST
@ ERR_NCX_EXTRA_VAL_INST
311
Definition: status_enum.h:354
xpath_new_pcb
xpath_pcb_t * xpath_new_pcb(const xmlChar *xpathstr, xpath_getvar_fn_t getvar_fn)
malloc a new XPath parser control block
Definition: xpath.c:2739
TK_CUR_LNUM
#define TK_CUR_LNUM(T)
return the current line number
Definition: tk.h:179
xpath_parse_token
status_t xpath_parse_token(xpath_pcb_t *pcb, tk_type_t tktype)
Parse the XPath token sequence for a specific token type.
Definition: xpath.c:3579
obj_first_key
obj_key_t * obj_first_key(obj_template_t *obj)
Get the first key record.
Definition: obj.c:9472
NCX_BT_LEAFREF
@ NCX_BT_LEAFREF
leafref (needs special processing)
Definition: ncxtypes.h:221
obj_get_mod
ncx_module_t * obj_get_mod(obj_template_t *obj)
Get the module pointer for this object.
Definition: obj.c:12218
tk.h
NCX Syntax Token Handler.
obj_get_ctypdef
const typ_def_t * obj_get_ctypdef(const obj_template_t *obj)
Get the typdef for the leaf or leaf-list : Const version.
Definition: obj.c:12049
ERR_NCX_XPATH_SELF_REF
@ ERR_NCX_XPATH_SELF_REF
1057
Definition: status_enum.h:546
obj_in_submodule
boolean obj_in_submodule(obj_template_t *obj)
Check if the object is defined in a submodule.
Definition: obj.c:12259
xpath_yang_get_namespaces
status_t xpath_yang_get_namespaces(const xpath_pcb_t *pcb, ncx_prefix_info_t *nsid_array, uint32 max_nsids, uint32 *num_nsids)
Get the namespace URI IDs used in the specified XPath expression;.
Definition: xpath_yang.c:3297
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
xpath_get_modinfo_from_prefix
status_t xpath_get_modinfo_from_prefix(const xmlChar *prefix, ncx_module_t *mod, const xmlChar **modname, const xmlChar **modrev)
Get the correct module name/revision to use for a given prefix.
Definition: xpath.c:3448
ncxconst.h
Contains NCX constants.
ncxmod.h
NCX Module Load Manager.
xpath_yang_make_instanceid_val
val_value_t * xpath_yang_make_instanceid_val(xpath_pcb_t *pcb, status_t *retres, val_value_t **deepest)
Make a value subtree out of an instance-identifier Used by yangcli to send PDUs from CLI target param...
Definition: xpath_yang.c:2838
ERR_NCX_INVALID_TOKEN
@ ERR_NCX_INVALID_TOKEN
238
Definition: status_enum.h:277
ERR_NCX_WRONG_VAL
@ ERR_NCX_WRONG_VAL
232
Definition: status_enum.h:271
TK_TT_SQSTRING
@ TK_TT_SQSTRING
single quoted string
Definition: tk.h:323
XP_CM_TARGET
@ XP_CM_TARGET
target mode (normal)
Definition: xpath.h:352
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
TK_ADV
#define TK_ADV(T)
advance the current token pointer
Definition: tk.h:107
NCX_LEAFREF_CLASS_GLOBAL
@ NCX_LEAFREF_CLASS_GLOBAL
the global class will have the same result for any context node (static, absolute path) /foo/bar/baz
Definition: ncxtypes.h:1293
xpath_yang_parse_path_ex2
status_t xpath_yang_parse_path_ex2(tk_chain_t *tkc, ncx_module_t *mod, xpath_source_t source, xpath_pcb_t *pcb, boolean logerrors, boolean is_xpath, ncx_leafref_class_t *leafref_class)
Parse the leafref path as a leafref path (extended2)
Definition: xpath_yang.c:2190
ncx_print_errormsg
void ncx_print_errormsg(tk_chain_t *tkc, ncx_module_t *mod, status_t res)
Print an parse error message to STDOUT.
Definition: ncx.c:7048
TK_CUR_VAL
#define TK_CUR_VAL(T)
return the current token value
Definition: tk.h:128
TK_CUR_LPOS
#define TK_CUR_LPOS(T)
return the current line position
Definition: tk.h:182
obj_is_list
boolean obj_is_list(const obj_template_t *obj)
Check if object is a YANG list.
Definition: obj.c:13349
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
XP_SRC_XML
@ XP_SRC_XML
NETCONF select filter.
Definition: xpath.h:379
xmlns_get_module
const xmlChar * xmlns_get_module(xmlns_id_t nsid)
get the module name of the namespace ID
Definition: xmlns.c:1126
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
TK_TT_FSLASH
@ TK_TT_FSLASH
forward slash char '/'
Definition: tk.h:301
ncx_warning_elevated
boolean ncx_warning_elevated(status_t res)
Check if a specific status_t code is elevated.
Definition: ncx.c:9439
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.
obj_is_leafy
boolean obj_is_leafy(const obj_template_t *obj)
Check if object is a proper leaf or leaflist.
Definition: obj.c:13478
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
ERR_NCX_WRONG_INDEX_TYPE
@ ERR_NCX_WRONG_INDEX_TYPE
304
Definition: status_enum.h:347
TK_TT_LPAREN
@ TK_TT_LPAREN
left paren '('
Definition: tk.h:289
ERR_NCX_WRONG_TKTYPE
@ ERR_NCX_WRONG_TKTYPE
245
Definition: status_enum.h:284
val_dump_value
void val_dump_value(val_value_t *val, int32 startindent, log_debug_t lvl)
Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (...
Definition: val.c:5688
TK_CUR_MOD
#define TK_CUR_MOD(T)
return the current token module qualifier value
Definition: tk.h:134
ncx_get_temp_modQ
dlq_hdr_t * ncx_get_temp_modQ(void)
Get the temp_modQ for yangcli session-specific module list.
Definition: ncx.c:9786
XP_SRC_LEAFREF
@ XP_SRC_LEAFREF
leafref path
Definition: xpath.h:375
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
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
ncx_find_object
obj_template_t * ncx_find_object(ncx_module_t *mod, const xmlChar *objname)
Find a top level module object.
Definition: ncx.c:4345
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
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
val_util.h
Value Node Utilities.
ERR_NCX_WRONG_TYPE
@ ERR_NCX_WRONG_TYPE
231
Definition: status_enum.h:270
ncx_find_module_que_nsid
ncx_module_t * ncx_find_module_que_nsid(dlq_hdr_t *modQ, xmlns_id_t nsid)
Find a ncx_module_t in the specified Q by namespace ID.
Definition: ncx.c:3397
obj_is_rpcio
boolean obj_is_rpcio(const obj_template_t *obj)
Check if the object is an RPC IO node.
Definition: obj.c:13996
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
NCX_BT_EMPTY
@ NCX_BT_EMPTY
empty
Definition: ncxtypes.h:205
xpath_get_load_import
void * xpath_get_load_import(xpath_pcb_t *pcb)
Get the PCB in load import mode.
Definition: xpath.c:4760
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
XP_FL_SCHEMA_INSTANCEID
#define XP_FL_SCHEMA_INSTANCEID
used to restrict the XPath expression to an ncx:schema-instance string syntax
Definition: xpath.h:238
val_child.h
Value Node Child Access Support.
VAL_EMPTY
#define VAL_EMPTY(V)
Access the value as an empty ONLY IF btyp == NCX_BT_EMPTY.
Definition: val.h:408
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
typ.h
Parameter Type Handler.
TK_CUR_STR
#define TK_CUR_STR(T)
return TRUE if the current token type is a string
Definition: tk.h:140
xmlns_get_ns_prefix
const xmlChar * xmlns_get_ns_prefix(xmlns_id_t ns_id)
Get the prefix for the specified namespace.
Definition: xmlns.c:669
obj_get_real_parent
obj_template_t * obj_get_real_parent(obj_template_t *obj)
Get the parent of the current object; skip OBJ_TYP_CHOICE and OBJ_TYP_CASE.
Definition: obj.c:12733
yangconst.h
Contains YANG constants separated to prevent H file include loops.
obj_get_config_flag
boolean obj_get_config_flag(const obj_template_t *obj)
Get the config flag for an obj_template_t Return the explicit value or the inherited value Also retur...
Definition: obj.c:11174
TK_CUR_MODLEN
#define TK_CUR_MODLEN(T)
return the current token module qualifier value length
Definition: tk.h:137
ERR_NCX_MAX_KEY_CHECK
@ ERR_NCX_MAX_KEY_CHECK
1028
Definition: status_enum.h:517
obj_find_child_lrcheck
obj_template_t * obj_find_child_lrcheck(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname)
Find a child object with the specified Qname LeafRef Check VERSION.
Definition: obj.c:6156
obj_find_template_top
obj_template_t * obj_find_template_top(ncx_module_t *mod, const xmlChar *modname, const xmlChar *objname)
Check if an obj_template_t in the mod->datadefQ or any of the include files visible to this module.
Definition: obj.c:5826
ERR_NCX_EOF
@ ERR_NCX_EOF
244
Definition: status_enum.h:283
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
TK_TT_RPAREN
@ TK_TT_RPAREN
right paren ')'
Definition: tk.h:290
ncx_get_gen_root
obj_template_t * ncx_get_gen_root(void)
Get the object template for the NCX generic root container.
Definition: ncx.c:6720
ncx_find_any_object_que
obj_template_t * ncx_find_any_object_que(dlq_hdr_t *modQ, const xmlChar *objname)
Find any top-level YANG object in a module in the modQ.
Definition: ncx.c:4313
tk_reset_chain
void tk_reset_chain(tk_chain_t *tkc)
Reset the token chain current pointer to the start.
Definition: tk.c:4042
TK_TT_LBRACK
@ TK_TT_LBRACK
left bracket '['
Definition: tk.h:291
OBJ_TYP_RPC
@ OBJ_TYP_RPC
rpc-stmt
Definition: obj.h:623
NCX_BT_UNION
@ NCX_BT_UNION
union (needs special processing)
Definition: ncxtypes.h:220
xpath_yang.h
YANG-specific Xpath support.
ERR_NCX_PREFIX_NOT_FOUND
@ ERR_NCX_PREFIX_NOT_FOUND
331
Definition: status_enum.h:374
XP_FL_ABSPATH
#define XP_FL_ABSPATH
used by xpath_leafref.c to keep track of path type
Definition: xpath.h:215
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
TK_CUR_NSID
#define TK_CUR_NSID(T)
return the namespace ID field in the token
Definition: tk.h:194
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
obj_get_datadefQ
dlq_hdr_t * obj_get_datadefQ(obj_template_t *obj)
Get the datadefQ (or caseQ) if this object has one.
Definition: obj.c:11455
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
ERR_NCX_IMP_NOT_FOUND
@ ERR_NCX_IMP_NOT_FOUND
321
Definition: status_enum.h:364
TK_TT_EQUAL
@ TK_TT_EQUAL
equal sign '='
Definition: tk.h:294
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
xpath_yang_make_instanceid_str
val_value_t * xpath_yang_make_instanceid_str(const xmlChar *target, status_t *retres, val_value_t **targval)
Return the instance ID string for the target object.
Definition: xpath_yang.c:3414
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
XP_CM_KEYVAR
@ XP_CM_KEYVAR
key variable mode
Definition: xpath.h:354
TK_TT_QVARBIND
@ TK_TT_QVARBIND
XPath varbind '$prefix:NCName'.
Definition: tk.h:326
YANG_PT_IMPORT
@ YANG_PT_IMPORT
called from module import-stmt
Definition: yang.h:108
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
ERR_BUFF_OVFL
@ ERR_BUFF_OVFL
106
Definition: status_enum.h:218
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
obj_is_leaf
boolean obj_is_leaf(const obj_template_t *obj)
Check if object is a proper leaf.
Definition: obj.c:13323
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
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
xpath_yang_validate_path_dev
status_t xpath_yang_validate_path_dev(ncx_module_t *mod, obj_template_t *obj, xpath_pcb_t *pcb, boolean schemainst, obj_template_t **leafobj, boolean logerrors, boolean is_xpath, ncx_module_t *rootmod)
Validate the previously parsed leafref path (deviation)
Definition: xpath_yang.c:2465
log_error_append
void void log_error_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_ERROR log entry.
xpath_yang_parse_path_ex
status_t xpath_yang_parse_path_ex(tk_chain_t *tkc, ncx_module_t *mod, xpath_source_t source, xpath_pcb_t *pcb, boolean logerrors, ncx_leafref_class_t *leafref_class)
Parse the leafref path as a leafref path (extended)
Definition: xpath_yang.c:2133
TK_MOD
#define TK_MOD(T)
return the token prefix pointer if any
Definition: tk.h:104
XP_FL_INSTANCEID
#define XP_FL_INSTANCEID
used to restrict the XPath expression to the YANG instance-identifier syntax
Definition: xpath.h:232
TK_TT_RANGESEP
@ TK_TT_RANGESEP
range sep, parent node '..'
Definition: tk.h:307
xpath_yang_parse_path
status_t xpath_yang_parse_path(tk_chain_t *tkc, ncx_module_t *mod, xpath_source_t source, xpath_pcb_t *pcb)
Parse the leafref path as a leafref path.
Definition: xpath_yang.c:2080
ncx_find_module_by_prefix
ncx_module_t * ncx_find_module_by_prefix(const xmlChar *prefix)
Find an ncx_module_t in the ncx_sesmodQ by prefix.
Definition: ncx.c:3286
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
VAL_BTYPE
#define VAL_BTYPE(V)
Access the base type : same as VAL_TYPE.
Definition: val.h:548
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
ncx_mod_exp_err
void ncx_mod_exp_err(tk_chain_t *tkc, ncx_module_t *mod, status_t result, const char *expstr)
Print an error for wrong token, expected a different token.
Definition: ncx.c:7220
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_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
obj.h
Data Object Support.
TK_CUR_TYP
#define TK_CUR_TYP(T)
return the current token type
Definition: tk.h:125
TK_TYP
#define TK_TYP(T)
return the token type
Definition: tk.h:92
XP_SRC_INSTANCEID
@ XP_SRC_INSTANCEID
instance-identifier
Definition: xpath.h:377
ERR_NCX_DEF_LOOP
@ ERR_NCX_DEF_LOOP
325
Definition: status_enum.h:368
TK_TT_QSTRING
@ TK_TT_QSTRING
double quoted string
Definition: tk.h:322
OBJ_TYP_ACTION
@ OBJ_TYP_ACTION
not really data, YANG 1.1 only
Definition: obj.h:627
XP_CM_ALT
@ XP_CM_ALT
alternate mode
Definition: xpath.h:353
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.
TK_TT_NCNAME_STAR
@ TK_TT_NCNAME_STAR
XPath NCName:* sequence.
Definition: tk.h:328
obj_key_count
uint32 obj_key_count(const obj_template_t *obj)
Get the number of keys for this object.
Definition: obj.c:9637
ncx_find_pre_import
ncx_import_t * ncx_find_pre_import(const ncx_module_t *mod, const xmlChar *prefix)
Search the importQ for a specified prefix value.
Definition: ncx.c:5619
XP_SRC_SCHEMA_INSTANCEID
@ XP_SRC_SCHEMA_INSTANCEID
schema-instance-identifier
Definition: xpath.h:378
obj_is_data_db
boolean obj_is_data_db(const obj_template_t *obj)
Check if the object is some sort of data Constrained to only check the config DB objects,...
Definition: obj.c:13788
TK_CUR_NUM
#define TK_CUR_NUM(T)
return TRUE if the current token type is a number
Definition: tk.h:151
ncx_find_module
ncx_module_t * ncx_find_module(const xmlChar *modname, const xmlChar *revision)
Find a ncx_module_t in the ncx_sesmodQ.
Definition: ncx.c:3227
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
ERR_NCX_EXTRA_PARM
@ ERR_NCX_EXTRA_PARM
234
Definition: status_enum.h:273
xpath_yang_validate_path
status_t xpath_yang_validate_path(ncx_module_t *mod, obj_template_t *obj, xpath_pcb_t *pcb, boolean schemainst, obj_template_t **leafobj)
Validate the previously parsed leafref path.
Definition: xpath_yang.c:2335
OBJ_TYP_LEAF
@ OBJ_TYP_LEAF
leaf
Definition: obj.h:615
ERR_NCX_UNKNOWN_NAMESPACE
@ ERR_NCX_UNKNOWN_NAMESPACE
266
Definition: status_enum.h:307
NCX_BT_STRING
@ NCX_BT_STRING
string
Definition: ncxtypes.h:217
TK_TT_PERIOD
@ TK_TT_PERIOD
period char '.
Definition: tk.h:300
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
NCX_LEAFREF_CLASS_LOCAL
@ NCX_LEAFREF_CLASS_LOCAL
the object class will have the same result for any instance of a specific object node (static,...
Definition: ncxtypes.h:1299
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
xpath_get_curmod_from_prefix2
status_t xpath_get_curmod_from_prefix2(const xmlChar *prefix, ncx_module_t *mod, ncx_module_t **targmod, const xmlChar **modname)
Get the correct module to use for a given prefix Return found module name if returning not-found erro...
Definition: xpath.c:3356
xmlns.h
XML namespace support.
obj_get_typestr
const xmlChar * obj_get_typestr(const obj_template_t *obj)
Get the name of the object type.
Definition: obj.c:11392
TK_TT_MSTRING
@ TK_TT_MSTRING
module-qualified token string
Definition: tk.h:320
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_is_root
boolean obj_is_root(const obj_template_t *obj)
Check if object is marked as a root object.
Definition: obj.c:14152
status.h
Global error messages for status code enumerations.
NCX_BT_NONE
@ NCX_BT_NONE
base type not set
Definition: ncxtypes.h:201
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:
NCX_DEF_INDENT
#define NCX_DEF_INDENT
default indent amount for nesting XML or other structured output
Definition: ncxconst.h:441