yumapro  20.10-12
YumaPro SDK
val_util.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_val_util
13 #define _H_val_util
14 
15 /* FILE: val_util.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 19-dec-05 abb Begun
36 21jul08 abb start obj-based rewrite
37 29jul08 abb split out from val.h
38 
39 */
40 
41 #include <xmlstring.h>
42 
43 #ifndef _H_ncxtypes
44 #include "ncxtypes.h"
45 #endif
46 
47 #ifndef _H_obj
48 #include "obj.h"
49 #endif
50 
51 #ifndef _H_op
52 #include "op.h"
53 #endif
54 
55 #ifndef _H_plock
56 #include "plock.h"
57 #endif
58 
59 #ifndef _H_ses
60 #include "ses.h"
61 #endif
62 
63 #ifndef _H_runstack
64 #include "runstack.h"
65 #endif
66 
67 #ifndef _H_status
68 #include "status.h"
69 #endif
70 
71 #ifndef _H_val
72 #include "val.h"
73 #endif
74 
75 #ifndef _H_xml_msg
76 #include "xml_msg.h"
77 #endif
78 
79 #ifndef _H_xmlns
80 #include "xmlns.h"
81 #endif
82 
83 #ifndef _H_xpath
84 #include "xpath.h"
85 #endif
86 
87 #ifdef __cplusplus
88 extern "C" {
89 #endif
90 
91 /********************************************************************
92 * *
93 * T Y P E S *
94 * *
95 *********************************************************************/
96 
131 typedef boolean
132  (*val_nodetest_fn_t) (xml_msg_hdr_t *mhdr,
133  ncx_withdefaults_t withdef,
134  boolean realtest,
135  val_value_t *node);
136 
137 
154 typedef struct val_getbulk_return_t_ {
157 
159  uint32 retcount;
160 
162  boolean retdone;
163 } val_getbulk_return_t;
164 
165 
186 typedef status_t
187  (*val_getbulk_cbfn_t) (obj_template_t *obj,
188  uint32 start_idx,
189  uint32 max_count,
190  uint32 max_depth,
191  val_nodetest_fn_t node_test_fn,
192  val_getbulk_return_t *getbulk_return);
193 
194 
195 
196 
197 /********************************************************************
198 * *
199 * F U N C T I O N S *
200 * *
201 *********************************************************************/
202 
203 
247 extern void
248  val_set_canonical_order (val_value_t *val);
249 
250 
260 extern status_t
261  val_gen_index_comp (const obj_key_t *in,
262  val_value_t *val);
263 
264 
273 extern status_t
274  val_gen_key_entry (val_value_t *keyval);
275 
276 
290 extern status_t
291  val_gen_index_chain (const obj_template_t *obj,
292  val_value_t *val);
293 
294 
324 extern status_t
325  val_add_defaults (val_value_t *val,
326  boolean scriptmode);
327 
328 
363 extern status_t
364  val_add_defaults_ex (val_value_t *val,
365  boolean scriptmode,
366  runstack_context_t *rcxt,
367  time_t last_modified,
368  ncx_etag_t etag);
369 
370 
386 extern status_t
387  val_add_node_defaults (obj_template_t *chobj,
388  val_value_t *val,
389  boolean scriptmode,
390  time_t last_modified,
391  ncx_etag_t etag);
392 
393 
408 status_t
409  val_instance_check (val_value_t *root,
410  val_value_t *val,
411  obj_template_t *obj);
412 
413 
429 extern status_t
430  val_instance_check_ex (val_value_t *root,
431  val_value_t *val,
432  obj_template_t *obj,
433  boolean check_when);
434 
435 
454 extern status_t
455  val_instance_check_max (val_value_t *root,
456  val_value_t *val,
457  obj_template_t *obj,
458  boolean check_when,
459  boolean check_deep,
460  ses_cb_t *scb,
461  xml_msg_hdr_t *msg);
462 
463 
479 extern val_value_t *
480  val_get_choice_first_set (val_value_t *val,
481  const obj_template_t *obj);
482 
483 
496 extern val_value_t *
497  val_get_choice_first_set_full (val_value_t *val,
498  const obj_template_t *obj);
499 
500 
513 extern val_value_t *
514  val_get_choice_first_set_ex (val_value_t *val,
515  const obj_template_t *obj,
516  boolean nondef);
517 
518 
529 extern val_value_t *
530  val_get_choice_next_set (const obj_template_t *obj,
531  val_value_t *curchild);
532 
533 
545 extern boolean
546  val_choice_is_set (val_value_t *val,
547  obj_template_t *obj);
548 
549 
556 extern void
557  val_purge_errors_from_root (val_value_t *val);
558 
559 
573 extern val_value_t *
575  const xmlChar *name,
576  boolean copyname,
577  val_value_t *parent,
578  op_editop_t editop,
579  obj_template_t *obj);
580 
581 
595 extern status_t
596  val_gen_instance_id (xml_msg_hdr_t *mhdr,
597  const val_value_t *val,
598  ncx_instfmt_t format,
599  xmlChar **buff);
600 
601 
617 extern status_t
618  val_gen_instance_id_ex (xml_msg_hdr_t *mhdr,
619  const val_value_t *val,
620  ncx_instfmt_t format,
621  boolean stop_at_root,
622  xmlChar **buff);
623 
624 
645 extern status_t
646  val_gen_instance_id_ex2 (xml_msg_hdr_t *mhdr,
647  const val_value_t *val,
648  const val_value_t *stopval,
649  ncx_instfmt_t format,
650  boolean stop_at_root,
651  xmlChar **buff);
652 
653 
674 extern status_t
675  val_gen_split_instance_id (xml_msg_hdr_t *mhdr,
676  const val_value_t *val,
677  ncx_instfmt_t format,
678  xmlns_id_t leaf_nsid,
679  const xmlChar *leaf_name,
680  boolean stop_at_root,
681  xmlChar **buff);
682 
683 
702 extern status_t
703  val_get_index_string (xml_msg_hdr_t *mhdr,
704  ncx_instfmt_t format,
705  boolean force_quotes,
706  const val_value_t *val,
707  xmlChar *buff,
708  uint32 *len);
709 
710 
731 extern status_t
732  val_check_obj_when (val_value_t *val,
733  val_value_t *valroot,
734  val_value_t *objval,
735  obj_template_t *obj,
736  boolean *condresult,
737  uint32 *whencount);
738 
739 
793 extern status_t
794  val_check_obj_when_ex (val_value_t *val,
795  val_value_t *valroot,
796  val_value_t *objval,
797  obj_template_t *obj,
798  xml_msg_hdr_t *mhdr,
799  boolean configonly,
800  boolean get_when,
801  ses_cb_t *pcb_session,
802  struct xpath_get2_cb_t_ *parent_cb,
803  boolean *condresult,
804  uint32 *whencount);
805 
806 
825 extern status_t
826  val_remove_false_when (val_value_t *val,
827  boolean *deleteme);
828 
829 
847 extern status_t
848  val_remove_false_when_error (const xmlChar *name,
849  val_value_t *val,
850  obj_template_t *obj,
851  boolean is_error,
852  boolean real_delete,
853  boolean *deleteme);
854 
855 
862 extern xpath_pcb_t *
863  val_get_xpathpcb (val_value_t *val);
864 
865 
872 extern const xpath_pcb_t *
873  val_get_const_xpathpcb (const val_value_t *val);
874 
875 
883 extern status_t
884  val_copy_xpathpcb (val_value_t *val,
885  const xpath_pcb_t *xpathpcb);
886 
887 
895 extern status_t
896  val_set_xpathpcb (val_value_t *val,
897  xpath_pcb_t *xpathpcb);
898 
899 
916 extern val_value_t *
917  val_make_simval_obj (obj_template_t *obj,
918  const xmlChar *valstr,
919  status_t *res);
920 
921 
937 extern status_t
938  val_set_simval_obj (val_value_t *val,
939  obj_template_t *obj,
940  const xmlChar *valstr);
941 
942 
953 extern val_value_t *
954  val_make_binary_obj (obj_template_t *obj,
955  const xmlChar *binstr,
956  uint32 binstrlen,
957  status_t *res);
958 
959 
960 
970 extern val_value_t *
971  val_make_idref_obj (obj_template_t *obj,
972  const val_idref_t *leafval,
973  status_t *res);
974 
975 
995 extern status_t
996  val_set_warning_parms (val_value_t *parentval);
997 
998 
1019 extern status_t
1020  val_set_logging_parms (val_value_t *parentval);
1021 
1022 
1058 extern status_t
1059  val_set_logging_parms_ex (val_value_t *parentval,
1060  const xmlChar *fhs_logfile);
1061 
1062 
1082 extern status_t
1083  val_set_path_parms (val_value_t *parentval);
1084 
1085 
1096 extern status_t
1097  val_set_subdirs_parm (val_value_t *parentval);
1098 
1099 
1120 extern status_t
1121  val_set_feature_parms (val_value_t *parentval);
1122 
1123 
1132 extern status_t
1133  val_set_protocols_parm (val_value_t *parentval);
1134 
1135 
1145 extern status_t
1146  val_set_ses_protocols_parm (ses_cb_t *scb,
1147  val_value_t *parentval);
1148 
1149 
1158 extern status_t
1159  val_set_message_indent_parm (val_value_t *parentval);
1160 
1161 
1173 extern status_t
1174  val_set_home_parms (val_value_t *parentval);
1175 
1176 
1185 extern status_t
1186  val_set_with_ocpattern_parm (val_value_t *parentval);
1187 
1188 
1198 extern status_t
1199  val_set_errmsg_parm (val_value_t *parentval);
1200 
1201 
1215 extern status_t
1216  val_ok_to_partial_lock (val_value_t *val,
1217  ses_id_t sesid,
1218  ses_id_t *lockowner);
1219 
1220 
1232 extern status_t
1233  val_set_partial_lock (val_value_t *val,
1234  plock_cb_t *plcb);
1235 
1236 
1243 extern void
1244  val_clear_partial_lock (val_value_t *val,
1245  plock_cb_t *plcb);
1246 
1247 
1266 extern status_t
1267  val_write_ok (val_value_t *val,
1268  op_editop_t editop,
1269  ses_id_t sesid,
1270  boolean checkup,
1271  uint32 *lockid);
1272 
1273 
1284 extern void
1285  val_check_swap_resnode (val_value_t *curval,
1286  val_value_t *newval);
1287 
1288 
1295 extern void
1296  val_check_delete_resnode (val_value_t *curval);
1297 
1298 
1305 extern void
1306  val_write_extern (ses_cb_t *scb,
1307  const val_value_t *val);
1308 
1309 
1316 extern void
1317  val_write_intern (ses_cb_t *scb,
1318  const val_value_t *val);
1319 
1320 
1345 extern val_value_t *
1346  val_get_value (ses_cb_t *scb,
1347  xml_msg_hdr_t *msg,
1348  val_value_t *val,
1349  val_nodetest_fn_t testfn,
1350  boolean acmcheck,
1351  boolean *malloced,
1352  status_t *res);
1353 
1354 
1382 extern val_value_t *
1383  val_get_value_ex (ses_cb_t *scb,
1384  xml_msg_hdr_t *msg,
1385  val_value_t *val,
1386  val_nodetest_fn_t testfn,
1387  boolean acmcheck,
1388  boolean *malloced,
1389  status_t *res,
1390  void *get2cb); // getcb_get2_t *
1391 
1392 
1406 extern void
1407  val_traverse_keys (val_value_t *val,
1408  void *cookie1,
1409  void *cookie2,
1410  val_walker_fn_t walkerfn);
1411 
1412 
1424 extern status_t
1425  val_build_index_chains (val_value_t *val);
1426 
1427 
1437 extern status_t
1438  val_cache_datarule (val_value_t *val,
1439  void *rule);
1440 
1441 
1450 extern void
1451  val_clear_datarule (val_value_t *val,
1452  const void *rule);
1453 
1454 
1462 extern boolean
1463  val_match_datarule (const val_value_t *val,
1464  void *rule);
1465 
1466 
1478 extern val_value_t *
1479  val_find_list_from_keyvalQ (val_value_t *parentval,
1480  val_value_t *firstmatch,
1481  dlq_hdr_t *keyvalQ,
1482  status_t *res);
1483 
1484 
1503 extern status_t
1504  val_move_config_false (val_value_t *newval,
1505  val_value_t *curval);
1506 
1507 
1515 extern status_t
1516  val_add_one_operation_attr (val_value_t *val,
1517  op_editop_t op);
1518 
1519 
1525 extern val_value_t *
1526  val_make_config_root (void);
1527 
1528 
1546 extern status_t
1547  val_expand_var_expr (val_value_t *val,
1548  xmlChar **retstr);
1549 
1550 
1564 extern void
1565  val_fixup_config_subtree (val_value_t *val,
1566  xmlns_id_t fixup_id);
1567 
1568 
1580 extern status_t
1581  val_gen_keyptrs (val_value_t *val,
1582  dlq_hdr_t *keyptrQ);
1583 
1584 
1595 extern status_t
1596  val_gen_keyclones (val_value_t *val,
1597  dlq_hdr_t *keyQ);
1598 
1599 
1608 extern status_t
1609  val_add_datapath_attr (val_value_t *val,
1610  obj_template_t *obj);
1611 
1612 
1620 extern status_t
1621  val_add_fixed_value_attr (val_value_t *val);
1622 
1623 
1631 extern boolean
1632  val_is_fixed_value (val_value_t *val);
1633 
1634 
1642 extern status_t
1643  val_add_btype_attr (val_value_t *val,
1644  ncx_btype_t btype);
1645 
1646 
1670 extern status_t
1671  val_convert_anyxml_to_real (val_value_t *anyxml_val,
1672  val_value_t *real_val,
1673  val_value_t **error_val);
1674 
1675 
1687 extern val_value_t *
1688  val_make_internal_value (const xmlChar *name,
1689  const xmlChar *value);
1690 
1691 
1699 extern val_value_t *
1700  val_make_external_value (obj_template_t *obj,
1701  xmlChar *fname);
1702 
1703 
1715 extern boolean
1716  val_obj_has_config_defaults (val_value_t *val,
1717  obj_template_t *obj);
1718 
1719 
1726 extern boolean
1727  val_simple_anyxml (const val_value_t *val);
1728 
1729 
1739 extern status_t
1740  val_apply_template (val_value_t *template_val,
1741  val_value_t *target_val);
1742 
1743 
1756 extern status_t
1757  val_convert_children (val_value_t *srcval,
1758  val_value_t *destval);
1759 
1760 
1768 extern void
1769  val_merge_return_vals (dlq_hdr_t *srcQ,
1770  dlq_hdr_t *dstQ);
1771 
1772 
1781 extern status_t
1782  val_set_binary_display_maxlen_parm (val_value_t *parentval);
1783 
1784 
1797 extern status_t
1798  val_validate_value (val_value_t *useval);
1799 
1800 
1807 extern boolean
1808  val_type_is_any (const val_value_t *val);
1809 
1810 
1817 extern ncx_nmda_origin_t
1818  val_get_origin (const val_value_t *val);
1819 
1820 
1821 
1828 extern void
1829  val_set_origin (val_value_t *val,
1830  ncx_nmda_origin_t origin);
1831 
1832 
1839 extern obj_template_t *
1840  val_get_casobj (val_value_t *val);
1841 
1842 
1849 extern void
1850  val_set_anyxml_tracking (val_value_t *val,
1851  obj_template_t *obj);
1852 
1853 
1865 extern void
1866  val_get_anyxml_tracking (const val_value_t *val,
1867  boolean *iskey,
1868  boolean *isconfig,
1869  boolean *isunknown);
1870 
1871 
1878 extern xmlns_id_t
1879  val_get_idref_nsid (const val_value_t *val);
1880 
1881 
1885 #ifdef __cplusplus
1886 } /* end extern 'C' */
1887 #endif
1888 
1889 #endif /* _H_val_util */
xpath1_get2.h
XPath 1.0 expression support for server GET2 callback functions.
ERR_NCX_NOT_CONFIG
@ ERR_NCX_NOT_CONFIG
342
Definition: status_enum.h:385
XP_FORM_GETCB
@ XP_FORM_GETCB
normal GET2 CB
Definition: xpath.h:448
obj_first_child
obj_template_t * obj_first_child(obj_template_t *obj)
Get the first child object if the specified object has any children.
Definition: obj.c:6687
typ_get_basetype
ncx_btype_t typ_get_basetype(const typ_def_t *typdef)
Get the final base type of the specified typ_def_t.
Definition: typ.c:1764
ses.h
NETCONF Session Common definitions module.
val_gen_split_instance_id
status_t val_gen_split_instance_id(xml_msg_hdr_t *mhdr, const val_value_t *val, ncx_instfmt_t format, xmlns_id_t leaf_nsid, const xmlChar *leaf_name, boolean stop_at_root, xmlChar **buff)
Malloc and Generate the instance ID string for this value node, Add the last node from the parameters...
Definition: val_util.c:3598
ERR_NCX_SKIPPED
@ ERR_NCX_SKIPPED
2001
Definition: status_enum.h:551
NCX_MATCH_EXACT
@ NCX_MATCH_EXACT
exact (default)
Definition: ncxtypes.h:523
xml_strlen
uint32 xml_strlen(const xmlChar *str)
Get the String len for xmlChar.
Definition: xml_util.c:1406
obj_get_default_case
obj_template_t * obj_get_default_case(obj_template_t *obj)
Get the default case for the specified OBJ_TYP_CHOICE object.
Definition: obj.c:11703
ncx_get_empty_npcon_presence
boolean ncx_get_empty_npcon_presence(void)
Get the empty_npcon_presence value.
Definition: ncx.c:13615
VAL_FL_ANYXML_KEY
#define VAL_FL_ANYXML_KEY
set if anyxml tracking is done and this node is identified as a key leaf
Definition: val.h:309
val_set_dname
status_t val_set_dname(val_value_t *val, const xmlChar *dname)
Set the dname field.
Definition: val.c:15387
cfg.h
val_get_origin
ncx_nmda_origin_t val_get_origin(const val_value_t *val)
Get the NMDA origin value for this node.
Definition: val_util.c:7943
ncx_feature.h
NCX Module Library YANG Feature Utility Functions.
val_remove_key
void val_remove_key(val_value_t *keyval)
Remove a key pointer because the key is invalid Free the key pointer.
Definition: val.c:13291
val_gen_instance_id_ex2
status_t val_gen_instance_id_ex2(xml_msg_hdr_t *mhdr, const val_value_t *val, const val_value_t *stopval, ncx_instfmt_t format, boolean stop_at_root, xmlChar **buff)
Malloc and Generate the instance ID string for this value node,.
Definition: val_util.c:3502
log_set_syslog_log_level
void log_set_syslog_log_level(log_debug_t dlevel)
Set the syslog log level.
Definition: log.c:3438
NCX_IFMT_XPATH1
@ NCX_IFMT_XPATH1
single-quote Xpath for filter
Definition: ncxtypes.h:399
ERR_NCX_MISSING_CHOICE
@ ERR_NCX_MISSING_CHOICE
296 - 13.6
Definition: status_enum.h:339
val_fixup_config_subtree
void val_fixup_config_subtree(val_value_t *val, xmlns_id_t fixup_id)
Look for a config subtree (obj_is_root) and make sure all the value nodes in the subtree have proper ...
Definition: val_util.c:6879
val_set_home_parms
status_t val_set_home_parms(val_value_t *parentval)
Handle the home and yumapro-home parameters.
Definition: val_util.c:5415
xpath_free_pcb
void xpath_free_pcb(xpath_pcb_t *pcb)
Free a malloced XPath parser control block.
Definition: xpath.c:2963
ERR_NCX_WRONG_NODETYP
@ ERR_NCX_WRONG_NODETYP
282
Definition: status_enum.h:325
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
plock_get_sid
uint32 plock_get_sid(plock_cb_t *plcb)
Get the session ID holding this partial lock.
Definition: plock.c:153
val_get_choice_first_set_full
val_value_t * val_get_choice_first_set_full(val_value_t *val, const obj_template_t *obj)
Check a val_value_t struct against its expected OBJ to determine if a specific choice has already bee...
Definition: val_util.c:3156
obj_next_ckey
const obj_key_t * obj_next_ckey(const obj_key_t *objkey)
Get the next key record: Const version.
Definition: obj.c:9611
val_value_t_::res
status_t res
validation result
Definition: val.h:910
val_unique_stmt_check
status_t val_unique_stmt_check(ses_cb_t *scb, xml_msg_hdr_t *msg, obj_template_t *obj, val_value_t *parent, val_value_t *firstval, val_value_t *root, record_unique_error_t error_fn)
Check for the proper uniqueness of the tuples within the set of list instances for the specified node...
Definition: val_unique.c:432
OBJ_TYP_LIST
@ OBJ_TYP_LIST
list: last real database object
Definition: obj.h:617
val_set_simval_obj
status_t val_set_simval_obj(val_value_t *val, obj_template_t *obj, const xmlChar *valstr)
Set an initialized val_value_t as a simple type.
Definition: val_util.c:4444
val_traverse_keys
void val_traverse_keys(val_value_t *val, void *cookie1, void *cookie2, val_walker_fn_t walkerfn)
Check ancestor-or-self nodes until root reached.
Definition: val_util.c:6277
NCX_IQUAL_1MORE
@ NCX_IQUAL_1MORE
'+' == 1 or more
Definition: ncxtypes.h:299
NCX_BT_BINARY
@ NCX_BT_BINARY
binary (base64)
Definition: ncxtypes.h:218
val_add_btype_attr
status_t val_add_btype_attr(val_value_t *val, ncx_btype_t btype)
Add the ye:btype attribute to a <key> node for a SIL-SA edit.
Definition: val_util.c:7188
obj_get_typdef
typ_def_t * obj_get_typdef(obj_template_t *obj)
Get the typdef for the leaf or leaf-list.
Definition: obj.c:11991
val_check_obj_when_ex
status_t val_check_obj_when_ex(val_value_t *val, val_value_t *valroot, val_value_t *objval, obj_template_t *obj, xml_msg_hdr_t *mhdr, boolean configonly, boolean get_when, ses_cb_t *pcb_session, struct xpath_get2_cb_t_ *parent_cb, boolean *condresult, uint32 *whencount)
checks when-stmt only (extended)
val_add_one_operation_attr
status_t val_add_one_operation_attr(val_value_t *val, op_editop_t op)
Add the nc:operation attribute to a value node.
Definition: val_util.c:6658
OP_EDITOP_REPLACE
@ OP_EDITOP_REPLACE
edit op is replace
Definition: op.h:125
val_type_is_any
boolean val_type_is_any(const val_value_t *val)
Check if val_value node is a proper simple type ANYXML.
Definition: val_util.c:7918
val_get_choice_next_set
val_value_t * val_get_choice_next_set(const obj_template_t *obj, val_value_t *curchild)
Check a val_value_t struct against its expected OBJ to determine if a specific choice has already bee...
Definition: val_util.c:3218
ERR_NCX_MISSING_INDEX
@ ERR_NCX_MISSING_INDEX
306
Definition: status_enum.h:349
OP_EDITOP_NONE
@ OP_EDITOP_NONE
not set
Definition: op.h:123
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
ncx_decode_num
status_t ncx_decode_num(const xmlChar *numstr, ncx_btype_t btyp, ncx_num_t *retnum)
Handle some sort of number string.
Definition: ncx_num.c:1288
val_set_name
void val_set_name(val_value_t *val, const xmlChar *name, uint32 namelen)
Set (or reset) the name of a value struct.
Definition: val.c:2875
val_simple_anyxml
boolean val_simple_anyxml(const val_value_t *val)
Check if val_value node is a proper simple type ANYXML.
Definition: val_util.c:7480
obj_is_mandatory
boolean obj_is_mandatory(obj_template_t *obj)
Figure out if the obj is YANG mandatory or not.
Definition: obj.c:13510
val_find_meta
val_value_t * val_find_meta(val_value_t *val, xmlns_id_t nsid, const xmlChar *name)
Get the corresponding meta data node.
Definition: val.c:5532
val_gen_key_entry
status_t val_gen_key_entry(val_value_t *keyval)
Create a key record within an index comp.
Definition: val_util.c:2561
val_child_remove
void val_child_remove(val_value_t *child)
Remove a child value node from its parent value node.
Definition: val_child.c:2133
NCX_IQUAL_ONE
@ NCX_IQUAL_ONE
no iqual == 1
Definition: ncxtypes.h:297
val_get_xpathpcb
xpath_pcb_t * val_get_xpathpcb(val_value_t *val)
Get the XPath parser control block in the specified value struct.
Definition: val_util.c:4264
ncx_find_backptr
ncx_backptr_t * ncx_find_backptr(const dlq_hdr_t *que, void *node)
Find the specified back pointer struct.
Definition: ncx.c:11609
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
val_find_child_fast
val_value_t * val_find_child_fast(const val_value_t *parent, xmlns_id_t nsid, const xmlChar *childname)
Find the first instance of the specified child node.
Definition: val.c:8588
val_validate_value
status_t val_validate_value(val_value_t *useval)
Verify that the value is valid and can be safely used later Used in the SIL code to ensure that the c...
Definition: val_util.c:7880
VAL_NMDA_ORIGIN
#define VAL_NMDA_ORIGIN(V)
Access the NMDA origin property.
Definition: val.h:663
obj_is_terminal
boolean obj_is_terminal(const obj_template_t *obj)
Check if object is a proper leaf or leaflist or anyxml.
Definition: obj.c:13493
LOG_DEBUG_DEBUG4
@ LOG_DEBUG_DEBUG4
debug level 4
Definition: log.h:397
val_new_child_val
val_value_t * val_new_child_val(xmlns_id_t nsid, const xmlChar *name, boolean copyname, val_value_t *parent, op_editop_t editop, obj_template_t *obj)
Internal function used by server to create a new child value.
Definition: val_util.c:3368
val_change_nsid
void val_change_nsid(val_value_t *val, xmlns_id_t nsid)
Change the namespace ID for a value node and all its descendants.
Definition: val.c:12303
VAL_NSID
#define VAL_NSID(V)
Access the namespace ID.
Definition: val.h:396
ERR_NCX_DEF_NOT_FOUND
@ ERR_NCX_DEF_NOT_FOUND
250
Definition: status_enum.h:289
LOG_DEBUG_NONE
@ LOG_DEBUG_NONE
value not set or error
Definition: log.h:386
plock.h
RFC 57517 partial lock support.
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
val_getbulk_return_t_::retdone
boolean retdone
flag to indicate return is complete
Definition: val_util.h:162
obj_is_leaf_list
boolean obj_is_leaf_list(const obj_template_t *obj)
Check if object is a proper leaf-list.
Definition: obj.c:13336
NCX_BT_BOOLEAN
@ NCX_BT_BOOLEAN
boolean
Definition: ncxtypes.h:206
val.h
Value Node Basic Support.
val_clear_partial_lock
void val_clear_partial_lock(val_value_t *val, plock_cb_t *plcb)
Clear the partial lock throughout the value tree.
Definition: val_util.c:5710
OBJ_TYP_CHOICE
@ OBJ_TYP_CHOICE
choice
Definition: obj.h:618
val_set_simval_binary
status_t val_set_simval_binary(val_value_t *val, const xmlChar *binstr, uint32 binstrlen)
set a binary type either in a type binary, or type within 1 or more unions
Definition: val.c:7400
ERR_NCX_MISSING_KEY
@ ERR_NCX_MISSING_KEY
383
Definition: status_enum.h:426
NCX_IFMT_RESTCONF
@ NCX_IFMT_RESTCONF
RESTCONF URI with list1=key1,key2.
Definition: ncxtypes.h:404
val_is_default
boolean val_is_default(val_value_t *val)
Check if the specified value is set to the YANG default value.
Definition: val.c:11347
xml_util.h
XML Utilities.
val_make_simval_obj
val_value_t * val_make_simval_obj(obj_template_t *obj, const xmlChar *valstr, status_t *res)
Create and set a val_value_t as a simple type from an object template instead of individual fields Ca...
Definition: val_util.c:4389
VAL_UINT32
#define VAL_UINT32(V)
Access the value as an uint32 ONLY if NCX_BT_UINT32.
Definition: val.h:497
NCX_BT_IDREF
@ NCX_BT_IDREF
identityref
Definition: ncxtypes.h:222
getcb.h
GET1 and GET2 Callback Support.
val_next_child_same
val_value_t * val_next_child_same(val_value_t *curchild)
Get the next instance of the corresponding child node.
Definition: val.c:8456
obj_get_parent
obj_template_t * obj_get_parent(obj_template_t *obj)
Get the parent of the current object.
Definition: obj.c:12679
val_get_value
val_value_t * val_get_value(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, val_nodetest_fn_t testfn, boolean acmcheck, boolean *malloced, status_t *res)
Get the value for a node after lots of internal processing.
Definition: val_util.c:6114
obj_next_key
obj_key_t * obj_next_key(obj_key_t *objkey)
Get the next key record.
Definition: obj.c:9559
ERR_NCX_EXTRA_VAL_INST
@ ERR_NCX_EXTRA_VAL_INST
311
Definition: status_enum.h:354
cli_parse_parm_ret
status_t cli_parse_parm_ret(runstack_context_t *rcxt, val_value_t *val, obj_template_t *obj, const xmlChar *strval, boolean script, val_value_t **retval)
Create a val_value_t struct for the specified parm value, and insert it into the parent container val...
Definition: cli.c:2248
xpath_cvt_boolean
boolean xpath_cvt_boolean(const xpath_result_t *result)
Convert an XPath result to a boolean answer.
Definition: xpath.c:3630
val_gen_keyptrs
status_t val_gen_keyptrs(val_value_t *val, dlq_hdr_t *keyptrQ)
Get all the keys for the specified data node object.
Definition: val_util.c:6929
val_child_find
val_value_t * val_child_find(const val_value_t *parent, const xmlChar *child_modname, const xmlChar *child_name)
Find the child node for the specified child name and modname.
Definition: val_child.c:1707
val_force_default
void val_force_default(val_value_t *val)
Set a node created by the server as a default node.
Definition: val.c:13521
plock_get_final_result
xpath_result_t * plock_get_final_result(plock_cb_t *plcb)
Get the session ID holding this partial lock.
Definition: plock.c:206
obj_first_key
obj_key_t * obj_first_key(obj_template_t *obj)
Get the first key record.
Definition: obj.c:9472
val_convert_children
status_t val_convert_children(val_value_t *srcval, val_value_t *destval)
Convert children nodes to the template node.
Definition: val_util.c:7702
typ_is_number
boolean typ_is_number(ncx_btype_t btyp)
Check if the base type is numeric.
Definition: typ.c:4063
ncx_data_templates_ok
boolean ncx_data_templates_ok(void)
Get the use-data-templates flag.
Definition: ncx.c:12393
NCX_BT_LEAFREF
@ NCX_BT_LEAFREF
leafref (needs special processing)
Definition: ncxtypes.h:221
NCX_PROTO_NETCONF11
@ NCX_PROTO_NETCONF11
RFC 6241 base:1.1.
Definition: ncxtypes.h:784
val_make_config_root
val_value_t * val_make_config_root(void)
Make a <config> element.
Definition: val_util.c:6715
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.
val_get_casobj
obj_template_t * val_get_casobj(val_value_t *val)
Get the case object for the value node.
Definition: val_util.c:7993
val_get_first_key
val_index_t * val_get_first_key(val_value_t *val)
Get the first key record if this is a list with a key-stmt.
Definition: val.c:13200
ncx_num.h
NCX Module Library Number Utility Functions.
ERR_NCX_NO_ACCESS_MAX
@ ERR_NCX_NO_ACCESS_MAX
303
Definition: status_enum.h:346
val_get_mod_name
const xmlChar * val_get_mod_name(const val_value_t *val)
Get the module name associated with this value node.
Definition: val.c:12223
ncx_def_hook_cbfn_t
status_t(* ncx_def_hook_cbfn_t)(struct val_value_t_ *parentval, struct obj_template_t_ *obj, xmlChar **buff)
Typedef of the ncx_def_hook_cbfn_t callback.
Definition: ncxtypes.h:1445
val_child_find_same
val_value_t * val_child_find_same(const val_value_t *child, const val_value_t *parent, val_child_op_t child_op)
Find the child header for the specified child, which is a different root; e.g., trying to match candi...
Definition: val_child.c:1888
val_set_canonical_order
void val_set_canonical_order(val_value_t *val)
Set canonical order No longer used.
Definition: val_util.c:2467
runstack.h
CLI run stack manager.
ncx_free_errmsg
void ncx_free_errmsg(ncx_errmsg_t *msg)
Clean and free an ncx_errmsg_t struct.
Definition: ncx.c:14536
obj_npcon_has_defaults_slow
boolean obj_npcon_has_defaults_slow(obj_template_t *obj)
Check if the specified NP container has defaults within it Must be a config object!...
Definition: obj.c:11776
ncxmod_set_home
status_t ncxmod_set_home(const xmlChar *home)
Override the HOME env var with the home CLI var.
Definition: ncxmod.c:6111
VAL_IDREF_NAME
#define VAL_IDREF_NAME(V)
Access the name string value as an identityref ONLY if NCX_BT_IDREF.
Definition: val.h:476
val_set_feature_parms
status_t val_set_feature_parms(val_value_t *parentval)
Handle the YANG feature parameter set.
Definition: val_util.c:5127
obj_first_unique
obj_unique_t * obj_first_unique(obj_template_t *listobj)
Get the first unique-stmt for a list.
Definition: obj.c:9242
val_compare
int32 val_compare(const val_value_t *val1, const val_value_t *val2)
Compare 2 val_value_t struct value contents.
Definition: val.c:9456
val_apply_template
status_t val_apply_template(val_value_t *template_val, val_value_t *target_val)
Apply the specified template to the val_value_t node.
Definition: val_util.c:7507
ncx_next_backptr
ncx_backptr_t * ncx_next_backptr(ncx_backptr_t *curptr)
Get next back pointer struct.
Definition: ncx.c:11545
val_check_obj_when
status_t val_check_obj_when(val_value_t *val, val_value_t *valroot, val_value_t *objval, obj_template_t *obj, boolean *condresult, uint32 *whencount)
checks when-stmt only
Definition: val_util.c:3848
val_get_value_ex
val_value_t * val_get_value_ex(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, val_nodetest_fn_t testfn, boolean acmcheck, boolean *malloced, status_t *res, void *get2cb)
Get the value for a node after lots of internal processing (extended)
Definition: val_util.c:6161
obj_is_key
boolean obj_is_key(const obj_template_t *obj)
Check if object is being used as a key leaf within a list.
Definition: obj.c:14278
val_add_defaults
status_t val_add_defaults(val_value_t *val, boolean scriptmode)
Add defaults to an initialized complex value.
Definition: val_util.c:2692
val_instance_count_fast2
uint32 val_instance_count_fast2(val_value_t *val, val_value_t *startval)
Count the number of instances of the specified object name in the parent value struct.
Definition: val.c:11580
ncx_init_num
void ncx_init_num(ncx_num_t *num)
Init a ncx_num_t struct.
Definition: ncx_num.c:162
NCX_BT_ANYDATA
@ NCX_BT_ANYDATA
YANG 1.1 anydata.
Definition: ncxtypes.h:229
ERR_NCX_NO_INSTANCE
@ ERR_NCX_NO_INSTANCE
1009
Definition: status_enum.h:498
val_instance_check
status_t val_instance_check(val_value_t *root, val_value_t *val, obj_template_t *obj)
Check for the proper number of object instances for the specified value struct.
Definition: val_util.c:2806
ERR_NCX_DUP_ENTRY
@ ERR_NCX_DUP_ENTRY
224
Definition: status_enum.h:263
obj_is_any
boolean obj_is_any(const obj_template_t *obj)
Get the config flag for the top-level object Check the specified object all the way to root.
Definition: obj.c:13304
VAL_SET_EXTERNAL
#define VAL_SET_EXTERNAL(V)
flag the value as an external value Not sure why this is different than NCX_BT_EXTERN
Definition: val.h:597
val_move_metadata
void val_move_metadata(val_value_t *srcval, val_value_t *destval)
Move the attribute fields from one val to another for xml_wr purposes.
Definition: val.c:13164
VAL_MAX_PLOCKS
#define VAL_MAX_PLOCKS
max number of concurrent partial locks by the same session
Definition: val.h:146
ncx_is_add_toplevel_default_mode
boolean ncx_is_add_toplevel_default_mode(void)
Get the add_toplevel_default_mode value.
Definition: ncx.c:13926
op.h
NETCONF protocol operations.
VAL_NAME
#define VAL_NAME(V)
Access the value name.
Definition: val.h:399
ncxconst.h
Contains NCX constants.
ncxmod.h
NCX Module Load Manager.
VAL_FL_DEFSET
#define VAL_FL_DEFSET
if set, this value was added by val_add_defaults
Definition: val.h:184
val_unique.h
unique-stmt tests for val_value_t node
val_set_origin
void val_set_origin(val_value_t *val, ncx_nmda_origin_t origin)
Set the NMDA value origin.
Definition: val_util.c:7974
ncx_get_datapath_obj
obj_template_t * ncx_get_datapath_obj(void)
Get the cached datapath meta-object template used to contruct a metaval for the attribute.
Definition: ncx.c:11691
NCX_PROTO_YUMA_YANGAPI
@ NCX_PROTO_YUMA_YANGAPI
YumaPro YANG-API 1.0.
Definition: ncxtypes.h:785
xml_msg_get_prefix_xpath
const xmlChar * xml_msg_get_prefix_xpath(xml_msg_hdr_t *msg, xmlns_id_t nsid)
Get the module prefix for XPath.
Definition: xml_msg.c:641
NCX_DC_CONFIG
@ NCX_DC_CONFIG
persistent config
Definition: ncxtypes.h:192
val_getbulk_cbfn_t
status_t(* val_getbulk_cbfn_t)(obj_template_t *obj, uint32 start_idx, uint32 max_count, uint32 max_depth, val_nodetest_fn_t node_test_fn, val_getbulk_return_t *getbulk_return)
user function callback template to bulk get operational values of a specified node.
Definition: val_util.h:187
obj_is_obsolete
boolean obj_is_obsolete(const obj_template_t *obj)
Check if the object has obsolete status.
Definition: obj.c:17094
NCX_IQUAL_ZMORE
@ NCX_IQUAL_ZMORE
'*' == 0 or more
Definition: ncxtypes.h:300
log_set_log_level
void log_set_log_level(log_debug_t dlevel)
Set the main log level.
Definition: log.c:3395
ncx_set_warn_error
void ncx_set_warn_error(boolean val)
Set the warn_error flag.
Definition: ncx.c:9374
val_set_message_indent_parm
status_t val_set_message_indent_parm(val_value_t *parentval)
Handle the message-indent parameter.
Definition: val_util.c:5375
cfg_get_root
val_value_t * cfg_get_root(ncx_cfg_t cfgid)
Get the config root for the specified config.
Definition: cfg.c:3240
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
ses_id_t
uint32 ses_id_t
Session ID.
Definition: ses.h:306
VAL_IDREF_IDENTITY
#define VAL_IDREF_IDENTITY(V)
Access the found identity for an identityref ONLY if NCX_BT_IDREF.
Definition: val.h:479
val_is_virtual
boolean val_is_virtual(const val_value_t *val)
Check if the specified value is a virtual value such that a 'get' callback function is required to ac...
Definition: val.c:11260
val_value_t_::editop
op_editop_t editop
needed for all edits
Definition: val.h:909
obj_first_inherit_when_ptr
ncx_backptr_t * obj_first_inherit_when_ptr(obj_template_t *obj)
Get first xpath pointer struct.
Definition: obj.c:16210
val_set_xpathpcb
status_t val_set_xpathpcb(val_value_t *val, xpath_pcb_t *xpathpcb)
Set the xpathpcb field with passed field;.
Definition: val_util.c:4324
ses_putchar
void ses_putchar(ses_cb_t *scb, uint32 ch)
Write one char to the session, without any translation.
Definition: ses.c:2353
obj_is_list
boolean obj_is_list(const obj_template_t *obj)
Check if object is a YANG list.
Definition: obj.c:13349
obj_is_action
boolean obj_is_action(const obj_template_t *obj)
Check if the object is a YANG 1.1 action.
Definition: obj.c:14028
val_value_t_::obj
struct obj_template_t_ * obj
common fields
Definition: val.h:865
dlq_insertAhead
void dlq_insertAhead(void *newP, void *nodeP)
insert the new queue entry before the current entry
Definition: dlq.c:447
val_ok_to_partial_lock
status_t val_ok_to_partial_lock(val_value_t *val, ses_id_t sesid, ses_id_t *lockowner)
Check if the specified root val could be locked right now by the specified session.
Definition: val_util.c:5564
val_find_next_child
val_value_t * val_find_next_child(const val_value_t *parent, const xmlChar *modname, const xmlChar *childname, const val_value_t *curchild)
Find the next instance of the specified child node.
Definition: val.c:8748
VAL_ENUM_NAME
#define VAL_ENUM_NAME(V)
Access the enum name in the value ONLY if BCX_NT_ENUM This is the macro used to check values in SIL c...
Definition: val.h:434
val_value_t_::name
const xmlChar * name
back pointer to elname the dname field is moved to val_extra_t and only used when the value is constr...
Definition: val.h:867
val_child_inst_cnt
uint32 val_child_inst_cnt(const val_value_t *parent, const xmlChar *modname, const xmlChar *name)
Get the corresponding child instance count by name get instance count – for instance qualifer checkin...
Definition: val.c:8929
xmlns_get_module
const xmlChar * xmlns_get_module(xmlns_id_t nsid)
get the module name of the namespace ID
Definition: xmlns.c:1126
ncx_set_warn_linelen
void ncx_set_warn_linelen(uint32 warnlen)
Set the warning length for YANG file lines.
Definition: ncx.c:9159
xmlns_id_t
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
val_get_dname
const xmlChar * val_get_dname(const val_value_t *val)
Get the dname field if set; NULL if not set.
Definition: val.c:15363
VAL_SET_IS_INDEX
#define VAL_SET_IS_INDEX(V)
Flag the value as a key leaf.
Definition: val.h:669
val_remove_child
void val_remove_child(val_value_t *child)
Remove a child value node from its parent value node.
Definition: val.c:8316
ERR_NCX_MISSING_PARM
@ ERR_NCX_MISSING_PARM
233
Definition: status_enum.h:272
log_debug2
void void void void void void void void void log_debug2(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG2 log entry.
var_getvar_fn_t
ncx_var_t *(* var_getvar_fn_t)(const xmlChar *varname, uint32 varlen, void *cookie, status_t *res)
Get Variable Callback.
Definition: var.h:172
xpath1.h
XPath 1.0 expression support.
obj_is_leafy
boolean obj_is_leafy(const obj_template_t *obj)
Check if object is a proper leaf or leaflist.
Definition: obj.c:13478
val_add_defaults_ex
status_t val_add_defaults_ex(val_value_t *val, boolean scriptmode, runstack_context_t *rcxt, time_t last_modified, ncx_etag_t etag)
add defaults to an initialized complex value (extended)
Definition: val_util.c:2738
val_gen_instance_id
status_t val_gen_instance_id(xml_msg_hdr_t *mhdr, const val_value_t *val, ncx_instfmt_t format, xmlChar **buff)
Malloc and Generate the instance ID string for this value node,.
Definition: val_util.c:3424
val_nodetest_fn_t
boolean(* val_nodetest_fn_t)(xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
user function callback template to test output of a specified node.
Definition: val_util.h:132
NCX_BT_ENUM
@ NCX_BT_ENUM
enumeration
Definition: ncxtypes.h:204
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
NCX_BT_LIST
@ NCX_BT_LIST
internal, YANG list
Definition: ncxtypes.h:228
ncx_get_gen_anyxml
obj_template_t * ncx_get_gen_anyxml(void)
Get the object template for the NCX generic anyxml container.
Definition: ncx.c:6664
ncxmod_set_subdirs
void ncxmod_set_subdirs(boolean usesubdirs)
Set the subdirs flag to FALSE if the no-subdirs CLI param is set.
Definition: ncxmod.c:6402
NCX_PROTO_RESTCONF
@ NCX_PROTO_RESTCONF
IETF RESTCONF.
Definition: ncxtypes.h:788
ERR_NCX_MAX_ELEMS_VIOLATION
@ ERR_NCX_MAX_ELEMS_VIOLATION
337 - 13.2
Definition: status_enum.h:380
NCX_MAX_GETBULK_COUNT
#define NCX_MAX_GETBULK_COUNT
size of the val_getbulk_array_t in val_util.h
Definition: ncxconst.h:159
val_instance_check_ex
status_t val_instance_check_ex(val_value_t *root, val_value_t *val, obj_template_t *obj, boolean check_when)
Check for the proper number of object instances for the specified value struct.
Definition: val_util.c:2836
var_get_getvar_cb_cookie
void * var_get_getvar_cb_cookie(void)
Get the cookie parameter for the getvar callback function used for data templates.
Definition: var.c:2934
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
NCX_FEATURE_CODE_STATIC
@ NCX_FEATURE_CODE_STATIC
compile-time if-feature code
Definition: ncxtypes.h:775
val_gen_instance_id_ex
status_t val_gen_instance_id_ex(xml_msg_hdr_t *mhdr, const val_value_t *val, ncx_instfmt_t format, boolean stop_at_root, xmlChar **buff)
Malloc and Generate the instance ID string for this value node,.
Definition: val_util.c:3462
obj_next_inherit_when_ptr
ncx_backptr_t * obj_next_inherit_when_ptr(ncx_backptr_t *ptr)
Get the next xpath pointer struct.
Definition: obj.c:16228
dlq_createQue
dlq_hdrT * dlq_createQue(void)
create a dynamic queue header
Definition: dlq.c:146
val_get_nsid
xmlns_id_t val_get_nsid(const val_value_t *val)
Get the namespace ID for the specified value node.
Definition: val.c:12277
ncx_get_fixed_value_obj
obj_template_t * ncx_get_fixed_value_obj(void)
Get the cached fixed-value meta-object template used to contruct a metaval for the attribute.
Definition: ncx.c:11724
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
ERR_NCX_IN_USE_LOCKED
@ ERR_NCX_IN_USE_LOCKED
372
Definition: status_enum.h:415
ncx_set_protocol_disabled
void ncx_set_protocol_disabled(ncx_protocol_t proto)
Set the specified protocol version to be disabled.
Definition: ncx.c:10312
ncx_find_object
obj_template_t * ncx_find_object(ncx_module_t *mod, const xmlChar *objname)
Find a top level module object.
Definition: ncx.c:4345
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
log_set_pthread_log_level
void log_set_pthread_log_level(log_debug_t dlevel)
Set the pthreads log level.
Definition: log.c:3470
xpath_free_result
void xpath_free_result(xpath_result_t *result)
Free a malloced XPath result struct.
Definition: xpath.c:3107
val_gen_index_chain
status_t val_gen_index_chain(const obj_template_t *obj, val_value_t *val)
Create an index chain for the just-parsed table or container struct.
Definition: val_util.c:2632
OP_EDITOP_DELETE
@ OP_EDITOP_DELETE
edit op is delete
Definition: op.h:127
log_open
status_t log_open(const char *fname, boolean append, boolean tstamps)
Open a logfile for writing.
Definition: log.c:1088
val_is_config_data
boolean val_is_config_data(const val_value_t *val)
Check if the specified value is a config DB object instance.
Definition: val.c:11157
log_warn
void void void log_warn(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_WARN log entry.
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
val_sprintf_simval_nc_ex
status_t val_sprintf_simval_nc_ex(xmlChar *buff, const val_value_t *val, boolean url_encode, uint32 *len)
Sprintf the xmlChar string NETCONF representation of a simple value.
Definition: val.c:9966
obj_has_children
boolean obj_has_children(obj_template_t *obj)
Check if there are any accessible nodes within the object.
Definition: obj.c:14831
val_add_datapath_attr
status_t val_add_datapath_attr(val_value_t *val, obj_template_t *obj)
Add the ye:datapath attribute to a node that is tagged as an ywx:datapath node.
Definition: val_util.c:7041
LOG_DEBUG_WARN
@ LOG_DEBUG_WARN
all errors + warnings
Definition: log.h:391
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
val_child_add
status_t val_child_add(val_value_t *child, val_value_t *parent)
Add a child value node to a parent value node.
Definition: val_child.c:1542
val_util.h
Value Node Utilities.
ERR_NCX_WRONG_TYPE
@ ERR_NCX_WRONG_TYPE
231
Definition: status_enum.h:270
ncxmod_set_yuma_home
status_t ncxmod_set_yuma_home(const xmlChar *yumahome)
Override the YUMAPRO_HOME env var with the yuma-home CLI var.
Definition: ncxmod.c:6194
val_get_anyxml_tracking
void val_get_anyxml_tracking(const val_value_t *val, boolean *iskey, boolean *isconfig, boolean *isunknown)
Set the anyxml tracking data for this node.
Definition: val_util.c:8054
val_index_match
boolean val_index_match(const val_value_t *val1, const val_value_t *val2)
Check 2 val_value structs for the same instance ID.
Definition: val.c:9032
cli_parse_parm_binary
status_t cli_parse_parm_binary(runstack_context_t *rcxt, val_value_t *val, obj_template_t *obj, const xmlChar *strval, boolean script, val_value_t **retval)
Create a val_value_t struct for the specified parm value, and insert it into the value set Extended.
Definition: cli.c:594
NCX_NMDA_ORIGIN_NONE
@ NCX_NMDA_ORIGIN_NONE
not set
Definition: ncxtypes.h:1349
OBJ_TYP_ANYDATA
@ OBJ_TYP_ANYDATA
anydata: YANG 1.1 only
Definition: obj.h:626
val_get_idref_nsid
xmlns_id_t val_get_idref_nsid(const val_value_t *val)
get the true namespace ID for the identityref value
Definition: val_util.c:8081
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
val_check_delete_resnode
void val_check_delete_resnode(val_value_t *curval)
Check if the curnode has any partial locks and if so, remove them from the final result.
Definition: val_util.c:5947
xpath1_get2_new_node
xpath_get2_node_t * xpath1_get2_new_node(xpath_get2_cb_t *cb, val_value_t *val, xpath_get2_form_t get2_form)
Create a malloced XPath GET2 node.
Definition: xpath1_get2.c:2252
ncx_get_btype_obj
obj_template_t * ncx_get_btype_obj(void)
Get the cached datapath meta-object template used to contruct a metaval for the attribute.
Definition: ncx.c:11757
log_get_log_level
log_debug_t log_get_log_level(void)
Get the main log level.
Definition: log.c:3508
obj_next_child
obj_template_t * obj_next_child(obj_template_t *obj)
Get the next child object if the specified object has any children.
Definition: obj.c:6860
XML_MSG_GET2CB
#define XML_MSG_GET2CB(M)
GET2 control block backptr.
Definition: xml_msg.h:273
val_get_varexpr
const xmlChar * val_get_varexpr(const val_value_t *val)
Get the varexpr field if set; NULL if not set.
Definition: val.c:15486
VAL_BITS
#define VAL_BITS
Access the value as a bits value ONLY if NCX_BT_BITS.
Definition: val.h:527
NCX_BT_EMPTY
@ NCX_BT_EMPTY
empty
Definition: ncxtypes.h:205
NCX_BT_UINT16
@ NCX_BT_UINT16
uint16
Definition: ncxtypes.h:212
plock_get_id
plock_id_t plock_get_id(plock_cb_t *plcb)
Get the lock ID for this partial lock.
Definition: plock.c:127
ncx_set_with_ocpattern
void ncx_set_with_ocpattern(boolean mode)
Set the openconfig pattern mode for the entire system.
Definition: ncx.c:13911
obj_get_first_default
const xmlChar * obj_get_first_default(const obj_template_t *obj, ncx_backptr_t **thisdef)
Get the first default value for the specified object.
Definition: obj.c:11613
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
val_clone
val_value_t * val_clone(const val_value_t *val)
Clone a specified val_value_t struct and sub-trees.
Definition: val.c:7836
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.
val_get_prev_key
val_index_t * val_get_prev_key(val_index_t *curkey)
Get the previous key record if this is a list with a key-stmt.
Definition: val.c:13272
LOG_DEBUG_WRITE
@ LOG_DEBUG_WRITE
logging turned on
Definition: log.h:388
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
XPATH_SCB
#define XPATH_SCB(P)
access the XPath scb backptr in xpath_pcb_t * (P)
Definition: xpath.h:316
VAL_INT8
#define VAL_INT8(V)
Access the value as an int8 ONLY if NCX_BT_INT8.
Definition: val.h:446
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
ncx_obj_is_generic
boolean ncx_obj_is_generic(const obj_template_t *obj)
Check if the object is 1 of the gen_foo object templates.
Definition: ncx.c:13013
NCX_BT_CONTAINER
@ NCX_BT_CONTAINER
internal container
Definition: ncxtypes.h:225
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.
val_copy_xpathpcb
status_t val_copy_xpathpcb(val_value_t *val, const xpath_pcb_t *xpathpcb)
Set the xpathpcb field with a clone of the parameter.
Definition: val_util.c:4294
ncxmod_set_datapath
void ncxmod_set_datapath(const xmlChar *datapath)
Override the YUMA_DATAPATH env var with the datapath CLI var.
Definition: ncxmod.c:6343
typ.h
Parameter Type Handler.
ncxmod_set_modpath
void ncxmod_set_modpath(const xmlChar *modpath)
Override the YUMAPRO_MODPATH env var with the modpath CLI var.
Definition: ncxmod.c:6281
ncx_new_errmsg
ncx_errmsg_t * ncx_new_errmsg(status_t res, const xmlChar *str)
Malloc and init an ncx_errmsg_t struct.
Definition: ncx.c:14512
ncx_protocol_enabled
boolean ncx_protocol_enabled(ncx_protocol_t proto)
Check if the specified protocol version is enabled.
Definition: ncx.c:10192
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
ncx_set_feature_code_entry
status_t ncx_set_feature_code_entry(const xmlChar *featstr, ncx_feature_code_t featcode)
Create or set a feature_entry struct for the specified feature code parameter (deprecated)
Definition: ncx_feature.c:1328
val_clear_datarule
void val_clear_datarule(val_value_t *val, const void *rule)
Clear the datarule back-ptr for this node.
Definition: val_util.c:6423
val_gen_index_comp
status_t val_gen_index_comp(const obj_key_t *in, val_value_t *val)
Create an index component.
Definition: val_util.c:2490
val_move_config_false
status_t val_move_config_false(val_value_t *newval, val_value_t *curval)
Move the config false data nodes.
Definition: val_util.c:6611
yangconst.h
Contains YANG constants separated to prevent H file include loops.
obj_get_config_flag
boolean obj_get_config_flag(const obj_template_t *obj)
Get the config flag for an obj_template_t Return the explicit value or the inherited value Also retur...
Definition: obj.c:11174
val_value_t_::last_modified
time_t last_modified
last_modified and etag fields used for filtered retrieval and YANG-API If-Match type of conditional e...
Definition: val.h:887
ses_set_protocols_requested
void ses_set_protocols_requested(ses_cb_t *scb, ncx_protocol_t proto)
set the NETCONF protocol versions requested
Definition: ses.c:3875
val_set_binary_display_maxlen_parm
status_t val_set_binary_display_maxlen_parm(val_value_t *parentval)
Handle the –binary-display-maxlen parameter.
Definition: val_util.c:7837
obj_is_case
boolean obj_is_case(const obj_template_t *obj)
Check if object is a YANG case.
Definition: obj.c:13445
val_add_meta
status_t val_add_meta(val_value_t *metaval, val_value_t *val)
Add a meta value to a value node.
Definition: val.c:15157
ncx_set_feature_enable_entry
status_t ncx_set_feature_enable_entry(const xmlChar *featstr, boolean flag)
Create or set a feature_entry struct for the specified feature enabled parameter.
Definition: ncx_feature.c:1387
val_get_virtual_value
val_value_t * val_get_virtual_value(ses_cb_t *scb, val_value_t *val, status_t *res)
Get the value of a virtual value node.
Definition: val.c:11310
val_cache_datarule
status_t val_cache_datarule(val_value_t *val, void *rule)
Set the data-rule back-ptr for this node.
Definition: val_util.c:6386
OBJ_TYP_CASE
@ OBJ_TYP_CASE
case: last named database object
Definition: obj.h:619
val_remove_false_when
status_t val_remove_false_when(val_value_t *val, boolean *deleteme)
Remove false when-stmt nodes.
Definition: val_util.c:4206
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
obj_get_key_num
uint16 obj_get_key_num(obj_template_t *obj)
Get the key number for the object.
Definition: obj.c:16895
ncx_get_gen_root
obj_template_t * ncx_get_gen_root(void)
Get the object template for the NCX generic root container.
Definition: ncx.c:6720
val_value_t_
one value to match one type
Definition: val.h:860
LOG_DEBUG_DEBUG2
@ LOG_DEBUG_DEBUG2
debug level 2
Definition: log.h:395
val_merge_return_vals
void val_merge_return_vals(dlq_hdr_t *srcQ, dlq_hdr_t *dstQ)
Merge return values into a dest Q Remove duplicates.
Definition: val_util.c:7781
ERR_NCX_RESOURCE_DENIED
@ ERR_NCX_RESOURCE_DENIED
269
Definition: status_enum.h:310
val_write_intern
void val_write_intern(ses_cb_t *scb, const val_value_t *val)
Write an internal buffer to the session.
Definition: val_util.c:6078
VAL_BINDEX_CH
#define VAL_BINDEX_CH
constants used in generating C and Xpath instance ID strings
Definition: val.h:155
LOG_DEBUG_DEV1
@ LOG_DEBUG_DEV1
Special use developer debugging only.
Definition: log.h:393
OBJ_TYP_LEAF_LIST
@ OBJ_TYP_LEAF_LIST
leaf-list
Definition: obj.h:616
val_add_fixed_value_attr
status_t val_add_fixed_value_attr(val_value_t *val)
Add the ywx:fixed-value attribute to a key value node Set it to true since false is the default.
Definition: val_util.c:7105
obj_gen_object_id_prefix
status_t obj_gen_object_id_prefix(const obj_template_t *obj, xmlChar **buff)
Malloc and Generate the object ID for an object node Use the prefix in every node.
Definition: obj.c:10034
val_make_sprintf_string
xmlChar * val_make_sprintf_string(const val_value_t *val)
Malloc a buffer and then sprintf the xmlChar string NETCONF representation of a simple value.
Definition: val.c:10323
val_add_node_defaults
status_t val_add_node_defaults(obj_template_t *chobj, val_value_t *val, boolean scriptmode, time_t last_modified, ncx_etag_t etag)
Check/Add defaults for the specified node and descendant nodes.
Definition: val_util.c:2770
obj_is_np_container
boolean obj_is_np_container(const obj_template_t *obj)
Check if the object is an Non-Presence-container.
Definition: obj.c:14487
OBJ_TYP_RPC
@ OBJ_TYP_RPC
rpc-stmt
Definition: obj.h:623
val_find_list_from_keyvalQ
val_value_t * val_find_list_from_keyvalQ(val_value_t *parentval, val_value_t *firstmatch, dlq_hdr_t *keyvalQ, status_t *res)
Find the list entry identified by the Q of yangapi_keyval_t strings.
Definition: val_util.c:6508
op_editop_name
const xmlChar * op_editop_name(op_editop_t ed_id)
Get the keyword for the specified op_editop_t enumeration.
Definition: op.c:106
VAL_FL_ANYXML_UNKNOWN
#define VAL_FL_ANYXML_UNKNOWN
set if anyxml tracking is done and this node is identified as an unknown node in a known namespace (c...
Definition: val.h:321
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
NCX_DC_STATE
@ NCX_DC_STATE
state or statistics
Definition: ncxtypes.h:193
NCX_BT_UNION
@ NCX_BT_UNION
union (needs special processing)
Definition: ncxtypes.h:220
ERR_NCX_EXTRA_CHOICE
@ ERR_NCX_EXTRA_CHOICE
295
Definition: status_enum.h:338
ncx_set_message_indent
void ncx_set_message_indent(int8 msg_indent)
Set the protocol output message indent amount.
Definition: ncx.c:10791
NCX_MAX_NUMLEN
#define NCX_MAX_NUMLEN
max number len to use for static buffer allocation only
Definition: ncxconst.h:136
xml_msg.h
XML and JSON Message send and receive support.
NCX_IFMT_C
@ NCX_IFMT_C
C format.
Definition: ncxtypes.h:398
ncx_first_backptr
ncx_backptr_t * ncx_first_backptr(dlq_hdr_t *que)
Get first back pointer struct.
Definition: ncx.c:11513
obj_get_xpath_oper_ok
boolean obj_get_xpath_oper_ok(const obj_template_t *obj)
Get the object XPath oper OK flag.
Definition: obj.c:18505
obj_is_container
boolean obj_is_container(const obj_template_t *obj)
Check if object is a YANG container.
Definition: obj.c:13405
errmsg_dict_insert
status_t errmsg_dict_insert(const xmlChar *lang, ncx_errmsg_t *errmsg)
Add a list entry to the errmsg_dict.
Definition: errmsg_dict.c:268
ERR_NCX_LOCK_DENIED
@ ERR_NCX_LOCK_DENIED
268
Definition: status_enum.h:309
OBJ_TYP_ANYXML
@ OBJ_TYP_ANYXML
anyxml
Definition: obj.h:613
val_make_simval
val_value_t * val_make_simval(typ_def_t *typdef, xmlns_id_t nsid, const xmlChar *valname, const xmlChar *valstr, status_t *res)
Create and set a val_value_t as a simple type same as val_set_simval, but malloc the value first.
Definition: val.c:7504
VAL_CHILD_OP_SAME
@ VAL_CHILD_OP_SAME
get-exact
Definition: val_child.h:82
typ_get_xref_typdef
typ_def_t * typ_get_xref_typdef(typ_def_t *typdef)
Get the xrefdef target typdef from a leafref or instance-identifier.
Definition: typ.c:5009
xpath1_get2_free_node
void xpath1_get2_free_node(xpath_get2_node_t *node)
Free a malloced XPath GET2 node.
Definition: xpath1_get2.c:2275
ncx_set_binary_display_maxlen
void ncx_set_binary_display_maxlen(uint32 val)
Set the binary_display_maxlen parameter.
Definition: ncx.c:14681
VAL_UINT
#define VAL_UINT(V)
Access the value as an uint32 ONLY if NCX_BT_UINT8, 16, 32.
Definition: val.h:482
val_getbulk_return_t_
return value for a getbulk callback function
Definition: val_util.h:154
ERR_NCX_UNKNOWN_OBJECT
@ ERR_NCX_UNKNOWN_OBJECT
293
Definition: status_enum.h:336
obj_get_mod_name
const xmlChar * obj_get_mod_name(const obj_template_t *obj)
Get the module name for this object.
Definition: obj.c:12176
VAL_FL_ANYXML_CONFIG
#define VAL_FL_ANYXML_CONFIG
set if anyxml tracking is done and this node is identified as a config data node
Definition: val.h:314
typ_is_simple
boolean typ_is_simple(ncx_btype_t btyp)
Check if this is a simple data type.
Definition: typ.c:3107
NCX_BT_ANY
@ NCX_BT_ANY
anyxml
Definition: ncxtypes.h:202
val_value_t_::etag
ncx_etag_t etag
ETag for RESTCONF.
Definition: val.h:888
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
val_find_child_obj
val_value_t * val_find_child_obj(const val_value_t *parent, const struct obj_template_t_ *chobj)
Find the first instance of the specified child node Use the object template pointer to match the obje...
Definition: val.c:8612
xpath1_eval_expr3
xpath_result_t * xpath1_eval_expr3(xpath_pcb_t *pcb, val_value_t *val, val_value_t *docroot, boolean logerrors, boolean configonly, boolean force_only, xml_msg_hdr_t *get2_mhdr, boolean get_when, xpath_get2_node_t *val_get2, status_t *res)
Evaluate an XPath expression (alt3)
Definition: xpath1.c:5406
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
val_set_with_ocpattern_parm
status_t val_set_with_ocpattern_parm(val_value_t *parentval)
Handle the –with-ocpattern parameter.
Definition: val_util.c:5463
LOG_DEBUG_ERROR
@ LOG_DEBUG_ERROR
fatal + internal errors only
Definition: log.h:390
val_purge_errors_from_root
void val_purge_errors_from_root(val_value_t *val)
Remove any error nodes under a root container that were saved for error recording purposes.
Definition: val_util.c:3342
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
val_remove_false_when_error
status_t val_remove_false_when_error(const xmlChar *name, val_value_t *val, obj_template_t *obj, boolean is_error, boolean real_delete, boolean *deleteme)
Remove false when-stmt nodes with error.
Definition: val_util.c:4236
VAL_BOOL
#define VAL_BOOL(V)
Access the value as a boolean ONLY IF btyp == NCX_BT_BOOLEAN.
Definition: val.h:405
val_get_next_child
val_value_t * val_get_next_child(const val_value_t *curchild)
Get the next child node.
Definition: val.c:8496
val_make_external_value
val_value_t * val_make_external_value(obj_template_t *obj, xmlChar *fname)
Make an external value node.
Definition: val_util.c:7313
log_get_syslog_log_level
log_debug_t log_get_syslog_log_level(void)
Get the syslog log level.
Definition: log.c:3523
val_set_by_default
boolean val_set_by_default(const val_value_t *val)
Check if the value was set by val_add_defaults.
Definition: val.c:12571
val_value_t_::parent
struct val_value_t_ * parent
back-ptr to parent if any
Definition: val.h:872
obj_is_choice
boolean obj_is_choice(const obj_template_t *obj)
Check if object is a YANG choice.
Definition: obj.c:13425
LOGDEBUG4
#define LOGDEBUG4
Check if at least log-level=debug4.
Definition: log.h:302
log.h
NCX System Logging Manager.
obj_first_ckey
const obj_key_t * obj_first_ckey(const obj_template_t *obj)
Get the first key record: Const version.
Definition: obj.c:9530
val_set_logging_parms_ex
status_t val_set_logging_parms_ex(val_value_t *parentval, const xmlChar *fhs_logfile)
Check the parent value struct (expected to be a container or list) for the full set of logging contro...
Definition: val_util.c:4720
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
obj_is_leaf
boolean obj_is_leaf(const obj_template_t *obj)
Check if object is a proper leaf.
Definition: obj.c:13323
val_set_errmsg_parm
status_t val_set_errmsg_parm(val_value_t *parentval)
Check the parent value struct (expected to be a container or list) for the errmsg parameter.
Definition: val_util.c:5504
OBJ_TYP_RPCIO
@ OBJ_TYP_RPCIO
rpc input or output
Definition: obj.h:624
ncx_missing_vars_ok
boolean ncx_missing_vars_ok(void)
Get the ignore-missing-vars flag.
Definition: ncx.c:12419
xmlns_nc_id
xmlns_id_t xmlns_nc_id(void)
Get the ID for the NETCONF namespace or 0 if it doesn't exist.
Definition: xmlns.c:880
ncx_remove_backptr
void ncx_remove_backptr(ncx_backptr_t *ptr)
Remove the specified backptr for deletion.
Definition: ncx.c:11592
val_set_anyxml_tracking
void val_set_anyxml_tracking(val_value_t *val, obj_template_t *obj)
Set the anyxml tracking data for this node.
Definition: val_util.c:8018
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
val_set_protocols_parm
status_t val_set_protocols_parm(val_value_t *parentval)
Handle the –protocols parameter.
Definition: val_util.c:5229
val_is_fixed_value
boolean val_is_fixed_value(val_value_t *val)
Check if the specified value has a fixed-value=true attribute set in it.
Definition: val_util.c:7157
LOG_DEBUG_DEV0
@ LOG_DEBUG_DEV0
Special use developer debugging only.
Definition: log.h:389
ncx_turn_off_warning
status_t ncx_turn_off_warning(status_t res)
Add a warning suppression entry.
Definition: ncx.c:9294
ncx_turn_up_warning
status_t ncx_turn_up_warning(status_t res)
Add a warning elevation entry.
Definition: ncx.c:9357
VAL_IS_VAREXPR
#define VAL_IS_VAREXPR(V)
Check if the value is a var expression.
Definition: val.h:557
val_getbulk_return_t_::retcount
uint32 retcount
actual return count
Definition: val_util.h:159
val_find_next_child_fast
val_value_t * val_find_next_child_fast(const val_value_t *parent, const val_value_t *curchild)
Find the next instance of the specified child node.
Definition: val.c:8774
xpath_clone_pcb
xpath_pcb_t * xpath_clone_pcb(const xpath_pcb_t *srcpcb)
Clone an XPath PCB.
Definition: xpath.c:2822
val_make_idref_obj
val_value_t * val_make_idref_obj(obj_template_t *obj, const val_idref_t *leafval, status_t *res)
make a val_value_t for a specified leaf or leaf-list identityref
Definition: val_util.c:4524
cfg_first_partial_lock
plock_cb_t * cfg_first_partial_lock(cfg_template_t *cfg)
Get the first partial lock in the specified config.
Definition: cfg.c:3076
cli.h
command line interpreter parsing to internal val_value_t format
OP_EDITOP_REMOVE
@ OP_EDITOP_REMOVE
remove, base:1.1 only
Definition: op.h:130
ncxmod_set_loadpath
void ncxmod_set_loadpath(const xmlChar *loadpath)
Override the YUMAPRO_LOADPATH env var with the loadpath CLI var.
Definition: ncxmod.c:6313
VAL_EINDEX_CH
#define VAL_EINDEX_CH
end index
Definition: val.h:156
val_build_index_chains
status_t val_build_index_chains(val_value_t *val)
Build index chains for a value if needed.
Definition: val_util.c:6333
NCX_BT_BITS
@ NCX_BT_BITS
bits
Definition: ncxtypes.h:203
ncx_list.h
NCX Module Library List Utility Functions.
val_choice_is_set
boolean val_choice_is_set(val_value_t *val, obj_template_t *obj)
Check a val_value_t struct against its expected OBJ to determine if a specific choice has already bee...
Definition: val_util.c:3260
val_new_extra
status_t val_new_extra(val_value_t *val)
Create the val_extra struct if it does not exist.
Definition: val.c:15458
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
val_get_first_child
val_value_t * val_get_first_child(const val_value_t *parent)
Get the first child node.
Definition: val.c:8477
MAX_LANG_TAGLEN
#define MAX_LANG_TAGLEN
Max length of language tag accepted.
Definition: ncxconst.h:298
val_get_next_key
val_index_t * val_get_next_key(val_index_t *curkey)
Get the next key record if this is a list with a key-stmt.
Definition: val.c:13254
obj_get_next_default
const xmlChar * obj_get_next_default(const obj_template_t *obj, ncx_backptr_t *lastdef, ncx_backptr_t **thisdef)
Get the next default value for the specified object.
Definition: obj.c:11662
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
val_child_swap
status_t val_child_swap(val_value_t *newchild, val_value_t *curchild)
Swap a child value node with a current value node.
Definition: val_child.c:2253
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
val_set_ses_protocols_parm
status_t val_set_ses_protocols_parm(ses_cb_t *scb, val_value_t *parentval)
Handle the -protocols parameter for a session.
Definition: val_util.c:5306
xml_msg_authfn_t
boolean(* xml_msg_authfn_t)(xml_msg_hdr_t *msg, const xmlChar *username, const val_value_t *val)
read authorization callback template
Definition: xml_msg.h:600
VAL_SET_META
#define VAL_SET_META(V)
Flag the value as metadeata which is stored within another val_value_t->metaQ.
Definition: val.h:565
VAL_TYPE
#define VAL_TYPE(V)
Access the base type : same as VAL_BTYPE.
Definition: val.h:387
obj_get_basetype
ncx_btype_t obj_get_basetype(const obj_template_t *obj)
Get the NCX base type enum for the object type.
Definition: obj.c:12077
val_get_index_string
status_t val_get_index_string(xml_msg_hdr_t *mhdr, ncx_instfmt_t format, boolean force_quotes, const val_value_t *val, xmlChar *buff, uint32 *len)
Get the index string for the specified table or container entry.
Definition: val_util.c:3707
obj_npcon_has_defaults
boolean obj_npcon_has_defaults(obj_template_t *obj)
Check if the specified NP container has defaults within it Must be a config object!...
Definition: obj.c:11752
val_set_partial_lock
status_t val_set_partial_lock(val_value_t *val, plock_cb_t *plcb)
Set the partial lock throughout the value tree.
Definition: val_util.c:5647
NCX_IQUAL_OPT
@ NCX_IQUAL_OPT
'?' == 0 or 1
Definition: ncxtypes.h:298
VAL_BTYPE
#define VAL_BTYPE(V)
Access the base type : same as VAL_TYPE.
Definition: val.h:548
ERR_NCX_VAR_NOT_FOUND
@ ERR_NCX_VAR_NOT_FOUND
360
Definition: status_enum.h:403
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
XPATH_GET2CB_OBJ
#define XPATH_GET2CB_OBJ(N)
access the GET2 control block object in xpath_get2_node_t (N)
Definition: xpath.h:319
obj_get_default
const xmlChar * obj_get_default(const obj_template_t *obj)
Get the default value for the specified object.
Definition: obj.c:11570
val_new_value
val_value_t * val_new_value(void)
Malloc and initialize the fields in a val_value_t.
Definition: val.c:2697
ncx_set_protocol_enabled
void ncx_set_protocol_enabled(ncx_protocol_t proto)
Set the specified protocol version to be enabled.
Definition: ncx.c:10275
ERR_NCX_MIN_ELEMS_VIOLATION
@ ERR_NCX_MIN_ELEMS_VIOLATION
338 - 13.3
Definition: status_enum.h:381
ncx_set_warn_idlen
void ncx_set_warn_idlen(uint32 warnlen)
Set the warning length for identifiers.
Definition: ncx.c:9126
ncx_get_source
xmlChar * ncx_get_source(const xmlChar *fspec, status_t *res)
Expand a filespec into an absolute path.
Definition: ncx.c:8362
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
var_get_getvar_cb
var_getvar_fn_t var_get_getvar_cb(void)
Get the getvar callback function used for data templates.
Definition: var.c:2917
val_obj_has_config_defaults
boolean val_obj_has_config_defaults(val_value_t *val, obj_template_t *obj)
Check if the object itself or child nodes can have a default.
Definition: val_util.c:7351
VAL_IDREF_NSID
#define VAL_IDREF_NSID(V)
Access the namespace ID value as an identityref ONLY if NCX_BT_IDREF.
Definition: val.h:473
LOG_DEBUG_DEBUG
@ LOG_DEBUG_DEBUG
debug level 1
Definition: log.h:394
val_get_child_inst_id
uint32 val_get_child_inst_id(const val_value_t *parent, const val_value_t *child)
Get the instance ID for this child node within the parent context.
Definition: val.c:8953
obj.h
Data Object Support.
LOG_DEBUG_DEBUG3
@ LOG_DEBUG_DEBUG3
debug level 3
Definition: log.h:396
cfg_get_config_id
cfg_template_t * cfg_get_config_id(ncx_cfg_t cfgid)
Get the config struct from its ID.
Definition: cfg.c:1530
val_write_ok
status_t val_write_ok(val_value_t *val, op_editop_t editop, ses_id_t sesid, boolean checkup, uint32 *lockid)
Check if there are any partial-locks owned by another session in the node that is going to be written...
Definition: val_util.c:5778
val_walker_fn_t
boolean(* val_walker_fn_t)(val_value_t *val, void *cookie1, void *cookie2)
child or descendant node search walker function
Definition: val.h:1084
XP_FORM_GETCB_CHILD
@ XP_FORM_GETCB_CHILD
child node CB
Definition: xpath.h:450
val_set_warning_parms
status_t val_set_warning_parms(val_value_t *parentval)
Check the parent value struct (expected to be a container or list) for the common warning control par...
Definition: val_util.c:4587
val_check_swap_resnode
void val_check_swap_resnode(val_value_t *curval, val_value_t *newval)
Maintain partial locks; Used by server only.
Definition: val_util.c:5894
val_get_last_key
val_index_t * val_get_last_key(val_value_t *val)
Get the last key record if this is a list with a key-stmt.
Definition: val.c:13227
LOG_DEBUG_INFO
@ LOG_DEBUG_INFO
all previous + user info trace
Definition: log.h:392
val_set_logging_parms
status_t val_set_logging_parms(val_value_t *parentval)
Check the parent value struct (expected to be a container or list) for the common logging control par...
Definition: val_util.c:4679
val_convert_anyxml_to_real
status_t val_convert_anyxml_to_real(val_value_t *anyxml_val, val_value_t *real_val, val_value_t **error_val)
Convert anydata nodes to match a real template.
Definition: val_util.c:7246
OBJ_TYP_ACTION
@ OBJ_TYP_ACTION
not really data, YANG 1.1 only
Definition: obj.h:627
val_getbulk_return_t_::retval
struct val_value_t_ * retval[NCX_MAX_GETBULK_COUNT]
array of return values
Definition: val_util.h:156
ncx_string_in_list
boolean ncx_string_in_list(const xmlChar *str, const ncx_list_t *list)
Check if the string value is in the list List type must be string based, or an enum.
Definition: ncx_list.c:343
CHK_EXIT
#define CHK_EXIT(res, retres)
used in parser routines to decide if processing can continue will exit the function if critical error...
Definition: yangconst.h:221
xpath1_res.h
XPath 1.0 expression support; result support.
val_set_path_parms
status_t val_set_path_parms(val_value_t *parentval)
Set the main search paths for files.
Definition: val_util.c:5022
val_init_from_template
void val_init_from_template(val_value_t *val, struct obj_template_t_ *obj)
Initialize a value node from its object template.
NCX_IFMT_CLI2
@ NCX_IFMT_CLI2
CLI syntax used in yangcli config mode.
Definition: ncxtypes.h:402
obj_key_count
uint32 obj_key_count(const obj_template_t *obj)
Get the number of keys for this object.
Definition: obj.c:9637
NCX_BT_EXTERN
@ NCX_BT_EXTERN
not a real type, points fo file for contents
Definition: ncxtypes.h:230
ncx_file_close
void ncx_file_close(FILE *fp)
Close a file; check result.
Definition: ncx.c:13235
NCX_IFMT_YANGAPI
@ NCX_IFMT_YANGAPI
YANG-API URI with list1/key1/key2.
Definition: ncxtypes.h:403
dlq_enque
void dlq_enque(REG void *newP, REG dlq_hdrT *listP)
add a queue node to the end of a queue list Add newP to listP
Definition: dlq.c:246
ERR_NCX_WRONG_DATATYP
@ ERR_NCX_WRONG_DATATYP
285
Definition: status_enum.h:328
val_instance_check_max
status_t val_instance_check_max(val_value_t *root, val_value_t *val, obj_template_t *obj, boolean check_when, boolean check_deep, ses_cb_t *scb, xml_msg_hdr_t *msg)
Check for the proper number of object instances for the specified value struct.
Definition: val_util.c:2870
NCX_FEATURE_CODE_DYNAMIC
@ NCX_FEATURE_CODE_DYNAMIC
run-time if-feature code
Definition: ncxtypes.h:776
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
xmlns_inv_id
xmlns_id_t xmlns_inv_id(void)
Get the INVALID namespace ID.
Definition: xmlns.c:931
val_child_next_same
val_value_t * val_child_next_same(val_value_t *curnode)
Get the next node of the same type.
Definition: val_child.c:2359
VAL_STR
#define VAL_STR(V)
Access the value as a string ONLY if typ_is_string() is true.
Definition: val.h:464
VAL_L_UINT8
#define VAL_L_UINT8(V)
Access the left-hand-side value as an uint8 ONLY if NCX_BT_UINT8.
Definition: val.h:488
val_make_internal_value
val_value_t * val_make_internal_value(const xmlChar *name, const xmlChar *value)
Create an NCX_BT_INTERNAL value that contains the raw XML for the value node.
Definition: val_util.c:7279
log_get_pthread_log_level
log_debug_t log_get_pthread_log_level(void)
Get the pthreads log level.
Definition: log.c:3560
NCX_IFMT_XPATH2
@ NCX_IFMT_XPATH2
double-quote Xpath for error-path
Definition: ncxtypes.h:400
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
val_get_choice_first_set_ex
val_value_t * val_get_choice_first_set_ex(val_value_t *val, const obj_template_t *obj, boolean nondef)
Check a val_value_t struct against its expected OBJ to determine if a specific choice has already bee...
Definition: val_util.c:3091
ncx_set_feature_enable_default
void ncx_set_feature_enable_default(boolean flag)
Set the feature_enable_default flag.
Definition: ncx_feature.c:1285
val_need_quotes
boolean val_need_quotes(const xmlChar *str)
Check if a string needs to be quoted to be output within a conf file or ncxcli stdout output.
Definition: val.c:11685
obj_has_name
boolean obj_has_name(const obj_template_t *obj)
Check if the specified object type has a name.
Definition: obj.c:10667
NCX_IFMT_CLI
@ NCX_IFMT_CLI
CLI syntax used in val_dump_value.
Definition: ncxtypes.h:401
ses_putstr
void ses_putstr(ses_cb_t *scb, const xmlChar *str)
Write a zero-terminated string to the session.
Definition: ses.c:2460
xmlns_ncx_id
xmlns_id_t xmlns_ncx_id(void)
Get the ID for the NETCONF Extensions namespace or 0 if it doesn't exist.
Definition: xmlns.c:897
OBJ_TYP_LEAF
@ OBJ_TYP_LEAF
leaf
Definition: obj.h:615
val_move_fields_for_xml
void val_move_fields_for_xml(val_value_t *srcval, val_value_t *destval, boolean movemeta)
Move or copy the internal fields from one val to another for xml_wr purposes.
Definition: val.c:13133
ncxmod_set_runpath
void ncxmod_set_runpath(const xmlChar *runpath)
Override the YUMAPRO_RUNPATH env var with the runpath CLI var.
Definition: ncxmod.c:6373
NCX_BT_STRING
@ NCX_BT_STRING
string
Definition: ncxtypes.h:217
val_child_add_force
status_t val_child_add_force(val_value_t *child, val_value_t *parent)
Add a child value node to a parent value node Force add even if Tree Insersion fails.
Definition: val_child.c:1624
val_set_simval
status_t val_set_simval(val_value_t *val, typ_def_t *typdef, xmlns_id_t nsid, const xmlChar *valname, const xmlChar *valstr)
set any simple value with any typdef Set an initialized val_value_t as a simple type
Definition: val.c:6836
ncx_free_backptr
void ncx_free_backptr(ncx_backptr_t *ptr)
Free an ncx_backptr_t struct.
Definition: ncx.c:11433
val_expand_var_expr
status_t val_expand_var_expr(val_value_t *val, xmlChar **retstr)
Expand the variable expression if found.
Definition: val_util.c:6759
val_set_subdirs_parm
status_t val_set_subdirs_parm(val_value_t *parentval)
set the subdirs parameter
Definition: val_util.c:5081
ncx_set_feature_code_default
void ncx_set_feature_code_default(ncx_feature_code_t code)
Set the feature_code_default enumeration (deprecated)
Definition: ncx_feature.c:1304
val_make_binary_obj
val_value_t * val_make_binary_obj(obj_template_t *obj, const xmlChar *binstr, uint32 binstrlen, status_t *res)
Malloc and set a val_value_t as a NCX_BT_BINARY type.
Definition: val_util.c:4480
xmlns.h
XML namespace support.
val_get_choice_first_set
val_value_t * val_get_choice_first_set(val_value_t *val, const obj_template_t *obj)
Check a val_value_t struct against its expected OBJ to determine if a specific choice has already bee...
Definition: val_util.c:3068
val_free_value
void val_free_value(val_value_t *val)
Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct it...
Definition: val.c:2842
NCX_PROTO_NETCONF10
@ NCX_PROTO_NETCONF10
RFC 4741 base:1.0
Definition: ncxtypes.h:783
obj_is_deleted_ex
boolean obj_is_deleted_ex(const obj_template_t *obj)
Check if object has been deleted by a deviate not-supported Or if its parent was deleted by deviation...
Definition: obj.c:14361
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
obj_get_iqualval
ncx_iqual_t obj_get_iqualval(obj_template_t *obj)
Get the instance qualifier for this object.
Definition: obj.c:12427
status.h
Global error messages for status code enumerations.
val_set_intern
void val_set_intern(val_value_t *val, xmlChar *intbuff)
Setup an NCX_BT_INTERN value.
Definition: val.c:10921
yangapi.h
YANG-API definitions (pre-RESTCONF)
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
log_debug3_append
void void void void void void void void void void void void log_debug3_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG3 log entry.
obj_get_nsid
xmlns_id_t obj_get_nsid(const obj_template_t *obj)
Get the namespace ID for this object.
Definition: obj.c:12395
dlq.h
dlq provides general double-linked list and queue support:
val_get_const_xpathpcb
const xpath_pcb_t * val_get_const_xpathpcb(const val_value_t *val)
Get the XPath parser control block in the specified value struct.
Definition: val_util.c:4351
xpath1_res_get_cxt_name
const xmlChar * xpath1_res_get_cxt_name(const xpath_pcb_t *pcb)
Get the local-name of the context node.
Definition: xpath1_res.c:1286
val_write_extern
void val_write_extern(ses_cb_t *scb, const val_value_t *val)
Write an external file to the session.
Definition: val_util.c:5982
ncx_new_backptr
ncx_backptr_t * ncx_new_backptr(void *node)
Malloc and initialize a new ncx_backptr_t struct.
Definition: ncx.c:11412
ncx_get_nc_operation
obj_template_t * ncx_get_nc_operation(void)
Get the cached operation meta-object template used to contruct a metaval for the attribute.
Definition: ncx.c:11657
val_gen_keyclones
status_t val_gen_keyclones(val_value_t *val, dlq_hdr_t *keyQ)
Get all the keys for the specified data node object.
Definition: val_util.c:6987
val_value_t_::nsid
xmlns_id_t nsid
namespace ID for this node
Definition: val.h:880
typ_has_children
boolean typ_has_children(ncx_btype_t btyp)
Check if this is a data type that uses the val.v.childQ.
Definition: typ.c:3056
errmsg_dict.h
AVL Tree storage of Language Specific Error Messages.
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
val_match_datarule
boolean val_match_datarule(const val_value_t *val, void *rule)
Check if the data-rule back-ptr applies to this node.
Definition: val_util.c:6453