yumapro  23.10T-5
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 - 2023, 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_CLR_DELETED(V) (V)->flags &= ~VAL_FL_DELETED
549
551#define VAL_MARK_DELETED(V) val_mark_deleted(V)
552
554#define VAL_UNMARK_DELETED(V) val_mark_undeleted(V)
555
557#define VAL_LAST_MODIFIED(V) (V)->last_modified
558
560#define VAL_ETAG(V) (V)->etag
561
563#define VAL_BTYPE(V) (V)->btyp
564
566#define VAL_SET_VAREXPR(V) (V)->flags |= VAL_FL_IS_VAREXPR
567
569#define VAL_CLR_VAREXPR(V) (V)->flags &= ~VAL_FL_IS_VAREXPR
570
572#define VAL_IS_VAREXPR(V) ((V)->flags & VAL_FL_IS_VAREXPR)
573
575#define VAL_VAREXPR(V) val_get_varexpr(V)
576
580#define VAL_SET_META(V) (V)->flags |= VAL_FL_META
581
583#define VAL_REMOVE_META(M) dlq_remove(M)
584
588#define VAL_SET_FIXED_VALUE(V) (V)->flags |= VAL_FL_FIXED_VALUE
589
593#define VAL_CLR_FIXED_VALUE(V) (V)->flags &= ~VAL_FL_FIXED_VALUE
594
598#define VAL_IS_FIXED_VALUE(V) ((V)->flags & VAL_FL_FIXED_VALUE)
599
601#define VAL_SET_EDIT2_MERGE(V) (V)->flags |= VAL_FL_EDIT2_MERGE
602
604#define VAL_CLR_EDIT2_MERGE(V) (V)->flags &= ~VAL_FL_EDIT2_MERGE
605
607#define VAL_IS_EDIT2_MERGE(V) ((V)->flags & VAL_FL_EDIT2_MERGE)
608
612#define VAL_SET_EXTERNAL(V) (V)->flags |= VAL_FL_EXTERNAL
613
615#define VAL_CLR_EXTERNAL(V) (V)->flags &= ~VAL_FL_EXTERNAL
616
618#define VAL_IS_EXTERNAL(V) ((V)->flags & VAL_FL_EXTERNAL)
619
621#define VAL_SET_VALUE_SET(V) (V)->flags |= VAL_FL_VALUE_SET
622
624#define VAL_CLR_VALUE_SET(V) (V)->flags &= ~VAL_FL_VALUE_SET
625
627#define VAL_IS_VALUE_SET(V) ((V)->flags & VAL_FL_VALUE_SET)
628
630#define VAL_SET_TEMP_XPATH(V) (V)->flags |= VAL_FL_TEMP_XPATH
631
633#define VAL_CLR_TEMP_XPATH(V) (V)->flags &= ~VAL_FL_TEMP_XPATH
634
636#define VAL_IS_TEMP_XPATH(V) ((V)->flags & VAL_FL_TEMP_XPATH)
637
639#define VAL_SET_UNCOMMITTED_DELETE(V) (V)->flags |= VAL_FL_UNCMTD_DELETE
640
642#define VAL_CLR_UNCOMMITTED_DELETE(V) (V)->flags &= ~VAL_FL_UNCMTD_DELETE
643
645#define VAL_IS_UNCOMMITTED_DELETE(V) ((V)->flags & VAL_FL_UNCMTD_DELETE)
646
648#define VAL_SET_RECREATED(V) (V)->flags |= VAL_FL_RECREATED
649
651#define VAL_CLR_RECREATED(V) (V)->flags &= ~VAL_FL_RECREATED
652
654#define VAL_IS_RECREATED(V) ((V)->flags & VAL_FL_RECREATED)
655
657#define VAL_SET_FROM_TEMPLATE(V) (V)->flags |= VAL_FL_FROM_TEMPLATE
658
660#define VAL_CLR_FROM_TEMPLATE(V) (V)->flags &= ~VAL_FL_FROM_TEMPLATE
661
663#define VAL_IS_FROM_TEMPLATE(V) ((V)->flags & VAL_FL_FROM_TEMPLATE)
664
666#define VAL_XPATHPCB(V) val_get_xpathpcb(V)
667
669#define VAL_SET_CANONICAL(V) (V)->flags |= VAL_FL_CANONICAL
670
672#define VAL_CLR_CANONICAL(V) (V)->flags &= ~VAL_FL_CANONICAL
673
675#define VAL_IS_CANONICAL(V) ((V)->flags & VAL_FL_CANONICAL)
676
678#define VAL_NMDA_ORIGIN(V) (V)->nmda_origin
679
681#define VAL_IS_INDEX(V) ((V)->flags & VAL_FL_IS_INDEX)
682
684#define VAL_SET_IS_INDEX(V) (V)->flags |= VAL_FL_IS_INDEX
685
687#define VAL_CHILD_HDR_OBJ(H) (H)->obj
688
690#define VAL_CHILD_HDR_COUNT(H) (H)->count
691
693#define VAL_SET_DEFCON_DELETED(V) (V)->flags |= VAL_FL_DEFCON_DELETED
694
696#define VAL_CLR_DEFCON_DELETED(V) (V)->flags &= ~VAL_FL_DEFCON_DELETED
697
699#define VAL_IS_DEFCON_DELETED(V) ((V)->flags & VAL_FL_DEFCON_DELETED)
700
701
706#define VAL_SET_ADDEDIT_DELETED(V) (V)->flags |= VAL_FL_ADDEDIT_DELETED
707
709#define VAL_IS_ADDEDIT_DELETED(V) ((V)->flags & VAL_FL_ADDEDIT_DELETED)
710
711
716#define VAL_EDITOP(V) (V)->editop
717
718#define VAL_EXTERN_VALONLY(V) (V)->extern_valonly
719
723#define VAL_SET_DEFSET(V) (V)->flags |= VAL_FL_DEFSET
724
725
729#define VAL_CLR_DEFSET(V) (V)->flags &= ~VAL_FL_DEFSET
730
731/* Value node is from anydata that was replaced by datapath */
732#define VAL_FROM_ANYDATA(V) (V)->from_anydata
733
734
737/********************************************************************
738* *
739* T Y P E S *
740* *
741*********************************************************************/
742
760typedef void (*dumpfn_t) (log_debug_t level, const char *fstr, ...);
761
762
769typedef void (*errfn_t) (const char *fstr, ...);
770
771
778/* pick a log indent function for dump_value */
779typedef void (*indentfn_t) (log_debug_t level, int32 indentcnt);
780
781
785typedef struct logfns_t_ {
786 dumpfn_t dumpfn; /**< log dump callback */
787 errfn_t errorfn; /**< log error callback */
788 indentfn_t indentfn; /**< log indent callback */
789 boolean suppressVariableNames; /**< suppress variable names in output */
790 FILE *outputFile; /**< manager redirect to file output */
791} logfns_t;
792
793
795typedef struct val_idref_t_ {
796 xmlns_id_t nsid; /**< namespace ID */
798 xmlChar *name;
799 ncx_identity_t *identity; /**< ID back-ptr if found */
800} YPACK val_idref_t;
801
802
804typedef enum val_insert_mode_t_ {
805 VAL_INS_MODE_NONE, /**< not set */
806 VAL_INS_MODE_KEY, /**< YANG key attribute */
807 VAL_INS_MODE_VALUE, /**< YANG value attribute */
808 VAL_INS_MODE_POINT /**< YANG-API point param */
809} YPACK val_insert_mode_t;
810
811
813typedef enum val_dumpvalue_mode_t_ {
814 DUMP_VAL_NONE, /**< not set */
815 DUMP_VAL_STDOUT, /**< dump val to STDOUT */
816 DUMP_VAL_LOG, /**< dump val to main log */
817 DUMP_VAL_ALT_LOG, /**< dump val to alternate log */
818 DUMP_VAL_AUDIT_LOG, /**< dump val to audit log */
819} val_dumpvalue_mode_t;
820
821
823typedef struct val_editvars_t_ {
828 struct val_value_t_ *curparent; /**< track the real parent */
829 op_insertop_t insertop; /**< YANG insert operation */
830 xmlChar *insertstr; /**< saved value or key attr */
831 struct xpath_pcb_t_ *insertxpcb; /**< key attr for insert */
832 struct val_value_t_ *insertval; /**< back-ptr if before or after */
833 val_insert_mode_t insert_mode; /**< insert mode requested */
834 uint8 silprio; /**< 2nd SIL priority for server */
835 boolean operset; /**< nc:operation here */
836 void *pcookie; /**< user pointer cookie */
837 int icookie; /**< user integer cookie */
838 boolean is_move; /**< TRUE if YPATCH MOVE operation */
839 boolean skip_sil_partial; /**< TRUE is skip_sil_partial needed */
840} YPACK val_editvars_t;
841
842
844typedef struct val_extra_t_ {
845
851 xmlChar *dname; /**< malloced name if needed */
852
859 void *getcb;
860
865 struct val_value_t_ *virtualval;
866
868 time_t cachetime;
869
874 struct xpath_pcb_t_ *xpathpcb;
875
876
880 plock_cb_t *plock[VAL_MAX_PLOCKS];
881
882
886 dlq_hdr_t *dataruleQ; /**< Q of obj_xpath_ptr_t */
887
893 xmlChar *varexpr;
894
899 struct xpath_aio_cb_t_ *aiocb;
900
902 ncx_sm_mpid_t *mpid;
903
904} YPACK val_extra_t;
905
906
911typedef struct val_value_t_ {
913 dlq_hdr_t qhdr;
914
916 struct obj_template_t_ *obj; /**< bptr to object def */
917 typ_def_t *typdef; /**< bptr to typdef if leaf */
918 const xmlChar *name; /**< back pointer to elname\n
919 * the dname field is moved to val_extra_t and only used when
920 * the value is constructed from dummy objects or no objects at all
921 */
922
923 struct val_value_t_ *parent; /**< back-ptr to parent if any */
924 struct val_child_hdr_t_ *hdr; /**< back-ptr to own child_hdr */
925
927 val_extra_t *val_extra;
928
929 uint32 flags; /**< internal status flags */
930
931 xmlns_id_t nsid; /**< namespace ID for this node */
932 ncx_btype_t btyp; /**< base type of this value */
933 ncx_data_class_t dataclass; /**< config or state data */
934
938 time_t last_modified;
939 ncx_etag_t etag; /**< ETag for RESTCONF */
940
954 dlq_hdr_t *metaQ; /**< Q of val_value_t */
955
959 val_editvars_t *editvars; /**< edit-vars from attrs */
960 op_editop_t editop; /**< needed for all edits */
961 status_t res; /**< validation result */
962
963 /* GET1 getcb moved to val_extra */
964 /* GET1 virtualval moved to val_extra */
965 /* GET1 cachetime moved to val_extra */
966
968 dlq_hdr_t *indexQ; /**< Q of val_index_t or ncx_filptr_t */
969
970 /* this field is used for NCX_BT_CHOICE
971 * If set, the object path for this node is really:
972 * $this --> casobj --> casobj.parent --> $this.parent
973 * the OBJ_TYP_CASE and OBJ_TYP_CHOICE nodes are skipped
974 * inside an XML instance document
975 *
976 * replaced by val_get_casobj() function in val_util.h
977 * struct obj_template_t_ *casobj;
978 */
979
980 /* xpathpcb moved to val_extra_t */
981
982 /* back-ptr to the partial locks that are held
983 * against this node
984 * plock moved to val_extra
985 */
986
987 /* back-ptr to the data access control rules that
988 * reference this node
989 * dataruleQ moved to val_extra
990 */
991
992 /* malloced pointer to the variable expression found
993 * if this val node is part of a data template.
994 * The actual value in union v_ MUST be ignored if
995 * varexpr string is non-NULL!!
996 * varexpr moved to val_extra
997 */
998
1002 ncx_owner_id_t owner_id;
1003
1005 ncx_nmda_origin_t nmda_origin;
1006
1008 boolean extern_valonly;
1009
1017 boolean from_anydata;
1018
1028 union v_ {
1038 dlq_hdr_t child_hdrQ;
1039
1049 ncx_num_t num;
1050
1057 ncx_str_t str;
1058
1059 val_idref_t idref; /**< NCX_BT_IDREF */
1060 ncx_binary_t binary; /**< NCX_BT_BINARY */
1061 ncx_list_t list; /**< NCX_BT_BITS, NCX_BT_SLIST */
1062 boolean boo; /**< NCX_BT_EMPTY, NCX_BT_BOOLEAN */
1063 ncx_enum_t enu; /**< NCX_BT_UNION, NCX_BT_ENUM */
1064 xmlChar *fname; /**< NCX_BT_EXTERN */
1065 xmlChar *intbuff; /**< NCX_BT_INTERN */
1066 } YPACK v;
1067} YPACK val_value_t;
1068
1069
1073typedef struct val_child_hdr_t_ {
1074 dlq_hdr_t qhdr; /**< queue header */
1075
1081 struct obj_template_t_ *obj;
1082
1086 struct val_tree_t_ *tree;
1087
1092 dlq_hdr_t que;
1093
1095 uint32 count;
1096
1098 uint8 flags;
1099} YPACK val_child_hdr_t;
1100
1101
1112typedef struct val_index_t_ {
1113 dlq_hdr_t qhdr; /**< queue header */
1114 val_value_t *val; /**< points to a child node */
1115} YPACK val_index_t;
1116
1117
1119typedef struct val_unique_t_ {
1120 dlq_hdr_t qhdr; /**< queue header */
1121 struct xpath_pcb_t_ *pcb; /**< live XPath CB w/ result */
1122} YPACK val_unique_t;
1123
1124
1133typedef boolean
1134 (*val_test_fn_t) (const val_value_t *val);
1135
1136
1146typedef boolean
1147 (*val_walker_fn_t) (val_value_t *val,
1148 void *cookie1,
1149 void *cookie2);
1150
1151
1152
1162typedef boolean
1163 (*val_walker2_fn_t) (val_child_hdr_t *valhdr,
1164 void *cookie1,
1165 void *cookie2);
1166
1167
1168
1178typedef boolean
1179 (*val_hdr_test_fn_t) (val_child_hdr_t *hdr,
1180 void *cookie);
1181
1182
1192typedef boolean
1193 (*val_test2_fn_t) (val_value_t *val,
1194 void *cookie);
1195
1196
1200/********************************************************************
1201* *
1202* F U N C T I O N S *
1203* *
1204*********************************************************************/
1205
1223extern val_value_t *
1224 val_new_value (void);
1225
1226
1235extern void
1236 val_init_value (val_value_t *val);
1237
1238
1249extern void
1250 val_init_complex (val_value_t *val,
1251 ncx_btype_t btyp);
1252
1253
1263extern void
1264 val_init_virtual (val_value_t *val,
1265 void *cbfn,
1266 struct obj_template_t_ *obj);
1267
1268
1278extern void
1279 val_init_from_template (val_value_t *val,
1280 struct obj_template_t_ *obj);
1281
1282
1292extern void
1293 val_reinit_from_template (val_value_t *val,
1294 struct obj_template_t_ *obj);
1295
1296
1306extern void
1307 val_free_value (val_value_t *val);
1308
1309
1317extern void
1318 val_set_name (val_value_t *val,
1319 const xmlChar *name,
1320 uint32 namelen);
1321
1322
1332extern status_t
1333 val_force_dname (val_value_t *val);
1334
1335
1344extern void
1345 val_set_qname (val_value_t *val,
1346 xmlns_id_t nsid,
1347 const xmlChar *name,
1348 uint32 namelen);
1349
1350
1360extern status_t
1361 val_string_ok (typ_def_t *typdef,
1362 ncx_btype_t btyp,
1363 const xmlChar *strval);
1364
1365
1380extern status_t
1381 val_string_ok_errinfo (typ_def_t *typdef,
1382 ncx_btype_t btyp,
1383 const xmlChar *strval,
1384 ncx_errinfo_t **errinfo);
1385
1386
1402status_t
1403 val_binary_ok_errinfo (typ_def_t *typdef,
1404 const xmlChar *strval,
1405 val_value_t *val,
1406 ncx_errinfo_t **errinfo);
1407
1408
1426extern status_t
1427 val_string_ok_ex (ses_cb_t *scb,
1428 typ_def_t *typdef,
1429 ncx_btype_t btyp,
1430 const xmlChar *strval,
1431 ncx_errinfo_t **errinfo,
1432 boolean logerrors);
1433
1434
1453extern status_t
1454 val_string_ok_ex2 (ses_cb_t *scb,
1455 typ_def_t *typdef,
1456 ncx_btype_t btyp,
1457 const xmlChar *strval,
1458 ncx_errinfo_t **errinfo,
1459 boolean logerrors,
1460 boolean is_defval);
1461
1462
1483extern status_t
1484 val_list_ok (typ_def_t *typdef,
1485 ncx_btype_t btyp,
1486 ncx_list_t *list);
1487
1488
1506extern status_t
1507 val_list_ok_errinfo (typ_def_t *typdef,
1508 ncx_btype_t btyp,
1509 ncx_list_t *list,
1510 ncx_errinfo_t **errinfo);
1511
1512
1525extern status_t
1526 val_enum_ok (typ_def_t *typdef,
1527 const xmlChar *enumval,
1528 int32 *retval,
1529 const xmlChar **retstr);
1530
1531
1541extern status_t
1542 val_bit_ok (typ_def_t *typdef,
1543 const xmlChar *bitname,
1544 uint32 *position);
1545
1546
1547
1548
1558extern status_t
1559 val_bitpos_ok (typ_def_t *typdef,
1560 uint32 position,
1561 const xmlChar **name);
1562
1563
1582extern status_t
1583 val_idref_ok (typ_def_t *typdef,
1584 const xmlChar *qname,
1585 xmlns_id_t nsid,
1586 const xmlChar **name,
1587 ncx_identity_t **id);
1588
1589
1614extern status_t
1615 val_idref_ok_ex (typ_def_t *typdef,
1616 const xmlChar *qname,
1617 xmlns_id_t nsid,
1618 boolean is_json,
1619 ncx_module_t *impmod,
1620 boolean or_self,
1621 const xmlChar **name,
1622 ncx_identity_t **id);
1623
1624
1641extern status_t
1642 val_parse_idref (ncx_module_t *mod,
1643 const xmlChar *qname,
1644 xmlns_id_t *nsid,
1645 const xmlChar **name,
1646 ncx_identity_t **id);
1647
1648
1666extern status_t
1667 val_parse_idref_rootcb (ncx_module_t *mod,
1668 const xmlChar *qname,
1669 xmlns_id_t *nsid,
1670 const xmlChar **name,
1671 ncx_identity_t **id,
1672 ncx_sm_rootcb_t *rootcb);
1673
1674
1684extern status_t
1685 val_range_ok (typ_def_t *typdef,
1686 ncx_btype_t btyp,
1687 const ncx_num_t *num);
1688
1689
1701extern status_t
1702 val_range_ok_errinfo (typ_def_t *typdef,
1703 ncx_btype_t btyp,
1704 const ncx_num_t *num,
1705 ncx_errinfo_t **errinfo);
1706
1707
1715extern status_t
1716 val_pattern_ok (typ_def_t *typdef,
1717 const xmlChar *strval);
1718
1719
1732extern status_t
1733 val_pattern_ok_errinfo (typ_def_t *typdef,
1734 const xmlChar *strval,
1735 ncx_errinfo_t **errinfo);
1736
1737
1747extern status_t
1748 val_simval_ok (typ_def_t *typdef,
1749 const xmlChar *simval);
1750
1751
1752
1764extern status_t
1765 val_simval_ok_errinfo (typ_def_t *typdef,
1766 const xmlChar *simval,
1767 ncx_errinfo_t **errinfo);
1768
1769
1783extern status_t
1784 val_simval_ok_ex (typ_def_t *typdef,
1785 const xmlChar *simval,
1786 ncx_errinfo_t **errinfo,
1787 ncx_module_t *mod);
1788
1789
1805extern status_t
1806 val_simval_ok_max (typ_def_t *typdef,
1807 const xmlChar *simval,
1808 ncx_errinfo_t **errinfo,
1809 ncx_module_t *mod,
1810 boolean logerrors);
1811
1830extern status_t
1831 val_simval_ok_max2 (typ_def_t *typdef,
1832 const xmlChar *simval,
1833 ncx_errinfo_t **errinfo,
1834 ncx_module_t *mod,
1835 boolean logerrors,
1836 boolean nocond);
1837
1838
1858status_t
1859 val_simval_ok_max3 (typ_def_t *typdef,
1860 const xmlChar *simval,
1861 ncx_errinfo_t **errinfo,
1862 ncx_module_t *mod,
1863 boolean logerrors,
1864 boolean nocond,
1865 boolean is_defval);
1866
1867
1879extern status_t
1880 val_union_ok (typ_def_t *typdef,
1881 const xmlChar *strval,
1882 val_value_t *retval);
1883
1884
1898extern status_t
1899 val_union_ok_errinfo (typ_def_t *typdef,
1900 const xmlChar *strval,
1901 val_value_t *retval,
1902 ncx_errinfo_t **errinfo);
1903
1904
1922extern status_t
1923 val_union_ok_ex (typ_def_t *typdef,
1924 const xmlChar *strval,
1925 val_value_t *retval,
1926 ncx_errinfo_t **errinfo,
1927 ncx_module_t *mod,
1928 typ_def_t **match_typdef);
1929
1930
1951extern status_t
1952 val_union_ok_binary (typ_def_t *typdef,
1953 const xmlChar *binstr,
1954 uint32 binstrlen,
1955 val_value_t *retval,
1956 ncx_errinfo_t **errinfo,
1957 typ_def_t **match_typdef);
1958
1959
1979extern status_t
1980 val_union_ok_full (typ_def_t *typdef,
1981 const xmlChar *strval,
1982 val_value_t *contextval,
1983 val_value_t *rootval,
1984 val_value_t *retval,
1985 ncx_errinfo_t **errinfo);
1986
1987
1994extern dlq_hdr_t *
1995 val_get_metaQ (val_value_t *val);
1996
1997
2005extern val_value_t *
2006 val_get_first_meta (dlq_hdr_t *queue);
2007
2008
2016extern val_value_t *
2017 val_get_first_meta_val (val_value_t *val);
2018
2019
2027extern val_value_t *
2028 val_get_next_meta (val_value_t *curnode);
2029
2030
2038extern boolean
2039 val_meta_empty (val_value_t *val);
2040
2041
2050extern val_value_t *
2051 val_find_meta (val_value_t *val,
2052 xmlns_id_t nsid,
2053 const xmlChar *name);
2054
2055
2065extern boolean
2066 val_meta_match (val_value_t *val,
2067 val_value_t *metaval);
2068
2069
2078extern uint32
2079 val_metadata_inst_count (val_value_t *val,
2080 xmlns_id_t nsid,
2081 const xmlChar *name);
2082
2083
2094extern void
2095 val_dump_value (val_value_t *val,
2096 int32 startindent,
2097 log_debug_t lvl);
2098
2099
2111extern void
2112 val_dump_value_ex (val_value_t *val,
2113 int32 startindent,
2114 ncx_display_mode_t display_mode,
2115 log_debug_t lvl);
2116
2117
2128extern void
2129 val_dump_alt_value (val_value_t *val,
2130 int32 startindent,
2131 log_debug_t lvl);
2132
2133
2143extern void
2144 val_stdout_value (val_value_t *val,
2145 int32 startindent,
2146 log_debug_t lvl);
2147
2148
2159extern void
2160 val_stdout_value_ex (val_value_t *val,
2161 int32 startindent,
2162 ncx_display_mode_t display_mode,
2163 log_debug_t lvl);
2164
2165
2183extern void
2184 val_dump_value_max (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 log_debug_t lvl);
2192
2193
2215extern void
2216 val_dump_value_full (val_value_t *val,
2217 int32 startindent,
2218 int32 indent_amount,
2219 val_dumpvalue_mode_t dumpmode,
2220 ncx_display_mode_t display_mode,
2221 boolean with_meta,
2222 boolean configonly,
2223 boolean conf_mode,
2224 boolean expand_varexpr,
2225 log_debug_t lvl,
2226 logfns_t *overrideOutput);
2227
2228
2251extern void
2252 val_dump_value_full2 (val_value_t *val,
2253 int32 startindent,
2254 int32 indent_amount,
2255 val_dumpvalue_mode_t dumpmode,
2256 ncx_display_mode_t display_mode,
2257 boolean with_meta,
2258 boolean configonly,
2259 boolean conf_mode,
2260 boolean expand_varexpr,
2261 boolean withdef,
2262 log_debug_t lvl,
2263 logfns_t *overrideOutput);
2264
2265
2278extern status_t
2279 val_set_string (val_value_t *val,
2280 const xmlChar *valname,
2281 const xmlChar *valstr);
2282
2283
2299extern status_t
2300 val_set_string2 (val_value_t *val,
2301 const xmlChar *valname,
2302 typ_def_t *typdef,
2303 const xmlChar *valstr,
2304 uint32 valstrlen);
2305
2306
2327extern status_t
2328 val_set_string3 (val_value_t *val,
2329 const xmlChar *valname,
2330 typ_def_t *typdef,
2331 const xmlChar *valstr,
2332 uint32 valstrlen,
2333 boolean is_dblquote);
2334
2335
2351extern status_t
2352 val_set_binary (const xmlChar *valstr,
2353 uint32 valstrlen,
2354 val_value_t *val);
2355
2356
2357
2367extern status_t
2368 val_reset_empty (val_value_t *val);
2369
2370
2383extern status_t
2384 val_set_simval (val_value_t *val,
2385 typ_def_t *typdef,
2386 xmlns_id_t nsid,
2387 const xmlChar *valname,
2388 const xmlChar *valstr);
2389
2390
2433extern status_t
2434 val_set_simval_str (val_value_t *val,
2435 typ_def_t *typdef,
2436 xmlns_id_t nsid,
2437 const xmlChar *valname,
2438 uint32 valnamelen,
2439 const xmlChar *valstr);
2440
2441
2462extern status_t
2463 val_set_simval_binary (val_value_t *val,
2464 const xmlChar *binstr,
2465 uint32 binstrlen);
2466
2467
2511extern status_t
2512 val_set_simval_max (val_value_t *val,
2513 typ_def_t *typdef,
2514 xmlns_id_t nsid,
2515 const xmlChar *valname,
2516 uint32 valnamelen,
2517 const xmlChar *valstr,
2518 uint32 valstrlen);
2519
2520
2534extern val_value_t *
2535 val_make_simval (typ_def_t *typdef,
2536 xmlns_id_t nsid,
2537 const xmlChar *valname,
2538 const xmlChar *valstr,
2539 status_t *res);
2540
2541
2555extern val_value_t *
2556 val_make_string (xmlns_id_t nsid,
2557 const xmlChar *valname,
2558 const xmlChar *valstr);
2559
2560
2571extern val_value_t *
2572 val_make_binary (xmlns_id_t nsid,
2573 const xmlChar *valname,
2574 const xmlChar *valstr,
2575 uint32 valstrlen);
2576
2577
2589extern status_t
2590 val_merge (const val_value_t *src,
2591 val_value_t *dest);
2592
2593
2600extern val_value_t *
2601 val_clone (const val_value_t *val);
2602
2603
2611extern val_value_t *
2612 val_clone2 (const val_value_t *val);
2613
2614
2628extern val_value_t *
2629 val_clone_config_data (const val_value_t *val,
2630 status_t *res);
2631
2632
2633
2650extern val_value_t *
2651 val_clone_config_newval (const val_value_t *val,
2652 status_t *res);
2653
2654
2674extern val_value_t *
2675 val_clone_config_save (const val_value_t *val,
2676 status_t *res);
2677
2678
2689extern status_t
2690 val_replace (val_value_t *val,
2691 val_value_t *copy);
2692
2693
2703extern status_t
2704 val_replace_str (const xmlChar *str,
2705 uint32 stringlen,
2706 val_value_t *copy);
2707
2708
2719extern status_t
2720 val_fast_replace_string (const xmlChar *str,
2721 uint32 stringlen,
2722 val_value_t *copy);
2723
2724
2731extern void
2732 val_replace_stringval (val_value_t *val,
2733 const xmlChar *str);
2734
2735
2752extern void
2753 val_add_child (val_value_t *child,
2754 val_value_t *parent);
2755
2756
2768extern void
2769 val_add_child_sorted (val_value_t *child,
2770 val_value_t *parent);
2771
2772
2784extern void
2785 val_insert_child (val_value_t *child,
2786 val_value_t *current,
2787 val_value_t *parent);
2788
2789
2798extern void
2799 val_remove_child (val_value_t *child);
2800
2801
2811extern void
2812 val_swap_child (val_value_t *newchild,
2813 val_value_t *curchild);
2814
2815
2823extern val_value_t *
2824 val_first_child_match (const val_value_t *parent,
2825 const val_value_t *child);
2826
2827
2838extern val_value_t *
2839 val_first_child_match_fast (const val_value_t *parent,
2840 const val_value_t *child,
2841 val_value_t *lastmatch);
2842
2843
2855extern val_value_t *
2856 val_next_child_match (val_value_t *parent,
2857 val_value_t *child,
2858 val_value_t *curmatch);
2859
2860
2867extern val_value_t *
2868 val_next_child_same (val_value_t *curchild);
2869
2870
2877extern val_value_t *
2878 val_get_first_child (const val_value_t *parent);
2879
2880
2887extern val_value_t *
2888 val_get_next_child (const val_value_t *curchild);
2889
2890
2897extern val_value_t *
2898 val_get_first_terminal_child (const val_value_t *parent);
2899
2900
2907extern val_value_t *
2908 val_get_next_terminal_child (const val_value_t *curchild);
2909
2910
2924extern val_value_t *
2925 val_find_child (const val_value_t *parent,
2926 const xmlChar *modname,
2927 const xmlChar *childname);
2928
2929
2943extern val_value_t *
2944 val_find_child_fast (const val_value_t *parent,
2945 xmlns_id_t nsid,
2946 const xmlChar *childname);
2947
2948
2957extern val_value_t *
2958 val_find_child_obj (const val_value_t *parent,
2959 const struct obj_template_t_ *chobj);
2960
2961
2976extern val_value_t *
2977 val_find_child_que (const dlq_hdr_t *childQ,
2978 xmlns_id_t nsid,
2979 const xmlChar *childname);
2980
2981
2995extern val_value_t *
2996 val_match_child (const val_value_t *parent,
2997 const xmlChar *modname,
2998 const xmlChar *childname);
2999
3000
3017extern val_value_t *
3018 val_match_child_count (const val_value_t *parent,
3019 const xmlChar *modname,
3020 const xmlChar *childname,
3021 uint32 *matchcount);
3022
3023
3040extern val_value_t *
3041 val_find_next_child (const val_value_t *parent,
3042 const xmlChar *modname,
3043 const xmlChar *childname,
3044 const val_value_t *curchild);
3045
3046
3060extern val_value_t *
3061 val_find_next_child_fast (const val_value_t *parent,
3062 const val_value_t *curchild);
3063
3064
3073extern val_value_t *
3074 val_first_child_name (val_value_t *parent,
3075 const xmlChar *name);
3076
3077
3086extern val_value_t *
3087 val_first_child_qname (val_value_t *parent,
3088 xmlns_id_t nsid,
3089 const xmlChar *name);
3090
3091
3101extern val_value_t *
3102 val_next_child_qname (val_value_t *parent,
3103 xmlns_id_t nsid,
3104 const xmlChar *name,
3105 val_value_t *curchild);
3106
3107
3125extern val_value_t *
3126 val_first_child_string (val_value_t *parent,
3127 const xmlChar *name,
3128 const xmlChar *strval);
3129
3130
3139extern uint32
3140 val_child_cnt (val_value_t *parent);
3141
3142
3152extern uint32
3153 val_child_inst_cnt (const val_value_t *parent,
3154 const xmlChar *modname,
3155 const xmlChar *name);
3156
3157
3165extern uint32
3166 val_get_child_inst_id (const val_value_t *parent,
3167 const val_value_t *child);
3168
3169
3176extern uint32
3177 val_liststr_count (const val_value_t *val);
3178
3179
3192extern boolean
3193 val_index_match (const val_value_t *val1,
3194 const val_value_t *val2);
3195
3196
3207extern int
3208 val_index_compare (const val_value_t *val1,
3209 const val_value_t *val2);
3210
3211
3241extern int32
3242 val_compare_max (const val_value_t *val1,
3243 const val_value_t *val2,
3244 boolean configonly,
3245 boolean childonly,
3246 boolean editing);
3247
3248
3282extern int32
3283 val_compare_max_def (const val_value_t *val1,
3284 const val_value_t *val2,
3285 boolean configonly,
3286 boolean childonly,
3287 boolean editing,
3288 boolean ignore_defaults);
3289
3290
3314extern int32
3315 val_compare_ex (const val_value_t *val1,
3316 const val_value_t *val2,
3317 boolean configonly);
3318
3319
3340extern int32
3341 val_compare (const val_value_t *val1,
3342 const val_value_t *val2);
3343
3344
3364extern int32
3365 val_compare_to_string (const val_value_t *val1,
3366 const xmlChar *strval2,
3367 status_t *res);
3368
3369
3391extern int32
3392 val_compare_to_string_len (const val_value_t *val1,
3393 const xmlChar *strval2,
3394 uint32 strval2len,
3395 status_t *res);
3396
3397
3416extern int32
3417 val_compare_for_replace (const val_value_t *val1,
3418 const val_value_t *val2);
3419
3420
3439extern int32
3440 val_compare_for_edit (const val_value_t *val1,
3441 const val_value_t *val2,
3442 boolean ismerge);
3443
3444
3463extern int32
3464 val_compare_as_string (const val_value_t *val1,
3465 const val_value_t *val2,
3466 status_t *res);
3467
3468
3487extern status_t
3488 val_sprintf_simval_nc (xmlChar *buff,
3489 const val_value_t *val,
3490 uint32 *len);
3491
3492
3512extern status_t
3513 val_sprintf_simval_nc_ex (xmlChar *buff,
3514 const val_value_t *val,
3515 boolean url_encode,
3516 uint32 *len);
3517
3518
3531extern xmlChar *
3532 val_make_sprintf_string (const val_value_t *val);
3533
3534
3547extern status_t
3548 val_resolve_scoped_name (val_value_t *val,
3549 const xmlChar *name,
3550 val_value_t **chval);
3551
3552
3559extern ncx_iqual_t
3560 val_get_iqualval (const val_value_t *val);
3561
3562
3581extern boolean
3582 val_duplicates_allowed (val_value_t *val);
3583
3584
3592extern boolean
3593 val_has_content (const val_value_t *val);
3594
3595
3604extern boolean
3605 val_has_content_ex (const val_value_t *val);
3606
3607
3615extern boolean
3616 val_has_index (const val_value_t *val);
3617
3618
3625extern val_index_t *
3626 val_get_first_index (const val_value_t *val);
3627
3628
3635extern val_index_t *
3636 val_get_next_index (const val_index_t *valindex);
3637
3638
3645extern uint32
3646 val_get_index_count (const val_value_t *val);
3647
3648
3660extern status_t
3661 val_parse_meta (ses_cb_t *scb,
3662 typ_def_t *typdef,
3663 xml_attr_t *attr,
3664 val_value_t *retval);
3665
3666
3673extern void
3674 val_set_extern (val_value_t *val,
3675 xmlChar *fname);
3676
3677
3685extern void
3686 val_set_intern (val_value_t *val,
3687 xmlChar *intbuff);
3688
3689
3708extern boolean
3709 val_fit_oneline (const val_value_t *val,
3710 uint32 linesize,
3711 boolean isxml);
3712
3713
3722extern boolean
3723 val_create_allowed (const val_value_t *val);
3724
3725
3734extern boolean
3735 val_delete_allowed (const val_value_t *val);
3736
3737
3745extern boolean
3746 val_is_config_data (const val_value_t *val);
3747
3748
3757extern boolean
3758 val_is_config_save (const val_value_t *val);
3759
3760
3770extern boolean
3771 val_is_virtual (const val_value_t *val);
3772
3773
3803extern val_value_t *
3804 val_get_virtual_value (ses_cb_t *scb,
3805 val_value_t *val,
3806 status_t *res);
3807
3808
3828extern boolean
3829 val_is_default (val_value_t *val);
3830
3831
3841extern boolean
3842 val_is_real (const val_value_t *val);
3843
3844
3851extern xmlns_id_t
3852 val_get_parent_nsid (const val_value_t *val);
3853
3854
3866extern uint32
3867 val_instance_count (val_value_t *val,
3868 const xmlChar *modname,
3869 const xmlChar *objname);
3870
3871
3886extern uint32
3887 val_instance_count_fast (val_value_t *val,
3888 xmlns_id_t nsid,
3889 const xmlChar *objname,
3890 val_value_t **firstval);
3891
3892
3905extern uint32
3906 val_instance_count_fast2 (val_value_t *val,
3907 val_value_t *startval);
3908
3909
3925extern void
3926 val_set_extra_instance_errors (val_value_t *val,
3927 const xmlChar *modname,
3928 const xmlChar *objname,
3929 uint32 maxelems);
3930
3931
3940extern boolean
3941 val_need_quotes (const xmlChar *str);
3942
3943
3953extern boolean
3954 val_has_dquotes (const xmlChar *str);
3955
3964extern boolean
3965 val_need_dquotes (const xmlChar *str);
3966
3967
3975extern boolean
3976 val_all_whitespace (const xmlChar *str);
3977
3978
3987extern boolean
3988 val_any_whitespace (const xmlChar *str,
3989 uint32 len);
3990
3991
4000extern boolean
4001 val_match_metaval (const xml_attr_t *attr,
4002 xmlns_id_t nsid,
4003 const xmlChar *name);
4004
4005
4012extern boolean
4013 val_get_dirty_flag (const val_value_t *val);
4014
4015
4022extern boolean
4023 val_get_subtree_dirty_flag (const val_value_t *val);
4024
4025
4031extern void
4032 val_set_subtree_dirty_up (val_value_t *val);
4033
4034
4042extern void
4043 val_set_dirty_flag (val_value_t *val,
4044 boolean clear_def);
4045
4046
4052extern void
4053 val_set_child_deleted_flag (val_value_t *val);
4054
4055
4062extern boolean
4063 val_get_child_deleted_flag (val_value_t *val);
4064
4065
4066
4079extern void
4080 val_clear_dirty_flag (val_value_t *val,
4081 time_t *timestamp,
4082 ncx_transaction_id_t txid,
4083 boolean is_delete,
4084 boolean do_clear_default);
4085
4086
4093extern boolean
4094 val_dirty_subtree (const val_value_t *val);
4095
4096
4109extern void
4110 val_clean_tree (val_value_t *val);
4111
4112
4119extern uint32
4120 val_get_nest_level (val_value_t *val);
4121
4122
4131extern val_value_t *
4132 val_get_first_leaf (val_value_t *val);
4133
4134
4142extern const xmlChar *
4143 val_get_mod_name (const val_value_t *val);
4144
4145
4153extern const xmlChar *
4154 val_get_mod_prefix (const val_value_t *val);
4155
4156
4163extern xmlns_id_t
4164 val_get_nsid (const val_value_t *val);
4165
4166
4173extern ncx_sid_t
4174 val_get_yang_sid (const val_value_t *val);
4175
4176
4183extern void
4184 val_change_nsid (val_value_t *val,
4185 xmlns_id_t nsid);
4186
4187
4194extern void
4195 val_change_nsid2 (val_value_t *val,
4196 xmlns_id_t nsid);
4197
4198
4205extern void
4206 val_change_nsid3 (val_value_t *val,
4207 xmlns_id_t nsid);
4208
4209
4221extern val_value_t *
4222 val_make_from_insertxpcb (val_value_t *sourceval,
4223 status_t *res);
4224
4225
4231extern val_unique_t *
4232 val_new_unique (void);
4233
4234
4240extern void
4241 val_free_unique (val_unique_t *valuni);
4242
4243
4250extern const typ_def_t *
4251 val_get_typdef (const val_value_t *val);
4252
4253
4261extern boolean
4262 val_set_by_default (const val_value_t *val);
4263
4264
4272extern boolean
4273 val_has_withdef_default (const val_value_t *val);
4274
4275
4281extern void
4282 val_set_withdef_default (val_value_t *val);
4283
4284
4292extern boolean
4293 val_is_metaval (const val_value_t *val);
4294
4295
4303extern void
4304 val_move_children (val_value_t *srcval,
4305 val_value_t *destval);
4306
4307
4315extern void
4316 val_move_nonconfig_children (val_value_t *srcval,
4317 val_value_t *destval);
4318
4338extern status_t
4339 val_cvt_generic (val_value_t *val);
4340
4341
4350extern status_t
4351 val_set_pcookie (val_value_t *val,
4352 void *pcookie);
4353
4354
4363extern status_t
4364 val_set_icookie (val_value_t *val,
4365 int icookie);
4366
4367
4375extern void *
4376 val_get_pcookie (val_value_t *val);
4377
4378
4386extern int
4387 val_get_icookie (val_value_t *val);
4388
4389
4397extern status_t
4398 val_delete_default_leaf (val_value_t *val);
4399
4400
4410extern status_t
4411 val_delete_default_leaf_list (val_value_t *val);
4412
4413
4419extern void
4420 val_force_empty (val_value_t *val);
4421
4422
4430extern status_t
4431 val_delete_default_npcon (val_value_t *val);
4432
4433
4442extern void
4443 val_move_fields_for_xml (val_value_t *srcval,
4444 val_value_t *destval,
4445 boolean movemeta);
4446
4447
4455extern void
4456 val_move_metadata (val_value_t *srcval,
4457 val_value_t *destval);
4458
4459
4466extern val_index_t *
4467 val_get_first_key (val_value_t *val);
4468
4469
4476extern val_index_t *
4477 val_get_last_key (val_value_t *val);
4478
4479
4486extern val_index_t *
4487 val_get_next_key (val_index_t *curkey);
4488
4489
4496extern val_index_t *
4497 val_get_prev_key (val_index_t *curkey);
4498
4499
4506extern void
4507 val_remove_key (val_value_t *keyval);
4508
4509
4516extern val_value_t *
4517 val_new_deleted_value (void);
4518
4519
4527extern status_t
4528 val_new_editvars (val_value_t *val);
4529
4530
4538extern void
4539 val_free_editvars (val_value_t *val);
4540
4541
4547extern void
4548 val_free_solo_editvars (val_editvars_t *editvars);
4549
4550
4561extern boolean
4562 val_all_np_containers (val_value_t *val);
4563
4564
4574extern status_t
4575 val_sprintf_etag (val_value_t *val,
4576 xmlChar *buff,
4577 int32 buffsize);
4578
4579
4586extern time_t *
4587 val_get_last_modified (val_value_t *val);
4588
4589
4595extern void
4596 val_force_default (val_value_t *val);
4597
4606extern void
4607 val_set_all_tags (val_value_t *val,
4608 time_t *timestamp,
4609 ncx_transaction_id_t txid);
4610
4611
4618extern const xmlChar *
4619 val_get_owner (val_value_t *val);
4620
4621
4628extern ncx_owner_id_t
4629 val_get_owner_id (val_value_t *val);
4630
4631
4638extern boolean
4639 val_need_owner_string (val_value_t *val);
4640
4641
4648extern void
4649 val_delete_children (val_value_t *val);
4650
4651
4657extern void
4658 val_clean_value (val_value_t *val);
4659
4660
4669extern boolean
4670 val_find_bit (val_value_t *val,
4671 const xmlChar *bitname);
4672
4673
4681extern boolean
4682 val_has_children (const val_value_t *val);
4683
4684
4692extern status_t
4693 val_add_test_valindex (val_value_t *parentval,
4694 val_value_t *keyval);
4695
4696
4703extern const xmlChar *
4704 val_get_yang_typename (val_value_t *val);
4705
4706
4713extern void
4714 val_set_force_config (val_value_t *val,
4715 boolean is_config);
4716
4717
4724extern void
4725 val_clear_defvalset_flag (val_value_t *val);
4726
4727
4736extern status_t
4737 val_clone_valQ (dlq_hdr_t *valQ,
4738 dlq_hdr_t *return_valQ);
4739
4740
4748extern void
4749 val_clean_valQ (dlq_hdr_t *valQ);
4750
4751
4761extern boolean
4762 val_is_value_set (val_value_t *val);
4763
4764
4772extern uint32
4773 val_url_encode_string (const xmlChar *str,
4774 xmlChar *buff);
4775
4776
4785extern void
4786 val_convert_any_to_container (val_value_t *val);
4787
4788
4795extern void
4796 val_clean_index_chain (val_value_t *val);
4797
4798
4806extern boolean
4807 val_pattern_match (const xmlRegexpPtr pattern,
4808 const xmlChar *strval);
4809
4810
4819extern boolean
4820 val_ocpattern_match (const regex_t *ocpattern,
4821 const xmlChar *strval);
4822
4823
4833extern boolean
4834 val_idref_derived_from (ncx_module_t *impmod,
4835 val_value_t *testval,
4836 const xmlChar *qname,
4837 boolean or_self);
4838
4839
4850extern status_t
4851 val_set_sil_priority (val_value_t *val,
4852 uint8 silprio);
4853
4854
4861extern uint8
4862 val_get_sil_priority (val_value_t *val);
4863
4864
4873extern const xmlChar *
4874 val_find_bit_name (val_value_t *val,
4875 uint32 bitpos);
4876
4877
4887extern const xmlChar *
4888 val_find_enum_name (val_value_t *val,
4889 int32 enunum);
4890
4891
4903extern const xmlChar *
4904 val_find_enum_name2 (ncx_btype_t btyp,
4905 typ_def_t *typdef,
4906 int32 enunum);
4907
4908
4915extern void
4916 val_mark_deleted (val_value_t *val);
4917
4918
4926extern void
4927 val_mark_undeleted (val_value_t *val);
4928
4929
4940extern boolean
4941 val_has_conditional_value (val_value_t *val);
4942
4943
4954extern val_value_t *
4955 val_convert_leafref (const val_value_t *val);
4956
4957
4978extern int32
4979 val_compare_for_topreplace (const val_value_t *val1,
4980 const val_value_t *val2);
4981
4982
5008extern int32
5009 val_compare_for_topreplace_simple (const val_value_t *val1,
5010 const val_value_t *val2);
5011
5012
5020extern boolean
5021 val_has_complex_child (const val_value_t *val);
5022
5023
5031extern status_t
5032 val_add_meta (val_value_t *metaval,
5033 val_value_t *val);
5034
5035
5042extern val_value_t *
5043 val_find_root (val_value_t *val);
5044
5045
5052extern status_t
5053 val_set_canonical (val_value_t *val);
5054
5055
5063extern typ_def_t *
5064 val_get_leafref_typdef (val_value_t *val);
5065
5066
5086extern boolean
5087 val_ascendant_compare (val_value_t *val1,
5088 val_value_t *val2);
5089
5090
5097extern const xmlChar *
5098 val_get_dname (const val_value_t *val);
5099
5100
5110extern status_t
5111 val_set_dname (val_value_t *val,
5112 const xmlChar *dname);
5113
5114
5125extern status_t
5126 val_set_dname2 (val_value_t *val,
5127 const xmlChar *dname,
5128 uint32 dnamelen);
5129
5130
5138extern status_t
5139 val_new_extra (val_value_t *val);
5140
5141
5148extern const xmlChar *
5149 val_get_varexpr (const val_value_t *val);
5150
5151
5159extern status_t
5160 val_set_varexpr (val_value_t *val,
5161 const xmlChar *varexpr);
5162
5163
5169extern void
5170 val_clear_varexpr (val_value_t *val);
5171
5172
5178extern void
5179 val_set_wildcard_string (val_value_t *val);
5180
5181
5188#define val_is_wildcard_string(V) (((V)->flags & VAL_FL_WILDCARD) ? TRUE : FALSE)
5189
5190
5198extern status_t
5199 val_copy_editvars (const val_value_t *val,
5200 val_value_t *copy);
5201
5202
5211extern status_t
5212 val_set_skip_sil_partial (val_value_t *val);
5213
5214
5221extern boolean
5222 val_get_skip_sil_partial (const val_value_t *val);
5223
5224
5235extern typ_def_t *
5236 val_get_leafref_typdef_ex (val_value_t *val,
5237 boolean union_check);
5238
5239
5240
5252extern boolean
5253 val_is_default_npcon (val_value_t *val);
5254
5255
5263extern status_t
5264 val_identity_ok (typ_def_t *typdef,
5265 ncx_identity_t *ident);
5266
5267
5282extern status_t
5283 val_highest_bit_set (const val_value_t *val,
5284 uint32 *count,
5285 uint32 *pos);
5286
5287
5301extern status_t
5302 val_first_bit_set (const val_value_t *val,
5303 const ncx_lmem_t **lmem,
5304 uint32 *pos);
5305
5306
5321extern status_t
5322 val_next_bit_set (const val_value_t *val,
5323 const ncx_lmem_t *lmem,
5324 const ncx_lmem_t **nextlmem,
5325 uint32 *pos);
5326
5333extern struct xpath_aio_cb_t_ *
5334 val_get_aiocb (const val_value_t *val);
5335
5336
5344extern status_t
5345 val_set_aiocb (val_value_t *val,
5346 struct xpath_aio_cb_t_ *aiocb);
5347
5348
5358extern ncx_sm_mpid_t *
5359 val_get_mpid (const val_value_t *val);
5360
5361
5370extern status_t
5371 val_set_mpid (val_value_t *val,
5372 struct ncx_sm_mpid_t_ *mpid);
5373
5374
5378#ifdef __cplusplus
5379} /* end extern 'C' */
5380#endif
5381
5382#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.