yumapro  22.10T-4
YumaPro SDK
Loading...
Searching...
No Matches
val.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
13#define _H_val
14
15/* FILE: val.h
16*********************************************************************
17* *
18* P U R P O S E *
19* *
20*********************************************************************/
21
30/*********************************************************************
31* *
32* C H A N G E H I S T O R Y *
33* *
34*********************************************************************
35
36date init comment
37----------------------------------------------------------------------
3819-dec-05 abb Begun
3921jul08 abb start obj-based rewrite
40
41*/
42
43#include <xmlstring.h>
44#include <time.h>
45
46#include "dlq.h"
47#include "ncxconst.h"
48#include "ncxtypes.h"
49#include "op.h"
50#include "plock_cb.h"
51#include "status.h"
52#include "typ.h"
53#include "xml_util.h"
54#include "xmlns.h"
55#include "log.h"
56
57#ifndef _H_ses
58#include "ses.h"
59#endif
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
65/********************************************************************
66* *
67* C O N S T A N T S *
68* *
69*********************************************************************/
70
71
72// Header only
73
146#define VAL_MAX_PLOCKS 1 // was 4
147
149#define VAL_MAX_DATARULES 1 // was 4
150
152#define VAL_MAX_NUMLEN NCX_MAX_NUMLEN
153
155#define VAL_BINDEX_CH '['
156#define VAL_EINDEX_CH ']'
158#define VAL_BENUM_CH '('
159#define VAL_EENUM_CH ')'
160#define VAL_INST_SEPCH '.'
161#define VAL_INDEX_SEPCH ','
162#define VAL_INDEX_CLI_SEPCH ' '
163#define VAL_CLI_SEPCH ' '
164#define VAL_QUOTE_CH '\''
165#define VAL_DBLQUOTE_CH '\"'
166#define VAL_EQUAL_CH '='
167#define VAL_XPATH_SEPCH '/'
168
169#define VAL_XPATH_INDEX_SEPSTR (const xmlChar *)"]["
170#define VAL_XPATH_INDEX_SEPLEN 2
171
173#define VAL_PASSWORD_STRING (const xmlChar *)"****"
174
178#define VAL_FL_DUPDONE bit0
179
181#define VAL_FL_DUPOK bit1
182
184#define VAL_FL_DEFSET bit2
185
187#define VAL_FL_META bit3
188
190#define VAL_FL_DIRTY bit4
191
193#define VAL_FL_UNIDONE bit5
194
196#define VAL_FL_DEFVALSET bit6
197
201#define VAL_FL_DEFVAL bit7
202
206#define VAL_FL_WITHDEF bit8
207
209#define VAL_FL_DELETED bit9
210
214#define VAL_FL_SUBTREE_DIRTY bit10
215
221#define VAL_FL_CHILD_DELETED bit11
222
229#define VAL_FL_IS_VAREXPR bit12
230
234#define VAL_FL_FIXED_VALUE bit13
235
239#define VAL_FL_EDIT2_MERGE bit14
240
242#define VAL_FL_EXTERNAL bit15
243
248#define VAL_FL_FORCE_CONFIG bit16
249
254#define VAL_FL_FORCE_CONFIG_VALUE bit17
255
260#define VAL_FL_VALUE_SET bit18
261
266#define VAL_FL_TEMP_XPATH bit19
267
271#define VAL_FL_UNCMTD_DELETE bit20
272
276#define VAL_FL_RECREATED bit21
277
283#define VAL_FL_SUBTREE_RECREATED bit22
284
289#define VAL_FL_FROM_TEMPLATE bit23
290
293#define VAL_FL_CANONICAL bit24
294
298#define VAL_FL_IS_INDEX bit25
299
304#define VAL_FL_WILDCARD bit26
305
309#define VAL_FL_ANYXML_KEY bit27
310
314#define VAL_FL_ANYXML_CONFIG bit28
315
321#define VAL_FL_ANYXML_UNKNOWN bit29
322
324#define VAL_FL_DEFCON_DELETED bit30
325
326
334#define VAL_FL_ADDEDIT_DELETED bit31
335
336
337/********* val_child_hdr->flags fields ***************/
338
339
347#define VAL_FL_GENERIC bit0
348
350#define VAL_FL_ROOT bit1
351
353#define VAL_FL_USE_QUE bit2
354
356#define VAL_FL_USE_TREE bit3
357
359#define VAL_FL_HDR_DIRTY bit4
360
362#define VAL_FL_HDR_SUBTREE_DIRTY bit5
363
367#define VAL_FL_HDR_RECREATED bit6
368
372#define VAL_FL_HDR_NOT_INSERTED bit7
373
374
376#define VAL_VIRTUAL_CACHE_TIME 3
377
378/* macros to access simple value types */
379
381#define VAL_OBJ(V) (V)->obj
382
384#define VAL_OBJTYPE(V) (V)->obj->objtype
385
387#define VAL_TYPE(V) (V)->btyp
388
390#define VAL_HDR(V) (V)->hdr
391
393#define VAL_TYPDEF(V) (V)->typdef
394
396#define VAL_NSID(V) (V)->nsid
397
399#define VAL_NAME(V) (V)->name
400
402#define VAL_RES(V) (V)->res
403
405#define VAL_BOOL(V) (V)->v.boo
406
408#define VAL_EMPTY(V) (V)->v.boo
409
411#define VAL_DOUBLE(V) (V)->v.num.d
412
414#define VAL_STRING(V) (V)->v.str
415
420#define VAL_BINARY(V) (V)->v.binary.ustr
421
423#define VAL_BINARY_LEN(V) (V)->v.binary.ustrlen
424
426#define VAL_ENU(V) (&(V)->v.enu)
427
429#define VAL_ENUM(V) (V)->v.enu.val
430
434#define VAL_ENUM_NAME(V) (V)->v.enu.name
435
437#define VAL_FLAG(V) (V)->v.boo
438
440#define VAL_NUMPTR(V) (&(V)->v.num)
441
443#define VAL_NUM(V) (V)->v.num
444
446#define VAL_LONG(V) (V)->v.num.l
447
449#define VAL_INT(V) (V)->v.num.i
450
452#define VAL_INT8(V) ((int8)((V)->v.num.i))
453
455#define VAL_L_INT8(V) (V)->v.num.i
456
458#define VAL_INT16(V) ((int16)((V)->v.num.i))
459
461#define VAL_L_INT16(V) (V)->v.num.i
462
464#define VAL_INT32(V) (V)->v.num.i
465
467#define VAL_INT64(V) (V)->v.num.l
468
470#define VAL_STR(V) (V)->v.str
471
473#define VAL_INSTANCE_ID(V) (V)->v.str
474
476#define VAL_IDREF(V) (&(V)->v.idref)
477
479#define VAL_IDREF_NSID(V) (V)->v.idref.nsid
480
482#define VAL_IDREF_NAME(V) (V)->v.idref.name
483
485#define VAL_IDREF_IDENTITY(V) (V)->v.idref.identity
486
488#define VAL_UINT(V) (V)->v.num.u
489
491#define VAL_UINT8(V) ((uint8)((V)->v.num.u))
492
494#define VAL_L_UINT8(V) (V)->v.num.u
495
497#define VAL_UINT16(V) ((uint16)((V)->v.num.u))
498
500#define VAL_L_UINT16(V) (V)->v.num.u
501
503#define VAL_UINT32(V) (V)->v.num.u
504
506#define VAL_L_UINT32(V) (V)->v.num.u
507
509#define VAL_UINT64(V) (V)->v.num.ul
510
512#define VAL_ULONG(V) (V)->v.num.ul
513
517#define VAL_DEC64(V) (V)->v.num.dec.val
518
522#define VAL_DEC64_DIGITS(V) (V)->v.num.dec.digits
523
527#define VAL_DEC64_ZEROES(V) (V)->v.num.dec.zeroes
528
530#define VAL_LIST(V) (V)->v.list
531
533#define VAL_BITS VAL_LIST
534
535
537#define VAL_INTERN(V) (V)->v.intbuff
538
539
541#define VAL_EXTERN(V) (V)->v.fname
542
543
545#define VAL_IS_DELETED(V) ((V)->flags & VAL_FL_DELETED)
546
548#define VAL_MARK_DELETED(V) val_mark_deleted(V)
549
551#define VAL_UNMARK_DELETED(V) val_mark_undeleted(V)
552
554#define VAL_LAST_MODIFIED(V) (V)->last_modified
555
557#define VAL_ETAG(V) (V)->etag
558
560#define VAL_BTYPE(V) (V)->btyp
561
563#define VAL_SET_VAREXPR(V) (V)->flags |= VAL_FL_IS_VAREXPR
564
566#define VAL_CLR_VAREXPR(V) (V)->flags &= ~VAL_FL_IS_VAREXPR
567
569#define VAL_IS_VAREXPR(V) ((V)->flags & VAL_FL_IS_VAREXPR)
570
572#define VAL_VAREXPR(V) val_get_varexpr(V)
573
577#define VAL_SET_META(V) (V)->flags |= VAL_FL_META
578
580#define VAL_REMOVE_META(M) dlq_remove(M)
581
585#define VAL_SET_FIXED_VALUE(V) (V)->flags |= VAL_FL_FIXED_VALUE
586
590#define VAL_CLR_FIXED_VALUE(V) (V)->flags &= ~VAL_FL_FIXED_VALUE
591
595#define VAL_IS_FIXED_VALUE(V) ((V)->flags & VAL_FL_FIXED_VALUE)
596
598#define VAL_SET_EDIT2_MERGE(V) (V)->flags |= VAL_FL_EDIT2_MERGE
599
601#define VAL_CLR_EDIT2_MERGE(V) (V)->flags &= ~VAL_FL_EDIT2_MERGE
602
604#define VAL_IS_EDIT2_MERGE(V) ((V)->flags & VAL_FL_EDIT2_MERGE)
605
609#define VAL_SET_EXTERNAL(V) (V)->flags |= VAL_FL_EXTERNAL
610
612#define VAL_CLR_EXTERNAL(V) (V)->flags &= ~VAL_FL_EXTERNAL
613
615#define VAL_IS_EXTERNAL(V) ((V)->flags & VAL_FL_EXTERNAL)
616
618#define VAL_SET_VALUE_SET(V) (V)->flags |= VAL_FL_VALUE_SET
619
621#define VAL_CLR_VALUE_SET(V) (V)->flags &= ~VAL_FL_VALUE_SET
622
624#define VAL_IS_VALUE_SET(V) ((V)->flags & VAL_FL_VALUE_SET)
625
627#define VAL_SET_TEMP_XPATH(V) (V)->flags |= VAL_FL_TEMP_XPATH
628
630#define VAL_CLR_TEMP_XPATH(V) (V)->flags &= ~VAL_FL_TEMP_XPATH
631
633#define VAL_IS_TEMP_XPATH(V) ((V)->flags & VAL_FL_TEMP_XPATH)
634
636#define VAL_SET_UNCOMMITTED_DELETE(V) (V)->flags |= VAL_FL_UNCMTD_DELETE
637
639#define VAL_CLR_UNCOMMITTED_DELETE(V) (V)->flags &= ~VAL_FL_UNCMTD_DELETE
640
642#define VAL_IS_UNCOMMITTED_DELETE(V) ((V)->flags & VAL_FL_UNCMTD_DELETE)
643
645#define VAL_SET_RECREATED(V) (V)->flags |= VAL_FL_RECREATED
646
648#define VAL_CLR_RECREATED(V) (V)->flags &= ~VAL_FL_RECREATED
649
651#define VAL_IS_RECREATED(V) ((V)->flags & VAL_FL_RECREATED)
652
654#define VAL_SET_FROM_TEMPLATE(V) (V)->flags |= VAL_FL_FROM_TEMPLATE
655
657#define VAL_CLR_FROM_TEMPLATE(V) (V)->flags &= ~VAL_FL_FROM_TEMPLATE
658
660#define VAL_IS_FROM_TEMPLATE(V) ((V)->flags & VAL_FL_FROM_TEMPLATE)
661
663#define VAL_XPATHPCB(V) val_get_xpathpcb(V)
664
666#define VAL_SET_CANONICAL(V) (V)->flags |= VAL_FL_CANONICAL
667
669#define VAL_CLR_CANONICAL(V) (V)->flags &= ~VAL_FL_CANONICAL
670
672#define VAL_IS_CANONICAL(V) ((V)->flags & VAL_FL_CANONICAL)
673
675#define VAL_NMDA_ORIGIN(V) (V)->nmda_origin
676
678#define VAL_IS_INDEX(V) ((V)->flags & VAL_FL_IS_INDEX)
679
681#define VAL_SET_IS_INDEX(V) (V)->flags |= VAL_FL_IS_INDEX
682
684#define VAL_CHILD_HDR_OBJ(H) (H)->obj
685
687#define VAL_CHILD_HDR_COUNT(H) (H)->count
688
690#define VAL_SET_DEFCON_DELETED(V) (V)->flags |= VAL_FL_DEFCON_DELETED
691
693#define VAL_CLR_DEFCON_DELETED(V) (V)->flags &= ~VAL_FL_DEFCON_DELETED
694
696#define VAL_IS_DEFCON_DELETED(V) ((V)->flags & VAL_FL_DEFCON_DELETED)
697
698
703#define VAL_SET_ADDEDIT_DELETED(V) (V)->flags |= VAL_FL_ADDEDIT_DELETED
704
706#define VAL_IS_ADDEDIT_DELETED(V) ((V)->flags & VAL_FL_ADDEDIT_DELETED)
707
708
713#define VAL_EDITOP(V) (V)->editop
714
717/********************************************************************
718* *
719* T Y P E S *
720* *
721*********************************************************************/
722
740typedef void (*dumpfn_t) (log_debug_t level, const char *fstr, ...);
741
742
749typedef void (*errfn_t) (const char *fstr, ...);
750
751
758/* pick a log indent function for dump_value */
759typedef void (*indentfn_t) (log_debug_t level, int32 indentcnt);
760
761
765typedef struct logfns_t_ {
766 dumpfn_t dumpfn; /**< log dump callback */
767 errfn_t errorfn; /**< log error callback */
768 indentfn_t indentfn; /**< log indent callback */
769 boolean suppressVariableNames; /**< suppress variable names in output */
770 FILE *outputFile; /**< manager redirect to file output */
771} logfns_t;
772
773
775typedef struct val_idref_t_ {
776 xmlns_id_t nsid; /**< namespace ID */
778 xmlChar *name;
779 ncx_identity_t *identity; /**< ID back-ptr if found */
780} YPACK val_idref_t;
781
782
784typedef enum val_insert_mode_t_ {
785 VAL_INS_MODE_NONE, /**< not set */
786 VAL_INS_MODE_KEY, /**< YANG key attribute */
787 VAL_INS_MODE_VALUE, /**< YANG value attribute */
788 VAL_INS_MODE_POINT /**< YANG-API point param */
789} YPACK val_insert_mode_t;
790
791
793typedef enum val_dumpvalue_mode_t_ {
794 DUMP_VAL_NONE, /**< not set */
795 DUMP_VAL_STDOUT, /**< dump val to STDOUT */
796 DUMP_VAL_LOG, /**< dump val to main log */
797 DUMP_VAL_ALT_LOG, /**< dump val to alternate log */
798 DUMP_VAL_AUDIT_LOG, /**< dump val to audit log */
799} val_dumpvalue_mode_t;
800
801
803typedef struct val_editvars_t_ {
808 struct val_value_t_ *curparent; /**< track the real parent */
809 op_insertop_t insertop; /**< YANG insert operation */
810 xmlChar *insertstr; /**< saved value or key attr */
811 struct xpath_pcb_t_ *insertxpcb; /**< key attr for insert */
812 struct val_value_t_ *insertval; /**< back-ptr if before or after */
813 val_insert_mode_t insert_mode; /**< insert mode requested */
814 uint8 silprio; /**< 2nd SIL priority for server */
815 boolean operset; /**< nc:operation here */
816 void *pcookie; /**< user pointer cookie */
817 int icookie; /**< user integer cookie */
818 boolean is_move; /**< TRUE if YPATCH MOVE operation */
819 boolean skip_sil_partial; /**< TRUE is skip_sil_partial needed */
820} YPACK val_editvars_t;
821
822
824typedef struct val_extra_t_ {
825
831 xmlChar *dname; /**< malloced name if needed */
832
839 void *getcb;
840
845 struct val_value_t_ *virtualval;
846
848 time_t cachetime;
849
854 struct xpath_pcb_t_ *xpathpcb;
855
856
860 plock_cb_t *plock[VAL_MAX_PLOCKS];
861
862
866 dlq_hdr_t *dataruleQ; /**< Q of obj_xpath_ptr_t */
867
873 xmlChar *varexpr;
874
879 struct xpath_aio_cb_t_ *aiocb;
880
882 ncx_sm_mpid_t *mpid;
883
884} YPACK val_extra_t;
885
886
891typedef struct val_value_t_ {
893 dlq_hdr_t qhdr;
894
896 struct obj_template_t_ *obj; /**< bptr to object def */
897 typ_def_t *typdef; /**< bptr to typdef if leaf */
898 const xmlChar *name; /**< back pointer to elname\n
899 * the dname field is moved to val_extra_t and only used when
900 * the value is constructed from dummy objects or no objects at all
901 */
902
903 struct val_value_t_ *parent; /**< back-ptr to parent if any */
904 struct val_child_hdr_t_ *hdr; /**< back-ptr to own child_hdr */
905
907 val_extra_t *val_extra;
908
909 uint32 flags; /**< internal status flags */
910
911 xmlns_id_t nsid; /**< namespace ID for this node */
912 ncx_btype_t btyp; /**< base type of this value */
913 ncx_data_class_t dataclass; /**< config or state data */
914
918 time_t last_modified;
919 ncx_etag_t etag; /**< ETag for RESTCONF */
920
934 dlq_hdr_t *metaQ; /**< Q of val_value_t */
935
939 val_editvars_t *editvars; /**< edit-vars from attrs */
940 op_editop_t editop; /**< needed for all edits */
941 status_t res; /**< validation result */
942
943 /* GET1 getcb moved to val_extra */
944 /* GET1 virtualval moved to val_extra */
945 /* GET1 cachetime moved to val_extra */
946
948 dlq_hdr_t *indexQ; /**< Q of val_index_t or ncx_filptr_t */
949
950 /* this field is used for NCX_BT_CHOICE
951 * If set, the object path for this node is really:
952 * $this --> casobj --> casobj.parent --> $this.parent
953 * the OBJ_TYP_CASE and OBJ_TYP_CHOICE nodes are skipped
954 * inside an XML instance document
955 *
956 * replaced by val_get_casobj() function in val_util.h
957 * struct obj_template_t_ *casobj;
958 */
959
960 /* xpathpcb moved to val_extra_t */
961
962 /* back-ptr to the partial locks that are held
963 * against this node
964 * plock moved to val_extra
965 */
966
967 /* back-ptr to the data access control rules that
968 * reference this node
969 * dataruleQ moved to val_extra
970 */
971
972 /* malloced pointer to the variable expression found
973 * if this val node is part of a data template.
974 * The actual value in union v_ MUST be ignored if
975 * varexpr string is non-NULL!!
976 * varexpr moved to val_extra
977 */
978
982 ncx_owner_id_t owner_id;
983
985 ncx_nmda_origin_t nmda_origin;
986
996 union v_ {
1006 dlq_hdr_t child_hdrQ;
1007
1017 ncx_num_t num;
1018
1025 ncx_str_t str;
1026
1027 val_idref_t idref; /**< NCX_BT_IDREF */
1028 ncx_binary_t binary; /**< NCX_BT_BINARY */
1029 ncx_list_t list; /**< NCX_BT_BITS, NCX_BT_SLIST */
1030 boolean boo; /**< NCX_BT_EMPTY, NCX_BT_BOOLEAN */
1031 ncx_enum_t enu; /**< NCX_BT_UNION, NCX_BT_ENUM */
1032 xmlChar *fname; /**< NCX_BT_EXTERN */
1033 xmlChar *intbuff; /**< NCX_BT_INTERN */
1034 } YPACK v;
1035} YPACK val_value_t;
1036
1037
1041typedef struct val_child_hdr_t_ {
1042 dlq_hdr_t qhdr; /**< queue header */
1043
1049 struct obj_template_t_ *obj;
1050
1054 struct val_tree_t_ *tree;
1055
1060 dlq_hdr_t que;
1061
1063 uint32 count;
1064
1066 uint8 flags;
1067} YPACK val_child_hdr_t;
1068
1069
1080typedef struct val_index_t_ {
1081 dlq_hdr_t qhdr; /**< queue header */
1082 val_value_t *val; /**< points to a child node */
1083} YPACK val_index_t;
1084
1085
1087typedef struct val_unique_t_ {
1088 dlq_hdr_t qhdr; /**< queue header */
1089 struct xpath_pcb_t_ *pcb; /**< live XPath CB w/ result */
1090} YPACK val_unique_t;
1091
1092
1101typedef boolean
1102 (*val_test_fn_t) (const val_value_t *val);
1103
1104
1114typedef boolean
1115 (*val_walker_fn_t) (val_value_t *val,
1116 void *cookie1,
1117 void *cookie2);
1118
1119
1120
1130typedef boolean
1131 (*val_walker2_fn_t) (val_child_hdr_t *valhdr,
1132 void *cookie1,
1133 void *cookie2);
1134
1135
1136
1146typedef boolean
1147 (*val_hdr_test_fn_t) (val_child_hdr_t *hdr,
1148 void *cookie);
1149
1150
1160typedef boolean
1161 (*val_test2_fn_t) (val_value_t *val,
1162 void *cookie);
1163
1164
1168/********************************************************************
1169* *
1170* F U N C T I O N S *
1171* *
1172*********************************************************************/
1173
1191extern val_value_t *
1192 val_new_value (void);
1193
1194
1203extern void
1204 val_init_value (val_value_t *val);
1205
1206
1217extern void
1218 val_init_complex (val_value_t *val,
1219 ncx_btype_t btyp);
1220
1221
1231extern void
1232 val_init_virtual (val_value_t *val,
1233 void *cbfn,
1234 struct obj_template_t_ *obj);
1235
1236
1246extern void
1247 val_init_from_template (val_value_t *val,
1248 struct obj_template_t_ *obj);
1249
1250
1260extern void
1261 val_reinit_from_template (val_value_t *val,
1262 struct obj_template_t_ *obj);
1263
1264
1274extern void
1275 val_free_value (val_value_t *val);
1276
1277
1285extern void
1286 val_set_name (val_value_t *val,
1287 const xmlChar *name,
1288 uint32 namelen);
1289
1290
1300extern status_t
1301 val_force_dname (val_value_t *val);
1302
1303
1312extern void
1313 val_set_qname (val_value_t *val,
1314 xmlns_id_t nsid,
1315 const xmlChar *name,
1316 uint32 namelen);
1317
1318
1328extern status_t
1329 val_string_ok (typ_def_t *typdef,
1330 ncx_btype_t btyp,
1331 const xmlChar *strval);
1332
1333
1348extern status_t
1349 val_string_ok_errinfo (typ_def_t *typdef,
1350 ncx_btype_t btyp,
1351 const xmlChar *strval,
1352 ncx_errinfo_t **errinfo);
1353
1354
1370status_t
1371 val_binary_ok_errinfo (typ_def_t *typdef,
1372 const xmlChar *strval,
1373 val_value_t *val,
1374 ncx_errinfo_t **errinfo);
1375
1376
1394extern status_t
1395 val_string_ok_ex (ses_cb_t *scb,
1396 typ_def_t *typdef,
1397 ncx_btype_t btyp,
1398 const xmlChar *strval,
1399 ncx_errinfo_t **errinfo,
1400 boolean logerrors);
1401
1402
1421extern status_t
1422 val_string_ok_ex2 (ses_cb_t *scb,
1423 typ_def_t *typdef,
1424 ncx_btype_t btyp,
1425 const xmlChar *strval,
1426 ncx_errinfo_t **errinfo,
1427 boolean logerrors,
1428 boolean is_defval);
1429
1430
1451extern status_t
1452 val_list_ok (typ_def_t *typdef,
1453 ncx_btype_t btyp,
1454 ncx_list_t *list);
1455
1456
1474extern status_t
1475 val_list_ok_errinfo (typ_def_t *typdef,
1476 ncx_btype_t btyp,
1477 ncx_list_t *list,
1478 ncx_errinfo_t **errinfo);
1479
1480
1493extern status_t
1494 val_enum_ok (typ_def_t *typdef,
1495 const xmlChar *enumval,
1496 int32 *retval,
1497 const xmlChar **retstr);
1498
1499
1509extern status_t
1510 val_bit_ok (typ_def_t *typdef,
1511 const xmlChar *bitname,
1512 uint32 *position);
1513
1514
1515
1516
1526extern status_t
1527 val_bitpos_ok (typ_def_t *typdef,
1528 uint32 position,
1529 const xmlChar **name);
1530
1531
1550extern status_t
1551 val_idref_ok (typ_def_t *typdef,
1552 const xmlChar *qname,
1553 xmlns_id_t nsid,
1554 const xmlChar **name,
1555 ncx_identity_t **id);
1556
1557
1582extern status_t
1583 val_idref_ok_ex (typ_def_t *typdef,
1584 const xmlChar *qname,
1585 xmlns_id_t nsid,
1586 boolean is_json,
1587 ncx_module_t *impmod,
1588 boolean or_self,
1589 const xmlChar **name,
1590 ncx_identity_t **id);
1591
1592
1609extern status_t
1610 val_parse_idref (ncx_module_t *mod,
1611 const xmlChar *qname,
1612 xmlns_id_t *nsid,
1613 const xmlChar **name,
1614 ncx_identity_t **id);
1615
1616
1634extern status_t
1635 val_parse_idref_rootcb (ncx_module_t *mod,
1636 const xmlChar *qname,
1637 xmlns_id_t *nsid,
1638 const xmlChar **name,
1639 ncx_identity_t **id,
1640 ncx_sm_rootcb_t *rootcb);
1641
1642
1652extern status_t
1653 val_range_ok (typ_def_t *typdef,
1654 ncx_btype_t btyp,
1655 const ncx_num_t *num);
1656
1657
1669extern status_t
1670 val_range_ok_errinfo (typ_def_t *typdef,
1671 ncx_btype_t btyp,
1672 const ncx_num_t *num,
1673 ncx_errinfo_t **errinfo);
1674
1675
1683extern status_t
1684 val_pattern_ok (typ_def_t *typdef,
1685 const xmlChar *strval);
1686
1687
1700extern status_t
1701 val_pattern_ok_errinfo (typ_def_t *typdef,
1702 const xmlChar *strval,
1703 ncx_errinfo_t **errinfo);
1704
1705
1715extern status_t
1716 val_simval_ok (typ_def_t *typdef,
1717 const xmlChar *simval);
1718
1719
1720
1732extern status_t
1733 val_simval_ok_errinfo (typ_def_t *typdef,
1734 const xmlChar *simval,
1735 ncx_errinfo_t **errinfo);
1736
1737
1751extern status_t
1752 val_simval_ok_ex (typ_def_t *typdef,
1753 const xmlChar *simval,
1754 ncx_errinfo_t **errinfo,
1755 ncx_module_t *mod);
1756
1757
1773extern status_t
1774 val_simval_ok_max (typ_def_t *typdef,
1775 const xmlChar *simval,
1776 ncx_errinfo_t **errinfo,
1777 ncx_module_t *mod,
1778 boolean logerrors);
1779
1798extern status_t
1799 val_simval_ok_max2 (typ_def_t *typdef,
1800 const xmlChar *simval,
1801 ncx_errinfo_t **errinfo,
1802 ncx_module_t *mod,
1803 boolean logerrors,
1804 boolean nocond);
1805
1806
1826status_t
1827 val_simval_ok_max3 (typ_def_t *typdef,
1828 const xmlChar *simval,
1829 ncx_errinfo_t **errinfo,
1830 ncx_module_t *mod,
1831 boolean logerrors,
1832 boolean nocond,
1833 boolean is_defval);
1834
1835
1847extern status_t
1848 val_union_ok (typ_def_t *typdef,
1849 const xmlChar *strval,
1850 val_value_t *retval);
1851
1852
1866extern status_t
1867 val_union_ok_errinfo (typ_def_t *typdef,
1868 const xmlChar *strval,
1869 val_value_t *retval,
1870 ncx_errinfo_t **errinfo);
1871
1872
1890extern status_t
1891 val_union_ok_ex (typ_def_t *typdef,
1892 const xmlChar *strval,
1893 val_value_t *retval,
1894 ncx_errinfo_t **errinfo,
1895 ncx_module_t *mod,
1896 typ_def_t **match_typdef);
1897
1898
1919extern status_t
1920 val_union_ok_binary (typ_def_t *typdef,
1921 const xmlChar *binstr,
1922 uint32 binstrlen,
1923 val_value_t *retval,
1924 ncx_errinfo_t **errinfo,
1925 typ_def_t **match_typdef);
1926
1927
1947extern status_t
1948 val_union_ok_full (typ_def_t *typdef,
1949 const xmlChar *strval,
1950 val_value_t *contextval,
1951 val_value_t *rootval,
1952 val_value_t *retval,
1953 ncx_errinfo_t **errinfo);
1954
1955
1962extern dlq_hdr_t *
1963 val_get_metaQ (val_value_t *val);
1964
1965
1973extern val_value_t *
1974 val_get_first_meta (dlq_hdr_t *queue);
1975
1976
1984extern val_value_t *
1985 val_get_first_meta_val (val_value_t *val);
1986
1987
1995extern val_value_t *
1996 val_get_next_meta (val_value_t *curnode);
1997
1998
2006extern boolean
2007 val_meta_empty (val_value_t *val);
2008
2009
2018extern val_value_t *
2019 val_find_meta (val_value_t *val,
2020 xmlns_id_t nsid,
2021 const xmlChar *name);
2022
2023
2033extern boolean
2034 val_meta_match (val_value_t *val,
2035 val_value_t *metaval);
2036
2037
2046extern uint32
2047 val_metadata_inst_count (val_value_t *val,
2048 xmlns_id_t nsid,
2049 const xmlChar *name);
2050
2051
2062extern void
2063 val_dump_value (val_value_t *val,
2064 int32 startindent,
2065 log_debug_t lvl);
2066
2067
2079extern void
2080 val_dump_value_ex (val_value_t *val,
2081 int32 startindent,
2082 ncx_display_mode_t display_mode,
2083 log_debug_t lvl);
2084
2085
2096extern void
2097 val_dump_alt_value (val_value_t *val,
2098 int32 startindent,
2099 log_debug_t lvl);
2100
2101
2111extern void
2112 val_stdout_value (val_value_t *val,
2113 int32 startindent,
2114 log_debug_t lvl);
2115
2116
2127extern void
2128 val_stdout_value_ex (val_value_t *val,
2129 int32 startindent,
2130 ncx_display_mode_t display_mode,
2131 log_debug_t lvl);
2132
2133
2151extern void
2152 val_dump_value_max (val_value_t *val,
2153 int32 startindent,
2154 int32 indent_amount,
2155 val_dumpvalue_mode_t dumpmode,
2156 ncx_display_mode_t display_mode,
2157 boolean with_meta,
2158 boolean configonly,
2159 log_debug_t lvl);
2160
2161
2183extern void
2184 val_dump_value_full (val_value_t *val,
2185 int32 startindent,
2186 int32 indent_amount,
2187 val_dumpvalue_mode_t dumpmode,
2188 ncx_display_mode_t display_mode,
2189 boolean with_meta,
2190 boolean configonly,
2191 boolean conf_mode,
2192 boolean expand_varexpr,
2193 log_debug_t lvl,
2194 logfns_t *overrideOutput);
2195
2196
2219extern void
2220 val_dump_value_full2 (val_value_t *val,
2221 int32 startindent,
2222 int32 indent_amount,
2223 val_dumpvalue_mode_t dumpmode,
2224 ncx_display_mode_t display_mode,
2225 boolean with_meta,
2226 boolean configonly,
2227 boolean conf_mode,
2228 boolean expand_varexpr,
2229 boolean withdef,
2230 log_debug_t lvl,
2231 logfns_t *overrideOutput);
2232
2233
2246extern status_t
2247 val_set_string (val_value_t *val,
2248 const xmlChar *valname,
2249 const xmlChar *valstr);
2250
2251
2267extern status_t
2268 val_set_string2 (val_value_t *val,
2269 const xmlChar *valname,
2270 typ_def_t *typdef,
2271 const xmlChar *valstr,
2272 uint32 valstrlen);
2273
2274
2290extern status_t
2291 val_set_binary (const xmlChar *valstr,
2292 uint32 valstrlen,
2293 val_value_t *val);
2294
2295
2296
2306extern status_t
2307 val_reset_empty (val_value_t *val);
2308
2309
2322extern status_t
2323 val_set_simval (val_value_t *val,
2324 typ_def_t *typdef,
2325 xmlns_id_t nsid,
2326 const xmlChar *valname,
2327 const xmlChar *valstr);
2328
2329
2372extern status_t
2373 val_set_simval_str (val_value_t *val,
2374 typ_def_t *typdef,
2375 xmlns_id_t nsid,
2376 const xmlChar *valname,
2377 uint32 valnamelen,
2378 const xmlChar *valstr);
2379
2380
2401extern status_t
2402 val_set_simval_binary (val_value_t *val,
2403 const xmlChar *binstr,
2404 uint32 binstrlen);
2405
2406
2450extern status_t
2451 val_set_simval_max (val_value_t *val,
2452 typ_def_t *typdef,
2453 xmlns_id_t nsid,
2454 const xmlChar *valname,
2455 uint32 valnamelen,
2456 const xmlChar *valstr,
2457 uint32 valstrlen);
2458
2459
2473extern val_value_t *
2474 val_make_simval (typ_def_t *typdef,
2475 xmlns_id_t nsid,
2476 const xmlChar *valname,
2477 const xmlChar *valstr,
2478 status_t *res);
2479
2480
2494extern val_value_t *
2495 val_make_string (xmlns_id_t nsid,
2496 const xmlChar *valname,
2497 const xmlChar *valstr);
2498
2499
2510extern val_value_t *
2511 val_make_binary (xmlns_id_t nsid,
2512 const xmlChar *valname,
2513 const xmlChar *valstr,
2514 uint32 valstrlen);
2515
2516
2528extern status_t
2529 val_merge (const val_value_t *src,
2530 val_value_t *dest);
2531
2532
2539extern val_value_t *
2540 val_clone (const val_value_t *val);
2541
2542
2550extern val_value_t *
2551 val_clone2 (const val_value_t *val);
2552
2553
2567extern val_value_t *
2568 val_clone_config_data (const val_value_t *val,
2569 status_t *res);
2570
2571
2572
2589extern val_value_t *
2590 val_clone_config_newval (const val_value_t *val,
2591 status_t *res);
2592
2593
2613extern val_value_t *
2614 val_clone_config_save (const val_value_t *val,
2615 status_t *res);
2616
2617
2628extern status_t
2629 val_replace (val_value_t *val,
2630 val_value_t *copy);
2631
2632
2642extern status_t
2643 val_replace_str (const xmlChar *str,
2644 uint32 stringlen,
2645 val_value_t *copy);
2646
2647
2658extern status_t
2659 val_fast_replace_string (const xmlChar *str,
2660 uint32 stringlen,
2661 val_value_t *copy);
2662
2663
2670extern void
2671 val_replace_stringval (val_value_t *val,
2672 const xmlChar *str);
2673
2674
2693extern void
2694 val_add_child (val_value_t *child,
2695 val_value_t *parent);
2696
2697
2710extern void
2711 val_add_child_sorted (val_value_t *child,
2712 val_value_t *parent);
2713
2714
2726extern void
2727 val_insert_child (val_value_t *child,
2728 val_value_t *current,
2729 val_value_t *parent);
2730
2731
2740extern void
2741 val_remove_child (val_value_t *child);
2742
2743
2753extern void
2754 val_swap_child (val_value_t *newchild,
2755 val_value_t *curchild);
2756
2757
2765extern val_value_t *
2766 val_first_child_match (const val_value_t *parent,
2767 const val_value_t *child);
2768
2769
2780extern val_value_t *
2781 val_first_child_match_fast (const val_value_t *parent,
2782 const val_value_t *child,
2783 val_value_t *lastmatch);
2784
2785
2797extern val_value_t *
2798 val_next_child_match (val_value_t *parent,
2799 val_value_t *child,
2800 val_value_t *curmatch);
2801
2802
2809extern val_value_t *
2810 val_next_child_same (val_value_t *curchild);
2811
2812
2819extern val_value_t *
2820 val_get_first_child (const val_value_t *parent);
2821
2822
2829extern val_value_t *
2830 val_get_next_child (const val_value_t *curchild);
2831
2832
2839extern val_value_t *
2840 val_get_first_terminal_child (const val_value_t *parent);
2841
2842
2849extern val_value_t *
2850 val_get_next_terminal_child (const val_value_t *curchild);
2851
2852
2866extern val_value_t *
2867 val_find_child (const val_value_t *parent,
2868 const xmlChar *modname,
2869 const xmlChar *childname);
2870
2871
2885extern val_value_t *
2886 val_find_child_fast (const val_value_t *parent,
2887 xmlns_id_t nsid,
2888 const xmlChar *childname);
2889
2890
2899extern val_value_t *
2900 val_find_child_obj (const val_value_t *parent,
2901 const struct obj_template_t_ *chobj);
2902
2903
2918extern val_value_t *
2919 val_find_child_que (const dlq_hdr_t *childQ,
2920 xmlns_id_t nsid,
2921 const xmlChar *childname);
2922
2923
2937extern val_value_t *
2938 val_match_child (const val_value_t *parent,
2939 const xmlChar *modname,
2940 const xmlChar *childname);
2941
2942
2959extern val_value_t *
2960 val_match_child_count (const val_value_t *parent,
2961 const xmlChar *modname,
2962 const xmlChar *childname,
2963 uint32 *matchcount);
2964
2965
2982extern val_value_t *
2983 val_find_next_child (const val_value_t *parent,
2984 const xmlChar *modname,
2985 const xmlChar *childname,
2986 const val_value_t *curchild);
2987
2988
3002extern val_value_t *
3003 val_find_next_child_fast (const val_value_t *parent,
3004 const val_value_t *curchild);
3005
3006
3015extern val_value_t *
3016 val_first_child_name (val_value_t *parent,
3017 const xmlChar *name);
3018
3019
3028extern val_value_t *
3029 val_first_child_qname (val_value_t *parent,
3030 xmlns_id_t nsid,
3031 const xmlChar *name);
3032
3033
3043extern val_value_t *
3044 val_next_child_qname (val_value_t *parent,
3045 xmlns_id_t nsid,
3046 const xmlChar *name,
3047 val_value_t *curchild);
3048
3049
3067extern val_value_t *
3068 val_first_child_string (val_value_t *parent,
3069 const xmlChar *name,
3070 const xmlChar *strval);
3071
3072
3081extern uint32
3082 val_child_cnt (val_value_t *parent);
3083
3084
3094extern uint32
3095 val_child_inst_cnt (const val_value_t *parent,
3096 const xmlChar *modname,
3097 const xmlChar *name);
3098
3099
3107extern uint32
3108 val_get_child_inst_id (const val_value_t *parent,
3109 const val_value_t *child);
3110
3111
3118extern uint32
3119 val_liststr_count (const val_value_t *val);
3120
3121
3134extern boolean
3135 val_index_match (const val_value_t *val1,
3136 const val_value_t *val2);
3137
3138
3149extern int
3150 val_index_compare (const val_value_t *val1,
3151 const val_value_t *val2);
3152
3153
3183extern int32
3184 val_compare_max (const val_value_t *val1,
3185 const val_value_t *val2,
3186 boolean configonly,
3187 boolean childonly,
3188 boolean editing);
3189
3190
3224extern int32
3225 val_compare_max_def (const val_value_t *val1,
3226 const val_value_t *val2,
3227 boolean configonly,
3228 boolean childonly,
3229 boolean editing,
3230 boolean ignore_defaults);
3231
3232
3256extern int32
3257 val_compare_ex (const val_value_t *val1,
3258 const val_value_t *val2,
3259 boolean configonly);
3260
3261
3282extern int32
3283 val_compare (const val_value_t *val1,
3284 const val_value_t *val2);
3285
3286
3306extern int32
3307 val_compare_to_string (const val_value_t *val1,
3308 const xmlChar *strval2,
3309 status_t *res);
3310
3311
3333extern int32
3334 val_compare_to_string_len (const val_value_t *val1,
3335 const xmlChar *strval2,
3336 uint32 strval2len,
3337 status_t *res);
3338
3339
3358extern int32
3359 val_compare_for_replace (const val_value_t *val1,
3360 const val_value_t *val2);
3361
3362
3381extern int32
3382 val_compare_for_edit (const val_value_t *val1,
3383 const val_value_t *val2,
3384 boolean ismerge);
3385
3386
3405extern int32
3406 val_compare_as_string (const val_value_t *val1,
3407 const val_value_t *val2,
3408 status_t *res);
3409
3410
3429extern status_t
3430 val_sprintf_simval_nc (xmlChar *buff,
3431 const val_value_t *val,
3432 uint32 *len);
3433
3434
3454extern status_t
3455 val_sprintf_simval_nc_ex (xmlChar *buff,
3456 const val_value_t *val,
3457 boolean url_encode,
3458 uint32 *len);
3459
3460
3473extern xmlChar *
3474 val_make_sprintf_string (const val_value_t *val);
3475
3476
3489extern status_t
3490 val_resolve_scoped_name (val_value_t *val,
3491 const xmlChar *name,
3492 val_value_t **chval);
3493
3494
3501extern ncx_iqual_t
3502 val_get_iqualval (const val_value_t *val);
3503
3504
3523extern boolean
3524 val_duplicates_allowed (val_value_t *val);
3525
3526
3534extern boolean
3535 val_has_content (const val_value_t *val);
3536
3537
3546extern boolean
3547 val_has_content_ex (const val_value_t *val);
3548
3549
3557extern boolean
3558 val_has_index (const val_value_t *val);
3559
3560
3567extern val_index_t *
3568 val_get_first_index (const val_value_t *val);
3569
3570
3577extern val_index_t *
3578 val_get_next_index (const val_index_t *valindex);
3579
3580
3587extern uint32
3588 val_get_index_count (const val_value_t *val);
3589
3590
3602extern status_t
3603 val_parse_meta (ses_cb_t *scb,
3604 typ_def_t *typdef,
3605 xml_attr_t *attr,
3606 val_value_t *retval);
3607
3608
3615extern void
3616 val_set_extern (val_value_t *val,
3617 xmlChar *fname);
3618
3619
3627extern void
3628 val_set_intern (val_value_t *val,
3629 xmlChar *intbuff);
3630
3631
3650extern boolean
3651 val_fit_oneline (const val_value_t *val,
3652 uint32 linesize,
3653 boolean isxml);
3654
3655
3664extern boolean
3665 val_create_allowed (const val_value_t *val);
3666
3667
3676extern boolean
3677 val_delete_allowed (const val_value_t *val);
3678
3679
3687extern boolean
3688 val_is_config_data (const val_value_t *val);
3689
3690
3699extern boolean
3700 val_is_config_save (const val_value_t *val);
3701
3702
3712extern boolean
3713 val_is_virtual (const val_value_t *val);
3714
3715
3745extern val_value_t *
3746 val_get_virtual_value (ses_cb_t *scb,
3747 val_value_t *val,
3748 status_t *res);
3749
3750
3770extern boolean
3771 val_is_default (val_value_t *val);
3772
3773
3783extern boolean
3784 val_is_real (const val_value_t *val);
3785
3786
3793extern xmlns_id_t
3794 val_get_parent_nsid (const val_value_t *val);
3795
3796
3808extern uint32
3809 val_instance_count (val_value_t *val,
3810 const xmlChar *modname,
3811 const xmlChar *objname);
3812
3813
3828extern uint32
3829 val_instance_count_fast (val_value_t *val,
3830 xmlns_id_t nsid,
3831 const xmlChar *objname,
3832 val_value_t **firstval);
3833
3834
3847extern uint32
3848 val_instance_count_fast2 (val_value_t *val,
3849 val_value_t *startval);
3850
3851
3867extern void
3868 val_set_extra_instance_errors (val_value_t *val,
3869 const xmlChar *modname,
3870 const xmlChar *objname,
3871 uint32 maxelems);
3872
3873
3882extern boolean
3883 val_need_quotes (const xmlChar *str);
3884
3885
3893extern boolean
3894 val_all_whitespace (const xmlChar *str);
3895
3896
3905extern boolean
3906 val_any_whitespace (const xmlChar *str,
3907 uint32 len);
3908
3909
3918extern boolean
3919 val_match_metaval (const xml_attr_t *attr,
3920 xmlns_id_t nsid,
3921 const xmlChar *name);
3922
3923
3930extern boolean
3931 val_get_dirty_flag (const val_value_t *val);
3932
3933
3940extern boolean
3941 val_get_subtree_dirty_flag (const val_value_t *val);
3942
3943
3949extern void
3950 val_set_subtree_dirty_up (val_value_t *val);
3951
3952
3960extern void
3961 val_set_dirty_flag (val_value_t *val,
3962 boolean clear_def);
3963
3964
3970extern void
3971 val_set_child_deleted_flag (val_value_t *val);
3972
3973
3980extern boolean
3981 val_get_child_deleted_flag (val_value_t *val);
3982
3983
3984
3997extern void
3998 val_clear_dirty_flag (val_value_t *val,
3999 time_t *timestamp,
4000 ncx_transaction_id_t txid,
4001 boolean is_delete,
4002 boolean do_clear_default);
4003
4004
4011extern boolean
4012 val_dirty_subtree (const val_value_t *val);
4013
4014
4027extern void
4028 val_clean_tree (val_value_t *val);
4029
4030
4037extern uint32
4038 val_get_nest_level (val_value_t *val);
4039
4040
4049extern val_value_t *
4050 val_get_first_leaf (val_value_t *val);
4051
4052
4060extern const xmlChar *
4061 val_get_mod_name (const val_value_t *val);
4062
4063
4071extern const xmlChar *
4072 val_get_mod_prefix (const val_value_t *val);
4073
4074
4081extern xmlns_id_t
4082 val_get_nsid (const val_value_t *val);
4083
4084
4091extern ncx_sid_t
4092 val_get_yang_sid (const val_value_t *val);
4093
4094
4101extern void
4102 val_change_nsid (val_value_t *val,
4103 xmlns_id_t nsid);
4104
4105
4112extern void
4113 val_change_nsid2 (val_value_t *val,
4114 xmlns_id_t nsid);
4115
4116
4123extern void
4124 val_change_nsid3 (val_value_t *val,
4125 xmlns_id_t nsid);
4126
4127
4139extern val_value_t *
4140 val_make_from_insertxpcb (val_value_t *sourceval,
4141 status_t *res);
4142
4143
4149extern val_unique_t *
4150 val_new_unique (void);
4151
4152
4158extern void
4159 val_free_unique (val_unique_t *valuni);
4160
4161
4168extern const typ_def_t *
4169 val_get_typdef (const val_value_t *val);
4170
4171
4179extern boolean
4180 val_set_by_default (const val_value_t *val);
4181
4182
4190extern boolean
4191 val_has_withdef_default (const val_value_t *val);
4192
4193
4199extern void
4200 val_set_withdef_default (val_value_t *val);
4201
4202
4210extern boolean
4211 val_is_metaval (const val_value_t *val);
4212
4213
4221extern void
4222 val_move_children (val_value_t *srcval,
4223 val_value_t *destval);
4224
4225
4233extern void
4234 val_move_nonconfig_children (val_value_t *srcval,
4235 val_value_t *destval);
4236
4256extern status_t
4257 val_cvt_generic (val_value_t *val);
4258
4259
4268extern status_t
4269 val_set_pcookie (val_value_t *val,
4270 void *pcookie);
4271
4272
4281extern status_t
4282 val_set_icookie (val_value_t *val,
4283 int icookie);
4284
4285
4293extern void *
4294 val_get_pcookie (val_value_t *val);
4295
4296
4304extern int
4305 val_get_icookie (val_value_t *val);
4306
4307
4315extern status_t
4316 val_delete_default_leaf (val_value_t *val);
4317
4318
4328extern status_t
4329 val_delete_default_leaf_list (val_value_t *val);
4330
4331
4337extern void
4338 val_force_empty (val_value_t *val);
4339
4340
4348extern status_t
4349 val_delete_default_npcon (val_value_t *val);
4350
4351
4360extern void
4361 val_move_fields_for_xml (val_value_t *srcval,
4362 val_value_t *destval,
4363 boolean movemeta);
4364
4365
4373extern void
4374 val_move_metadata (val_value_t *srcval,
4375 val_value_t *destval);
4376
4377
4384extern val_index_t *
4385 val_get_first_key (val_value_t *val);
4386
4387
4394extern val_index_t *
4395 val_get_last_key (val_value_t *val);
4396
4397
4404extern val_index_t *
4405 val_get_next_key (val_index_t *curkey);
4406
4407
4414extern val_index_t *
4415 val_get_prev_key (val_index_t *curkey);
4416
4417
4424extern void
4425 val_remove_key (val_value_t *keyval);
4426
4427
4434extern val_value_t *
4435 val_new_deleted_value (void);
4436
4437
4445extern status_t
4446 val_new_editvars (val_value_t *val);
4447
4448
4456extern void
4457 val_free_editvars (val_value_t *val);
4458
4459
4465extern void
4466 val_free_solo_editvars (val_editvars_t *editvars);
4467
4468
4479extern boolean
4480 val_all_np_containers (val_value_t *val);
4481
4482
4492extern status_t
4493 val_sprintf_etag (val_value_t *val,
4494 xmlChar *buff,
4495 int32 buffsize);
4496
4497
4504extern time_t *
4505 val_get_last_modified (val_value_t *val);
4506
4507
4513extern void
4514 val_force_default (val_value_t *val);
4515
4524extern void
4525 val_set_all_tags (val_value_t *val,
4526 time_t *timestamp,
4527 ncx_transaction_id_t txid);
4528
4529
4536extern const xmlChar *
4537 val_get_owner (val_value_t *val);
4538
4539
4546extern ncx_owner_id_t
4547 val_get_owner_id (val_value_t *val);
4548
4549
4556extern boolean
4557 val_need_owner_string (val_value_t *val);
4558
4559
4566extern void
4567 val_delete_children (val_value_t *val);
4568
4569
4575extern void
4576 val_clean_value (val_value_t *val);
4577
4578
4587extern boolean
4588 val_find_bit (val_value_t *val,
4589 const xmlChar *bitname);
4590
4591
4599extern boolean
4600 val_has_children (const val_value_t *val);
4601
4602
4610extern status_t
4611 val_add_test_valindex (val_value_t *parentval,
4612 val_value_t *keyval);
4613
4614
4621extern const xmlChar *
4622 val_get_yang_typename (val_value_t *val);
4623
4624
4631extern void
4632 val_set_force_config (val_value_t *val,
4633 boolean is_config);
4634
4635
4642extern void
4643 val_clear_defvalset_flag (val_value_t *val);
4644
4645
4654extern status_t
4655 val_clone_valQ (dlq_hdr_t *valQ,
4656 dlq_hdr_t *return_valQ);
4657
4658
4666extern void
4667 val_clean_valQ (dlq_hdr_t *valQ);
4668
4669
4679extern boolean
4680 val_is_value_set (val_value_t *val);
4681
4682
4690extern uint32
4691 val_url_encode_string (const xmlChar *str,
4692 xmlChar *buff);
4693
4694
4703extern void
4704 val_convert_any_to_container (val_value_t *val);
4705
4706
4713extern void
4714 val_clean_index_chain (val_value_t *val);
4715
4716
4724extern boolean
4725 val_pattern_match (const xmlRegexpPtr pattern,
4726 const xmlChar *strval);
4727
4728
4737extern boolean
4738 val_ocpattern_match (const regex_t *ocpattern,
4739 const xmlChar *strval);
4740
4741
4751extern boolean
4752 val_idref_derived_from (ncx_module_t *impmod,
4753 val_value_t *testval,
4754 const xmlChar *qname,
4755 boolean or_self);
4756
4757
4768extern status_t
4769 val_set_sil_priority (val_value_t *val,
4770 uint8 silprio);
4771
4772
4779extern uint8
4780 val_get_sil_priority (val_value_t *val);
4781
4782
4791extern const xmlChar *
4792 val_find_bit_name (val_value_t *val,
4793 uint32 bitpos);
4794
4795
4805extern const xmlChar *
4806 val_find_enum_name (val_value_t *val,
4807 int32 enunum);
4808
4809
4821extern const xmlChar *
4822 val_find_enum_name2 (ncx_btype_t btyp,
4823 typ_def_t *typdef,
4824 int32 enunum);
4825
4826
4833extern void
4834 val_mark_deleted (val_value_t *val);
4835
4836
4844extern void
4845 val_mark_undeleted (val_value_t *val);
4846
4847
4858extern boolean
4859 val_has_conditional_value (val_value_t *val);
4860
4861
4872extern val_value_t *
4873 val_convert_leafref (const val_value_t *val);
4874
4875
4896extern int32
4897 val_compare_for_topreplace (const val_value_t *val1,
4898 const val_value_t *val2);
4899
4900
4926extern int32
4927 val_compare_for_topreplace_simple (const val_value_t *val1,
4928 const val_value_t *val2);
4929
4930
4938extern boolean
4939 val_has_complex_child (const val_value_t *val);
4940
4941
4949extern status_t
4950 val_add_meta (val_value_t *metaval,
4951 val_value_t *val);
4952
4953
4960extern val_value_t *
4961 val_find_root (val_value_t *val);
4962
4963
4970extern status_t
4971 val_set_canonical (val_value_t *val);
4972
4973
4981extern typ_def_t *
4982 val_get_leafref_typdef (val_value_t *val);
4983
4984
5004extern boolean
5005 val_ascendant_compare (val_value_t *val1,
5006 val_value_t *val2);
5007
5008
5015extern const xmlChar *
5016 val_get_dname (const val_value_t *val);
5017
5018
5028extern status_t
5029 val_set_dname (val_value_t *val,
5030 const xmlChar *dname);
5031
5032
5043extern status_t
5044 val_set_dname2 (val_value_t *val,
5045 const xmlChar *dname,
5046 uint32 dnamelen);
5047
5048
5056extern status_t
5057 val_new_extra (val_value_t *val);
5058
5059
5066extern const xmlChar *
5067 val_get_varexpr (const val_value_t *val);
5068
5069
5077extern status_t
5078 val_set_varexpr (val_value_t *val,
5079 const xmlChar *varexpr);
5080
5081
5087extern void
5088 val_clear_varexpr (val_value_t *val);
5089
5090
5096extern void
5097 val_set_wildcard_string (val_value_t *val);
5098
5099
5106#define val_is_wildcard_string(V) (((V)->flags & VAL_FL_WILDCARD) ? TRUE : FALSE)
5107
5108
5116extern status_t
5117 val_copy_editvars (const val_value_t *val,
5118 val_value_t *copy);
5119
5120
5129extern status_t
5130 val_set_skip_sil_partial (val_value_t *val);
5131
5132
5139extern boolean
5140 val_get_skip_sil_partial (const val_value_t *val);
5141
5142
5153extern typ_def_t *
5154 val_get_leafref_typdef_ex (val_value_t *val,
5155 boolean union_check);
5156
5157
5158
5170extern boolean
5171 val_is_default_npcon (val_value_t *val);
5172
5173
5181extern status_t
5182 val_identity_ok (typ_def_t *typdef,
5183 ncx_identity_t *ident);
5184
5185
5200extern status_t
5201 val_highest_bit_set (const val_value_t *val,
5202 uint32 *count,
5203 uint32 *pos);
5204
5205
5219extern status_t
5220 val_first_bit_set (const val_value_t *val,
5221 const ncx_lmem_t **lmem,
5222 uint32 *pos);
5223
5224
5239extern status_t
5240 val_next_bit_set (const val_value_t *val,
5241 const ncx_lmem_t *lmem,
5242 const ncx_lmem_t **nextlmem,
5243 uint32 *pos);
5244
5251extern struct xpath_aio_cb_t_ *
5252 val_get_aiocb (const val_value_t *val);
5253
5254
5262extern status_t
5263 val_set_aiocb (val_value_t *val,
5264 struct xpath_aio_cb_t_ *aiocb);
5265
5266
5276extern ncx_sm_mpid_t *
5277 val_get_mpid (const val_value_t *val);
5278
5279
5288extern status_t
5289 val_set_mpid (val_value_t *val,
5290 struct ncx_sm_mpid_t_ *mpid);
5291
5292
5296#ifdef __cplusplus
5297} /* end extern 'C' */
5298#endif
5299
5300#endif /* _H_val */
dlq provides general double-linked list and queue support:
NCX System Logging Manager.
Contains NCX constants.
YANG module data structures Many internal representations of YANG module constructs.
NETCONF protocol operations.
RFC 57517 partial lock support Data structure definition.
NETCONF Session Common definitions module.
Global error messages for status code enumerations.
Parameter Type Handler.
XML Utilities.
XML namespace support.