![]() |
yumapro
24.10-11
YumaPro SDK
|
Contains many general utilities useful for SIL and SIL-SA code to use. More...
Functions | |
const val_value_t * | agt_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_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 More... | |
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 More... | |
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 More... | |
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 More... | |
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 More... | |
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 More... | |
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 More... | |
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 More... | |
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 More... | |
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. 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_t * | agt_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_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 More... | |
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 More... | |
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 More... | |
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 More... | |
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 More... | |
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 More... | |
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 More... | |
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) More... | |
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) More... | |
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) More... | |
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 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_t * | agt_get_rpc_input (rpc_msg_t *msg) |
Get the rpc input value node. More... | |
obj_template_t * | agt_get_rpc_output_obj (rpc_msg_t *msg) |
Get the rpc output object template. More... | |
obj_template_t * | agt_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_t * | agt_make_string_key (const xmlChar *leafval) |
make a generic key leaf node from a string More... | |
val_value_t * | agt_make_uint_key (uint32 leafval) |
make a generic key leaf node from a uint More... | |
val_value_t * | agt_make_int_key (int32 leafval) |
make a generic key leaf node from an int More... | |
val_value_t * | agt_make_uint64_key (uint64 leafval) |
make a generic key leaf node from a uint64 More... | |
val_value_t * | agt_make_int64_key (int64 leafval) |
make a generic key leaf node from an int64 More... | |
val_value_t * | agt_make_boolean_key (boolean leafval) |
make a generic key leaf node from a boolean More... | |
val_value_t * | agt_make_idref_key (const val_idref_t *leafval) |
make a generic key leaf node from an idref struct More... | |
val_value_t * | agt_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... | |
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.
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
A bits can also be set with agt_add_leafy using the string representation instead of the internal representation
parentval | parent value node to get new child |
modname | name of module defining leaf (may be NULL to pick parent) |
leafname | name of leaf to find (namespace hardwired) |
leafval | bits value for leaf |
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
parentval | parent value node to get new child |
modname | name of module defining leaf (may be NULL to pick parent) |
leafname | name of leaf to find (namespace hardwired) |
boolval | boolean value for leaf |
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
An identityref can also be set with agt_add_leafy using the string representation instead of the internal representation
parentval | parent value node to get new child |
modname | name of module defining leaf (may be NULL to pick parent) |
leafname | name of leaf to find (namespace hardwired) |
leafval | idref value for leaf |
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
parentval | parent value node to get new child |
modname | name of module defining leaf (may be NULL to pick parent) |
leafname | name of leaf to find (namespace hardwired) |
leafval | number value for leaf |
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
parentval | parent value node to get new child |
modname | name of module defining leaf (may be NULL to pick parent) |
leafname | name of leaf to find (namespace hardwired) |
leafval | number value for leaf |
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
parentval | parent value node to get new child |
modname | name of module defining leaf (may be NULL to pick parent) |
leafname | name of leaf to find (namespace hardwired) |
leafstrval | string version of value to set for leaf |
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.
parms | edit parms in progress |
edit_id_str | index value for the edit |
edit_target | edit target path string |
edit_operation | edit operation (create merge replace delete remove) |
edit_xml_value | XML payload in string form, whitespace allowed MAY BE NULL if no value required (delete remove)) |
insert_point | a 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)
|
HACK: cut-and-paste from db_api_add_edit function
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
parentval | parent value node to get new child |
modname | name of module defining leaf (may be NULL to pick parent) |
leafname | name of leaf to find (namespace hardwired) |
leafval | number value for leaf |
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
parentval | parent value node to get new child |
modname | name of module defining leaf (may be NULL to pick parent) |
leafname | name of leaf to find (namespace hardwired) |
leafval | number value for leaf |
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.
scb | session 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
|
boolean agt_backups_enabled | ( | void | ) |
Check if the backup commands are enabled.
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.
testobj | object to check |
status_t agt_check_max_access | ( | val_value_t * | newval, |
boolean | cur_exists | ||
) |
Check if the max-access for a parameter is exceeded.
newval | value node from PDU to check |
cur_exists | TRUE if the corresponding node in the target exists |
agt_crl_mode_t agt_crl_mode_enum | ( | const xmlChar * | crl_mode | ) |
Get the enum for the CRL mode string.
crl_mode | string to check |
const xmlChar * agt_crl_mode_str | ( | agt_crl_mode_t | crl_mode | ) |
Get the string for the CRL mode enum.
crl_mode | enum to check |
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
cfg_id | enum for target datastore to search | |
err_value | node from a PDU or different datastore to find | |
[out] | retval | address of return value *retval return value if found in datastore |
obj_template_t * agt_get_action_output_obj | ( | val_value_t * | actionval | ) |
Get the action output object template.
actionval | action value node passed to action callback |
Get the enum ID of the configuration that is being edited.
rpcmsg | RPC message to check |
uint32 agt_get_error_count | ( | rpc_msg_t * | msg | ) |
Get the current number of errors in the rpc msg Q.
msg | RPC message to check |
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
startval | value node to start from | |
[out] | lastkey | address 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 |
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!
parmname | parameter to get |
msg | incoming rpc_msg_t in progress |
val_value_t * agt_get_rpc_input | ( | rpc_msg_t * | msg | ) |
Get the rpc input value node.
msg | RPC message to check |
obj_template_t * agt_get_rpc_output_obj | ( | rpc_msg_t * | msg | ) |
Get the rpc output object template.
msg | RPC message to check |
xmlChar * agt_get_startup_filespec | ( | status_t * | res | ) |
Figure out where to store the startup file.
[out] | res | address of return status; *res return status |
const xmlChar * agt_getTermReasonStr | ( | ses_term_reason_t | termreason | ) |
Convert the termination reason enum to a string.
termreason | enum for the terminationReason leaf |
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!
leafval | bits value to set for 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)
parentobj | parent object to find child leaf object | |
modname | name of module defining leaf (may be NULL to pick parent) | |
leafname | name of leaf to find (namespace hardwired) | |
listval | bits value for leaf | |
[out] | res | address of return status; *res return status |
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!
leafval | boolean value to set for 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)
parentobj | parent object to find child leaf object | |
modname | name of module defining leaf (may be NULL to pick parent) | |
leafname | name of leaf to find (namespace hardwired) | |
boolval | boolean value for leaf | |
[out] | res | address of return status; *res return status |
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)
parentobj | parent object to find child leaf object | |
modname | name of module defining leaf (may be NULL to pick parent) | |
leafname | name of leaf to find (namespace hardwired) | |
boolval | ignored boolean value for leaf | |
[out] | res | address of return status; *res return status |
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!
leafval | idref value to set for 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.
parentobj | parent object to find child leaf object | |
leafname | name of leaf to find (namespace hardwired) | |
leafval | identityref value for leaf | |
[out] | res | address of return status; *res return status |
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
parentobj | parent object to find child leaf object | |
modname | name of module defining leaf (may be NULL to pick parent) | |
leafname | name of leaf to find (namespace hardwired) | |
leafval | identityref value for leaf | |
[out] | res | address of return status; *res return status |
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!
leafval | int64 value to set for 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.
parentobj | parent object to find child leaf object | |
leafname | name of leaf to find (namespace hardwired) | |
leafval | int64 number value for leaf | |
[out] | res | address of return status; *res return status |
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.
parentobj | parent object to find child leaf object | |
modname | name of module defining leaf (may be NULL to pick parent) | |
leafname | name of leaf to find (namespace hardwired) | |
leafval | number value for leaf | |
[out] | res | address of return status; *res return status |
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!
leafval | int value to set for 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.
parentobj | parent object to find child leaf object | |
leafname | name of leaf to find (namespace hardwired) | |
leafval | integer number value for leaf | |
[out] | res | address of return status; *res return status |
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.
parentobj | parent object to find child leaf object | |
modname | name of module defining leaf (may be NULL to pick parent) | |
leafname | name of leaf to find (namespace hardwired) | |
leafval | number value for leaf | |
[out] | res | address of return status; *res return status |
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.
parentobj | parent object to find child leaf object | |
leafname | name of leaf to find (namespace hardwired) | |
leafstrval | string version of value to set for leaf | |
[out] | res | address of return status; *res=return status |
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.
parentobj | parent object to find child leaf object | |
modname | name of module defining leaf (may be NULL to pick parent) | |
leafname | name of leaf to find (namespace hardwired) | |
leafstrval | string version of value to set for leaf | |
[out] | res | address of return status; *res return status |
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
parentobj | parent object to find child leaf object | |
listname | name of list object to find (namespace hardwired) | |
[out] | res | address of return status; *res return status |
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
parentobj | parent object to find child leaf object | |
objname | name of the object to find (namespace hardwired) | |
[out] | res | address of return status; *res return status |
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.
parentobj | parent object to find child leaf object | |
modname | module name that defines objname | |
objname | name of the object to find | |
[out] | res | address of return status; *res return status |
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.
basestr | plain filespec used for length check
|
patstr | pattern string with 1 's' in it for the valstr
|
valstr | This is expected to be the server root ID string
|
NULL | if malloc error |
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!
leafval | string version of value to set for leaf |
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!
leafval | uint64 value to set for 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.
parentobj | parent object to find child leaf object | |
leafname | name of leaf to find (namespace hardwired) | |
leafval | uint64 number value for leaf | |
[out] | res | address of return status; *res return status |
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.
parentobj | parent object to find child leaf object | |
modname | name of module defining leaf (may be NULL to pick parent) | |
leafname | name of leaf to find (namespace hardwired) | |
leafval | number value for leaf | |
[out] | res | address of return status; *res return status |
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!
leafval | uint value to set for 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.
parentobj | parent object to find child leaf object | |
leafname | name of leaf to find (namespace hardwired) | |
leafval | number value for leaf | |
[out] | res | address of return status; *res=return status |
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.
parentobj | parent object to find child leaf object | |
modname | name of module defining leaf (may be NULL to pick parent) | |
leafname | name of leaf to find (namespace hardwired) | |
leafval | number value for leaf | |
[out] | res | address of return status; *res return status |
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
parentobj | parent object to find child leaf object | |
modname | name of module defining leaf (may be NULL to pick parent) | |
leafname | name of leaf to find (namespace hardwired) | |
leafval | val_value_t union val | |
[out] | res | address of return status; *res return status |
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
Use GET2 callbacks instead! GET1 is deprecated!
!!! This function works on all value node types !!! !!! Check for leaf or leaf-list removed !!!
parentobj | parent object to find child leaf object | |
leafname | name of leaf to find (namespace hardwired) | |
callbackfn | get callback function to install | |
[out] | res | address of return status; *res return status |
boolean agt_modified_since | ( | val_value_t * | val, |
time_t * | timerec | ||
) |
Check if the timestamp for the object is later then the specified timestamp.
val | value node to check |
timerec | timestamp string converted to time_t to check |
boolean agt_module_in_cli_valset | ( | const xmlChar * | modname | ) |
Check if there is a module=foo parameter in the CLI parameter set.
modname | module name to find |
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
scb | session evaluating the XPath expression | |
expr | expression string to use (may be NULL) | |
[out] | res | address of return status; *res return status |
boolean agt_notifications_enabled | ( | void | ) |
Check if notifications are enabled.
boolean agt_op_ok_for_maintenance_mode | ( | const obj_template_t * | rpcobj | ) |
Check if the operation is OK for maintenance mode.
rpcobj | RPC template structure to check currently using just name but may use YANG extension in the future |
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.
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
scb | session control block | |
[in,out] | msghdr | XML msg header with error Q NULL, no errors will be recorded! msghdr->errQ has error message added if no malloc errors |
layer | netconf layer error occured | |
res | internal error code | |
xmlattr | XML attribute node causing error (NULL if not available) | |
xmlnode | XML node containing the attr | |
badns | bad namespace string value | |
nodetyp | type of node in 'errnode' | |
errnode | internal data node with the error NULL if not used |
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.
[in,out] | scb | session control block NULL and no stats will be recorded scb->stats may be updated if scb non-NULL |
[in,out] | msghdr | XML msg header with error Q NULL, no errors will be recorded! msghdr->errQ has error message added if not NULL and no malloc errors |
layer | netconf layer error occured. Used for <error-type> field. | |
res | internal error code. Will get mapped to <error-tag> and <error-app-tag> | |
xmlnode | XML node causing error. Will be used for <bad-element> and maybe error <error-path> NULL if not available | |
parmtyp | type of node in 'error_info' | |
error_info | error data, specific to 'res'. Used to generate <error-info> sub-elements. NULL if not available (then nodetyp ignored) | |
nodetyp | type of node in 'error_path' | |
error_path | internal data node with the error. Used to generate the <error-path> field NULL if not available or not used |
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.
[in,out] | scb | session control block NULL and no stats will be recorded scb->stats may be updated if scb non-NULL |
[in,out] | msghdr | XML msg header with error Q NULL, no errors will be recorded! msghdr->errQ has error message added if not NULL and no malloc errors |
layer | netconf layer error occured. Used for <error-type> field. | |
res | internal error code. Will get mapped to <error-tag> and <error-app-tag> | |
xmlnode | XML node causing error. Will be used for <bad-element> and maybe error <error-path> NULL if not available | |
parmtyp | type of node in 'error_info' | |
error_info | error data, specific to 'res'. Used to generate <error-info> sub-elements. NULL if not available (then nodetyp ignored) | |
nodetyp | type of node in 'error_path' | |
error_path | internal data node with the error. Used to generate the <error-path> field NULL if not available or not used | |
errinfo | error info record to use (may be NULL) |
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.
scb | session control block to use |
msghdr | XML msg header with error Q |
res | error status code |
errobj | object node in API schema tree or data schema tree associated with the error |
badval | error-info node to use |
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.
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
[in,out] | scb | session control block NULL and no stats will be recorded scb->stats may be updated if scb non-NULL |
[in,out] | msghdr | XML msg header with error Q NULL, no errors will be recorded! msghdr->errQ has error message added if not NULL and no malloc errors |
layer | netconf layer error occured. Used for <error-type> field. | |
res | internal error code. Will get mapped to <error-tag> and <error-app-tag> | |
xmlnode | XML node causing error. Will be used for <bad-element> and maybe error <error-path> NULL if not available | |
parmtyp | type of node in 'error_info' | |
error_parm | error data, specific to 'res'. Used to generate <error-info> sub-elements. NULL if not available (then nodetyp ignored) | |
nodetyp | type of node in 'error_path' | |
error_path | internal data node with the error. Used to generate the <error-path> field NULL if not available or not used | |
errinfo | error info record to use (may be NULL) |
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.
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.
pcb | XPath parser control block in use | |
context | context value node to use. The object of this node contains a pointer to this callback function | |
docroot | document root value node to use. | |
[out] | result | address of return result if NO_ERR
|
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.
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.
pcb | XPath parser control block in use | |
context | context value node to use. The object of this node contains a pointer to this callback function | |
docroot | document root value node to use. | |
[out] | result | address of return result if NO_ERR
|
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 |