40 #include <xmlstring.h> 41 #include <xmlreader.h> 42 #include <xmlregexp.h> 87 #define XPATH_RESULT_CACHE_MAX 16 90 #define XPATH_RESNODE_CACHE_MAX 64 94 #define XP_AXIS_ANCESTOR (const xmlChar *)"ancestor" 95 #define XP_AXIS_ANCESTOR_OR_SELF (const xmlChar *)"ancestor-or-self" 96 #define XP_AXIS_ATTRIBUTE (const xmlChar *)"attribute" 97 #define XP_AXIS_CHILD (const xmlChar *)"child" 98 #define XP_AXIS_DESCENDANT (const xmlChar *)"descendant" 99 #define XP_AXIS_DESCENDANT_OR_SELF (const xmlChar *)"descendant-or-self" 100 #define XP_AXIS_FOLLOWING (const xmlChar *)"following" 101 #define XP_AXIS_FOLLOWING_SIBLING (const xmlChar *)"following-sibling" 102 #define XP_AXIS_NAMESPACE (const xmlChar *)"namespace" 103 #define XP_AXIS_PARENT (const xmlChar *)"parent" 104 #define XP_AXIS_PRECEDING (const xmlChar *)"preceding" 105 #define XP_AXIS_PRECEDING_SIBLING (const xmlChar *)"preceding-sibling" 106 #define XP_AXIS_SELF (const xmlChar *)"self" 109 #define XP_FN_BOOLEAN (const xmlChar *)"boolean" 110 #define XP_FN_CEILING (const xmlChar *)"ceiling" 111 #define XP_FN_CONCAT (const xmlChar *)"concat" 112 #define XP_FN_CONTAINS (const xmlChar *)"contains" 113 #define XP_FN_COUNT (const xmlChar *)"count" 114 #define XP_FN_CURRENT (const xmlChar *)"current" 115 #define XP_FN_FALSE (const xmlChar *)"false" 116 #define XP_FN_FLOOR (const xmlChar *)"floor" 117 #define XP_FN_ID (const xmlChar *)"id" 118 #define XP_FN_LANG (const xmlChar *)"lang" 119 #define XP_FN_LAST (const xmlChar *)"last" 120 #define XP_FN_LOCAL_NAME (const xmlChar *)"local-name" 121 #define XP_FN_NAME (const xmlChar *)"name" 122 #define XP_FN_NAMESPACE_URI (const xmlChar *)"namespace-uri" 123 #define XP_FN_NORMALIZE_SPACE (const xmlChar *)"normalize-space" 124 #define XP_FN_NOT (const xmlChar *)"not" 125 #define XP_FN_NUMBER (const xmlChar *)"number" 126 #define XP_FN_POSITION (const xmlChar *)"position" 127 #define XP_FN_ROUND (const xmlChar *)"round" 128 #define XP_FN_STARTS_WITH (const xmlChar *)"starts-with" 129 #define XP_FN_STRING (const xmlChar *)"string" 130 #define XP_FN_STRING_LENGTH (const xmlChar *)"string-length" 131 #define XP_FN_SUBSTRING (const xmlChar *)"substring" 132 #define XP_FN_SUBSTRING_AFTER (const xmlChar *)"substring-after" 133 #define XP_FN_SUBSTRING_BEFORE (const xmlChar *)"substring-before" 134 #define XP_FN_SUM (const xmlChar *)"sum" 135 #define XP_FN_TRANSLATE (const xmlChar *)"translate" 136 #define XP_FN_TRUE (const xmlChar *)"true" 140 #define XP_FN_MODULE_LOADED (const xmlChar *)"module-loaded" 141 #define XP_FN_FEATURE_ENABLED (const xmlChar *)"feature-enabled" 144 #define XP_FN_REMATCH (const xmlChar *)"re-match" 145 #define XP_FN_DEREF (const xmlChar *)"deref" 146 #define XP_FN_DERIVED_FROM (const xmlChar *)"derived-from" 147 #define XP_FN_DERIVED_FROM_OR_SELF (const xmlChar *)"derived-from-or-self" 148 #define XP_FN_ENUM_VALUE (const xmlChar *)"enum-value" 149 #define XP_FN_BIT_IS_SET (const xmlChar *)"bit-is-set" 152 #define XP_NT_COMMENT (const xmlChar *)"comment" 153 #define XP_NT_TEXT (const xmlChar *)"text" 154 #define XP_NT_PROCESSING_INSTRUCTION \ 155 (const xmlChar *)"processing-instruction" 156 #define XP_NT_NODE (const xmlChar *)"node" 159 #define XP_OP_AND (const xmlChar *)"and" 160 #define XP_OP_OR (const xmlChar *)"or" 161 #define XP_OP_DIV (const xmlChar *)"div" 162 #define XP_OP_MOD (const xmlChar *)"mod" 185 #define XP_URL_ESC_WILDCARD '-' 199 #define XP_FL_DYNNODE bit0 205 #define XP_FL_SKIP_MODE bit1 211 #define XP_FL_LOAD_IMPORT bit2 215 #define XP_FL_ABSPATH bit3 221 #define XP_FL_CONFIGONLY bit4 227 #define XP_FL_USEROOT bit5 232 #define XP_FL_INSTANCEID bit6 238 #define XP_FL_SCHEMA_INSTANCEID bit7 247 #define XP_FL_TOP_RPC_INPUT bit8 256 #define XP_FL_ACTION_INPUT bit9 262 #define XP_FL_NACM_GET2 bit10 268 #define XP_FL_KEEP_RESULT bit11 272 #define XP_FL_FOUND_PRED bit12 277 #define XP_FL_GET_WHEN bit13 282 #define XP_FL_BACKPTR_CDIRTY bit0 285 #define XP_FL_BACKPTR_RDIRTY bit1 288 #define XP_FL_BACKPTR_SDIRTY bit2 298 #define XPATH_GET_TYPE(P) (P)->xpath_type 301 #define XPATH_GET_RESTYPE(R) (R)->restype 304 #define XPATH_NACM_GET2(P) ((P)->flags & XP_FL_NACM_GET2) 307 #define XPATH_NONCONFIG_WARN(P) (P)->nonconfig_warn_obj 310 #define XPATH_VAL_CXT(P) ((P)->val || (P)->val_get2) 313 #define XPATH_ANY_CXT(P) ((P)->val || (P)->val_get2 || (P)->obj) 316 #define XPATH_SCB(P) (P)->scb 319 #define XPATH_GET2CB_OBJ(N) (N)->cb->obj 322 #define XPATH_MHDR(P) (P)->mhdr 325 #define XPATH_EXPRSTR(P) (P)->exprstr 328 #define XPATH_SET_DISABLED_OBJ_OK(P) (P)->disabled_obj_ok = TRUE 331 #define XPATH_DISABLED_OBJ_OK(P) (P)->disabled_obj_ok 341 typedef enum xpath_restype_t_ {
350 typedef enum xpath_curmode_t_ {
361 typedef enum xpath_document_t_ {
373 typedef enum xpath_source_t_ {
384 typedef enum xpath_exop_t_ {
409 typedef enum xpath_nodetype_t_ {
421 typedef enum xpath_rntype_t_ {
433 typedef enum xpath_get2_state_t_ {
446 typedef enum xpath_get2_form_t_ {
471 (*xpath_getvar_fn_t) (
struct xpath_pcb_t_ *pcb,
472 const xmlChar *varname,
481 typedef struct xpath_get2_cb_t_ {
518 dlq_hdr_t return_keyQ;
519 dlq_hdr_t return_termQ;
529 typedef struct xpath_get2_node_t_ {
585 typedef struct xpath_resnode_t_ {
619 typedef struct xpath_result_t_ {
650 typedef struct xpath_pred_ent_t_ {
668 typedef struct xpath_pcb_t_ {
686 xmlTextReaderPtr reader;
827 dlq_hdr_t result_cacheQ;
833 dlq_hdr_t resnode_cacheQ;
919 dlq_hdr_t get2_aio_cbQ;
957 typedef struct xpath_fncb_t_ {
973 typedef struct xpath_walkerparms_t_ {
983 typedef struct xpath_compwalkerparms_t_ {
1011 typedef struct xpath_stringwalkerparms_t_ {
1027 typedef struct xpath_aio_cb_t_ {
1096 dlq_hdr_t *datadefQ,
1097 const xmlChar *target,
1141 dlq_hdr_t *datadefQ,
1142 const xmlChar *target,
1179 dlq_hdr_t *datadefQ,
1180 const xmlChar *target,
1240 const xmlChar *target,
1316 const xmlChar *target,
1392 const xmlChar *exprstr);
1426 xpath_restype_t restype);
1535 const xmlChar **modname);
1558 const xmlChar **modname,
1559 const xmlChar **modrev);
1937 const xmlChar *expr,
1995 extern const xmlChar *
2051 const xmlChar *keyval);
ncx_num_t * cmpnum
compare number
Definition: xpath.h:991
child node CB
Definition: xpath.h:450
status_t validateres
validation stage result
Definition: xpath.h:865
xpath_pcb_t * xpath_new_pcb_ex(const xmlChar *xpathstr, xpath_getvar_fn_t getvar_fn, void *cookie)
malloc a new XPath parser control block Extended
Definition: xpath.c:2769
xmlChar * xpath_convert_url_to_path(const xmlChar *urlpath, ncx_name_match_t match_names, boolean alt_naming, boolean wildcards, boolean withkeys, boolean fullkeys, boolean withmod, ncx_protocol_t proto, status_t *res)
Convert a URL format path to XPath format path.
Definition: xpath.c:4376
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:4019
XPath expression result.
Definition: xpath.h:619
not set
Definition: xpath.h:422
status_t xpath_get_curmod_from_prefix(const xmlChar *prefix, ncx_module_t *mod, ncx_module_t **targmod)
Get the correct module to use for a given prefix.
Definition: xpath.c:3321
dlq provides general double-linked list and queue support:
Common Encoding Message Header No longer XML specific!! Used by JSON parsing as well!! Allows common ...
Definition: xml_msg.h:351
boolean xpath_expr_has_predicates(xpath_pcb_t *pcb)
Check if any predicates parsed in the expression.
Definition: xpath.c:4899
leafref path
Definition: xpath.h:375
not set
Definition: xpath.h:447
val_value_t * valptr
result is a plain value node
Definition: xpath.h:608
notification context
Definition: xpath.h:366
NETCONF select filter.
Definition: xpath.h:379
xpath_restype_t restype
XPath result type.
Definition: xpath.h:624
Special XPath GET2 state record to be used instead of val_value_t or val_child_hdr_t pointers...
Definition: xpath.h:481
boolean backptrs_mode
must/when/data-rule obj_template_t backptr caching support backptrs in use
Definition: xpath.h:844
xpath_nodetype_t
XPath expression node types.
Definition: xpath.h:409
xpath_resnode_t context
additive XPath1 context back- pointer to current step results.
Definition: xpath.h:785
status_t res
status field to continue or exit walk
Definition: xpath.h:978
not set
Definition: xpath.h:410
processing instruction
Definition: xpath.h:413
void xpath_clear_nodeset_result(xpath_result_t *result)
Clear all the nodes from the node-set result.
Definition: xpath.c:4637
const xmlChar * name
function name
Definition: xpath.h:959
xpath_resnode_t * xpath_new_resnode(void)
Create and initialize an XPath result node struct.
Definition: xpath.c:3189
const xmlChar * xpath_get_restype_str(xpath_restype_t restype)
Get the string for the specific result type.
Definition: xpath.c:4813
YANG Module parser utilities.
xpath_rntype_t
XPath resnode union types.
Definition: xpath.h:421
status_t valueres
evaluation stage result
Definition: xpath.h:868
xpath_get2_cb_t * cb
the 'cb' is always set and is a back-pointer to the xpath_cb_t stored in the pcb get2_cbQ the 'val' p...
Definition: xpath.h:535
obj_template_t * startobj
start object set for rpc,notif validation
Definition: xpath.h:754
uint32 resnode_count
The count of entries in the resnode_cacheQ.
Definition: xpath.h:839
status_t xpath_find_schema_target(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, obj_template_t *obj, dlq_hdr_t *datadefQ, const xmlChar *target, obj_template_t **targobj, dlq_hdr_t **targQ)
Find the schema target, save in *targobj.
Definition: xpath.c:2275
xpath_get2_state_t get2_state
current state of this entry
Definition: xpath.h:485
ncx_name_match_t
Node name match modes.
Definition: ncxtypes.h:673
One YANG data-def-stmt.
Definition: obj.h:1140
void xpath_set_load_import(xpath_pcb_t *pcb, void *yang_pcb)
Set the PCB in load import mode.
Definition: xpath.c:4723
r.
Definition: xpath.h:393
obj_template_t * obj
the GET2 callback is expected to be in this object
Definition: xpath.h:488
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
keyword 'div'
Definition: xpath.h:397
xml_msg_hdr_t * mhdr
backptr to the message header in progress if processing an XPath select filter for NETCONF ...
Definition: xpath.h:899
not set
Definition: xpath.h:362
boolean xpath_cvt_boolean(const xpath_result_t *result)
Convert an XPath result to a boolean answer.
Definition: xpath.c:3630
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:3984
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
void xpath_clean_result(xpath_result_t *result)
Clean an XPath result struct.
Definition: xpath.c:3135
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:4671
status_t xpath_find_val_target(val_value_t *startval, ncx_module_t *mod, const xmlChar *target, val_value_t **targval)
Find the XPath value node target.
Definition: xpath.c:2608
void xpath_discard_resnode(xpath_resnode_t *resnode)
Discard a result node.
Definition: xpath.c:4618
Special XPath GET2 resnode.
Definition: xpath.h:529
xpath_getvar_fn_t getvar_fn
The getvar_fn callback function may be set to allow user variables to be supported in this XPath expr...
Definition: xpath.h:796
status_t xpath_add_to_result(xpath_result_t *source, xpath_result_t *target)
Move the resnodes from 1 XPath result to another.
Definition: xpath.c:4567
void xpath_free_resnode(xpath_resnode_t *resnode)
Free a malloced XPath result node struct.
Definition: xpath.c:3240
not set
Definition: xpath.h:374
number result
Definition: xpath.h:344
void xpath_move_nodeset(xpath_result_t *srcresult, xpath_result_t *destresult)
Move the nodes from a nodeset reult into the target nodeset result.
Definition: xpath.c:4196
not set
Definition: xpath.h:342
union of all the basic number types if float not supported, then it is stored as an int64 ...
Definition: ncxtypes.h:719
if the result->isval flag is false then the objptr is used in all resnodes in that result ...
Definition: xpath.h:606
tk_type_t
different types of tokens parsed during 1st pass
Definition: tk.h:279
int32 parmcnt
parameter count: -1 == N, 0..N == actual cnt
Definition: xpath.h:965
GET2 callback error happened.
Definition: xpath.h:439
void xpath_init_resnode(xpath_resnode_t *resnode)
Initialize an XPath result node struct.
Definition: xpath.c:3217
boolean disabled_obj_ok
YPW-1774: need to ignore if-feature=false while validating leafref path-stmt.
Definition: xpath.h:927
boolean xpath_predicate
true when processing a predicate
Definition: xpath.h:856
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1052
boolean xpath_expr_scan_predicates(xpath_pcb_t *pcb)
Check if any predicates parsed in the expression.
Definition: xpath.c:4918
status_t res
status of walker operation
Definition: xpath.h:1006
xpath_result_t * context_result
internal context result during processing
Definition: xpath.h:791
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
xpath_pred_ent_t * xpath_new_pred_ent(obj_template_t *keyobj, const xmlChar *keyval)
Malloc and init an XPath predicate entry struct.
Definition: xpath.c:4951
xpath_exop_t exop
relational expression operation
Definition: xpath.h:1000
minus '-'
Definition: xpath.h:395
fwd slash '/'
Definition: xpath.h:401
xmlChar * buffer
buffer for internal use
Definition: xpath.h:994
not set
Definition: xpath.h:351
ncx_errinfo_t errinfo
must-stmt error info.
Definition: xpath.h:704
obj_template_t * xpath_get_cxt_obj(xpath_pcb_t *pcb)
Get the object pointer for the context node.
Definition: xpath.c:4098
result r contains the appropiate data depending on restype
Definition: xpath.h:630
const xmlChar * keyval
backptr to token value
Definition: xpath.h:653
void * xpath_get_load_import(xpath_pcb_t *pcb)
Get the PCB in load import mode.
Definition: xpath.c:4762
boolean dblslash
double slash mode means the shorthand for the descendant-or-self axis was used
Definition: xpath.h:592
void xpath_init_result(xpath_result_t *result, xpath_restype_t restype)
Initialize an XPath result struct.
Definition: xpath.c:3066
valhdr
Definition: xpath.h:425
obj_template_t * targobj
these parms are used to parse leafref path-arg limited object tree syntax allowed only targobj is bpt...
Definition: xpath.h:720
Value Node Basic Support.
plus sign '+'
Definition: xpath.h:394
const struct xpath_fncb_t_ * functions
The function Q is a copy of the global Q It is not hardwired in case app-specific extensions are adde...
Definition: xpath.h:811
GET2 callback done.
Definition: xpath.h:438
obj_template_t * nonconfig_warn_obj
backptr to object causing nonconfig warning if that is being checked in the obj_walker_fn callback in...
Definition: xpath.h:910
text node
Definition: xpath.h:412
ncx_error_t tkerr
saved error info for the agent to process
Definition: xpath.h:871
not set
Definition: xpath.h:385
unary '-'
Definition: xpath.h:399
struct xpath_get2_node_t_ * val_get2
YPW-1342 the context node can be one of the following nodes.
Definition: xpath.h:773
tk_chain_t * tkc
token chain for exprstr, Often saved and reset each evaluation so the parse is done only once ...
Definition: xpath.h:676
uint32 flags
internal processing flags for managing XPath state
Definition: xpath.h:776
xpath_get2_state_t
GET2 retrieval states.
Definition: xpath.h:433
double fwd slash (C++ comment)
Definition: xpath.h:402
keyword 'or'
Definition: xpath.h:387
schema-instance-identifier
Definition: xpath.h:378
comment node
Definition: xpath.h:411
quick processing of NACM data rule predicates.
Definition: xpath.h:650
xpath_exop_t
XPath expression operation type.
Definition: xpath.h:384
boolean xpath_expr_ok_for_nolock_get(xpath_pcb_t *pcb)
Check an XPath expression to see if it contains any top-level config=true data nodes or not...
Definition: xpath.c:4999
boolean missing_errors
T: missing node is error.
Definition: xpath.h:714
boolean xpath_check_backptrs_dirty(xpath_pcb_t *pcb, ncx_cfg_t cfg_id)
Check the backptrs_dirty flag in the PCB.
Definition: xpath.c:4487
boolean xpath_find_obj_in_result(xpath_result_t *result, obj_template_t *obj)
Find the object pointer in the specified result.
Definition: xpath.c:4862
status_t res
result of stringify operation
Definition: xpath.h:1022
YANG module data structures Many internal representations of YANG module constructs.
XPath result node struct.
Definition: xpath.h:585
void * cookie
The cookie registered with the getvar_fn.
Definition: xpath.h:799
struct to remember error info tkc->cur_err will be checked before tkc->cur for error information ...
Definition: ncxtypes.h:812
status_t parseres
first and second pass parsing results.
Definition: xpath.h:862
boolean xpath_need_get2_processing(xpath_result_t *result)
Check if the result nodeset contains any XP_RNT_GET2 nodes.
Definition: xpath.c:4785
ncx_xpath_type_t xpath_type
expression context
Definition: xpath.h:853
token parsing chain (main parser control block)
Definition: tk.h:415
xpath_pcb_t * xpath_find_pcb(dlq_hdr_t *pcbQ, const xmlChar *exprstr)
Find an XPath PCB.
Definition: xpath.c:2932
void * yang_pcb
backptr to yang parser control block in progress used to force an inline import instead of returning ...
Definition: xpath.h:880
void xpath_nodeset_swap_valptr(xpath_result_t *result, val_value_t *oldval, val_value_t *newval)
Check if the result has the oldval ptr and if so, replace it with the newval ptr. ...
Definition: xpath.c:4256
objnode
Definition: xpath.h:423
XPath function control block.
Definition: xpath.h:957
xpath_document_t doctype
document context for this evaluation
Definition: xpath.h:763
xpath_fn_t fn
callback pointer for XPath function
Definition: xpath.h:968
uint32 buffsize
size of buffer
Definition: xpath.h:1016
AIO Subtree respresentation.
Definition: xpath.h:1027
vert.
Definition: xpath.h:400
ses_cb_t * scb
backptr to session control block in progress.
Definition: xpath.h:894
ncx_module_t * objmod
module containing obj.
Definition: xpath.h:740
void xpath_nodeset_delete_valptr(xpath_result_t *result, val_value_t *oldval)
Check if the result has the oldval ptr and if so, delete it.
Definition: xpath.c:4295
xpath_source_t
XPath expression source type.
Definition: xpath.h:373
struct xpath_get2_cb_t_ * parent_cb
parent control block used if parent_val not used
Definition: xpath.h:501
left angle bracket '<'
Definition: xpath.h:390
void xpath_set_backptrs_dirty(xpath_pcb_t *pcb, ncx_cfg_t cfg_id, boolean dirty)
Set the backptrs_dirty flag in the PCB.
Definition: xpath.c:4441
uint8 backptrs_flags
internal state for backptr handling
Definition: xpath.h:850
ncx_num_t num
numeric result
Definition: xpath.h:638
val_child_hdr_t * valhdr
result is a value node header
Definition: xpath.h:609
void xpath_set_keep_result(xpath_pcb_t *pcb)
Set the keep-result flag in the PCB.
Definition: xpath.c:4842
xpath_get2_node_t get2node
result is a GET2 state node
Definition: xpath.h:610
void xpath_free_result(xpath_result_t *result)
Free a malloced XPath result struct.
Definition: xpath.c:3107
equals '='
Definition: xpath.h:388
rpc-input context
Definition: xpath.h:364
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
one value to match one type
Definition: val.h:870
val_value_t * val
dummy value for container or list control block DO NOT USE DIRECTLY FOR CHILDREN OR PARENT ...
Definition: xpath.h:493
xpath_source_t source
the prefixes in the QNames in the exprstr MUST be resolved in different contexts. ...
Definition: xpath.h:698
target mode (normal)
Definition: xpath.h:352
status_t xpath_find_schema_target_int(const xmlChar *target, obj_template_t **targobj)
@
Definition: xpath.c:2475
dlq_hdr_t * xpath_get_varbindQ(xpath_pcb_t *pcb)
Get the varbindQ from a parser control block struct.
Definition: xpath.c:4170
obj_template_t * xpath_get_resnode_objptr(xpath_resnode_t *resnode)
Get the result node object pointer (obsolete)
Definition: xpath.c:4150
xpath_result_t * result2
internal result storage
Definition: xpath.h:985
status_t xpath_cvt_string(xpath_pcb_t *pcb, const xpath_result_t *result, xmlChar **str)
Convert an XPath result to a string answer.
Definition: xpath.c:3823
Session Control Block.
Definition: ses.h:542
val_value_t * val
if 'val' is not set then this resnode represents the object node for a container or list; if set then...
Definition: xpath.h:541
status_t xpath_find_val_unique(val_value_t *startval, ncx_module_t *mod, const xmlChar *target, val_value_t *root, boolean logerrors, boolean configonly, xpath_pcb_t **retpcb)
Find the data node for a unique-stmt target.
Definition: xpath.c:2659
key variable mode
Definition: xpath.h:354
xpath_restype_t
XPath expression result type.
Definition: xpath.h:341
xpath_result_t * xpath_new_result(xpath_restype_t restype)
malloc an XPath result
Definition: xpath.c:3033
Value node compare walker fn callback parameters.
Definition: xpath.h:983
status_t
global error return code
Definition: status_enum.h:186
xpath_restype_t restype
expected result type
Definition: xpath.h:962
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
struct xpath_aio_cb_t_ * parent_cb
parent AIO control block
Definition: xpath.h:1032
status_t xpath_find_data_target_pcb(xpath_pcb_t *pcb, obj_template_t **targobj)
Find schema target for a datastore node.
Definition: xpath.c:2560
status_t xpath_find_schema_target_restconf(const xmlChar *target, obj_template_t **targobj)
Find a schema target for RESTCONF.
Definition: xpath.c:2515
uint32 buffpos
current buffer position
Definition: xpath.h:1019
boolean cmpresult
compare result
Definition: xpath.h:1003
YANG must or when.
Definition: xpath.h:376
uint32 xpath_resnode_count(xpath_result_t *result)
Get the number of resnodes in the node-set.
Definition: xpath.c:4596
GET2 callback pending.
Definition: xpath.h:435
xpath_rntype_t rntype
The result node type is the union discriminator for node_.
Definition: xpath.h:595
struct getcb_get2_t_ * get2cb
the getcb for a NACM data rule test
Definition: xpath.h:902
not set
Definition: xpath.h:434
obj_template_t * objptr
object for YANG validation mode
Definition: xpath.h:607
l.
Definition: xpath.h:392
rpc-output context
Definition: xpath.h:365
boolean logerrors
T: use log_error F: suppress error messages.
Definition: xpath.h:711
string result
Definition: xpath.h:345
boolean backptrs_manual_clear
manual clear of backptrs needed
Definition: xpath.h:847
ncx_xpath_type_t
enumeration for different XPath back pointer types
Definition: ncxtypes.h:1171
xpath_result_t * result
The XPath result for this evaluation.
Definition: xpath.h:779
keyword 'mod'
Definition: xpath.h:398
right angle bracket '>'
Definition: xpath.h:391
NCX Syntax Token Handler.
valptr
Definition: xpath.h:424
Global error messages for status code enumerations.
GET2 callback skipped.
Definition: xpath.h:436
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:3933
status_t xpath_find_schema_target_err(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, obj_template_t *obj, dlq_hdr_t *datadefQ, const xmlChar *target, obj_template_t **targobj, dlq_hdr_t **targQ, ncx_error_t *tkerr)
find target, save in *targobj, use the errtk if error
Definition: xpath.c:2406
xmlChar * str
string result
Definition: xpath.h:641
val_value_t * parent_val
only 1 of these 2 pointers should be set they are both back-pointers and not malloced here ...
Definition: xpath.h:498
this struct is inserted in the val->v.child_hdrQ for container and list value nodes ...
Definition: val.h:1020
obj_template_t * altobj
bptr to pred.
Definition: xpath.h:723
obj_template_t * obj
object for this subtree
Definition: xpath.h:1035
void xpath_clean_resnode(xpath_resnode_t *resnode)
Clean an XPath result node struct.
Definition: xpath.c:3289
xpath_pcb_t * xpath_clone_pcb(const xpath_pcb_t *srcpcb)
Clone an XPath PCB.
Definition: xpath.c:2822
GET2 callback starting.
Definition: xpath.h:437
ncx_module_t * rootmod
YPW-1416: track module in progress during deviation validation of leafref type replacement.
Definition: xpath.h:748
boolean seen
internal yangdiff support
Definition: xpath.h:874
ncx_module_t * impmod
[sub]module containing obj
Definition: xpath.h:743
uint32 result_count
The count of entries in the result_cacheQ.
Definition: xpath.h:836
boolean xpath_check_manual_clear(xpath_pcb_t *pcb)
Check the backptrs_dirty flag in the PCB is clearly manually only.
Definition: xpath.c:4528
YANG error info statement struct used to override default error handling in the server.
Definition: ncxtypes.h:1250
XPath parser control block.
Definition: xpath.h:668
xmlChar * cmpstring
compare string
Definition: xpath.h:988
obj_template_t * docroot
document root.
Definition: xpath.h:751
alternate mode
Definition: xpath.h:353
val_value_t * val
saved state for the current() function result
Definition: xpath.h:757
void xpath_clear_load_import(xpath_pcb_t *pcb)
Clear the PCB out of load import mode.
Definition: xpath.c:4743
boolean xpath_result_is_get2(xpath_result_t *result)
Check if the result is a node-set for GET2 nodes.
Definition: xpath.c:5146
xpath_curmode_t curmode
select targ/alt/var obj
Definition: xpath.h:729
void xpath_delete_resnode(xpath_resnode_t *resnode)
Delete and free a malloced XPath result node struct.
Definition: xpath.c:3267
val_value_t * val_docroot
cfg->root for db
Definition: xpath.h:760
void xpath_free_pred_ent(xpath_pred_ent_t *ent)
Free a malloced XPath predicate entry struct.
Definition: xpath.c:4975
xpath_resnode_t * xpath_get_first_real_resnode(xpath_result_t *result)
Get the first result in the renodeQ from a result struct.
Definition: xpath.c:5112
node-set result
Definition: xpath.h:343
xpath_get2_form_t form
the form field determines the type of get2 node
Definition: xpath.h:574
status_t xpath_find_schema_target_force_mod(yang_pcb_t *pcb, tk_chain_t *tkc, ncx_module_t *mod, ncx_module_t *force_mod, obj_template_t *obj, dlq_hdr_t *datadefQ, const xmlChar *target, obj_template_t **targobj, dlq_hdr_t **targQ)
find target, save in *targobj, force the module
Definition: xpath.c:2337
ncx_protocol_t
NCX session protocol versions supported.
Definition: ncxtypes.h:933
get2ptr
Definition: xpath.h:426
Value or object node walker fn callback parameters.
Definition: xpath.h:973
terminal node CB
Definition: xpath.h:449
xmlChar * buffer
buffer used for stringifying the node-set
Definition: xpath.h:1013
dlq_hdr_t * xpath_get_resnodeQ(xpath_result_t *result)
Get the renodeQ from a result struct.
Definition: xpath.c:3907
boolean result
Definition: xpath.h:346
instance-identifier
Definition: xpath.h:377
keyword 'and'
Definition: xpath.h:386
Value node stringify walker fn callback parameters.
Definition: xpath.h:1011
struct of NCX user variable mapping for yangcli
Definition: var.h:131
obj_template_t * keyobj
backptr to schema tree
Definition: xpath.h:652
ncx_cfg_t
hardwire the 3 standard configs
Definition: ncxtypes.h:535
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
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
bang equals '!='
Definition: xpath.h:389
ncx_var_t *(* xpath_getvar_fn_t)(struct xpath_pcb_t_ *pcb, const xmlChar *varname, status_t *res)
XPath GET variable callback function.
Definition: xpath.h:471
uint32 buffsize
size of internal buffer
Definition: xpath.h:997
datastore context
Definition: xpath.h:363
xpath_curmode_t
XPath dynamic parsing mode for leafref.
Definition: xpath.h:350
obj_template_t * varobj
bptr to key-expr LHS object
Definition: xpath.h:726
obj_template_t * obj
these parms are used by leafref and XPath1 parsing obj is a bptr to start object
Definition: xpath.h:734
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:3961
YANG parser control block.
Definition: yang.h:204
boolean boo
boolean result
Definition: xpath.h:635
XML start, empty, or end tag.
Definition: xpath.h:414
xpath_get2_form_t
GET2 control block forms.
Definition: xpath.h:446
xpath_document_t
document root type.
Definition: xpath.h:361
val_value_t * xpath_get_resnode_val(xpath_resnode_t *resnode)
Get the resnode value pointer from a resnode, if any.
Definition: xpath.c:4115
boolean xpath_nodeset_empty(const xpath_result_t *result)
Check if the result is an empty nodeset.
Definition: xpath.c:4230
obj_template_t * xpath_get_resnode_obj(xpath_resnode_t *resnode)
Get the resnode object pointer from a value resnode.
Definition: xpath.c:4052
xpath_result_t *(* xpath_fn_t)(xpath_pcb_t *pcb, dlq_hdr_t *parmQ, status_t *res)
XPath function prototype.
Definition: xpath.h:947
asterisk '*'
Definition: xpath.h:396
void xpath_set_manual_clear(xpath_pcb_t *pcb)
Set the manual clear mode flag in the PCB.
Definition: xpath.c:4545
struct getcb_get2_t_ * get2cb
the getcb for this retrieval, ancestor keys in parent_val or parent_cb
Definition: xpath.h:506
normal GET2 CB
Definition: xpath.h:448