yumapro  23.10T-5
YumaPro SDK
Loading...
Searching...
No Matches
Agent Utilities

Contains many general utilities useful for SIL and SIL-SA code to use. More...

Collaboration diagram for Agent Utilities:

Functions

status_t agt_get_cfg_from_parm (const xmlChar *parmname, rpc_msg_t *msg, xml_node_t *methnode, cfg_template_t **retcfg)
 FUNCTION agt_get_cfg_from_parm. More...
 
status_t agt_get_inline_cfg_from_parm (const xmlChar *parmname, rpc_msg_t *msg, xml_node_t *methnode, val_value_t **retval)
 Get the val_value_t node for the inline config element. More...
 
status_t agt_get_url_from_parm (const xmlChar *parmname, rpc_msg_t *msg, xml_node_t *methnode, const xmlChar **returl, val_value_t **retval)
 Get the URL string for the config in the target param. More...
 
xmlChar * agt_get_filespec_from_url (const xmlChar *urlstr, status_t *res)
 Check the URL and get the filespec part out of it. More...
 
const val_value_tagt_get_parmval (const xmlChar *parmname, rpc_msg_t *msg)
 Get the identified val_value_t for a given parameter. More...
 
void agt_record_error (ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_node_t *xmlnode, ncx_node_t parmtyp, const void *error_info, ncx_node_t nodetyp, void *error_path)
 Generate an rpc_err_rec_t and save it in the msg. More...
 
void agt_record_error_obj (ses_cb_t *scb, xml_msg_hdr_t *msghdr, status_t res, obj_template_t *errobj, const xmlChar *badval)
 Generate an rpc_err_rec_t and save it in the msg Use the provided object for <rpc-error> fields. More...
 
void agt_record_error_errinfo (ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_node_t *xmlnode, ncx_node_t parmtyp, const void *error_info, ncx_node_t nodetyp, void *error_path, const ncx_errinfo_t *errinfo)
 Generate an rpc_err_rec_t and save it in the msg Use provided error fields. More...
 
void agt_record_warning (ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_node_t *xmlnode, ncx_node_t parmtyp, const void *error_parm, ncx_node_t nodetyp, void *error_path, const ncx_errinfo_t *errinfo)
 Generate an rpc_err_rec_t and save it in the msg. More...
 
void agt_record_attr_error (ses_cb_t *scb, xml_msg_hdr_t *msghdr, ncx_layer_t layer, status_t res, const xml_attr_t *xmlattr, const xml_node_t *xmlnode, const xmlChar *badns, ncx_node_t nodetyp, void *errnode)
 Generate an rpc_err_rec_t and save it in the msg. More...
 
void agt_record_insert_error (ses_cb_t *scb, xml_msg_hdr_t *msghdr, status_t res, val_value_t *errval)
 Generate an rpc_err_rec_t and save it in the msg Called from the YANG edit validation code when an invalid insert operation is detected. More...
 
void agt_record_unique_error (ses_cb_t *scb, xml_msg_hdr_t *msghdr, val_value_t *errval, dlq_hdr_t *valuniqueQ)
 Generate an rpc_err_rec_t and save it in the msg. More...
 
status_t agt_validate_filter (ses_cb_t *scb, rpc_msg_t *msg)
 Validate the <filter> parameter if present. More...
 
status_t agt_validate_filter_ex (ses_cb_t *scb, rpc_msg_t *msg, val_value_t *filter)
 Validate the <filter> parameter if present (extended) More...
 
status_t agt_validate_filter_nmda (rpc_msg_t *msg, val_value_t *filter, boolean is_subtree, boolean is_operational)
 Validate the <filter> parameter; FOR NMDA ONLY. More...
 
boolean agt_check_config (xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
 Used by the <get-config> operation to return any type of configuration data. More...
 
boolean agt_check_default (xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
 Used by the <get*> operation to return only values not set to the default. More...
 
boolean agt_check_config_false (xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
 Used by the <get*> operation to return only config=false nodes and the ID ancestor nodes. More...
 
boolean agt_check_config_false_default (xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
 Used by the <get> operation to return only content=nonconfig nodes and the ID ancestor node and only values not set to the default except if it is a container with counters. More...
 
boolean agt_check_save (xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
 Used by agt_ncx_cfg_save function to filter just what is supposed to be saved in the <startup> config file. More...
 
boolean agt_check_modtags (xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
 Used by the <get> and <get-config> operation to return report-all module-tags filtered data. More...
 
boolean agt_check_basic (xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
 Used by the <get-data> operation to return basic filtering NMDA, module-tags, tstamps filtered data. More...
 
status_t agt_output_filter (ses_cb_t *scb, rpc_msg_t *msg, int32 indent)
 output the proper data for the get or get-config operation generate the data that matched the subtree or XPath filter More...
 
status_t agt_output_schema (ses_cb_t *scb, rpc_msg_t *msg, int32 indent)
 generate the YANG file contents for the get-schema operation More...
 
status_t agt_output_empty (ses_cb_t *scb, rpc_msg_t *msg, int32 indent)
 output no data for the get or get-config operation because the if-modified-since fileter did not pass More...
 
status_t agt_check_max_access (val_value_t *newval, boolean cur_exists)
 Check if the max-access for a parameter is exceeded. More...
 
status_t agt_check_editop (op_editop_t pop, op_editop_t *cop, val_value_t *newnode, val_value_t *curnode, ncx_iqual_t iqual, ncx_protocol_t proto, boolean is_commit, boolean *delete_default)
 Check if the edit operation is okay. More...
 
status_t agt_enable_feature (const xmlChar *modname, const xmlChar *featurename)
 Enable a YANG feature in the server. More...
 
status_t agt_disable_feature (const xmlChar *modname, const xmlChar *featurename)
 Disable a YANG feature in the server. More...
 
val_value_tagt_make_leaf (obj_template_t *parentobj, const xmlChar *leafname, const xmlChar *leafstrval, status_t *res)
 make a string val_value_t struct for a specified leaf or leaf-list More...
 
val_value_tagt_make_uint_leaf (obj_template_t *parentobj, const xmlChar *leafname, uint32 leafval, status_t *res)
 make a uint32 val_value_t struct for a specified leaf or leaf-list More...
 
val_value_tagt_make_int_leaf (obj_template_t *parentobj, const xmlChar *leafname, int32 leafval, status_t *res)
 make an int32 val_value_t struct for a specified leaf or leaf-list More...
 
val_value_tagt_make_uint64_leaf (obj_template_t *parentobj, const xmlChar *leafname, uint64 leafval, status_t *res)
 make a uint64 val_value_t struct for a specified leaf or leaf-list More...
 
val_value_tagt_make_int64_leaf (obj_template_t *parentobj, const xmlChar *leafname, int64 leafval, status_t *res)
 make an int64 val_value_t struct for a specified leaf or leaf-list More...
 
val_value_tagt_make_idref_leaf (obj_template_t *parentobj, const xmlChar *leafname, const val_idref_t *leafval, status_t *res)
 make an identityref val_value_t struct for a specified leaf or leaf-list More...
 
val_value_tagt_make_list (obj_template_t *parentobj, const xmlChar *listname, status_t *res)
 make a val_value_t struct for a specified list More...
 
val_value_tagt_make_object (obj_template_t *parentobj, const xmlChar *objname, status_t *res)
 make a val_value_t struct for a specified node More...
 
val_value_tagt_make_virtual_leaf (obj_template_t *parentobj, const xmlChar *leafname, getcb_fn_t callbackfn, status_t *res)
 make a val_value_t struct for a specified virtual leaf or leaf-list More...
 
status_t agt_add_top_virtual (obj_template_t *obj, getcb_fn_t callbackfn)
 make a val_value_t struct for a specified virtual top-level data node More...
 
status_t agt_add_top_container (obj_template_t *obj, val_value_t **val)
 make a val_value_t struct for a specified top-level container data node. More...
 
status_t agt_add_container (const xmlChar *modname, const xmlChar *objname, val_value_t *parentval, val_value_t **val)
 make a val_value_t struct for a specified nested container data node. More...
 
val_value_tagt_init_cache (const xmlChar *modname, const xmlChar *objname, status_t *res)
 init a cache pointer during the init2 callback More...
 
status_t agt_check_cache (val_value_t **cacheptr, val_value_t *newval, val_value_t *curval, op_editop_t editop)
 check if a cache pointer needs to be changed or NULLed out More...
 
xpath_pcb_tagt_new_xpath_pcb (ses_cb_t *scb, const xmlChar *expr, status_t *res)
 Get a new XPath parser control block and set up the server variable bindings. More...
 
xmlChar * agt_make_srid_filespec (const xmlChar *basestr, const xmlChar *patstr, const xmlChar *valstr)
 Make a filespec string needed for a filespec with SRID in it. More...
 
xmlChar * agt_get_startup_filespec (status_t *res)
 Figure out where to store the startup file. More...
 
xmlChar * agt_get_target_filespec (const xmlChar *target_url, status_t *res)
 Figure out where to store the URL target file. More...
 
status_t agt_set_mod_defaults (ncx_module_t *mod, val_value_t *valroot, boolean set_candidate, boolean set_augment, boolean force)
 Check for any top-level config leafs that have a default value, and add them to the running configuration. More...
 
status_t agt_set_val_defaults (val_value_t *val)
 Check for any node-level config leafs that have a default value, and add them to the running configuration. More...
 
status_t agt_set_with_defaults (rpc_msg_t *msg, const xmlChar *modname, val_value_t **errval)
 Check if the <with-defaults> parameter is set in the request message, and if so, it is one of the server's supported values. More...
 
void agt_set_with_owners (rpc_msg_t *msg)
 Check if the <with-owners> parameter is set in the request message. More...
 
void agt_set_depth (rpc_msg_t *msg)
 Check if the <depth> parameter is set in the request message. More...
 
void agt_set_depth_nmda (rpc_msg_t *msg)
 Check if the <depth> parameter is set NMDA max-depth parameter in the request message If so, then set the msg->mhdr.max_depth and cur_depth will be set. More...
 
val_value_tagt_get_key_value (val_value_t *startval, val_value_t **lastkey)
 Get the next expected key value in the ancestor chain. More...
 
val_value_tagt_add_top_node_if_missing (ncx_module_t *mod, const xmlChar *objname, boolean *added, status_t *res)
 Add a top config node if it is missing. More...
 
boolean agt_any_operations_set (val_value_t *val)
 Check the new node and all descendants for any operation attibutes prsent. More...
 
boolean agt_apply_this_node (op_editop_t editop, const val_value_t *newnode, const val_value_t *curnode)
 Check if the write operation applies to the current node. More...
 
boolean agt_apply_this_node_ex (op_editop_t editop, const val_value_t *newnode, const val_value_t *curnode, boolean ignore_defaults, boolean childonly, boolean top_replace)
 Check if the write operation applies to the current node. More...
 
boolean agt_backups_enabled (void)
 Check if the backup commands are enabled. More...
 
xpath_result_tagt_get_result_from_xpath (xpath_pcb_t *pcb, val_value_t *rootval, status_t *retres)
 Get the result from evaluating an XPath expression. More...
 
val_value_tagt_get_first_result_val (xpath_result_t *result)
 Get the first XPath result node or NULL if not node-set or empty node-set or not value node. More...
 
void agt_output_start_container (ses_cb_t *scb, xml_msg_hdr_t *mhdr, xmlns_id_t parent_nsid, xmlns_id_t node_nsid, const xmlChar *node_name, int32 indent)
 Output a start container node. More...
 
void agt_output_start_node (ses_cb_t *scb, xml_msg_hdr_t *mhdr, xmlns_id_t parent_nsid, xmlns_id_t node_nsid, const xmlChar *node_name, int32 indent, boolean try_modname)
 Output a start node and try to use modname in front if needed. More...
 
void agt_output_start_node2 (ses_cb_t *scb, xml_msg_hdr_t *mhdr, xmlns_id_t parent_nsid, xmlns_id_t node_nsid, const xmlChar *node_name, int32 indent, boolean try_modname, val_value_t *metaval)
 Output a start node and try to use modname in front if needed. More...
 
void agt_output_start_errors_container (ses_cb_t *scb, xml_msg_hdr_t *mhdr, xmlns_id_t parent_nsid, xmlns_id_t nsid, const xmlChar *elname, const dlq_hdr_t *attrQ, boolean isattrq, int32 indent, boolean empty)
 Output a start <errors> element on the specified session for RESTCONF error handling. More...
 
void agt_output_end_container (ses_cb_t *scb, xml_msg_hdr_t *mhdr, xmlns_id_t node_nsid, const xmlChar *node_name, int32 indent)
 Output an end container node. More...
 
boolean agt_match_etag (val_value_t *val, const xmlChar *etag)
 Check if the etag matches the specified value string. More...
 
boolean agt_match_etag_binary (val_value_t *val, ncx_etag_t etag)
 Check if the etag matches the specified value string. More...
 
boolean agt_modified_since (val_value_t *val, time_t *timerec)
 Check if the timestamp for the object is later then the specified timestamp. More...
 
boolean agt_notifications_enabled (void)
 Check if notifications are enabled. More...
 
val_value_tagt_make_leaf2 (obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, const xmlChar *leafstrval, status_t *res)
 make a val_value_t struct for a specified leaf or leaf-list More...
 
val_value_tagt_make_union_leaf (obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, const val_value_t *leafval, status_t *res)
 make a val_value_t struct for a specified leaf or leaf-list use a val_value_t for a union More...
 
val_value_tagt_make_uint_leaf2 (obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, uint32 leafval, status_t *res)
 make a val_value_t struct for a specified leaf or leaf-list More...
 
val_value_tagt_make_int_leaf2 (obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, int32 leafval, status_t *res)
 make a val_value_t struct for a specified leaf or leaf-list More...
 
val_value_tagt_make_uint64_leaf2 (obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, uint64 leafval, status_t *res)
 make a val_value_t struct for a specified leaf or leaf-list More...
 
val_value_tagt_make_int64_leaf2 (obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, int64 leafval, status_t *res)
 make a val_value_t struct for a specified leaf or leaf-list More...
 
val_value_tagt_make_idref_leaf2 (obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, const val_idref_t *leafval, status_t *res)
 make a val_value_t struct for a specified leaf or leaf-list More...
 
val_value_tagt_make_bits_leaf (obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, const ncx_list_t *listval, status_t *res)
 make a val_value_t struct for a specified leaf or leaf-list (NCX_BT_BITS or NCX_BT_SLIST) More...
 
val_value_tagt_make_boolean_leaf (obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, boolean boolval, status_t *res)
 make a val_value_t struct for a specified leaf or leaf-list (NCX_BT_BOOL) More...
 
val_value_tagt_make_empty_leaf (obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, boolean boolval, status_t *res)
 make a val_value_t struct for a specified leaf or leaf-list (NCX_BT_EMPTY) More...
 
val_value_tagt_make_object2 (obj_template_t *parentobj, const xmlChar *modname, const xmlChar *objname, status_t *res)
 make a val_value_t struct for a specified node More...
 
val_value_tagt_make_virtual_leaf2 (obj_template_t *parentobj, const xmlChar *modname, const xmlChar *leafname, getcb_fn_t callbackfn, status_t *res)
 make a val_value_t struct for a specified virtual leaf or leaf-list More...
 
ncx_cfg_t agt_get_edit_config_id (rpc_msg_t *rpcmsg)
 Get the enum ID of the configuration that is being edited. More...
 
boolean agt_module_in_cli_valset (const xmlChar *modname)
 Check if there is a module=foo parameter in the CLI parameter set. More...
 
void agt_set_basic_withdef_enabled (void)
 Force the basic mode to be enabled in the agt_withdef_enabled bitmask. More...
 
boolean agt_check_delete_all_allowed (obj_template_t *testobj)
 Check if the delete-all or remove-all operation is enabled for for specified object. More...
 
op_editop_t agt_cvt_editop (op_editop_t editop, const val_value_t *newval, const val_value_t *curval)
 Determine the effective edit (if OP_EDITOP_COMMIT) More...
 
op_editop_t agt_cvt_editop_acm (op_editop_t editop, const val_value_t *newval, const val_value_t *curval)
 Determine the effective edit for NACM. More...
 
op_editop_t agt_cvt_editop_ex (op_editop_t editop, const val_value_t *newval, const val_value_t *curval)
 Determine the effective edit (if OP_EDITOP_COMMIT) Do not convert COMMIT to REPLACE same as cvt_editop. More...
 
int agt_connect_client (const xmlChar *hostname, uint16_t port)
 Start a TCP connection to a client. More...
 
status_t agt_find_in_datastore (ncx_cfg_t cfg_id, val_value_t *err_value, val_value_t **retval)
 Find the node (should be from an <edit-config> content node) in the specified datastore. More...
 
uint32 agt_get_error_count (rpc_msg_t *msg)
 Get the current number of errors in the rpc msg Q. More...
 
val_value_tagt_get_rpc_input (rpc_msg_t *msg)
 Get the rpc input value node. More...
 
const xmlChar * agt_getTermReasonStr (ses_term_reason_t termreason)
 Convert the termination reason enum to a string. More...
 
boolean agt_get_ok_for_nolock (rpc_msg_t *msg)
 Check if the get has filters and if they are OK for a <get> without waiting for a pthreads filter. More...
 
boolean agt_getbulk_ok_for_nolock (const xmlChar *pathstr)
 Check if the get-bulk target is OK for a nolock get without waiting for a pthreads filter. More...
 
boolean agt_op_ok_for_maintenance_mode (const obj_template_t *rpcobj)
 Check if the operation is OK for maintenance mode. More...
 
const xmlChar * agt_crl_mode_str (agt_crl_mode_t crl_mode)
 Get the string for the CRL mode enum. More...
 
agt_crl_mode_t agt_crl_mode_enum (const xmlChar *crl_mode)
 Get the enum for the CRL mode string. More...
 
val_nodetest_fn_t agt_util_get_testfn (xml_msg_hdr_t *msg, boolean getop)
 Get the test function that should be used for a specific get operation based on with-default parameter and get operation. More...
 
status_t agt_fill_dummy_method (const xmlChar *modname, const xmlChar *rpcname, xml_node_t *node, obj_template_t **rpcobj)
 Fill the xml_node with the proper data to fake an XML node for the start of the rpc-method element. More...
 
yang_patch_cb_tagt_make_yang_patch_cb (const xmlChar *patch_id, const xmlChar *the_comment, const xmlChar *patch_root, agt_cfg_transaction_t *txcb, uint32 included_changes)
 Make a yang_patch_cb for a YANG Patch conventional datastore on-change update. More...
 
yang_patch_cb_tagt_make_yang_patch_cb_targobj (const xmlChar *patch_id, const xmlChar *the_comment, const xmlChar *patch_root, agt_cfg_transaction_t *txcb, uint32 included_changes, obj_template_t *targobj)
 Make a yang_patch_cb for a YANG Patch conventional datastore on-change update for a target object. More...
 
yang_patch_cb_tagt_make_yang_patch_cb_file (const xmlChar *patch_id, const xmlChar *the_comment, const xmlChar *patch_root, const xmlChar *filespec)
 Make a yang_patch_cb for a Simulated Operational On-Change subscription update from a data file. More...
 
boolean agt_check_included_changes (agt_cfg_transaction_t *txcb, uint32 included_changes, obj_template_t *targobj)
 Check an edit transaction to see if it has any edits that match the included_changes bitmask parameter. More...
 
status_t agt_add_leafy (val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, const xmlChar *leafstrval)
 make a child node from a string and add to parent. More...
 
status_t agt_add_uint_leafy (val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, uint32 leafval)
 make a child node from a uint32 and add to parent. More...
 
status_t agt_add_int_leafy (val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, int32 leafval)
 make a child node from a int32 and add to parent. More...
 
status_t agt_add_uint64_leafy (val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, uint64 leafval)
 make a child node from a uint64 and add to parent. More...
 
status_t agt_add_int64_leafy (val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, int64 leafval)
 make a child node from a int64 and add to parent. More...
 
status_t agt_add_boolean_leafy (val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, boolean boolval)
 make a child node from a boolean and add to parent. More...
 
status_t agt_add_idref_leafy (val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, const val_idref_t *leafval)
 make a child node from a val_idref_t struct and add to parent. More...
 
status_t agt_add_bits_leafy (val_value_t *parentval, const xmlChar *modname, const xmlChar *leafname, const ncx_list_t *leafval)
 make a child node from a ncx_list_t struct (bits) and add to parent. More...
 
val_value_tagt_make_string_key (const xmlChar *leafval)
 make a generic key leaf node from a string More...
 
val_value_tagt_make_uint_key (uint32 leafval)
 make a generic key leaf node from a uint More...
 
val_value_tagt_make_int_key (int32 leafval)
 make a generic key leaf node from an int More...
 
val_value_tagt_make_uint64_key (uint64 leafval)
 make a generic key leaf node from a uint64 More...
 
val_value_tagt_make_int64_key (int64 leafval)
 make a generic key leaf node from an int64 More...
 
val_value_tagt_make_boolean_key (boolean leafval)
 make a generic key leaf node from a boolean More...
 
val_value_tagt_make_idref_key (const val_idref_t *leafval)
 make a generic key leaf node from an idref struct More...
 
val_value_tagt_make_bits_key (const ncx_list_t *leafval)
 make a generic key leaf node from a bits struct More...
 
status_t agt_get_sid_set_id (xmlChar *buff, uint32 bufflen)
 Fill the buffer with the current sid-set-id value. More...
 
status_t agt_xpath_force_true (struct xpath_pcb_t_ *pcb, val_value_t *context, val_value_t *docroot, boolean *result)
 XPath Boolean EVAL Replacement Callback. More...
 
agt_edit_parms_cb_tagt_new_edit_parms (const xmlChar *patch_id_str, boolean system_edit, boolean skip_sil, const xmlChar *comment)
 Create and initialize a SIL edit_parms control clock. More...
 
status_t agt_init_edit_parms (agt_edit_parms_cb_t *parms, const xmlChar *patch_id_str, boolean system_edit, boolean skip_sil, const xmlChar *comment)
 Initialize a SIL edit_parms control clock. More...
 
void agt_clean_edit_parms (agt_edit_parms_cb_t *parms)
 Clean a SIL edit_parms control clock. More...
 
void agt_free_edit_parms (agt_edit_parms_cb_t *parms)
 Clean and free a SIL edit_parms control clock. More...
 
status_t agt_add_patch_edit (agt_edit_parms_cb_t *parms, const xmlChar *edit_id_str, const xmlChar *edit_target, const xmlChar *edit_operation, const xmlChar *edit_xml_value, const xmlChar *insert_point, const xmlChar *insert_where)
 Create an edit request and add to YANG Patch in progress. More...
 
status_t agt_apply_patch_edit (ses_cb_t *scb, agt_edit_parms_cb_t *parms)
 SIL version of the db_api_send_edt_full2 API. More...
 

Detailed Description

Contains many general utilities useful for SIL and SIL-SA code to use.

Includes agt_make_ set of functions for constructing return data for GET2 callbacks. Includes many internal APIs used by the server, unrelated to specific YANG modules.

Function Documentation

◆ agt_add_bits_leafy()

status_t agt_add_bits_leafy ( val_value_t parentval,
const xmlChar *  modname,
const xmlChar *  leafname,
const ncx_list_t leafval 
)

make a child node from a ncx_list_t struct (bits) and add to parent.

Add a simple child to a container or list

  • Combines agt_make_bits_leaf and val_child_add
  • Can be used for leaf or leaf-list

A bits can also be set with agt_add_leafy using the string representation instead of the internal representation

Parameters
parentvalparent value node to get new child
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafvalbits value for leaf
Returns
status
Here is the call graph for this function:

◆ agt_add_boolean_leafy()

status_t agt_add_boolean_leafy ( val_value_t parentval,
const xmlChar *  modname,
const xmlChar *  leafname,
boolean  boolval 
)

make a child node from a boolean and add to parent.

Add a simple child to a container or list

  • Combines agt_make_boolean_leaf and val_child_add
  • Can be used for leaf or leaf-list
Parameters
parentvalparent value node to get new child
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
boolvalboolean value for leaf
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_add_container()

status_t agt_add_container ( const xmlChar *  modname,
const xmlChar *  objname,
val_value_t parentval,
val_value_t **  val 
)

make a val_value_t struct for a specified nested container data node.

This is used by SIL functions to create a nested container which may have virtual nodes within it

This is for older GET1 callbacks. Use GET2 instead!

TBD: fine-control over SIL C code generation to allow mix of container virtual callback plus child node virtual node callbacks

Parameters
modnamemodule name defining objname
objnamename of object node to create
parentvalparent value node to add container to
[out]valaddress of return val pointer
*val pointer to node created in the database this is not live memory! It will be freed by the database management code
Returns
status
Here is the call graph for this function:

◆ agt_add_idref_leafy()

status_t agt_add_idref_leafy ( val_value_t parentval,
const xmlChar *  modname,
const xmlChar *  leafname,
const val_idref_t leafval 
)

make a child node from a val_idref_t struct and add to parent.

Add a simple child to a container or list

  • Combines agt_make_int64_leaf2 and val_child_add
  • Can be used for leaf or leaf-list

An identityref can also be set with agt_add_leafy using the string representation instead of the internal representation

Parameters
parentvalparent value node to get new child
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafvalidref value for leaf
Returns
status
Here is the call graph for this function:

◆ agt_add_int64_leafy()

status_t agt_add_int64_leafy ( val_value_t parentval,
const xmlChar *  modname,
const xmlChar *  leafname,
int64  leafval 
)

make a child node from a int64 and add to parent.

Add a simple child to a container or list

  • Combines agt_make_int64_leaf2 and val_child_add
  • Can be used for leaf or leaf-list
Parameters
parentvalparent value node to get new child
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafvalnumber value for leaf
Returns
status
Here is the call graph for this function:

◆ agt_add_int_leafy()

status_t agt_add_int_leafy ( val_value_t parentval,
const xmlChar *  modname,
const xmlChar *  leafname,
int32  leafval 
)

make a child node from a int32 and add to parent.

Add a simple child to a container or list

  • Combines agt_make_int_leaf2 and val_child_add
  • Can be used for leaf or leaf-list
Parameters
parentvalparent value node to get new child
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafvalnumber value for leaf
Returns
status
Here is the call graph for this function:

◆ agt_add_leafy()

status_t agt_add_leafy ( val_value_t parentval,
const xmlChar *  modname,
const xmlChar *  leafname,
const xmlChar *  leafstrval 
)

make a child node from a string and add to parent.

Add a simple child to a container or list

  • Combines agt_make_leaf2 and val_child_add
  • Can be used for leaf or leaf-list
Parameters
parentvalparent value node to get new child
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafstrvalstring version of value to set for leaf
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_add_patch_edit()

status_t agt_add_patch_edit ( agt_edit_parms_cb_t parms,
const xmlChar *  edit_id_str,
const xmlChar *  edit_target,
const xmlChar *  edit_operation,
const xmlChar *  edit_xml_value,
const xmlChar *  insert_point,
const xmlChar *  insert_where 
)

Create an edit request and add to YANG Patch in progress.

THIS API MUST ONLY BE USED WITHIN THE MAIN SERVER.

Parameters
parmsedit parms in progress
edit_id_strindex value for the edit
edit_targetedit target path string
edit_operationedit operation (create merge replace delete remove)
edit_xml_valueXML payload in string form, whitespace allowed
MAY BE NULL if no value required (delete remove))
insert_pointa string like the target except a different instance of the same list of leaf-list; only for before, after; NULL if not used
insert_where== <insert enum string> (may be NULL if not used)
  • "before"
  • "after"
  • "first"
  • "last"
Returns
status
See also
db_api_add_edit

HACK: cut-and-paste from db_api_add_edit function

Here is the call graph for this function:

◆ agt_add_top_container()

status_t agt_add_top_container ( obj_template_t obj,
val_value_t **  val 
)

make a val_value_t struct for a specified top-level container data node.

This is for older GET1 callbacks. Use GET2 instead!

This is used by SIL functions to create a top-level container which may have virtual nodes within in it

TBD: fine-control over SIL C code generation to allow mix of container virtual callback plus child node virtual node callbacks

Parameters
objobject node of the container data node to create
[out]valaddress of return val pointer
*val pointer to node created in the database this is not live memory! It will be freed by the database management code
Returns
status
Here is the call graph for this function:

◆ agt_add_top_node_if_missing()

val_value_t * agt_add_top_node_if_missing ( ncx_module_t mod,
const xmlChar *  objname,
boolean *  added,
status_t res 
)

Add a top config node if it is missing.

SIL Phase 2 init: Check the running config to see if the specified node is there; if not create one return the node either way

Parameters
modmodule containing object
objnameobject name
[out]addedaddress of return added flag
*added TRUE if new node was added
[out]resaddress of return status *res return status, return NULL unless NO_ERR
Returns
if *res==NO_ERR, pointer to new or existing node for modname:objname this is added to running config and does not have to be deleted. !!!! No MRO nodes or default nodes have been added !!!!
Here is the call graph for this function:

◆ agt_add_top_virtual()

status_t agt_add_top_virtual ( obj_template_t obj,
getcb_fn_t  callbackfn 
)

make a val_value_t struct for a specified virtual top-level data node

This is a SIL only API for creating a GET1 callback.

Use GET2 callbacks instead! GET1 is deprecated!

Parameters
objobject node of the virtual data node to create
callbackfnget callback function to install
Returns
status
Here is the call graph for this function:

◆ agt_add_uint64_leafy()

status_t agt_add_uint64_leafy ( val_value_t parentval,
const xmlChar *  modname,
const xmlChar *  leafname,
uint64  leafval 
)

make a child node from a uint64 and add to parent.

Add a simple child to a container or list

  • Combines agt_make_uint64_leaf2 and val_child_add
  • Can be used for leaf or leaf-list
Parameters
parentvalparent value node to get new child
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafvalnumber value for leaf
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_add_uint_leafy()

status_t agt_add_uint_leafy ( val_value_t parentval,
const xmlChar *  modname,
const xmlChar *  leafname,
uint32  leafval 
)

make a child node from a uint32 and add to parent.

Add a simple child to a container or list

  • Combines agt_make_uint_leaf2 and val_child_add
  • Can be used for leaf or leaf-list
Parameters
parentvalparent value node to get new child
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafvalnumber value for leaf
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_any_operations_set()

boolean agt_any_operations_set ( val_value_t val)

Check the new node and all descendants for any operation attibutes prsent.

Parameters
valvalue node to check
Returns
TRUE if any operation attributes found
FALSE if no operation attributes found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_apply_patch_edit()

status_t agt_apply_patch_edit ( ses_cb_t scb,
agt_edit_parms_cb_t parms 
)

SIL version of the db_api_send_edt_full2 API.

Create a YANG Patch edit request and invoke it locally. This patch can have exactly one edit. Provides full access to all 1-shot send_edit parameters.

THIS API MUST ONLY BE USED WITHIN THE MAIN SERVER.

Parameters
scbsession control block for real session that is altering the datastore as a side effect of the RPC operation in progress
parms== agt_edit_parms_cb_t struct
  • MUST BE INITIALIZED FIRST WITH agt_init_edit_parms
Returns
status
See also
db_api_send_edit_full2
Here is the call graph for this function:

◆ agt_apply_this_node()

boolean agt_apply_this_node ( op_editop_t  editop,
const val_value_t newnode,
const val_value_t curnode 
)

Check if the write operation applies to the current node.

Parameters
editopedit operation value
newnodepointer to new node (if any)
curnodepointer to current value node (if any)
(just used to check if non-NULL or compare leaf)
Returns
TRUE if the current node needs the write operation applied
FALSE if this is a NO=OP node (either explicit or special merge)
Here is the call graph for this function:

◆ agt_apply_this_node_ex()

boolean agt_apply_this_node_ex ( op_editop_t  editop,
const val_value_t newnode,
const val_value_t curnode,
boolean  ignore_defaults,
boolean  childonly,
boolean  top_replace 
)

Check if the write operation applies to the current node.

Extended.

Parameters
editopedit operation value
newnodepointer to new node (if any)
curnodepointer to current value node (if any)
(just used to check if non-NULL or compare leaf)
ignore_defaultsTRUE if no special default handling
FALSE if missing default leaf not considered a true result
childonlyTRUE to look just 1 level for comparison
FALSE to compare all descendant nodes of complex types Used only for REPLACE operation
top_replaceTRUE if top replace in progress
FALSE if regular handling
Returns
TRUE if the current node needs the write operation applied
FALSE if this is a NO=OP node (either explicit or special merge)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_backups_enabled()

boolean agt_backups_enabled ( void  )

Check if the backup commands are enabled.

Returns
TRUE if enabled; FALSE if not
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_check_basic()

boolean agt_check_basic ( xml_msg_hdr_t mhdr,
ncx_withdefaults_t  withdef,
boolean  realtest,
val_value_t node 
)

Used by the <get-data> operation to return basic filtering NMDA, module-tags, tstamps filtered data.

val_nodetest_fn_t callback

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
Here is the caller graph for this function:

◆ agt_check_cache()

status_t agt_check_cache ( val_value_t **  cacheptr,
val_value_t newval,
val_value_t curval,
op_editop_t  editop 
)

check if a cache pointer needs to be changed or NULLed out

The auto-generated cache is deprecated. It is for GET1 callbacks. Use GET2 instead.

Parameters
[in,out]cacheptraddress of pointer to cache value node
*cacheptr may be changed, depending on the operation
newvalnewval from the callback function
curvalcurval from the callback function
editopeditop from the callback function
Returns
status
Here is the call graph for this function:

◆ agt_check_config()

boolean agt_check_config ( xml_msg_hdr_t mhdr,
ncx_withdefaults_t  withdef,
boolean  realtest,
val_value_t node 
)

Used by the <get-config> operation to return any type of configuration data.

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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_check_config_false()

boolean agt_check_config_false ( xml_msg_hdr_t mhdr,
ncx_withdefaults_t  withdef,
boolean  realtest,
val_value_t node 
)

Used by the <get*> operation to return only config=false nodes and the ID ancestor nodes.

val_nodetest_fn_t callback

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
Here is the call graph for this function:

◆ agt_check_config_false_default()

boolean agt_check_config_false_default ( xml_msg_hdr_t mhdr,
ncx_withdefaults_t  withdef,
boolean  realtest,
val_value_t node 
)

Used by the <get> operation to return only content=nonconfig nodes and the ID ancestor node and only values not set to the default except if it is a container with counters.

val_nodetest_fn_t callback

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
Here is the call graph for this function:

◆ agt_check_default()

boolean agt_check_default ( xml_msg_hdr_t mhdr,
ncx_withdefaults_t  withdef,
boolean  realtest,
val_value_t node 
)

Used by the <get*> operation to return only values not set to the default.

Matches ncx/val_util.h (val_nodetest_fn_t)

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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_check_delete_all_allowed()

boolean agt_check_delete_all_allowed ( obj_template_t testobj)

Check if the delete-all or remove-all operation is enabled for for specified object.

Parameters
testobjobject to check
Returns
TRUE if delete-all OK; FALSE if no OK
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_check_editop()

status_t agt_check_editop ( op_editop_t  pop,
op_editop_t cop,
val_value_t newnode,
val_value_t curnode,
ncx_iqual_t  iqual,
ncx_protocol_t  proto,
boolean  is_commit,
boolean *  delete_default 
)

Check if the edit operation is okay.

Used internally by the server to process edit-config operation attribute values.

Parameters
popparent edit operation in affect
Starting at the data root, the parent edit-op is derived from the default-operation parameter
[out]copaddress of child operation (MAY BE ADJUSTED ON EXIT!!!)
This is the edit-op field in the new node corresponding to the curnode position in the data model
*cop may be adjusted to simplify further processing, based on the following reduction algorithm:

create, replace, and delete operations are 'sticky'. Once set, any nested edit-ops must be valid within the context of the fixed operation (create or delete) and the child operation gets changed to the sticky parent edit-op

if the parent is create or delete, and the child is merge or replace, then the child can be ignored and will be changed to the parent, since the create or delete must be carried through all the way to the leaves

Parameters
newnodepointer to new node in the edit-config PDU
curnodepointer to the current node in the data model being affected by this operation, if any.
NULL if no current node exists
iqualeffective instance qualifier for this value
protoprotocol in use
is_commitTRUE if this is a commit operation; FALSE if not
[out]delete_defaultaddress of return delete default flag
*delete_default TRUE if this is an attempt to delete or remove a default node; FALSE if not
Returns
status
Here is the call graph for this function:

◆ agt_check_included_changes()

boolean agt_check_included_changes ( agt_cfg_transaction_t txcb,
uint32  included_changes,
obj_template_t targobj 
)

Check an edit transaction to see if it has any edits that match the included_changes bitmask parameter.

Used by YANG Push to filter out push-change-update notifications for a subscription

Parameters
txcbtransaction CB to use to check
included_changesmask to check
see agt_push_change_t flags in agt_push.h
targobjthe target object to check for
NULL for full datastore subscriptions
Returns
TRUE if any included changes; FALSE if not
Here is the call graph for this function:

◆ agt_check_max_access()

status_t agt_check_max_access ( val_value_t newval,
boolean  cur_exists 
)

Check if the max-access for a parameter is exceeded.

Parameters
newvalvalue node from PDU to check
cur_existsTRUE if the corresponding node in the target exists
Returns
status
Here is the call graph for this function:

◆ agt_check_modtags()

boolean agt_check_modtags ( xml_msg_hdr_t mhdr,
ncx_withdefaults_t  withdef,
boolean  realtest,
val_value_t node 
)

Used by the <get> and <get-config> operation to return report-all module-tags filtered data.

val_nodetest_fn_t callback

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
Here is the caller graph for this function:

◆ agt_check_save()

boolean agt_check_save ( xml_msg_hdr_t mhdr,
ncx_withdefaults_t  withdef,
boolean  realtest,
val_value_t node 
)

Used by agt_ncx_cfg_save function to filter just what is supposed to be saved in the <startup> config file.

val_nodetest_fn_t callback

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

◆ agt_clean_edit_parms()

void agt_clean_edit_parms ( agt_edit_parms_cb_t parms)

Clean a SIL edit_parms control clock.

THIS API MUST ONLY BE USED WITHIN THE MAIN SERVER.

Parameters
parmsstruct to clean
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_connect_client()

int agt_connect_client ( const xmlChar *  hostname,
uint16_t  port 
)

Start a TCP connection to a client.

Internal API used by the server

Parameters
hostnameaddress of DNS name of client
portTCP port number to use
Returns
the socket number of the started TCP connection or -1 if error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_crl_mode_enum()

agt_crl_mode_t agt_crl_mode_enum ( const xmlChar *  crl_mode)

Get the enum for the CRL mode string.

Parameters
crl_modestring to check
Returns
enum for CRL mode or AGT_CRL_MODE_NONE if no match
Here is the call graph for this function:

◆ agt_crl_mode_str()

const xmlChar * agt_crl_mode_str ( agt_crl_mode_t  crl_mode)

Get the string for the CRL mode enum.

Parameters
crl_modeenum to check
Returns
const string to type or NCX_EL_NONE if no match

◆ agt_cvt_editop()

op_editop_t agt_cvt_editop ( op_editop_t  editop,
const val_value_t newval,
const val_value_t curval 
)

Determine the effective edit (if OP_EDITOP_COMMIT)

No change unless editop == OP_EDITOP_COMMIT

Parameters
editopthe edit operation to check
newvalthe new value
curvalthe current value
Returns
the converted edit operation
Here is the caller graph for this function:

◆ agt_cvt_editop_acm()

op_editop_t agt_cvt_editop_acm ( op_editop_t  editop,
const val_value_t newval,
const val_value_t curval 
)

Determine the effective edit for NACM.

Parameters
editopthe edit operation to check
newvalthe new value
curvalthe current value
Returns
the converted edit operation

◆ agt_cvt_editop_ex()

op_editop_t agt_cvt_editop_ex ( op_editop_t  editop,
const val_value_t newval,
const val_value_t curval 
)

Determine the effective edit (if OP_EDITOP_COMMIT) Do not convert COMMIT to REPLACE same as cvt_editop.

Parameters
editopthe edit operation to check
newvalthe new value
curvalthe current value
Returns
the converted edit operation
Here is the call graph for this function:

◆ agt_disable_feature()

status_t agt_disable_feature ( const xmlChar *  modname,
const xmlChar *  featurename 
)

Disable a YANG feature in the server.

This will not be detected by any sessions in progress!!! It will take affect the next time a <hello> message is sent by the server

Parameters
modnamemodule name containing the feature
featurenamefeature name to disable
Returns
status
Here is the call graph for this function:

◆ agt_enable_feature()

status_t agt_enable_feature ( const xmlChar *  modname,
const xmlChar *  featurename 
)

Enable a YANG feature in the server.

This will not be detected by any sessions in progress!!! It will take affect the next time a <hello> message is sent by the server

Parameters
modnamemodule name containing the feature
featurenamefeature name to enable
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_fill_dummy_method()

status_t agt_fill_dummy_method ( const xmlChar *  modname,
const xmlChar *  rpcname,
xml_node_t node,
obj_template_t **  rpcobj 
)

Fill the xml_node with the proper data to fake an XML node for the start of the rpc-method element.

MUST CALL xml_init_node for 'node' BEFORE CALLING THIS FUNCTION MUST CALL xml_clean_node AFTER CALLING THIS FUNCTION

Parameters
modnamemodule name of the object
rpcnamename of the RPC node
[out]nodeaddress of node to fill in
*node filled in
[out]rpcobjaddress of return RPC method node
*rpcobj set to object set
Returns
status
Here is the call graph for this function:

◆ agt_find_in_datastore()

status_t agt_find_in_datastore ( ncx_cfg_t  cfg_id,
val_value_t err_value,
val_value_t **  retval 
)

Find the node (should be from an <edit-config> content node) in the specified datastore.

The server will generate an instance-identifier for err_value and then look for it with XPath. The result node if found is returned in *retval

Parameters
cfg_idenum for target datastore to search
err_valuenode from a PDU or different datastore to find
[out]retvaladdress of return value
*retval return value if found in datastore
Returns
status
Here is the call graph for this function:

◆ agt_free_edit_parms()

void agt_free_edit_parms ( agt_edit_parms_cb_t parms)

Clean and free a SIL edit_parms control clock.

THIS API MUST ONLY BE USED WITHIN THE MAIN SERVER.

Parameters
parmsstruct to clean and free
Here is the call graph for this function:

◆ agt_get_cfg_from_parm()

status_t agt_get_cfg_from_parm ( const xmlChar *  parmname,
rpc_msg_t msg,
xml_node_t methnode,
cfg_template_t **  retcfg 
)

FUNCTION agt_get_cfg_from_parm.

Get the cfg_template_t for the config in the target param

Parameters
parmnameparameter to get from (e.g., target)
msgincoming rpc_msg_t in progress
methnodeXML node for RPC method (for errors)
[out]retcfgaddress of return cfg pointer
*retcfg is set to the address of the cfg_template_t struct
Returns
status
Here is the call graph for this function:

◆ agt_get_edit_config_id()

ncx_cfg_t agt_get_edit_config_id ( rpc_msg_t rpcmsg)

Get the enum ID of the configuration that is being edited.

Parameters
rpcmsgRPC message to check
Returns
enumeration of the config being edited (no value for NONE!!)
  • NCX_CFGID_RUNNING,
  • NCX_CFGID_CANDIDATE,
  • NCX_CFGID_STARTUP

◆ agt_get_error_count()

uint32 agt_get_error_count ( rpc_msg_t msg)

Get the current number of errors in the rpc msg Q.

Parameters
msgRPC message to check
Returns
rpc-error count recorded in the message; 0 also if some error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_get_filespec_from_url()

xmlChar * agt_get_filespec_from_url ( const xmlChar *  urlstr,
status_t res 
)

Check the URL and get the filespec part out of it.

Parameters
urlstrURL to check
[out]resaddress of return status; *res return status
Returns
malloced URL string; must be freed by caller!! NULL if some error
Here is the call graph for this function:

◆ agt_get_first_result_val()

val_value_t * agt_get_first_result_val ( xpath_result_t result)

Get the first XPath result node or NULL if not node-set or empty node-set or not value node.

Parameters
resultXPath result to get first resnode from
Returns
back-ptr to first resnode or NULL if none
Here is the call graph for this function:

◆ agt_get_inline_cfg_from_parm()

status_t agt_get_inline_cfg_from_parm ( const xmlChar *  parmname,
rpc_msg_t msg,
xml_node_t methnode,
val_value_t **  retval 
)

Get the val_value_t node for the inline config element.

Parameters
parmnameparameter to get from (e.g., source)
msgincoming rpc_msg_t in progress
methnodeXML node for RPC method (for errors)
[out]retvaladdress of return value node pointer
*retval is set to the address of the val_value_t struct
Returns
status
Here is the call graph for this function:

◆ agt_get_key_value()

val_value_t * agt_get_key_value ( val_value_t startval,
val_value_t **  lastkey 
)

Get the next expected key value in the ancestor chain.

Used in Yuma SIL code to invoke User SIL callbacks with key values

Parameters
startvalvalue node to start from
[out]lastkeyaddress of last key leaf found in ancestor chain
caller maintains this state-var as the anscestor keys are traversed
NULL to get the first key
*lastkey updated with the return value if key found
Returns
value node to use (do not free!!!)
NULL if some bad error like no next key found
Here is the call graph for this function:

◆ agt_get_ok_for_nolock()

boolean agt_get_ok_for_nolock ( rpc_msg_t msg)

Check if the get has filters and if they are OK for a <get> without waiting for a pthreads filter.

This should be OK for top-level config=false data nodes

Parameters
msgrequest message to check
Returns
TRUE if OK for no lock get; FALSE otherwise
Here is the call graph for this function:

◆ agt_get_parmval()

const val_value_t * agt_get_parmval ( const xmlChar *  parmname,
rpc_msg_t msg 
)

Get the identified val_value_t for a given parameter.

Used for error purposes!

Parameters
parmnameparameter to get
msgincoming rpc_msg_t in progress
Returns
status
Here is the call graph for this function:

◆ agt_get_result_from_xpath()

xpath_result_t * agt_get_result_from_xpath ( xpath_pcb_t pcb,
val_value_t rootval,
status_t retres 
)

Get the result from evaluating an XPath expression.

Parameters
pcbXPath parser control block to get result from
rootvaldocument root for XPath evaluation
[out]retresaddress of return status; *retres return status
Returns
malloced XPath result or NULL if some error
Here is the call graph for this function:

◆ agt_get_rpc_input()

val_value_t * agt_get_rpc_input ( rpc_msg_t msg)

Get the rpc input value node.

Parameters
msgRPC message to check
Returns
input value if any
could be the initial rpc-input value that is set to
the NCX_BT_NONE if no input
Here is the caller graph for this function:

◆ agt_get_sid_set_id()

status_t agt_get_sid_set_id ( xmlChar *  buff,
uint32  bufflen 
)

Fill the buffer with the current sid-set-id value.

Constructed from the server-id and the module-set-id

Parameters
buffbuffer to fill in
bufflen== length of buffer
Returns
status
Here is the call graph for this function:

◆ agt_get_startup_filespec()

xmlChar * agt_get_startup_filespec ( status_t res)

Figure out where to store the startup file.

Parameters
[out]resaddress of return status; *res return status
Returns
malloced and filled in filespec string; must be freed by caller NULL if malloc error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_get_target_filespec()

xmlChar * agt_get_target_filespec ( const xmlChar *  target_url,
status_t res 
)

Figure out where to store the URL target file.

Parameters
target_urltarget url spec to use; this is treated as a relative pathspec, and the appropriate data directory is used to create this file
[out]resaddress of return status; *res return status
Returns
malloced and filled in filespec string; must be freed by caller NULL if some error
Here is the call graph for this function:

◆ agt_get_url_from_parm()

status_t agt_get_url_from_parm ( const xmlChar *  parmname,
rpc_msg_t msg,
xml_node_t methnode,
const xmlChar **  returl,
val_value_t **  retval 
)

Get the URL string for the config in the target param.

Used by <edit-config> operation

   1) an edit-content choice for edit-config
   2) a source or target config-choice option for copy-config
   3) a target of delete-config
   4) config-source choice option for validate
Parameters
parmnameparameter to get from (e.g., target)
msgincoming rpc_msg_t in progress
methnodeXML node for RPC method (for errors)
[out]returladdress of return URL string pointer
*returl is set to the address of the URL string pointing to the memory inside the found parameter
[out]retvaladdress of value node from input used
*retval is set to parm node found, if return NO_ERR
Returns
status
Here is the call graph for this function:

◆ agt_getbulk_ok_for_nolock()

boolean agt_getbulk_ok_for_nolock ( const xmlChar *  pathstr)

Check if the get-bulk target is OK for a nolock get without waiting for a pthreads filter.

This should be OK for top-level config=false data nodes

Parameters
pathstrpath string from the request message to check
Returns
TRUE if OK for no lock get; FALSE otherwise
Here is the call graph for this function:

◆ agt_getTermReasonStr()

const xmlChar * agt_getTermReasonStr ( ses_term_reason_t  termreason)

Convert the termination reason enum to a string.

Parameters
termreasonenum for the terminationReason leaf
Returns
the termination reason string
Here is the caller graph for this function:

◆ agt_init_cache()

val_value_t * agt_init_cache ( const xmlChar *  modname,
const xmlChar *  objname,
status_t res 
)

init a cache pointer during the init2 callback

The auto-generated cache is deprecated. It is for GET1 callbacks. Use GET2 instead.

Parameters
modnamename of module defining the top-level object
objnamename of the top-level database object
[out]resaddress of return status; *res is set to the return status
Returns
pointer to object value node from running config, or NULL if error or not found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_init_edit_parms()

status_t agt_init_edit_parms ( agt_edit_parms_cb_t parms,
const xmlChar *  patch_id_str,
boolean  system_edit,
boolean  skip_sil,
const xmlChar *  comment 
)

Initialize a SIL edit_parms control clock.

THIS API MUST ONLY BE USED WITHIN THE MAIN SERVER.

Parameters
[out]parmsstruct to initialize
patch_id_strstring to use as the patch ID
NULL to use the default patch-id field
system_editTRUE if this edit is from the system
FALSE if this is a user edit subject to access control
skip_silTRUE to skip, FALSE to not skip
commentcomment string or NULL to use default
Returns
status
  • can fail if new patch PCB cannot be allocated
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_bits_key()

val_value_t * agt_make_bits_key ( const ncx_list_t leafval)

make a generic key leaf node from a bits struct

For use with the agt_not_add_key API only!

Parameters
leafvalbits value to set for leaf
Returns
malloced value node
Here is the call graph for this function:

◆ agt_make_bits_leaf()

val_value_t * agt_make_bits_leaf ( obj_template_t parentobj,
const xmlChar *  modname,
const xmlChar *  leafname,
const ncx_list_t listval,
status_t res 
)

make a val_value_t struct for a specified leaf or leaf-list (NCX_BT_BITS or NCX_BT_SLIST)

Parameters
parentobjparent object to find child leaf object
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
listvalbits value for leaf
[out]resaddress of return status; *res return status
Returns
malloced value struct or NULL if some error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_boolean_key()

val_value_t * agt_make_boolean_key ( boolean  leafval)

make a generic key leaf node from a boolean

For use with the agt_not_add_key API only!

Parameters
leafvalboolean value to set for leaf
Returns
malloced value node
Here is the call graph for this function:

◆ agt_make_boolean_leaf()

val_value_t * agt_make_boolean_leaf ( obj_template_t parentobj,
const xmlChar *  modname,
const xmlChar *  leafname,
boolean  boolval,
status_t res 
)

make a val_value_t struct for a specified leaf or leaf-list (NCX_BT_BOOL)

Parameters
parentobjparent object to find child leaf object
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
boolvalboolean value for leaf
[out]resaddress of return status; *res return status
Returns
malloced value struct or NULL if some error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_empty_leaf()

val_value_t * agt_make_empty_leaf ( obj_template_t parentobj,
const xmlChar *  modname,
const xmlChar *  leafname,
boolean  boolval,
status_t res 
)

make a val_value_t struct for a specified leaf or leaf-list (NCX_BT_EMPTY)

Parameters
parentobjparent object to find child leaf object
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
boolvalignored boolean value for leaf
[out]resaddress of return status; *res return status
Returns
malloced value struct or NULL if some error
Here is the call graph for this function:

◆ agt_make_idref_key()

val_value_t * agt_make_idref_key ( const val_idref_t leafval)

make a generic key leaf node from an idref struct

For use with the agt_not_add_key API only!

Parameters
leafvalidref value to set for leaf
Returns
malloced value node
Here is the call graph for this function:

◆ agt_make_idref_leaf()

val_value_t * agt_make_idref_leaf ( obj_template_t parentobj,
const xmlChar *  leafname,
const val_idref_t leafval,
status_t res 
)

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

This is a main API for SIL and SIL-SA code to construct return data for GET2 callbacks.

Parameters
parentobjparent object to find child leaf object
leafnamename of leaf to find (namespace hardwired)
leafvalidentityref value for leaf
[out]resaddress of return status; *res return status
Returns
malloced value struct or NULL if some error
See also
agt_make_idref_leaf2
Here is the call graph for this function:

◆ agt_make_idref_leaf2()

val_value_t * agt_make_idref_leaf2 ( obj_template_t parentobj,
const xmlChar *  modname,
const xmlChar *  leafname,
const val_idref_t leafval,
status_t res 
)

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

Similiar to agt_make_idref_leaf except this API allows augmented child nodes to be accessed.

A val_idref_t must be available to use this function Start with a val_value_t of base type NCX_BT_IDREF Use macro VAL_IDREF(val) to access to struct for leafval

Parameters
parentobjparent object to find child leaf object
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafvalidentityref value for leaf
[out]resaddress of return status; *res return status
Returns
malloced value struct or NULL if some error
See also
agt_make_idref_leaf
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_int64_key()

val_value_t * agt_make_int64_key ( int64  leafval)

make a generic key leaf node from an int64

For use with the agt_not_add_key API only!

Parameters
leafvalint64 value to set for leaf
Returns
malloced value node
Here is the call graph for this function:

◆ agt_make_int64_leaf()

val_value_t * agt_make_int64_leaf ( obj_template_t parentobj,
const xmlChar *  leafname,
int64  leafval,
status_t res 
)

make an int64 val_value_t struct for a specified leaf or leaf-list

This is a main API for SIL and SIL-SA code to construct return data for GET2 callbacks.

Parameters
parentobjparent object to find child leaf object
leafnamename of leaf to find (namespace hardwired)
leafvalint64 number value for leaf
[out]resaddress of return status; *res return status
Returns
malloced value struct or NULL if some error
See also
agt_make_int64_leaf2
Here is the call graph for this function:

◆ agt_make_int64_leaf2()

val_value_t * agt_make_int64_leaf2 ( obj_template_t parentobj,
const xmlChar *  modname,
const xmlChar *  leafname,
int64  leafval,
status_t res 
)

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

Similiar to agt_make_int64_leaf except this API allows augmented child nodes to be accessed.

Parameters
parentobjparent object to find child leaf object
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafvalnumber value for leaf
[out]resaddress of return status; *res return status
Returns
:malloced value struct or NULL if some error
See also
agt_make_int64_leaf
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_int_key()

val_value_t * agt_make_int_key ( int32  leafval)

make a generic key leaf node from an int

For use with the agt_not_add_key API only!

Parameters
leafvalint value to set for leaf
Returns
malloced value node
Here is the call graph for this function:

◆ agt_make_int_leaf()

val_value_t * agt_make_int_leaf ( obj_template_t parentobj,
const xmlChar *  leafname,
int32  leafval,
status_t res 
)

make an int32 val_value_t struct for a specified leaf or leaf-list

This is a main API for SIL and SIL-SA code to construct return data for GET2 callbacks.

Parameters
parentobjparent object to find child leaf object
leafnamename of leaf to find (namespace hardwired)
leafvalinteger number value for leaf
[out]resaddress of return status; *res return status
Returns
malloced value struct or NULL if some error
See also
agt_make_int_leaf2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_int_leaf2()

val_value_t * agt_make_int_leaf2 ( obj_template_t parentobj,
const xmlChar *  modname,
const xmlChar *  leafname,
int32  leafval,
status_t res 
)

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

Similiar to agt_make_uint_leaf except this API allows augmented child nodes to be accessed.

Parameters
parentobjparent object to find child leaf object
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafvalnumber value for leaf
[out]resaddress of return status; *res return status
Returns
malloced value struct or NULL if some error
See also
agt_make_int_leaf
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_leaf()

val_value_t * agt_make_leaf ( obj_template_t parentobj,
const xmlChar *  leafname,
const xmlChar *  leafstrval,
status_t res 
)

make a string val_value_t struct for a specified leaf or leaf-list

This is a main API for SIL and SIL-SA code to construct return data for GET2 callbacks.

Parameters
parentobjparent object to find child leaf object
leafnamename of leaf to find (namespace hardwired)
leafstrvalstring version of value to set for leaf
[out]resaddress of return status; *res=return status
Returns
malloced value struct or NULL if some error
See also
agt_make_leaf2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_leaf2()

val_value_t * agt_make_leaf2 ( obj_template_t parentobj,
const xmlChar *  modname,
const xmlChar *  leafname,
const xmlChar *  leafstrval,
status_t res 
)

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

Similiar to agt_make_leaf except this API allows augmented child nodes to be accessed.

Parameters
parentobjparent object to find child leaf object
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafstrvalstring version of value to set for leaf
[out]resaddress of return status; *res return status
Returns
malloced value struct or NULL if some error
See also
agt_make_leaf
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_list()

val_value_t * agt_make_list ( obj_template_t parentobj,
const xmlChar *  listname,
status_t res 
)

make a val_value_t struct for a specified list

Note that the list is not complete and not ready upon exit. The list keys need to be added and then the val_gen_index_chain must be called

Parameters
parentobjparent object to find child leaf object
listnamename of list object to find (namespace hardwired)
[out]resaddress of return status; *res return status
Returns
malloced value struct for the list or NULL if some error
Here is the call graph for this function:

◆ agt_make_object()

val_value_t * agt_make_object ( obj_template_t parentobj,
const xmlChar *  objname,
status_t res 
)

make a val_value_t struct for a specified node

Parameters
parentobjparent object to find child leaf object
objnamename of the object to find (namespace hardwired)
[out]resaddress of return status; *res return status
Returns
malloced value struct for the list or NULL if some error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_object2()

val_value_t * agt_make_object2 ( obj_template_t parentobj,
const xmlChar *  modname,
const xmlChar *  objname,
status_t res 
)

make a val_value_t struct for a specified node

Similiar to agt_make_object except this API allows augmented child nodes to be accessed.

Parameters
parentobjparent object to find child leaf object
modnamemodule name that defines objname
objnamename of the object to find
[out]resaddress of return status; *res return status
Returns
malloced value struct for the list or NULL if some error
See also
agt_make_object
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_srid_filespec()

xmlChar * agt_make_srid_filespec ( const xmlChar *  basestr,
const xmlChar *  patstr,
const xmlChar *  valstr 
)

Make a filespec string needed for a filespec with SRID in it.

Parameters
basestrplain filespec used for length check
  • Example: "/tmp/netconfd-pro-subsys-info.txt"
patstrpattern string with 1 's' in it for the valstr
  • Example "/tmp/netconfd-pro-subsys-info.%s.txt"
valstrThis is expected to be the server root ID string
  • Example: sr1 or sr2
Returns
malloced string; free with m__free
Return values
NULLif malloc error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_string_key()

val_value_t * agt_make_string_key ( const xmlChar *  leafval)

make a generic key leaf node from a string

For use with the agt_not_add_key API only!

Parameters
leafvalstring version of value to set for leaf
Returns
malloced value node
Here is the call graph for this function:

◆ agt_make_uint64_key()

val_value_t * agt_make_uint64_key ( uint64  leafval)

make a generic key leaf node from a uint64

For use with the agt_not_add_key API only!

Parameters
leafvaluint64 value to set for leaf
Returns
malloced value node
Here is the call graph for this function:

◆ agt_make_uint64_leaf()

val_value_t * agt_make_uint64_leaf ( obj_template_t parentobj,
const xmlChar *  leafname,
uint64  leafval,
status_t res 
)

make a uint64 val_value_t struct for a specified leaf or leaf-list

This is a main API for SIL and SIL-SA code to construct return data for GET2 callbacks.

Parameters
parentobjparent object to find child leaf object
leafnamename of leaf to find (namespace hardwired)
leafvaluint64 number value for leaf
[out]resaddress of return status; *res return status
Returns
malloced value struct or NULL if some error
See also
agt_make_uint64_leaf2
Here is the call graph for this function:

◆ agt_make_uint64_leaf2()

val_value_t * agt_make_uint64_leaf2 ( obj_template_t parentobj,
const xmlChar *  modname,
const xmlChar *  leafname,
uint64  leafval,
status_t res 
)

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

Similiar to agt_make_uint64_leaf except this API allows augmented child nodes to be accessed.

Parameters
parentobjparent object to find child leaf object
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafvalnumber value for leaf
[out]resaddress of return status; *res return status
Returns
:malloced value struct or NULL if some error
See also
agt_make_uint64_leaf
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_uint_key()

val_value_t * agt_make_uint_key ( uint32  leafval)

make a generic key leaf node from a uint

For use with the agt_not_add_key API only!

Parameters
leafvaluint value to set for leaf
Returns
malloced value node
Here is the call graph for this function:

◆ agt_make_uint_leaf()

val_value_t * agt_make_uint_leaf ( obj_template_t parentobj,
const xmlChar *  leafname,
uint32  leafval,
status_t res 
)

make a uint32 val_value_t struct for a specified leaf or leaf-list

This is a main API for SIL and SIL-SA code to construct return data for GET2 callbacks.

Parameters
parentobjparent object to find child leaf object
leafnamename of leaf to find (namespace hardwired)
leafvalnumber value for leaf
[out]resaddress of return status; *res=return status
Returns
malloced value struct or NULL if some error
See also
agt_make_uint_leaf2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_uint_leaf2()

val_value_t * agt_make_uint_leaf2 ( obj_template_t parentobj,
const xmlChar *  modname,
const xmlChar *  leafname,
uint32  leafval,
status_t res 
)

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

Similiar to agt_make_uint_leaf except this API allows augmented child nodes to be accessed.

Parameters
parentobjparent object to find child leaf object
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafvalnumber value for leaf
[out]resaddress of return status; *res return status
Returns
:malloced value struct or NULL if some error
See also
agt_make_uint_leaf
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_union_leaf()

val_value_t * agt_make_union_leaf ( obj_template_t parentobj,
const xmlChar *  modname,
const xmlChar *  leafname,
const val_value_t leafval,
status_t res 
)

make a val_value_t struct for a specified leaf or leaf-list use a val_value_t for a union

Parameters
parentobjparent object to find child leaf object
modnamename of module defining leaf (may be NULL to pick parent)
leafnamename of leaf to find (namespace hardwired)
leafvalval_value_t union val
[out]resaddress of return status; *res return status
Returns
malloced value struct or NULL if some error
Here is the call graph for this function:

◆ agt_make_virtual_leaf()

val_value_t * agt_make_virtual_leaf ( obj_template_t parentobj,
const xmlChar *  leafname,
getcb_fn_t  callbackfn,
status_t res 
)

make a val_value_t struct for a specified virtual leaf or leaf-list

This is a SIL only API for creating a GET1 callback.

Use GET2 callbacks instead! GET1 is deprecated!

!!! This function works on all value node types !!! !!! Check for leaf or leaf-list removed !!!

Parameters
parentobjparent object to find child leaf object
leafnamename of leaf to find (namespace hardwired)
callbackfnget callback function to install
[out]resaddress of return status; *res return status
Returns
malloced value struct or NULL if some error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_virtual_leaf2()

val_value_t * agt_make_virtual_leaf2 ( obj_template_t parentobj,
const xmlChar *  modname,
const xmlChar *  leafname,
getcb_fn_t  callbackfn,
status_t res 
)

make a val_value_t struct for a specified virtual leaf or leaf-list

Similiar to agt_make_virtual_leaf except this API allows augmented child nodes to be accessed.

  !!! This function works on all value node types !!!
  !!! Check for leaf or leaf-list removed !!!
Parameters
parentobjparent object to find child leaf object
modnamemodule name that defines objname
leafnamename of leaf to find (namespace hardwired)
callbackfnget callback function to install
[out]resaddress of return status; *res return status
Returns
malloced value struct or NULL if some error
See also
agt_make_virtual_leaf
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_make_yang_patch_cb()

yang_patch_cb_t * agt_make_yang_patch_cb ( const xmlChar *  patch_id,
const xmlChar *  the_comment,
const xmlChar *  patch_root,
agt_cfg_transaction_t txcb,
uint32  included_changes 
)

Make a yang_patch_cb for a YANG Patch conventional datastore on-change update.

Used by RESTCONF and DB-API for edits

Parameters
patch_idpatch-id field (may be NULL)
the_commentcomment field (may be NULL)
patch_rootpatch root string (may be NULL)
txcbtransaction CB to use to convert to yang patch
included_changesmask to check for edit types to include
see agt_push_change_t flags in agt_push.h
Returns
yang_patch_cb malloed and filled in; free with yang_patch_free_cb
Here is the call graph for this function:

◆ agt_make_yang_patch_cb_file()

yang_patch_cb_t * agt_make_yang_patch_cb_file ( const xmlChar *  patch_id,
const xmlChar *  the_comment,
const xmlChar *  patch_root,
const xmlChar *  filespec 
)

Make a yang_patch_cb for a Simulated Operational On-Change subscription update from a data file.

Used by YANG Push for an update record

Parameters
patch_idpatch-id field (may be NULL)
the_commentcomment field (may be NULL)
patch_rootpatch root string (may be NULL)
filespecfile containing the data to send
Returns
yang_patch_cb malloed and filled in; free with yang_patch_free_cb
Here is the call graph for this function:

◆ agt_make_yang_patch_cb_targobj()

yang_patch_cb_t * agt_make_yang_patch_cb_targobj ( const xmlChar *  patch_id,
const xmlChar *  the_comment,
const xmlChar *  patch_root,
agt_cfg_transaction_t txcb,
uint32  included_changes,
obj_template_t targobj 
)

Make a yang_patch_cb for a YANG Patch conventional datastore on-change update for a target object.

Used by RESTCONF and DB-API for edits

Parameters
patch_idpatch-id field (may be NULL)
the_commentcomment field (may be NULL)
patch_rootpatch root string (may be NULL)
txcbtransaction CB to use to convert to yang patch
included_changesmask to check for edit types to include
see agt_push_change_t flags in agt_push.h
targobjobject to make patch for
Returns
yang_patch_cb malloed and filled in; free with yang_patch_free_cb
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_match_etag()

boolean agt_match_etag ( val_value_t val,
const xmlChar *  etag 
)

Check if the etag matches the specified value string.

Parameters
valvalue node to check
etagetag string to check
Returns
TRUE if the etags match; FALSE if not
Here is the call graph for this function:

◆ agt_match_etag_binary()

boolean agt_match_etag_binary ( val_value_t val,
ncx_etag_t  etag 
)

Check if the etag matches the specified value string.

Start with a binary etag, not a string

Parameters
valvalue node to check
etagetag to check
Returns
TRUE if the etags match; FALSE if not

◆ agt_modified_since()

boolean agt_modified_since ( val_value_t val,
time_t *  timerec 
)

Check if the timestamp for the object is later then the specified timestamp.

Parameters
valvalue node to check
timerectimestamp string converted to time_t to check
Returns
TRUE if the modified since timestamp or not timestamp; FALSE if not
Here is the call graph for this function:

◆ agt_module_in_cli_valset()

boolean agt_module_in_cli_valset ( const xmlChar *  modname)

Check if there is a module=foo parameter in the CLI parameter set.

Parameters
modnamemodule name to find
Returns
TRUE if module=modname found; FALSE if not
Here is the call graph for this function:

◆ agt_new_edit_parms()

agt_edit_parms_cb_t * agt_new_edit_parms ( const xmlChar *  patch_id_str,
boolean  system_edit,
boolean  skip_sil,
const xmlChar *  comment 
)

Create and initialize a SIL edit_parms control clock.

THIS API MUST ONLY BE USED WITHIN THE MAIN SERVER.

Parameters
patch_id_strstring to use as the patch ID
NULL to use the default patch-id field
system_editTRUE if this edit is from the system
FALSE if this is a user edit subject to access control
skip_silTRUE to skip, FALSE to not skip
commentcomment string or NULL to use default
Returns
malloced and initialized control block
See also
db_api_start_patch2
Here is the call graph for this function:

◆ agt_new_xpath_pcb()

xpath_pcb_t * agt_new_xpath_pcb ( ses_cb_t scb,
const xmlChar *  expr,
status_t res 
)

Get a new XPath parser control block and set up the server variable bindings.

Parameters
scbsession evaluating the XPath expression
exprexpression string to use (may be NULL)
[out]resaddress of return status; *res return status
Returns
malloced and initialied xpath_pcb_t structure NULL if some error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_notifications_enabled()

boolean agt_notifications_enabled ( void  )

Check if notifications are enabled.

Returns
TRUE if notifications are enabled
FALSE if not
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_op_ok_for_maintenance_mode()

boolean agt_op_ok_for_maintenance_mode ( const obj_template_t rpcobj)

Check if the operation is OK for maintenance mode.

Parameters
rpcobjRPC template structure to check
currently using just name but may use YANG extension in the future
Returns
TRUE if OK for no lock get; FALSE otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_output_empty()

status_t agt_output_empty ( ses_cb_t scb,
rpc_msg_t msg,
int32  indent 
)

output no data for the get or get-config operation because the if-modified-since fileter did not pass

Parameters
scbsession control block
msgRPC request in progress
indentstart indent amount; ignored if the server is configured not to use PDU indentation
Returns
status of the output operation

◆ agt_output_end_container()

void agt_output_end_container ( ses_cb_t scb,
xml_msg_hdr_t mhdr,
xmlns_id_t  node_nsid,
const xmlChar *  node_name,
int32  indent 
)

Output an end container node.

Internal API used by the server

Parameters
scbsession to use
mhdrmessage header to use
node_nsidnamespace ID of the container node
node_namelocal-name of the container node
indentstarting indent
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_output_filter()

status_t agt_output_filter ( ses_cb_t scb,
rpc_msg_t msg,
int32  indent 
)

output the proper data for the get or get-config operation generate the data that matched the subtree or XPath filter

Parameters
scbsession control block
msgRPC request in progress
indentstart indent amount; ignored if the server is configured not to use PDU indentation
Returns
status of the output operation
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_output_schema()

status_t agt_output_schema ( ses_cb_t scb,
rpc_msg_t msg,
int32  indent 
)

generate the YANG file contents for the get-schema operation

Parameters
scbsession control block
msgRPC request in progress
indentstart indent amount; ignored if the server is configured not to use PDU indentation
Returns
status of the output operation
Here is the call graph for this function:

◆ agt_output_start_container()

void agt_output_start_container ( ses_cb_t scb,
xml_msg_hdr_t mhdr,
xmlns_id_t  parent_nsid,
xmlns_id_t  node_nsid,
const xmlChar *  node_name,
int32  indent 
)

Output a start container node.

Internal API used by the server

Parameters
scbsession to use
mhdrmessage header to use
parent_nsidnamespace ID of the parent of the container node
OK if this is zero (will force xmlns attr in XML)
node_nsidnamespace ID of the container node
node_namelocal-name of the container node
indentstarting indent
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_output_start_errors_container()

void agt_output_start_errors_container ( ses_cb_t scb,
xml_msg_hdr_t mhdr,
xmlns_id_t  parent_nsid,
xmlns_id_t  nsid,
const xmlChar *  elname,
const dlq_hdr_t *  attrQ,
boolean  isattrq,
int32  indent,
boolean  empty 
)

Output a start <errors> element on the specified session for RESTCONF error handling.

Internal API used by the server

Parameters
scbsession to use
mhdrmessage header to use
parent_nsidnamespace ID of the parent of the container node
OK if this is zero (will force xmlns attr in XML)
nsidnamespace ID of the element elname
elnameunqualified name of element to write
attrQQ of xml_attr_t or val_value_t records to write in the element; NULL none
isattrqTRUE if the qQ contains xml_attr_t nodes
FALSE if the Q contains val_value_t nodes (metadata)
indentstarting indent
emptyTRUE for empty node
FALSE for start node
Here is the call graph for this function:

◆ agt_output_start_node()

void agt_output_start_node ( ses_cb_t scb,
xml_msg_hdr_t mhdr,
xmlns_id_t  parent_nsid,
xmlns_id_t  node_nsid,
const xmlChar *  node_name,
int32  indent,
boolean  try_modname 
)

Output a start node and try to use modname in front if needed.

Internal API used by the server

Parameters
scbsession to use
mhdrmessage header to use
parent_nsidnamespace ID of the parent of the container node
OK if this is zero (will force xmlns attr in XML)
node_nsidnamespace ID of the container node
node_namelocal-name of the container node
indentstarting indent
try_modnameTRUE to try to use modname
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_output_start_node2()

void agt_output_start_node2 ( ses_cb_t scb,
xml_msg_hdr_t mhdr,
xmlns_id_t  parent_nsid,
xmlns_id_t  node_nsid,
const xmlChar *  node_name,
int32  indent,
boolean  try_modname,
val_value_t metaval 
)

Output a start node and try to use modname in front if needed.

Can add metadata (XML attributes) to the start node.

Internal API used by the server

Parameters
scbsession to use
mhdrmessage header to use
parent_nsidnamespace ID of the parent of the container node
OK if this is zero (will force xmlns attr in XML)
node_nsidnamespace ID of the container node
node_namelocal-name of the container node
indentstarting indent
try_modnameTRUE to try to use modname
metavalthe fake node to use for its metaQ These val_value_t nodes will be used in the begin element for XML output. NULL for no metadata
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_record_attr_error()

void agt_record_attr_error ( ses_cb_t scb,
xml_msg_hdr_t msghdr,
ncx_layer_t  layer,
status_t  res,
const xml_attr_t xmlattr,
const xml_node_t xmlnode,
const xmlChar *  badns,
ncx_node_t  nodetyp,
void *  errnode 
)

Generate an rpc_err_rec_t and save it in the msg.

This is called from the XML parser when an invalid or missing attribute is detected

Parameters
scbsession control block
[in,out]msghdrXML msg header with error Q
NULL, no errors will be recorded!
msghdr->errQ has error message added if no malloc errors
layernetconf layer error occured
resinternal error code
xmlattrXML attribute node causing error
(NULL if not available)
xmlnodeXML node containing the attr
badnsbad namespace string value
nodetyptype of node in 'errnode'
errnodeinternal data node with the error
NULL if not used
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_record_error()

void agt_record_error ( ses_cb_t scb,
xml_msg_hdr_t msghdr,
ncx_layer_t  layer,
status_t  res,
const xml_node_t xmlnode,
ncx_node_t  parmtyp,
const void *  error_info,
ncx_node_t  nodetyp,
void *  error_path 
)

Generate an rpc_err_rec_t and save it in the msg.

This is the main SIL or SIL-SA API to return an <rpc-error> to the NETCONF or RESTCONF client.

Parameters
[in,out]scbsession control block
NULL and no stats will be recorded
scb->stats may be updated if scb non-NULL
[in,out]msghdrXML msg header with error Q
NULL, no errors will be recorded!
msghdr->errQ has error message added if not NULL and no malloc errors
layernetconf layer error occured. Used for <error-type> field.
resinternal error code. Will get mapped to <error-tag> and <error-app-tag>
xmlnodeXML node causing error. Will be used for <bad-element> and maybe error <error-path>
NULL if not available
parmtyptype of node in 'error_info'
error_infoerror data, specific to 'res'. Used to generate <error-info> sub-elements.
NULL if not available (then nodetyp ignored)
nodetyptype of node in 'error_path'
error_pathinternal data node with the error. Used to generate the <error-path> field
NULL if not available or not used
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_record_error_errinfo()

void agt_record_error_errinfo ( ses_cb_t scb,
xml_msg_hdr_t msghdr,
ncx_layer_t  layer,
status_t  res,
const xml_node_t xmlnode,
ncx_node_t  parmtyp,
const void *  error_info,
ncx_node_t  nodetyp,
void *  error_path,
const ncx_errinfo_t errinfo 
)

Generate an rpc_err_rec_t and save it in the msg Use provided error fields.

This is the main SIL or SIL-SA API to return an <rpc-error> to the NETCONF or RESTCONF client.

Parameters
[in,out]scbsession control block
NULL and no stats will be recorded
scb->stats may be updated if scb non-NULL
[in,out]msghdrXML msg header with error Q
NULL, no errors will be recorded!
msghdr->errQ has error message added if not NULL and no malloc errors
layernetconf layer error occured. Used for <error-type> field.
resinternal error code. Will get mapped to <error-tag> and <error-app-tag>
xmlnodeXML node causing error. Will be used for <bad-element> and maybe error <error-path>
NULL if not available
parmtyptype of node in 'error_info'
error_infoerror data, specific to 'res'. Used to generate <error-info> sub-elements.
NULL if not available (then nodetyp ignored)
nodetyptype of node in 'error_path'
error_pathinternal data node with the error. Used to generate the <error-path> field
NULL if not available or not used
errinfoerror info record to use (may be NULL)
Here is the caller graph for this function:

◆ agt_record_error_obj()

void agt_record_error_obj ( ses_cb_t scb,
xml_msg_hdr_t msghdr,
status_t  res,
obj_template_t errobj,
const xmlChar *  badval 
)

Generate an rpc_err_rec_t and save it in the msg Use the provided object for <rpc-error> fields.

Parameters
scbsession control block to use
msghdrXML msg header with error Q
reserror status code
errobjobject node in API schema tree or data schema tree associated with the error
badvalerror-info node to use
Here is the call graph for this function: