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

Data Structures

struct  val_getbulk_return_t_
 return value for a getbulk callback function More...
 

Typedefs

typedef boolean(* val_nodetest_fn_t) (xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
 user function callback template to test output of a specified node. More...
 
typedef status_t(* val_getbulk_cbfn_t) (obj_template_t *obj, uint32 start_idx, uint32 max_count, uint32 max_depth, val_nodetest_fn_t node_test_fn, val_getbulk_return_t *getbulk_return)
 user function callback template to bulk get operational values of a specified node. More...
 

Functions

void val_set_canonical_order (val_value_t *val)
 Set canonical order No longer used. More...
 
status_t val_gen_index_comp (const obj_key_t *in, val_value_t *val)
 Create an index component. More...
 
status_t val_gen_key_entry (val_value_t *keyval)
 Create a key record within an index comp. More...
 
status_t val_gen_index_chain (const obj_template_t *obj, val_value_t *val)
 Create an index chain for the just-parsed table or container struct. More...
 
status_t val_add_defaults (val_value_t *val, boolean scriptmode)
 Add defaults to an initialized complex value. More...
 
status_t val_add_defaults_ex (val_value_t *val, boolean scriptmode, runstack_context_t *rcxt, time_t last_modified, ncx_etag_t etag)
 add defaults to an initialized complex value (extended) More...
 
status_t val_add_node_defaults (obj_template_t *chobj, val_value_t *val, boolean scriptmode, time_t last_modified, ncx_etag_t etag)
 Check/Add defaults for the specified node and descendant nodes. More...
 
status_t val_instance_check (val_value_t *root, val_value_t *val, obj_template_t *obj)
 Check for the proper number of object instances for the specified value struct. More...
 
status_t val_instance_check_ex (val_value_t *root, val_value_t *val, obj_template_t *obj, boolean check_when)
 Check for the proper number of object instances for the specified value struct. More...
 
status_t val_instance_check_max (val_value_t *root, val_value_t *val, obj_template_t *obj, boolean check_when, boolean check_deep, ses_cb_t *scb, xml_msg_hdr_t *msg)
 Check for the proper number of object instances for the specified value struct. More...
 
val_value_t * val_get_choice_first_set (val_value_t *val, const obj_template_t *obj)
 Check a val_value_t struct against its expected OBJ to determine if a specific choice has already been set. More...
 
val_value_t * val_get_choice_first_set_full (val_value_t *val, const obj_template_t *obj)
 Check a val_value_t struct against its expected OBJ to determine if a specific choice has already been set Get the value struct for the first value set for the specified choice. More...
 
val_value_t * val_get_choice_first_set_ex (val_value_t *val, const obj_template_t *obj, boolean nondef)
 Check a val_value_t struct against its expected OBJ to determine if a specific choice has already been set Get the value struct for the first value set for the specified choice. More...
 
val_value_t * val_get_choice_next_set (const obj_template_t *obj, val_value_t *curchild)
 Check a val_value_t struct against its expected OBJ to determine if a specific choice has already been set Get the value struct for the next value set from the specified choice, afvter 'curval'. More...
 
boolean val_choice_is_set (val_value_t *val, obj_template_t *obj)
 Check a val_value_t struct against its expected OBJ to determine if a specific choice has already been set. More...
 
void val_purge_errors_from_root (val_value_t *val)
 Remove any error nodes under a root container that were saved for error recording purposes. More...
 
val_value_t * val_new_child_val (xmlns_id_t nsid, const xmlChar *name, boolean copyname, val_value_t *parent, op_editop_t editop, obj_template_t *obj)
 Internal function used by server to create a new child value. More...
 
status_t val_gen_instance_id (xml_msg_hdr_t *mhdr, const val_value_t *val, ncx_instfmt_t format, xmlChar **buff)
 Malloc and Generate the instance ID string for this value node,. More...
 
status_t val_gen_instance_id_ex (xml_msg_hdr_t *mhdr, const val_value_t *val, ncx_instfmt_t format, boolean stop_at_root, xmlChar **buff)
 Malloc and Generate the instance ID string for this value node,. More...
 
status_t val_gen_instance_id_ex2 (xml_msg_hdr_t *mhdr, const val_value_t *val, const val_value_t *stopval, ncx_instfmt_t format, boolean stop_at_root, xmlChar **buff)
 Malloc and Generate the instance ID string for this value node,. More...
 
status_t val_gen_split_instance_id (xml_msg_hdr_t *mhdr, const val_value_t *val, ncx_instfmt_t format, xmlns_id_t leaf_nsid, const xmlChar *leaf_name, boolean stop_at_root, xmlChar **buff)
 Malloc and Generate the instance ID string for this value node, Add the last node from the parameters, not the value node. More...
 
status_t val_get_index_string (xml_msg_hdr_t *mhdr, ncx_instfmt_t format, boolean force_quotes, const val_value_t *val, xmlChar *buff, uint32 *len)
 Get the index string for the specified table or container entry. More...
 
status_t val_check_obj_when (val_value_t *val, val_value_t *valroot, val_value_t *objval, obj_template_t *obj, boolean *condresult, uint32 *whencount)
 checks when-stmt only More...
 
status_t val_check_obj_when_ex (val_value_t *val, val_value_t *valroot, val_value_t *objval, obj_template_t *obj, xml_msg_hdr_t *mhdr, boolean configonly, boolean get_when, ses_cb_t *pcb_session, struct xpath_get2_cb_t_ *parent_cb, boolean *condresult, uint32 *whencount)
 checks when-stmt only (extended) More...
 
status_t val_remove_false_when (val_value_t *val, boolean *deleteme)
 Remove false when-stmt nodes. More...
 
status_t val_remove_false_when_error (const xmlChar *name, val_value_t *val, obj_template_t *obj, boolean is_error, boolean real_delete, boolean *deleteme)
 Remove false when-stmt nodes with error. More...
 
xpath_pcb_t * val_get_xpathpcb (val_value_t *val)
 Get the XPath parser control block in the specified value struct. More...
 
const xpath_pcb_t * val_get_const_xpathpcb (const val_value_t *val)
 Get the XPath parser control block in the specified value struct. More...
 
status_t val_copy_xpathpcb (val_value_t *val, const xpath_pcb_t *xpathpcb)
 Set the xpathpcb field with a clone of the parameter. More...
 
status_t val_set_xpathpcb (val_value_t *val, xpath_pcb_t *xpathpcb)
 Set the xpathpcb field with passed field;. More...
 
val_value_t * val_make_simval_obj (obj_template_t *obj, const xmlChar *valstr, status_t *res)
 Create and set a val_value_t as a simple type from an object template instead of individual fields Calls val_make_simval with the object settings. More...
 
status_t val_set_simval_obj (val_value_t *val, obj_template_t *obj, const xmlChar *valstr)
 Set an initialized val_value_t as a simple type. More...
 
val_value_t * val_make_binary_obj (obj_template_t *obj, const xmlChar *binstr, uint32 binstrlen, status_t *res)
 Malloc and set a val_value_t as a NCX_BT_BINARY type. More...
 
val_value_t * val_make_idref_obj (obj_template_t *obj, const val_idref_t *leafval, status_t *res)
 make a val_value_t for a specified leaf or leaf-list identityref More...
 
status_t val_set_warning_parms (val_value_t *parentval)
 Check the parent value struct (expected to be a container or list) for the common warning control parameters. More...
 
status_t val_set_logging_parms (val_value_t *parentval)
 Check the parent value struct (expected to be a container or list) for the common logging control parameters. More...
 
status_t val_set_logging_parms_ex (val_value_t *parentval, const xmlChar *fhs_logfile)
 Check the parent value struct (expected to be a container or list) for the full set of logging control parameters. More...
 
status_t val_set_path_parms (val_value_t *parentval)
 Set the main search paths for files. More...
 
status_t val_set_subdirs_parm (val_value_t *parentval)
 set the subdirs parameter More...
 
status_t val_set_feature_parms (val_value_t *parentval)
 Handle the YANG feature parameter set. More...
 
status_t val_set_protocols_parm (val_value_t *parentval)
 Handle the –protocols parameter. More...
 
status_t val_set_ses_protocols_parm (ses_cb_t *scb, val_value_t *parentval)
 Handle the -protocols parameter for a session. More...
 
status_t val_set_message_indent_parm (val_value_t *parentval)
 Handle the message-indent parameter. More...
 
status_t val_set_home_parms (val_value_t *parentval)
 Handle the home and yumapro-home parameters. More...
 
status_t val_set_with_ocpattern_parm (val_value_t *parentval)
 Handle the –with-ocpattern parameter. More...
 
status_t val_set_errmsg_parm (val_value_t *parentval)
 Check the parent value struct (expected to be a container or list) for the errmsg parameter. More...
 
status_t val_ok_to_partial_lock (val_value_t *val, ses_id_t sesid, ses_id_t *lockowner)
 Check if the specified root val could be locked right now by the specified session. More...
 
status_t val_set_partial_lock (val_value_t *val, plock_cb_t *plcb)
 Set the partial lock throughout the value tree. More...
 
void val_clear_partial_lock (val_value_t *val, plock_cb_t *plcb)
 Clear the partial lock throughout the value tree. More...
 
status_t val_write_ok (val_value_t *val, op_editop_t editop, ses_id_t sesid, boolean checkup, uint32 *lockid)
 Check if there are any partial-locks owned by another session in the node that is going to be written. More...
 
void val_check_swap_resnode (val_value_t *curval, val_value_t *newval)
 Maintain partial locks; Used by server only. More...
 
void val_check_delete_resnode (val_value_t *curval)
 Check if the curnode has any partial locks and if so, remove them from the final result. More...
 
void val_write_extern (ses_cb_t *scb, const val_value_t *val)
 Write an external file to the session. More...
 
void val_write_intern (ses_cb_t *scb, const val_value_t *val)
 Write an internal buffer to the session. More...
 
val_value_t * val_get_value (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, val_nodetest_fn_t testfn, boolean acmcheck, boolean *malloced, status_t *res)
 Get the value for a node after lots of internal processing. More...
 
val_value_t * val_get_value_ex (ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, val_nodetest_fn_t testfn, boolean acmcheck, boolean *malloced, status_t *res, void *get2cb)
 Get the value for a node after lots of internal processing (extended) More...
 
void val_traverse_keys (val_value_t *val, void *cookie1, void *cookie2, val_walker_fn_t walkerfn)
 Check ancestor-or-self nodes until root reached. More...
 
status_t val_build_index_chains (val_value_t *val)
 Build index chains for a value if needed. More...
 
status_t val_cache_datarule (val_value_t *val, void *rule)
 Set the data-rule back-ptr for this node. More...
 
void val_clear_datarule (val_value_t *val, const void *rule)
 Clear the datarule back-ptr for this node. More...
 
boolean val_match_datarule (const val_value_t *val, void *rule)
 Check if the data-rule back-ptr applies to this node. More...
 
val_value_t * val_find_list_from_keyvalQ (val_value_t *parentval, val_value_t *firstmatch, dlq_hdr_t *keyvalQ, status_t *res)
 Find the list entry identified by the Q of yangapi_keyval_t strings. More...
 
status_t val_move_config_false (val_value_t *newval, val_value_t *curval)
 Move the config false data nodes. More...
 
status_t val_add_one_operation_attr (val_value_t *val, op_editop_t op)
 Add the nc:operation attribute to a value node. More...
 
val_value_t * val_make_config_root (void)
 Make a <config> element. More...
 
status_t val_expand_var_expr (val_value_t *val, xmlChar **retstr)
 Expand the variable expression if found. More...
 
void val_fixup_config_subtree (val_value_t *val, xmlns_id_t fixup_id)
 Look for a config subtree (obj_is_root) and make sure all the value nodes in the subtree have proper NSID set. More...
 
status_t val_gen_keyptrs (val_value_t *val, dlq_hdr_t *keyptrQ)
 Get all the keys for the specified data node object. More...
 
status_t val_gen_keyclones (val_value_t *val, dlq_hdr_t *keyQ)
 Get all the keys for the specified data node object. More...
 
status_t val_add_datapath_attr (val_value_t *val, obj_template_t *obj)
 Add the ye:datapath attribute to a node that is tagged as an ywx:datapath node. More...
 
status_t val_add_fixed_value_attr (val_value_t *val)
 Add the ywx:fixed-value attribute to a key value node Set it to true since false is the default. More...
 
boolean val_is_fixed_value (val_value_t *val)
 Check if the specified value has a fixed-value=true attribute set in it. More...
 
status_t val_add_btype_attr (val_value_t *val, ncx_btype_t btype)
 Add the ye:btype attribute to a <key> node for a SIL-SA edit. More...
 
status_t val_convert_anyxml_to_real (val_value_t *anyxml_val, val_value_t *real_val, val_value_t **error_val)
 Convert anydata nodes to match a real template. More...
 
val_value_t * val_make_internal_value (const xmlChar *name, const xmlChar *value)
 Create an NCX_BT_INTERNAL value that contains the raw XML for the value node. More...
 
val_value_t * val_make_external_value (obj_template_t *obj, xmlChar *fname)
 Make an external value node. More...
 
boolean val_obj_has_config_defaults (val_value_t *val, obj_template_t *obj)
 Check if the object itself or child nodes can have a default. More...
 
boolean val_simple_anyxml (const val_value_t *val)
 Check if val_value node is a proper simple type ANYXML. More...
 
status_t val_apply_template (val_value_t *template_val, val_value_t *target_val)
 Apply the specified template to the val_value_t node. More...
 
status_t val_convert_children (val_value_t *srcval, val_value_t *destval)
 Convert children nodes to the template node. More...
 
void val_merge_return_vals (dlq_hdr_t *srcQ, dlq_hdr_t *dstQ)
 Merge return values into a dest Q Remove duplicates. More...
 
status_t val_set_binary_display_maxlen_parm (val_value_t *parentval)
 Handle the –binary-display-maxlen parameter. More...
 
status_t val_validate_value (val_value_t *useval)
 Verify that the value is valid and can be safely used later Used in the SIL code to ensure that the created value is correct. More...
 
boolean val_type_is_any (const val_value_t *val)
 Check if val_value node is a proper simple type ANYXML. More...
 
ncx_nmda_origin_t val_get_origin (const val_value_t *val)
 Get the NMDA origin value for this node. More...
 
void val_set_origin (val_value_t *val, ncx_nmda_origin_t origin)
 Set the NMDA value origin. More...
 
obj_template_t * val_get_casobj (val_value_t *val)
 Get the case object for the value node. More...
 
void val_set_anyxml_tracking (val_value_t *val, obj_template_t *obj)
 Set the anyxml tracking data for this node. More...
 
void val_get_anyxml_tracking (const val_value_t *val, boolean *iskey, boolean *isconfig, boolean *isunknown)
 Set the anyxml tracking data for this node. More...
 
xmlns_id_t val_get_idref_nsid (const val_value_t *val)
 get the true namespace ID for the identityref value More...
 
void val_dump_cli_valset (const char *progname, val_value_t *valset)
 dump the parameter set with and without defaults More...
 

Detailed Description

High level value node utility functions. This module contains APIs that use obj_template_t which are simpler to use than the core functions that rely on typ_def_t and other individual data fields.

Some important APIs like val_gen_index_chain and val_make_simval_obj are used by SIL and SIL-SA code.

Typedef Documentation

◆ val_getbulk_cbfn_t

typedef status_t(* val_getbulk_cbfn_t) (obj_template_t *obj, uint32 start_idx, uint32 max_count, uint32 max_depth, val_nodetest_fn_t node_test_fn, val_getbulk_return_t *getbulk_return)

user function callback template to bulk get operational values of a specified node.

val_getbulk_cbfn_t

Run a user-defined get callback function

Parameters
objobject template for the retrieval (list or leaf-list)
start_idxinteger offset of the list or leaf-list instance to start the return. First entry is zero.
max_countinteger count of max number of entries that can fit in the return array. This number is 1..N
max_depthinteger sount to descendant levels to retrieve in each entry. Value zero means no limit
getbulk_returnaddress of return getbulk data struct
Return values
*getbulk_returnis filled in, according to val_getbulk_return_t struct instructions
Returns
status of the operation

◆ val_nodetest_fn_t

typedef boolean(* val_nodetest_fn_t) (xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)

user function callback template to test output of a specified node.

This callback supports the XPath node-test rule: val_nodetest_fn_t

Run a user-defined test on the supplied node, and determine if it should be output or not.

Parameters
mhdrmessage header
withdefwith-defaults value in affect
realtestFALSE to just check object properties in the val->obj template
TRUE if OK to check the other fields
nodepointer to the value struct to check
Returns
TRUE if the node should be output
FALSE if the node should be skipped

Function Documentation

◆ val_add_btype_attr()

status_t val_add_btype_attr ( val_value_t *  val,
ncx_btype_t  btype 
)

Add the ye:btype attribute to a <key> node for a SIL-SA edit.

Parameters
valvalue node to add attribute into
btypebasetype to use in attribute value
Returns
status
Here is the call graph for this function:

◆ val_add_datapath_attr()

status_t val_add_datapath_attr ( val_value_t *  val,
obj_template_t *  obj 
)

Add the ye:datapath attribute to a node that is tagged as an ywx:datapath node.

Parameters
valvalue node to add attribute into
objobject template to use for object identifier
Returns
status
Here is the call graph for this function:

◆ val_add_defaults()

status_t val_add_defaults ( val_value_t *  val,
boolean  scriptmode 
)

Add defaults to an initialized complex value.

Go through the specified value struct and add in any defaults for missing leaf and choice nodes, that have defaults.

  !!! Only the child nodes will be checked for missing defaults
  !!! The top-level value passed to this function is assumed to
  !!! be already set

This function does not handle top-level choice object subtrees. This special case must be handled with the datadefQ for the module. If a top-level leaf value is passed in, which is from a top-level choice case-arm, then the rest of the case-arm objects will not get added by this function.

It is assumed that even top-level data-def-stmts will be handled within a <config> container, so the top-level object should always a container.

Parameters
valthe value struct to modify
scriptmodeTRUE if the value is a script object access
FALSE for normal val_get_simval access instead
Return values
*valand any sub-nodes are set to the default value as requested
Returns
status
Here is the caller graph for this function:

◆ val_add_defaults_ex()

status_t val_add_defaults_ex ( val_value_t *  val,
boolean  scriptmode,
runstack_context_t *  rcxt,
time_t  last_modified,
ncx_etag_t  etag 
)

add defaults to an initialized complex value (extended)

Go through the specified value struct and add in any defaults for missing leaf and choice nodes, that have defaults. Use a runstack_contect for adding defaults!!

  !!! Only the child nodes will be checked for missing defaults
  !!! The top-level value passed to this function is assumed to
  !!! be already set

This function does not handle top-level choice object subtrees. This special case must be handled with the datadefQ for the module. If a top-level leaf value is passed in, which is from a top-level choice case-arm, then the rest of the case-arm objects will not get added by this function.

It is assumed that even top-level data-def-stmts will be handled within a <config> container, so the top-level object should always a container.

Parameters
valthe node to add defaults into; expecting container or list to check the descendant nodes
scriptmodeTRUE if the value is a script object access
FALSE for normal val_get_simval access instead
rcxtrunstack contect to use (may be NULL)
last_modifiedtimestamp to set in new value
etagentity tag to set in new value
Return values
*val->indexQhas entries added for each index component, if NO_ERR
Returns
status
Here is the caller graph for this function:

◆ val_add_fixed_value_attr()

status_t val_add_fixed_value_attr ( val_value_t *  val)

Add the ywx:fixed-value attribute to a key value node Set it to true since false is the default.

Parameters
valvalue node to add attribute into
Returns
status
Here is the call graph for this function:

◆ val_add_node_defaults()

status_t val_add_node_defaults ( obj_template_t *  chobj,
val_value_t *  val,
boolean  scriptmode,
time_t  last_modified,
ncx_etag_t  etag 
)

Check/Add defaults for the specified node and descendant nodes.

This function is called from the server only

Parameters
chobjtop-lvel object to add defaults to
valthe node to add defaults into; expecting container or list to check the descendant nodes
scriptmodeTRUE if the value is a script object access
FALSE for normal val_get_simval access instead
last_modifiedtimestamp to set in new value
etagentity tag to set in new value
Return values
*val->indexQhas entries added for each index component, if NO_ERR
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_add_one_operation_attr()

status_t val_add_one_operation_attr ( val_value_t *  val,
op_editop_t  op 
)

Add the nc:operation attribute to a value node.

Parameters
valvalue node to set
opedit operation to use
Returns
status
Here is the call graph for this function:

◆ val_apply_template()

status_t val_apply_template ( val_value_t *  template_val,
val_value_t *  target_val 
)

Apply the specified template to the val_value_t node.

Only supported if templates are enabled in the server

Parameters
template_valtemplate to apply
target_valvalue from edit to expand with template
Returns
status
Here is the call graph for this function:

◆ val_build_index_chains()

status_t val_build_index_chains ( val_value_t *  val)

Build index chains for a value if needed.

Check descendant-or-self nodes for lists Check if they have index chains built already If not, then try to add one for each of the key objects in order

Parameters
valvalue node to start check from
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_cache_datarule()

status_t val_cache_datarule ( val_value_t *  val,
void *  rule 
)

Set the data-rule back-ptr for this node.

Used by the server NACM implementation

Parameters
valvalue struct to use
rulebackptr to NACM rule
Returns
status: ERR_NCX_RESOURCE_DENIED if max data rules reached
Here is the call graph for this function:

◆ val_check_delete_resnode()

void val_check_delete_resnode ( val_value_t *  curval)

Check if the curnode has any partial locks and if so, remove them from the final result.

Parameters
curvalcurrent node to check
Here is the call graph for this function:

◆ val_check_obj_when()

status_t val_check_obj_when ( val_value_t *  val,
val_value_t *  valroot,
val_value_t *  objval,
obj_template_t *  obj,
boolean *  condresult,
uint32 *  whencount 
)

checks when-stmt only

Check if the specified object node is conditionally TRUE or FALSE, based on any when statements attached to the child node

Parameters
valparent value node of the object node to check
valrootdatabase root for XPath purposes
objvaldatabase value node to check (may be NULL)
objobject template of data node object to check
condresultaddress of conditional test result
whencountaddress of number of when-stmts tested (may be NULL if caller does not care)
Return values
*condresultTRUE if conditional is true or there are none FALSE if conditional test failed
*whencountnumber of when-stmts tested this can be 0 if *condresult == TRUE
Returns
status
Here is the call graph for this function:

◆ val_check_obj_when_ex()

status_t val_check_obj_when_ex ( val_value_t *  val,
val_value_t *  valroot,
val_value_t *  objval,
obj_template_t *  obj,
xml_msg_hdr_t *  mhdr,
boolean  configonly,
boolean  get_when,
ses_cb_t *  pcb_session,
struct xpath_get2_cb_t_ parent_cb,
boolean *  condresult,
uint32 *  whencount 
)

checks when-stmt only (extended)

Check if the specified object node is conditionally TRUE or FALSE, based on any when statements attached to the child node

From RFC 6020, sec. 7.19.5

 The XPath expression is conceptually evaluated in the following
   context, in addition to the definition in Section 6.4.1:
   o  If the "when" statement is a child of an "augment" statement, then
      the context node is the augment's target node in the data tree, if
      the target node is a data node.  Otherwise, the context node is
      the closest ancestor node to the target node that is also a data
      node.
   o  If the "when" statement is a child of a "uses", "choice", or
      "case" statement, then the context node is the closest ancestor
      node to the "uses", "choice", or "case" node that is also a data
      node.
   o  If the "when" statement is a child of any other data definition
      statement, the context node is the data definition's node in the
      data tree.
   o  The accessible tree is made up of all nodes in the data tree, and
      all leafs with default values in use (see Section 7.6.1).
Parameters
valparent value node of the object node to check
valrootdatabase root for XPath purposes
objvaldatabase value node to check (may be NULL)
objobject template of data node object to check
mhdrdummy or real message header to use if GET2 needed
configonlyTRUE for config datastore test; FALSE otherwise
get_whenTRUE if this is an eval of a when-stmt during a GET
pcb_sessionsession to use in the pcb->scb field that will be passed to GET2 callbacks and tested for NULL (e.g. get2-test)
parent_cbparent node if val is not used as parent, NULL to use val
condresultaddress of conditional test result
whencountaddress of number of when-stmts tested (may be NULL if caller does not care)
Return values
*condresultTRUE if conditional is true or there are none FALSE if conditional test failed
*whencountnumber of when-stmts tested this can be 0 if *condresult == TRUE
Returns
status
Here is the caller graph for this function:

◆ val_check_swap_resnode()

void val_check_swap_resnode ( val_value_t *  curval,
val_value_t *  newval 
)

Maintain partial locks; Used by server only.

Check if the curnode has any partial locks and if so, transfer them to the new node and change any resnodes as well

Parameters
curvalcurrent node to check
newvalnew value taking its place
Here is the call graph for this function:

◆ val_choice_is_set()

boolean val_choice_is_set ( val_value_t *  val,
obj_template_t *  obj 
)

Check a val_value_t struct against its expected OBJ to determine if a specific choice has already been set.

Check that all the mandatory config fields in the selected case are set

Parameters
valparent of the choice object to check
objchoice object to check
Returns
pointer to first value struct or NULL if choice not set
Here is the call graph for this function:

◆ val_clear_datarule()

void val_clear_datarule ( val_value_t *  val,
const void *  rule 
)

Clear the datarule back-ptr for this node.

Used by the server NACM implementation

Parameters
valvalue struct to use
rulebackptr to NACM rule to clear
Here is the call graph for this function:

◆ val_clear_partial_lock()

void val_clear_partial_lock ( val_value_t *  val,
plock_cb_t *  plcb 
)

Clear the partial lock throughout the value tree.

Parameters
valstart value struct to use
plcbpartial lock to clear
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_convert_anyxml_to_real()

status_t val_convert_anyxml_to_real ( val_value_t *  anyxml_val,
val_value_t *  real_val,
val_value_t **  error_val 
)

Convert anydata nodes to match a real template.

Need to convert the anyxml val_value_t tree so the correct YANG object templates are used instead of the generic anyxml nodes.

  • Lists need to be identified and the index chains setup.
  • XPath and QName content needs to be converted to real values.
  • Union, leafref and identityref values also need to be setup correctly
  • defaults need to be added after conversion

The entire tree will be processed top-down. The tree can be a leaf, container, or list. If any value errors occur or extra unknown nodes are found, then the *error_val will be set to that node, and an error will be returned.

Parameters
anyxml_valvalue node that is supposed to represent the real_val
real_valvalue node that represents the real template to use
error_valaddress of return error node pointer
Return values
*error_valreturn error node pointer (if res != NO_ERR)
NULL if NO_ERR is returned
Returns
status

◆ val_convert_children()

status_t val_convert_children ( val_value_t *  srcval,
val_value_t *  destval 
)

Convert children nodes to the template node.

Internal API for template support Check the src val for all child nodes and add a corresponding node in the dest val, using the correct object template This is a simple 1:1 value and name mapping

Parameters
srcvalsource value node to check for child nodes to copy
destvalempty destination container or list to fill
Returns
status
Here is the call graph for this function:

◆ val_copy_xpathpcb()

status_t val_copy_xpathpcb ( val_value_t *  val,
const xpath_pcb_t *  xpathpcb 
)

Set the xpathpcb field with a clone of the parameter.

Parameters
valvalue to use
xpathpcbstruct xpath_pcb_t_ to copy from
Returns
status
Here is the call graph for this function:

◆ val_dump_cli_valset()

void val_dump_cli_valset ( const char *  progname,
val_value_t *  valset 
)

dump the parameter set with and without defaults

Parameters
prognameprogram name to display
valsetvalue to dump
Here is the call graph for this function:

◆ val_expand_var_expr()

status_t val_expand_var_expr ( val_value_t *  val,
xmlChar **  retstr 
)

Expand the variable expression if found.

Check if the string node is a data template variable The val_value_t must have already been properly parsed so the VAL_FL_IS_VAREXPR flag set if this is a complex var expression

Parameters
valaddress of val_value_t being set
retstraddress of return expanded string
Return values
*retstrmalloced string to use for expanded simple variable expr expansion
Returns
status; ERR_NCX_SKIPPED if this is not a variable NO_ERR if there is a simple variable expression that was processed correctly; == some error if any error occurred
Here is the call graph for this function:

◆ val_find_list_from_keyvalQ()

val_value_t* val_find_list_from_keyvalQ ( val_value_t *  parentval,
val_value_t *  firstmatch,
dlq_hdr_t *  keyvalQ,
status_t *  res 
)

Find the list entry identified by the Q of yangapi_keyval_t strings.

Parameters
parentvalvalue node to start check from; parent of the list entries
firstmatchfirst instance of the list entry to find
keyvalQQ of yangapi_keyval_t structs representing the string value of each key
resaddress of return status
Return values
*resreturn status (NO_ERR + NULL return == no entry found)
Returns
pointer to found entry (if *res == NO_ERR)

◆ val_fixup_config_subtree()

void val_fixup_config_subtree ( val_value_t *  val,
xmlns_id_t  fixup_id 
)

Look for a config subtree (obj_is_root) and make sure all the value nodes in the subtree have proper NSID set.

  >>> IT IS ASSUMED THAT ONLY VALID NODES ARE PRESENT
  >>> AND ALL ERROR NODES HAVE BEEN PURGED ALREADY
Parameters
valvalue node to fixup
fixup_idNSID of the node to find and change (also find 0)
Return values
valand descendant nodes may be altered
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_gen_index_chain()

status_t val_gen_index_chain ( const obj_template_t *  obj,
val_value_t *  val 
)

Create an index chain for the just-parsed table or container struct.

This is the correct API for SIL code to use when constructing a val_value_t tree for a list. This function must be called after all the key leafs have been added to the 'val' entry

Parameters
objlist object containing the keyQ
valthe just parsed table row with the childQ containing nodes to check as index nodes
Return values
*val->indexQhas entries added for each index component, if NO_ERR
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_gen_index_comp()

status_t val_gen_index_comp ( const obj_key_t *  in,
val_value_t *  val 
)

Create an index component.

Parameters
inobj_key_t in the chain to process
valthe just parsed table row with the childQ containing nodes to check as index nodes
Return values
val->indexQwill get a val_index_t record added if return NO_ERR
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_gen_instance_id()

status_t val_gen_instance_id ( xml_msg_hdr_t *  mhdr,
const val_value_t *  val,
ncx_instfmt_t  format,
xmlChar **  buff 
)

Malloc and Generate the instance ID string for this value node,.

Parameters
mhdrmessage hdr w/ prefix map or NULL to just use the internal prefix mappings
valnode to generate the instance ID for
formatdesired output format (NCX or Xpath)
buffpointer to address of buffer to use
Return values
mhdr.pmapmay have entries added if prefixes used in the instance identifier which are not already in the pmap
*buffmalloced buffer with the instance ID
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_gen_instance_id_ex()

status_t val_gen_instance_id_ex ( xml_msg_hdr_t *  mhdr,
const val_value_t *  val,
ncx_instfmt_t  format,
boolean  stop_at_root,
xmlChar **  buff 
)

Malloc and Generate the instance ID string for this value node,.

Parameters
mhdrmessage hdr w/ prefix map or NULL to just use the internal prefix mappings
valnode to generate the instance ID for
formatdesired output format (NCX or Xpath)
stop_at_rootTRUE to stop if a 'root' node is encountered
FALSE to keep recursing all the way to
buffpointer to address of buffer to use
Return values
mhdr.pmapmay have entries added if prefixes used in the instance identifier which are not already in the pmap
*buffmalloced buffer with the instance ID
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_gen_instance_id_ex2()

status_t val_gen_instance_id_ex2 ( xml_msg_hdr_t *  mhdr,
const val_value_t *  val,
const val_value_t *  stopval,
ncx_instfmt_t  format,
boolean  stop_at_root,
xmlChar **  buff 
)

Malloc and Generate the instance ID string for this value node,.

Used internally - do not use Allows partial identifier to be created using a node in the path as the rooy

Parameters
mhdrmessage hdr w/ prefix map or NULL to just use the internal prefix mappings
valnode to generate the instance ID for
stopvalfake root to stop at as if the root; ancestor of val
formatdesired output format (NCX or Xpath)
stop_at_rootTRUE to stop if a 'root' node is encountered
FALSE to keep recursing all the way to
buffpointer to address of buffer to use
Return values
mhdr.pmapmay have entries added if prefixes used in the instance identifier which are not already in the pmap
*buffmalloced buffer with the instance ID
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_gen_key_entry()

status_t val_gen_key_entry ( val_value_t *  keyval)

Create a key record within an index comp.

Parameters
keyvalthe just parsed table row with the childQ containing nodes to check as index nodes
Return values
keyval->parent->indexQwill get a val_index_t record added if return NO_ERR
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_gen_keyclones()

status_t val_gen_keyclones ( val_value_t *  val,
dlq_hdr_t *  keyQ 
)

Get all the keys for the specified data node object.

Create a copy of each key Keys are gathered in reverse order!!!

Parameters
valvalue node to use
keyQQ of val_value_t to use
Return values
keyQwill have 1 entry added for each ancestor key
Returns
status

◆ val_gen_keyptrs()

status_t val_gen_keyptrs ( val_value_t *  val,
dlq_hdr_t *  keyptrQ 
)

Get all the keys for the specified data node object.

Generate a backptr to the key leaf val_value_t Keys are gathered in reverse order!!!

Parameters
valvalue node to use
keyptrQQ of ncx_backptr_t to val_value_t to use
Return values
keyptrQwill have 1 entry added for each ancestor key
Returns
status

◆ val_gen_split_instance_id()

status_t val_gen_split_instance_id ( xml_msg_hdr_t *  mhdr,
const val_value_t *  val,
ncx_instfmt_t  format,
xmlns_id_t  leaf_nsid,
const xmlChar *  leaf_name,
boolean  stop_at_root,
xmlChar **  buff 
)

Malloc and Generate the instance ID string for this value node, Add the last node from the parameters, not the value node.

Do not use – needed for special case parsing

Parameters
mhdrmessage hdr w/ prefix map or NULL to just use the internal prefix mappings
valnode to generate the instance ID for
formatdesired output format (NCX or Xpath)
leaf_nsidnamespace ID of the leaf to add
leaf_namename string of the leaf to add
stop_at_rootTRUE to stop if a 'root' node is encountered
FALSE to keep recursing all the way to
buffpointer to address of buffer to use
Return values
mhdr.pmapmay have entries added if prefixes used in the instance identifier which are not already in the pmap
*buffmalloced buffer with the instance ID
Returns
status
Here is the call graph for this function:

◆ val_get_anyxml_tracking()

void val_get_anyxml_tracking ( const val_value_t *  val,
boolean *  iskey,
boolean *  isconfig,
boolean *  isunknown 
)

Set the anyxml tracking data for this node.

Parameters
valvalue to check
iskeyaddress of return iskey flag
isconfigaddress of return isconfig flag
isunknownaddress of return isunknown flag
Return values
*iskeyreturn iskey flag
*isconfigreturn isconfig flag
*isunknownreturn isunknown flag

◆ val_get_casobj()

obj_template_t* val_get_casobj ( val_value_t *  val)

Get the case object for the value node.

Parameters
valvalue to use
Returns
struct obj_template_t if case object set ; NULL if not
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_get_choice_first_set()

val_value_t* val_get_choice_first_set ( val_value_t *  val,
const obj_template_t *  obj 
)

Check a val_value_t struct against its expected OBJ to determine if a specific choice has already been set.

Get the value struct for the first value set for the specified choice

The val_find_child function can also be used to test directly for a case member. Choice and case nodes do not exist in the value tree.

Parameters
valval_value_t to check
objchoice object to check
Returns
pointer to first value struct or NULL if choice not set
Here is the call graph for this function:

◆ val_get_choice_first_set_ex()

val_value_t* val_get_choice_first_set_ex ( val_value_t *  val,
const obj_template_t *  obj,
boolean  nondef 
)

Check a val_value_t struct against its expected OBJ to determine if a specific choice has already been set Get the value struct for the first value set for the specified choice.

Parameters
valval_value_t to check
objchoice object to check
nondefTRUE for non-default only; FALSE for any set from this case
Returns
pointer to first value struct or NULL if choice not set
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_get_choice_first_set_full()

val_value_t* val_get_choice_first_set_full ( val_value_t *  val,
const obj_template_t *  obj 
)

Check a val_value_t struct against its expected OBJ to determine if a specific choice has already been set Get the value struct for the first value set for the specified choice.

Checks all children deep, including complex children

Parameters
valval_value_t to check
objchoice object to check
Returns
pointer to first value struct or NULL if choice not set
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_get_choice_next_set()

val_value_t* val_get_choice_next_set ( const obj_template_t *  obj,
val_value_t *  curchild 
)

Check a val_value_t struct against its expected OBJ to determine if a specific choice has already been set Get the value struct for the next value set from the specified choice, afvter 'curval'.

Parameters
objchoice object to check
curchildcurrent child selected from this choice (obj)
Returns
pointer to first value struct or NULL if choice not set
Here is the call graph for this function:

◆ val_get_const_xpathpcb()

const xpath_pcb_t* val_get_const_xpathpcb ( const val_value_t *  val)

Get the XPath parser control block in the specified value struct.

Parameters
valvalue struct to check
Returns
pointer to xpath control block or NULL if none

◆ val_get_idref_nsid()

xmlns_id_t val_get_idref_nsid ( const val_value_t *  val)

get the true namespace ID for the identityref value

Parameters
valvalue to check
Returns
namespace ID or 0 if some error

◆ val_get_index_string()

status_t val_get_index_string ( xml_msg_hdr_t *  mhdr,
ncx_instfmt_t  format,
boolean  force_quotes,
const val_value_t *  val,
xmlChar *  buff,
uint32 *  len 
)

Get the index string for the specified table or container entry.

Parameters
mhdrmessage hdr w/ prefix map or NULL to just use the internal prefix mappings
formatdesired output format
force_quotesTRUE to force quotes for config file mode
valval_value_t for table or container
buffbuffer to hold result; NULL means get length only
lenaddress of index string length
Return values
*mhdrmhdr.pmap may have entries added if prefixes used in the instance identifier which are not already in the pmap
*bufffilled in if set
*lennumber of bytes that were (or would have been) written to buff
Returns
status

◆ val_get_origin()

ncx_nmda_origin_t val_get_origin ( const val_value_t *  val)

Get the NMDA origin value for this node.

Parameters
valdatastore val to get the origin from
Returns
the ncx_nmda_origin_t enum or NCX_NMDA_DS_NONE if not set
Here is the caller graph for this function:

◆ val_get_value()

val_value_t* val_get_value ( ses_cb_t *  scb,
xml_msg_hdr_t *  msg,
val_value_t *  val,
val_nodetest_fn_t  testfn,
boolean  acmcheck,
boolean *  malloced,
status_t *  res 
)

Get the value for a node after lots of internal processing.

THIS IS NOT A SIL OR SIL-SA API

Get the value node for output to a session Checks access control if enabled Checks filtering via testfn if non-NULL

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
valvalue to write (node from system)
testfncallback function to use, NULL if not used
acmcheckTRUE if NACM should be checked; FALSE to skip
mallocedaddress of return malloced flag
resaddress of return status
Return values
*mallocedTRUE if thereturn value was malloced
FALSE if it is just a pointer to 'val'
*resreturn status
Returns
value node to use; this is malloced if *malloced is TRUE
NULL if some error; check *res
!!!! check for ERR_NCX_SKIPPED !!!
Here is the call graph for this function:

◆ val_get_value_ex()

val_value_t* val_get_value_ex ( ses_cb_t *  scb,
xml_msg_hdr_t *  msg,
val_value_t *  val,
val_nodetest_fn_t  testfn,
boolean  acmcheck,
boolean *  malloced,
status_t *  res,
void *  get2cb 
)

Get the value for a node after lots of internal processing (extended)

THIS IS NOT A SIL OR SIL-SA API FUNCTION val_get_value_ex

Get the value node for output to a session Checks access control if enabled Checks filtering via testfn if non-NULL Version 2: GET2 support

Parameters
scbsession control block
msgxml_msg_hdr_t in progress
valvalue to write (node from system)
testfncallback function to use, NULL if not used
acmcheckTRUE if NACM should be checked; FALSE to skip
mallocedaddress of return malloced flag
resaddress of return status
get2cbGET2 control block or NULL if not used
Return values
*mallocedTRUE if thereturn value was malloced; FALSE if it is just a pointer to 'val'
*resreturn status
Returns
value node to use; this is malloced if *malloced is TRUE NULL if some error; check *res; !!!! check for ERR_NCX_SKIPPED !!!
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_get_xpathpcb()

xpath_pcb_t* val_get_xpathpcb ( val_value_t *  val)

Get the XPath parser control block in the specified value struct.

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

◆ val_instance_check()

status_t val_instance_check ( val_value_t *  root,
val_value_t *  val,
obj_template_t *  obj 
)

Check for the proper number of object instances for the specified value struct.

Checks the direct accessible children of 'val' only!!! Log errors as needed and mark val->res as needed

Parameters
rootthe docroot for XPath processing
valcontext node value to use (val->obj usually == obj)
objusually the val->obj field except for choice/case processing.
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_instance_check_ex()

status_t val_instance_check_ex ( val_value_t *  root,
val_value_t *  val,
obj_template_t *  obj,
boolean  check_when 
)

Check for the proper number of object instances for the specified value struct.

Extended.

Checks the direct accessible children of 'val' only!!! Log errors as needed and mark val->res as needed &

Parameters
rootthe docroot for XPath processing
valcontext node value to use (val->obj usually == obj)
objusually the val->obj field except for choice/case processing.
check_whenTRUE to check false when; FALSE if already done
Returns
status
Here is the call graph for this function:

◆ val_instance_check_max()

status_t val_instance_check_max ( val_value_t *  root,
val_value_t *  val,
obj_template_t *  obj,
boolean  check_when,
boolean  check_deep,
ses_cb_t *  scb,
xml_msg_hdr_t *  msg 
)

Check for the proper number of object instances for the specified value struct.

Checks the direct accessible children of 'val' only!!!

Parameters
rootthe docroot for XPath processing
valcontext node value to use (val->obj usually == obj)
objusually the val->obj field except for choice/case processing.
check_whenTRUE to check false when; FALSE if already done
check_deepTRUE to recurse for descendant nodes; FALSE for just the just nodes; will not attempt to process a node that is tagged as ncx:root!!!!
scbsession control block to use (may be NULL)
msgmsg to record errors (may be NULL)
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_is_fixed_value()

boolean val_is_fixed_value ( val_value_t *  val)

Check if the specified value has a fixed-value=true attribute set in it.

Parameters
valvalue node to check
Returns
TRUE if this is tagged as fixed-value=true; FALSE if not
Here is the call graph for this function:

◆ val_make_binary_obj()

val_value_t* val_make_binary_obj ( obj_template_t *  obj,
const xmlChar *  binstr,
uint32  binstrlen,
status_t *  res 
)

Malloc and set a val_value_t as a NCX_BT_BINARY type.

Parameters
objobject template to use set binary object
binstrsimple value encoded as a binary buffer
binstrlenlength of binstr (not zero-terminated)
resaddress of return status
Return values
*resreturn status
Returns
malloced val struct filled in; NULL if malloc failed
Here is the call graph for this function:

◆ val_make_config_root()

val_value_t* val_make_config_root ( void  )

Make a <config> element.

Returns
malloced config root or NULL if memory error
Here is the call graph for this function:

◆ val_make_external_value()

val_value_t* val_make_external_value ( obj_template_t *  obj,
xmlChar *  fname 
)

Make an external value node.

Parameters
objobject template to use
fnamefilespec string to set as the value (PASS OFF MEMORY)
Returns
malloced val_value_t containing the requested filename
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_make_idref_obj()

val_value_t* val_make_idref_obj ( obj_template_t *  obj,
const val_idref_t *  leafval,
status_t *  res 
)

make a val_value_t for a specified leaf or leaf-list identityref

Parameters
objname of module defining leaf (may be NULL to pick parent)
leafvalidentityref value for leaf
resaddress of return status
Return values
*resreturn status
Returns
malloced value struct or NULL if some error
Here is the call graph for this function:

◆ val_make_internal_value()

val_value_t* val_make_internal_value ( const xmlChar *  name,
const xmlChar *  value 
)

Create an NCX_BT_INTERNAL value that contains the raw XML for the value node.

namespaces may be added if they are correct. They may also be left out of the 'value' buffer

Parameters
namename of wrapper element
valueZ-terminated buffer with XML value within it
Returns
malloced val_value_t containing the requested internal content
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_make_simval_obj()

val_value_t* val_make_simval_obj ( obj_template_t *  obj,
const xmlChar *  valstr,
status_t *  res 
)

Create and set a val_value_t as a simple type from an object template instead of individual fields Calls val_make_simval with the object settings.

This API is the preferred method to create a leaf in SIL or SIL-SA code. This will use correct settings from the object template

Parameters
objobject template to use
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_match_datarule()

boolean val_match_datarule ( const val_value_t *  val,
void *  rule 
)

Check if the data-rule back-ptr applies to this node.

Parameters
valvalue struct to use
rulebackptr to NACM rule to check
Returns
TRUE if rule applies to 'val'; FALSE if not
Here is the call graph for this function:

◆ val_merge_return_vals()

void val_merge_return_vals ( dlq_hdr_t *  srcQ,
dlq_hdr_t *  dstQ 
)

Merge return values into a dest Q Remove duplicates.

Parameters
srcQQ of val_value_t to drain
dstQQ of val_value_t to fill

◆ val_move_config_false()

status_t val_move_config_false ( val_value_t *  newval,
val_value_t *  curval 
)

Move the config false data nodes.

Used by server only

Look for all the child nodes of the newval and any config-false child nodes will moved

  *** does not traverse into nested config=true
  *** nodes looking for config=false nodes to mode
  *** just moves direct child nodes that are config=false

Move from curval to newval because newval is replacing curval

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

◆ val_new_child_val()

val_value_t* val_new_child_val ( xmlns_id_t  nsid,
const xmlChar *  name,
boolean  copyname,
val_value_t *  parent,
op_editop_t  editop,
obj_template_t *  obj 
)

Internal function used by server to create a new child value.

Used in XPath processing using dusing node parsing

Parameters
nsidnamespace ID of name
namename string (direct or strdup, based on copyname)
copynameTRUE is dname strdup should be used
parentparent node
editoprequested edit operation
objobject template to use
Returns
status
Here is the call graph for this function:

◆ val_obj_has_config_defaults()

boolean val_obj_has_config_defaults ( val_value_t *  val,
obj_template_t *  obj 
)

Check if the object itself or child nodes can have a default.

In case of choice btype also checks value that is being modified: check if the choice has been set at all use the actuall selected case instead of the default case

Parameters
valthe value struct being checked
objobject to check
Returns
TRUE if can have a default; FALSE if not

◆ val_ok_to_partial_lock()

status_t val_ok_to_partial_lock ( val_value_t *  val,
ses_id_t  sesid,
ses_id_t lockowner 
)

Check if the specified root val could be locked right now by the specified session.

Parameters
valdata node that will be locked
sesidsession ID requesting the partial lock
lockowneraddress of first lock owner violation
Return values
*lockownerpointer to first lock owner violation
Returns
status: if any error, then val_clear_partial_lock MUST be called with the start root, to back out any partial operations. This can happen if the max number of
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_purge_errors_from_root()

void val_purge_errors_from_root ( val_value_t *  val)

Remove any error nodes under a root container that were saved for error recording purposes.

Parameters
valroot container to purge

◆ val_remove_false_when()

status_t val_remove_false_when ( val_value_t *  val,
boolean *  deleteme 
)

Remove false when-stmt nodes.

Called by CLI to remove false when-stmt CLI parameters Called by agt_val voia val_delete_default_npcon

checks when-stmt only Check if the specified value node and all its descendants conditionally TRUE or FALSE, based on any when statements attached to the child node If false, and not set by default, the node will be removed

Parameters
valparent value node of the object node to check
deletemeaddress of delete flag for val itself
Return values
*deletemeTRUE if this node is itself hasfalse when-stmts descendants of false whe
Returns
status
Here is the caller graph for this function:

◆ val_remove_false_when_error()

status_t val_remove_false_when_error ( const xmlChar *  name,
val_value_t *  val,
obj_template_t *  obj,
boolean  is_error,
boolean  real_delete,
boolean *  deleteme 
)

Remove false when-stmt nodes with error.

Called by yangcli to check an <rpc> that is about the be output to the server. False when-stnt nodes are errors in rpc-input

Parameters
namename of element, internal use, default is 'data'
valparent value node of the object node to check
objobj_template to parse 'val' against
is_errorTRUE for error; FALSE for warning
real_deleteTRUE to do real deletes; FALSE to just print msgs
deletemeaddress of delete flag for val itself
Return values
*deletemeTRUE if this node is itself hasfalse when-stmts descendants of false whe
Returns
status

◆ val_set_anyxml_tracking()

void val_set_anyxml_tracking ( val_value_t *  val,
obj_template_t *  obj 
)

Set the anyxml tracking data for this node.

Parameters
valvalue to set
objobject to use to set anyxml tracking bits
Here is the call graph for this function:

◆ val_set_binary_display_maxlen_parm()

status_t val_set_binary_display_maxlen_parm ( val_value_t *  parentval)

Handle the –binary-display-maxlen parameter.

–binary-display-maxlen=<uint32>

Parameters
parentvalCLI container to check for the parm
Returns
status
Here is the call graph for this function:

◆ val_set_canonical_order()

void val_set_canonical_order ( val_value_t *  val)

Set canonical order No longer used.

THIS FUNCTION IS REMOVED!!!! IT DOES NOT DO ANYTHING!!!!

Change the child XML nodes throughout an entire subtree to the canonical order defined in the object template

IT IS ASSUMED THAT ONLY VALID NODES ARE PRESENT AND ALL ERROR NODES HAVE BEEN PURGED ALREADY

There is no canonical order defined for the contents of the following nodes:

  • anyxml leaf
  • ordered-by user leaf-list

These nodes are not ordered, but their child nodes are ordered

  • ncx:root container
  • ordered-by user list

Leaf objects will not be processed, if val is OBJ_TYP_LEAF Leaf-list objects will not be processed, if val is OBJ_TYP_LEAF_LIST. These object types must be processed within the context of the parent object.

List child key nodes are ordered first among all of the list's child nodes.

List nodes with system keys are not kept in sorted order This is not required by YANG. Instead the user-given order servers as the canonical order. It is up to the application setting the config to pick an order for the list nodes.

Also, leaf-list order is not changed, regardless of the order. The default insert order is 'last'.

Parameters
valvalue node to change to canonical order
Return values
val->v.childQmay be reordered, for all complex types in the subtree
Here is the caller graph for this function:

◆ val_set_errmsg_parm()

status_t val_set_errmsg_parm ( val_value_t *  parentval)

Check the parent value struct (expected to be a container or list) for the errmsg parameter.

prints an error message if an ncx_errmsg_t record cannot be added

Parameters
parentvalCLI container to check for these parameters
Returns
status
Here is the call graph for this function:

◆ val_set_feature_parms()

status_t val_set_feature_parms ( val_value_t *  parentval)

Handle the YANG feature parameter set.

    --feature-code-default
    --feature-enable-default
    --feature-static
    --feature-dynamic
    --feature-enable
    --feature-disable

Handle the feature-related CLI parms for the specified value set

Not all of these parameters are supported in all programs The object tree is not checked, just the value tree

Parameters
parentvalCLI container to check for the feature parms
Returns
status
Here is the call graph for this function:

◆ val_set_home_parms()

status_t val_set_home_parms ( val_value_t *  parentval)

Handle the home and yumapro-home parameters.

    --home=/some/dir
    --yumapro-home=/some/dir
Parameters
parentvalCLI container to check for these parameters
Returns
status
Here is the call graph for this function:

◆ val_set_logging_parms()

status_t val_set_logging_parms ( val_value_t *  parentval)

Check the parent value struct (expected to be a container or list) for the common logging control parameters.

invoke the logging parms that are present

Called by CLI and .conf file handlers after the CLI 'valset' has been parsed. The logging parameters are checked and set in the NCX layer if found

prints an error message if any errors occur

    --log=filename
    --log-level=<debug-enum>
    --log-append=<boolean>
Parameters
parentvalparent value struct to check
Returns
status
Here is the call graph for this function:

◆ val_set_logging_parms_ex()

status_t val_set_logging_parms_ex ( val_value_t *  parentval,
const xmlChar *  fhs_logfile 
)

Check the parent value struct (expected to be a container or list) for the full set of logging control parameters.

invoke the logging parms that are present

Called by CLI and .conf file handlers after the CLI 'valset' has been parsed. The logging parameters are checked and set in the NCX layer if found

prints an error message if any errors occur

    --log-level
    --log-syslog
    --log-vendor
    --log-syslog-level
    --log-pthread-level
    --log-mirroring
    --log-console
    --log-append
    --log-stderr
    --log
    --log-backtrace
    --log-backtrace-detail
    --log-backtrace-level
    --log-backtrace-stream
    --log-header
    --log-suppress-ctrl
Parameters
parentvalparent value struct to check
fhs_logfilelog filespec for server FHS mode
NULL if not used
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_set_message_indent_parm()

status_t val_set_message_indent_parm ( val_value_t *  parentval)

Handle the message-indent parameter.

–message-indent=<number> (-1 .. 9)

Parameters
parentvalCLI container to check for the message-indent parm
Returns
status
Here is the call graph for this function:

◆ val_set_origin()

void val_set_origin ( val_value_t *  val,
ncx_nmda_origin_t  origin 
)

Set the NMDA value origin.

Parameters
valdatastore val to set the origin for
originorigin enum to set

◆ val_set_partial_lock()

status_t val_set_partial_lock ( val_value_t *  val,
plock_cb_t *  plcb 
)

Set the partial lock throughout the value tree.

Parameters
valstart value struct to use
plcbpartial lock to set on entire subtree
Returns
status: if any error, then val_clear_partial_lock MUST be called with the start root, to back out any partial operations. This can happen if the max number of locks reached or lock already help by another session
Here is the call graph for this function:

◆ val_set_path_parms()

status_t val_set_path_parms ( val_value_t *  parentval)

Set the main search paths for files.

    --datapath
    --modpath
    --runpath

Check the specified value set for the 3 path CLI parms and override the environment variable setting, if any.

Not all of these parameters are supported in all programs The object tree is not checked, just the value tree

Parameters
parentvalCLI container to check for the runpath, modpath, and datapath variables
Returns
status
Here is the call graph for this function:

◆ val_set_protocols_parm()

status_t val_set_protocols_parm ( val_value_t *  parentval)

Handle the –protocols parameter.

–protocols=bits [netconf1.0, netconf1.1]

Parameters
parentvalCLI container to check for the protocols parm
Returns
status: at least 1 protocol must be selected
Here is the call graph for this function:

◆ val_set_ses_protocols_parm()

status_t val_set_ses_protocols_parm ( ses_cb_t *  scb,
val_value_t *  parentval 
)

Handle the -protocols parameter for a session.

–protocols=bits [netconf1.0, netconf1.1]

Parameters
scbsession control block to use
parentvalCLI container to check for the protocols parm
Returns
status: at least 1 protocol must be selected
Here is the call graph for this function:

◆ val_set_simval_obj()

status_t val_set_simval_obj ( val_value_t *  val,
obj_template_t *  obj,
const xmlChar *  valstr 
)

Set an initialized val_value_t as a simple type.

Set a pre-initialized val_value_t as a simple type from an object template instead of individual fields Calls val_set_simval with the object settings

This API should be used by GET1 callbacks where 'retval' has been allocated but not initialized yet

Parameters
valvalue struct to set
objobject template to use
valstrsimple value encoded as a string to set
Returns
status
Here is the call graph for this function:

◆ val_set_subdirs_parm()

status_t val_set_subdirs_parm ( val_value_t *  parentval)

set the subdirs parameter

–subdirs=<boolean>

Handle the –subdirs parameter

Parameters
parentvalCLI container to check for the subdirs parm
Returns
status
Here is the call graph for this function:

◆ val_set_warning_parms()

status_t val_set_warning_parms ( val_value_t *  parentval)

Check the parent value struct (expected to be a container or list) for the common warning control parameters.

Called by CLI and .conf file handlers after the CLI 'valset' has been parsed. The warning parameters are checked and set in the NCX layer if found

prints an error message if a warn-off record cannot be added

    --warn-idlen
    --warn-linelen
    --warn-off
Parameters
parentvalparent value struct to check
Returns
status
Here is the call graph for this function:

◆ val_set_with_ocpattern_parm()

status_t val_set_with_ocpattern_parm ( val_value_t *  parentval)

Handle the –with-ocpattern parameter.

–with-ocpattern=<boolean>

Parameters
parentvalCLI container to check for these parameters
Returns
status
Here is the call graph for this function:

◆ val_set_xpathpcb()

status_t val_set_xpathpcb ( val_value_t *  val,
xpath_pcb_t *  xpathpcb 
)

Set the xpathpcb field with passed field;.

Parameters
valvalue to use
xpathpcbstruct xpath_pcb_t_ PASS OFF MEMORY HERE
Returns
status
Here is the call graph for this function:

◆ val_simple_anyxml()

boolean val_simple_anyxml ( const val_value_t *  val)

Check if val_value node is a proper simple type ANYXML.

Parameters
valvalue node to test
Returns
TRUE if val is simple ANYXML/ANYDATA node; FALSE otherwise
Here is the call graph for this function:

◆ val_traverse_keys()

void val_traverse_keys ( val_value_t *  val,
void *  cookie1,
void *  cookie2,
val_walker_fn_t  walkerfn 
)

Check ancestor-or-self nodes until root reached.

Find all lists; For each list, starting with the closest to root, invoke the callback function for each of the key objects in order

Parameters
valvalue node to start check from
cookie1cookie1 to pass to the callback function
cookie2cookie2 to pass to the callback function
walkerfnwalker callback function; This callback returns FALSE to terminate traversal
Here is the call graph for this function:
Here is the caller graph for this function:

◆ val_type_is_any()

boolean val_type_is_any ( const val_value_t *  val)

Check if val_value node is a proper simple type ANYXML.

Parameters
valvalue node to test
Returns
TRUE if val's type is ANYXML/ANYDATA node; FALSE otherwise
Here is the caller graph for this function:

◆ val_validate_value()

status_t val_validate_value ( val_value_t *  useval)

Verify that the value is valid and can be safely used later Used in the SIL code to ensure that the created value is correct.

Validates that:

  • value and its OBJ is not NULL
  • value is list or container
Parameters
usevalval value to check
Returns
status
Here is the call graph for this function:

◆ val_write_extern()

void val_write_extern ( ses_cb_t *  scb,
const val_value_t *  val 
)

Write an external file to the session.

Parameters
scbsession control block to write to
valvalue to write (NCX_BT_EXTERN)
Here is the call graph for this function:

◆ val_write_intern()

void val_write_intern ( ses_cb_t *  scb,
const val_value_t *  val 
)

Write an internal buffer to the session.

Parameters
scbsession control block to write to
valvalue to write (NCX_BT_INTERN)
Here is the call graph for this function:

◆ val_write_ok()

status_t val_write_ok ( val_value_t *  val,
op_editop_t  editop,
ses_id_t  sesid,
boolean  checkup,
uint32 *  lockid 
)

Check if there are any partial-locks owned by another session in the node that is going to be written.

If the operation is replace or delete, then the entire target subtree will be checked

Parameters
valstart value struct to use
editoprequested write operation
sesidsession requesting this write operation
checkupTRUE to check up the tree as well
lockidaddress of return partial lock ID
Return values
*lockidreturn lock ID if any portion is locked Only the first lock violation detected will be reported
Returns
status, NO_ERR indicates no partial lock conflicts error code will be NCX_ERR_IN_USE if *lockid is set
Here is the call graph for this function:
Here is the caller graph for this function: