yumapro
24.10-2
YumaPro SDK
|
High level value node utility functions. More...
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_add_npcons (val_value_t *val) |
Check/Add empty NP containers. 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... | |
val_value_t * | val_make_identity_obj (obj_template_t *obj, typ_def_t *typdef, ncx_identity_t *ident, status_t *res) |
make a val_value_t for a specified leaf or leaf-list from an identity 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_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_set_children_load (val_value_t *val) |
Flag the CLI parameters coming from the command line. 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... | |
status_t | val_make_subtree (obj_template_t *obj, dlq_hdr_t *keyQ, val_value_t **topval, val_value_t **targetval) |
Create a hierarchy from root to the target object. More... | |
val_value_t * | val_find_descendant (val_value_t *val, const xmlChar *modname, const xmlChar *name) |
Find the fist available descendant matching the name also check seld. More... | |
val_value_t * | val_make_from_enumval (obj_template_t *obj, int32 enumval, status_t *res) |
Create an enumeration leaf from its enum value. More... | |
val_value_t * | val_make_from_num (obj_template_t *obj, typ_def_t *typdef, ncx_btype_t btyp, const ncx_num_t *num, status_t *res) |
Create a numeric leaf from a ncx_num_t struct. More... | |
val_value_t * | val_make_from_bitstring (obj_template_t *obj, typ_def_t *typdef, const xmlChar *buff, uint32 bufflen, status_t *res) |
Make a val_value_t with the bits set in the octet string. More... | |
status_t | val_set_tcp_connect_parms (val_value_t *parentval) |
Set TCP Connect parameters. More... | |
val_value_t * | val_find_notif (val_value_t *topval) |
Check the 'topval' node for a nested notification node. More... | |
void | val_force_dataclass_config (val_value_t *val) |
| |
status_t | val_check_deprecated_warning (val_value_t *val) |
Check if any values in the val_value_t are deprecated YANG nodes. More... | |
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 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
obj | object template for the retrieval (list or leaf-list) | |
start_idx | integer offset of the list or leaf-list instance to start the return. First entry is zero. | |
max_count | integer count of max number of entries that can fit in the return array. This number is 1..N | |
max_depth | integer sount to descendant levels to retrieve in each entry. Value zero means no limit | |
node_test_fn | callback to test the node to keep or not | |
[out] | getbulk_return | address of return getbulk data struct
|
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.
mhdr | message header |
withdef | with-defaults value in affect |
realtest | FALSE to just check object properties in the val->obj template TRUE if OK to check the other fields |
node | pointer to the value struct to check |
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.
val | value node to add attribute into |
btype | basetype to use in attribute value |
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.
val | value node to add attribute into |
obj | object template to use for object identifier |
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.
[in,out] | val | the value struct to modify
|
scriptmode | TRUE if the value is a script object access FALSE for normal val_get_simval access instead |
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.
[in,out] | val | the node to add defaults into; expecting container or list to check the descendant nodes
|
scriptmode | TRUE if the value is a script object access FALSE for normal val_get_simval access instead | |
rcxt | runstack contect to use (may be NULL) | |
last_modified | timestamp to set in new value | |
etag | entity tag to set in new value |
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.
val | value node to add attribute into |
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
chobj | top-lvel object to add defaults to |
val | the node to add defaults into; expecting container or list to check the descendant nodes
|
scriptmode | TRUE if the value is a script object access FALSE for normal val_get_simval access instead |
last_modified | timestamp to set in new value |
etag | entity tag to set in new value |
status_t val_add_npcons | ( | val_value_t * | val | ) |
Check/Add empty NP containers.
Used while validating the msg->action_parent
This function just adds NP containers. The default case will be checked for NP containers If a choice object is found
[in,out] | val | the value struct to modify by adding missing NP containers |
status_t val_add_one_operation_attr | ( | val_value_t * | val, |
op_editop_t | op | ||
) |
Add the nc:operation attribute to a value node.
val | value node to set |
op | edit operation to use |
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
template_val | template to apply |
target_val | value from edit to expand with template |
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
val | value node to start check from |
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
val | value struct to use |
rule | backptr to NACM rule |
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.
curval | current node to check |
status_t val_check_deprecated_warning | ( | val_value_t * | val | ) |
Check if any values in the val_value_t are deprecated YANG nodes.
Expecting CLI valset so only checks direct child nodes
val | value node to check (not written) |
NO_ERR | if no deprecated parameters used or warning |
ERR_NCX_USING_DEPRECATED | if warning elevated to error |
ERR_NCX_MISSING_PARM | if 'val' is NULL |
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
val | parent value node of the object node to check | |
valroot | database root for XPath purposes | |
objval | database value node to check (may be NULL) | |
obj | object template of data node object to check | |
[out] | condresult | address of conditional test result
|
[out] | whencount | address of number of when-stmts tested
|
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).
val | parent value node of the object node to check | |
valroot | database root for XPath purposes | |
objval | database value node to check (may be NULL) | |
obj | object template of data node object to check | |
mhdr | dummy or real message header to use if GET2 needed | |
configonly | TRUE for config datastore test; FALSE otherwise | |
get_when | TRUE if this is an eval of a when-stmt during a GET | |
pcb_session | session to use in the pcb->scb field that will be passed to GET2 callbacks and tested for NULL (e.g. get2-test) | |
parent_cb | parent node if val is not used as parent, NULL to use val | |
[out] | condresult | address of conditional test result
|
[out] | whencount | address of number of when-stmts tested
|
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
curval | current node to check |
newval | new value taking its place |
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
val | parent of the choice object to check |
obj | choice object to check |
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
val | value struct to use |
rule | backptr to NACM rule to clear |
void val_clear_partial_lock | ( | val_value_t * | val, |
plock_cb_t * | plcb | ||
) |
Clear the partial lock throughout the value tree.
val | start value struct to use |
plcb | partial lock to clear |
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.
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.
anyxml_val | value node that is supposed to represent the real_val | |
real_val | value node that represents the real template to use | |
[out] | error_val | address of return error node pointer
|
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
srcval | source value node to check for child nodes to copy |
destval | empty destination container or list to fill |
status_t val_copy_xpathpcb | ( | val_value_t * | val, |
const xpath_pcb_t * | xpathpcb | ||
) |
Set the xpathpcb field with a clone of the parameter.
val | value to use |
xpathpcb | struct xpath_pcb_t_ to copy from |
void val_dump_cli_valset | ( | const char * | progname, |
val_value_t * | valset | ||
) |
dump the parameter set with and without defaults
progname | program name to display |
valset | value to dump |
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
val | address of val_value_t being set | |
[out] | retstr | address of return expanded string
|
val_value_t * val_find_descendant | ( | val_value_t * | val, |
const xmlChar * | modname, | ||
const xmlChar * | name | ||
) |
Find the fist available descendant matching the name also check seld.
val | value to search |
modname | module name to find or NULL for any module |
name | object name to find |
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.
parentval | value node to start check from; parent of the list entries | |
firstmatch | first instance of the list entry to find | |
keyvalQ | Q of yangapi_keyval_t structs representing the string value of each key | |
[out] | res | address of return status
|
val_value_t * val_find_notif | ( | val_value_t * | topval | ) |
Check the 'topval' node for a nested notification node.
Return the first found notification node. If 'topval' is a notification node then tat node will be returned
topval | node to check for a nested notification |
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
[in,out] | val | value node to fixup
|
fixup_id | NSID of the node to find and change (also find 0) |
void val_force_dataclass_config | ( | val_value_t * | val | ) |
This is needed in agt_util:agt_apply_patch_edit to fixup the data stree returned from xml_parse_buffer
val | value node to convert |
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
obj | list object containing the keyQ | |
[in,out] | val | the just parsed table row with the childQ containing nodes to check as index nodes
|
status_t val_gen_index_comp | ( | const obj_key_t * | in, |
val_value_t * | val | ||
) |
Create an index component.
in | obj_key_t in the chain to process | |
[in,out] | val | the just parsed table row with the childQ containing nodes to check as index nodes
|
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,.
[in,out] | mhdr | message hdr w/ prefix map or NULL to just use the internal prefix mappings
|
val | node to generate the instance ID for | |
format | desired output format (NCX or Xpath) | |
[out] | buff | pointer to address of buffer to use
|
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,.
[in,out] | mhdr | message hdr w/ prefix map or NULL to just use the internal prefix mappings
|
val | node to generate the instance ID for | |
format | desired output format (NCX or Xpath) | |
stop_at_root | TRUE to stop if a 'root' node is encountered FALSE to keep recursing all the way to | |
[out] | buff | pointer to address of buffer to use
|
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
mhdr | message hdr w/ prefix map or NULL to just use the internal prefix mappings
| |
val | node to generate the instance ID for | |
stopval | fake root to stop at as if the root; ancestor of val | |
format | desired output format (NCX or Xpath) | |
stop_at_root | TRUE to stop if a 'root' node is encountered FALSE to keep recursing all the way to | |
[out] | buff | pointer to address of buffer to use
|
status_t val_gen_key_entry | ( | val_value_t * | keyval | ) |
Create a key record within an index comp.
[in,out] | keyval | the just parsed table row with the childQ containing nodes to check as index nodes
|
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!!!
val | value node to use | |
[out] | keyQ | Q of val_value_t to use
|
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!!!
val | value node to use | |
[out] | keyptrQ | Q of ncx_backptr_t to val_value_t to use
|
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
mhdr | message hdr w/ prefix map or NULL to just use the internal prefix mappings
| |
val | node to generate the instance ID for | |
format | desired output format (NCX or Xpath) | |
leaf_nsid | namespace ID of the leaf to add | |
leaf_name | name string of the leaf to add | |
stop_at_root | TRUE to stop if a 'root' node is encountered FALSE to keep recursing all the way to | |
[out] | buff | pointer to address of buffer to use
|
void val_get_anyxml_tracking | ( | const val_value_t * | val, |
boolean * | iskey, | ||
boolean * | isconfig, | ||
boolean * | isunknown | ||
) |
Set the anyxml tracking data for this node.
val | value to check | |
[out] | iskey | address of return iskey flag
|
[out] | isconfig | address of return isconfig flag
|
[out] | isunknown | address of return isunknown flag
|
obj_template_t * val_get_casobj | ( | val_value_t * | val | ) |
Get the case object for the value node.
val | value to use |
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.
val | val_value_t to check |
obj | choice object to check |
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.
val | val_value_t to check |
obj | choice object to check |
nondef | TRUE for non-default only; FALSE for any set from this case |
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
val | val_value_t to check |
obj | choice object to check |
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'.
obj | choice object to check |
curchild | current child selected from this choice (obj) |
const xpath_pcb_t * val_get_const_xpathpcb | ( | const val_value_t * | val | ) |
Get the XPath parser control block in the specified value struct.
val | value struct to check |
xmlns_id_t val_get_idref_nsid | ( | const val_value_t * | val | ) |
get the true namespace ID for the identityref value
val | value to check |
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.
mhdr | message hdr w/ prefix map or NULL to just use the internal prefix mappings
| |
format | desired output format | |
force_quotes | TRUE to force quotes for config file mode | |
val | val_value_t for table or container | |
buff | buffer to hold result;
| |
[out] | len | address of index string length
|
ncx_nmda_origin_t val_get_origin | ( | const val_value_t * | val | ) |
Get the NMDA origin value for this node.
val | datastore val to get the origin from |
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
scb | session control block | |
msg | xml_msg_hdr_t in progress | |
val | value to write (node from system) | |
testfn | callback function to use, NULL if not used | |
acmcheck | TRUE if NACM should be checked; FALSE to skip | |
[out] | malloced | address of return malloced flag
|
[out] | res | address of return status
|
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
scb | session control block | |
msg | xml_msg_hdr_t in progress | |
val | value to write (node from system) | |
testfn | callback function to use, NULL if not used | |
acmcheck | TRUE if NACM should be checked; FALSE to skip | |
[out] | malloced | address of return malloced flag
|
[out] | res | address of return status
|
get2cb | GET2 control block or NULL if not used |
xpath_pcb_t * val_get_xpathpcb | ( | val_value_t * | val | ) |
Get the XPath parser control block in the specified value struct.
val | value struct to 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
root | the docroot for XPath processing |
val | context node value to use (val->obj usually == obj) |
obj | usually the val->obj field except for choice/case processing. |
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 &
root | the docroot for XPath processing |
val | context node value to use (val->obj usually == obj) |
obj | usually the val->obj field except for choice/case processing. |
check_when | TRUE to check false when; FALSE if already done |
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!!!
root | the docroot for XPath processing |
val | context node value to use (val->obj usually == obj) |
obj | usually the val->obj field except for choice/case processing. |
check_when | TRUE to check false when; FALSE if already done |
check_deep | TRUE to recurse for descendant nodes; FALSE for just the just nodes; will not attempt to process a node that is tagged as ncx:root!!!! |
scb | session control block to use (may be NULL) |
msg | msg to record errors (may be NULL) |
boolean val_is_fixed_value | ( | val_value_t * | val | ) |
Check if the specified value has a fixed-value=true attribute set in it.
val | value node to check |
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.
obj | object template to use set binary object | |
binstr | simple value encoded as a binary buffer | |
binstrlen | length of binstr (not zero-terminated) | |
[out] | res | address of return status
|
val_value_t * val_make_config_root | ( | void | ) |
Make a <config> element.
val_value_t * val_make_external_value | ( | obj_template_t * | obj, |
xmlChar * | fname | ||
) |
Make an external value node.
obj | object template to use |
fname | filespec string to set as the value (PASS OFF MEMORY) |
val_value_t * val_make_from_bitstring | ( | obj_template_t * | obj, |
typ_def_t * | typdef, | ||
const xmlChar * | buff, | ||
uint32 | bufflen, | ||
status_t * | res | ||
) |
Make a val_value_t with the bits set in the octet string.
Support CBOR bits byte string format
obj | target object to use and create | |
typdef | override obj typdef with this one (union TBD!) | |
buff | buffer represeting the bitstring | |
bufflen | length of buffer represeting the bitstring (can be 0) | |
[out] | res | == address of return status
|
val_value_t * val_make_from_enumval | ( | obj_template_t * | obj, |
int32 | enumval, | ||
status_t * | res | ||
) |
Create an enumeration leaf from its enum value.
obj | target object to use and create | |
enumval | numeric value of the enum to set | |
[out] | res | == address of return status
|
val_value_t * val_make_from_num | ( | obj_template_t * | obj, |
typ_def_t * | typdef, | ||
ncx_btype_t | btyp, | ||
const ncx_num_t * | num, | ||
status_t * | res | ||
) |
Create a numeric leaf from a ncx_num_t struct.
obj | target object to use and create | |
typdef | target typdef to use if object is a union | |
btyp | numeric base type | |
num | number struct already set to copy into new value | |
[out] | res | == address of return status
|
val_value_t * val_make_identity_obj | ( | obj_template_t * | obj, |
typ_def_t * | typdef, | ||
ncx_identity_t * | ident, | ||
status_t * | res | ||
) |
make a val_value_t for a specified leaf or leaf-list from an identity
The identity is used as a const pointer but the val_idref_t does not use a const keyword
obj | name of module defining leaf (may be NULL to pick parent) | |
typdef | typdef to use if object is a union (NULL otherwise) | |
ident | identity struct value for leaf | |
[out] | res | address of return status
|
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
obj | name of module defining leaf (may be NULL to pick parent) | |
leafval | identityref value for leaf | |
[out] | res | address of return status
|
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
name | name of wrapper element |
value | Z-terminated buffer with XML value within it |
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
obj | object template to use | |
valstr | simple value encoded as a string | |
[out] | res | address of return status
|
status_t val_make_subtree | ( | obj_template_t * | obj, |
dlq_hdr_t * | keyQ, | ||
val_value_t ** | topval, | ||
val_value_t ** | targetval | ||
) |
Create a hierarchy from root to the target object.
obj | target object to use and create within the hierarchy | |
keyQ | Q of val_value_t; expecting generic strings
| |
[out] | topval | address of return top instance of tree
|
[out] | targetval | address of return instance created of 'obj'
|
boolean val_match_datarule | ( | const val_value_t * | val, |
void * | rule | ||
) |
Check if the data-rule back-ptr applies to this node.
val | value struct to use |
rule | backptr to NACM rule to check |
void val_merge_return_vals | ( | dlq_hdr_t * | srcQ, |
dlq_hdr_t * | dstQ | ||
) |
Merge return values into a dest Q Remove duplicates.
srcQ | Q of val_value_t to drain |
dstQ | Q of val_value_t to fill |
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
newval | new value struct to use |
curval | currenrt value struct to use |
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
nsid | namespace ID of name |
name | name string (direct or strdup, based on copyname) |
copyname | TRUE is dname strdup should be used |
parent | parent node |
editop | requested edit operation |
obj | object template to use |
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.
val | data node that will be locked | |
sesid | session ID requesting the partial lock | |
[out] | lockowner | address of first lock owner violation
|
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.
val | root container to purge |
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
val | parent value node of the object node to check | |
[out] | deleteme | address of delete flag for val itself
|
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
name | name of element, internal use, default is 'data' | |
val | parent value node of the object node to check | |
obj | obj_template to parse 'val' against | |
is_error | TRUE for error; FALSE for warning | |
real_delete | TRUE to do real deletes; FALSE to just print msgs | |
[out] | deleteme | address of delete flag for val itself
|
void val_set_anyxml_tracking | ( | val_value_t * | val, |
obj_template_t * | obj | ||
) |
Set the anyxml tracking data for this node.
val | value to set |
obj | object to use to set anyxml tracking bits |
status_t val_set_binary_display_maxlen_parm | ( | val_value_t * | parentval | ) |
Handle the –binary-display-maxlen parameter.
–binary-display-maxlen=<uint32>
parentval | CLI container to check for the parm |
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:
These nodes are not ordered, but their child nodes are ordered
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'.
[in,out] | val | value node to change to canonical order
|
void val_set_children_load | ( | val_value_t * | val | ) |
Flag the CLI parameters coming from the command line.
hack: flag this val_value_t as editop=load so it can be identified by the server as coming from the CLI parameters instead of from the conf files
This API is only used by agt_cli.c for yumaworks-server. Non-default objects are marked as editop=OP_EDITOP_LOAD
val | CLI valset to convert |
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
parentval | CLI container to check for these parameters |
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
parentval | CLI container to check for the feature 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
parentval | CLI container to check for these parameters |
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>
parentval | parent value struct to check |
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
parentval | parent value struct to check |
fhs_logfile | log filespec for server FHS mode NULL if not used |
status_t val_set_message_indent_parm | ( | val_value_t * | parentval | ) |
Handle the message-indent parameter.
–message-indent=<number> (-1 .. 9)
parentval | CLI container to check for the message-indent parm |
void val_set_origin | ( | val_value_t * | val, |
ncx_nmda_origin_t | origin | ||
) |
Set the NMDA value origin.
val | datastore val to set the origin for |
origin | origin enum to set |
status_t val_set_partial_lock | ( | val_value_t * | val, |
plock_cb_t * | plcb | ||
) |
Set the partial lock throughout the value tree.
val | start value struct to use |
plcb | partial lock to set on entire subtree |
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
parentval | CLI container to check for the runpath, modpath, and datapath variables |
status_t val_set_protocols_parm | ( | val_value_t * | parentval | ) |
Handle the –protocols parameter.
–protocols=bits [netconf1.0, netconf1.1]
parentval | CLI container to check for the 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]
scb | session control block to use |
parentval | CLI container to check for the protocols parm |
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
val | value struct to set |
obj | object template to use |
valstr | simple value encoded as a string to set |
status_t val_set_subdirs_parm | ( | val_value_t * | parentval | ) |
set the subdirs parameter
–subdirs=<boolean>
Handle the –subdirs parameter
parentval | CLI container to check for the subdirs parm |
status_t val_set_tcp_connect_parms | ( | val_value_t * | parentval | ) |
Set TCP Connect parameters.
Check the parent value struct (expected to be a container or list) for the common TCP connect parameters from grouping TcpConnectParms
–tcp-connect-timeout
parentval | parent value struct to check if tcp-connect-timeout foundL
|
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
parentval | parent value struct to check |
status_t val_set_with_ocpattern_parm | ( | val_value_t * | parentval | ) |
Handle the –with-ocpattern parameter.
–with-ocpattern=<boolean>
parentval | CLI container to check for these parameters |
status_t val_set_xpathpcb | ( | val_value_t * | val, |
xpath_pcb_t * | xpathpcb | ||
) |
Set the xpathpcb field with passed field;.
val | value to use |
xpathpcb | struct xpath_pcb_t_ PASS OFF MEMORY HERE |
boolean val_simple_anyxml | ( | const val_value_t * | val | ) |
Check if val_value node is a proper simple type ANYXML.
val | value node to test |
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
val | value node to start check from |
cookie1 | cookie1 to pass to the callback function |
cookie2 | cookie2 to pass to the callback function |
walkerfn | walker callback function; This callback returns FALSE to terminate traversal |
boolean val_type_is_any | ( | const val_value_t * | val | ) |
Check if val_value node is a proper simple type ANYXML.
val | value node to test |
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:
useval | val value to check |
void val_write_extern | ( | ses_cb_t * | scb, |
const val_value_t * | val | ||
) |
Write an external file to the session.
scb | session control block to write to |
val | value to write (NCX_BT_EXTERN) |
void val_write_intern | ( | ses_cb_t * | scb, |
const val_value_t * | val | ||
) |
Write an internal buffer to the session.
scb | session control block to write to |
val | value to write (NCX_BT_INTERN) |
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
val | start value struct to use | |
editop | requested write operation | |
sesid | session requesting this write operation | |
checkup | TRUE to check up the tree as well | |
[out] | lockid | address of return partial lock ID
|