yumapro  24.10-11
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

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...
 
status_t agt_check_max_access (val_value_t *newval, boolean cur_exists)
 Check if the max-access for a parameter is exceeded. 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...
 
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...
 
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...
 
boolean agt_backups_enabled (void)
 Check if the backup commands are enabled. 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...
 
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...
 
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...
 
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...
 
obj_template_tagt_get_rpc_output_obj (rpc_msg_t *msg)
 Get the rpc output object template. More...
 
obj_template_tagt_get_action_output_obj (val_value_t *actionval)
 Get the action output object template. More...
 
const xmlChar * agt_getTermReasonStr (ses_term_reason_t termreason)
 Convert the termination reason enum to a string. 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...
 
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_xpath_force_true (struct xpath_pcb_t_ *pcb, val_value_t *context, val_value_t *docroot, boolean *result)
 XPath Boolean EVAL Replacement Callback. More...
 
status_t agt_xpath_example (struct xpath_pcb_t_ *pcb, val_value_t *context, val_value_t *docroot, boolean *result)
 XPath Boolean EVAL Replacement Callback. 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...
 
void agt_print_error_headers (void)
 Print the error number and error message for each error to STDOUT or the logfile; Used for doxygen header in H file. 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.

  • OK for SIL or SIL-SA

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.

  • OK for SIL or SIL-SA

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_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.

  • OK for SIL or SIL-SA

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.

  • OK for SIL or SIL-SA

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.

  • OK for SIL or SIL-SA

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.

  • OK for SIL or SIL-SA

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.

  • OK for SIL; NOT OK for SIL-SA
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_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.

  • OK for SIL or SIL-SA

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.

  • OK for SIL or SIL-SA

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_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.

  • OK for SIL; NOT OK for SIL-SA

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_backups_enabled()

boolean agt_backups_enabled ( void  )

Check if the backup commands are enabled.

  • OK for SIL; NOT OK for SIL-SA
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_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.

  • OK for SIL; NOT OK for SIL-SA
Parameters
testobjobject to check
Returns
TRUE if delete-all OK; FALSE if no OK
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.

  • OK for SIL; NOT OK for SIL-SA
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_crl_mode_enum()

agt_crl_mode_t agt_crl_mode_enum ( const xmlChar *  crl_mode)

Get the enum for the CRL mode string.

  • OK for SIL; NOT OK for SIL-SA
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.

  • OK for SIL; NOT OK for SIL-SA
Parameters
crl_modeenum to check
Returns
const string to type or NCX_EL_NONE if no match

◆ 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.

  • OK for SIL; NOT OK for SIL-SA

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_get_action_output_obj()

obj_template_t * agt_get_action_output_obj ( val_value_t actionval)

Get the action output object template.

  • OK for SIL; NOT OK for SIL-SA
Parameters
actionvalaction value node passed to action callback
Returns
output object or NULL if some error
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.

  • OK for SIL; NOT OK for SIL-SA
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.

  • OK for SIL; NOT OK for SIL-SA
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_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

  • OK for SIL; NOT OK for SIL-SA
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_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!

  • OK for SIL; NOT OK for SIL-SA
Parameters
parmnameparameter to get
msgincoming rpc_msg_t in progress
Returns
status
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.

  • OK for SIL; NOT OK for SIL-SA
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_rpc_output_obj()

obj_template_t * agt_get_rpc_output_obj ( rpc_msg_t msg)

Get the rpc output object template.

  • OK for SIL; NOT OK for SIL-SA
Parameters
msgRPC message to check
Returns
output object or NULL if some error
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.

  • OK for SIL; NOT OK for SIL-SA
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_getTermReasonStr()

const xmlChar * agt_getTermReasonStr ( ses_term_reason_t  termreason)

Convert the termination reason enum to a string.

  • OK for SIL; NOT OK for SIL-SA
Parameters
termreasonenum for the terminationReason leaf
Returns
the termination reason string
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

  • OK for SIL or SIL-SA

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)

  • OK for SIL or SIL-SA
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

  • OK for SIL or SIL-SA

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)

  • OK for SIL or SIL-SA
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)

  • OK for SIL or SIL-SA
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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA
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.

  • OK for SIL or SIL-SA
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!

  • OK for SIL or SIL-SA
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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA

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

  • OK for SIL or SIL-SA
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.
  • NOT OK for SIL-SA

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

◆ 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.

  • OK for SIL; NOT OK for SIL-SA
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.

  • OK for SIL; NOT OK for SIL-SA
Parameters
modnamemodule name to find
Returns
TRUE if module=modname found; FALSE if not
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.

Usually an INTERNAL function but could be needed to use XPath from SIL; NOT OK for SIL-SA

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.

  • OK for SIL; NOT OK for SIL-SA
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.

  • OK for SIL; NOT OK for SIL-SA
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_print_error_headers()

void agt_print_error_headers ( void  )

Print the error number and error message for each error to STDOUT or the logfile; Used for doxygen header in H file.

◆ 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.

  • OK for SIL; NOT OK for SIL-SA

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.

  • OK for SIL; NOT OK for SIL-SA

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.

  • OK for SIL; NOT OK for SIL-SA

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.

  • OK for SIL; NOT OK for SIL-SA
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:

◆ agt_record_warning()

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.

  • OK for SIL; NOT OK for SIL-SA

Not actually supported in NETCONF protocol because no standard error-tag values are defined for severity=warning

Use the provided error info record for <rpc-error> fields Set the error-severity field to warning instead of error but only if agt_with_warnings is TRUE

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_parmerror 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)

◆ agt_xpath_example()

status_t agt_xpath_example ( struct xpath_pcb_t_ *  pcb,
val_value_t context,
val_value_t docroot,
boolean *  result 
)

XPath Boolean EVAL Replacement Callback.

  • OK for SIL; NOT OK for SIL-SA

EXAMPLE; NOT REAL Callback to implement the XPath semantics for a must or when statement for a datastore object.

Use XPATH_EXPRSTR(pcb) to examine the XPath expression The callback must return ERR_NCX_SKIPPED if the expression evaluation is skipped.

Only supported for used during datastore processing to access configuration nodes (val_value_t tree) Support for GET2 callbacks not supported at this time

Used in the server to optimize datastore validation and delete_dead_nodes when-stmt processing.

Parameters
pcbXPath parser control block in use
contextcontext value node to use. The object of this node contains a pointer to this callback function
docrootdocument root value node to use.
[out]resultaddress of return result if NO_ERR
  • *result is TRUE if the must/when result is true
  • *result is FALSE if the must/when result is false
Returns
status
  • NO_ERR if test is done and *result is valid
  • ERR_NCX_SKIPPED if test is not done and *result is not valid. Actual XPath eval will be done instead.
  • other error to force the XPath test to fail with an error and datastore operation will fail
Here is the call graph for this function:

◆ agt_xpath_force_true()

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.

  • OK for SIL; NOT OK for SIL-SA

Callback to implement the XPath semantics for a must or when statement for a datastore object.

Use XPATH_EXPRSTR(pcb) to examine the XPath expression The callback must return ERR_NCX_SKIPPED if the expression evaluation is skipped.

Only supported for used during datastore processing to access configuration nodes (val_value_t tree) Support for GET2 callbacks not supported at this time

Used in the server to optimize datastore validation and delete_dead_nodes when-stmt processing.

Parameters
pcbXPath parser control block in use
contextcontext value node to use. The object of this node contains a pointer to this callback function
docrootdocument root value node to use.
[out]resultaddress of return result if NO_ERR
  • *result is TRUE if the must/when result is true
  • *result is FALSE if the must/when result is false
Returns
status
Return values
NO_ERRif test is done and *result is valid
ERR_NCX_SKIPPEDif test is not done and *result is not valid. Actual XPath eval will be done instead.
othererror to force the XPath test to fail with an error and datastore operation will fail