yumapro  20.10-12
YumaPro SDK
xpath1.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_xpath1
13 #define _H_xpath1
14 
15 /* FILE: xpath1.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 #ifndef _H_dlq
40 #include "dlq.h"
41 #endif
42 
43 #ifndef _H_getcb
44 #include "getcb.h"
45 #endif
46 
47 #ifndef _H_ncxtypes
48 #include "ncxtypes.h"
49 #endif
50 
51 #ifndef _H_obj
52 #include "obj.h"
53 #endif
54 
55 #ifndef _H_status_enum
56 #include "status_enum.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 #ifndef _H_xpath
68 #include "xpath.h"
69 #endif
70 
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74 
75 /********************************************************************
76 * *
77 * C O N S T A N T S *
78 * *
79 *********************************************************************/
80 
81 
96 #define SET_SKIP_MODE(pcb) (pcb)->flags |= XP_FL_SKIP_MODE
97 
99 #define CLEAR_SKIP_MODE(pcb) (pcb)->flags &= ~XP_FL_SKIP_MODE
100 
102 #define IS_SKIP_MODE(pcb) ((pcb)->flags & XP_FL_SKIP_MODE)
103 
104 
105 /********************************************************************
106 * *
107 * T Y P E S *
108 * *
109 *********************************************************************/
110 
111 /********************************************************************
112 * *
113 * F U N C T I O N S *
114 * *
115 *********************************************************************/
116 
117 
154 extern status_t
155  xpath1_parse_expr (tk_chain_t *tkc,
156  ncx_module_t *mod,
157  xpath_pcb_t *pcb,
158  xpath_source_t source);
159 
160 
186 extern status_t
187  xpath1_validate_expr (ncx_module_t *mod,
188  obj_template_t *obj,
189  xpath_pcb_t *pcb);
190 
191 
225 extern status_t
226  xpath1_validate_expr_ex (ncx_module_t *mod,
227  obj_template_t *obj,
228  xpath_pcb_t *pcb,
229  boolean missing_is_error,
230  boolean set_backptrs,
231  ncx_xpath_type_t backptr_type);
232 
233 
262 extern xpath_result_t *
263  xpath1_eval_expr (xpath_pcb_t *pcb,
264  val_value_t *val,
265  val_value_t *docroot,
266  boolean logerrors,
267  boolean configonly,
268  status_t *res);
269 
270 
300 extern xpath_result_t *
301  xpath1_eval_expr2 (xpath_pcb_t *pcb,
302  val_value_t *val,
303  val_value_t *docroot,
304  boolean logerrors,
305  boolean configonly,
306  boolean force_only,
307  status_t *res);
308 
309 
343 extern xpath_result_t *
344  xpath1_eval_expr3 (xpath_pcb_t *pcb,
345  val_value_t *val,
346  val_value_t *docroot,
347  boolean logerrors,
348  boolean configonly,
349  boolean force_only,
350  xml_msg_hdr_t *get2_mhdr,
351  boolean get_when,
352  xpath_get2_node_t *val_get2,
353  status_t *res);
354 
355 
369 extern status_t
370  xpath1_test_data_rule (xpath_pcb_t *pcb,
371  getcb_get2_t *get2cb,
372  boolean *testres);
373 
374 
406 extern xpath_result_t *
407  xpath1_eval_xmlexpr (xmlTextReaderPtr reader,
408  xpath_pcb_t *pcb,
409  val_value_t *val,
410  val_value_t *docroot,
411  boolean logerrors,
412  boolean configonly,
413  status_t *res);
414 
415 
427 extern void
428  xpath1_prune_nodeset (xpath_pcb_t *pcb,
429  xpath_result_t *result);
430 
431 
448 extern boolean
449  xpath1_check_node_exists (xpath_pcb_t *pcb,
450  dlq_hdr_t *resultQ,
451  const val_value_t *val);
452 
453 
471 extern boolean
472  xpath1_check_node_exists_slow (xpath_pcb_t *pcb,
473  dlq_hdr_t *resultQ,
474  const val_value_t *val);
475 
476 
493 extern boolean
494  xpath1_check_resnode_exists (xpath_pcb_t *pcb,
495  dlq_hdr_t *resultQ,
496  xpath_resnode_t *resnode);
497 
498 
512 extern status_t
513  xpath1_stringify_nodeset (xpath_pcb_t *pcb,
514  const xpath_result_t *result,
515  xmlChar **str);
516 
517 
529 extern status_t
530  xpath1_stringify_node (xpath_pcb_t *pcb,
531  val_value_t *val,
532  xmlChar **str);
533 
534 
547 extern boolean
548  xpath1_compare_result_to_string (xpath_pcb_t *pcb,
549  xpath_result_t *result,
550  xmlChar *strval,
551  status_t *res);
552 
553 
567 extern boolean
568  xpath1_compare_result_to_number (xpath_pcb_t *pcb,
569  xpath_result_t *result,
570  ncx_num_t *numval,
571  status_t *res);
572 
573 
587 extern boolean
588  xpath1_compare_nodeset_results (xpath_pcb_t *pcb,
589  xpath_result_t *result1,
590  xpath_result_t *result2,
591  status_t *res);
592 
593 
601 extern boolean
602  xpath1_find_val_in_nodeset (xpath_result_t *result,
603  const xmlChar *valstr);
604 
605 
616 extern boolean
617  xpath1_find_val_in_nodeset_ex (xpath_result_t *result,
618  val_value_t *testval);
619 
620 
636 extern xpath_result_t *
637  xpath1_parse_expr_int (xpath_pcb_t *pcb,
638  status_t *res);
639 
640 
651 extern xpath_result_t *
652  xpath1_parse_relational_expr_int (xpath_pcb_t *pcb,
653  status_t *res);
654 
668 extern boolean
669  xpath1_keep_object (obj_template_t *testobj,
670  boolean textmode,
671  xmlns_id_t nsid,
672  const xmlChar *name);
673 
674 
685 extern void
686  xpath1_dump_result (log_debug_t lvl,
687  xpath_pcb_t *pcb,
688  xpath_result_t *result,
689  const char *banner);
690 
691 
692 
702 extern void
703  xpath1_dump_resnode (log_debug_t lvl,
704  xpath_resnode_t *resnode,
705  const char *banner);
706 
710 #ifdef __cplusplus
711 } /* end extern 'C' */
712 #endif
713 
714 
715 #endif /* _H_xpath1 */
xpath1_get2.h
XPath 1.0 expression support for server GET2 callback functions.
XP_AX_ATTRIBUTE
@ XP_AX_ATTRIBUTE
attribute axis
Definition: ncxtypes.h:492
XP_FORM_GETCB
@ XP_FORM_GETCB
normal GET2 CB
Definition: xpath.h:448
XP_EXOP_EQUAL
@ XP_EXOP_EQUAL
equals '='
Definition: xpath.h:388
TK_CUR
#define TK_CUR(T)
return the current token
Definition: tk.h:122
xpath_get_resnode_obj
obj_template_t * xpath_get_resnode_obj(xpath_resnode_t *resnode)
Get the resnode object pointer from a value resnode.
Definition: xpath.c:4050
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
xml_strlen
uint32 xml_strlen(const xmlChar *str)
Get the String len for xmlChar.
Definition: xml_util.c:1406
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
obj_is_uses
boolean obj_is_uses(const obj_template_t *obj)
Check if object is a YANG uses-stmt.
Definition: obj.c:13465
NCX_NF_OCTAL
@ NCX_NF_OCTAL
YANG octal format.
Definition: ncxtypes.h:334
val_child_find_all_pfaxis
boolean val_child_find_all_pfaxis(val_walker2_fn_t walkerfn, void *cookie1, void *cookie2, val_value_t *startnode, xmlns_id_t mod_nsid, const xmlChar *name, boolean configonly, boolean dblslash, boolean textmode, ncx_xpath_axis_t axis)
Find all occurances of the specified node for the specified preceding or following axis.
Definition: val_child.c:3055
ncx_feature.h
NCX Module Library YANG Feature Utility Functions.
obj_find_all_descendants
boolean obj_find_all_descendants(ncx_module_t *exprmod, obj_walker_fn_t walkerfn, void *cookie1, void *cookie2, obj_template_t *startnode, const xmlChar *modname, const xmlChar *name, boolean configonly, boolean textmode, boolean useroot, boolean orself, boolean *fncalled)
Find all occurances of the specified node(s) within the descendants of the current node.
Definition: obj.c:7700
TK_TT_PLUS
@ TK_TT_PLUS
plus mark '+'
Definition: tk.h:298
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
dlq_block_enque
void dlq_block_enque(dlq_hdrT *srcP, dlq_hdrT *dstP)
add all the queue entries in the srcP queue list to the end of the dstP queue list
Definition: dlq.c:731
XP_RT_NUMBER
@ XP_RT_NUMBER
number result
Definition: xpath.h:348
ERR_NCX_NO_XPATH_DESCENDANT
@ ERR_NCX_NO_XPATH_DESCENDANT
1033
Definition: status_enum.h:522
xpath1_parse_expr
status_t xpath1_parse_expr(tk_chain_t *tkc, ncx_module_t *mod, xpath_pcb_t *pcb, xpath_source_t source)
Parse the XPATH 1.0 expression string.
Definition: xpath1.c:4816
ncx_need_get2_xpath
boolean ncx_need_get2_xpath(void)
Check if GET2 callback support needed in XPath.
Definition: ncx.c:13652
xpath_first_resnode_valptr
val_value_t * xpath_first_resnode_valptr(xpath_resnode_t *resnode)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:3982
xpath_clean_result
void xpath_clean_result(xpath_result_t *result)
Clean an XPath result struct.
Definition: xpath.c:3135
XP_AX_PARENT
@ XP_AX_PARENT
parent axis
Definition: ncxtypes.h:507
tk_get_token_name
const char * tk_get_token_name(tk_type_t ttyp)
Get the symbolic token name.
Definition: tk.c:3280
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
ncx_warning_enabled
boolean ncx_warning_enabled(status_t res)
Check if a specific status_t code is enabled.
Definition: ncx.c:9394
def_reg_find_ns
xmlns_t * def_reg_find_ns(const xmlChar *nsname)
find one xmlns_t in the registry find a xmlns_t by its value (name)
Definition: def_reg.c:397
xpath1_res_new_valhdr_resnode
xpath_resnode_t * xpath1_res_new_valhdr_resnode(xpath_pcb_t *pcb, boolean dblslash, val_child_hdr_t *valhdr)
Get a new result node from the cache or malloc if none available.
Definition: xpath1_res.c:380
xpath_next_resnode_valptr
val_value_t * xpath_next_resnode_valptr(xpath_resnode_t *resnode, val_value_t *valptr)
Get the next node val pointer from a result node struct.
Definition: xpath.c:4017
xpath1_dump_result
void xpath1_dump_result(log_debug_t lvl, xpath_pcb_t *pcb, xpath_result_t *result, const char *banner)
Generate log output displaying the contents of a result.
Definition: xpath1.c:6737
XP_AX_PRECEDING_SIBLING
@ XP_AX_PRECEDING_SIBLING
preceding-sibling axis (not allowed in YANG)
Definition: ncxtypes.h:513
xpath1_compare_result_to_number
boolean xpath1_compare_result_to_number(xpath_pcb_t *pcb, xpath_result_t *result, ncx_num_t *numval, status_t *res)
Compare an XPath result to the specified number.
Definition: xpath1.c:6380
VAL_NSID
#define VAL_NSID(V)
Access the namespace ID.
Definition: val.h:396
ERR_NCX_DEF_NOT_FOUND
@ ERR_NCX_DEF_NOT_FOUND
250
Definition: status_enum.h:289
TK_TT_COMMA
@ TK_TT_COMMA
comma ','
Definition: tk.h:293
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.
TK_TT_STAR
@ TK_TT_STAR
star '*'
Definition: tk.h:296
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_in_augment
boolean obj_in_augment(const obj_template_t *obj)
Check if object is an augment or inside an augment CHECK ENTIRE TREE UP TO ROOT.
Definition: obj.c:13716
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
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
obj_has_text_content
boolean obj_has_text_content(const obj_template_t *obj)
Check if the specified object type has a text content for XPath purposes.
Definition: obj.c:10719
obj_find_all_children
boolean obj_find_all_children(ncx_module_t *exprmod, obj_walker_fn_t walkerfn, void *cookie1, void *cookie2, obj_template_t *startnode, const xmlChar *modname, const xmlChar *childname, boolean configonly, boolean textmode, boolean useroot)
Find all occurances of the specified node(s) within the children of the current node.
Definition: obj.c:7296
XP_FL_CONFIGONLY
#define XP_FL_CONFIGONLY
used for YANG/NETCONF to auto-filter any non-config nodes that are matched by an XPath wildcard mecha...
Definition: xpath.h:221
val_child_find_all_children
boolean val_child_find_all_children(val_walker2_fn_t walkerfn, void *cookie1, void *cookie2, val_value_t *startnode, xmlns_id_t mod_nsid, const xmlChar *name, boolean configonly, boolean textmode)
Find all children instances of the specified node(s) The walker fn will be called for each match.
Definition: val_child.c:2596
tk_next_val
const xmlChar * tk_next_val(tk_chain_t *tkc)
Get the token type of the next token.
Definition: tk.c:3464
val_child_find_all_descendants
boolean val_child_find_all_descendants(val_walker2_fn_t walkerfn, void *cookie1, void *cookie2, val_value_t *startnode, xmlns_id_t mod_nsid, const xmlChar *name, boolean configonly, boolean textmode, boolean orself, boolean forceall)
Find all occurances of the specified node within the current subtree.
Definition: val_child.c:2785
ncx_set_num_nan
void ncx_set_num_nan(ncx_num_t *num, ncx_btype_t btyp)
Set a FP number to the Not a Number value.
Definition: ncx_num.c:592
XP_AX_FOLLOWING
@ XP_AX_FOLLOWING
following axis (not allowed in YANG)
Definition: ncxtypes.h:498
XP_EXNT_TEXT
@ XP_EXNT_TEXT
text node
Definition: xpath.h:412
NCX_BT_IDREF
@ NCX_BT_IDREF
identityref
Definition: ncxtypes.h:222
obj_is_rpcio_input
boolean obj_is_rpcio_input(const obj_template_t *obj)
Check if the object is an RPC IO node.
Definition: obj.c:14009
getcb.h
GET1 and GET2 Callback Support.
obj_find_all_ancestors
boolean obj_find_all_ancestors(ncx_module_t *exprmod, obj_walker_fn_t walkerfn, void *cookie1, void *cookie2, obj_template_t *startnode, const xmlChar *modname, const xmlChar *name, boolean configonly, boolean textmode, boolean useroot, boolean orself, boolean *fncalled)
Find all occurances of the specified node(s) within the ancestors of the current node.
Definition: obj.c:7507
obj_in_abstract
boolean obj_in_abstract(const obj_template_t *obj)
Check if object is being used as an object identifier or error-info CHECK ENTIRE TREE UP TO ROOT.
Definition: obj.c:14305
XP_AX_ANCESTOR_OR_SELF
@ XP_AX_ANCESTOR_OR_SELF
ancestor-or-self axis
Definition: ncxtypes.h:491
ERR_NCX_EMPTY_XPATH_RESULT
@ ERR_NCX_EMPTY_XPATH_RESULT
1029
Definition: status_enum.h:518
TK_CUR_LNUM
#define TK_CUR_LNUM(T)
return the current line number
Definition: tk.h:179
xpath_cvt_boolean
boolean xpath_cvt_boolean(const xpath_result_t *result)
Convert an XPath result to a boolean answer.
Definition: xpath.c:3630
status_enum.h
global error status code enumerations
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
typ_is_number
boolean typ_is_number(ncx_btype_t btyp)
Check if the base type is numeric.
Definition: typ.c:4063
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.
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.
tk_dump_chain
void tk_dump_chain(const tk_chain_t *tkc)
Debug printf the token chain !!! Very verbose !!!
Definition: tk.c:3532
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
ncx_num.h
NCX Module Library Number Utility Functions.
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
XP_DOC_NOTIFICATION
@ XP_DOC_NOTIFICATION
notification context
Definition: xpath.h:366
XP_EXNT_COMMENT
@ XP_EXNT_COMMENT
comment node
Definition: xpath.h:411
val_compare
int32 val_compare(const val_value_t *val1, const val_value_t *val2)
Compare 2 val_value_t struct value contents.
Definition: val.c:9456
XP_EXNT_NONE
@ XP_EXNT_NONE
not set
Definition: xpath.h:410
TK_TT_RNUM
@ TK_TT_RNUM
real number
Definition: tk.h:333
VAL_CHILD_HDR_COUNT
#define VAL_CHILD_HDR_COUNT(H)
Access the instance count field in a child header.
Definition: val.h:675
ncx_init_num
void ncx_init_num(ncx_num_t *num)
Init a ncx_num_t struct.
Definition: ncx_num.c:162
XP_EXOP_NONE
@ XP_EXOP_NONE
not set
Definition: xpath.h:385
XP_RNT_GET2
@ XP_RNT_GET2
get2ptr
Definition: xpath.h:426
xpath1_stringify_nodeset
status_t xpath1_stringify_nodeset(xpath_pcb_t *pcb, const xpath_result_t *result, xmlChar **str)
Convert a value node pointer to a string node.
Definition: xpath1.c:6081
XP_FL_GET_WHEN
#define XP_FL_GET_WHEN
the parser is processing a when-stmt for a GET node so retrieve the value now instead of leaving the ...
Definition: xpath.h:277
xpath1_cmp.h
XPath 1.0 expression support; Compare utilities.
VAL_NAME
#define VAL_NAME(V)
Access the value name.
Definition: val.h:399
ncxconst.h
Contains NCX constants.
XP_SRC_YANG
@ XP_SRC_YANG
YANG must or when.
Definition: xpath.h:376
TK_TT_SQSTRING
@ TK_TT_SQSTRING
single quoted string
Definition: tk.h:323
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
XP_EXOP_ADD
@ XP_EXOP_ADD
plus sign '+'
Definition: xpath.h:394
XP_RT_STRING
@ XP_RT_STRING
string result
Definition: xpath.h:349
TK_ADV
#define TK_ADV(T)
advance the current token pointer
Definition: tk.h:107
XP_FL_TOP_RPC_INPUT
#define XP_FL_TOP_RPC_INPUT
set if starting context node is RPC input which is allowed in YANG 1.1
Definition: xpath.h:247
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
xpath1_res_new_nodeset
xpath_result_t * xpath1_res_new_nodeset(xpath_pcb_t *pcb, obj_template_t *obj, val_value_t *val, boolean dblslash)
Create a new nodeset.
Definition: xpath1_res.c:545
val_is_virtual
boolean val_is_virtual(const val_value_t *val)
Check if the specified value is a virtual value such that a 'get' callback function is required to ac...
Definition: val.c:11260
ERR_NCX_UNKNOWN_PARM
@ ERR_NCX_UNKNOWN_PARM
227
Definition: status_enum.h:266
TK_CUR_VAL
#define TK_CUR_VAL(T)
return the current token value
Definition: tk.h:128
val_child_find_all_pfsibling_axis
boolean val_child_find_all_pfsibling_axis(val_walker2_fn_t walkerfn, void *cookie1, void *cookie2, val_value_t *startnode, xmlns_id_t mod_nsid, const xmlChar *name, boolean configonly, boolean dblslash, boolean textmode, ncx_xpath_axis_t axis)
Find all occurances of the specified node for the specified axis.
Definition: val_child.c:3186
TK_CUR_LPOS
#define TK_CUR_LPOS(T)
return the current line position
Definition: tk.h:182
XP_EXOP_GEQUAL
@ XP_EXOP_GEQUAL
r.
Definition: xpath.h:393
NCX_NF_DEC
@ NCX_NF_DEC
YANG deciaml format.
Definition: ncxtypes.h:335
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
dlq_insertAhead
void dlq_insertAhead(void *newP, void *nodeP)
insert the new queue entry before the current entry
Definition: dlq.c:447
XP_EXOP_SUBTRACT
@ XP_EXOP_SUBTRACT
minus '-'
Definition: xpath.h:395
obj_exit_xpath_mode
void obj_exit_xpath_mode(void)
Exit xpath mode and stop ignoring obj_is_enabled.
Definition: obj.c:17608
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
xpath1_compare_result_to_string
boolean xpath1_compare_result_to_string(xpath_pcb_t *pcb, xpath_result_t *result, xmlChar *strval, status_t *res)
Compare an XPath result to the specified string.
Definition: xpath1.c:6328
ncx_warning_elevated
boolean ncx_warning_elevated(status_t res)
Check if a specific status_t code is elevated.
Definition: ncx.c:9439
NCX_NF_NONE
@ NCX_NF_NONE
not set
Definition: ncxtypes.h:333
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.
obj_is_notif
boolean obj_is_notif(const obj_template_t *obj)
Check if the object is a notification.
Definition: obj.c:14083
xpath1.h
XPath 1.0 expression support.
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
obj_in_action
boolean obj_in_action(const obj_template_t *obj)
Check if the object is within or is an action method.
Definition: obj.c:14041
XP_EXOP_DIV
@ XP_EXOP_DIV
keyword 'div'
Definition: xpath.h:397
TK_TT_LEQUAL
@ TK_TT_LEQUAL
less than or equal '<='
Definition: tk.h:311
def_reg.h
Definition Registry module.
xpath_aio_cb_t_::obj
obj_template_t * obj
object for this subtree
Definition: xpath.h:1035
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
XP_EXNT_NODE
@ XP_EXNT_NODE
XML start, empty, or end tag.
Definition: xpath.h:414
val_convert_leafref
val_value_t * val_convert_leafref(const val_value_t *val)
Convert a value of type NCX_BT_LEAFREF to the value that the final leafref is pointing at.
Definition: val.c:14761
xpath1_res_malloc_failed_error
void xpath1_res_malloc_failed_error(xpath_pcb_t *pcb)
Generate a malloc failed error if OK.
Definition: xpath1_res.c:125
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
NCX_NF_REAL
@ NCX_NF_REAL
internal format for XPath
Definition: ncxtypes.h:337
xpath1_res_new_obj_resnode
xpath_resnode_t * xpath1_res_new_obj_resnode(xpath_pcb_t *pcb, boolean dblslash, obj_template_t *objptr)
Get a new result node from the cache or malloc if none available.
Definition: xpath1_res.c:270
var_get_que_raw
ncx_var_t * var_get_que_raw(dlq_hdr_t *varQ, xmlns_id_t nsid, const xmlChar *name)
Find a Q-based user variable; return the var struct instead of just the value.
Definition: var.c:1839
obj_in_notif
boolean obj_in_notif(const obj_template_t *obj)
Check if the object is in a notification.
Definition: obj.c:13952
TK_TT_DBLFSLASH
@ TK_TT_DBLFSLASH
2 fwd slashes '//'
Definition: tk.h:309
val_get_nsid
xmlns_id_t val_get_nsid(const val_value_t *val)
Get the namespace ID for the specified value node.
Definition: val.c:12277
TK_CUR_MOD
#define TK_CUR_MOD(T)
return the current token module qualifier value
Definition: tk.h:134
xpath_cvt_number
void xpath_cvt_number(const xpath_result_t *result, ncx_num_t *num)
Convert an XPath result to a number answer.
Definition: xpath.c:3690
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
TK_TT_DBLCOLON
@ TK_TT_DBLCOLON
2 colon chars '::'
Definition: tk.h:308
xpath1_pred_parse_predicate
status_t xpath1_pred_parse_predicate(xpath_pcb_t *pcb, xpath_result_t **result)
Parse an XPath Predicate sequence It has already been tokenized.
Definition: xpath1_pred.c:1422
xpath_aio_cb_t_::parent_cb
struct xpath_aio_cb_t_ * parent_cb
parent AIO control block
Definition: xpath.h:1032
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
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
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
xpath1_find_val_in_nodeset_ex
boolean xpath1_find_val_in_nodeset_ex(xpath_result_t *result, val_value_t *testval)
Check a nodeset result and find the same value in one of the nodes.
Definition: xpath1.c:6519
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
xpath1_eval_expr
xpath_result_t * xpath1_eval_expr(xpath_pcb_t *pcb, val_value_t *val, val_value_t *docroot, boolean logerrors, boolean configonly, status_t *res)
Evaluate an XPath expression use if the prefixes are YANG: must/when.
Definition: xpath1.c:5293
XP_EXOP_MOD
@ XP_EXOP_MOD
keyword 'mod'
Definition: xpath.h:398
val_child_hdr_next
val_value_t * val_child_hdr_next(const val_child_hdr_t *hdr, const val_value_t *curval)
Get the next entry in the child header.
Definition: val_child.c:3827
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
XP_EXOP_GT
@ XP_EXOP_GT
right angle bracket '>'
Definition: xpath.h:391
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
ncx_set_num_zero
void ncx_set_num_zero(ncx_num_t *num, ncx_btype_t btyp)
Set a number to zero.
Definition: ncx_num.c:542
XP_FL_KEEP_RESULT
#define XP_FL_KEEP_RESULT
set if the caller wants the test result to be kept will free pcb->result if already set when trying t...
Definition: xpath.h:268
XPATH_ANY_CXT
#define XPATH_ANY_CXT(P)
test if context node is a value or get2 in xpath_pcb_t * (P)
Definition: xpath.h:313
XP_RT_NONE
@ XP_RT_NONE
not set
Definition: xpath.h:346
xpath1_parse_expr_int
xpath_result_t * xpath1_parse_expr_int(xpath_pcb_t *pcb, status_t *res)
Parse an XPath Expr sequence It has already been tokenized.
Definition: xpath1.c:6644
ncx_skip_child_node_warn
boolean ncx_skip_child_node_warn(const xmlChar *modname)
Internal compiler check to suppress warnings.
Definition: ncx.c:14250
obj_enter_xpath_mode
void obj_enter_xpath_mode(void)
Enter xpath mode and start ignoring obj_is_enabled.
Definition: obj.c:17599
obj_in_rpc_reply
boolean obj_in_rpc_reply(const obj_template_t *obj)
Check if the object is in an rpc-reply/output section.
Definition: obj.c:13918
XP_AX_NAMESPACE
@ XP_AX_NAMESPACE
namespace axis (not allowed in YANG)
Definition: ncxtypes.h:504
NCX_BT_EMPTY
@ NCX_BT_EMPTY
empty
Definition: ncxtypes.h:205
xpath1_check_node_exists_slow
boolean xpath1_check_node_exists_slow(xpath_pcb_t *pcb, dlq_hdr_t *resultQ, const val_value_t *val)
Check if any ancestor-ot-self node is already in the specified Q Slow version.
Definition: xpath1.c:5927
xpath1_res_free_resnode
void xpath1_res_free_resnode(xpath_pcb_t *pcb, xpath_resnode_t *resnode)
Free a result node struct: put in cache or free if cache maxed out.
Definition: xpath1_res.c:495
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
xpath_init_result
void xpath_init_result(xpath_result_t *result, xpath_restype_t restype)
Initialize an XPath result struct.
Definition: xpath.c:3066
IS_SKIP_MODE
#define IS_SKIP_MODE(pcb)
Check if skip mode is active.
Definition: xpath1.h:102
XP_RNT_OBJ
@ XP_RNT_OBJ
objnode
Definition: xpath.h:423
val_dump_value_ex
void val_dump_value_ex(val_value_t *val, int32 startindent, ncx_display_mode_t display_mode, 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:5721
NCX_XPATH_TYPE_NACM
@ NCX_XPATH_TYPE_NACM
NACM data rule.
Definition: ncxtypes.h:1023
val_child.h
Value Node Child Access Support.
xpath1_dump_resnode
void xpath1_dump_resnode(log_debug_t lvl, xpath_resnode_t *resnode, const char *banner)
Generate log output displaying the contents of an XPath resnode.
Definition: xpath1.c:6829
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
XP_EXOP_MULTIPLY
@ XP_EXOP_MULTIPLY
asterisk '*'
Definition: xpath.h:396
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
XP_EXOP_LEQUAL
@ XP_EXOP_LEQUAL
l.
Definition: xpath.h:392
ERR_NCX_NO_XPATH_CHILD
@ ERR_NCX_NO_XPATH_CHILD
1032
Definition: status_enum.h:521
log_debug
void void void void void void void log_debug(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG log entry.
XP_AX_NONE
@ XP_AX_NONE
not set
Definition: ncxtypes.h:489
xpath1_validate_expr_ex
status_t xpath1_validate_expr_ex(ncx_module_t *mod, obj_template_t *obj, xpath_pcb_t *pcb, boolean missing_is_error, boolean set_backptrs, ncx_xpath_type_t backptr_type)
Validate the previously parsed expression string.
Definition: xpath1.c:4975
TK_TT_MINUS
@ TK_TT_MINUS
minus char '-'
Definition: tk.h:302
typ.h
Parameter Type Handler.
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
xpath1_res_add_resnode
void xpath1_res_add_resnode(xpath_resnode_t *resnode, xpath_result_t *result)
Add the specified resnode to the result.
Definition: xpath1_res.c:904
TK_TT_NOTEQUAL
@ TK_TT_NOTEQUAL
not equal '!='
Definition: tk.h:310
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
TK_CUR_MODLEN
#define TK_CUR_MODLEN(T)
return the current token module qualifier value length
Definition: tk.h:137
obj_is_case
boolean obj_is_case(const obj_template_t *obj)
Check if object is a YANG case.
Definition: obj.c:13445
val_get_virtual_value
val_value_t * val_get_virtual_value(ses_cb_t *scb, val_value_t *val, status_t *res)
Get the value of a virtual value node.
Definition: val.c:11310
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
ERR_NCX_INVALID_XPATH_EXPR
@ ERR_NCX_INVALID_XPATH_EXPR
348
Definition: status_enum.h:391
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
obj_find_all_pfaxis
boolean obj_find_all_pfaxis(ncx_module_t *exprmod, obj_walker_fn_t walkerfn, void *cookie1, void *cookie2, obj_template_t *startnode, const xmlChar *modname, const xmlChar *name, boolean configonly, boolean dblslash, boolean textmode, boolean useroot, ncx_xpath_axis_t axis, boolean *fncalled)
Find all occurances of the specified preceding or following node(s).
Definition: obj.c:7882
xpath1_fn.h
XPath 1.0 expression support; Function library.
TK_TT_BAR
@ TK_TT_BAR
bar '|'
Definition: tk.h:295
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
XP_RNT_VAL
@ XP_RNT_VAL
valptr
Definition: xpath.h:424
NCX_XPATH_TYPE_NONE
@ NCX_XPATH_TYPE_NONE
not set
Definition: ncxtypes.h:1020
xpath1_validate_expr
status_t xpath1_validate_expr(ncx_module_t *mod, obj_template_t *obj, xpath_pcb_t *pcb)
Validate the previously parsed expression string.
Definition: xpath1.c:5247
xpath1_prune_nodeset
void xpath1_prune_nodeset(xpath_pcb_t *pcb, xpath_result_t *result)
Check the current result nodeset and remove any redundant nodes from a NETCONF POV.
Definition: xpath1.c:5770
ncx_get_display_mode
ncx_display_mode_t ncx_get_display_mode(void)
Get the current default display mode.
Definition: ncx.c:9816
xpath1_eval_expr2
xpath_result_t * xpath1_eval_expr2(xpath_pcb_t *pcb, val_value_t *val, val_value_t *docroot, boolean logerrors, boolean configonly, boolean force_only, status_t *res)
Evaluate an XPath expression (alt)
Definition: xpath1.c:5347
SET_SKIP_MODE
#define SET_SKIP_MODE(pcb)
Set the current skip mode active used only by internal xpath1_pred.c XPath requires that AND and OR e...
Definition: xpath1.h:96
XPATH_GET_RESTYPE
#define XPATH_GET_RESTYPE(R)
get the result type from xpath_result_t * (R)
Definition: xpath.h:301
XP_EXOP_LT
@ XP_EXOP_LT
left angle bracket '<'
Definition: xpath.h:390
xpath1_parse_relational_expr_int
xpath_result_t * xpath1_parse_relational_expr_int(xpath_pcb_t *pcb, status_t *res)
Parse an XPath Relational Expr sequence It has already been tokenized.
Definition: xpath1.c:6671
ERR_NCX_OPERATION_NOT_SUPPORTED
@ ERR_NCX_OPERATION_NOT_SUPPORTED
273
Definition: status_enum.h:314
XP_EXNT_PROC_INST
@ XP_EXNT_PROC_INST
processing instruction
Definition: xpath.h:413
XP_AX_PRECEDING
@ XP_AX_PRECEDING
preceding axis (not allowed in YANG)
Definition: ncxtypes.h:510
xpath_get_next_resnode
xpath_resnode_t * xpath_get_next_resnode(xpath_resnode_t *resnode)
Get the next result in the renodeQ from a result struct.
Definition: xpath.c:3959
XP_DOC_DATABASE
@ XP_DOC_DATABASE
datastore context
Definition: xpath.h:363
log_debug4_append
void void void void void void void void void void void void void void log_debug4_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG4 log entry.
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
ERR_NCX_NO_XPATH_ANCESTOR
@ ERR_NCX_NO_XPATH_ANCESTOR
1030
Definition: status_enum.h:519
xpath1_stringify_node
status_t xpath1_stringify_node(xpath_pcb_t *pcb, val_value_t *val, xmlChar **str)
Convert a value node to a string node.
Definition: xpath1.c:6198
ncx_clean_num
void ncx_clean_num(ncx_btype_t btyp, ncx_num_t *num)
Scrub the memory in a ncx_num_t by freeing all the sub-fields.
Definition: ncx_num.c:189
obj_in_rpc
boolean obj_in_rpc(const obj_template_t *obj)
Check if the object is in an rpc/input section.
Definition: obj.c:13876
typ_is_simple
boolean typ_is_simple(ncx_btype_t btyp)
Check if this is a simple data type.
Definition: typ.c:3107
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
xpath1_keep_object
boolean xpath1_keep_object(obj_template_t *testobj, boolean textmode, xmlns_id_t nsid, const xmlChar *name)
Test if an object should be kept in a resnode node-test.
Definition: xpath1.c:6694
TK_TT_EQUAL
@ TK_TT_EQUAL
equal sign '='
Definition: tk.h:294
xpath_get_first_resnode
xpath_resnode_t * xpath_get_first_resnode(xpath_result_t *result)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:3931
xpath1_eval_expr3
xpath_result_t * xpath1_eval_expr3(xpath_pcb_t *pcb, val_value_t *val, val_value_t *docroot, boolean logerrors, boolean configonly, boolean force_only, xml_msg_hdr_t *get2_mhdr, boolean get_when, xpath_get2_node_t *val_get2, status_t *res)
Evaluate an XPath expression (alt3)
Definition: xpath1.c:5406
XP_AX_CHILD
@ XP_AX_CHILD
child axis (default)
Definition: ncxtypes.h:493
xpath1_res_get_count
int64 xpath1_res_get_count(xpath_result_t *result)
Get the number of entries in the node-set result to support the count() function.
Definition: xpath1_res.c:814
ERR_NCX_INVALID_INSTANCEID
@ ERR_NCX_INVALID_INSTANCEID
349
Definition: status_enum.h:392
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
VAL_BOOL
#define VAL_BOOL(V)
Access the value as a boolean ONLY IF btyp == NCX_BT_BOOLEAN.
Definition: val.h:405
xpath1_cmp_results
boolean xpath1_cmp_results(xpath_pcb_t *pcb, xpath_result_t *val1, xpath_result_t *val2, xpath_exop_t exop, status_t *res)
Compare 2 results, using the specified logic operator.
Definition: xpath1_cmp.c:1440
ERR_NCX_WRONG_NUMTYP
@ ERR_NCX_WRONG_NUMTYP
289
Definition: status_enum.h:332
val_child_find_all_ancestors
boolean val_child_find_all_ancestors(val_walker2_fn_t walkerfn, void *cookie1, void *cookie2, val_value_t *startnode, xmlns_id_t mod_nsid, const xmlChar *name, boolean configonly, boolean textmode, boolean orself)
Find all the ancestor instances of the specified node within the path to root from the current node; ...
Definition: val_child.c:2703
TK_TT_QVARBIND
@ TK_TT_QVARBIND
XPath varbind '$prefix:NCName'.
Definition: tk.h:326
obj_is_choice
boolean obj_is_choice(const obj_template_t *obj)
Check if object is a YANG choice.
Definition: obj.c:13425
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
log.h
NCX System Logging Manager.
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.
xpath1_get2_set_resnode_parent
status_t xpath1_get2_set_resnode_parent(xpath_resnode_t *resnode)
Set the resnode to its parent.
Definition: xpath1_get2.c:2002
TK_TT_LT
@ TK_TT_LT
less than char '<'
Definition: tk.h:303
tk_next_typ2
tk_type_t tk_next_typ2(tk_chain_t *tkc)
Get the token type of the token after the next token.
Definition: tk.c:3374
XP_DOC_RPC_REPLY
@ XP_DOC_RPC_REPLY
rpc-output context
Definition: xpath.h:365
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
CLEAR_SKIP_MODE
#define CLEAR_SKIP_MODE(pcb)
Clear the current skip mode.
Definition: xpath1.h:99
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
obj_is_augment
boolean obj_is_augment(const obj_template_t *obj)
Check if the obj is an augment statement.
Definition: obj.c:13703
ncx_num_zero
boolean ncx_num_zero(const ncx_num_t *num, ncx_btype_t btyp)
Compare a ncx_num_t to zero.
Definition: ncx_num.c:663
TK_TT_GEQUAL
@ TK_TT_GEQUAL
greater than or equal '>='
Definition: tk.h:312
XP_FL_USEROOT
#define XP_FL_USEROOT
used to indicate the top object node is set FALSE to indicate that all the ncx_module_t datadefQs nee...
Definition: xpath.h:227
NCX_BT_FLOAT64
@ NCX_BT_FLOAT64
hidden: just for XPath
Definition: ncxtypes.h:216
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
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
XP_RNT_VALHDR
@ XP_RNT_VALHDR
valhdr
Definition: xpath.h:425
obj_is_cli
boolean obj_is_cli(const obj_template_t *obj)
Check if object is marked as a CLI object.
Definition: obj.c:14222
TK_TT_GT
@ TK_TT_GT
greater than char '>'
Definition: tk.h:304
typ_is_string
boolean typ_is_string(ncx_btype_t btyp)
Check if the base type is a simple string (not list)
Definition: typ.c:4097
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
XP_AX_FOLLOWING_SIBLING
@ XP_AX_FOLLOWING_SIBLING
following-sibling axis (not allowed in YANG)
Definition: ncxtypes.h:501
xml_strcpy
uint32 xml_strcpy(xmlChar *copyTo, const xmlChar *copyFrom)
String copy for xmlChar.
Definition: xml_util.c:1486
xpath1_res_find_get2_resnode
xpath_resnode_t * xpath1_res_find_get2_resnode(xpath_pcb_t *pcb, dlq_hdr_t *resultQ, xpath_get2_node_t *get2node)
Check if the specified resnode ptr is already in the Q (GET2)
Definition: xpath1_res.c:1038
XP_FL_INSTANCEID
#define XP_FL_INSTANCEID
used to restrict the XPath expression to the YANG instance-identifier syntax
Definition: xpath.h:232
ERR_NCX_NO_XPATH_NODES
@ ERR_NCX_NO_XPATH_NODES
1034
Definition: status_enum.h:523
TK_TT_RANGESEP
@ TK_TT_RANGESEP
range sep, parent node '..'
Definition: tk.h:307
xpath1_check_node_exists
boolean xpath1_check_node_exists(xpath_pcb_t *pcb, dlq_hdr_t *resultQ, const val_value_t *val)
Check if any ancestor-ot-self node is already in the specified Q.
Definition: xpath1.c:5867
ncx_cast_num
status_t ncx_cast_num(const ncx_num_t *num1, ncx_btype_t btyp1, ncx_num_t *num2, ncx_btype_t btyp2)
Cast a number as another number type.
Definition: ncx_num.c:1516
val_child_hdr_first
val_value_t * val_child_hdr_first(const val_child_hdr_t *hdr)
Get the first entry in the child header.
Definition: val_child.c:3789
VAL_TYPE
#define VAL_TYPE(V)
Access the base type : same as VAL_BTYPE.
Definition: val.h:387
xpath1_check_resnode_exists
boolean xpath1_check_resnode_exists(xpath_pcb_t *pcb, dlq_hdr_t *resultQ, xpath_resnode_t *resnode)
Check if any ancestor-ot-self node is already in the specified Q.
Definition: xpath1.c:5989
XP_AX_SELF
@ XP_AX_SELF
self axis
Definition: ncxtypes.h:516
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
XPATH_GET2CB_OBJ
#define XPATH_GET2CB_OBJ(N)
access the GET2 control block object in xpath_get2_node_t (N)
Definition: xpath.h:319
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
XP_AX_ANCESTOR
@ XP_AX_ANCESTOR
ancestor axis
Definition: ncxtypes.h:490
ncx_printf_num
void ncx_printf_num(const ncx_num_t *num, ncx_btype_t btyp, log_debug_t level)
Printf a ncx_num_t contents using logging functions.
Definition: ncx_num.c:2214
ncx.h
YANG module utility functions.
XP_AX_DESCENDANT
@ XP_AX_DESCENDANT
descendant axis
Definition: ncxtypes.h:494
ncx_copy_num
status_t ncx_copy_num(const ncx_num_t *num1, ncx_num_t *num2, ncx_btype_t btyp)
Copy the contents of num1 to num2.
Definition: ncx_num.c:1451
xpath1_res_new_result
xpath_result_t * xpath1_res_new_result(xpath_pcb_t *pcb, xpath_restype_t restype)
Get a new result from the cache or malloc if none available.
Definition: xpath1_res.c:157
obj_get_level
uint32 obj_get_level(const obj_template_t *obj)
Get the nest level for the specified object Top-level is '1' Does not count groupings as a level.
Definition: obj.c:11833
obj.h
Data Object Support.
TK_CUR_TYP
#define TK_CUR_TYP(T)
return the current token type
Definition: tk.h:125
getcb_find_return_key
val_value_t * getcb_find_return_key(getcb_get2_t *get2cb, obj_template_t *obj)
Find a return keyval in the get2cb return_keyQ.
Definition: getcb.c:6253
XP_SRC_INSTANCEID
@ XP_SRC_INSTANCEID
instance-identifier
Definition: xpath.h:377
grp.h
YANG Grouping Statement Handler.
xpath1_res_find_resnode
xpath_resnode_t * xpath1_res_find_resnode(xpath_pcb_t *pcb, dlq_hdr_t *resultQ, const void *ptr)
Check if the specified resnode ptr is already in the Q.
Definition: xpath1_res.c:981
XP_FORM_GETCB_CHILD
@ XP_FORM_GETCB_CHILD
child node CB
Definition: xpath.h:450
XP_FL_ACTION_INPUT
#define XP_FL_ACTION_INPUT
set if starting context node is within action input which is allowed in YANG 1.1
Definition: xpath.h:256
xmlns_get_ns_name
const xmlChar * xmlns_get_ns_name(xmlns_id_t ns_id)
Get the name for the specified namespace.
Definition: xmlns.c:690
xpath1_get2_set_nodeset_child
status_t xpath1_get2_set_nodeset_child(xpath_pcb_t *pcb, xpath_result_t *result, xmlns_id_t childnsid, const xmlChar *childname, boolean textmode, ncx_xpath_axis_t axis)
Check the current result nodeset and replace each node with a node for every child instead.
Definition: xpath1_get2.c:1876
XP_EXOP_NOTEQUAL
@ XP_EXOP_NOTEQUAL
bang equals '!='
Definition: xpath.h:389
val_get_nest_level
uint32 val_get_nest_level(val_value_t *val)
Get the next level of the value.
Definition: val.c:12157
TK_TT_QSTRING
@ TK_TT_QSTRING
double quoted string
Definition: tk.h:322
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
XP_FORM_NONE
@ XP_FORM_NONE
not set
Definition: xpath.h:447
XPATH_VAL_CXT
#define XPATH_VAL_CXT(P)
test if context node is a value or get2 in xpath_pcb_t * (P)
Definition: xpath.h:310
TK_TT_VARBIND
@ TK_TT_VARBIND
XPath varbind '$NCName'.
Definition: tk.h:325
xpath1_res.h
XPath 1.0 expression support; result support.
XP_RT_BOOLEAN
@ XP_RT_BOOLEAN
boolean result
Definition: xpath.h:350
TK_TT_NCNAME_STAR
@ TK_TT_NCNAME_STAR
XPath NCName:* sequence.
Definition: tk.h:328
xpath_get_curmod_from_prefix_str
status_t xpath_get_curmod_from_prefix_str(const xmlChar *prefix, uint32 prefixlen, ncx_module_t *mod, ncx_module_t **targmod)
Get the correct module to use for a given prefix Unended string version.
Definition: xpath.c:3526
xpath1_get2_get_resnode_parent
void xpath1_get2_get_resnode_parent(xpath_get2_node_t *get2node, val_value_t **parentval, xpath_get2_cb_t **parent_cb)
Get the resnode parent.
Definition: xpath1_get2.c:2062
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
xpath1_res_new_cxt_nodeset
xpath_result_t * xpath1_res_new_cxt_nodeset(xpath_pcb_t *pcb, boolean dblslash)
Start a nodeset result with the current context node.
Definition: xpath1_res.c:595
val_sprintf_simval_nc
status_t val_sprintf_simval_nc(xmlChar *buff, const val_value_t *val, uint32 *len)
Sprintf the xmlChar string NETCONF representation of a simple value.
Definition: val.c:9931
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
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
VAL_STR
#define VAL_STR(V)
Access the value as a string ONLY if typ_is_string() is true.
Definition: val.h:464
ERR_NCX_NO_XPATH_PARENT
@ ERR_NCX_NO_XPATH_PARENT
1031
Definition: status_enum.h:520
XP_AX_DESCENDANT_OR_SELF
@ XP_AX_DESCENDANT_OR_SELF
descendant-or-self axis
Definition: ncxtypes.h:495
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
xpath1_res_get_resnode_name
const xmlChar * xpath1_res_get_resnode_name(const xpath_resnode_t *resnode)
Get the local-name of the resnode node.
Definition: xpath1_res.c:1305
VAL_CHILD_HDR_OBJ
#define VAL_CHILD_HDR_OBJ(H)
Access the object field in a child header.
Definition: val.h:672
val_compare_to_string
int32 val_compare_to_string(const val_value_t *val1, const xmlChar *strval2, status_t *res)
Compare a val_value_t struct value contents to a string.
Definition: val.c:9493
ERR_NCX_EXTRA_PARM
@ ERR_NCX_EXTRA_PARM
234
Definition: status_enum.h:273
TK_TT_ATSIGN
@ TK_TT_ATSIGN
at sign '@'
Definition: tk.h:297
xpath1_res_match_resnode
xpath_resnode_t * xpath1_res_match_resnode(dlq_hdr_t *resultQ, xpath_resnode_t *findnode, boolean match_exact)
Match the specified result node.
Definition: xpath1_res.c:1133
obj_assign_xpath_backptr
status_t obj_assign_xpath_backptr(obj_template_t *obj, struct xpath_pcb_t_ *xpath)
Set an xpath-expr backptr.
Definition: obj.c:16358
TK_TT_PERIOD
@ TK_TT_PERIOD
period char '.
Definition: tk.h:300
xpath1_test_data_rule
status_t xpath1_test_data_rule(xpath_pcb_t *pcb, getcb_get2_t *get2cb, boolean *testres)
Test a NACM data rule expression against a GET2 control block.
Definition: xpath1.c:5542
xpath1_pred.h
XPath 1.0 expression support; predicate support.
xpath1_res_free_result
void xpath1_res_free_result(xpath_pcb_t *pcb, xpath_result_t *result)
Free a result struct: put in cache or free if cache maxed out.
Definition: xpath1_res.c:204
xpath1_res_copy_resnode
void xpath1_res_copy_resnode(xpath_resnode_t *srcnode, xpath_resnode_t *dstnode)
Copy a resnode struct.
Definition: xpath1_res.c:1245
xpath1_compare_nodeset_results
boolean xpath1_compare_nodeset_results(xpath_pcb_t *pcb, xpath_result_t *result1, xpath_result_t *result2, status_t *res)
Compare an XPath result to another result.
Definition: xpath1.c:6431
XP_RT_NODESET
@ XP_RT_NODESET
node-set result
Definition: xpath.h:347
getcb_find_key
val_value_t * getcb_find_key(getcb_get2_t *get2cb, obj_template_t *obj)
Find an input keyval in the get2cb keyQ.
Definition: getcb.c:5994
XP_FORM_GETCB_TERM
@ XP_FORM_GETCB_TERM
terminal node CB
Definition: xpath.h:449
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
XP_DOC_NONE
@ XP_DOC_NONE
not set
Definition: xpath.h:362
XP_DOC_RPC
@ XP_DOC_RPC
rpc-input context
Definition: xpath.h:364
xpath1_find_val_in_nodeset
boolean xpath1_find_val_in_nodeset(xpath_result_t *result, const xmlChar *valstr)
Check a nodeset result and find the same value in one of the nodes.
Definition: xpath1.c:6465
log_debug3_append
void void void void void void void void void void void void log_debug3_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG3 log entry.
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
obj_set_name
status_t obj_set_name(obj_template_t *obj, const xmlChar *objname)
Set the name field for this obj.
Definition: obj.c:10574
dlq.h
dlq provides general double-linked list and queue support:
xpath1_res_get_cxt_name
const xmlChar * xpath1_res_get_cxt_name(const xpath_pcb_t *pcb)
Get the local-name of the context node.
Definition: xpath1_res.c:1286
ERR_NCX_MISSING_INSTANCE
@ ERR_NCX_MISSING_INSTANCE
350 - 13.6
Definition: status_enum.h:393
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297