yumapro  20.10-13
YumaPro SDK
Value Node Core Functions
Collaboration diagram for Value Node Core Functions:

Macros

#define val_is_wildcard_string(V)   (((V)->flags & VAL_FL_WILDCARD) ? TRUE : FALSE)
 Check if the value is a wildcard string. More...
 

Functions

val_value_t * val_new_value (void)
 Malloc and initialize the fields in a val_value_t. More...
 
void val_init_value (val_value_t *val)
 Initialize the generic fields in a val_value_t so it is ready for use. More...
 
void val_init_complex (val_value_t *val, ncx_btype_t btyp)
 Initialize the fields in a complex val_value_t this is deprecated and should only be called by val_init_from_template. More...
 
void val_init_virtual (val_value_t *val, void *cbfn, struct obj_template_t_ *obj)
 Special function to initialize a virtual value node. More...
 
void val_init_from_template (val_value_t *val, struct obj_template_t_ *obj)
 Initialize a value node from its object template. More...
 
void val_reinit_from_template (val_value_t *val, struct obj_template_t_ *obj)
 Re-Initialize a value node from its object template. More...
 
void val_free_value (val_value_t *val)
 Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct itself. More...
 
void val_set_name (val_value_t *val, const xmlChar *name, uint32 namelen)
 Set (or reset) the name of a value struct. More...
 
status_t val_force_dname (val_value_t *val)
 Set (or reset) the name of a value struct. More...
 
void val_set_qname (val_value_t *val, xmlns_id_t nsid, const xmlChar *name, uint32 namelen)
 Set (or reset) the name and namespace ID of a value struct. More...
 
status_t val_string_ok (typ_def_t *typdef, ncx_btype_t btyp, const xmlChar *strval)
 Check a string to make sure the value is valid based on the restrictions in the specified typdef. More...
 
status_t val_string_ok_errinfo (typ_def_t *typdef, ncx_btype_t btyp, const xmlChar *strval, ncx_errinfo_t **errinfo)
 retrieve the YANG custom error info if any More...
 
status_t val_binary_ok_errinfo (typ_def_t *typdef, const xmlChar *strval, val_value_t *val, ncx_errinfo_t **errinfo)
 retrieve the YANG custom error info for binary val, if any More...
 
status_t val_string_ok_ex (ses_cb_t *scb, typ_def_t *typdef, ncx_btype_t btyp, const xmlChar *strval, ncx_errinfo_t **errinfo, boolean logerrors)
 retrieve the YANG custom error info if any (extended) More...
 
status_t val_string_ok_ex2 (ses_cb_t *scb, typ_def_t *typdef, ncx_btype_t btyp, const xmlChar *strval, ncx_errinfo_t **errinfo, boolean logerrors, boolean is_defval)
 retrieve the YANG custom error info if any More...
 
status_t val_list_ok (typ_def_t *typdef, ncx_btype_t btyp, ncx_list_t *list)
 Check a list to make sure the all the strings are valid based on the specified typdef. More...
 
status_t val_list_ok_errinfo (typ_def_t *typdef, ncx_btype_t btyp, ncx_list_t *list, ncx_errinfo_t **errinfo)
 Check a list to make sure the all the strings are valid based on the specified typdef. More...
 
status_t val_enum_ok (typ_def_t *typdef, const xmlChar *enumval, int32 *retval, const xmlChar **retstr)
 Check an enumerated integer string to make sure the value is valid based on the specified typdef. More...
 
status_t val_bit_ok (typ_def_t *typdef, const xmlChar *bitname, uint32 *position)
 Check a bit name is valid for the typedef. More...
 
status_t val_idref_ok (typ_def_t *typdef, const xmlChar *qname, xmlns_id_t nsid, const xmlChar **name, ncx_identity_t **id)
 Check if an identityref QName is valid for the typedef. More...
 
status_t val_idref_ok_ex (typ_def_t *typdef, const xmlChar *qname, xmlns_id_t nsid, boolean is_json, ncx_module_t *impmod, boolean or_self, const xmlChar **name, ncx_identity_t **id)
 Check if an identityref QName is valid for the typedef. More...
 
status_t val_parse_idref (ncx_module_t *mod, const xmlChar *qname, xmlns_id_t *nsid, const xmlChar **name, ncx_identity_t **id)
 Parse a CLI BASED identityref QName into its various parts. More...
 
status_t val_range_ok (typ_def_t *typdef, ncx_btype_t btyp, const ncx_num_t *num)
 Check a number to see if it is in range or not Could be a number or size range. More...
 
status_t val_range_ok_errinfo (typ_def_t *typdef, ncx_btype_t btyp, const ncx_num_t *num, ncx_errinfo_t **errinfo)
 Check a number to see if it is in range or not; get errinfo Could be a number or size range. More...
 
status_t val_pattern_ok (typ_def_t *typdef, const xmlChar *strval)
 Check a string against all the patterns in a big AND expression. More...
 
status_t val_pattern_ok_errinfo (typ_def_t *typdef, const xmlChar *strval, ncx_errinfo_t **errinfo)
 Check a string against all the patterns in a big AND expression Get errinfo if any. More...
 
status_t val_simval_ok (typ_def_t *typdef, const xmlChar *simval)
 check any simple type to see if it is valid, but do not retrieve the value; used to check the default parameter for example More...
 
status_t val_simval_ok_errinfo (typ_def_t *typdef, const xmlChar *simval, ncx_errinfo_t **errinfo)
 check any simple type to see if it is valid, but do not retrieve the value; used to check the default parameter for example More...
 
status_t val_simval_ok_ex (typ_def_t *typdef, const xmlChar *simval, ncx_errinfo_t **errinfo, ncx_module_t *mod)
 check any simple type to see if it is valid, but do not retrieve the value; used to check the default parameter for example More...
 
status_t val_simval_ok_max (typ_def_t *typdef, const xmlChar *simval, ncx_errinfo_t **errinfo, ncx_module_t *mod, boolean logerrors)
 check any simple type to see if it is valid, but do not retrieve the value; used to check the default parameter for example More...
 
status_t val_simval_ok_max2 (typ_def_t *typdef, const xmlChar *simval, ncx_errinfo_t **errinfo, ncx_module_t *mod, boolean logerrors, boolean nocond)
 check any simple type to see if it is valid, but do not retrieve the value; used to check the default parameter for example More...
 
status_t val_simval_ok_max3 (typ_def_t *typdef, const xmlChar *simval, ncx_errinfo_t **errinfo, ncx_module_t *mod, boolean logerrors, boolean nocond, boolean is_defval)
 check any simple type to see if it is valid, but do not retrieve the value; used to check the default parameter for example More...
 
status_t val_union_ok (typ_def_t *typdef, const xmlChar *strval, val_value_t *retval)
 Check a union to make sure the string is valid based on the specified typdef, and convert the string to an NCX internal format. More...
 
status_t val_union_ok_errinfo (typ_def_t *typdef, const xmlChar *strval, val_value_t *retval, ncx_errinfo_t **errinfo)
 Check a union to make sure the string is valid based on the specified typdef, and convert the string to an NCX internal format. More...
 
status_t val_union_ok_ex (typ_def_t *typdef, const xmlChar *strval, val_value_t *retval, ncx_errinfo_t **errinfo, ncx_module_t *mod, typ_def_t **match_typdef)
 Check a union to make sure the string is valid based on the specified typdef, and convert the string to an NCX internal format. More...
 
status_t val_union_ok_binary (typ_def_t *typdef, const xmlChar *binstr, uint32 binstrlen, val_value_t *retval, ncx_errinfo_t **errinfo, typ_def_t **match_typdef)
 Check a union to make sure the buffer is valid based on the specified typdef, and convert the buffer to an NCX internal format. More...
 
status_t val_union_ok_full (typ_def_t *typdef, const xmlChar *strval, val_value_t *contextval, val_value_t *rootval, val_value_t *retval, ncx_errinfo_t **errinfo)
 Check a union to make sure the string is valid based on the specified typdef, and convert the string to an NCX internal format. More...
 
dlq_hdr_t * val_get_metaQ (val_value_t *val)
 Get the meta Q header for the value. More...
 
val_value_t * val_get_first_meta (dlq_hdr_t *queue)
 Get the first metaQ entry from the specified Queue. More...
 
val_value_t * val_get_first_meta_val (val_value_t *val)
 Get the first metaQ entry from the specified Queue. More...
 
val_value_t * val_get_next_meta (val_value_t *curnode)
 Get the next metaQ entry from the specified entry. More...
 
boolean val_meta_empty (val_value_t *val)
 Check if the metaQ is empty for the value node. More...
 
val_value_t * val_find_meta (val_value_t *val, xmlns_id_t nsid, const xmlChar *name)
 Get the corresponding meta data node. More...
 
boolean val_meta_match (val_value_t *val, val_value_t *metaval)
 Return true if the corresponding attribute exists and has the same value. More...
 
uint32 val_metadata_inst_count (val_value_t *val, xmlns_id_t nsid, const xmlChar *name)
 Get the number of instances of the specified attribute. More...
 
void val_dump_value (val_value_t *val, int32 startindent, log_debug_t lvl)
 Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (see ncx/conf.h) More...
 
void val_dump_value_ex (val_value_t *val, int32 startindent, ncx_display_mode_t display_mode, log_debug_t lvl)
 Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (see ncx/conf.h) More...
 
void val_dump_alt_value (val_value_t *val, int32 startindent, log_debug_t lvl)
 Printf the specified val_value_t struct to the alternate logfile Uses conf file format (see ncx/conf.h) More...
 
void val_stdout_value (val_value_t *val, int32 startindent, log_debug_t lvl)
 Printf the specified val_value_t struct to stdout Uses conf file format (see ncx/conf.h) More...
 
void val_stdout_value_ex (val_value_t *val, int32 startindent, ncx_display_mode_t display_mode, log_debug_t lvl)
 Printf the specified val_value_t struct to stdout Uses conf file format (see ncx/conf.h) More...
 
void val_dump_value_max (val_value_t *val, int32 startindent, int32 indent_amount, val_dumpvalue_mode_t dumpmode, ncx_display_mode_t display_mode, boolean with_meta, boolean configonly, log_debug_t lvl)
 Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (see ncx/conf.h) More...
 
void val_dump_value_full (val_value_t *val, int32 startindent, int32 indent_amount, val_dumpvalue_mode_t dumpmode, ncx_display_mode_t display_mode, boolean with_meta, boolean configonly, boolean conf_mode, boolean expand_varexpr, log_debug_t lvl, logfns_t *overrideOutput)
 Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (see ncx/conf.h) More...
 
void val_dump_value_full2 (val_value_t *val, int32 startindent, int32 indent_amount, val_dumpvalue_mode_t dumpmode, ncx_display_mode_t display_mode, boolean with_meta, boolean configonly, boolean conf_mode, boolean expand_varexpr, boolean withdef, log_debug_t lvl, logfns_t *overrideOutput)
 Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (see ncx/conf.h) More...
 
status_t val_set_string (val_value_t *val, const xmlChar *valname, const xmlChar *valstr)
 set a generic string using the builtin string typdef Set an initialized val_value_t as a simple type namespace set to 0 !!! use after calling val_new_value More...
 
status_t val_set_string2 (val_value_t *val, const xmlChar *valname, typ_def_t *typdef, const xmlChar *valstr, uint32 valstrlen)
 set a string with any typdef Set an initialized val_value_t as a simple type namespace set to 0 !!! More...
 
status_t val_set_binary (const xmlChar *valstr, uint32 valstrlen, val_value_t *val)
 set and decode base64 value. More...
 
status_t val_reset_empty (val_value_t *val)
 Recast an already initialized value as an NCX_BT_EMPTY clean a value and set it to empty type used by yangcli to delete leafs. More...
 
status_t val_set_simval (val_value_t *val, typ_def_t *typdef, xmlns_id_t nsid, const xmlChar *valname, const xmlChar *valstr)
 set any simple value with any typdef Set an initialized val_value_t as a simple type More...
 
status_t val_set_simval_str (val_value_t *val, typ_def_t *typdef, xmlns_id_t nsid, const xmlChar *valname, uint32 valnamelen, const xmlChar *valstr)
 set any simple value with any typdef, and a counted string Set an initialized val_value_t as a simple type More...
 
status_t val_set_simval_binary (val_value_t *val, const xmlChar *binstr, uint32 binstrlen)
 set a binary type either in a type binary, or type within 1 or more unions More...
 
status_t val_set_simval_max (val_value_t *val, typ_def_t *typdef, xmlns_id_t nsid, const xmlChar *valname, uint32 valnamelen, const xmlChar *valstr, uint32 valstrlen)
 set any simple value with any typdef, and a counted string Set an initialized val_value_t as a simple type More...
 
val_value_t * val_make_simval (typ_def_t *typdef, xmlns_id_t nsid, const xmlChar *valname, const xmlChar *valstr, status_t *res)
 Create and set a val_value_t as a simple type same as val_set_simval, but malloc the value first. More...
 
val_value_t * val_make_string (xmlns_id_t nsid, const xmlChar *valname, const xmlChar *valstr)
 Malloc and set a val_value_t as a generic NCX_BT_STRING namespace set to 0 !!! More...
 
val_value_t * val_make_binary (xmlns_id_t nsid, const xmlChar *valname, const xmlChar *valstr, uint32 valstrlen)
 Malloc and set a val_value_t as a NCX_BT_BINARY type Uses the generic binary object from ncx_get_gen_binary. More...
 
status_t val_merge (const val_value_t *src, val_value_t *dest)
 Merge src val into dest val (! MUST be same type !) Any meta vars in src are also merged into dest. More...
 
val_value_t * val_clone (const val_value_t *val)
 Clone a specified val_value_t struct and sub-trees. More...
 
val_value_t * val_clone2 (const val_value_t *val)
 Clone a specified val_value_t struct and sub-trees but not the editvars. More...
 
val_value_t * val_clone_config_data (const val_value_t *val, status_t *res)
 Clone a specified val_value_t struct and sub-trees with config=true only. More...
 
val_value_t * val_clone_config_save (const val_value_t *val, status_t *res)
 Clone a specified val_value_t struct and sub-trees filter for config only for saving to NVRAM. More...
 
status_t val_replace (val_value_t *val, val_value_t *copy)
 Replace a specified val_value_t struct and sub-trees. More...
 
status_t val_replace_str (const xmlChar *str, uint32 stringlen, val_value_t *copy)
 Replace a specified val_value_t struct with a string type. More...
 
status_t val_fast_replace_string (const xmlChar *str, uint32 stringlen, val_value_t *copy)
 Replace a specified val_value_t struct with a string type Reuse everything – just set the val->v.str field. More...
 
void val_replace_stringval (val_value_t *val, const xmlChar *str)
 Replace the string value, not the entire value. More...
 
void val_add_child (val_value_t *child, val_value_t *parent)
 Add a child (deprecated: use val_child_add instead) More...
 
void val_add_child_sorted (val_value_t *child, val_value_t *parent)
 Add a child value node to a parent value node in the proper place (deprecated: use val_child_add instead) More...
 
void val_insert_child (val_value_t *child, val_value_t *current, val_value_t *parent)
 Insert a child value node to a parent value node. More...
 
void val_remove_child (val_value_t *child)
 Remove a child value node from its parent value node. More...
 
void val_swap_child (val_value_t *newchild, val_value_t *curchild)
 Swap a child value node with a current value node. More...
 
val_value_t * val_first_child_match (const val_value_t *parent, const val_value_t *child)
 Get the first instance of the corresponding child node. More...
 
val_value_t * val_first_child_match_fast (const val_value_t *parent, const val_value_t *child, val_value_t *lastmatch)
 Get the first instance of the corresponding child node Object pointers must be from the same tree!!! More...
 
val_value_t * val_next_child_match (val_value_t *parent, val_value_t *child, val_value_t *curmatch)
 Get the next instance of the corresponding child node. More...
 
val_value_t * val_next_child_same (val_value_t *curchild)
 Get the next instance of the corresponding child node. More...
 
val_value_t * val_get_first_child (const val_value_t *parent)
 Get the first child node. More...
 
val_value_t * val_get_next_child (const val_value_t *curchild)
 Get the next child node. More...
 
val_value_t * val_get_first_terminal_child (const val_value_t *parent)
 Get the child node only if obj_is_terminal(val->obj) is true. More...
 
val_value_t * val_get_next_terminal_child (const val_value_t *curchild)
 Get the next child node only if obj_is_terminal(val->obj) is true. More...
 
val_value_t * val_find_child (const val_value_t *parent, const xmlChar *modname, const xmlChar *childname)
 Find the first instance of the specified child node. More...
 
val_value_t * val_find_child_fast (const val_value_t *parent, xmlns_id_t nsid, const xmlChar *childname)
 Find the first instance of the specified child node. More...
 
val_value_t * val_find_child_obj (const val_value_t *parent, const struct obj_template_t_ *chobj)
 Find the first instance of the specified child node Use the object template pointer to match the object. More...
 
val_value_t * val_find_child_que (const dlq_hdr_t *childQ, xmlns_id_t nsid, const xmlChar *childname)
 Find the first instance of the specified child node in the specified child Q. More...
 
val_value_t * val_match_child (const val_value_t *parent, const xmlChar *modname, const xmlChar *childname)
 Match the first instance of the specified child node. More...
 
val_value_t * val_match_child_count (const val_value_t *parent, const xmlChar *modname, const xmlChar *childname, uint32 *matchcount)
 Match the first instance of the specified child node Return the total number of matches. More...
 
val_value_t * val_find_next_child (const val_value_t *parent, const xmlChar *modname, const xmlChar *childname, const val_value_t *curchild)
 Find the next instance of the specified child node. More...
 
val_value_t * val_find_next_child_fast (const val_value_t *parent, const val_value_t *curchild)
 Find the next instance of the specified child node. More...
 
val_value_t * val_first_child_name (val_value_t *parent, const xmlChar *name)
 Get the first corresponding child node instance, by name find first – really for resolve index function. More...
 
val_value_t * val_first_child_qname (val_value_t *parent, xmlns_id_t nsid, const xmlChar *name)
 Get the first corresponding child node instance, by QName. More...
 
val_value_t * val_next_child_qname (val_value_t *parent, xmlns_id_t nsid, const xmlChar *name, val_value_t *curchild)
 Get the next corresponding child node instance, by QName. More...
 
val_value_t * val_first_child_string (val_value_t *parent, const xmlChar *name, const xmlChar *strval)
 find first name value pair More...
 
uint32 val_child_cnt (val_value_t *parent)
 Get the number of child nodes present. More...
 
uint32 val_child_inst_cnt (const val_value_t *parent, const xmlChar *modname, const xmlChar *name)
 Get the corresponding child instance count by name get instance count – for instance qualifer checking. More...
 
uint32 val_get_child_inst_id (const val_value_t *parent, const val_value_t *child)
 Get the instance ID for this child node within the parent context. More...
 
uint32 val_liststr_count (const val_value_t *val)
 Get the number of strings in the list type. More...
 
boolean val_index_match (const val_value_t *val1, const val_value_t *val2)
 Check 2 val_value structs for the same instance ID. More...
 
int val_index_compare (const val_value_t *val1, const val_value_t *val2)
 Check 2 val_value structs for the same instance ID. More...
 
int32 val_compare_max (const val_value_t *val1, const val_value_t *val2, boolean configonly, boolean childonly, boolean editing)
 Compare 2 val_value_t struct value contents. More...
 
int32 val_compare_max_def (const val_value_t *val1, const val_value_t *val2, boolean configonly, boolean childonly, boolean editing, boolean ignore_defaults)
 Compare 2 val_value_t struct value contents. More...
 
int32 val_compare_ex (const val_value_t *val1, const val_value_t *val2, boolean configonly)
 Compare 2 val_value_t struct value contents Check all or config only. More...
 
int32 val_compare (const val_value_t *val1, const val_value_t *val2)
 Compare 2 val_value_t struct value contents. More...
 
int32 val_compare_to_string (const val_value_t *val1, const xmlChar *strval2, status_t *res)
 Compare a val_value_t struct value contents to a string. More...
 
int32 val_compare_to_string_len (const val_value_t *val1, const xmlChar *strval2, uint32 strval2len, status_t *res)
 Compare a val_value_t struct value contents to a string Provide a max-length to compare. More...
 
int32 val_compare_for_replace (const val_value_t *val1, const val_value_t *val2)
 Compare 2 val_value_t struct value contents for the nc:operation=replace procedures. More...
 
int32 val_compare_for_edit (const val_value_t *val1, const val_value_t *val2, boolean ismerge)
 Compare 2 val_value_t struct value contents from an editing POV; compare for merge or delete! More...
 
int32 val_compare_as_string (const val_value_t *val1, const val_value_t *val2, status_t *res)
 Compare 2 val_value_t structs Convert each value to a string and compare as strings Needed to compare a value if a UNION type is used. More...
 
status_t val_sprintf_simval_nc (xmlChar *buff, const val_value_t *val, uint32 *len)
 Sprintf the xmlChar string NETCONF representation of a simple value. More...
 
status_t val_sprintf_simval_nc_ex (xmlChar *buff, const val_value_t *val, boolean url_encode, uint32 *len)
 Sprintf the xmlChar string NETCONF representation of a simple value. More...
 
xmlChar * val_make_sprintf_string (const val_value_t *val)
 Malloc a buffer and then sprintf the xmlChar string NETCONF representation of a simple value. More...
 
status_t val_resolve_scoped_name (val_value_t *val, const xmlChar *name, val_value_t **chval)
 Find the scoped identifier in the specified complex value. More...
 
ncx_iqual_t val_get_iqualval (const val_value_t *val)
 Get the effective instance qualifier value for this value. More...
 
boolean val_duplicates_allowed (val_value_t *val)
 Determine if duplicates are allowed for the given val type The entire definition chain is checked to see if a 'no-duplicates'. More...
 
boolean val_has_content (const val_value_t *val)
 Determine if there is a value or any child nodes for this val. More...
 
boolean val_has_content_ex (const val_value_t *val)
 Determine if there is a value or any child nodes for this val. More...
 
boolean val_has_index (const val_value_t *val)
 Determine if this value has an index. More...
 
val_index_t * val_get_first_index (const val_value_t *val)
 Get the first index entry, if any for this value node. More...
 
val_index_t * val_get_next_index (const val_index_t *valindex)
 Get the next index entry, if any for this value node. More...
 
uint32 val_get_index_count (const val_value_t *val)
 Get the number of index nodes in this val. More...
 
status_t val_parse_meta (ses_cb_t *scb, typ_def_t *typdef, xml_attr_t *attr, val_value_t *retval)
 Parse the metadata descriptor against the typdef Check only that the value is ok, not instance count. More...
 
void val_set_extern (val_value_t *val, xmlChar *fname)
 Setup an NCX_BT_EXTERN value. More...
 
void val_set_intern (val_value_t *val, xmlChar *intbuff)
 Setup an NCX_BT_INTERN value. More...
 
boolean val_fit_oneline (const val_value_t *val, uint32 linesize, boolean isxml)
 Check if the XML encoding for the specified val_value_t should take one line or more than one line. More...
 
boolean val_create_allowed (const val_value_t *val)
 Check if the specified value is allowed to have a create edit-config operation attribute. More...
 
boolean val_delete_allowed (const val_value_t *val)
 Check if the specified value is allowed to have a delete edit-config operation attribute. More...
 
boolean val_is_config_data (const val_value_t *val)
 Check if the specified value is a config DB object instance. More...
 
boolean val_is_config_save (const val_value_t *val)
 Check if the specified value is a config DB object instance Check for config-save mode. More...
 
boolean val_is_virtual (const val_value_t *val)
 Check if the specified value is a virtual value such that a 'get' callback function is required to access the real value contents. More...
 
val_value_t * val_get_virtual_value (ses_cb_t *scb, val_value_t *val, status_t *res)
 Get the value of a virtual value node. More...
 
boolean val_is_default (val_value_t *val)
 Check if the specified value is set to the YANG default value. More...
 
boolean val_is_real (const val_value_t *val)
 Check if the specified value is a real value. More...
 
xmlns_id_t val_get_parent_nsid (const val_value_t *val)
 Try to get the parent namespace ID. More...
 
uint32 val_instance_count (val_value_t *val, const xmlChar *modname, const xmlChar *objname)
 Count the number of instances of the specified object name in the parent value struct. More...
 
uint32 val_instance_count_fast (val_value_t *val, xmlns_id_t nsid, const xmlChar *objname, val_value_t **firstval)
 Count the number of instances of the specified object name in the parent value struct. More...
 
uint32 val_instance_count_fast2 (val_value_t *val, val_value_t *startval)
 Count the number of instances of the specified object name in the parent value struct. More...
 
void val_set_extra_instance_errors (val_value_t *val, const xmlChar *modname, const xmlChar *objname, uint32 maxelems)
 mark ERR_NCX_EXTRA_VAL_INST errors for nodes > 'maxelems' More...
 
boolean val_need_quotes (const xmlChar *str)
 Check if a string needs to be quoted to be output within a conf file or ncxcli stdout output. More...
 
boolean val_all_whitespace (const xmlChar *str)
 Check if a string is all whitespace. More...
 
boolean val_any_whitespace (const xmlChar *str, uint32 len)
 Check if a string has any whitespace chars. More...
 
boolean val_match_metaval (const xml_attr_t *attr, xmlns_id_t nsid, const xmlChar *name)
 Match the specific attribute value and namespace ID. More...
 
boolean val_get_dirty_flag (const val_value_t *val)
 Get the dirty flag for this value node. More...
 
boolean val_get_subtree_dirty_flag (const val_value_t *val)
 Get the subtree dirty flag for this value node. More...
 
void val_set_subtree_dirty_up (val_value_t *val)
 Set the dirty flag for this value node. More...
 
void val_set_dirty_flag (val_value_t *val, boolean clear_def)
 Set the dirty flag for this value node. More...
 
void val_set_child_deleted_flag (val_value_t *val)
 Set the child_deleted flag for this value node. More...
 
boolean val_get_child_deleted_flag (val_value_t *val)
 Get the child_deleted flag for this value node. More...
 
void val_clear_dirty_flag (val_value_t *val, time_t *timestamp, ncx_transaction_id_t txid, boolean is_delete, boolean do_clear_default)
 Clear the dirty flag for this value node. More...
 
boolean val_dirty_subtree (const val_value_t *val)
 Check the dirty or subtree_dirty flag. More...
 
void val_clean_tree (val_value_t *val)
 Clear the dirty flag and the operation for all nodes within a value struct. More...
 
uint32 val_get_nest_level (val_value_t *val)
 Get the next level of the value. More...
 
val_value_t * val_get_first_leaf (val_value_t *val)
 Get the first leaf or leaflist node in the specified value tree. More...
 
const xmlChar * val_get_mod_name (const val_value_t *val)
 Get the module name associated with this value node. More...
 
const xmlChar * val_get_mod_prefix (const val_value_t *val)
 Get the module prefix associated with this value node. More...
 
xmlns_id_t val_get_nsid (const val_value_t *val)
 Get the namespace ID for the specified value node. More...
 
void val_change_nsid (val_value_t *val, xmlns_id_t nsid)
 Change the namespace ID for a value node and all its descendants. More...
 
void val_change_nsid2 (val_value_t *val, xmlns_id_t nsid)
 Change the namespace ID for the descendant nodes of the value node. More...
 
void val_change_nsid3 (val_value_t *val, xmlns_id_t nsid)
 Change the namespace ID for a value node only. More...
 
val_value_t * val_make_from_insertxpcb (val_value_t *sourceval, status_t *res)
 Make a val_value_t for a list, with the child nodes for key leafs, specified in the key attribute string given to the insert operation. More...
 
val_unique_t * val_new_unique (void)
 Malloc and initialize the fields in a val_unique_t. More...
 
void val_free_unique (val_unique_t *valuni)
 Clean and free a val_unique_t struct. More...
 
const typ_def_t * val_get_typdef (const val_value_t *val)
 Get the typdef field for a value struct. More...
 
boolean val_set_by_default (const val_value_t *val)
 Check if the value was set by val_add_defaults. More...
 
boolean val_has_withdef_default (const val_value_t *val)
 Check if the value contained the wd:default attribute. More...
 
void val_set_withdef_default (val_value_t *val)
 Set the value flags as having the wd:default attribute. More...
 
boolean val_is_metaval (const val_value_t *val)
 Check if the value is a meta-val (XML attribute) More...
 
void val_move_children (val_value_t *srcval, val_value_t *destval)
 Move all the child nodes from src to dest Source and dest must both be containers! More...
 
void val_move_nonconfig_children (val_value_t *srcval, val_value_t *destval)
 Move all the config=false child nodes from src to dest Source and dest must both be containers! More...
 
status_t val_cvt_generic (val_value_t *val)
 Convert all the database object pointers to generic object pointers. More...
 
status_t val_set_pcookie (val_value_t *val, void *pcookie)
 Set the SIL pointer cookie in the editvars for the specified value node. More...
 
status_t val_set_icookie (val_value_t *val, int icookie)
 Set the SIL integer cookie in the editvars for the specified value node. More...
 
void * val_get_pcookie (val_value_t *val)
 Get the SIL pointer cookie in the editvars for the specified value node. More...
 
int val_get_icookie (val_value_t *val)
 Get the SIL integer cookie in the editvars for the specified value node. More...
 
status_t val_delete_default_leaf (val_value_t *val)
 Do the internal work to setup a delete of a default leaf. More...
 
status_t val_delete_default_leaf_list (val_value_t *val)
 Do the internal work to convert a leaf-list to its YANG default value(s) More...
 
void val_force_empty (val_value_t *val)
 Convert a simple node to an empty type. More...
 
status_t val_delete_default_npcon (val_value_t *val)
 Do the internal work to convert an NP-container to its subtree of YANG default values. More...
 
void val_move_fields_for_xml (val_value_t *srcval, val_value_t *destval, boolean movemeta)
 Move or copy the internal fields from one val to another for xml_wr purposes. More...
 
void val_move_metadata (val_value_t *srcval, val_value_t *destval)
 Move the attribute fields from one val to another for xml_wr purposes. More...
 
val_index_t * val_get_first_key (val_value_t *val)
 Get the first key record if this is a list with a key-stmt. More...
 
val_index_t * val_get_last_key (val_value_t *val)
 Get the last key record if this is a list with a key-stmt. More...
 
val_index_t * val_get_next_key (val_index_t *curkey)
 Get the next key record if this is a list with a key-stmt. More...
 
val_index_t * val_get_prev_key (val_index_t *curkey)
 Get the previous key record if this is a list with a key-stmt. More...
 
void val_remove_key (val_value_t *keyval)
 Remove a key pointer because the key is invalid Free the key pointer. More...
 
val_value_t * val_new_deleted_value (void)
 Malloc and initialize the fields in a val_value_t to be used as a deleted node marker. More...
 
status_t val_new_editvars (val_value_t *val)
 Malloc and initialize the val->editvars field. More...
 
void val_free_editvars (val_value_t *val)
 Free the editing variables for the value node. More...
 
void val_free_solo_editvars (val_editvars_t *editvars)
 Free the editing variables removed from a val_value_t. More...
 
boolean val_all_np_containers (val_value_t *val)
 Check if the value tree is all NP containers and nothing else. More...
 
status_t val_sprintf_etag (val_value_t *val, xmlChar *buff, int32 buffsize)
 Write the Entity Tag for the value to the specified buffer. More...
 
time_t * val_get_last_modified (val_value_t *val)
 Get the last_modified field. More...
 
void val_force_default (val_value_t *val)
 Set a node created by the server as a default node. More...
 
void val_set_all_tags (val_value_t *val, time_t *timestamp, ncx_transaction_id_t txid)
 Set the etag and last_modified field for the node and all config sub-children. More...
 
const xmlChar * val_get_owner (val_value_t *val)
 Get the owner string for the specified value node. More...
 
ncx_owner_id_t val_get_owner_id (val_value_t *val)
 Get the owner ID for the specified value node. More...
 
boolean val_need_owner_string (val_value_t *val)
 Check if the owner string is needed when generating ywx:owner attrs. More...
 
void val_delete_children (val_value_t *val)
 Check if the value is a complex type and if so then delete all child nodes. More...
 
void val_clean_value (val_value_t *val)
 Clean a static val_value_t struct. More...
 
boolean val_find_bit (val_value_t *val, const xmlChar *bitname)
 Find the specified bit name in the NCX_BT_BITS value. More...
 
boolean val_has_children (const val_value_t *val)
 Determine if there are any child nodes for this val. More...
 
status_t val_add_test_valindex (val_value_t *parentval, val_value_t *keyval)
 Make a dummy val_index_t for the getcg acmtest. More...
 
const xmlChar * val_get_yang_typename (val_value_t *val)
 Get the YANG type name for this value node if there is one. More...
 
void val_set_force_config (val_value_t *val, boolean is_config)
 Set the force config flags for the object. More...
 
void val_clear_defvalset_flag (val_value_t *val)
 Clear the defvalset flag so the server will re-check this node the next time the client does a get request. More...
 
status_t val_clone_valQ (dlq_hdr_t *valQ, dlq_hdr_t *return_valQ)
 Clone all values in 1 valQ into the return_valQ. More...
 
void val_clean_valQ (dlq_hdr_t *valQ)
 Clean a queue of val_value_t. More...
 
boolean val_is_value_set (val_value_t *val)
 Check if a value has been set by a client It has to be initialized and not set by default to return true. More...
 
uint32 val_url_encode_string (const xmlChar *str, xmlChar *buff)
 Fill in a buffer with the URL-encoded string. More...
 
void val_convert_any_to_container (val_value_t *val)
 Convert the extern parameter to a container instead of extern. More...
 
void val_clean_index_chain (val_value_t *val)
 Clean out any indexQ entries. More...
 
boolean val_pattern_match (const xmlRegexpPtr pattern, const xmlChar *strval)
 Check the specified string against the specified pattern. More...
 
boolean val_ocpattern_match (const regex_t *ocpattern, const xmlChar *strval)
 Check the specified string against the specified pattern Use POSIX format for openconfig pattern. More...
 
boolean val_idref_derived_from (ncx_module_t *impmod, val_value_t *testval, const xmlChar *qname, boolean or_self)
 Check the specified valnode is derived from the specified identity. More...
 
status_t val_set_sil_priority (val_value_t *val, uint8 silprio)
 Set the secondary SIL priority. More...
 
uint8 val_get_sil_priority (val_value_t *val)
 Get the secondary SIL priority; zero if not found. More...
 
const xmlChar * val_find_bit_name (val_value_t *val, uint32 bitpos)
 Find the specified bit name in the NCX_BT_BITS value. More...
 
const xmlChar * val_find_enum_name (val_value_t *val, int32 enunum)
 Find the specified enum name for the value field that matches for NCX_BT_ENUM value. More...
 
const xmlChar * val_find_enum_name2 (ncx_btype_t btyp, typ_def_t *typdef, int32 enunum)
 Find the specified enum name for the value field that matches for NCX_BT_ENUM value Do not use val_value value. More...
 
void val_mark_deleted (val_value_t *val)
 mark the value node as deleted May have to really delete from val_tree More...
 
void val_mark_undeleted (val_value_t *val)
 mark the value node as un-deleted More...
 
boolean val_has_conditional_value (val_value_t *val)
 Check if the value is conditional. More...
 
val_value_t * val_convert_leafref (const val_value_t *val)
 Convert a value of type NCX_BT_LEAFREF to the value that the final leafref is pointing at. More...
 
int32 val_compare_for_topreplace (const val_value_t *val1, const val_value_t *val2)
 Compare 2 val_value_t struct value contents. More...
 
int32 val_compare_for_topreplace_simple (const val_value_t *val1, const val_value_t *val2)
 Compare 2 val_value_t struct value contents. More...
 
boolean val_has_complex_child (const val_value_t *val)
 Check if the value has complex children nodes. More...
 
status_t val_add_meta (val_value_t *metaval, val_value_t *val)
 Add a meta value to a value node. More...
 
val_value_t * val_find_root (val_value_t *val)
 Find the root value node or top-val if no ncx:root found. More...
 
status_t val_set_canonical (val_value_t *val)
 Invoke the canonical callback for the data type (if any) More...
 
typ_def_t * val_get_leafref_typdef (val_value_t *val)
 Return a base typedef of type NCX_BT_LEAFREF. More...
 
boolean val_ascendant_compare (val_value_t *val1, val_value_t *val2)
 Special compare function for edit compares. More...
 
const xmlChar * val_get_dname (const val_value_t *val)
 Get the dname field if set; NULL if not set. More...
 
status_t val_set_dname (val_value_t *val, const xmlChar *dname)
 Set the dname field. More...
 
status_t val_set_dname2 (val_value_t *val, const xmlChar *dname, uint32 dnamelen)
 Set the dname field. More...
 
status_t val_new_extra (val_value_t *val)
 Create the val_extra struct if it does not exist. More...
 
const xmlChar * val_get_varexpr (const val_value_t *val)
 Get the varexpr field if set; NULL if not set. More...
 
status_t val_set_varexpr (val_value_t *val, const xmlChar *varexpr)
 Set the varexpr field in the value node. More...
 
void val_clear_varexpr (val_value_t *val)
 Clear the varexpr field in the value node. More...
 
void val_set_wildcard_string (val_value_t *val)
 Set the value as a wildcard string. More...
 
status_t val_copy_editvars (const val_value_t *val, val_value_t *copy)
 Copy the editvars struct contents into the value node. More...
 
status_t val_set_skip_sil_partial (val_value_t *val)
 Set the skip_sil_partial flag for this value in an edit. More...
 
boolean val_get_skip_sil_partial (const val_value_t *val)
 Get the skip_sil_partial flag. More...
 

Detailed Description

Core data access functions to create and use YANG data. Some functions are used internally but most can be used by SIL and SIL-SA code. All functionality is the same on SIL and SIL-SA platforms.

Macro Definition Documentation

◆ val_is_wildcard_string

#define val_is_wildcard_string (   V)    (((V)->flags & VAL_FL_WILDCARD) ? TRUE : FALSE)

Check if the value is a wildcard string.

Parameters
Vvalue to check
Returns
TRUE if WILDCARD_STRING node

Function Documentation

◆ val_add_child()

void val_add_child ( val_value_t *  child,
val_value_t *  parent 
)

Add a child (deprecated: use val_child_add instead)

This function calls SET_ERROR if any errors in val_child_add Do not use in the server anymore!

Add a child value node to a parent value node Simply makes a new last child!!! Does not check siblings!!! Relies on val_set_canonical_order

To modify existing extries, use val_add_child_sorted instead!!

Parameters
childnode to store in the parent
parentcomplex value node with a childQ
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_add_child_sorted()

void val_add_child_sorted ( val_value_t *  child,
val_value_t *  parent 
)

Add a child value node to a parent value node in the proper place (deprecated: use val_child_add instead)

Parameters
childnode to store in the parent
parentcomplex value node with a childQ
Here is the call graph for this function:

◆ val_add_meta()

status_t val_add_meta ( val_value_t *  metaval,
val_value_t *  val 
)

Add a meta value to a value node.

Parameters
metavalnode to store in the parent
valcomplex value node with a metaQ
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_add_test_valindex()

status_t val_add_test_valindex ( val_value_t *  parentval,
val_value_t *  keyval 
)

Make a dummy val_index_t for the getcg acmtest.

Parameters
parentvalparent to add the val_index
keyvalkeyval to use
Returns
status
Here is the call graph for this function:

◆ val_all_np_containers()

boolean val_all_np_containers ( val_value_t *  val)

Check if the value tree is all NP containers and nothing else.

This is needed by yangcli to prune these edits from the config mode editing process

Parameters
valval_value_t data structure to check
Returns
TRUE if all NP containers
FALSE if any descendant-or-self non-NP containers found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_all_whitespace()

boolean val_all_whitespace ( const xmlChar *  str)

Check if a string is all whitespace.

Parameters
strstring to check
Returns
TRUE if string is all whitespace or empty length
FALSE if non-whitespace char found
Here is the caller graph for this function:

◆ val_any_whitespace()

boolean val_any_whitespace ( const xmlChar *  str,
uint32  len 
)

Check if a string has any whitespace chars.

Parameters
strstring to check
lenlength of str to check
Returns
TRUE if string has any whitespace
FALSE if no whitespace chars found
Here is the caller graph for this function:

◆ val_ascendant_compare()

boolean val_ascendant_compare ( val_value_t *  val1,
val_value_t *  val2 
)

Special compare function for edit compares.

YPW-1348: Add_Edit API problem in case of identical edit value names from different modules

  Compare 2 val_value_t struct node contents
  1) Check if the current node is the same (do not check children)
  2) Check if all the parents nodes are the same

Does NOT check values, only nodes names and modules

Parameters
val1test node value to compare
val2test node value to compare
Returns
TRUE if the value and all parents are different
FALSE if the val or any of the parents are the same
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_binary_ok_errinfo()

status_t val_binary_ok_errinfo ( typ_def_t *  typdef,
const xmlChar *  strval,
val_value_t *  val,
ncx_errinfo_t **  errinfo 
)

retrieve the YANG custom error info for binary val, if any

Check a binary string to make sure the value is valid base64 if the value came from raw RPC XML, and if its CLI input then do validation as for binary sting Retrieve the configured error info struct if any error

Parameters
typdeftyp_def_t for the designated string type
strvalstring value to check
valdata node that has the binary value
errinfoaddress of return errinfo block (may be NULL)
Return values
*errinfoerror record to use if return error
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_bit_ok()

status_t val_bit_ok ( typ_def_t *  typdef,
const xmlChar *  bitname,
uint32 *  position 
)

Check a bit name is valid for the typedef.

Parameters
typdeftyp_def_t for the designated bits type
bitnamebit name value to check
positionaddress of return bit struct position value
Return values
*positionbit position value
Returns
status
Here is the caller graph for this function:

◆ val_change_nsid()

void val_change_nsid ( val_value_t *  val,
xmlns_id_t  nsid 
)

Change the namespace ID for a value node and all its descendants.

Parameters
valvalue node to change
nsidnew namespace ID to use
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_change_nsid2()

void val_change_nsid2 ( val_value_t *  val,
xmlns_id_t  nsid 
)

Change the namespace ID for the descendant nodes of the value node.

Parameters
valvalue node to change
nsidnew namespace ID to use
Here is the call graph for this function:

◆ val_change_nsid3()

void val_change_nsid3 ( val_value_t *  val,
xmlns_id_t  nsid 
)

Change the namespace ID for a value node only.

Parameters
valvalue node to change
nsidnew namespace ID to use

◆ val_child_cnt()

uint32 val_child_cnt ( val_value_t *  parent)

Get the number of child nodes present.

get number of child nodes present – for choice checking

Parameters
parentparent complex type to check
Returns
the number of child nodes found
Here is the call graph for this function:

◆ val_child_inst_cnt()

uint32 val_child_inst_cnt ( const val_value_t *  parent,
const xmlChar *  modname,
const xmlChar *  name 
)

Get the corresponding child instance count by name get instance count – for instance qualifer checking.

Parameters
parentparent complex type to check
modnamemodule name defining the child (may be NULL)
namechild name to find and count
Returns
the instance count
Here is the call graph for this function:

◆ val_clean_index_chain()

void val_clean_index_chain ( val_value_t *  val)

Clean out any indexQ entries.

Parameters
vallist containing the indexQ to clean
Return values
*val->indexQis cleaned

◆ val_clean_tree()

void val_clean_tree ( val_value_t *  val)

Clear the dirty flag and the operation for all nodes within a value struct.

Parameters
valvalue node to clean
Return values
valand all its child nodes (if any) are cleaned
      val->flags: VAL_FL_DIRTY bit cleared to 0
      val->editop: cleared to OP_EDITOP_NONE
      val->curparent: cleared to NULL
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_clean_valQ()

void val_clean_valQ ( dlq_hdr_t *  valQ)

Clean a queue of val_value_t.

Deque and free with val_free_value

Parameters
valQque of val_value_t to clean and free
Here is the caller graph for this function:

◆ val_clean_value()

void val_clean_value ( val_value_t *  val)

Clean a static val_value_t struct.

Parameters
valvalue node to clean

◆ val_clear_defvalset_flag()

void val_clear_defvalset_flag ( val_value_t *  val)

Clear the defvalset flag so the server will re-check this node the next time the client does a get request.

Parameters
valpointer to the value node to set

◆ val_clear_dirty_flag()

void val_clear_dirty_flag ( val_value_t *  val,
time_t *  timestamp,
ncx_transaction_id_t  txid,
boolean  is_delete,
boolean  do_clear_default 
)

Clear the dirty flag for this value node.

Parameters
valvalue node to clear
timestampnew last-modified timestamp to set
txidtransaction id for this edit
is_deleteTRUE if the descendant nodes of the 'val' node should be skipped (delete or remove operation)
FALSE to stamp the descendant nodes
do_clear_defaultTRUE to clear_default or FALSE to leave VAL_FL_DEFVAL untouched
Here is the call graph for this function:

◆ val_clear_varexpr()

void val_clear_varexpr ( val_value_t *  val)

Clear the varexpr field in the value node.

Parameters
valvalue to clear
Here is the caller graph for this function:

◆ val_clone()

val_value_t* val_clone ( const val_value_t *  val)

Clone a specified val_value_t struct and sub-trees.

Parameters
valvalue to clone
Returns
clone of val, or NULL if a malloc failure
Here is the caller graph for this function:

◆ val_clone2()

val_value_t* val_clone2 ( const val_value_t *  val)

Clone a specified val_value_t struct and sub-trees but not the editvars.

Parameters
val== value to clone
Returns
clone of val, or NULL if a malloc failure

◆ val_clone_config_data()

val_value_t* val_clone_config_data ( const val_value_t *  val,
status_t *  res 
)

Clone a specified val_value_t struct and sub-trees with config=true only.

Filter with the val_is_config_data callback function pass in a config node, such as <config> root will call val_clone_test with the val_is_config_data callback function

Parameters
valconfig data value to clone
resaddress of return status
Return values
*resreturn status
Returns
clone of val, or NULL if a malloc failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_clone_config_save()

val_value_t* val_clone_config_save ( const val_value_t *  val,
status_t *  res 
)

Clone a specified val_value_t struct and sub-trees filter for config only for saving to NVRAM.

Filter with the val_is_config_data callback function pass in a config node, such as <config> root will call clone_test with the val_is_config_data callback function

  DOES NOT CLONE THE EDITVARS!!!!
  DOES NOT CLONE THE DEFAULT NODES!!!!
Parameters
valconfig data value to clone
resaddress of return status
Return values
*resreturn status
Returns
clone of val, or NULL if a malloc failure
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_clone_valQ()

status_t val_clone_valQ ( dlq_hdr_t *  valQ,
dlq_hdr_t *  return_valQ 
)

Clone all values in 1 valQ into the return_valQ.

Parameters
valQsource of val_value_t value queue to clone
return_valQdestination valQ for clones
Return values
return_valQhas nodes added from valQ
Returns
status

◆ val_compare()

int32 val_compare ( const val_value_t *  val1,
const val_value_t *  val2 
)

Compare 2 val_value_t struct value contents.

Handles NCX_CL_BASE and NCX_CL_SIMPLE data classes by comparing the simple value.

Handle NCX_CL_COMPLEX by checking the index if needed and then checking all the child nodes recursively

!!!! Meta-value contents are ignored for this test !!!!

Parameters
val1first value to check
val2second value to check
Returns
compare result
      -1: val1 is less than val2 (if complex just different or error)
       0: val1 is the same as val2
       1: val1 is greater than val2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_compare_as_string()

int32 val_compare_as_string ( const val_value_t *  val1,
const val_value_t *  val2,
status_t *  res 
)

Compare 2 val_value_t structs Convert each value to a string and compare as strings Needed to compare a value if a UNION type is used.

!!!! Meta-value contents are ignored for this test !!!!

Parameters
val1first value to check
val2second value to check
resaddress of return status
Return values
*resreturn status
Returns
compare result
      -1: val1 is less than val2 (if complex just different or error)
       0: val1 is the same as val2
       1: val1 is greater than val2
Here is the call graph for this function:

◆ val_compare_ex()

int32 val_compare_ex ( const val_value_t *  val1,
const val_value_t *  val2,
boolean  configonly 
)

Compare 2 val_value_t struct value contents Check all or config only.

Handles NCX_CL_BASE and NCX_CL_SIMPLE data classes by comparing the simple value.

Handle NCX_CL_COMPLEX by checking the index if needed and then checking all the child nodes recursively

!!!! Meta-value contents are ignored for this test !!!!

Parameters
val1first value to check
val2second value to check
configonlyTRUE to compare config=true nodes only
FALSE to compare all nodes
Returns
compare result
      -1: val1 is less than val2 (if complex just different or error)
       0: val1 is the same as val2
       1: val1 is greater than val2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_compare_for_edit()

int32 val_compare_for_edit ( const val_value_t *  val1,
const val_value_t *  val2,
boolean  ismerge 
)

Compare 2 val_value_t struct value contents from an editing POV; compare for merge or delete!

Check just the nodes present in val1 against val2

!!!! Meta-value contents are ignored for this test !!!!

Parameters
val1first value to check
val2second value to check
ismergeTRUE for a merge operation; FALSE for delete operation
Returns
compare result
      -1: val1 is less than val2 (if complex just different or error)
       0: val1 is the same as val2
       1: val1 is greater than val2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_compare_for_replace()

int32 val_compare_for_replace ( const val_value_t *  val1,
const val_value_t *  val2 
)

Compare 2 val_value_t struct value contents for the nc:operation=replace procedures.

Only check the child nodes to see if the config nodes are the same

!!!! Meta-value contents are ignored for this test !!!!

Parameters
val1new value to check
val2current value to check
Returns
compare result
      -1: val1 is less than val2 (if complex just different or error)
       0: val1 is the same as val2
       1: val1 is greater than val2
Here is the call graph for this function:

◆ val_compare_for_topreplace()

int32 val_compare_for_topreplace ( const val_value_t *  val1,
const val_value_t *  val2 
)

Compare 2 val_value_t struct value contents.

Check just the nodes present in val1 against val2 Ignores nodes that are set to default in val2

defaults values in val1 can be absent, it will not affect comparison

!!!! Meta-value contents are ignored for this test !!!!

Parameters
val1first value to check
val2second value to check
Returns
compare result
      -1: val1 is less than val2 (if complex just different or error)
       0: val1 is the same as val2
       1: val1 is greater than val2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_compare_for_topreplace_simple()

int32 val_compare_for_topreplace_simple ( const val_value_t *  val1,
const val_value_t *  val2 
)

Compare 2 val_value_t struct value contents.

Check just the nodes present in val1 against val2 Ignores nodes that are set to default in val2

defaults values in val1 can be absent, it will not affect comparison

!!!! NB: Simplified version, only checks the simple children, does NOT dive into complex children. (Used to identify if the current level node is dirty for agt_apply_this_node_ex() call)

!!!! Meta-value contents are ignored for this test !!!!

Parameters
val1first value to compare
val2second value to compare
Returns
compare result
      -1: val1 is less than val2 (if complex just different or error)
       0: val1 is the same as val2
       1: val1 is greater than val2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_compare_max()

int32 val_compare_max ( const val_value_t *  val1,
const val_value_t *  val2,
boolean  configonly,
boolean  childonly,
boolean  editing 
)

Compare 2 val_value_t struct value contents.

Check all or config only Check just child nodes or all descendant nodes Handles NCX_CL_BASE and NCX_CL_SIMPLE data classes by comparing the simple value.

Handle NCX_CL_COMPLEX by checking the index if needed and then checking all the child nodes recursively

!!!! Meta-value contents are ignored for this test !!!!

Parameters
val1first value to check
val2second value to check
configonlyTRUE to compare config=true nodes only
FALSE to compare all nodes
childonlyTRUE to look just 1 level for comparison
FALSE to compare all descendant nodes of complex types
editingTRUE to compare for editing
FALSE to compare just the values, so a set by default and value=default are the same value
Returns
compare result
      -1: val1 is less than val2 (if complex just different or error)
       0: val1 is the same as val2
       1: val1 is greater than val2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_compare_max_def()

int32 val_compare_max_def ( const val_value_t *  val1,
const val_value_t *  val2,
boolean  configonly,
boolean  childonly,
boolean  editing,
boolean  ignore_defaults 
)

Compare 2 val_value_t struct value contents.

Check all or config only Check just child nodes or all descendant nodes Handles NCX_CL_BASE and NCX_CL_SIMPLE data classes by comparing the simple value.

Handle NCX_CL_COMPLEX by checking the index if needed and then checking all the child nodes recursively

!!!! Meta-value contents are ignored for this test !!!!

Parameters
val1first value to check
val2second value to check
configonlyTRUE to compare config=true nodes only
FALSE to compare all nodes
childonlyTRUE to look just 1 level for comparison
FALSE to compare all descendant nodes of complex types
editingTRUE to compare for editing
FALSE to compare just the values, so a set by default and value=default are the same value
ignore_defaultsTRUE to ignore defaults; expect defaults to be set in both nodes
FALSE to compensate for defaults missing in val1; try to skip past missing default containers and leafs
Returns
compare result
      -1: val1 is less than val2 (if complex just different or error)
       0: val1 is the same as val2
       1: val1 is greater than val2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_compare_to_string()

int32 val_compare_to_string ( const val_value_t *  val1,
const xmlChar *  strval2,
status_t *  res 
)

Compare a val_value_t struct value contents to a string.

Handles NCX_CL_BASE and NCX_CL_SIMPLE data classes by comparing the simple value.

!!!! Meta-value contents are ignored for this test !!!!

Parameters
val1first value to check
strval2second value to check
resaddress of return status
Return values
*resreturn status
Returns
compare result
      -1: val1 is less than val2 (if complex just different or error)
       0: val1 is the same as val2
       1: val1 is greater than val2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_compare_to_string_len()

int32 val_compare_to_string_len ( const val_value_t *  val1,
const xmlChar *  strval2,
uint32  strval2len,
status_t *  res 
)

Compare a val_value_t struct value contents to a string Provide a max-length to compare.

Handles NCX_CL_BASE and NCX_CL_SIMPLE data classes by comparing the simple value.

!!!! Meta-value contents are ignored for this test !!!!

Parameters
val1first value to check
strval2second value to check
strval2lenlength of strval2
resaddress of return status
Return values
*resreturn status
Returns
compare result
      -1: val1 is less than val2 (if complex just different or error)
       0: val1 is the same as val2
       1: val1 is greater than val2
Here is the call graph for this function:

◆ val_convert_any_to_container()

void val_convert_any_to_container ( val_value_t *  val)

Convert the extern parameter to a container instead of extern.

The caller will add child nodes into this container of val_value_t representing the nodes found in the external file

Parameters
valpointer to the value node to convert
Here is the call graph for this function:

◆ val_convert_leafref()

val_value_t* val_convert_leafref ( const val_value_t *  val)

Convert a value of type NCX_BT_LEAFREF to the value that the final leafref is pointing at.

Parameters
valvalue to convert; this must be an NCX_BT_LEAFREF
Returns
malloced val_value_t that must be freed with val_free_value the val->btyp and val->typdef and val->v fields will be set based on the real type; the val->obj will still point at the original object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_copy_editvars()

status_t val_copy_editvars ( const val_value_t *  val,
val_value_t *  copy 
)

Copy the editvars struct contents into the value node.

Parameters
valvalue to copy from
copyvalue to copy to
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_create_allowed()

boolean val_create_allowed ( const val_value_t *  val)

Check if the specified value is allowed to have a create edit-config operation attribute.

Parameters
valvalue to check
Returns
TRUE if the val is allowed to have the edit-op
FALSE otherwise
Here is the caller graph for this function:

◆ val_cvt_generic()

status_t val_cvt_generic ( val_value_t *  val)

Convert all the database object pointers to generic object pointers.

Needed to decouple a user variable in yangcli from the server-specific object definition (which goes away when the session is terminated)

  !!! Need to assume the val->obj pointer is already
  !!! invalid.  This can happen to yangcli when a
  !!! session is dropped and there are vars that
  !!! reference YANG objects from the session
Parameters
valval_value_t struct to convert to generic
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_delete_allowed()

boolean val_delete_allowed ( const val_value_t *  val)

Check if the specified value is allowed to have a delete edit-config operation attribute.

Parameters
valvalue to check
Returns
TRUE if the val is allowed to have the edit-op
FALSE otherwise
Here is the caller graph for this function:

◆ val_delete_children()

void val_delete_children ( val_value_t *  val)

Check if the value is a complex type and if so then delete all child nodes.

Parameters
valvalue node to clean
Here is the call graph for this function:

◆ val_delete_default_leaf()

status_t val_delete_default_leaf ( val_value_t *  val)

Do the internal work to setup a delete of a default leaf.

Parameters
valval_value_t struct to use
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_delete_default_leaf_list()

status_t val_delete_default_leaf_list ( val_value_t *  val)

Do the internal work to convert a leaf-list to its YANG default value(s)

Parameters
valval_value_t struct to use
Return values
*valchanged to the first default val and any sibling nodes added after it
Returns
status
Here is the call graph for this function:

◆ val_delete_default_npcon()

status_t val_delete_default_npcon ( val_value_t *  val)

Do the internal work to convert an NP-container to its subtree of YANG default values.

Parameters
valval_value_t struct to use
Returns
status
Here is the call graph for this function:

◆ val_dirty_subtree()

boolean val_dirty_subtree ( const val_value_t *  val)

Check the dirty or subtree_dirty flag.

Parameters
valvalue node to check
Returns
TRUE if value is dirty or any subtree may be dirty, false otherwise

◆ val_dump_alt_value()

void val_dump_alt_value ( val_value_t *  val,
int32  startindent,
log_debug_t  lvl 
)

Printf the specified val_value_t struct to the alternate logfile Uses conf file format (see ncx/conf.h)

Parameters
valvalue to printf
startindentstart indent char count
lvldebug level to use; will not print anything unless log-level set to at least this level
Here is the call graph for this function:

◆ val_dump_value()

void val_dump_value ( val_value_t *  val,
int32  startindent,
log_debug_t  lvl 
)

Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (see ncx/conf.h)

Parameters
valvalue to printf
startindentstart indent char count
lvldebug level to use; will not print anything unless log-level set to at least this level
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_dump_value_ex()

void val_dump_value_ex ( val_value_t *  val,
int32  startindent,
ncx_display_mode_t  display_mode,
log_debug_t  lvl 
)

Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (see ncx/conf.h)

Parameters
valvalue to printf
startindentstart indent char count
display_modedisplay mode to use
lvldebug level to use; will not print anything unless log-level set to at least this level
Here is the call graph for this function:

◆ val_dump_value_full()

void val_dump_value_full ( val_value_t *  val,
int32  startindent,
int32  indent_amount,
val_dumpvalue_mode_t  dumpmode,
ncx_display_mode_t  display_mode,
boolean  with_meta,
boolean  configonly,
boolean  conf_mode,
boolean  expand_varexpr,
log_debug_t  lvl,
logfns_t *  overrideOutput 
)

Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (see ncx/conf.h)

Parameters
valvalue to printf
startindentstart indent char count
indent_amountnumber of spaces for each indent
dumpmodelogging mode to use
display_modedisplay mode enumeration to use
with_metaTRUE if metaQ should be printed
FALSE to skip meta data
configonlyTRUE if config only nodes should be displayed
FALSE if all nodes should be displayed
conf_modetrue if .conf file mode
expand_varexprTRUE if expanding variable expressions
FALSE if not expanding variable expressions
lvldebug level to use; will not print anything unless log-level set to at least this level
overrideOutputalternate functions to send to, use NULL normally
Here is the call graph for this function:

◆ val_dump_value_full2()

void val_dump_value_full2 ( val_value_t *  val,
int32  startindent,
int32  indent_amount,
val_dumpvalue_mode_t  dumpmode,
ncx_display_mode_t  display_mode,
boolean  with_meta,
boolean  configonly,
boolean  conf_mode,
boolean  expand_varexpr,
boolean  withdef,
log_debug_t  lvl,
logfns_t *  overrideOutput 
)

Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (see ncx/conf.h)

Parameters
valvalue to printf
startindentstart indent char count
indent_amountnumber of spaces for each indent
dumpmodelogging mode to use
display_modedisplay mode enumeration to use
with_metaTRUE if metaQ should be printed
FALSE to skip meta data
configonlyTRUE if config only nodes should be displayed
FALSE if all nodes should be displayed
conf_modetrue if .conf file mode
expand_varexprTRUE if expanding variable expressions
FALSE if not expanding variable expressions
withdefTRUE to generate leafy defaults; FALSE to skip
lvldebug level to use; will not print anything unless log-level set to at least this level
overrideOutputalternate functions to send to, use NULL normally
Here is the caller graph for this function:

◆ val_dump_value_max()

void val_dump_value_max ( val_value_t *  val,
int32  startindent,
int32  indent_amount,
val_dumpvalue_mode_t  dumpmode,
ncx_display_mode_t  display_mode,
boolean  with_meta,
boolean  configonly,
log_debug_t  lvl 
)

Printf the specified val_value_t struct to the logfile, or stdout if none set Uses conf file format (see ncx/conf.h)

Parameters
valvalue to printf
startindentstart indent char count
indent_amountnumber of spaces for each indent
dumpmodelogging mode to use
display_modedisplay mode enumeration to use
with_metaTRUE if metaQ should be printed
FALSE to skip meta data
configonlyTRUE if config only nodes should be displayed
FALSE if all nodes should be displayed
lvldebug level to use; will not print anything unless log-level set to at least this level
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_duplicates_allowed()

boolean val_duplicates_allowed ( val_value_t *  val)

Determine if duplicates are allowed for the given val type The entire definition chain is checked to see if a 'no-duplicates'.

The default is config, so some sort of named type or parameter must be declared to create a non-config data element

  Fishing order:
   1) typdef chain
   2) parm definition
   3) parmset definition
Parameters
valvalue node to check
Returns
TRUE if the value is classified as configuration
FALSE if the value is not classified as configuration
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_enum_ok()

status_t val_enum_ok ( typ_def_t *  typdef,
const xmlChar *  enumval,
int32 *  retval,
const xmlChar **  retstr 
)

Check an enumerated integer string to make sure the value is valid based on the specified typdef.

Parameters
typdeftyp_def_t for the designated enum type
enumvalenum string value to check
retvalpointer to return integer variable
retstrpointer to return string name variable
Return values
*retvalinteger value of enum
*retstrpointer to return string name variable
Returns
status
Here is the caller graph for this function:

◆ val_fast_replace_string()

status_t val_fast_replace_string ( const xmlChar *  str,
uint32  stringlen,
val_value_t *  copy 
)

Replace a specified val_value_t struct with a string type Reuse everything – just set the val->v.str field.

Parameters
strvalue to clone from; may be NULL
stringlennumber of chars to use from str, if not NULL
copyaddress of value to replace str.v string value
Return values
*copyhas been altered and copy->v.str changed
Returns
status
Here is the call graph for this function:

◆ val_find_bit()

boolean val_find_bit ( val_value_t *  val,
const xmlChar *  bitname 
)

Find the specified bit name in the NCX_BT_BITS value.

Parameters
valvalue node to check
bitnamename of bit to find
Returns
TRUE if bit is found
FALSE if bit not found or val is not a bits type
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_find_bit_name()

const xmlChar* val_find_bit_name ( val_value_t *  val,
uint32  bitpos 
)

Find the specified bit name in the NCX_BT_BITS value.

Parameters
valvalue node to check
bitposposition value for the bit to find
Returns
const pointer to the bit name that is associated with the specicifed bit number
Here is the call graph for this function:

◆ val_find_child()

val_value_t* val_find_child ( const val_value_t *  parent,
const xmlChar *  modname,
const xmlChar *  childname 
)

Find the first instance of the specified child node.

Parameters
parentparent complex type to check
modnamemodule name; the first match in this module namespace will be returned
NULL: the first match in any namespace will be returned;
childnamename of child node to find
Returns
pointer to the child if found or NULL if not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_find_child_fast()

val_value_t* val_find_child_fast ( const val_value_t *  parent,
xmlns_id_t  nsid,
const xmlChar *  childname 
)

Find the first instance of the specified child node.

Parameters
parentparent complex type to check
nsidmodule namespace ID the first match in this module namespace will be returned
== 0: the first match in any namespace will be returned;
childnamename of child node to find
Returns
pointer to the child if found or NULL if not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_find_child_obj()

val_value_t* val_find_child_obj ( const val_value_t *  parent,
const struct obj_template_t_ chobj 
)

Find the first instance of the specified child node Use the object template pointer to match the object.

Parameters
parentparent complex type to check
chobjchild object type to check
Returns
pointer to the first child value if found or NULL if not found
Here is the call graph for this function:

◆ val_find_child_que()

val_value_t* val_find_child_que ( const dlq_hdr_t *  childQ,
xmlns_id_t  nsid,
const xmlChar *  childname 
)

Find the first instance of the specified child node in the specified child Q.

Parameters
childQQ of val_value_t to search
nsidmodule namespace ID the first match in this module namespace will be returned
== 0: the first match in any namespace will be returned;
childnamename of child node to find
Returns
pointer to the child if found or NULL if not found

◆ val_find_enum_name()

const xmlChar* val_find_enum_name ( val_value_t *  val,
int32  enunum 
)

Find the specified enum name for the value field that matches for NCX_BT_ENUM value.

Parameters
valvalue node to check
enunum'value' value for the enum to find
Returns
const pointer to the enum name that is associated with the specicifed enumeration value
Here is the call graph for this function:

◆ val_find_enum_name2()

const xmlChar* val_find_enum_name2 ( ncx_btype_t  btyp,
typ_def_t *  typdef,
int32  enunum 
)

Find the specified enum name for the value field that matches for NCX_BT_ENUM value Do not use val_value value.

Parameters
btypbase type to use check
typdefdefault typdef for the specified base type
enunum'value' value for the enum to find
Returns
const pointer to the enum name that is associated with the specicifed enumeration value
Here is the caller graph for this function:

◆ val_find_meta()

val_value_t* val_find_meta ( val_value_t *  val,
xmlns_id_t  nsid,
const xmlChar *  name 
)

Get the corresponding meta data node.

Parameters
valvalue to check for metadata
nsidnamespace ID of 'name'; 0 == don't use
namename of metadata variable name
Returns
pointer to the child if found or NULL if not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_find_next_child()

val_value_t* val_find_next_child ( const val_value_t *  parent,
const xmlChar *  modname,
const xmlChar *  childname,
const val_value_t *  curchild 
)

Find the next instance of the specified child node.

Use val_child_next_same instead of this function

Parameters
parentparent complex type to check
modnamemodule name; the first match in this module namespace will be returned
== NULL: the first match in any namespace will be returned;
childnamename of child node to find
curchildcurrent child of this object type to start search
Returns
pointer to the child if found or NULL if not found
Here is the call graph for this function:

◆ val_find_next_child_fast()

val_value_t* val_find_next_child_fast ( const val_value_t *  parent,
const val_value_t *  curchild 
)

Find the next instance of the specified child node.

Deprecated : Use val_child_next_same instead

Use the curchild->obj pointer to find next child of this type Assumes childQ is sorted and all instances of 'curchild' are already grouped together.

Parameters
parentparent complex type to check
curchildcurrent child of this object type to start search
Returns
pointer to the child if found or NULL if not found
Here is the call graph for this function:

◆ val_find_root()

val_value_t* val_find_root ( val_value_t *  val)

Find the root value node or top-val if no ncx:root found.

Parameters
valnode to check
Returns
pointer to root node
Here is the call graph for this function:

◆ val_first_child_match()

val_value_t* val_first_child_match ( const val_value_t *  parent,
const val_value_t *  child 
)

Get the first instance of the corresponding child node.

Parameters
parentparent value to check
childchild value to find (e.g., from a NETCONF PDU)
Returns
pointer to the child if found or NULL if not found
Here is the call graph for this function:

◆ val_first_child_match_fast()

val_value_t* val_first_child_match_fast ( const val_value_t *  parent,
const val_value_t *  child,
val_value_t *  lastmatch 
)

Get the first instance of the corresponding child node Object pointers must be from the same tree!!!

Parameters
parentparent value to check
childchild value to find (e.g., from a NETCONF PDU)
lastmatchlast child to start search from; (may be NULL)
Returns
pointer to the child if found or NULL if not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_first_child_name()

val_value_t* val_first_child_name ( val_value_t *  parent,
const xmlChar *  name 
)

Get the first corresponding child node instance, by name find first – really for resolve index function.

Parameters
parentparent complex type to check
namechild name to find
Returns
pointer to the FIRST match if found, or NULL if not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_first_child_qname()

val_value_t* val_first_child_qname ( val_value_t *  parent,
xmlns_id_t  nsid,
const xmlChar *  name 
)

Get the first corresponding child node instance, by QName.

Parameters
parentparent complex type to check
nsidnamespace ID to use, 0 for any
namechild name to find
Returns
pointer to the first match if found, or NULL if not found
Here is the call graph for this function:

◆ val_first_child_string()

val_value_t* val_first_child_string ( val_value_t *  parent,
const xmlChar *  name,
const xmlChar *  strval 
)

find first name value pair

Get the first corresponding child node instance, by name and by string value. Child node must be a base type of

    NCX_BT_STRING
    NCX_BT_INSTANCE_ID
    NCX_BT_LEAFREF
Parameters
parentparent complex type to check
namechild name to find
strvalstring value to find
Returns
pointer to the FIRST match if found, or NULL if not found
Here is the call graph for this function:

◆ val_fit_oneline()

boolean val_fit_oneline ( const val_value_t *  val,
uint32  linesize,
boolean  isxml 
)

Check if the XML encoding for the specified val_value_t should take one line or more than one line.

Simple types should not use more than one line or introduce any extra whitespace in any simple content element

!!!The calculation includes the XML start and end tags!!!

totalsize: <foo:node>value</foo:node> == 26

Parameters
valvalue to check
linesizelength of line to check against
isxmlTRUE to account for XML start and end tags
FALSE to account for config file formatting
Returns
TRUE if the val is a type that should or must fit on one line
FALSE otherwise
Here is the call graph for this function:

◆ val_force_default()

void val_force_default ( val_value_t *  val)

Set a node created by the server as a default node.

Parameters
valvalue node to change
Here is the caller graph for this function:

◆ val_force_dname()

status_t val_force_dname ( val_value_t *  val)

Set (or reset) the name of a value struct.

Set all descendant nodes as well

Force dname to be used, not object name backptr

Parameters
valval_value_t data structure to change
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_force_empty()

void val_force_empty ( val_value_t *  val)

Convert a simple node to an empty type.

Parameters
valval_value_t struct to use
Here is the call graph for this function:

◆ val_free_editvars()

void val_free_editvars ( val_value_t *  val)

Free the editing variables for the value node.

Parameters
valval_value_t data structure to use
Return values
val->editvarsis freed if set
val->editopset to OP_EDITOP_NONE

◆ val_free_solo_editvars()

void val_free_solo_editvars ( val_editvars_t *  editvars)

Free the editing variables removed from a val_value_t.

Parameters
editvarsedit var struct to clean and free

◆ val_free_unique()

void val_free_unique ( val_unique_t *  valuni)

Clean and free a val_unique_t struct.

Parameters
valunival_unique struct to free
Here is the call graph for this function:

◆ val_free_value()

void val_free_value ( val_value_t *  val)

Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct itself.

The struct must be removed from any queue it is in before this function is called.

Parameters
valval_value_t to delete
Here is the call graph for this function:

◆ val_get_child_deleted_flag()

boolean val_get_child_deleted_flag ( val_value_t *  val)

Get the child_deleted flag for this value node.

Parameters
valvalue node to check
Returns
TRUE if child deleted flag set, false otherwise

◆ val_get_child_inst_id()

uint32 val_get_child_inst_id ( const val_value_t *  parent,
const val_value_t *  child 
)

Get the instance ID for this child node within the parent context.

Parameters
parentparent complex type to check
childchild node to find ID for
Returns
the instance ID num (1 .. N), or 0 if some error
Here is the call graph for this function:

◆ val_get_dirty_flag()

boolean val_get_dirty_flag ( const val_value_t *  val)

Get the dirty flag for this value node.

Parameters
valvalue node to check
Returns
TRUE if value is dirty, false otherwise

◆ val_get_dname()

const xmlChar* val_get_dname ( const val_value_t *  val)

Get the dname field if set; NULL if not set.

Parameters
valvalue to check
Returns
pointer to dname field or NULL if none
Here is the caller graph for this function:

◆ val_get_first_child()

val_value_t* val_get_first_child ( const val_value_t *  parent)

Get the first child node.

Parameters
parentparent complex type to check
Returns
pointer to the child if found or NULL if not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_get_first_index()

val_index_t* val_get_first_index ( const val_value_t *  val)

Get the first index entry, if any for this value node.

Parameters
valvalue node to check
Returns
pointer to first val_index_t node, NULL if none
Here is the caller graph for this function:

◆ val_get_first_key()

val_index_t* val_get_first_key ( val_value_t *  val)

Get the first key record if this is a list with a key-stmt.

Parameters
valvalue node to check
Returns
pointer to first key control block or NULL if none
Here is the caller graph for this function:

◆ val_get_first_leaf()

val_value_t* val_get_first_leaf ( val_value_t *  val)

Get the first leaf or leaflist node in the specified value tree.

Parameters
valvalue node to check
Returns
pointer to first leaf found within this val struct pointer to val if val is a leaf
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_get_first_meta()

val_value_t* val_get_first_meta ( dlq_hdr_t *  queue)

Get the first metaQ entry from the specified Queue.

Parameters
queue== queue of val_value_t meta-vals to check
Returns
pointer to the first meta-var in the Queue if found, or NULL if none

◆ val_get_first_meta_val()

val_value_t* val_get_first_meta_val ( val_value_t *  val)

Get the first metaQ entry from the specified Queue.

Parameters
valvalue node to get the metaQ from
Returns
pointer to the first meta-var in the Queue if found, or NULL if none

◆ val_get_first_terminal_child()

val_value_t* val_get_first_terminal_child ( const val_value_t *  parent)

Get the child node only if obj_is_terminal(val->obj) is true.

Parameters
parentparent complex type to check
Returns
pointer to the first terminal child if found or NULL if not found
Here is the call graph for this function:

◆ val_get_icookie()

int val_get_icookie ( val_value_t *  val)

Get the SIL integer cookie in the editvars for the specified value node.

Parameters
valval_value_t struct to set
Returns
integer cookie value or 0 if none

◆ val_get_index_count()

uint32 val_get_index_count ( const val_value_t *  val)

Get the number of index nodes in this val.

Parameters
valvalue node to check
Returns
index count (keys actually present)
Here is the call graph for this function:

◆ val_get_iqualval()

ncx_iqual_t val_get_iqualval ( const val_value_t *  val)

Get the effective instance qualifier value for this value.

Parameters
valvalue construct to check
Returns
iqual value
Here is the call graph for this function:

◆ val_get_last_key()

val_index_t* val_get_last_key ( val_value_t *  val)

Get the last key record if this is a list with a key-stmt.

Parameters
valvalue node to check
Returns
pointer to last key control block or NULL if none

◆ val_get_last_modified()

time_t* val_get_last_modified ( val_value_t *  val)

Get the last_modified field.

Parameters
valval_value_t data structure to use
Returns
pointer to last_modified field
Here is the caller graph for this function:

◆ val_get_leafref_typdef()

typ_def_t* val_get_leafref_typdef ( val_value_t *  val)

Return a base typedef of type NCX_BT_LEAFREF.

The value that the final leafref is pointing at.

Parameters
valvalue to use; this must be an NCX_BT_LEAFREF
Returns
pointer to final typ_def_t
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_get_metaQ()

dlq_hdr_t* val_get_metaQ ( val_value_t *  val)

Get the meta Q header for the value.

Parameters
valvalue node to check
Returns
pointer to the metaQ for this value

◆ val_get_mod_name()

const xmlChar* val_get_mod_name ( const val_value_t *  val)

Get the module name associated with this value node.

Parameters
valvalue node to check
Returns
const pointer to module name string
NULL if not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_get_mod_prefix()

const xmlChar* val_get_mod_prefix ( const val_value_t *  val)

Get the module prefix associated with this value node.

Parameters
valvalue node to check
Returns
const pointer to module name string
NULL if not found
Here is the call graph for this function:

◆ val_get_nest_level()

uint32 val_get_nest_level ( val_value_t *  val)

Get the next level of the value.

Parameters
valvalue node to check
Returns
nest level from the root

◆ val_get_next_child()

val_value_t* val_get_next_child ( const val_value_t *  curchild)

Get the next child node.

Parameters
curchildcurrent child node
Returns
pointer to the next child if found or NULL if not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_get_next_index()

val_index_t* val_get_next_index ( const val_index_t *  valindex)

Get the next index entry, if any for this value node.

Parameters
valindexcurrent value index struct to check
Returns
pointer to next val_index_t node, NULL if none
Here is the caller graph for this function:

◆ val_get_next_key()

val_index_t* val_get_next_key ( val_index_t *  curkey)

Get the next key record if this is a list with a key-stmt.

Parameters
curkeycurrent key node
Returns
pointer to next key control block or NULL if none
Here is the caller graph for this function:

◆ val_get_next_meta()

val_value_t* val_get_next_meta ( val_value_t *  curnode)

Get the next metaQ entry from the specified entry.

Parameters
curnodecurrent meta-var node
Returns
pointer to the next meta-var in the Queue if found, or NULL if none

◆ val_get_next_terminal_child()

val_value_t* val_get_next_terminal_child ( const val_value_t *  curchild)

Get the next child node only if obj_is_terminal(val->obj) is true.

Parameters
curchildcurrent child node
Returns
pointer to the next child if found or NULL if not found
Here is the call graph for this function:

◆ val_get_nsid()

xmlns_id_t val_get_nsid ( const val_value_t *  val)

Get the namespace ID for the specified value node.

Parameters
valvalue node to check
Returns
const pointer to module name string
NULL if not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_get_owner()

const xmlChar* val_get_owner ( val_value_t *  val)

Get the owner string for the specified value node.

Parameters
valvalue node to check
Returns
const pointer to owner name; NULL if system-owned
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_get_owner_id()

ncx_owner_id_t val_get_owner_id ( val_value_t *  val)

Get the owner ID for the specified value node.

Parameters
valvalue node to check
Returns
const pointer to owner name; "system" if system-owned
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_get_parent_nsid()

xmlns_id_t val_get_parent_nsid ( const val_value_t *  val)

Try to get the parent namespace ID.

Parameters
val== value to check
Returns
namespace ID of parent, or 0 if not found or not a value parent

◆ val_get_pcookie()

void* val_get_pcookie ( val_value_t *  val)

Get the SIL pointer cookie in the editvars for the specified value node.

Parameters
valval_value_t struct to set
Returns
pointer cookie value or NULL if none

◆ val_get_prev_key()

val_index_t* val_get_prev_key ( val_index_t *  curkey)

Get the previous key record if this is a list with a key-stmt.

Parameters
curkey== current key node
Returns
pointer to previous key control block or NULL if none

◆ val_get_sil_priority()

uint8 val_get_sil_priority ( val_value_t *  val)

Get the secondary SIL priority; zero if not found.

Parameters
valvalue to check
Returns
SIL priority value

◆ val_get_skip_sil_partial()

boolean val_get_skip_sil_partial ( const val_value_t *  val)

Get the skip_sil_partial flag.

Parameters
valvalue to check
Returns
TRUE if the skip-sil-partial flag is set

◆ val_get_subtree_dirty_flag()

boolean val_get_subtree_dirty_flag ( const val_value_t *  val)

Get the subtree dirty flag for this value node.

Parameters
valvalue node to check
Returns
TRUE if value is subtree dirty, false otherwise

◆ val_get_typdef()

const typ_def_t* val_get_typdef ( const val_value_t *  val)

Get the typdef field for a value struct.

Parameters
valval_value_t struct to use
Returns
pointer to the typdef or NULL if none

◆ val_get_varexpr()

const xmlChar* val_get_varexpr ( const val_value_t *  val)

Get the varexpr field if set; NULL if not set.

Parameters
valvalue to check
Returns
pointer to varexpr field or NULL if none
Here is the caller graph for this function:

◆ val_get_virtual_value()

val_value_t* val_get_virtual_value ( ses_cb_t *  scb,
val_value_t *  val,
status_t *  res 
)

Get the value of a virtual value node.

The top-level value is provided by the caller and must be malloced with val_new_value before calling this function

must free the return val; not cached

If the val->getcb is NULL, then an error will be returned

Caller should check for *res == ERR_NCX_SKIPPED This will be returned if virtual value has no instance at this time.

!!! DO NOT SAVE THE RETURN VALUE LONGER THAN THE !!! VIRTUAL VALUE CACHE TIMEOUT VALUE

Parameters
scbsession CB ptr cast as void * that is getting the virtual value
valvirtual value to get value for
respointer to output function return status value
Return values
val->virtualvalwill be set with the cached return value
*resthe function return status
Returns
A malloced and filled in val_value_t struct This value is cached in the val->virtualval pointer and will be freed when the cache is replaced or when val is freed
Here is the caller graph for this function:

◆ val_get_yang_typename()

const xmlChar* val_get_yang_typename ( val_value_t *  val)

Get the YANG type name for this value node if there is one.

Parameters
valpointer to the value node to check
Returns
pointer to YANG type name, NULL if some error
Here is the call graph for this function:

◆ val_has_children()

boolean val_has_children ( const val_value_t *  val)

Determine if there are any child nodes for this val.

Parameters
valvalue node to check
Returns
TRUE if the value has 1 or more child nodes
FALSE if the value does not have any child nodes
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_has_complex_child()

boolean val_has_complex_child ( const val_value_t *  val)

Check if the value has complex children nodes.

Parameters
valvalue to check;
Returns
TRUE if value has complex children nodes
FALSE otherwise
Here is the call graph for this function:

◆ val_has_conditional_value()

boolean val_has_conditional_value ( val_value_t *  val)

Check if the value is conditional.

YANG 1.1:: Check the value that must be properly set to see if it is conditional on any if-feature-stmts

Parameters
valvalue to check
Returns
true if value set is conditional; false if not
Here is the call graph for this function:

◆ val_has_content()

boolean val_has_content ( const val_value_t *  val)

Determine if there is a value or any child nodes for this val.

Parameters
valvalue node to check
Returns
TRUE if the value has some content
FALSE if the value does not have any content
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_has_content_ex()

boolean val_has_content_ex ( const val_value_t *  val)

Determine if there is a value or any child nodes for this val.

Also checks if the complex nodes have any GET2 children

Parameters
valvalue node to check
Returns
TRUE if the value has some content
FALSE if the value does not have any content
Here is the call graph for this function:

◆ val_has_index()

boolean val_has_index ( const val_value_t *  val)

Determine if this value has an index.

Parameters
valvalue node to check
Returns
TRUE if the value has an index
FALSE if the value does not have an index
Here is the caller graph for this function:

◆ val_has_withdef_default()

boolean val_has_withdef_default ( const val_value_t *  val)

Check if the value contained the wd:default attribute.

Parameters
valval_value_t struct to check
Returns
TRUE if wd:default was set to true
FALSE if wd:default attribute was not set to true

◆ val_idref_derived_from()

boolean val_idref_derived_from ( ncx_module_t *  impmod,
val_value_t *  testval,
const xmlChar *  qname,
boolean  or_self 
)

Check the specified valnode is derived from the specified identity.

Parameters
impmodmodule to use for prefix-to-import matching
testvalvalue node to test
qnameidentity string to check
or_selfTRUE if SELF OK; FALSE if NORMAL MODE
Returns
TRUE is string matches pattern; FALSE otherwise
Here is the call graph for this function:

◆ val_idref_ok()

status_t val_idref_ok ( typ_def_t *  typdef,
const xmlChar *  qname,
xmlns_id_t  nsid,
const xmlChar **  name,
ncx_identity_t **  id 
)

Check if an identityref QName is valid for the typedef.

The QName must match an identity that has the same base as specified in the typdef

Parameters
typdeftyp_def_t for the designated identityref type
qnameQName or local-name string to check
nsidnamespace ID from XML node for NS of QName
this NSID will be used and not the prefix in qname it was parsed in the XML node and is not a module prefix
nameaddress of return local name part of QName
idaddress of return identity, if found
Return values
*namepointer into the qname string at the start of the local name part
*idpointer to ncx_identity_t found
Returns
status
Here is the call graph for this function:

◆ val_idref_ok_ex()

status_t val_idref_ok_ex ( typ_def_t *  typdef,
const xmlChar *  qname,
xmlns_id_t  nsid,
boolean  is_json,
ncx_module_t *  impmod,
boolean  or_self,
const xmlChar **  name,
ncx_identity_t **  id 
)

Check if an identityref QName is valid for the typedef.

The QName must match an identity that has the same base as specified in the typdef

Parameters
typdeftyp_def_t for the designated identityref type
qnameQName or local-name string to check
nsidnamespace ID from XML node for NS of QName
this NSID will be used and not the prefix in qname it was parsed in the XML node and is not a module prefix
is_jsonTRUE if YANG JSON encoded string (modname:name)
FALSE if YANG prefixes expected (modprefix:name)
impmodmodule to use to find prefix-to-import mappings this will be used if for prefixes in qname
NULL if not used
or_selfTRUE if SELF OK; FALSE if NORMAL MODE
nameaddress of return local name part of QName
idaddress of return identity, if found
Return values
*namepointer into the qname string at the start of the local name part
*idpointer to ncx_identity_t found
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_index_compare()

int val_index_compare ( const val_value_t *  val1,
const val_value_t *  val2 
)

Check 2 val_value structs for the same instance ID.

The node data types must match, and must be NCX_BT_LIST

Parameters
val1first value to index match
val2second value to index match
Returns
-1 , - or 1 for compare value

◆ val_index_match()

boolean val_index_match ( const val_value_t *  val1,
const val_value_t *  val2 
)

Check 2 val_value structs for the same instance ID.

The node data types must match, and must be NCX_BT_LIST

All index components must exactly match.

Parameters
val1first value to index match
val2second value to index match
Returns
TRUE if the index chains match
Here is the caller graph for this function:

◆ val_init_complex()

void val_init_complex ( val_value_t *  val,
ncx_btype_t  btyp 
)

Initialize the fields in a complex val_value_t this is deprecated and should only be called by val_init_from_template.

MUST CALL val_new_value FIRST

Parameters
valpointer to the malloced struct to initialize
btypbase type for this value; expect NCX_BT_CONTAINER or NCX_BT_LIST
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_init_from_template()

void val_init_from_template ( val_value_t *  val,
struct obj_template_t_ obj 
)

Initialize a value node from its object template.

This is the normal init function to call MUST CALL val_new_value FIRST

Parameters
valpointer to the initialized value struct to bind
objobject template to use
Here is the caller graph for this function:

◆ val_init_value()

void val_init_value ( val_value_t *  val)

Initialize the generic fields in a val_value_t so it is ready for use.

MUST BE USED with val_value_t structs inside other malloced data

Parameters
valvalue struct to initialize
Here is the caller graph for this function:

◆ val_init_virtual()

void val_init_virtual ( val_value_t *  val,
void *  cbfn,
struct obj_template_t_ obj 
)

Special function to initialize a virtual value node.

MUST CALL val_new_value FIRST

Parameters
valpointer to the malloced struct to initialize
cbfnGET1 callback function to use cast as void *
objobject template to use
Here is the caller graph for this function:

◆ val_insert_child()

void val_insert_child ( val_value_t *  child,
val_value_t *  current,
val_value_t *  parent 
)

Insert a child value node to a parent value node.

Parameters
childnode to store in the parent
currentcurrent node to insert after; NULL to make new first entry
parentcomplex value node with a childQ
Here is the call graph for this function:

◆ val_instance_count()

uint32 val_instance_count ( val_value_t *  val,
const xmlChar *  modname,
const xmlChar *  objname 
)

Count the number of instances of the specified object name in the parent value struct.

This only checks the first level under the parent, not the entire subtree

Parameters
valvalue to check
modnamename of module which defines the object to count
NULL (do not check module names)
objnamename of object to count
Returns
number of instances found
Here is the call graph for this function:

◆ val_instance_count_fast()

uint32 val_instance_count_fast ( val_value_t *  val,
xmlns_id_t  nsid,
const xmlChar *  objname,
val_value_t **  firstval 
)

Count the number of instances of the specified object name in the parent value struct.

This only checks the first level under the parent, not the entire subtree

Try to use val_child_count instead of this function

Parameters
valvalue to check
nsidmodule namespace or zero to skip
objnamename of object to count
firstvalpointer to return first found instance
Return values
*firstvalset to first found instance of nsid:objname
Returns
number of instances found
Here is the call graph for this function:

◆ val_instance_count_fast2()

uint32 val_instance_count_fast2 ( val_value_t *  val,
val_value_t *  startval 
)

Count the number of instances of the specified object name in the parent value struct.

This only checks the first level under the parent, not the entire subtree Starts with the startval passed in

Try to use val_child_count instead of this function

Parameters
valvalue to check
startvalfirst found instance
Returns
number of instances found
Here is the call graph for this function:

◆ val_is_config_data()

boolean val_is_config_data ( const val_value_t *  val)

Check if the specified value is a config DB object instance.

Parameters
valvalue to check
Returns
TRUE if the val is a config DB object instance
FALSE otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_is_config_save()

boolean val_is_config_save ( const val_value_t *  val)

Check if the specified value is a config DB object instance Check for config-save mode.

Parameters
valvalue to check
Returns
TRUE if the val is a config DB object instance in save mode
FALSE otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_is_default()

boolean val_is_default ( val_value_t *  val)

Check if the specified value is set to the YANG default value.

This is not the same as val_set_by_default. Use that function instead to avoid differences between trim, explicit, and report-all default-style settings

Parameters
valvalue to check
Return values
val->flagsmay be adjusted
          VAL_FL_DEFVALSET will be set if not set already
          VAL_FL_DEFVAL will be set or cleared if
             VAL_FL_DEFSETVAL is not already set,
             after determining if the value == its default
Returns
TRUE if the val is set to the default value
FALSE otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_is_metaval()

boolean val_is_metaval ( const val_value_t *  val)

Check if the value is a meta-val (XML attribute)

Parameters
valval_value_t struct to check
Returns
TRUE if val is a meta-val
FALSE if val is not a meta-val

◆ val_is_real()

boolean val_is_real ( const val_value_t *  val)

Check if the specified value is a real value.

return TRUE if not virtual or NCX_BT_EXTERN or NCX_BT_INTERN)

Parameters
valvalue to check
Returns
TRUE if the val is a real value
FALSE otherwise
Here is the caller graph for this function:

◆ val_is_value_set()

boolean val_is_value_set ( val_value_t *  val)

Check if a value has been set by a client It has to be initialized and not set by default to return true.

Parameters
valvalue to check
Returns
true if value has been set
false if has not been set, or set to default, or the code cannot tell if the value is more than initialized
Here is the call graph for this function:

◆ val_is_virtual()

boolean val_is_virtual ( const val_value_t *  val)

Check if the specified value is a virtual value such that a 'get' callback function is required to access the real value contents.

Parameters
valvalue to check
Returns
TRUE if the val is a virtual value
FALSE otherwise
Here is the caller graph for this function:

◆ val_list_ok()

status_t val_list_ok ( typ_def_t *  typdef,
ncx_btype_t  btyp,
ncx_list_t *  list 
)

Check a list to make sure the all the strings are valid based on the specified typdef.

validate all the ncx_lmem_t entries in the list against the specified typdef. Mark any errors in the ncx_lmem_t flags field of each member in the list with an error

Parameters
typdeftyp_def_t for the designated list type
btypbase type (NCX_BT_SLIST or NCX_BT_BITS)
listlist struct with ncx_lmem_t structs to check
Return values
list->lmem.flagsfield may contain bits set
Returns
status
         NCX_FL_RANGE_ERR: size out of range
         NCX_FL_VALUE_ERR  value not permitted by value set,
                           or pattern
Here is the call graph for this function:

◆ val_list_ok_errinfo()

status_t val_list_ok_errinfo ( typ_def_t *  typdef,
ncx_btype_t  btyp,
ncx_list_t *  list,
ncx_errinfo_t **  errinfo 
)

Check a list to make sure the all the strings are valid based on the specified typdef.

Parameters
typdeftyp_def_t for the designated list type
btypbase type (NCX_BT_SLIST or NCX_BT_BITS)
listlist struct with ncx_lmem_t structs to check
errinfoaddress of return rpc-error info struct
Return values
list->lmem.flagsfield may contain bits set
*errinfocontains the YANG specified error info, if any
Returns
status
         NCX_FL_RANGE_ERR: size out of range
         NCX_FL_VALUE_ERR  value not permitted by value set,
                           or pattern
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_liststr_count()

uint32 val_liststr_count ( const val_value_t *  val)

Get the number of strings in the list type.

Parameters
valvalue to check
Returns
number of list entries; also zero for error
Here is the call graph for this function:

◆ val_make_binary()

val_value_t* val_make_binary ( xmlns_id_t  nsid,
const xmlChar *  valname,
const xmlChar *  valstr,
uint32  valstrlen 
)

Malloc and set a val_value_t as a NCX_BT_BINARY type Uses the generic binary object from ncx_get_gen_binary.

Parameters
nsidnamespace ID to use
valnamename of simple value
valstrsimple value encoded as a binary buffer
valstrlenlength of valstr (not zero-terminated)
Returns
malloced val struct filled in; NULL if malloc or strdup failed
Here is the call graph for this function:

◆ val_make_from_insertxpcb()

val_value_t* val_make_from_insertxpcb ( val_value_t *  sourceval,
status_t *  res 
)

Make a val_value_t for a list, with the child nodes for key leafs, specified in the key attribute string given to the insert operation.

Parameters
sourcevallist val_value_t from the PDU with the insertxpcb to process
resaddress of return status (may be NULL, ignored)
Return values
*resreturn status
Returns
malloced list val_value_t struct with converted value
Here is the call graph for this function:

◆ val_make_simval()

val_value_t* val_make_simval ( typ_def_t *  typdef,
xmlns_id_t  nsid,
const xmlChar *  valname,
const xmlChar *  valstr,
status_t *  res 
)

Create and set a val_value_t as a simple type same as val_set_simval, but malloc the value first.

Parameters
typdeftypdef of expected type
nsidnamespace ID of this field
valnamename of simple value
valstrsimple value encoded as a string
resaddress of return status
Return values
*resreturn status
Returns
pointer to malloced and filled in val_value_t struct NULL if some error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_make_sprintf_string()

xmlChar* val_make_sprintf_string ( const val_value_t *  val)

Malloc a buffer and then sprintf the xmlChar string NETCONF representation of a simple value.

SIL code should use this function to generate the val_value_t simple value into a buffer for external use

Parameters
valvalue to print
Returns
malloced buffer with string represetation of the 'val' value node NULL if some error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_make_string()

val_value_t* val_make_string ( xmlns_id_t  nsid,
const xmlChar *  valname,
const xmlChar *  valstr 
)

Malloc and set a val_value_t as a generic NCX_BT_STRING namespace set to 0 !!!

This function uses the generic string object in ncx.c! Do not use for SIL code! Use val_make_simval_obj in val_util.h instead!

Parameters
nsidnamespace ID to use
valnamename of simple value
valstrsimple value encoded as a string
Returns
malloced val struct filled in; NULL if malloc or strdup failed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_mark_deleted()

void val_mark_deleted ( val_value_t *  val)

mark the value node as deleted May have to really delete from val_tree

Parameters
valvalue node to mark deleted
Here is the call graph for this function:

◆ val_mark_undeleted()

void val_mark_undeleted ( val_value_t *  val)

mark the value node as un-deleted

May have to really delete from val_tree

Parameters
valvalue node to mark un-deleted
Here is the call graph for this function:

◆ val_match_child()

val_value_t* val_match_child ( const val_value_t *  parent,
const xmlChar *  modname,
const xmlChar *  childname 
)

Match the first instance of the specified child node.

Parameters
parentparent complex type to check
modnamemodule name; the first match in this module namespace will be returned
== NULL: the first match in any namespace will be returned;
childnamename of child node to find
Returns
pointer to the child if found or NULL if not found
Here is the call graph for this function:

◆ val_match_child_count()

val_value_t* val_match_child_count ( const val_value_t *  parent,
const xmlChar *  modname,
const xmlChar *  childname,
uint32 *  matchcount 
)

Match the first instance of the specified child node Return the total number of matches.

Parameters
parentparent complex type to check
modnamemodule name; the first match in this module namespace will be returned
== NULL: the first match in any namespace will be returned;
childnamename of child node to find
matchcountaddress of return match count
Return values
*matchcountnumber of matches found
Returns
pointer to the child if found or NULL if not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_match_metaval()

boolean val_match_metaval ( const xml_attr_t *  attr,
xmlns_id_t  nsid,
const xmlChar *  name 
)

Match the specific attribute value and namespace ID.

Parameters
attrattr to check
nsidmamespace ID to match against
nameattribute name to match against
Returns
TRUE if attr is a match; FALSE otherwise
Here is the call graph for this function:

◆ val_merge()

status_t val_merge ( const val_value_t *  src,
val_value_t *  dest 
)

Merge src val into dest val (! MUST be same type !) Any meta vars in src are also merged into dest.

This function is not used to merge complex objects !!! For typ_is_simple() only !!!

Parameters
srcval to merge from
destval to merge into
Returns
status
Here is the call graph for this function:

◆ val_meta_empty()

boolean val_meta_empty ( val_value_t *  val)

Check if the metaQ is empty for the value node.

Parameters
valvalue to check
Returns
TRUE if the metaQ for the value is empty
FALSE otherwise

◆ val_meta_match()

boolean val_meta_match ( val_value_t *  val,
val_value_t *  metaval 
)

Return true if the corresponding attribute exists and has the same value.

Parameters
valvalue to check for metadata
metavalvalue to match in the val->metaQ
Returns
TRUE if the specified attr if found and has the same value
FALSE otherwise

◆ val_metadata_inst_count()

uint32 val_metadata_inst_count ( val_value_t *  val,
xmlns_id_t  nsid,
const xmlChar *  name 
)

Get the number of instances of the specified attribute.

Parameters
valvalue to check for metadata instance count
nsidnamespace ID of the meta data variable
namename of the meta data variable
Returns
number of instances found in val->metaQ
Here is the call graph for this function:

◆ val_move_children()

void val_move_children ( val_value_t *  srcval,
val_value_t *  destval 
)

Move all the child nodes from src to dest Source and dest must both be containers!

Parameters
srcvalsource val_value_t struct to move
destvaldestination value struct ot use
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_move_fields_for_xml()

void val_move_fields_for_xml ( val_value_t *  srcval,
val_value_t *  destval,
boolean  movemeta 
)

Move or copy the internal fields from one val to another for xml_wr purposes.

Parameters
srcvalsource val_value_t struct to move from
destvaldestination val to move to
movemetaTRUE if metaQ should be transferred
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_move_metadata()

void val_move_metadata ( val_value_t *  srcval,
val_value_t *  destval 
)

Move the attribute fields from one val to another for xml_wr purposes.

Parameters
srcvalsource val_value_t struct to move from
destvaldestination val to move to
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_move_nonconfig_children()

void val_move_nonconfig_children ( val_value_t *  srcval,
val_value_t *  destval 
)

Move all the config=false child nodes from src to dest Source and dest must both be containers!

Parameters
srcvalsource val_value_t struct to move
destvaldestination value struct ot use
Here is the call graph for this function:

◆ val_need_owner_string()

boolean val_need_owner_string ( val_value_t *  val)

Check if the owner string is needed when generating ywx:owner attrs.

Parameters
valvalue node to check
Returns
const pointer to owner name; "system" if system-owned

◆ val_need_quotes()

boolean val_need_quotes ( const xmlChar *  str)

Check if a string needs to be quoted to be output within a conf file or ncxcli stdout output.

Parameters
strstring to check
Returns
TRUE if double quoted string is needed
FALSE if not needed
Here is the caller graph for this function:

◆ val_new_deleted_value()

val_value_t* val_new_deleted_value ( void  )

Malloc and initialize the fields in a val_value_t to be used as a deleted node marker.

Returns
pointer to the malloced and initialized struct or NULL if an error
Here is the call graph for this function:

◆ val_new_editvars()

status_t val_new_editvars ( val_value_t *  val)

Malloc and initialize the val->editvars field.

Parameters
valval_value_t data structure to use
Return values
val->editvarsis malloced and initialized
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_new_extra()

status_t val_new_extra ( val_value_t *  val)

Create the val_extra struct if it does not exist.

Parameters
valvalue to change
Return values
val->val_extracreated
Returns
status
Here is the caller graph for this function:

◆ val_new_unique()

val_unique_t* val_new_unique ( void  )

Malloc and initialize the fields in a val_unique_t.

Returns
pointer to the malloced and initialized struct or NULL if an error

◆ val_new_value()

val_value_t* val_new_value ( void  )

Malloc and initialize the fields in a val_value_t.

Returns
pointer to the malloced and initialized struct or NULL if an error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_next_child_match()

val_value_t* val_next_child_match ( val_value_t *  parent,
val_value_t *  child,
val_value_t *  curmatch 
)

Get the next instance of the corresponding child node.

Match the keys from curchild to siblings of child if they are keys; match same value if they are leaf-lists.

Parameters
parentparent value to check
childchild value to find (e.g., from a NETCONF PDU)
curmatchcurrent child of parent that matched
Returns
pointer to the next child match if found or NULL if not found
Here is the call graph for this function:

◆ val_next_child_qname()

val_value_t* val_next_child_qname ( val_value_t *  parent,
xmlns_id_t  nsid,
const xmlChar *  name,
val_value_t *  curchild 
)

Get the next corresponding child node instance, by QName.

Parameters
parentparent complex type to check
nsidnamespace ID to use, 0 for any
namechild name to find
curchildcurrent child match to start from
Returns
pointer to the next match if found, or NULL if not found
Here is the call graph for this function:

◆ val_next_child_same()

val_value_t* val_next_child_same ( val_value_t *  curchild)

Get the next instance of the corresponding child node.

Parameters
curchildchild type to find next instance of
Returns
pointer to the next child of same type or NULL if none
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_ocpattern_match()

boolean val_ocpattern_match ( const regex_t *  ocpattern,
const xmlChar *  strval 
)

Check the specified string against the specified pattern Use POSIX format for openconfig pattern.

Parameters
ocpatterncompiled pattern to use
strvalstring to check
Returns
TRUE is string matches pattern; FALSE otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_parse_idref()

status_t val_parse_idref ( ncx_module_t *  mod,
const xmlChar *  qname,
xmlns_id_t nsid,
const xmlChar **  name,
ncx_identity_t **  id 
)

Parse a CLI BASED identityref QName into its various parts.

Parameters
modmodule containing the default-stmt (or NULL if N/A)
qnameQName or local-name string to parse
nsidaddress of return namespace ID of the module indicated by the prefix. If mod==NULL then a prefix MUST be present
nameaddress of return local name part of QName
idaddress of return identity, if found
Return values
*nsidnamespace ID for the prefix part of the QName
*namepointer into the qname string at the start of the local name part
*idpointer to ncx_identity_t found (if any, not an error)
Returns
status
Here is the call graph for this function:

◆ val_parse_meta()

status_t val_parse_meta ( ses_cb_t *  scb,
typ_def_t *  typdef,
xml_attr_t *  attr,
val_value_t *  retval 
)

Parse the metadata descriptor against the typdef Check only that the value is ok, not instance count.

Parameters
scbsession control block or NULL if none
typdeftypdef to check
attrXML attribute to check
retvalinitialized val_value_t to fill in
Return values
*retvalfilled in if return is NO_ERR
Returns
status of the operation

◆ val_pattern_match()

boolean val_pattern_match ( const xmlRegexpPtr  pattern,
const xmlChar *  strval 
)

Check the specified string against the specified pattern.

Parameters
patterncompiled pattern to use
strvalstring to check
Returns
TRUE is string matches pattern; FALSE otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_pattern_ok()

status_t val_pattern_ok ( typ_def_t *  typdef,
const xmlChar *  strval 
)

Check a string against all the patterns in a big AND expression.

Parameters
typdeftyp_def_t for the designated enum type
strvalstring value to check
Returns
NO_ERR if pattern OK or no patterns found to check; error otherwise
Here is the call graph for this function:

◆ val_pattern_ok_errinfo()

status_t val_pattern_ok_errinfo ( typ_def_t *  typdef,
const xmlChar *  strval,
ncx_errinfo_t **  errinfo 
)

Check a string against all the patterns in a big AND expression Get errinfo if any.

Parameters
typdeftyp_def_t for the designated enum type
strvalstring value to check
errinfoaddress of return errinfo struct for err-pattern
Return values
*errinfoset to error info struct if any, and if error exit
Returns
NO_ERR if pattern OK or no patterns found to check; error otherwise, and *errinfo will be set if the pattern that failed has any errinfo defined in it
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_range_ok()

status_t val_range_ok ( typ_def_t *  typdef,
ncx_btype_t  btyp,
const ncx_num_t *  num 
)

Check a number to see if it is in range or not Could be a number or size range.

Parameters
typdeftyp_def_t for the simple type to check
btypbase type of num
numnumber to check
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_range_ok_errinfo()

status_t val_range_ok_errinfo ( typ_def_t *  typdef,
ncx_btype_t  btyp,
const ncx_num_t *  num,
ncx_errinfo_t **  errinfo 
)

Check a number to see if it is in range or not; get errinfo Could be a number or size range.

Parameters
typdeftyp_def_t for the simple type to check
btypbase type of num
numnumber to check
errinfoaddress of return error struct
Return values
*errinfoerrinfo record on error exit
Returns
status
Here is the caller graph for this function:

◆ val_reinit_from_template()

void val_reinit_from_template ( val_value_t *  val,
struct obj_template_t_ obj 
)

Re-Initialize a value node from its object template.

MUST CALL val_new_value FIRST
MUST CALL val_init_foo first

Parameters
valpointer to the initialized value struct to bind
objobject template to use
Here is the call graph for this function:

◆ val_remove_child()

void val_remove_child ( val_value_t *  child)

Remove a child value node from its parent value node.

Parameters
childnode to store in the parent
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_remove_key()

void val_remove_key ( val_value_t *  keyval)

Remove a key pointer because the key is invalid Free the key pointer.

Parameters
keyvalvalue node to find, remove and free
Here is the call graph for this function:

◆ val_replace()

status_t val_replace ( val_value_t *  val,
val_value_t *  copy 
)

Replace a specified val_value_t struct and sub-trees.

!!! this can be destructive to the source 'val' parameter !!!!

Parameters
valvalue to clone from
copyaddress of value to replace
Return values
*copyhas been deleted and reforms with the contents of 'val'
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_replace_str()

status_t val_replace_str ( const xmlChar *  str,
uint32  stringlen,
val_value_t *  copy 
)

Replace a specified val_value_t struct with a string type.

Parameters
strvalue to clone from; may be NULL
stringlennumber of chars to use from str, if not NULL
copyaddress of value to replace
Return values
*copyhas been deleted and reforms with the contents of 'val'
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_replace_stringval()

void val_replace_stringval ( val_value_t *  val,
const xmlChar *  str 
)

Replace the string value, not the entire value.

Parameters
valvalue to change
strthe string to use to replace the current string
Here is the call graph for this function:

◆ val_reset_empty()

status_t val_reset_empty ( val_value_t *  val)

Recast an already initialized value as an NCX_BT_EMPTY clean a value and set it to empty type used by yangcli to delete leafs.

Parameters
valvalue to set
Return values
*valis filled in if return NO_ERR
Returns
status
Here is the call graph for this function:

◆ val_resolve_scoped_name()

status_t val_resolve_scoped_name ( val_value_t *  val,
const xmlChar *  name,
val_value_t **  chval 
)

Find the scoped identifier in the specified complex value.

E.g.: foo.bar.baz

Parameters
valcomplex type to check
namescoped name string of a nested node to find
chvaladdress of return child val
Return values
*chvalis set to the value of the found local scoped child member, if NO_ERR
Returns
status
Here is the call graph for this function:

◆ val_set_all_tags()

void val_set_all_tags ( val_value_t *  val,
time_t *  timestamp,
ncx_transaction_id_t  txid 
)

Set the etag and last_modified field for the node and all config sub-children.

Parameters
valvalue node to set
timestampnew last-modified timestamp to set
txidtransaction id for this edit

◆ val_set_binary()

status_t val_set_binary ( const xmlChar *  valstr,
uint32  valstrlen,
val_value_t *  val 
)

set and decode base64 value.

Set an initialized val_value_t as a binary type

This function expects the input to be in base64 format!!! ONLY USED BY PARSER FUNCTIONS SETTING A VAL ALREADY SETUP AS NCX_BT_BINARY

Parameters
valstrencoded value
valstrlenlength of valstr to use
valvalue to set
Return values
*valis filled in if return NO_ERR
Returns
status
Here is the call graph for this function:

◆ val_set_by_default()

boolean val_set_by_default ( const val_value_t *  val)

Check if the value was set by val_add_defaults.

Parameters
valval_value_t struct to check
Returns
TRUE if set by default
FALSE if set explicitly by some user or the ctartup config
Here is the caller graph for this function:

◆ val_set_canonical()

status_t val_set_canonical ( val_value_t *  val)

Invoke the canonical callback for the data type (if any)

Parameters
valnode to change to canonical format
Returns
status; returns NO_ERR if done or skipped!
Here is the call graph for this function:

◆ val_set_child_deleted_flag()

void val_set_child_deleted_flag ( val_value_t *  val)

Set the child_deleted flag for this value node.

Parameters
valvalue node to set

◆ val_set_dirty_flag()

void val_set_dirty_flag ( val_value_t *  val,
boolean  clear_def 
)

Set the dirty flag for this value node.

Parameters
valvalue node to set
clear_defTRUE to clear the DEFSET flag
FALSE to skip the clear_default() step
Here is the call graph for this function:

◆ val_set_dname()

status_t val_set_dname ( val_value_t *  val,
const xmlChar *  dname 
)

Set the dname field.

The dname will be strdup-ed and then added

Parameters
valvalue to set
dnamename to set
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_set_dname2()

status_t val_set_dname2 ( val_value_t *  val,
const xmlChar *  dname,
uint32  dnamelen 
)

Set the dname field.

The dname will be strndup-ed and then added

Parameters
valvalue to set
dnamename to set
dnamelenlength of dname field
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_set_extern()

void val_set_extern ( val_value_t *  val,
xmlChar *  fname 
)

Setup an NCX_BT_EXTERN value.

Parameters
valvalue to setup
fnamefilespec string to set as the value

◆ val_set_extra_instance_errors()

void val_set_extra_instance_errors ( val_value_t *  val,
const xmlChar *  modname,
const xmlChar *  objname,
uint32  maxelems 
)

mark ERR_NCX_EXTRA_VAL_INST errors for nodes > 'maxelems'

Count the number of instances of the specified object name in the parent value struct. This only checks the first level under the parent, not the entire subtree Set the val-res status for all instances beyond the specified 'maxelems' count to ERR_NCX_EXTRA_VAL_INST

Parameters
valvalue to check
modnamename of module which defines the object to count
NULL (do not check module names)
objnamename of object to count
maxelemsnumber of allowed instances
Here is the call graph for this function:

◆ val_set_force_config()

void val_set_force_config ( val_value_t *  val,
boolean  is_config 
)

Set the force config flags for the object.

Parameters
valpointer to the value node to set
is_configconfig-stmt value to set
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_set_icookie()

status_t val_set_icookie ( val_value_t *  val,
int  icookie 
)

Set the SIL integer cookie in the editvars for the specified value node.

Parameters
valval_value_t struct to set
icookieinteger cookie value to set
Returns
status
Here is the call graph for this function:

◆ val_set_intern()

void val_set_intern ( val_value_t *  val,
xmlChar *  intbuff 
)

Setup an NCX_BT_INTERN value.

Parameters
valvalue to setup
intbuffinternal buffer to set as the value THIS IS LIVE MEMORY THAT WILL BE FREED IF THE VALUE IS FREED
Here is the caller graph for this function:

◆ val_set_name()

void val_set_name ( val_value_t *  val,
const xmlChar *  name,
uint32  namelen 
)

Set (or reset) the name of a value struct.

Parameters
valval_value_t data structure to check
namename string to set. This is a counted string
namelenlength of name string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_set_pcookie()

status_t val_set_pcookie ( val_value_t *  val,
void *  pcookie 
)

Set the SIL pointer cookie in the editvars for the specified value node.

Parameters
valval_value_t struct to set
pcookiepointer cookie value to set
Returns
status
Here is the call graph for this function:

◆ val_set_qname()

void val_set_qname ( val_value_t *  val,
xmlns_id_t  nsid,
const xmlChar *  name,
uint32  namelen 
)

Set (or reset) the name and namespace ID of a value struct.

Parameters
valval_value_t data structure to check
nsidnamespace ID to set
namename string to set
namelenlength of name string
Here is the call graph for this function:

◆ val_set_sil_priority()

status_t val_set_sil_priority ( val_value_t *  val,
uint8  silprio 
)

Set the secondary SIL priority.

Intended for instances of list and list-list Will not have any affect for other node types

Parameters
valvalue to set
silpriovalue instance SIL priority
Returns
status; ERR_INTERNAL_MEM if editvars could not be malloced
Here is the call graph for this function:

◆ val_set_simval()

status_t val_set_simval ( val_value_t *  val,
typ_def_t *  typdef,
xmlns_id_t  nsid,
const xmlChar *  valname,
const xmlChar *  valstr 
)

set any simple value with any typdef Set an initialized val_value_t as a simple type

Parameters
valvalue to set
typdeftypdef of expected type
nsidnamespace ID of this field
valnamename of simple value
valstrsimple value encoded as a string
Return values
*valis filled in if return NO_ERR
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_set_simval_binary()

status_t val_set_simval_binary ( val_value_t *  val,
const xmlChar *  binstr,
uint32