yumapro  23.10T-8
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 - 2024, 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
2100
2111extern void
2112 val_dump_value_config (val_value_t *val,
2113 int32 startindent,
2114 log_debug_t lvl);
2115
2116
2128extern void
2129 val_dump_value_ex (val_value_t *val,
2130 int32 startindent,
2131 ncx_display_mode_t display_mode,
2132 log_debug_t lvl);
2133
2134
2145extern void
2146 val_dump_alt_value (val_value_t *val,
2147 int32 startindent,
2148 log_debug_t lvl);
2149
2150
2160extern void
2161 val_stdout_value (val_value_t *val,
2162 int32 startindent,
2163 log_debug_t lvl);
2164
2165
2176extern void
2177 val_stdout_value_ex (val_value_t *val,
2178 int32 startindent,
2179 ncx_display_mode_t display_mode,
2180 log_debug_t lvl);
2181
2182
2200extern void
2201 val_dump_value_max (val_value_t *val,
2202 int32 startindent,
2203 int32 indent_amount,
2204 val_dumpvalue_mode_t dumpmode,
2205 ncx_display_mode_t display_mode,
2206 boolean with_meta,
2207 boolean configonly,
2208 log_debug_t lvl);
2209
2210
2232extern void
2233 val_dump_value_full (val_value_t *val,
2234 int32 startindent,
2235 int32 indent_amount,
2236 val_dumpvalue_mode_t dumpmode,
2237 ncx_display_mode_t display_mode,
2238 boolean with_meta,
2239 boolean configonly,
2240 boolean conf_mode,
2241 boolean expand_varexpr,
2242 log_debug_t lvl,
2243 logfns_t *overrideOutput);
2244
2245
2268extern void
2269 val_dump_value_full2 (val_value_t *val,
2270 int32 startindent,
2271 int32 indent_amount,
2272 val_dumpvalue_mode_t dumpmode,
2273 ncx_display_mode_t display_mode,
2274 boolean with_meta,
2275 boolean configonly,
2276 boolean conf_mode,
2277 boolean expand_varexpr,
2278 boolean withdef,
2279 log_debug_t lvl,
2280 logfns_t *overrideOutput);
2281
2282
2295extern status_t
2296 val_set_string (val_value_t *val,
2297 const xmlChar *valname,
2298 const xmlChar *valstr);
2299
2300
2316extern status_t
2317 val_set_string2 (val_value_t *val,
2318 const xmlChar *valname,
2319 typ_def_t *typdef,
2320 const xmlChar *valstr,
2321 uint32 valstrlen);
2322
2323
2344extern status_t
2345 val_set_string3 (val_value_t *val,
2346 const xmlChar *valname,
2347 typ_def_t *typdef,
2348 const xmlChar *valstr,
2349 uint32 valstrlen,
2350 boolean is_dblquote);
2351
2352
2368extern status_t
2369 val_set_binary (const xmlChar *valstr,
2370 uint32 valstrlen,
2371 val_value_t *val);
2372
2373
2374
2384extern status_t
2385 val_reset_empty (val_value_t *val);
2386
2387
2400extern status_t
2401 val_set_simval (val_value_t *val,
2402 typ_def_t *typdef,
2403 xmlns_id_t nsid,
2404 const xmlChar *valname,
2405 const xmlChar *valstr);
2406
2407
2450extern status_t
2451 val_set_simval_str (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
2458
2479extern status_t
2480 val_set_simval_binary (val_value_t *val,
2481 const xmlChar *binstr,
2482 uint32 binstrlen);
2483
2484
2528extern status_t
2529 val_set_simval_max (val_value_t *val,
2530 typ_def_t *typdef,
2531 xmlns_id_t nsid,
2532 const xmlChar *valname,
2533 uint32 valnamelen,
2534 const xmlChar *valstr,
2535 uint32 valstrlen);
2536
2537
2551extern val_value_t *
2552 val_make_simval (typ_def_t *typdef,
2553 xmlns_id_t nsid,
2554 const xmlChar *valname,
2555 const xmlChar *valstr,
2556 status_t *res);
2557
2558
2572extern val_value_t *
2573 val_make_string (xmlns_id_t nsid,
2574 const xmlChar *valname,
2575 const xmlChar *valstr);
2576
2577
2588extern val_value_t *
2589 val_make_binary (xmlns_id_t nsid,
2590 const xmlChar *valname,
2591 const xmlChar *valstr,
2592 uint32 valstrlen);
2593
2594
2606extern status_t
2607 val_merge (const val_value_t *src,
2608 val_value_t *dest);
2609
2610
2617extern val_value_t *
2618 val_clone (const val_value_t *val);
2619
2620
2628extern val_value_t *
2629 val_clone2 (const val_value_t *val);
2630
2631
2645extern val_value_t *
2646 val_clone_config_data (const val_value_t *val,
2647 status_t *res);
2648
2649
2650
2667extern val_value_t *
2668 val_clone_config_newval (const val_value_t *val,
2669 status_t *res);
2670
2691extern val_value_t *
2692 val_clone_config_newval_keys_only (const val_value_t *val,
2693 status_t *res);
2694
2695
2715extern val_value_t *
2716 val_clone_config_save (const val_value_t *val,
2717 status_t *res);
2718
2719
2730extern status_t
2731 val_replace (val_value_t *val,
2732 val_value_t *copy);
2733
2734
2744extern status_t
2745 val_replace_str (const xmlChar *str,
2746 uint32 stringlen,
2747 val_value_t *copy);
2748
2749
2760extern status_t
2761 val_fast_replace_string (const xmlChar *str,
2762 uint32 stringlen,
2763 val_value_t *copy);
2764
2765
2772extern void
2773 val_replace_stringval (val_value_t *val,
2774 const xmlChar *str);
2775
2776
2793extern void
2794 val_add_child (val_value_t *child,
2795 val_value_t *parent);
2796
2797
2809extern void
2810 val_add_child_sorted (val_value_t *child,
2811 val_value_t *parent);
2812
2813
2825extern void
2826 val_insert_child (val_value_t *child,
2827 val_value_t *current,
2828 val_value_t *parent);
2829
2830
2839extern void
2840 val_remove_child (val_value_t *child);
2841
2842
2852extern void
2853 val_swap_child (val_value_t *newchild,
2854 val_value_t *curchild);
2855
2856
2864extern val_value_t *
2865 val_first_child_match (const val_value_t *parent,
2866 const val_value_t *child);
2867
2868
2879extern val_value_t *
2880 val_first_child_match_fast (const val_value_t *parent,
2881 const val_value_t *child,
2882 val_value_t *lastmatch);
2883
2884
2896extern val_value_t *
2897 val_next_child_match (val_value_t *parent,
2898 val_value_t *child,
2899 val_value_t *curmatch);
2900
2901
2908extern val_value_t *
2909 val_next_child_same (val_value_t *curchild);
2910
2911
2918extern val_value_t *
2919 val_get_first_child (const val_value_t *parent);
2920
2921
2928extern val_value_t *
2929 val_get_next_child (const val_value_t *curchild);
2930
2931
2938extern val_value_t *
2939 val_get_first_terminal_child (const val_value_t *parent);
2940
2941
2948extern val_value_t *
2949 val_get_next_terminal_child (const val_value_t *curchild);
2950
2951
2965extern val_value_t *
2966 val_find_child (const val_value_t *parent,
2967 const xmlChar *modname,
2968 const xmlChar *childname);
2969
2970
2984extern val_value_t *
2985 val_find_child_fast (const val_value_t *parent,
2986 xmlns_id_t nsid,
2987 const xmlChar *childname);
2988
2989
2998extern val_value_t *
2999 val_find_child_obj (const val_value_t *parent,
3000 const struct obj_template_t_ *chobj);
3001
3002
3017extern val_value_t *
3018 val_find_child_que (const dlq_hdr_t *childQ,
3019 xmlns_id_t nsid,
3020 const xmlChar *childname);
3021
3022
3036extern val_value_t *
3037 val_match_child (const val_value_t *parent,
3038 const xmlChar *modname,
3039 const xmlChar *childname);
3040
3041
3058extern val_value_t *
3059 val_match_child_count (const val_value_t *parent,
3060 const xmlChar *modname,
3061 const xmlChar *childname,
3062 uint32 *matchcount);
3063
3064
3081extern val_value_t *
3082 val_find_next_child (const val_value_t *parent,
3083 const xmlChar *modname,
3084 const xmlChar *childname,
3085 const val_value_t *curchild);
3086
3087
3101extern val_value_t *
3102 val_find_next_child_fast (const val_value_t *parent,
3103 const val_value_t *curchild);
3104
3105
3114extern val_value_t *
3115 val_first_child_name (val_value_t *parent,
3116 const xmlChar *name);
3117
3118
3127extern val_value_t *
3128 val_first_child_qname (val_value_t *parent,
3129 xmlns_id_t nsid,
3130 const xmlChar *name);
3131
3132
3142extern val_value_t *
3143 val_next_child_qname (val_value_t *parent,
3144 xmlns_id_t nsid,
3145 const xmlChar *name,
3146 val_value_t *curchild);
3147
3148
3166extern val_value_t *
3167 val_first_child_string (val_value_t *parent,
3168 const xmlChar *name,
3169 const xmlChar *strval);
3170
3171
3180extern uint32
3181 val_child_cnt (val_value_t *parent);
3182
3183
3193extern uint32
3194 val_child_inst_cnt (const val_value_t *parent,
3195 const xmlChar *modname,
3196 const xmlChar *name);
3197
3198
3206extern uint32
3207 val_get_child_inst_id (const val_value_t *parent,
3208 const val_value_t *child);
3209
3210
3217extern uint32
3218 val_liststr_count (const val_value_t *val);
3219
3220
3233extern boolean
3234 val_index_match (const val_value_t *val1,
3235 const val_value_t *val2);
3236
3237
3248extern int
3249 val_index_compare (const val_value_t *val1,
3250 const val_value_t *val2);
3251
3252
3282extern int32
3283 val_compare_max (const val_value_t *val1,
3284 const val_value_t *val2,
3285 boolean configonly,
3286 boolean childonly,
3287 boolean editing);
3288
3289
3323extern int32
3324 val_compare_max_def (const val_value_t *val1,
3325 const val_value_t *val2,
3326 boolean configonly,
3327 boolean childonly,
3328 boolean editing,
3329 boolean ignore_defaults);
3330
3331
3355extern int32
3356 val_compare_ex (const val_value_t *val1,
3357 const val_value_t *val2,
3358 boolean configonly);
3359
3360
3381extern int32
3382 val_compare (const val_value_t *val1,
3383 const val_value_t *val2);
3384
3385
3405extern int32
3406 val_compare_to_string (const val_value_t *val1,
3407 const xmlChar *strval2,
3408 status_t *res);
3409
3410
3432extern int32
3433 val_compare_to_string_len (const val_value_t *val1,
3434 const xmlChar *strval2,
3435 uint32 strval2len,
3436 status_t *res);
3437
3438
3457extern int32
3458 val_compare_for_replace (const val_value_t *val1,
3459 const val_value_t *val2);
3460
3461
3480extern int32
3481 val_compare_for_edit (const val_value_t *val1,
3482 const val_value_t *val2,
3483 boolean ismerge);
3484
3485
3504extern int32
3505 val_compare_as_string (const val_value_t *val1,
3506 const val_value_t *val2,
3507 status_t *res);
3508
3509
3528extern status_t
3529 val_sprintf_simval_nc (xmlChar *buff,
3530 const val_value_t *val,
3531 uint32 *len);
3532
3533
3553extern status_t
3554 val_sprintf_simval_nc_ex (xmlChar *buff,
3555 const val_value_t *val,
3556 boolean url_encode,
3557 uint32 *len);
3558
3559
3560
3561
3584extern status_t
3585 val_sprintf_simval_xpath (xmlChar *buff,
3586 const val_value_t *val,
3587 boolean url_encode,
3588 xmlChar quot_char,
3589 uint32 *len);
3590
3591
3604extern xmlChar *
3605 val_make_sprintf_string (const val_value_t *val);
3606
3607
3620extern status_t
3621 val_resolve_scoped_name (val_value_t *val,
3622 const xmlChar *name,
3623 val_value_t **chval);
3624
3625
3632extern ncx_iqual_t
3633 val_get_iqualval (const val_value_t *val);
3634
3635
3654extern boolean
3655 val_duplicates_allowed (val_value_t *val);
3656
3657
3665extern boolean
3666 val_has_content (const val_value_t *val);
3667
3668
3677extern boolean
3678 val_has_content_ex (const val_value_t *val);
3679
3680
3688extern boolean
3689 val_has_index (const val_value_t *val);
3690
3691
3698extern val_index_t *
3699 val_get_first_index (const val_value_t *val);
3700
3701
3708extern val_index_t *
3709 val_get_next_index (const val_index_t *valindex);
3710
3711
3718extern uint32
3719 val_get_index_count (const val_value_t *val);
3720
3721
3733extern status_t
3734 val_parse_meta (ses_cb_t *scb,
3735 typ_def_t *typdef,
3736 xml_attr_t *attr,
3737 val_value_t *retval);
3738
3739
3746extern void
3747 val_set_extern (val_value_t *val,
3748 xmlChar *fname);
3749
3750
3758extern void
3759 val_set_intern (val_value_t *val,
3760 xmlChar *intbuff);
3761
3762
3781extern boolean
3782 val_fit_oneline (const val_value_t *val,
3783 uint32 linesize,
3784 boolean isxml);
3785
3786
3795extern boolean
3796 val_create_allowed (const val_value_t *val);
3797
3798
3807extern boolean
3808 val_delete_allowed (const val_value_t *val);
3809
3810
3818extern boolean
3819 val_is_config_data (const val_value_t *val);
3820
3821
3830extern boolean
3831 val_is_config_save (const val_value_t *val);
3832
3833
3843extern boolean
3844 val_is_virtual (const val_value_t *val);
3845
3846
3876extern val_value_t *
3877 val_get_virtual_value (ses_cb_t *scb,
3878 val_value_t *val,
3879 status_t *res);
3880
3881
3901extern boolean
3902 val_is_default (val_value_t *val);
3903
3904
3914extern boolean
3915 val_is_real (const val_value_t *val);
3916
3917
3924extern xmlns_id_t
3925 val_get_parent_nsid (const val_value_t *val);
3926
3927
3939extern uint32
3940 val_instance_count (val_value_t *val,
3941 const xmlChar *modname,
3942 const xmlChar *objname);
3943
3944
3959extern uint32
3960 val_instance_count_fast (val_value_t *val,
3961 xmlns_id_t nsid,
3962 const xmlChar *objname,
3963 val_value_t **firstval);
3964
3965
3978extern uint32
3979 val_instance_count_fast2 (val_value_t *val,
3980 val_value_t *startval);
3981
3982
3998extern void
3999 val_set_extra_instance_errors (val_value_t *val,
4000 const xmlChar *modname,
4001 const xmlChar *objname,
4002 uint32 maxelems);
4003
4004
4013extern boolean
4014 val_need_quotes (const xmlChar *str);
4015
4016
4026extern boolean
4027 val_has_dquotes (const xmlChar *str);
4028
4037extern boolean
4038 val_need_dquotes (const xmlChar *str);
4039
4040
4048extern boolean
4049 val_all_whitespace (const xmlChar *str);
4050
4051
4060extern boolean
4061 val_any_whitespace (const xmlChar *str,
4062 uint32 len);
4063
4064
4073extern boolean
4074 val_match_metaval (const xml_attr_t *attr,
4075 xmlns_id_t nsid,
4076 const xmlChar *name);
4077
4078
4085extern boolean
4086 val_get_dirty_flag (const val_value_t *val);
4087
4088
4095extern boolean
4096 val_get_subtree_dirty_flag (const val_value_t *val);
4097
4098
4104extern void
4105 val_set_subtree_dirty_up (val_value_t *val);
4106
4107
4115extern void
4116 val_set_dirty_flag (val_value_t *val,
4117 boolean clear_def);
4118
4119
4125extern void
4126 val_set_child_deleted_flag (val_value_t *val);
4127
4128
4135extern boolean
4136 val_get_child_deleted_flag (val_value_t *val);
4137
4138
4151extern void
4152 val_clear_dirty_flag (val_value_t *val,
4153 time_t *timestamp,
4154 ncx_transaction_id_t txid,
4155 boolean is_delete,
4156 boolean do_clear_default);
4157
4158
4164extern void
4165 val_clear_child_dirty_flag (val_value_t *val);
4166
4167
4174extern boolean
4175 val_dirty_subtree (const val_value_t *val);
4176
4177
4190extern void
4191 val_clean_tree (val_value_t *val);
4192
4193
4200extern uint32
4201 val_get_nest_level (val_value_t *val);
4202
4203
4212extern val_value_t *
4213 val_get_first_leaf (val_value_t *val);
4214
4215
4223extern const xmlChar *
4224 val_get_mod_name (const val_value_t *val);
4225
4226
4234extern const xmlChar *
4235 val_get_mod_prefix (const val_value_t *val);
4236
4237
4244extern xmlns_id_t
4245 val_get_nsid (const val_value_t *val);
4246
4247
4254extern ncx_sid_t
4255 val_get_yang_sid (const val_value_t *val);
4256
4257
4264extern void
4265 val_change_nsid (val_value_t *val,
4266 xmlns_id_t nsid);
4267
4268
4275extern void
4276 val_change_nsid2 (val_value_t *val,
4277 xmlns_id_t nsid);
4278
4279
4286extern void
4287 val_change_nsid3 (val_value_t *val,
4288 xmlns_id_t nsid);
4289
4290
4302extern val_value_t *
4303 val_make_from_insertxpcb (val_value_t *sourceval,
4304 status_t *res);
4305
4306
4312extern val_unique_t *
4313 val_new_unique (void);
4314
4315
4321extern void
4322 val_free_unique (val_unique_t *valuni);
4323
4324
4331extern const typ_def_t *
4332 val_get_typdef (const val_value_t *val);
4333
4334
4342extern boolean
4343 val_set_by_default (const val_value_t *val);
4344
4345
4353extern boolean
4354 val_has_withdef_default (const val_value_t *val);
4355
4356
4362extern void
4363 val_set_withdef_default (val_value_t *val);
4364
4365
4373extern boolean
4374 val_is_metaval (const val_value_t *val);
4375
4376
4384extern void
4385 val_move_children (val_value_t *srcval,
4386 val_value_t *destval);
4387
4388
4396extern void
4397 val_move_nonconfig_children (val_value_t *srcval,
4398 val_value_t *destval);
4399
4419extern status_t
4420 val_cvt_generic (val_value_t *val);
4421
4422
4431extern status_t
4432 val_set_pcookie (val_value_t *val,
4433 void *pcookie);
4434
4435
4444extern status_t
4445 val_set_icookie (val_value_t *val,
4446 int icookie);
4447
4448
4456extern void *
4457 val_get_pcookie (val_value_t *val);
4458
4459
4467extern int
4468 val_get_icookie (val_value_t *val);
4469
4470
4478extern status_t
4479 val_delete_default_leaf (val_value_t *val);
4480
4481
4491extern status_t
4492 val_delete_default_leaf_list (val_value_t *val);
4493
4494
4500extern void
4501 val_force_empty (val_value_t *val);
4502
4503
4511extern status_t
4512 val_delete_default_npcon (val_value_t *val);
4513
4514
4523extern void
4524 val_move_fields_for_xml (val_value_t *srcval,
4525 val_value_t *destval,
4526 boolean movemeta);
4527
4528
4536extern void
4537 val_move_metadata (val_value_t *srcval,
4538 val_value_t *destval);
4539
4540
4547extern val_index_t *
4548 val_get_first_key (val_value_t *val);
4549
4550
4557extern val_index_t *
4558 val_get_last_key (val_value_t *val);
4559
4560
4567extern val_index_t *
4568 val_get_next_key (val_index_t *curkey);
4569
4570
4577extern val_index_t *
4578 val_get_prev_key (val_index_t *curkey);
4579
4580
4587extern void
4588 val_remove_key (val_value_t *keyval);
4589
4590
4597extern val_value_t *
4598 val_new_deleted_value (void);
4599
4600
4608extern status_t
4609 val_new_editvars (val_value_t *val);
4610
4611
4619extern void
4620 val_free_editvars (val_value_t *val);
4621
4622
4628extern void
4629 val_free_solo_editvars (val_editvars_t *editvars);
4630
4631
4642extern boolean
4643 val_all_np_containers (val_value_t *val);
4644
4645
4655extern status_t
4656 val_sprintf_etag (val_value_t *val,
4657 xmlChar *buff,
4658 int32 buffsize);
4659
4660
4667extern time_t *
4668 val_get_last_modified (val_value_t *val);
4669
4670
4676extern void
4677 val_force_default (val_value_t *val);
4678
4687extern void
4688 val_set_all_tags (val_value_t *val,
4689 time_t *timestamp,
4690 ncx_transaction_id_t txid);
4691
4692
4699extern const xmlChar *
4700 val_get_owner (val_value_t *val);
4701
4702
4709extern ncx_owner_id_t
4710 val_get_owner_id (val_value_t *val);
4711
4712
4719extern boolean
4720 val_need_owner_string (val_value_t *val);
4721
4722
4729extern void
4730 val_delete_children (val_value_t *val);
4731
4732
4738extern void
4739 val_clean_value (val_value_t *val);
4740
4741
4750extern boolean
4751 val_find_bit (val_value_t *val,
4752 const xmlChar *bitname);
4753
4754
4762extern boolean
4763 val_has_children (const val_value_t *val);
4764
4765
4773extern status_t
4774 val_add_test_valindex (val_value_t *parentval,
4775 val_value_t *keyval);
4776
4777
4784extern const xmlChar *
4785 val_get_yang_typename (val_value_t *val);
4786
4787
4794extern void
4795 val_set_force_config (val_value_t *val,
4796 boolean is_config);
4797
4798
4805extern void
4806 val_clear_defvalset_flag (val_value_t *val);
4807
4808
4817extern status_t
4818 val_clone_valQ (dlq_hdr_t *valQ,
4819 dlq_hdr_t *return_valQ);
4820
4821
4829extern void
4830 val_clean_valQ (dlq_hdr_t *valQ);
4831
4832
4842extern boolean
4843 val_is_value_set (val_value_t *val);
4844
4845
4853extern uint32
4854 val_url_encode_string (const xmlChar *str,
4855 xmlChar *buff);
4856
4857
4858
4870extern status_t
4871 val_quote_encode_string (const xmlChar *str,
4872 xmlChar quot_char,
4873 xmlChar *buff,
4874 uint32 *retlen);
4875
4876
4885extern void
4886 val_convert_any_to_container (val_value_t *val);
4887
4888
4895extern void
4896 val_clean_index_chain (val_value_t *val);
4897
4898
4906extern boolean
4907 val_pattern_match (const xmlRegexpPtr pattern,
4908 const xmlChar *strval);
4909
4910
4919extern boolean
4920 val_ocpattern_match (const regex_t *ocpattern,
4921 const xmlChar *strval);
4922
4923
4933extern boolean
4934 val_idref_derived_from (ncx_module_t *impmod,
4935 val_value_t *testval,
4936 const xmlChar *qname,
4937 boolean or_self);
4938
4939
4950extern status_t
4951 val_set_sil_priority (val_value_t *val,
4952 uint8 silprio);
4953
4954
4961extern uint8
4962 val_get_sil_priority (val_value_t *val);
4963
4964
4973extern const xmlChar *
4974 val_find_bit_name (val_value_t *val,
4975 uint32 bitpos);
4976
4977
4987extern const xmlChar *
4988 val_find_enum_name (val_value_t *val,
4989 int32 enunum);
4990
4991
5003extern const xmlChar *
5004 val_find_enum_name2 (ncx_btype_t btyp,
5005 typ_def_t *typdef,
5006 int32 enunum);
5007
5008
5015extern void
5016 val_mark_deleted (val_value_t *val);
5017
5018
5026extern void
5027 val_mark_undeleted (val_value_t *val);
5028
5029
5040extern boolean
5041 val_has_conditional_value (val_value_t *val);
5042
5043
5054extern val_value_t *
5055 val_convert_leafref (const val_value_t *val);
5056
5057
5078extern int32
5079 val_compare_for_topreplace (const val_value_t *val1,
5080 const val_value_t *val2);
5081
5082
5108extern int32
5109 val_compare_for_topreplace_simple (const val_value_t *val1,
5110 const val_value_t *val2);
5111
5112
5120extern boolean
5121 val_has_complex_child (const val_value_t *val);
5122
5123
5131extern status_t
5132 val_add_meta (val_value_t *metaval,
5133 val_value_t *val);
5134
5135
5142extern val_value_t *
5143 val_find_root (val_value_t *val);
5144
5145
5152extern status_t
5153 val_set_canonical (val_value_t *val);
5154
5155
5163extern typ_def_t *
5164 val_get_leafref_typdef (val_value_t *val);
5165
5166
5186extern boolean
5187 val_ascendant_compare (val_value_t *val1,
5188 val_value_t *val2);
5189
5190
5197extern const xmlChar *
5198 val_get_dname (const val_value_t *val);
5199
5200
5210extern status_t
5211 val_set_dname (val_value_t *val,
5212 const xmlChar *dname);
5213
5214
5225extern status_t
5226 val_set_dname2 (val_value_t *val,
5227 const xmlChar *dname,
5228 uint32 dnamelen);
5229
5230
5238extern status_t
5239 val_new_extra (val_value_t *val);
5240
5241
5248extern const xmlChar *
5249 val_get_varexpr (const val_value_t *val);
5250
5251
5259extern status_t
5260 val_set_varexpr (val_value_t *val,
5261 const xmlChar *varexpr);
5262
5263
5269extern void
5270 val_clear_varexpr (val_value_t *val);
5271
5272
5278extern void
5279 val_set_wildcard_string (val_value_t *val);
5280
5281
5288#define val_is_wildcard_string(V) (((V)->flags & VAL_FL_WILDCARD) ? TRUE : FALSE)
5289
5290
5298extern status_t
5299 val_copy_editvars (const val_value_t *val,
5300 val_value_t *copy);
5301
5302
5311extern status_t
5312 val_set_skip_sil_partial (val_value_t *val);
5313
5314
5321extern boolean
5322 val_get_skip_sil_partial (const val_value_t *val);
5323
5324
5335extern typ_def_t *
5336 val_get_leafref_typdef_ex (val_value_t *val,
5337 boolean union_check);
5338
5339
5340
5352extern boolean
5353 val_is_default_npcon (val_value_t *val);
5354
5355
5363extern status_t
5364 val_identity_ok (typ_def_t *typdef,
5365 ncx_identity_t *ident);
5366
5367
5382extern status_t
5383 val_highest_bit_set (const val_value_t *val,
5384 uint32 *count,
5385 uint32 *pos);
5386
5387
5401extern status_t
5402 val_first_bit_set (const val_value_t *val,
5403 const ncx_lmem_t **lmem,
5404 uint32 *pos);
5405
5406
5421extern status_t
5422 val_next_bit_set (const val_value_t *val,
5423 const ncx_lmem_t *lmem,
5424 const ncx_lmem_t **nextlmem,
5425 uint32 *pos);
5426
5433extern struct xpath_aio_cb_t_ *
5434 val_get_aiocb (const val_value_t *val);
5435
5436
5444extern status_t
5445 val_set_aiocb (val_value_t *val,
5446 struct xpath_aio_cb_t_ *aiocb);
5447
5448
5458extern ncx_sm_mpid_t *
5459 val_get_mpid (const val_value_t *val);
5460
5461
5470extern status_t
5471 val_set_mpid (val_value_t *val,
5472 struct ncx_sm_mpid_t_ *mpid);
5473
5474
5478#ifdef __cplusplus
5479} /* end extern 'C' */
5480#endif
5481
5482#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.