yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
val_util.h File Reference

Value Node Utilities. More...

#include <xmlstring.h>
#include "ncxtypes.h"
#include "obj.h"
#include "op.h"
#include "plock.h"
#include "ses.h"
#include "runstack.h"
#include "status.h"
#include "val.h"
#include "xml_msg.h"
#include "xmlns.h"
#include "xpath.h"
Include dependency graph for val_util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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_tval_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_tval_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_tval_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_tval_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_tval_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_tval_get_xpathpcb (val_value_t *val)
 Get the XPath parser control block in the specified value struct. More...
 
const xpath_pcb_tval_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_tval_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_tval_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_tval_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_tval_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_tval_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_tval_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_tval_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_tval_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_tval_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_tval_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_tval_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_tval_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_tval_make_from_enumval (obj_template_t *obj, int32 enumval, status_t *res)
 Create an enumeration leaf from its enum value. More...
 
val_value_tval_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_tval_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_tval_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)
 
  • Set the dataclass field to NCX_DC_CONFIG in the 'val' data tree
More...
 
status_t val_check_deprecated_warning (val_value_t *val)
 Check if any values in the val_value_t are deprecated YANG nodes. More...
 

Detailed Description

Value Node Utilities.