yumapro  24.10-3
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 if skip_sil_partial needed */
840 boolean deleted; /**< TRUE if deleted from commit_deletes */
841} YPACK val_editvars_t;
842
843
845typedef struct val_extra_t_ {
846
852 xmlChar *dname; /**< malloced name if needed */
853
860 void *getcb;
861
866 struct val_value_t_ *virtualval;
867
869 time_t cachetime;
870
875 struct xpath_pcb_t_ *xpathpcb;
876
877
881 plock_cb_t *plock[VAL_MAX_PLOCKS];
882
883
887 dlq_hdr_t *dataruleQ; /**< Q of obj_xpath_ptr_t */
888
894 xmlChar *varexpr;
895
900 struct xpath_aio_cb_t_ *aiocb;
901
903 ncx_sm_mpid_t *mpid;
904
905} YPACK val_extra_t;
906
907
912typedef struct val_value_t_ {
914 dlq_hdr_t qhdr;
915
917 struct obj_template_t_ *obj; /**< bptr to object def */
918 typ_def_t *typdef; /**< bptr to typdef if leaf */
919 const xmlChar *name; /**< back pointer to elname\n
920 * the dname field is moved to val_extra_t and only used when
921 * the value is constructed from dummy objects or no objects at all
922 */
923
924 struct val_value_t_ *parent; /**< back-ptr to parent if any */
925 struct val_child_hdr_t_ *hdr; /**< back-ptr to own child_hdr */
926
928 val_extra_t *val_extra;
929
930 uint32 flags; /**< internal status flags */
931
932 xmlns_id_t nsid; /**< namespace ID for this node */
933 ncx_btype_t btyp; /**< base type of this value */
934 ncx_data_class_t dataclass; /**< config or state data */
935
939 time_t last_modified;
940 ncx_etag_t etag; /**< ETag for RESTCONF */
941
955 dlq_hdr_t *metaQ; /**< Q of val_value_t */
956
960 val_editvars_t *editvars; /**< edit-vars from attrs */
961 op_editop_t editop; /**< needed for all edits */
962 status_t res; /**< validation result */
963
964 /* GET1 getcb moved to val_extra */
965 /* GET1 virtualval moved to val_extra */
966 /* GET1 cachetime moved to val_extra */
967
969 dlq_hdr_t *indexQ; /**< Q of val_index_t or ncx_filptr_t */
970
971 /* this field is used for NCX_BT_CHOICE
972 * If set, the object path for this node is really:
973 * $this --> casobj --> casobj.parent --> $this.parent
974 * the OBJ_TYP_CASE and OBJ_TYP_CHOICE nodes are skipped
975 * inside an XML instance document
976 *
977 * replaced by val_get_casobj() function in val_util.h
978 * struct obj_template_t_ *casobj;
979 */
980
981 /* xpathpcb moved to val_extra_t */
982
983 /* back-ptr to the partial locks that are held
984 * against this node
985 * plock moved to val_extra
986 */
987
988 /* back-ptr to the data access control rules that
989 * reference this node
990 * dataruleQ moved to val_extra
991 */
992
993 /* malloced pointer to the variable expression found
994 * if this val node is part of a data template.
995 * The actual value in union v_ MUST be ignored if
996 * varexpr string is non-NULL!!
997 * varexpr moved to val_extra
998 */
999
1003 ncx_owner_id_t owner_id;
1004
1006 ncx_nmda_origin_t nmda_origin;
1007
1009 boolean extern_valonly;
1010
1018 boolean from_anydata;
1019
1029 union v_ {
1039 dlq_hdr_t child_hdrQ;
1040
1050 ncx_num_t num;
1051
1058 ncx_str_t str;
1059
1060 val_idref_t idref; /**< NCX_BT_IDREF */
1061 ncx_binary_t binary; /**< NCX_BT_BINARY */
1062 ncx_list_t list; /**< NCX_BT_BITS, NCX_BT_SLIST */
1063 boolean boo; /**< NCX_BT_EMPTY, NCX_BT_BOOLEAN */
1064 ncx_enum_t enu; /**< NCX_BT_UNION, NCX_BT_ENUM */
1065 xmlChar *fname; /**< NCX_BT_EXTERN */
1066 xmlChar *intbuff; /**< NCX_BT_INTERN */
1067 } YPACK v;
1068} YPACK val_value_t;
1069
1070
1074typedef struct val_child_hdr_t_ {
1075 dlq_hdr_t qhdr; /**< queue header */
1076
1082 struct obj_template_t_ *obj;
1083
1087 struct val_tree_t_ *tree;
1088
1093 dlq_hdr_t que;
1094
1096 uint32 count;
1097
1099 uint8 flags;
1100} YPACK val_child_hdr_t;
1101
1102
1113typedef struct val_index_t_ {
1114 dlq_hdr_t qhdr; /**< queue header */
1115 val_value_t *val; /**< points to a child node */
1116} YPACK val_index_t;
1117
1118
1127typedef boolean
1128 (*val_test_fn_t) (const val_value_t *val);
1129
1130
1140typedef boolean
1141 (*val_walker_fn_t) (val_value_t *val,
1142 void *cookie1,
1143 void *cookie2);
1144
1145
1146
1156typedef boolean
1157 (*val_walker2_fn_t) (val_child_hdr_t *valhdr,
1158 void *cookie1,
1159 void *cookie2);
1160
1161
1162
1172typedef boolean
1173 (*val_hdr_test_fn_t) (val_child_hdr_t *hdr,
1174 void *cookie);
1175
1176
1186typedef boolean
1187 (*val_test2_fn_t) (val_value_t *val,
1188 void *cookie);
1189
1190
1194/********************************************************************
1195* *
1196* F U N C T I O N S *
1197* *
1198*********************************************************************/
1199
1217extern val_value_t *
1218 val_new_value (void);
1219
1220
1229extern void
1230 val_init_value (val_value_t *val);
1231
1232
1243extern void
1244 val_init_complex (val_value_t *val,
1245 ncx_btype_t btyp);
1246
1247
1257extern void
1258 val_init_virtual (val_value_t *val,
1259 void *cbfn,
1260 struct obj_template_t_ *obj);
1261
1262
1272extern void
1273 val_init_from_template (val_value_t *val,
1274 struct obj_template_t_ *obj);
1275
1276
1286extern void
1287 val_reinit_from_template (val_value_t *val,
1288 struct obj_template_t_ *obj);
1289
1290
1300extern void
1301 val_free_value (val_value_t *val);
1302
1303
1311extern void
1312 val_set_name (val_value_t *val,
1313 const xmlChar *name,
1314 uint32 namelen);
1315
1316
1326extern status_t
1327 val_force_dname (val_value_t *val);
1328
1329
1338extern void
1339 val_set_qname (val_value_t *val,
1340 xmlns_id_t nsid,
1341 const xmlChar *name,
1342 uint32 namelen);
1343
1344
1354extern status_t
1355 val_string_ok (typ_def_t *typdef,
1356 ncx_btype_t btyp,
1357 const xmlChar *strval);
1358
1359
1374extern status_t
1375 val_string_ok_errinfo (typ_def_t *typdef,
1376 ncx_btype_t btyp,
1377 const xmlChar *strval,
1378 ncx_errinfo_t **errinfo);
1379
1380
1396status_t
1397 val_binary_ok_errinfo (typ_def_t *typdef,
1398 const xmlChar *strval,
1399 val_value_t *val,
1400 ncx_errinfo_t **errinfo);
1401
1402
1420extern status_t
1421 val_string_ok_ex (ses_cb_t *scb,
1422 typ_def_t *typdef,
1423 ncx_btype_t btyp,
1424 const xmlChar *strval,
1425 ncx_errinfo_t **errinfo,
1426 boolean logerrors);
1427
1428
1447extern status_t
1448 val_string_ok_ex2 (ses_cb_t *scb,
1449 typ_def_t *typdef,
1450 ncx_btype_t btyp,
1451 const xmlChar *strval,
1452 ncx_errinfo_t **errinfo,
1453 boolean logerrors,
1454 boolean is_defval);
1455
1456
1477extern status_t
1478 val_list_ok (typ_def_t *typdef,
1479 ncx_btype_t btyp,
1480 ncx_list_t *list);
1481
1482
1500extern status_t
1501 val_list_ok_errinfo (typ_def_t *typdef,
1502 ncx_btype_t btyp,
1503 ncx_list_t *list,
1504 ncx_errinfo_t **errinfo);
1505
1506
1519extern status_t
1520 val_enum_ok (typ_def_t *typdef,
1521 const xmlChar *enumval,
1522 int32 *retval,
1523 const xmlChar **retstr);
1524
1525
1535extern status_t
1536 val_bit_ok (typ_def_t *typdef,
1537 const xmlChar *bitname,
1538 uint32 *position);
1539
1540
1541
1542
1552extern status_t
1553 val_bitpos_ok (typ_def_t *typdef,
1554 uint32 position,
1555 const xmlChar **name);
1556
1557
1576extern status_t
1577 val_idref_ok (typ_def_t *typdef,
1578 const xmlChar *qname,
1579 xmlns_id_t nsid,
1580 const xmlChar **name,
1581 ncx_identity_t **id);
1582
1583
1608extern status_t
1609 val_idref_ok_ex (typ_def_t *typdef,
1610 const xmlChar *qname,
1611 xmlns_id_t nsid,
1612 boolean is_json,
1613 ncx_module_t *impmod,
1614 boolean or_self,
1615 const xmlChar **name,
1616 ncx_identity_t **id);
1617
1618
1635extern status_t
1636 val_parse_idref (ncx_module_t *mod,
1637 const xmlChar *qname,
1638 xmlns_id_t *nsid,
1639 const xmlChar **name,
1640 ncx_identity_t **id);
1641
1642
1660extern status_t
1661 val_parse_idref_rootcb (ncx_module_t *mod,
1662 const xmlChar *qname,
1663 xmlns_id_t *nsid,
1664 const xmlChar **name,
1665 ncx_identity_t **id,
1666 ncx_sm_rootcb_t *rootcb);
1667
1668
1678extern status_t
1679 val_range_ok (typ_def_t *typdef,
1680 ncx_btype_t btyp,
1681 const ncx_num_t *num);
1682
1683
1695extern status_t
1696 val_range_ok_errinfo (typ_def_t *typdef,
1697 ncx_btype_t btyp,
1698 const ncx_num_t *num,
1699 ncx_errinfo_t **errinfo);
1700
1701
1709extern status_t
1710 val_pattern_ok (typ_def_t *typdef,
1711 const xmlChar *strval);
1712
1713
1726extern status_t
1727 val_pattern_ok_errinfo (typ_def_t *typdef,
1728 const xmlChar *strval,
1729 ncx_errinfo_t **errinfo);
1730
1731
1741extern status_t
1742 val_simval_ok (typ_def_t *typdef,
1743 const xmlChar *simval);
1744
1745
1746
1758extern status_t
1759 val_simval_ok_errinfo (typ_def_t *typdef,
1760 const xmlChar *simval,
1761 ncx_errinfo_t **errinfo);
1762
1763
1777extern status_t
1778 val_simval_ok_ex (typ_def_t *typdef,
1779 const xmlChar *simval,
1780 ncx_errinfo_t **errinfo,
1781 ncx_module_t *mod);
1782
1783
1799extern status_t
1800 val_simval_ok_max (typ_def_t *typdef,
1801 const xmlChar *simval,
1802 ncx_errinfo_t **errinfo,
1803 ncx_module_t *mod,
1804 boolean logerrors);
1805
1824extern status_t
1825 val_simval_ok_max2 (typ_def_t *typdef,
1826 const xmlChar *simval,
1827 ncx_errinfo_t **errinfo,
1828 ncx_module_t *mod,
1829 boolean logerrors,
1830 boolean nocond);
1831
1832
1852status_t
1853 val_simval_ok_max3 (typ_def_t *typdef,
1854 const xmlChar *simval,
1855 ncx_errinfo_t **errinfo,
1856 ncx_module_t *mod,
1857 boolean logerrors,
1858 boolean nocond,
1859 boolean is_defval);
1860
1861
1873extern status_t
1874 val_union_ok (typ_def_t *typdef,
1875 const xmlChar *strval,
1876 val_value_t *retval);
1877
1878
1892extern status_t
1893 val_union_ok_errinfo (typ_def_t *typdef,
1894 const xmlChar *strval,
1895 val_value_t *retval,
1896 ncx_errinfo_t **errinfo);
1897
1898
1916extern status_t
1917 val_union_ok_ex (typ_def_t *typdef,
1918 const xmlChar *strval,
1919 val_value_t *retval,
1920 ncx_errinfo_t **errinfo,
1921 ncx_module_t *mod,
1922 typ_def_t **match_typdef);
1923
1924
1945extern status_t
1946 val_union_ok_binary (typ_def_t *typdef,
1947 const xmlChar *binstr,
1948 uint32 binstrlen,
1949 val_value_t *retval,
1950 ncx_errinfo_t **errinfo,
1951 typ_def_t **match_typdef);
1952
1953
1973extern status_t
1974 val_union_ok_full (typ_def_t *typdef,
1975 const xmlChar *strval,
1976 val_value_t *contextval,
1977 val_value_t *rootval,
1978 val_value_t *retval,
1979 ncx_errinfo_t **errinfo);
1980
1981
1988extern dlq_hdr_t *
1989 val_get_metaQ (val_value_t *val);
1990
1991
1999extern val_value_t *
2000 val_get_first_meta (dlq_hdr_t *queue);
2001
2002
2010extern val_value_t *
2011 val_get_first_meta_val (val_value_t *val);
2012
2013
2021extern val_value_t *
2022 val_get_next_meta (val_value_t *curnode);
2023
2024
2032extern boolean
2033 val_meta_empty (val_value_t *val);
2034
2035
2044extern val_value_t *
2045 val_find_meta (val_value_t *val,
2046 xmlns_id_t nsid,
2047 const xmlChar *name);
2048
2049
2059extern boolean
2060 val_meta_match (val_value_t *val,
2061 val_value_t *metaval);
2062
2063
2072extern uint32
2073 val_metadata_inst_count (val_value_t *val,
2074 xmlns_id_t nsid,
2075 const xmlChar *name);
2076
2077
2088extern void
2089 val_dump_value (val_value_t *val,
2090 int32 startindent,
2091 log_debug_t lvl);
2092
2093
2094
2105extern void
2106 val_dump_value_config (val_value_t *val,
2107 int32 startindent,
2108 log_debug_t lvl);
2109
2110
2122extern void
2123 val_dump_value_ex (val_value_t *val,
2124 int32 startindent,
2125 ncx_display_mode_t display_mode,
2126 log_debug_t lvl);
2127
2128
2139extern void
2140 val_dump_alt_value (val_value_t *val,
2141 int32 startindent,
2142 log_debug_t lvl);
2143
2144
2154extern void
2155 val_stdout_value (val_value_t *val,
2156 int32 startindent,
2157 log_debug_t lvl);
2158
2159
2170extern void
2171 val_stdout_value_ex (val_value_t *val,
2172 int32 startindent,
2173 ncx_display_mode_t display_mode,
2174 log_debug_t lvl);
2175
2176
2194extern void
2195 val_dump_value_max (val_value_t *val,
2196 int32 startindent,
2197 int32 indent_amount,
2198 val_dumpvalue_mode_t dumpmode,
2199 ncx_display_mode_t display_mode,
2200 boolean with_meta,
2201 boolean configonly,
2202 log_debug_t lvl);
2203
2204
2226extern void
2227 val_dump_value_full (val_value_t *val,
2228 int32 startindent,
2229 int32 indent_amount,
2230 val_dumpvalue_mode_t dumpmode,
2231 ncx_display_mode_t display_mode,
2232 boolean with_meta,
2233 boolean configonly,
2234 boolean conf_mode,
2235 boolean expand_varexpr,
2236 log_debug_t lvl,
2237 logfns_t *overrideOutput);
2238
2239
2262extern void
2263 val_dump_value_full2 (val_value_t *val,
2264 int32 startindent,
2265 int32 indent_amount,
2266 val_dumpvalue_mode_t dumpmode,
2267 ncx_display_mode_t display_mode,
2268 boolean with_meta,
2269 boolean configonly,
2270 boolean conf_mode,
2271 boolean expand_varexpr,
2272 boolean withdef,
2273 log_debug_t lvl,
2274 logfns_t *overrideOutput);
2275
2276
2289extern status_t
2290 val_set_string (val_value_t *val,
2291 const xmlChar *valname,
2292 const xmlChar *valstr);
2293
2294
2310extern status_t
2311 val_set_string2 (val_value_t *val,
2312 const xmlChar *valname,
2313 typ_def_t *typdef,
2314 const xmlChar *valstr,
2315 uint32 valstrlen);
2316
2317
2338extern status_t
2339 val_set_string3 (val_value_t *val,
2340 const xmlChar *valname,
2341 typ_def_t *typdef,
2342 const xmlChar *valstr,
2343 uint32 valstrlen,
2344 boolean is_dblquote);
2345
2346
2362extern status_t
2363 val_set_binary (const xmlChar *valstr,
2364 uint32 valstrlen,
2365 val_value_t *val);
2366
2367
2368
2378extern status_t
2379 val_reset_empty (val_value_t *val);
2380
2381
2394extern status_t
2395 val_set_simval (val_value_t *val,
2396 typ_def_t *typdef,
2397 xmlns_id_t nsid,
2398 const xmlChar *valname,
2399 const xmlChar *valstr);
2400
2401
2444extern status_t
2445 val_set_simval_str (val_value_t *val,
2446 typ_def_t *typdef,
2447 xmlns_id_t nsid,
2448 const xmlChar *valname,
2449 uint32 valnamelen,
2450 const xmlChar *valstr);
2451
2452
2473extern status_t
2474 val_set_simval_binary (val_value_t *val,
2475 const xmlChar *binstr,
2476 uint32 binstrlen);
2477
2478
2522extern status_t
2523 val_set_simval_max (val_value_t *val,
2524 typ_def_t *typdef,
2525 xmlns_id_t nsid,
2526 const xmlChar *valname,
2527 uint32 valnamelen,
2528 const xmlChar *valstr,
2529 uint32 valstrlen);
2530
2531
2545extern val_value_t *
2546 val_make_simval (typ_def_t *typdef,
2547 xmlns_id_t nsid,
2548 const xmlChar *valname,
2549 const xmlChar *valstr,
2550 status_t *res);
2551
2552
2566extern val_value_t *
2567 val_make_string (xmlns_id_t nsid,
2568 const xmlChar *valname,
2569 const xmlChar *valstr);
2570
2571
2582extern val_value_t *
2583 val_make_binary (xmlns_id_t nsid,
2584 const xmlChar *valname,
2585 const xmlChar *valstr,
2586 uint32 valstrlen);
2587
2588
2600extern status_t
2601 val_merge (const val_value_t *src,
2602 val_value_t *dest);
2603
2604
2611extern val_value_t *
2612 val_clone (const val_value_t *val);
2613
2614
2622extern val_value_t *
2623 val_clone2 (const val_value_t *val);
2624
2625
2639extern val_value_t *
2640 val_clone_config_data (const val_value_t *val,
2641 status_t *res);
2642
2643
2644
2661extern val_value_t *
2662 val_clone_config_newval (const val_value_t *val,
2663 status_t *res);
2664
2685extern val_value_t *
2686 val_clone_config_newval_keys_only (const val_value_t *val,
2687 status_t *res);
2688
2689
2709extern val_value_t *
2710 val_clone_config_save (const val_value_t *val,
2711 status_t *res);
2712
2713
2724extern status_t
2725 val_replace (val_value_t *val,
2726 val_value_t *copy);
2727
2728
2738extern status_t
2739 val_replace_str (const xmlChar *str,
2740 uint32 stringlen,
2741 val_value_t *copy);
2742
2743
2754extern status_t
2755 val_fast_replace_string (const xmlChar *str,
2756 uint32 stringlen,
2757 val_value_t *copy);
2758
2759
2766extern void
2767 val_replace_stringval (val_value_t *val,
2768 const xmlChar *str);
2769
2770
2787extern void
2788 val_add_child (val_value_t *child,
2789 val_value_t *parent);
2790
2791
2803extern void
2804 val_add_child_sorted (val_value_t *child,
2805 val_value_t *parent);
2806
2807
2819extern void
2820 val_insert_child (val_value_t *child,
2821 val_value_t *current,
2822 val_value_t *parent);
2823
2824
2833extern void
2834 val_remove_child (val_value_t *child);
2835
2836
2846extern void
2847 val_swap_child (val_value_t *newchild,
2848 val_value_t *curchild);
2849
2850
2858extern val_value_t *
2859 val_first_child_match (const val_value_t *parent,
2860 const val_value_t *child);
2861
2862
2873extern val_value_t *
2874 val_first_child_match_fast (const val_value_t *parent,
2875 const val_value_t *child,
2876 val_value_t *lastmatch);
2877
2878
2890extern val_value_t *
2891 val_next_child_match (val_value_t *parent,
2892 val_value_t *child,
2893 val_value_t *curmatch);
2894
2895
2902extern val_value_t *
2903 val_next_child_same (val_value_t *curchild);
2904
2905
2912extern val_value_t *
2913 val_get_first_child (const val_value_t *parent);
2914
2915
2922extern val_value_t *
2923 val_get_next_child (const val_value_t *curchild);
2924
2925
2932extern val_value_t *
2933 val_get_first_terminal_child (const val_value_t *parent);
2934
2935
2942extern val_value_t *
2943 val_get_next_terminal_child (const val_value_t *curchild);
2944
2945
2959extern val_value_t *
2960 val_find_child (const val_value_t *parent,
2961 const xmlChar *modname,
2962 const xmlChar *childname);
2963
2964
2978extern val_value_t *
2979 val_find_child_fast (const val_value_t *parent,
2980 xmlns_id_t nsid,
2981 const xmlChar *childname);
2982
2983
2992extern val_value_t *
2993 val_find_child_obj (const val_value_t *parent,
2994 const struct obj_template_t_ *chobj);
2995
2996
3011extern val_value_t *
3012 val_find_child_que (const dlq_hdr_t *childQ,
3013 xmlns_id_t nsid,
3014 const xmlChar *childname);
3015
3016
3030extern val_value_t *
3031 val_match_child (const val_value_t *parent,
3032 const xmlChar *modname,
3033 const xmlChar *childname);
3034
3035
3052extern val_value_t *
3053 val_match_child_count (const val_value_t *parent,
3054 const xmlChar *modname,
3055 const xmlChar *childname,
3056 uint32 *matchcount);
3057
3058
3075extern val_value_t *
3076 val_find_next_child (const val_value_t *parent,
3077 const xmlChar *modname,
3078 const xmlChar *childname,
3079 const val_value_t *curchild);
3080
3081
3095extern val_value_t *
3096 val_find_next_child_fast (const val_value_t *parent,
3097 const val_value_t *curchild);
3098
3099
3108extern val_value_t *
3109 val_first_child_name (val_value_t *parent,
3110 const xmlChar *name);
3111
3112
3121extern val_value_t *
3122 val_first_child_qname (val_value_t *parent,
3123 xmlns_id_t nsid,
3124 const xmlChar *name);
3125
3126
3136extern val_value_t *
3137 val_next_child_qname (val_value_t *parent,
3138 xmlns_id_t nsid,
3139 const xmlChar *name,
3140 val_value_t *curchild);
3141
3142
3160extern val_value_t *
3161 val_first_child_string (val_value_t *parent,
3162 const xmlChar *name,
3163 const xmlChar *strval);
3164
3165
3174extern uint32
3175 val_child_cnt (val_value_t *parent);
3176
3177
3187extern uint32
3188 val_child_inst_cnt (const val_value_t *parent,
3189 const xmlChar *modname,
3190 const xmlChar *name);
3191
3192
3200extern uint32
3201 val_get_child_inst_id (const val_value_t *parent,
3202 const val_value_t *child);
3203
3204
3211extern uint32
3212 val_liststr_count (const val_value_t *val);
3213
3214
3227extern boolean
3228 val_index_match (const val_value_t *val1,
3229 const val_value_t *val2);
3230
3231
3242extern int
3243 val_index_compare (const val_value_t *val1,
3244 const val_value_t *val2);
3245
3246
3278extern int32
3279 val_compare_max (const val_value_t *val1,
3280 const val_value_t *val2,
3281 boolean configonly,
3282 boolean childonly,
3283 boolean editing);
3284
3285
3322extern int32
3323 val_compare_max_def (const val_value_t *val1,
3324 const val_value_t *val2,
3325 boolean configonly,
3326 boolean childonly,
3327 boolean editing,
3328 boolean ignore_defaults);
3329
3330
3354extern int32
3355 val_compare_ex (const val_value_t *val1,
3356 const val_value_t *val2,
3357 boolean configonly);
3358
3359
3380extern int32
3381 val_compare (const val_value_t *val1,
3382 const val_value_t *val2);
3383
3384
3404extern int32
3405 val_compare_to_string (const val_value_t *val1,
3406 const xmlChar *strval2,
3407 status_t *res);
3408
3409
3431extern int32
3432 val_compare_to_string_len (const val_value_t *val1,
3433 const xmlChar *strval2,
3434 uint32 strval2len,
3435 status_t *res);
3436
3437
3444// extern int32
3445// val_compare_for_replace (const val_value_t *val1,
3446// const val_value_t *val2);
3447
3448
3467extern int32
3468 val_compare_for_edit (const val_value_t *val1,
3469 const val_value_t *val2,
3470 boolean ismerge);
3471
3472
3491extern int32
3492 val_compare_as_string (const val_value_t *val1,
3493 const val_value_t *val2,
3494 status_t *res);
3495
3496
3515extern status_t
3516 val_sprintf_simval_nc (xmlChar *buff,
3517 const val_value_t *val,
3518 uint32 *len);
3519
3520
3540extern status_t
3541 val_sprintf_simval_nc_ex (xmlChar *buff,
3542 const val_value_t *val,
3543 boolean url_encode,
3544 uint32 *len);
3545
3546
3547
3548
3571extern status_t
3572 val_sprintf_simval_xpath (xmlChar *buff,
3573 const val_value_t *val,
3574 boolean url_encode,
3575 xmlChar quot_char,
3576 uint32 *len);
3577
3578
3591extern xmlChar *
3592 val_make_sprintf_string (const val_value_t *val);
3593
3594
3607extern status_t
3608 val_resolve_scoped_name (val_value_t *val,
3609 const xmlChar *name,
3610 val_value_t **chval);
3611
3612
3619extern ncx_iqual_t
3620 val_get_iqualval (const val_value_t *val);
3621
3622
3641extern boolean
3642 val_duplicates_allowed (val_value_t *val);
3643
3644
3652extern boolean
3653 val_has_content (const val_value_t *val);
3654
3655
3664extern boolean
3665 val_has_content_ex (const val_value_t *val);
3666
3667
3675extern boolean
3676 val_has_index (const val_value_t *val);
3677
3678
3685extern val_index_t *
3686 val_get_first_index (const val_value_t *val);
3687
3688
3695extern val_index_t *
3696 val_get_next_index (const val_index_t *valindex);
3697
3698
3705extern uint32
3706 val_get_index_count (const val_value_t *val);
3707
3708
3720extern status_t
3721 val_parse_meta (ses_cb_t *scb,
3722 typ_def_t *typdef,
3723 xml_attr_t *attr,
3724 val_value_t *retval);
3725
3726
3733extern void
3734 val_set_extern (val_value_t *val,
3735 xmlChar *fname);
3736
3737
3745extern void
3746 val_set_intern (val_value_t *val,
3747 xmlChar *intbuff);
3748
3749
3768extern boolean
3769 val_fit_oneline (const val_value_t *val,
3770 uint32 linesize,
3771 boolean isxml);
3772
3773
3782extern boolean
3783 val_create_allowed (const val_value_t *val);
3784
3785
3794extern boolean
3795 val_delete_allowed (const val_value_t *val);
3796
3797
3805extern boolean
3806 val_is_config_data (const val_value_t *val);
3807
3808
3817extern boolean
3818 val_is_config_save (const val_value_t *val);
3819
3820
3830extern boolean
3831 val_is_virtual (const val_value_t *val);
3832
3833
3863extern val_value_t *
3864 val_get_virtual_value (ses_cb_t *scb,
3865 val_value_t *val,
3866 status_t *res);
3867
3868
3888extern boolean
3889 val_is_default (val_value_t *val);
3890
3891
3901extern boolean
3902 val_is_real (const val_value_t *val);
3903
3904
3911extern xmlns_id_t
3912 val_get_parent_nsid (const val_value_t *val);
3913
3914
3926extern uint32
3927 val_instance_count (val_value_t *val,
3928 const xmlChar *modname,
3929 const xmlChar *objname);
3930
3931
3946extern uint32
3947 val_instance_count_fast (val_value_t *val,
3948 xmlns_id_t nsid,
3949 const xmlChar *objname,
3950 val_value_t **firstval);
3951
3952
3965extern uint32
3966 val_instance_count_fast2 (val_value_t *val,
3967 val_value_t *startval);
3968
3969
3985extern void
3986 val_set_extra_instance_errors (val_value_t *val,
3987 const xmlChar *modname,
3988 const xmlChar *objname,
3989 uint32 maxelems);
3990
3991
4000extern boolean
4001 val_need_quotes (const xmlChar *str);
4002
4003
4013extern boolean
4014 val_has_dquotes (const xmlChar *str);
4015
4024extern boolean
4025 val_need_dquotes (const xmlChar *str);
4026
4027
4035extern boolean
4036 val_all_whitespace (const xmlChar *str);
4037
4038
4047extern boolean
4048 val_any_whitespace (const xmlChar *str,
4049 uint32 len);
4050
4051
4060extern boolean
4061 val_match_metaval (const xml_attr_t *attr,
4062 xmlns_id_t nsid,
4063 const xmlChar *name);
4064
4065
4072extern boolean
4073 val_get_dirty_flag (const val_value_t *val);
4074
4075
4082extern boolean
4083 val_get_subtree_dirty_flag (const val_value_t *val);
4084
4085
4091extern void
4092 val_set_subtree_dirty_up (val_value_t *val);
4093
4094
4102extern void
4103 val_set_dirty_flag (val_value_t *val,
4104 boolean clear_def);
4105
4106
4112extern void
4113 val_set_child_deleted_flag (val_value_t *val);
4114
4115
4122extern boolean
4123 val_get_child_deleted_flag (val_value_t *val);
4124
4125
4138extern void
4139 val_clear_dirty_flag (val_value_t *val,
4140 time_t *timestamp,
4141 ncx_transaction_id_t txid,
4142 boolean is_delete,
4143 boolean do_clear_default);
4144
4145
4151extern void
4152 val_clear_child_dirty_flag (val_value_t *val);
4153
4154
4161extern boolean
4162 val_dirty_subtree (const val_value_t *val);
4163
4164
4177extern void
4178 val_clean_tree (val_value_t *val);
4179
4180
4187extern uint32
4188 val_get_nest_level (val_value_t *val);
4189
4190
4199extern val_value_t *
4200 val_get_first_leaf (val_value_t *val);
4201
4202
4210extern const xmlChar *
4211 val_get_mod_name (const val_value_t *val);
4212
4213
4221extern const xmlChar *
4222 val_get_mod_prefix (const val_value_t *val);
4223
4224
4231extern xmlns_id_t
4232 val_get_nsid (const val_value_t *val);
4233
4234
4241extern ncx_sid_t
4242 val_get_yang_sid (const val_value_t *val);
4243
4244
4251extern void
4252 val_change_nsid (val_value_t *val,
4253 xmlns_id_t nsid);
4254
4255
4262extern void
4263 val_change_nsid2 (val_value_t *val,
4264 xmlns_id_t nsid);
4265
4266
4273extern void
4274 val_change_nsid3 (val_value_t *val,
4275 xmlns_id_t nsid);
4276
4277
4289extern val_value_t *
4290 val_make_from_insertxpcb (val_value_t *sourceval,
4291 status_t *res);
4292
4293
4300extern const typ_def_t *
4301 val_get_typdef (const val_value_t *val);
4302
4303
4311extern boolean
4312 val_set_by_default (const val_value_t *val);
4313
4314
4322extern boolean
4323 val_has_withdef_default (const val_value_t *val);
4324
4325
4331extern void
4332 val_set_withdef_default (val_value_t *val);
4333
4334
4342extern boolean
4343 val_is_metaval (const val_value_t *val);
4344
4345
4353extern void
4354 val_move_children (val_value_t *srcval,
4355 val_value_t *destval);
4356
4357
4365extern void
4366 val_move_nonconfig_children (val_value_t *srcval,
4367 val_value_t *destval);
4368
4388extern status_t
4389 val_cvt_generic (val_value_t *val);
4390
4391
4400extern status_t
4401 val_set_pcookie (val_value_t *val,
4402 void *pcookie);
4403
4404
4413extern status_t
4414 val_set_icookie (val_value_t *val,
4415 int icookie);
4416
4417
4425extern void *
4426 val_get_pcookie (val_value_t *val);
4427
4428
4436extern int
4437 val_get_icookie (val_value_t *val);
4438
4439
4447extern status_t
4448 val_delete_default_leaf (val_value_t *val);
4449
4450
4460extern status_t
4461 val_delete_default_leaf_list (val_value_t *val);
4462
4463
4469extern void
4470 val_force_empty (val_value_t *val);
4471
4472
4480extern status_t
4481 val_delete_default_npcon (val_value_t *val);
4482
4483
4492extern void
4493 val_move_fields_for_xml (val_value_t *srcval,
4494 val_value_t *destval,
4495 boolean movemeta);
4496
4497
4505extern void
4506 val_move_metadata (val_value_t *srcval,
4507 val_value_t *destval);
4508
4509
4516extern val_index_t *
4517 val_get_first_key (val_value_t *val);
4518
4519
4526extern val_index_t *
4527 val_get_last_key (val_value_t *val);
4528
4529
4536extern val_index_t *
4537 val_get_next_key (val_index_t *curkey);
4538
4539
4546extern val_index_t *
4547 val_get_prev_key (val_index_t *curkey);
4548
4549
4556extern void
4557 val_remove_key (val_value_t *keyval);
4558
4559
4566extern val_value_t *
4567 val_new_deleted_value (void);
4568
4569
4577extern status_t
4578 val_new_editvars (val_value_t *val);
4579
4580
4588extern void
4589 val_free_editvars (val_value_t *val);
4590
4591
4597extern void
4598 val_free_solo_editvars (val_editvars_t *editvars);
4599
4600
4611extern boolean
4612 val_all_np_containers (val_value_t *val);
4613
4614
4624extern status_t
4625 val_sprintf_etag (val_value_t *val,
4626 xmlChar *buff,
4627 int32 buffsize);
4628
4629
4636extern time_t *
4637 val_get_last_modified (val_value_t *val);
4638
4639
4645extern void
4646 val_force_default (val_value_t *val);
4647
4656extern void
4657 val_set_all_tags (val_value_t *val,
4658 time_t *timestamp,
4659 ncx_transaction_id_t txid);
4660
4661
4668extern const xmlChar *
4669 val_get_owner (val_value_t *val);
4670
4671
4678extern ncx_owner_id_t
4679 val_get_owner_id (val_value_t *val);
4680
4681
4688extern boolean
4689 val_need_owner_string (val_value_t *val);
4690
4691
4698extern void
4699 val_delete_children (val_value_t *val);
4700
4701
4707extern void
4708 val_clean_value (val_value_t *val);
4709
4710
4719extern boolean
4720 val_find_bit (val_value_t *val,
4721 const xmlChar *bitname);
4722
4723
4731extern boolean
4732 val_has_children (const val_value_t *val);
4733
4734
4742extern status_t
4743 val_add_test_valindex (val_value_t *parentval,
4744 val_value_t *keyval);
4745
4746
4753extern const xmlChar *
4754 val_get_yang_typename (val_value_t *val);
4755
4756
4763extern void
4764 val_set_force_config (val_value_t *val,
4765 boolean is_config);
4766
4767
4774extern void
4775 val_clear_defvalset_flag (val_value_t *val);
4776
4777
4786extern status_t
4787 val_clone_valQ (dlq_hdr_t *valQ,
4788 dlq_hdr_t *return_valQ);
4789
4790
4798extern void
4799 val_clean_valQ (dlq_hdr_t *valQ);
4800
4801
4811extern boolean
4812 val_is_value_set (val_value_t *val);
4813
4814
4822extern uint32
4823 val_url_encode_string (const xmlChar *str,
4824 xmlChar *buff);
4825
4826
4827
4839extern status_t
4840 val_quote_encode_string (const xmlChar *str,
4841 xmlChar quot_char,
4842 xmlChar *buff,
4843 uint32 *retlen);
4844
4845
4854extern void
4855 val_convert_any_to_container (val_value_t *val);
4856
4857
4864extern void
4865 val_clean_index_chain (val_value_t *val);
4866
4867
4875extern boolean
4876 val_pattern_match (const xmlRegexpPtr pattern,
4877 const xmlChar *strval);
4878
4879
4888extern boolean
4889 val_ocpattern_match (const regex_t *ocpattern,
4890 const xmlChar *strval);
4891
4892
4902extern boolean
4903 val_idref_derived_from (ncx_module_t *impmod,
4904 val_value_t *testval,
4905 const xmlChar *qname,
4906 boolean or_self);
4907
4908
4919extern status_t
4920 val_set_sil_priority (val_value_t *val,
4921 uint8 silprio);
4922
4923
4930extern uint8
4931 val_get_sil_priority (val_value_t *val);
4932
4933
4942extern const xmlChar *
4943 val_find_bit_name (val_value_t *val,
4944 uint32 bitpos);
4945
4946
4956extern const xmlChar *
4957 val_find_enum_name (val_value_t *val,
4958 int32 enunum);
4959
4960
4972extern const xmlChar *
4973 val_find_enum_name2 (ncx_btype_t btyp,
4974 typ_def_t *typdef,
4975 int32 enunum);
4976
4977
4984extern void
4985 val_mark_deleted (val_value_t *val);
4986
4987
4995extern void
4996 val_mark_undeleted (val_value_t *val);
4997
4998
5009extern boolean
5010 val_has_conditional_value (val_value_t *val);
5011
5012
5023extern val_value_t *
5024 val_convert_leafref (const val_value_t *val);
5025
5026
5049extern int32
5050 val_compare_for_topreplace (const val_value_t *val1,
5051 const val_value_t *val2);
5052
5053
5081extern int32
5082 val_compare_for_topreplace_simple (const val_value_t *val1,
5083 const val_value_t *val2);
5084
5085
5093extern boolean
5094 val_has_complex_child (const val_value_t *val);
5095
5096
5104extern status_t
5105 val_add_meta (val_value_t *metaval,
5106 val_value_t *val);
5107
5108
5115extern val_value_t *
5116 val_find_root (val_value_t *val);
5117
5118
5125extern status_t
5126 val_set_canonical (val_value_t *val);
5127
5128
5136extern typ_def_t *
5137 val_get_leafref_typdef (val_value_t *val);
5138
5139
5159extern boolean
5160 val_ascendant_compare (val_value_t *val1,
5161 val_value_t *val2);
5162
5163
5170extern const xmlChar *
5171 val_get_dname (const val_value_t *val);
5172
5173
5183extern status_t
5184 val_set_dname (val_value_t *val,
5185 const xmlChar *dname);
5186
5187
5198extern status_t
5199 val_set_dname2 (val_value_t *val,
5200 const xmlChar *dname,
5201 uint32 dnamelen);
5202
5203
5211extern status_t
5212 val_new_extra (val_value_t *val);
5213
5214
5221extern const xmlChar *
5222 val_get_varexpr (const val_value_t *val);
5223
5224
5232extern status_t
5233 val_set_varexpr (val_value_t *val,
5234 const xmlChar *varexpr);
5235
5236
5242extern void
5243 val_clear_varexpr (val_value_t *val);
5244
5245
5251extern void
5252 val_set_wildcard_string (val_value_t *val);
5253
5254
5261#define val_is_wildcard_string(V) (((V)->flags & VAL_FL_WILDCARD) ? TRUE : FALSE)
5262
5263
5271extern status_t
5272 val_copy_editvars (const val_value_t *val,
5273 val_value_t *copy);
5274
5275
5284extern status_t
5285 val_set_skip_sil_partial (val_value_t *val);
5286
5287
5294extern boolean
5295 val_get_skip_sil_partial (const val_value_t *val);
5296
5297
5308extern typ_def_t *
5309 val_get_leafref_typdef_ex (val_value_t *val,
5310 boolean union_check);
5311
5312
5313
5325extern boolean
5326 val_is_default_npcon (val_value_t *val);
5327
5328
5336extern status_t
5337 val_identity_ok (typ_def_t *typdef,
5338 ncx_identity_t *ident);
5339
5340
5355extern status_t
5356 val_highest_bit_set (const val_value_t *val,
5357 uint32 *count,
5358 uint32 *pos);
5359
5360
5374extern status_t
5375 val_first_bit_set (const val_value_t *val,
5376 const ncx_lmem_t **lmem,
5377 uint32 *pos);
5378
5379
5394extern status_t
5395 val_next_bit_set (const val_value_t *val,
5396 const ncx_lmem_t *lmem,
5397 const ncx_lmem_t **nextlmem,
5398 uint32 *pos);
5399
5406extern struct xpath_aio_cb_t_ *
5407 val_get_aiocb (const val_value_t *val);
5408
5409
5417extern status_t
5418 val_set_aiocb (val_value_t *val,
5419 struct xpath_aio_cb_t_ *aiocb);
5420
5421
5431extern ncx_sm_mpid_t *
5432 val_get_mpid (const val_value_t *val);
5433
5434
5443extern status_t
5444 val_set_mpid (val_value_t *val,
5445 struct ncx_sm_mpid_t_ *mpid);
5446
5447
5458extern status_t
5459 val_set_deleted_from_commit_deletes (val_value_t *val,
5460 boolean deleted);
5461
5462
5475extern boolean
5476 val_get_deleted_from_commit_deletes (const val_value_t *val);
5477
5478
5482#ifdef __cplusplus
5483} /* end extern 'C' */
5484#endif
5485
5486#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.