YANG actions are like RPC handlers embedded within YANG data.
More...
|
status_t | agt_action_init (void) |
| Initialize the Action handler. More...
|
|
void | agt_action_cleanup (void) |
| Cleanup the Action handler. More...
|
|
status_t | agt_action_register_action (const xmlChar *defpath, agt_rpc_phase_t phase, agt_action_cb_t action_cb) |
| add callback for 1 phase of action processing More...
|
|
void | agt_action_unregister_action (const xmlChar *defpath) |
| remove a callback for all phases of action processing More...
|
|
boolean | agt_action_is_action (obj_template_t *rpcobj) |
| Check if the specified node is the action. More...
|
|
status_t | agt_action_parse_input (ses_cb_t *scb, rpc_msg_t *msg, xml_node_t *method, obj_template_t *rpcobj, val_value_t **action_val) |
| RPC "<action>" received, parse parameters against anydata 'action'. More...
|
|
boolean | agt_action_callback_set (obj_template_t *obj) |
| Check if an ACTION callback is registered for this object for SIL-SA usage. More...
|
|
void | agt_action_callback_regdone (obj_template_t *obj) |
| Set the ACTION as register done. More...
|
|
boolean | agt_action_callback_is_regdone (obj_template_t *obj) |
| Set the ACTION as register done. More...
|
|
status_t | agt_action_register_subsys_callback (const xmlChar *subsys_id, const xmlChar *modname, const xmlChar *revision, const xmlChar *defpath) |
| Register an object specific ACTION callback function. More...
|
|
void | agt_action_unregister_subsys_callback (const xmlChar *subsys_id, const xmlChar *modname, const xmlChar *revision, const xmlChar *defpath) |
| Unregister an object specific ACTION callback function. More...
|
|
val_value_t * | agt_action_find_node (val_value_t *val) |
| Find the nested node that is an action. More...
|
|
void | agt_action_unload_module (ncx_module_t *mod) |
| Check all the action objects from this module and clean any callbacks because the module is being unloaded. More...
|
|
YANG actions are like RPC handlers embedded within YANG data.
They use validate and invoke callbacks like RPC callbacks.
◆ agt_action_cb_t
Template for Action server callbacks.
The same template is used for all Action callback phases The callback is expected to validate if needed and then invoke if needed.
The entire input hierarchy for an action is contained in the msg->rpc_input node. The 'actionval' node passed to the callback points at the action node nested in the input (like <ping> in the example below)
<action xmlns="urn:ietf:params:xml:ns:yang:1">
<interfaces xmlns="http://netconfcentral.org/ns/t200">
<interface>
<name>eth1</name>
<ping>
<destination>192.0.2.1</destination>
</ping>
</interface>
</interfaces>
</action>
- Parameters
-
scb | The session control block for the session handling the action request. |
msg | message in progress for this <rpc> request, containing the input parameters (if any). |
methnode | The XML-specific node being parsed if available. This can used for error reporting if no 'val' or 'obj' parameters are available (from the request message). |
actionval | The input node represents the start of the specific action being invoked. The auto-generated SIL code can derive all the ancestor keys from this data structure. |
- Returns
- status return status for the phase; an error in validate phase will cancel invoke phase; an rpc-error will be added if an error is returned and the msg error Q is empty
◆ agt_action_callback_is_regdone()
Set the ACTION as register done.
- Parameters
-
- Returns
- TRUE if register done; FALSE otherwise
◆ agt_action_callback_regdone()
Set the ACTION as register done.
- Parameters
-
◆ agt_action_callback_set()
Check if an ACTION callback is registered for this object for SIL-SA usage.
- Parameters
-
- Returns
- TRUE if ACTION callback registered; FALSE if not
◆ agt_action_cleanup()
void agt_action_cleanup |
( |
void |
| ) |
|
Cleanup the Action handler.
TBD – put platform-specific agent cleanup here
◆ agt_action_find_node()
Find the nested node that is an action.
- Parameters
-
- Returns
- pointer to first action found
◆ agt_action_init()
Initialize the Action handler.
- Returns
- status of the initialization procedure
◆ agt_action_is_action()
Check if the specified node is the action.
- Returns
- TRUE if this is the action RPC
◆ agt_action_parse_input()
RPC "<action>" received, parse parameters against anydata 'action'.
- Parameters
-
| scb | session control block |
[in,out] | msg | rpc_msg_t in progress
msg->mhdr.errorQ may be set be agt_record_error |
| method | method node |
| rpcobj | the object template for <action> found by agt_rpc |
[out] | action_val | address of return action value node template to validate as if it were an RPC contents
*action_val set to subtree within top_val that represents the action-stmt container, which is equivalent to the rpc_input value tree that represents the rpc/input container. |
- Returns
- status
◆ agt_action_register_action()
add callback for 1 phase of action processing
- Parameters
-
defpath | Xpath with default (or no) prefixes defining the object that will get the callbacks |
phase | action server callback phase for this callback
- AGT_PH_VALIDATE(0): validate phase
- AGT_PH_INVOKE(1): invoke phase
- AGT_PH_POST_REPLY(2): post-reply phase
|
action_cb | pointer to callback function to register |
- Returns
- status of the operation
◆ agt_action_register_subsys_callback()
status_t agt_action_register_subsys_callback |
( |
const xmlChar * |
subsys_id, |
|
|
const xmlChar * |
modname, |
|
|
const xmlChar * |
revision, |
|
|
const xmlChar * |
defpath |
|
) |
| |
Register an object specific ACTION callback function.
- Parameters
-
subsys_id | subsystem ID registering the remote callback fn |
modname | module being loaded |
revision | revision date of module being loaded (may be NULL) |
defpath | path ID for the action |
- Returns
- status
◆ agt_action_unload_module()
Check all the action objects from this module and clean any callbacks because the module is being unloaded.
- Parameters
-
mod | module being removed. This must be a real module not a submodule |
◆ agt_action_unregister_action()
void agt_action_unregister_action |
( |
const xmlChar * |
defpath | ) |
|
remove a callback for all phases of action processing
- Parameters
-
defpath | Xpath with default (or no) prefixes defining the object that will have the callbacks removed |
◆ agt_action_unregister_subsys_callback()
void agt_action_unregister_subsys_callback |
( |
const xmlChar * |
subsys_id, |
|
|
const xmlChar * |
modname, |
|
|
const xmlChar * |
revision, |
|
|
const xmlChar * |
defpath |
|
) |
| |
Unregister an object specific ACTION callback function.
- Parameters
-
subsys_id | subsystem ID registering the remote callback fn |
modname | module being loaded |
revision | revision date of module being loaded (may be NULL) |
defpath | action definition path string |