yumapro  20.10-12
YumaPro SDK
xpath.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
13 #define _H_xpath
14 
15 /* FILE: xpath.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 30-dec-07 abb Begun
36 06-jul-11 abb add wildcard match support
37 11-dec-16 abb add GET2 retrieval support
38 */
39 
40 #include <xmlstring.h>
41 #include <xmlreader.h>
42 #include <xmlregexp.h>
43 
44 #ifndef _H_dlq
45 #include "dlq.h"
46 #endif
47 
48 #ifndef _H_ncxtypes
49 #include "ncxtypes.h"
50 #endif
51 
52 #ifndef _H_status
53 #include "status.h"
54 #endif
55 
56 #ifndef _H_obj
57 #include "obj.h"
58 #endif
59 
60 #ifndef _H_tk
61 #include "tk.h"
62 #endif
63 
64 #ifndef _H_val
65 #include "val.h"
66 #endif
67 
68 #ifndef _H_var
69 #include "var.h"
70 #endif
71 
72 #ifndef _H_yang
73 #include "yang.h"
74 #endif
75 
76 #ifdef __cplusplus
77 extern "C" {
78 #endif
79 
80 /********************************************************************
81 * *
82 * C O N S T A N T S *
83 * *
84 *********************************************************************/
85 
86 /* max size of the pcb->result_cacheQ */
87 #define XPATH_RESULT_CACHE_MAX 16
88 
89 /* max size of the pcb->resnode_cacheQ */
90 #define XPATH_RESNODE_CACHE_MAX 64
91 
92 
93 /* XPath 1.0 sec 2.2 AxisName */
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"
107 
108 /* Xpath 1.0 Function library + current() from XPath 2.0 */
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"
137 
138 
139 /* yuma function extensions */
140 #define XP_FN_MODULE_LOADED (const xmlChar *)"module-loaded"
141 #define XP_FN_FEATURE_ENABLED (const xmlChar *)"feature-enabled"
142 
143 /* XPath functions added to YANG 1.1 */
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"
150 
151 /* XPath NodeType values */
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"
157 
158 /* XPath 1.0 operator names */
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"
163 
164 
165 /* Header only */
166 
185 #define XP_URL_ESC_WILDCARD '-'
186 
199 #define XP_FL_DYNNODE bit0
200 
201 
205 #define XP_FL_SKIP_MODE bit1
206 
207 
211 #define XP_FL_LOAD_IMPORT bit2
212 
213 
215 #define XP_FL_ABSPATH bit3
216 
217 
221 #define XP_FL_CONFIGONLY bit4
222 
227 #define XP_FL_USEROOT bit5
228 
232 #define XP_FL_INSTANCEID bit6
233 
234 
238 #define XP_FL_SCHEMA_INSTANCEID bit7
239 
247 #define XP_FL_TOP_RPC_INPUT bit8
248 
256 #define XP_FL_ACTION_INPUT bit9
257 
262 #define XP_FL_NACM_GET2 bit10
263 
268 #define XP_FL_KEEP_RESULT bit11
269 
270 
272 #define XP_FL_FOUND_PRED bit12
273 
277 #define XP_FL_GET_WHEN bit13
278 
279 /***** backptr_flags definitions *****/
280 
282 #define XP_FL_BACKPTR_CDIRTY bit0
283 
285 #define XP_FL_BACKPTR_RDIRTY bit1
286 
288 #define XP_FL_BACKPTR_SDIRTY bit2
289 
290 
291 /********************************************************************
292 * *
293 * M A C R O S *
294 * *
295 *********************************************************************/
296 
298 #define XPATH_GET_TYPE(P) (P)->xpath_type
299 
301 #define XPATH_GET_RESTYPE(R) (R)->restype
302 
304 #define XPATH_NACM_GET2(P) ((P)->flags & XP_FL_NACM_GET2)
305 
307 #define XPATH_NONCONFIG_WARN(P) (P)->nonconfig_warn_obj
308 
310 #define XPATH_VAL_CXT(P) ((P)->val || (P)->val_get2)
311 
313 #define XPATH_ANY_CXT(P) ((P)->val || (P)->val_get2 || (P)->obj)
314 
316 #define XPATH_SCB(P) (P)->scb
317 
319 #define XPATH_GET2CB_OBJ(N) (N)->cb->obj
320 
322 #define XPATH_MHDR(P) (P)->mhdr
323 
325 #define XPATH_EXPRSTR(P) (P)->exprstr
326 
328 #define XPATH_SET_DISABLED_OBJ_OK(P) (P)->disabled_obj_ok = TRUE
329 
331 #define XPATH_DISABLED_OBJ_OK(P) (P)->disabled_obj_ok
332 
333 
334 /********************************************************************
335 * *
336 * T Y P E S *
337 * *
338 *********************************************************************/
339 
341 typedef enum xpath_restype_t_ {
342  XP_RT_NONE,
343  XP_RT_NODESET,
344  XP_RT_NUMBER,
345  XP_RT_STRING,
347 } xpath_restype_t;
348 
350 typedef enum xpath_curmode_t_ {
355 } xpath_curmode_t;
356 
357 
361 typedef enum xpath_document_t_ {
367 } xpath_document_t;
368 
369 
373 typedef enum xpath_source_t_ {
380 } xpath_source_t;
381 
382 
384 typedef enum xpath_exop_t_ {
403 } xpath_exop_t;
404 
405 
409 typedef enum xpath_nodetype_t_ {
415 } xpath_nodetype_t;
416 
417 
421 typedef enum xpath_rntype_t_ {
427 } xpath_rntype_t;
428 
429 
433 typedef enum xpath_get2_state_t_ {
440 } xpath_get2_state_t;
441 
442 
446 typedef enum xpath_get2_form_t_ {
451 } xpath_get2_form_t;
452 
453 
470 typedef ncx_var_t *
471  (*xpath_getvar_fn_t) (struct xpath_pcb_t_ *pcb,
472  const xmlChar *varname,
473  status_t *res);
474 
475 
481 typedef struct xpath_get2_cb_t_ {
482  dlq_hdr_t qhdr;
485  xpath_get2_state_t get2_state;
486 
488  obj_template_t *obj;
489 
493  val_value_t *val;
494 
498  val_value_t *parent_val;
499 
502 
507 
518  dlq_hdr_t return_keyQ;
519  dlq_hdr_t return_termQ;
521  dlq_hdr_t lookupQ;
523 } xpath_get2_cb_t;
524 
525 
529 typedef struct xpath_get2_node_t_ {
535  xpath_get2_cb_t *cb;
536 
541  val_value_t *val;
542 
574  xpath_get2_form_t form;
575 
576 } xpath_get2_node_t;
577 
578 
585 typedef struct xpath_resnode_t_ {
587  dlq_hdr_t qhdr;
588 
592  boolean dblslash;
593 
595  xpath_rntype_t rntype;
596 
606  union node_ {
607  obj_template_t *objptr;
608  val_value_t *valptr;
609  val_child_hdr_t *valhdr;
610  xpath_get2_node_t get2node;
611  } node;
612 } xpath_resnode_t;
613 
614 
619 typedef struct xpath_result_t_ {
621  dlq_hdr_t qhdr;
622 
624  xpath_restype_t restype;
625 
626  /* flag to identify node types in the nodeQ if XP_RT_NODESET */
627  boolean isval;
628 
630  union r_ {
631  /* result node Q of xpath_resnode_t */
632  dlq_hdr_t nodeQ;
633 
635  boolean boo;
636 
638  ncx_num_t num;
639 
641  xmlChar *str;
642  } r;
643 
644 } xpath_result_t;
645 
646 
650 typedef struct xpath_pred_ent_t_ {
651  dlq_hdr_t qhdr;
652  obj_template_t *keyobj;
653  const xmlChar *keyval;
654 } xpath_pred_ent_t;
655 
656 
668 typedef struct xpath_pcb_t_ {
670  dlq_hdr_t qhdr;
671 
676  tk_chain_t *tkc;
677 
678  /* XPath expression to evaluate provided by the caller.
679  * This is a mandatory parameter.
680  */
681  xmlChar *exprstr;
682 
683  /* XmlTextReader is needed when the evaluation is inside
684  * an XML instance document (rpc request)
685  */
686  xmlTextReaderPtr reader;
687 
698  xpath_source_t source;
699 
704  ncx_errinfo_t errinfo;
705 
711  boolean logerrors;
712 
714  boolean missing_errors;
715 
720  obj_template_t *targobj;
721 
723  obj_template_t *altobj;
724 
726  obj_template_t *varobj;
727 
729  xpath_curmode_t curmode;
730 
734  obj_template_t *obj;
735 
740  ncx_module_t *objmod;
741 
743  ncx_module_t *impmod;
744 
748  ncx_module_t *rootmod;
751  obj_template_t *docroot;
752 
754  obj_template_t *startobj;
755 
757  val_value_t *val;
758 
760  val_value_t *val_docroot;
761 
763  xpath_document_t doctype;
764 
774 
776  uint32 flags;
777 
779  xpath_result_t *result;
780 
785  xpath_resnode_t context;
787  /* Need to save original context for current() fn */
788  xpath_resnode_t orig_context;
789 
791  xpath_result_t *context_result;
792 
797 
799  void *cookie;
800 
805  dlq_hdr_t varbindQ;
806 
811  const struct xpath_fncb_t_ *functions;
812 
827  dlq_hdr_t result_cacheQ;
828 
833  dlq_hdr_t resnode_cacheQ;
834 
836  uint32 result_count;
837 
840 
844  boolean backptrs_mode;
845 
848 
851 
853  ncx_xpath_type_t xpath_type;
854 
857 
862  status_t parseres;
863 
865  status_t validateres;
866 
868  status_t valueres;
869 
871  ncx_error_t tkerr;
872 
874  boolean seen;
875 
880  void *yang_pcb;
881 
887  dlq_hdr_t get2_cbQ; /* Q of xpath_get2_cb_t */
888 
894  ses_cb_t *scb;
895 
899  xml_msg_hdr_t *mhdr;
900 
903 
905  dlq_hdr_t pred_entQ;
906 
910  obj_template_t *nonconfig_warn_obj;
911 
919  dlq_hdr_t get2_aio_cbQ;
928 
929 } xpath_pcb_t;
930 
931 
946 typedef xpath_result_t *
947  (*xpath_fn_t) (xpath_pcb_t *pcb,
948  dlq_hdr_t *parmQ,
949  status_t *res);
950 
951 
957 typedef struct xpath_fncb_t_ {
959  const xmlChar *name;
960 
962  xpath_restype_t restype;
963 
965  int32 parmcnt;
966 
969 } xpath_fncb_t;
970 
971 
973 typedef struct xpath_walkerparms_t_ {
975  dlq_hdr_t *resnodeQ;
976 
978  status_t res;
979 } xpath_walkerparms_t;
980 
981 
983 typedef struct xpath_compwalkerparms_t_ {
985  xpath_result_t *result2;
986 
988  xmlChar *cmpstring;
989 
991  ncx_num_t *cmpnum;
992 
994  xmlChar *buffer;
995 
997  uint32 buffsize;
998 
1000  xpath_exop_t exop;
1001 
1003  boolean cmpresult;
1004 
1006  status_t res;
1007 } xpath_compwalkerparms_t;
1008 
1009 
1013  xmlChar *buffer;
1014 
1016  uint32 buffsize;
1017 
1019  uint32 buffpos;
1020 
1022  status_t res;
1023 } xpath_stringwalkerparms_t;
1024 
1025 
1027 typedef struct xpath_aio_cb_t_ {
1029  dlq_hdr_t qhdr;
1030 
1033 
1035  obj_template_t *obj;
1036 
1041  dlq_hdr_t valQ;
1042 
1043 } xpath_aio_cb_t;
1044 
1045 
1049 /********************************************************************
1050 * *
1051 * F U N C T I O N S *
1052 * *
1053 *********************************************************************/
1054 
1091 extern status_t
1092  xpath_find_schema_target (yang_pcb_t *pcb,
1093  tk_chain_t *tkc,
1094  ncx_module_t *mod,
1095  obj_template_t *obj,
1096  dlq_hdr_t *datadefQ,
1097  const xmlChar *target,
1098  obj_template_t **targobj,
1099  dlq_hdr_t **targQ);
1100 
1101 
1135 extern status_t
1136  xpath_find_schema_target_force_mod (yang_pcb_t *pcb,
1137  tk_chain_t *tkc,
1138  ncx_module_t *mod,
1139  ncx_module_t *force_mod,
1140  obj_template_t *obj,
1141  dlq_hdr_t *datadefQ,
1142  const xmlChar *target,
1143  obj_template_t **targobj,
1144  dlq_hdr_t **targQ);
1145 
1146 
1174 extern status_t
1175  xpath_find_schema_target_err (yang_pcb_t *pcb,
1176  tk_chain_t *tkc,
1177  ncx_module_t *mod,
1178  obj_template_t *obj,
1179  dlq_hdr_t *datadefQ,
1180  const xmlChar *target,
1181  obj_template_t **targobj,
1182  dlq_hdr_t **targQ,
1183  ncx_error_t *tkerr);
1184 
1185 
1204 extern status_t
1205  xpath_find_schema_target_int (const xmlChar *target,
1206  obj_template_t **targobj);
1207 
1208 
1237 extern status_t
1238  xpath_find_val_target (val_value_t *startval,
1239  ncx_module_t *mod,
1240  const xmlChar *target,
1241  val_value_t **targval);
1242 
1243 
1257 extern status_t
1258  xpath_find_schema_target_restconf (const xmlChar *target,
1259  obj_template_t **targobj);
1260 
1261 
1262 
1281 extern status_t
1282  xpath_find_data_target_pcb (xpath_pcb_t *pcb,
1283  obj_template_t **targobj);
1284 
1285 
1313 extern status_t
1314  xpath_find_val_unique (val_value_t *startval,
1315  ncx_module_t *mod,
1316  const xmlChar *target,
1317  val_value_t *root,
1318  boolean logerrors,
1319  boolean configonly,
1320  xpath_pcb_t **retpcb);
1321 
1322 
1338 extern xpath_pcb_t *
1339  xpath_new_pcb (const xmlChar *xpathstr,
1340  xpath_getvar_fn_t getvar_fn);
1341 
1342 
1359 extern xpath_pcb_t *
1360  xpath_new_pcb_ex (const xmlChar *xpathstr,
1361  xpath_getvar_fn_t getvar_fn,
1362  void *cookie);
1363 
1364 
1377 extern xpath_pcb_t *
1378  xpath_clone_pcb (const xpath_pcb_t *srcpcb);
1379 
1380 
1390 extern xpath_pcb_t *
1391  xpath_find_pcb (dlq_hdr_t *pcbQ,
1392  const xmlChar *exprstr);
1393 
1394 
1400 extern void
1401  xpath_free_pcb (xpath_pcb_t *pcb);
1402 
1403 
1414 extern xpath_result_t *
1415  xpath_new_result (xpath_restype_t restype);
1416 
1417 
1424 extern void
1425  xpath_init_result (xpath_result_t *result,
1426  xpath_restype_t restype);
1427 
1428 
1434 extern void
1435  xpath_free_result (xpath_result_t *result);
1436 
1437 
1443 extern void
1444  xpath_clean_result (xpath_result_t *result);
1445 
1446 
1452 extern xpath_resnode_t *
1453  xpath_new_resnode (void);
1454 
1455 
1461 extern void
1462  xpath_init_resnode (xpath_resnode_t *resnode);
1463 
1464 
1470 extern void
1471  xpath_free_resnode (xpath_resnode_t *resnode);
1472 
1473 
1479 extern void
1480  xpath_delete_resnode (xpath_resnode_t *resnode);
1481 
1482 
1488 extern void
1489  xpath_clean_resnode (xpath_resnode_t *resnode);
1490 
1491 
1507 extern status_t
1508  xpath_get_curmod_from_prefix (const xmlChar *prefix,
1509  ncx_module_t *mod,
1510  ncx_module_t **targmod);
1511 
1512 
1531 extern status_t
1532  xpath_get_curmod_from_prefix2 (const xmlChar *prefix,
1533  ncx_module_t *mod,
1534  ncx_module_t **targmod,
1535  const xmlChar **modname);
1536 
1537 
1555 extern status_t
1556  xpath_get_modinfo_from_prefix (const xmlChar *prefix,
1557  ncx_module_t *mod,
1558  const xmlChar **modname,
1559  const xmlChar **modrev);
1560 
1561 
1579 extern status_t
1580  xpath_get_curmod_from_prefix_str (const xmlChar *prefix,
1581  uint32 prefixlen,
1582  ncx_module_t *mod,
1583  ncx_module_t **targmod);
1584 
1585 
1598 extern status_t
1599  xpath_parse_token (xpath_pcb_t *pcb,
1600  tk_type_t tktype);
1601 
1602 
1609 extern boolean
1610  xpath_cvt_boolean (const xpath_result_t *result);
1611 
1612 
1620 extern void
1621  xpath_cvt_number (const xpath_result_t *result,
1622  ncx_num_t *num);
1623 
1624 
1634 extern status_t
1635  xpath_cvt_string (xpath_pcb_t *pcb,
1636  const xpath_result_t *result,
1637  xmlChar **str);
1638 
1639 
1646 extern dlq_hdr_t *
1647  xpath_get_resnodeQ (xpath_result_t *result);
1648 
1649 
1656 extern xpath_resnode_t *
1657  xpath_get_first_resnode (xpath_result_t *result);
1658 
1659 
1666 extern xpath_resnode_t *
1667  xpath_get_next_resnode (xpath_resnode_t *resnode);
1668 
1669 
1676 extern val_value_t *
1677  xpath_first_resnode_valptr (xpath_resnode_t *resnode);
1678 
1679 
1687 extern val_value_t *
1688  xpath_next_resnode_valptr (xpath_resnode_t *resnode,
1689  val_value_t *valptr);
1690 
1691 
1698 extern obj_template_t *
1699  xpath_get_resnode_obj (xpath_resnode_t *resnode);
1700 
1701 
1708 extern obj_template_t *
1709  xpath_get_cxt_obj (xpath_pcb_t *pcb);
1710 
1711 
1718 extern val_value_t *
1719  xpath_get_resnode_val (xpath_resnode_t *resnode);
1720 
1721 
1730 extern obj_template_t *
1731  xpath_get_resnode_objptr (xpath_resnode_t *resnode);
1732 
1733 
1740 extern dlq_hdr_t *
1741  xpath_get_varbindQ (xpath_pcb_t *pcb);
1742 
1743 
1756 extern void
1757  xpath_move_nodeset (xpath_result_t *srcresult,
1758  xpath_result_t *destresult);
1759 
1760 
1761 
1769 extern boolean
1770  xpath_nodeset_empty (const xpath_result_t *result);
1771 
1772 
1781 extern void
1782  xpath_nodeset_swap_valptr (xpath_result_t *result,
1783  val_value_t *oldval,
1784  val_value_t *newval);
1785 
1786 
1794 extern void
1795  xpath_nodeset_delete_valptr (xpath_result_t *result,
1796  val_value_t *oldval);
1797 
1798 
1824 extern xmlChar *
1825  xpath_convert_url_to_path (const xmlChar *urlpath,
1826  ncx_name_match_t match_names,
1827  boolean alt_naming,
1828  boolean wildcards,
1829  boolean withkeys,
1830  boolean fullkeys,
1831  boolean withmod,
1832  ncx_protocol_t proto,
1833  status_t *res);
1834 
1835 
1843 extern void
1844  xpath_set_backptrs_dirty (xpath_pcb_t *pcb,
1845  ncx_cfg_t cfg_id,
1846  boolean dirty);
1847 
1848 
1857 extern boolean
1858  xpath_check_backptrs_dirty (xpath_pcb_t *pcb,
1859  ncx_cfg_t cfg_id);
1860 
1861 
1870 extern boolean
1871  xpath_check_manual_clear (xpath_pcb_t *pcb);
1872 
1873 
1879 extern void
1880  xpath_set_manual_clear (xpath_pcb_t *pcb);
1881 
1882 
1891 extern status_t
1892  xpath_add_to_result (xpath_result_t *source,
1893  xpath_result_t *target);
1894 
1895 
1902 extern uint32
1903  xpath_resnode_count (xpath_result_t *result);
1904 
1905 
1911 extern void
1912  xpath_discard_resnode (xpath_resnode_t *resnode);
1913 
1914 
1920 extern void
1921  xpath_clear_nodeset_result (xpath_result_t *result);
1922 
1923 
1935 extern xpath_pcb_t *
1936  xpath_new_session_pcb (ses_cb_t *scb,
1937  const xmlChar *expr,
1938  status_t *res);
1939 
1940 
1949 extern void
1950  xpath_set_load_import (xpath_pcb_t *pcb,
1951  void *yang_pcb);
1952 
1953 
1961 extern void
1962  xpath_clear_load_import (xpath_pcb_t *pcb);
1963 
1964 
1973 extern void *
1974  xpath_get_load_import (xpath_pcb_t *pcb);
1975 
1976 
1983 extern boolean
1984  xpath_need_get2_processing (xpath_result_t *result);
1985 
1986 
1995 extern const xmlChar *
1996  xpath_get_restype_str (xpath_restype_t restype);
1997 
1998 
2004 extern void
2005  xpath_set_keep_result (xpath_pcb_t *pcb);
2006 
2007 
2015 extern boolean
2016  xpath_find_obj_in_result (xpath_result_t *result,
2017  obj_template_t *obj);
2018 
2019 
2026 extern boolean
2027  xpath_expr_has_predicates (xpath_pcb_t *pcb);
2028 
2029 
2038 extern boolean
2039  xpath_expr_scan_predicates (xpath_pcb_t *pcb);
2040 
2041 
2049 extern xpath_pred_ent_t *
2050  xpath_new_pred_ent (obj_template_t *keyobj,
2051  const xmlChar *keyval);
2052 
2053 
2059 extern void xpath_free_pred_ent (xpath_pred_ent_t *ent);
2060 
2061 
2072 extern boolean xpath_expr_ok_for_nolock_get (xpath_pcb_t *pcb);
2073 
2074 
2084 extern xpath_resnode_t *
2085  xpath_get_first_real_resnode (xpath_result_t *result);
2086 
2087 
2096 extern boolean
2097  xpath_result_is_get2 (xpath_result_t *result);
2098 
2099 
2103 #ifdef __cplusplus
2104 } /* end extern 'C' */
2105 #endif
2106 
2107 #endif /* _H_xpath */
xpath1_get2.h
XPath 1.0 expression support for server GET2 callback functions.
XP_FORM_GETCB
@ XP_FORM_GETCB
normal GET2 CB
Definition: xpath.h:448
XP_EXOP_EQUAL
@ XP_EXOP_EQUAL
equals '='
Definition: xpath.h:388
xpath_pcb_t_::valueres
status_t valueres
evaluation stage result
Definition: xpath.h:868
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
xpath_fn_t
xpath_result_t *(* xpath_fn_t)(xpath_pcb_t *pcb, dlq_hdr_t *parmQ, status_t *res)
XPath function prototype.
Definition: xpath.h:947
xml_strlen
uint32 xml_strlen(const xmlChar *str)
Get the String len for xmlChar.
Definition: xml_util.c:1406
xpath_stringwalkerparms_t_
Value node stringify walker fn callback parameters.
Definition: xpath.h:1011
xpath_result_t_::r_::str
xmlChar * str
string result
Definition: xpath.h:641
NCX_NF_OCTAL
@ NCX_NF_OCTAL
YANG octal format.
Definition: ncxtypes.h:334
xpath_aio_cb_t_
AIO Subtree respresentation.
Definition: xpath.h:1027
xpath_pcb_t_::doctype
xpath_document_t doctype
document context for this evaluation
Definition: xpath.h:763
xpath_find_schema_target_err
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
xpath_pcb_t_::altobj
obj_template_t * altobj
bptr to pred.
Definition: xpath.h:723
xpath_pcb_t_::varbindQ
dlq_hdr_t varbindQ
The varbindQ may be used instead of the getvar_fn to store user variables to be supported in this XPa...
Definition: xpath.h:805
xpath_free_pcb
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
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
xml_strncpy
uint32 xml_strncpy(xmlChar *copyTo, const xmlChar *copyFrom, uint32 maxlen)
String copy for xmlChar – checks for buffer overflow.
Definition: xml_util.c:1518
ncx_decode_url_string
status_t ncx_decode_url_string(const xmlChar *urlstr, uint32 urlstrlen, xmlChar *buffer, uint32 *cnt)
Fill buffer with a plain string from a URL string.
Definition: ncx.c:10822
ncx_match_any_object
obj_template_t * ncx_match_any_object(const xmlChar *objname, ncx_name_match_t name_match, boolean alt_names, status_t *retres)
Match any object in any YANG module with extra search options.
Definition: ncx.c:4084
OBJ_TYP_LIST
@ OBJ_TYP_LIST
list: last real database object
Definition: obj.h:617
var_set_move_que
status_t var_set_move_que(dlq_hdr_t *varQ, const xmlChar *name, val_value_t *value)
Find or create and set a Q-based user variable.
Definition: var.c:1354
xpath_pcb_t_::val_docroot
val_value_t * val_docroot
cfg->root for db
Definition: xpath.h:760
XP_RT_NUMBER
@ XP_RT_NUMBER
number result
Definition: xpath.h:348
xpath_clear_nodeset_result
void xpath_clear_nodeset_result(xpath_result_t *result)
Clear all the nodes from the node-set result.
Definition: xpath.c:4635
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
xpath_result_t_::r_::num
ncx_num_t num
numeric result
Definition: xpath.h:638
xpath_result_t_
XPath expression result.
Definition: xpath.h:619
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
xpath_compwalkerparms_t_::result2
xpath_result_t * result2
internal result storage
Definition: xpath.h:985
xpath_pcb_t_::flags
uint32 flags
internal processing flags for managing XPath state
Definition: xpath.h:776
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_aio.h
Xpath 1.0 search support; XPath function library. Interface to the AIO GET2 object callback API.
xpath1_get2_free_cb
void xpath1_get2_free_cb(xpath_get2_cb_t *cb)
Free a malloced XPath parser control block.
Definition: xpath1_get2.c:2228
xpath_walkerparms_t_::resnodeQ
dlq_hdr_t * resnodeQ
Q of xpath_resnode_t being checked.
Definition: xpath.h:975
xpath_find_val_target
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
xpath_pred_ent_t_
quick processing of NACM data rule predicates.
Definition: xpath.h:650
ncx_valid_name2
boolean ncx_valid_name2(const xmlChar *str)
Check if an xmlChar string is a valid NCX name.
Definition: ncx.c:7637
xpath_resnode_t_::rntype
xpath_rntype_t rntype
The result node type is the union discriminator for node_.
Definition: xpath.h:595
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
obj_find_template_test
obj_template_t * obj_find_template_test(dlq_hdr_t *que, const xmlChar *modname, const xmlChar *objname)
Find an object with the specified name Test version; do not set 'used' flag.
Definition: obj.c:5784
val_find_child
val_value_t * val_find_child(const val_value_t *parent, const xmlChar *modname, const xmlChar *childname)
Find the first instance of the specified child node.
Definition: val.c:8560
xpath_get_curmod_from_prefix
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
xpath_resnode_t_::node_
if the result->isval flag is false then the objptr is used in all resnodes in that result
Definition: xpath.h:606
xpath_pcb_t_::rootmod
ncx_module_t * rootmod
YPW-1416: track module in progress during deviation validation of leafref type replacement.
Definition: xpath.h:748
ERR_NCX_DEF_NOT_FOUND
@ ERR_NCX_DEF_NOT_FOUND
250
Definition: status_enum.h:289
xpath_need_get2_processing
boolean xpath_need_get2_processing(xpath_result_t *result)
Check if the result nodeset contains any XP_RNT_GET2 nodes.
Definition: xpath.c:4783
xpath_fncb_t_
XPath function control block.
Definition: xpath.h:957
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
OBJ_TYP_NOTIF
@ OBJ_TYP_NOTIF
notification
Definition: obj.h:625
xpath_move_nodeset
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:4194
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_make_string
val_value_t * val_make_string(xmlns_id_t nsid, const xmlChar *valname, const xmlChar *valstr)
Malloc and set a val_value_t as a generic NCX_BT_STRING namespace set to 0 !!!
Definition: val.c:7557
xpath_init_resnode
void xpath_init_resnode(xpath_resnode_t *resnode)
Initialize an XPath result node struct.
Definition: xpath.c:3217
xpath_pcb_t_::val
val_value_t * val
saved state for the current() function result
Definition: xpath.h:757
xpath_pcb_t_::startobj
obj_template_t * startobj
start object set for rpc,notif validation
Definition: xpath.h:754
val.h
Value Node Basic Support.
xpath_compwalkerparms_t_::buffsize
uint32 buffsize
size of internal buffer
Definition: xpath.h:997
OBJ_TYP_CHOICE
@ OBJ_TYP_CHOICE
choice
Definition: obj.h:618
tk_clone_chain
tk_chain_t * tk_clone_chain(tk_chain_t *oldtkc)
Allocatate and a new token parse chain and fill it with the specified token chain contents.
Definition: tk.c:4068
ERR_NCX_MISSING_KEY
@ ERR_NCX_MISSING_KEY
383
Definition: status_enum.h:426
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
ncx_get_search_modQ_ok
boolean ncx_get_search_modQ_ok(void)
Get the search_modQ_ok flag.
Definition: ncx.c:12554
xpath_set_load_import
void xpath_set_load_import(xpath_pcb_t *pcb, void *yang_pcb)
Set the PCB in load import mode.
Definition: xpath.c:4721
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
XP_EXNT_TEXT
@ XP_EXNT_TEXT
text node
Definition: xpath.h:412
XP_EXOP_UNION
@ XP_EXOP_UNION
vert.
Definition: xpath.h:400
getcb.h
GET1 and GET2 Callback Support.
tk_free_chain
void tk_free_chain(tk_chain_t *tkc)
Cleanup and deallocate a tk_chain_t.
Definition: tk.c:3205
obj_next_key
obj_key_t * obj_next_key(obj_key_t *objkey)
Get the next key record.
Definition: obj.c:9559
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
xpath_new_pred_ent
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:4949
xpath_cvt_boolean
boolean xpath_cvt_boolean(const xpath_result_t *result)
Convert an XPath result to a boolean answer.
Definition: xpath.c:3630
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
xpath_pcb_t_::scb
ses_cb_t * scb
backptr to session control block in progress.
Definition: xpath.h:894
typ_is_number
boolean typ_is_number(ncx_btype_t btyp)
Check if the base type is numeric.
Definition: typ.c:4063
tk.h
NCX Syntax Token Handler.
xpath_pcb_t_::xpath_type
ncx_xpath_type_t xpath_type
expression context
Definition: xpath.h:853
xpath_curmode_t_
xpath_curmode_t_
XPath dynamic parsing mode for leafref.
Definition: xpath.h:350
xpath_aio_cb_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: xpath.h:1029
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.
xpath_compwalkerparms_t_::cmpnum
ncx_num_t * cmpnum
compare number
Definition: xpath.h:991
ncx_num.h
NCX Module Library Number Utility Functions.
xpath_pcb_t_::obj
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_compwalkerparms_t_::buffer
xmlChar * buffer
buffer for internal use
Definition: xpath.h:994
XP_DOC_NOTIFICATION
@ XP_DOC_NOTIFICATION
notification context
Definition: xpath.h:366
xpath_pcb_t_::result
xpath_result_t * result
The XPath result for this evaluation.
Definition: xpath.h:779
XP_EXNT_COMMENT
@ XP_EXNT_COMMENT
comment node
Definition: xpath.h:411
XP_RST_NONE
@ XP_RST_NONE
not set
Definition: xpath.h:434
XP_FL_BACKPTR_RDIRTY
#define XP_FL_BACKPTR_RDIRTY
static config dirty for <running>
Definition: xpath.h:285
xpath_resnode_t_
XPath result node struct.
Definition: xpath.h:585
xpath_restype_t_
xpath_restype_t_
XPath expression result type.
Definition: xpath.h:341
xpath_exop_t_
xpath_exop_t_
XPath expression operation type.
Definition: xpath.h:384
XP_EXNT_NONE
@ XP_EXNT_NONE
not set
Definition: xpath.h:410
NCX_NF_HEX
@ NCX_NF_HEX
YANG hexidecimal format.
Definition: ncxtypes.h:336
obj_gen_object_id_unique
status_t obj_gen_object_id_unique(const obj_template_t *obj, const obj_template_t *stopobj, xmlChar **buff)
Malloc and Generate the object ID for a unique-stmt test.
Definition: obj.c:10253
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
xpath_pcb_t_::targobj
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
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
xpath_pcb_t_::result_cacheQ
dlq_hdr_t result_cacheQ
Performance Caches.
Definition: xpath.h:827
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
xpath_pcb_t_::varobj
obj_template_t * varobj
bptr to key-expr LHS object
Definition: xpath.h:726
XP_RST_GET2_SKIPPED
@ XP_RST_GET2_SKIPPED
GET2 callback skipped.
Definition: xpath.h:436
ncxconst.h
Contains NCX constants.
XP_SRC_YANG
@ XP_SRC_YANG
YANG must or when.
Definition: xpath.h:376
obj_is_augclone
boolean obj_is_augclone(const obj_template_t *obj)
Figure out if the obj is a cloned object, inserted via an augment statement.
Definition: obj.c:13683
XP_CM_TARGET
@ XP_CM_TARGET
target mode (normal)
Definition: xpath.h:352
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
OBJ_TYP_CONTAINER
@ OBJ_TYP_CONTAINER
container
Definition: obj.h:614
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
xpath_check_backptrs_dirty
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:4485
xpath_result_t_::qhdr
dlq_hdr_t qhdr
queue header in case saved in a Q
Definition: xpath.h:621
TK_CUR_VAL
#define TK_CUR_VAL(T)
return the current token value
Definition: tk.h:128
XP_EXOP_NEGATE
@ XP_EXOP_NEGATE
unary '-'
Definition: xpath.h:399
XP_EXOP_GEQUAL
@ XP_EXOP_GEQUAL
r.
Definition: xpath.h:393
NCX_NF_DEC
@ NCX_NF_DEC
YANG deciaml format.
Definition: ncxtypes.h:335
NCX_BT_UINT8
@ NCX_BT_UINT8
uint8
Definition: ncxtypes.h:211
XP_EXOP_SUBTRACT
@ XP_EXOP_SUBTRACT
minus '-'
Definition: xpath.h:395
XP_SRC_XML
@ XP_SRC_XML
NETCONF select filter.
Definition: xpath.h:379
xpath_set_manual_clear
void xpath_set_manual_clear(xpath_pcb_t *pcb)
Set the manual clear mode flag in the PCB.
Definition: xpath.c:4543
xpath_walkerparms_t_
Value or object node walker fn callback parameters.
Definition: xpath.h:973
xpath_pcb_t_::impmod
ncx_module_t * impmod
[sub]module containing obj
Definition: xpath.h:743
xpath_get2_form_t_
xpath_get2_form_t_
GET2 control block forms.
Definition: xpath.h:446
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
obj_find_schema_template
obj_template_t * obj_find_schema_template(dlq_hdr_t *que, const xmlChar *modname, const xmlChar *objname)
Find an object with the specified name For YANG schema-nodeid so NEVER lookdeep.
Definition: obj.c:5717
TK_TT_FSLASH
@ TK_TT_FSLASH
forward slash char '/'
Definition: tk.h:301
xpath_pcb_t_::objmod
ncx_module_t * objmod
module containing obj.
Definition: xpath.h:740
NCX_NF_NONE
@ NCX_NF_NONE
not set
Definition: ncxtypes.h:333
ncx_locate_modqual_import
void * ncx_locate_modqual_import(yang_pcb_t *pcb, ncx_import_t *imp, const xmlChar *defname, ncx_node_t *deftyp)
Search the specific module for the specified definition name.
Definition: ncx.c:5748
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.
XP_FL_FOUND_PRED
#define XP_FL_FOUND_PRED
set if the parser found any predicates in the XPath expression
Definition: xpath.h:272
ncx_check_any_object_nolock_get
boolean ncx_check_any_object_nolock_get(const xmlChar *objname)
Check if the object name will match any config=true nodes.
Definition: ncx.c:14573
xpath1.h
XPath 1.0 expression support.
xpath_get2_cb_t_::lookupQ
dlq_hdr_t lookupQ
Q of getcb_get2_lookup_t.
Definition: xpath.h:521
XP_EXOP_DIV
@ XP_EXOP_DIV
keyword 'div'
Definition: xpath.h:397
TK_CUR_ID
#define TK_CUR_ID(T)
return TRUE if the current token type is an identifier
Definition: tk.h:171
obj_find_child_ex
obj_template_t * obj_find_child_ex(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname, ncx_name_match_t match_names, boolean alt_names, boolean dataonly, status_t *retres)
Find a child object with the specified Qname extended match modes.
Definition: obj.c:6296
xpath_aio_cb_t_::obj
obj_template_t * obj
object for this subtree
Definition: xpath.h:1035
XP_URL_ESC_WILDCARD
#define XP_URL_ESC_WILDCARD
Special URL to XPath translation.
Definition: xpath.h:185
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath_pcb_t_::get2_aio_cbQ
dlq_hdr_t get2_aio_cbQ
if AIO GET2 callbacks needed to process the XPath expression then The Subtree returned from AIO GET2 ...
Definition: xpath.h:919
xpath.h
Schema and data model Xpath search support.
xpath1_fn_get_functions_ptr
const xpath_fncb_t * xpath1_fn_get_functions_ptr(void)
Get the start of the function array for XPath 1.0 plus the current() function.
Definition: xpath1_fn.c:3474
XP_EXOP_FILTER1
@ XP_EXOP_FILTER1
fwd slash '/'
Definition: xpath.h:401
XP_EXNT_NODE
@ XP_EXNT_NODE
XML start, empty, or end tag.
Definition: xpath.h:414
NCX_PROTO_RESTCONF
@ NCX_PROTO_RESTCONF
IETF RESTCONF.
Definition: ncxtypes.h:788
xpath_discard_resnode
void xpath_discard_resnode(xpath_resnode_t *resnode)
Discard a result node.
Definition: xpath.c:4616
xpath_nodeset_delete_valptr
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:4293
ERR_NCX_WRONG_TKTYPE
@ ERR_NCX_WRONG_TKTYPE
245
Definition: status_enum.h:284
ERR_NCX_MOD_NOT_FOUND
@ ERR_NCX_MOD_NOT_FOUND
236
Definition: status_enum.h:275
xpath_pcb_t_::source
xpath_source_t source
the prefixes in the QNames in the exprstr MUST be resolved in different contexts.
Definition: xpath.h:698
xpath_compwalkerparms_t_::exop
xpath_exop_t exop
relational expression operation
Definition: xpath.h:1000
NCX_NF_REAL
@ NCX_NF_REAL
internal format for XPath
Definition: ncxtypes.h:337
xpath_pred_ent_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: xpath.h:651
xpath_get_cxt_obj
obj_template_t * xpath_get_cxt_obj(xpath_pcb_t *pcb)
Get the object pointer for the context node.
Definition: xpath.c:4096
xpath_pcb_t_::xpath_predicate
boolean xpath_predicate
true when processing a predicate
Definition: xpath.h:856
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
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
xpath_aio_cb_t_::parent_cb
struct xpath_aio_cb_t_ * parent_cb
parent AIO control block
Definition: xpath.h:1032
xpath_get2_state_t_
xpath_get2_state_t_
GET2 retrieval states.
Definition: xpath.h:433
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
xpath_rntype_t_
xpath_rntype_t_
XPath resnode union types.
Definition: xpath.h:421
xpath_pcb_t_::logerrors
boolean logerrors
T: use log_error F: suppress error messages.
Definition: xpath.h:711
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
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
xpath_pcb_t_::result_count
uint32 result_count
The count of entries in the result_cacheQ.
Definition: xpath.h:836
XP_EXOP_FILTER2
@ XP_EXOP_FILTER2
double fwd slash (C++ comment)
Definition: xpath.h:402
ncx_valid_name
boolean ncx_valid_name(const xmlChar *str, uint32 len)
Check if an xmlChar string is a valid YANG identifier value.
Definition: ncx.c:7596
xpath_pcb_t_::qhdr
dlq_hdr_t qhdr
queue header in case saved in a Q
Definition: xpath.h:670
ncx_match_any_object_ex
obj_template_t * ncx_match_any_object_ex(const xmlChar *modname, const xmlChar *objname, boolean dataonly, ncx_name_match_t name_match, boolean alt_names, status_t *retres)
Match any object in any YANG module with double extra search options.
Definition: ncx.c:4171
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
xpath_document_t_
xpath_document_t_
document root type.
Definition: xpath.h:361
XP_RNT_NONE
@ XP_RNT_NONE
not set
Definition: xpath.h:422
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
xpath_resnode_t_::node_::objptr
obj_template_t * objptr
object for YANG validation mode
Definition: xpath.h:607
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
xpath_pcb_t_::curmode
xpath_curmode_t curmode
select targ/alt/var obj
Definition: xpath.h:729
NCX_CFGID_CANDIDATE
@ NCX_CFGID_CANDIDATE
candidate datastore
Definition: ncxtypes.h:385
xpath_find_val_unique
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
xpath_compwalkerparms_t_::cmpresult
boolean cmpresult
compare result
Definition: xpath.h:1003
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_check_manual_clear
boolean xpath_check_manual_clear(xpath_pcb_t *pcb)
Check the backptrs_dirty flag in the PCB is clearly manually only.
Definition: xpath.c:4526
NCX_CFGID_STARTUP
@ NCX_CFGID_STARTUP
startup datastore
Definition: ncxtypes.h:386
XP_RT_NONE
@ XP_RT_NONE
not set
Definition: xpath.h:346
xpath_get2_cb_t_::return_keyQ
dlq_hdr_t return_keyQ
If the get2cb is NULL then this is an expanded get2 CB for a YANG list.
Definition: xpath.h:518
obj_enter_xpath_mode
void obj_enter_xpath_mode(void)
Enter xpath mode and start ignoring obj_is_enabled.
Definition: obj.c:17599
xpath_fncb_t_::name
const xmlChar * name
function name
Definition: xpath.h:959
xpath_pcb_t_::backptrs_flags
uint8 backptrs_flags
internal state for backptr handling
Definition: xpath.h:850
xpath_find_obj_in_result
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:4860
xpath_result_t_::r_
result r contains the appropiate data depending on restype
Definition: xpath.h:630
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
xpath_init_result
void xpath_init_result(xpath_result_t *result, xpath_restype_t restype)
Initialize an XPath result struct.
Definition: xpath.c:3066
XP_RNT_OBJ
@ XP_RNT_OBJ
objnode
Definition: xpath.h:423
xpath_pcb_t_::parseres
status_t parseres
first and second pass parsing results.
Definition: xpath.h:862
xpath_find_data_target_pcb
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
obj_is_dup_local
boolean obj_is_dup_local(obj_template_t *obj)
Check if this object is one that has a duplicate sibling with the same local-name and different modul...
Definition: obj.c:16854
val_child.h
Value Node Child Access Support.
xpath_pcb_t_::getvar_fn
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
xpath_compwalkerparms_t_::cmpstring
xmlChar * cmpstring
compare string
Definition: xpath.h:988
XP_EXOP_MULTIPLY
@ XP_EXOP_MULTIPLY
asterisk '*'
Definition: xpath.h:396
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
xpath_get2_node_t_::form
xpath_get2_form_t form
the form field determines the type of get2 node
Definition: xpath.h:574
XP_EXOP_LEQUAL
@ XP_EXOP_LEQUAL
l.
Definition: xpath.h:392
yang.h
YANG Module parser utilities.
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.
ncx_clean_errinfo
void ncx_clean_errinfo(ncx_errinfo_t *err)
Scrub the memory in a ncx_errinfo_t by freeing all the sub-fields.
Definition: ncx.c:8015
xpath_pcb_t_::context
xpath_resnode_t context
additive XPath1 context back- pointer to current step results.
Definition: xpath.h:785
xpath_find_schema_target_force_mod
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
xpath_find_schema_target
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
typ.h
Parameter Type Handler.
XP_EXOP_AND
@ XP_EXOP_AND
keyword 'and'
Definition: xpath.h:386
xpath_pcb_t_::docroot
obj_template_t * docroot
document root.
Definition: xpath.h:751
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
dlq_count
unsigned int dlq_count(const dlq_hdrT *listP)
get the number of queue entries in the listP queue list
Definition: dlq.c:994
NCX_CFGID_RUNNING
@ NCX_CFGID_RUNNING
running datastore (no value for not set!)
Definition: ncxtypes.h:384
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
val_get_first_leaf
val_value_t * val_get_first_leaf(val_value_t *val)
Get the first leaf or leaflist node in the specified value tree.
Definition: val.c:12185
yangconst.h
Contains YANG constants separated to prevent H file include loops.
xpath_result_t_::restype
xpath_restype_t restype
XPath result type.
Definition: xpath.h:624
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
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
obj_is_case
boolean obj_is_case(const obj_template_t *obj)
Check if object is a YANG case.
Definition: obj.c:13445
OBJ_TYP_CASE
@ OBJ_TYP_CASE
case: last named database object
Definition: obj.h:619
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
ERR_NCX_DEFSEG_NOT_FOUND
@ ERR_NCX_DEFSEG_NOT_FOUND
251
Definition: status_enum.h:290
XP_RST_GET2_ERROR
@ XP_RST_GET2_ERROR
GET2 callback error happened.
Definition: xpath.h:439
ERR_NCX_INVALID_NAME
@ ERR_NCX_INVALID_NAME
228
Definition: status_enum.h:267
ERR_NCX_INVALID_XPATH_EXPR
@ ERR_NCX_INVALID_XPATH_EXPR
348
Definition: status_enum.h:391
xpath1_fn.h
XPath 1.0 expression support; Function library.
xpath_pcb_t_::get2cb
struct getcb_get2_t_ * get2cb
the getcb for a NACM data rule test
Definition: xpath.h:902
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
TK_ID
#define TK_ID(T)
return TRUE if the token type is an identifier
Definition: tk.h:95
obj_find_template
obj_template_t * obj_find_template(dlq_hdr_t *que, const xmlChar *modname, const xmlChar *objname)
Find an object with the specified name.
Definition: obj.c:5678
XP_RST_GET2_DONE
@ XP_RST_GET2_DONE
GET2 callback done.
Definition: xpath.h:438
XP_RNT_VAL
@ XP_RNT_VAL
valptr
Definition: xpath.h:424
xpath_add_to_result
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:4565
xpath_free_resnode
void xpath_free_resnode(xpath_resnode_t *resnode)
Free a malloced XPath result node struct.
Definition: xpath.c:3240
xpath_pred_ent_t_::keyval
const xmlChar * keyval
backptr to token value
Definition: xpath.h:653
OBJ_TYP_LEAF_LIST
@ OBJ_TYP_LEAF_LIST
leaf-list
Definition: obj.h:616
ncx_init_errinfo
void ncx_init_errinfo(ncx_errinfo_t *err)
Init the fields in an ncx_errinfo_t struct.
Definition: ncx.c:7998
xpath_get2_cb_t_::get2_state
xpath_get2_state_t get2_state
current state of this entry
Definition: xpath.h:485
ncx_set_error
void ncx_set_error(ncx_error_t *tkerr, ncx_module_t *mod, uint32 linenum, uint32 linepos)
Set the fields in an ncx_error_t struct.
Definition: ncx.c:9746
xpath_set_keep_result
void xpath_set_keep_result(xpath_pcb_t *pcb)
Set the keep-result flag in the PCB.
Definition: xpath.c:4840
xpath_pcb_t_::backptrs_manual_clear
boolean backptrs_manual_clear
manual clear of backptrs needed
Definition: xpath.h:847
OBJ_TYP_RPC
@ OBJ_TYP_RPC
rpc-stmt
Definition: obj.h:623
xpath_pcb_t_::nonconfig_warn_obj
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
xpath_nodeset_swap_valptr
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:4254
XP_FL_BACKPTR_CDIRTY
#define XP_FL_BACKPTR_CDIRTY
static config dirty for <candidate>
Definition: xpath.h:282
xpath_find_pcb
xpath_pcb_t * xpath_find_pcb(dlq_hdr_t *pcbQ, const xmlChar *exprstr)
Find an XPath PCB.
Definition: xpath.c:2932
xpath_get2_cb_t_::get2cb
struct getcb_get2_t_ * get2cb
the getcb for this retrieval, ancestor keys in parent_val or parent_cb
Definition: xpath.h:506
xpath_walkerparms_t_::res
status_t res
status field to continue or exit walk
Definition: xpath.h:978
XP_EXOP_LT
@ XP_EXOP_LT
left angle bracket '<'
Definition: xpath.h:390
xpath_aio_cb_t_::valQ
dlq_hdr_t valQ
Queue of val_value that represent the current complex level object.
Definition: xpath.h:1041
XP_EXNT_PROC_INST
@ XP_EXNT_PROC_INST
processing instruction
Definition: xpath.h:413
ncx_copy_errinfo
status_t ncx_copy_errinfo(const ncx_errinfo_t *src, ncx_errinfo_t *dest)
Copy the fields from one errinfo to a blank errinfo.
Definition: ncx.c:8093
XP_RST_GET2_PENDING
@ XP_RST_GET2_PENDING
GET2 callback pending.
Definition: xpath.h:435
xpath_fncb_t_::parmcnt
int32 parmcnt
parameter count: -1 == N, 0..N == actual cnt
Definition: xpath.h:965
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
ncx_sprintf_num
status_t ncx_sprintf_num(xmlChar *buff, const ncx_num_t *num, ncx_btype_t btyp, uint32 *len)
Sprintf a ncx_num_t contents.
Definition: ncx_num.c:2357
xpath_get2_node_t_::cb
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
XP_DOC_DATABASE
@ XP_DOC_DATABASE
datastore context
Definition: xpath.h:363
xpath_pcb_t_::val_get2
struct xpath_get2_node_t_ * val_get2
YPW-1342 the context node can be one of the following nodes.
Definition: xpath.h:773
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
xpath_set_backptrs_dirty
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:4439
xpath_fncb_t_::fn
xpath_fn_t fn
callback pointer for XPath function
Definition: xpath.h:968
obj_find_child_fast
obj_template_t * obj_find_child_fast(obj_template_t *obj, xmlns_id_t nsid, const xmlChar *objname)
Find a child object with the specified Qname.
Definition: obj.c:6239
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
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
xpath_pcb_t_::mhdr
xml_msg_hdr_t * mhdr
backptr to the message header in progress if processing an XPath select filter for NETCONF
Definition: xpath.h:899
xpath_pcb_t_::tkerr
ncx_error_t tkerr
saved error info for the agent to process
Definition: xpath.h:871
xpath_pred_ent_t_::keyobj
obj_template_t * keyobj
backptr to schema tree
Definition: xpath.h:652
EMPTY_STRING
#define EMPTY_STRING
empty string used to get const xmlChar * cast
Definition: ncxconst.h:289
obj_find_child
obj_template_t * obj_find_child(obj_template_t *obj, const xmlChar *modname, const xmlChar *objname)
Find a child object with the specified Qname.
Definition: obj.c:6116
NCX_NT_OBJ
@ NCX_NT_OBJ
obj_template_t
Definition: ncxtypes.h:277
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
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_resnode_t_::dblslash
boolean dblslash
double slash mode means the shorthand for the descendant-or-self axis was used
Definition: xpath.h:592
xpath_resnode_t_::node_::valptr
val_value_t * valptr
result is a plain value node
Definition: xpath.h:608
xpath_pcb_t_::disabled_obj_ok
boolean disabled_obj_ok
YPW-1774: need to ignore if-feature=false while validating leafref path-stmt.
Definition: xpath.h:927
XP_EXOP_OR
@ XP_EXOP_OR
keyword 'or'
Definition: xpath.h:387
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
ERR_NCX_WRONG_NUMTYP
@ ERR_NCX_WRONG_NUMTYP
289
Definition: status_enum.h:332
xpath_get2_node_t_::val
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
obj_ok_for_nolock
boolean obj_ok_for_nolock(const obj_template_t *obj)
check an object OK for nolock
Definition: obj.c:18194
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
xpath_fncb_t_::restype
xpath_restype_t restype
expected result type
Definition: xpath.h:962
xpath_resnode_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: xpath.h:587
xpath_new_pcb_ex
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
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
xpath_pcb_t_::pred_entQ
dlq_hdr_t pred_entQ
Internal state processing, Q of xpath_pred_ent_t.
Definition: xpath.h:905
OBJ_TYP_RPCIO
@ OBJ_TYP_RPCIO
rpc input or output
Definition: obj.h:624
XP_DOC_RPC_REPLY
@ XP_DOC_RPC_REPLY
rpc-output context
Definition: xpath.h:365
xpath_stringwalkerparms_t_::buffer
xmlChar * buffer
buffer used for stringifying the node-set
Definition: xpath.h:1013
ncx_set_num_one
void ncx_set_num_one(ncx_num_t *num, ncx_btype_t btyp)
Set a number to one.
Definition: ncx_num.c:492
xpath_get_varbindQ
dlq_hdr_t * xpath_get_varbindQ(xpath_pcb_t *pcb)
Get the varbindQ from a parser control block struct.
Definition: xpath.c:4168
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
xpath_result_t_::r_::boo
boolean boo
boolean result
Definition: xpath.h:635
XP_FL_LOAD_IMPORT
#define XP_FL_LOAD_IMPORT
OLD: bit 2 not used.
Definition: xpath.h:211
xpath_cvt_string
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:3821
xpath_clone_pcb
xpath_pcb_t * xpath_clone_pcb(const xpath_pcb_t *srcpcb)
Clone an XPath PCB.
Definition: xpath.c:2822
xpath_get_resnode_objptr
obj_template_t * xpath_get_resnode_objptr(xpath_resnode_t *resnode)
Get the result node object pointer (obsolete)
Definition: xpath.c:4148
xpath_pcb_t_
XPath parser control block.
Definition: xpath.h:668
xpath_pcb_t_::backptrs_mode
boolean backptrs_mode
must/when/data-rule obj_template_t backptr caching support backptrs in use
Definition: xpath.h:844
xpath_get_resnodeQ
dlq_hdr_t * xpath_get_resnodeQ(xpath_result_t *result)
Get the renodeQ from a result struct.
Definition: xpath.c:3905
xpath_pcb_t_::resnode_cacheQ
dlq_hdr_t resnode_cacheQ
Q of xpath_resnode_t.
Definition: xpath.h:833
xpath_expr_ok_for_nolock_get
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:4997
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
xpath_get2_cb_t_::parent_val
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
obj_get_real_mod
ncx_module_t * obj_get_real_mod(obj_template_t *obj)
Get the module struct for the submodule or main module with this object.
Definition: obj.c:18549
xpath_pcb_t_::cookie
void * cookie
The cookie registered with the getvar_fn.
Definition: xpath.h:799
xpath_new_result
xpath_result_t * xpath_new_result(xpath_restype_t restype)
malloc an XPath result
Definition: xpath.c:3033
xpath_pcb_t_::tkc
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
NCX_BT_FLOAT64
@ NCX_BT_FLOAT64
hidden: just for XPath
Definition: ncxtypes.h:216
ERR_NCX_PUSH_UNCHANGING_SELECTION
@ ERR_NCX_PUSH_UNCHANGING_SELECTION
437
Definition: status_enum.h:484
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
XP_RNT_VALHDR
@ XP_RNT_VALHDR
valhdr
Definition: xpath.h:425
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
xpath_delete_resnode
void xpath_delete_resnode(xpath_resnode_t *resnode)
Delete and free a malloced XPath result node struct.
Definition: xpath.c:3267
xml_strcpy
uint32 xml_strcpy(xmlChar *copyTo, const xmlChar *copyFrom)
String copy for xmlChar.
Definition: xml_util.c:1486
xmlns_get_modptr
void * xmlns_get_modptr(xmlns_id_t nsid)
get the module pointer for the namespace ID
Definition: xmlns.c:1151
ERR_NCX_NOTIF_FILTER_UNSUPPORTED
@ ERR_NCX_NOTIF_FILTER_UNSUPPORTED
424
Definition: status_enum.h:469
xpath_pcb_t_::get2_cbQ
dlq_hdr_t get2_cbQ
if GET2 callbacks needed to process the XPath expression then they will be stored in this queue and x...
Definition: xpath.h:887
xpath_pcb_t_::yang_pcb
void * yang_pcb
backptr to yang parser control block in progress used to force an inline import instead of returning ...
Definition: xpath.h:880
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
xpath_pcb_t_::errinfo
ncx_errinfo_t errinfo
must-stmt error info.
Definition: xpath.h:704
xpath_resnode_count
uint32 xpath_resnode_count(xpath_result_t *result)
Get the number of resnodes in the node-set.
Definition: xpath.c:4594
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_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
xpath_pcb_t_::missing_errors
boolean missing_errors
T: missing node is error.
Definition: xpath.h:714
xpath_get2_cb_t_::val
val_value_t * val
dummy value for container or list control block DO NOT USE DIRECTLY FOR CHILDREN OR PARENT
Definition: xpath.h:493
XP_FL_BACKPTR_SDIRTY
#define XP_FL_BACKPTR_SDIRTY
static config dirty for <startup>
Definition: xpath.h:288
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
xpath_stringwalkerparms_t_::res
status_t res
result of stringify operation
Definition: xpath.h:1022
xpath_nodeset_empty
boolean xpath_nodeset_empty(const xpath_result_t *result)
Check if the result is an empty nodeset.
Definition: xpath.c:4228
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
XP_CM_NONE
@ XP_CM_NONE
not set
Definition: xpath.h:351
ncx.h
YANG module utility functions.
xpath_pcb_t_::resnode_count
uint32 resnode_count
The count of entries in the resnode_cacheQ.
Definition: xpath.h:839
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
xpath_nodetype_t_
xpath_nodetype_t_
XPath expression node types.
Definition: xpath.h:409
xpath_get_resnode_val
val_value_t * xpath_get_resnode_val(xpath_resnode_t *resnode)
Get the resnode value pointer from a resnode, if any.
Definition: xpath.c:4113
xpath_get2_cb_t_::parent_cb
struct xpath_get2_cb_t_ * parent_cb
parent control block used if parent_val not used
Definition: xpath.h:501
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
xpath1_aio_free_cb
void xpath1_aio_free_cb(xpath_aio_cb_t *cb)
Free a malloced AIO control block.
Definition: xpath1_aio.c:468
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
xpath_resnode_t_::node_::get2node
xpath_get2_node_t get2node
result is a GET2 state node
Definition: xpath.h:610
XP_EXOP_NOTEQUAL
@ XP_EXOP_NOTEQUAL
bang equals '!='
Definition: xpath.h:389
ERR_NCX_XPATH_NOT_NODESET
@ ERR_NCX_XPATH_NOT_NODESET
370
Definition: status_enum.h:413
OBJ_TYP_ACTION
@ OBJ_TYP_ACTION
not really data, YANG 1.1 only
Definition: obj.h:627
XP_FORM_NONE
@ XP_FORM_NONE
not set
Definition: xpath.h:447
xpath_clear_load_import
void xpath_clear_load_import(xpath_pcb_t *pcb)
Clear the PCB out of load import mode.
Definition: xpath.c:4741
xpath1_res.h
XPath 1.0 expression support; result support.
XP_RT_BOOLEAN
@ XP_RT_BOOLEAN
boolean result
Definition: xpath.h:350
xpath_get2_cb_t_::obj
obj_template_t * obj
the GET2 callback is expected to be in this object
Definition: xpath.h:488
XP_CM_ALT
@ XP_CM_ALT
alternate mode
Definition: xpath.h:353
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
ncx_find_object_nsid
obj_template_t * ncx_find_object_nsid(xmlns_id_t nsid, const xmlChar *objname)
Find a top level module object by module NSID.
Definition: ncx.c:4363
xpath_find_schema_target_int
status_t xpath_find_schema_target_int(const xmlChar *target, obj_template_t **targobj)
@
Definition: xpath.c:2475
xpath_pcb_t_::seen
boolean seen
internal yangdiff support
Definition: xpath.h:874
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
ncx_convert_num
status_t ncx_convert_num(const xmlChar *numstr, ncx_numfmt_t numfmt, ncx_btype_t btyp, ncx_num_t *val)
Convert a number string to a numeric type.
Definition: ncx_num.c:717
xpath_new_session_pcb
xpath_pcb_t * xpath_new_session_pcb(ses_cb_t *scb, const xmlChar *expr, status_t *res)
Get a new XPath parser control block for a session.
Definition: xpath.c:4669
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
XP_RST_GET2_START
@ XP_RST_GET2_START
GET2 callback starting.
Definition: xpath.h:437
xpath_expr_has_predicates
boolean xpath_expr_has_predicates(xpath_pcb_t *pcb)
Check if any predicates parsed in the expression.
Definition: xpath.c:4897
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
xpath_source_t_
xpath_source_t_
XPath expression source type.
Definition: xpath.h:373
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
xpath_clean_resnode
void xpath_clean_resnode(xpath_resnode_t *resnode)
Clean an XPath result node struct.
Definition: xpath.c:3289
ERR_NCX_DATA_MISSING
@ ERR_NCX_DATA_MISSING
272
Definition: status_enum.h:313
NEED_EXIT
#define NEED_EXIT(res)
used in parser routines to decide if processing can continue does not return, just evaluates to TRUE ...
Definition: yangconst.h:234
var_clean_varQ
void var_clean_varQ(dlq_hdr_t *varQ)
Clean a Q of ncx_var_t.
Definition: var.c:1170
OBJ_TYP_LEAF
@ OBJ_TYP_LEAF
leaf
Definition: obj.h:615
xpath_pcb_t_::context_result
xpath_result_t * context_result
internal context result during processing
Definition: xpath.h:791
xpath_get2_node_t_
Special XPath GET2 resnode.
Definition: xpath.h:529
xpath_get2_cb_t_::return_termQ
dlq_hdr_t return_termQ
Q of val_value_t *.
Definition: xpath.h:519
xpath_get2_cb_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: xpath.h:482
xpath_compwalkerparms_t_
Value node compare walker fn callback parameters.
Definition: xpath.h:983
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
XP_RT_NODESET
@ XP_RT_NODESET
node-set result
Definition: xpath.h:347
XP_FORM_GETCB_TERM
@ XP_FORM_GETCB_TERM
terminal node CB
Definition: xpath.h:449
obj_get_typestr
const xmlChar * obj_get_typestr(const obj_template_t *obj)
Get the name of the object type.
Definition: obj.c:11392
xpath_pcb_t_::functions
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
xpath_free_pred_ent
void xpath_free_pred_ent(xpath_pred_ent_t *ent)
Free a malloced XPath predicate entry struct.
Definition: xpath.c:4973
xpath_find_schema_target_restconf
status_t xpath_find_schema_target_restconf(const xmlChar *target, obj_template_t **targobj)
Find a schema target for RESTCONF.
Definition: xpath.c:2515
xpath_stringwalkerparms_t_::buffsize
uint32 buffsize
size of buffer
Definition: xpath.h:1016
xpath_result_is_get2
boolean xpath_result_is_get2(xpath_result_t *result)
Check if the result is a node-set for GET2 nodes.
Definition: xpath.c:5144
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
status.h
Global error messages for status code enumerations.
XP_DOC_RPC
@ XP_DOC_RPC
rpc-input context
Definition: xpath.h:364
XP_SRC_NONE
@ XP_SRC_NONE
not set
Definition: xpath.h:374
xpath_getvar_fn_t
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
xpath_resnode_t_::node_::valhdr
val_child_hdr_t * valhdr
result is a value node header
Definition: xpath.h:609
xpath_get2_cb_t_
Special XPath GET2 state record to be used instead of val_value_t or val_child_hdr_t pointers.
Definition: xpath.h:481
xpath_pcb_t_::validateres
status_t validateres
validation stage result
Definition: xpath.h:865
xpath_get_first_real_resnode
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:5110
xpath_convert_url_to_path
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:4374
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:
obj_has_get2cb
boolean obj_has_get2cb(obj_template_t *obj)
Check if current object has GET2 callback registered.
Definition: obj.c:18099
var.h
NCX Variable Support. Used within a runstack by a CLI user or script.
xpath_stringwalkerparms_t_::buffpos
uint32 buffpos
current buffer position
Definition: xpath.h:1019
getcb_get2_t_
GET2 control block.
Definition: getcb.h:339
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
xpath_new_resnode
xpath_resnode_t * xpath_new_resnode(void)
Create and initialize an XPath result node struct.
Definition: xpath.c:3189
xpath_get_restype_str
const xmlChar * xpath_get_restype_str(xpath_restype_t restype)
Get the string for the specific result type.
Definition: xpath.c:4811
xpath_compwalkerparms_t_::res
status_t res
status of walker operation
Definition: xpath.h:1006