yumapro  20.10-10
YumaPro SDK

Macros and data structures used to manage YANG instrumentation callbacks and hooks. More...

Collaboration diagram for Data Structures:

Data Structures

struct  agt_cb_subsys_t
 header for 1 subsystem that has a SIL-SA callback function registered for the data node in the agt_cb_set_t struct containing the subsysQ More...
 
struct  agt_cb_fnset_t
 set of server object callback functions back pointer to this struct stored in obj_template_t Shared by local and subsys callbacks More...
 

Macros

#define FORALL   TRUE
 symbolic tag for agt_cb_register_callback 'forall' boolean
 
#define FORONE   FALSE
 symbolic tag for agt_cb_register_callback 'forone' boolean
 
#define AGT_CB_FL_EDIT   bit0
 begin 3 flags for the agt_cb_subsys_t.flags field edit flag indicates EDIT1 callbacks for this subsystem
 
#define AGT_CB_FL_GET   bit1
 GET2 callbacks for this subsystem.
 
#define AGT_CB_FL_EDIT2   bit2
 EDIT2 callbacks for this subsystem.
 
#define AGT_CB_FL_PSHOOK   bit3
 3 flags for the HOOKS support in agt_cb_subsys_t.flags field More...
 
#define AGT_CB_FL_SHOOK   bit4
 Set Hook.
 
#define AGT_CB_FL_TXHOOK   bit5
 Transaction Hook.
 
#define AGT_CB_FL_SETHOOK_TREE   bit0
 4 flags for the agt_cb_fnset_t.flags field More...
 
#define AGT_CB_FL_TRANSHOOK_TREE   bit1
 transaction hook tree
 
#define AGT_CB_FL_SKIP_SETHOOK   bit2
 skip set-hook
 
#define AGT_CB_FL_SKIP_TRANSHOOK   bit3
 skip transaction hook
 
#define AGT_CB_FL_PSETHOOK   bit4
 Specifies whether post-set-hook is set in the cbset.
 
#define AGT_CB_FL_SETHOOK   bit5
 Specifies whether set-hook is set in the cbset.
 
#define AGT_CB_FL_TRANSHOOK   bit6
 Specifies whether transaction-hook is set in the cbset.
 
#define AGT_CB_SUBSYS_HAS_EDIT(S)   ((S)->flags & AGT_CB_FL_EDIT)
 check subsystem has an EDIT1 callback
 
#define AGT_CB_SUBSYS_HAS_GET(S)   ((S)->flags & AGT_CB_FL_GET)
 check subsystem has a GET2 callback
 
#define AGT_CB_SUBSYS_HAS_EDIT2(S)   ((S)->flags & AGT_CB_FL_EDIT2)
 check subsystem has an EDIT2 callback
 
#define AGT_CB_SUBSYS_HAS_PSHOOK(S)   ((S)->flags & AGT_CB_FL_PSHOOK)
 Hooks Support flags handling check subsystem has a post-set-hook.
 
#define AGT_CB_SUBSYS_HAS_SHOOK(S)   ((S)->flags & AGT_CB_FL_SHOOK)
 check subsystem has a set-hook
 
#define AGT_CB_SUBSYS_HAS_TXHOOK(S)   ((S)->flags & AGT_CB_FL_TXHOOK)
 check subsystem has a transaction-hook
 
#define AGT_CB_SUBSYS_SET_PSHOOK(S)   (S)->flags |= AGT_CB_FL_PSHOOK
 set subsystem has a post-set-hook
 
#define AGT_CB_SUBSYS_SET_SHOOK(S)   (S)->flags |= AGT_CB_FL_SHOOK
 set subsystem has a set-hook
 
#define AGT_CB_SUBSYS_SET_TXHOOK(S)   (S)->flags |= AGT_CB_FL_TXHOOK
 set subsystem has a transaction-hook
 
#define AGT_CB_HAS_REMOTE_PSHOOK(C)   ((C)->flags & AGT_CB_FL_PSETHOOK)
 Flags to tell the server that the CBSET has remote hook callbacks check subsystem has a remote post-set-hook.
 
#define AGT_CB_HAS_REMOTE_SHOOK(C)   ((C)->flags & AGT_CB_FL_SETHOOK)
 check subsystem has a remote set-hook
 
#define AGT_CB_HAS_REMOTE_TXHOOK(C)   ((C)->flags & AGT_CB_FL_TRANSHOOK)
 check subsystem has a remote transaction-hook
 
#define AGT_CB_SET_REMOTE_PSHOOK(C)   (C)->flags |= AGT_CB_FL_PSETHOOK
 set remote has a post-set-hook
 
#define AGT_CB_SET_REMOTE_SHOOK(C)   (C)->flags |= AGT_CB_FL_SETHOOK
 set remote has a set-hook
 
#define AGT_CB_SET_REMOTE_TXHOOK(C)   (C)->flags |= AGT_CB_FL_TRANSHOOK
 set remote has a transaction-hook
 

Typedefs

typedef status_t(* agt_cb_fn_t) (ses_cb_t *scb, rpc_msg_t *msg, agt_cbtyp_t cbtyp, op_editop_t editop, val_value_t *newval, val_value_t *curval)
 Callback function for server object handler. More...
 
typedef status_t(* agt_cb_hook_t) (ses_cb_t *scb, rpc_msg_t *msg, agt_cfg_transaction_t *txcb, op_editop_t editop, val_value_t *newval, val_value_t *curval)
 Typedef of the agt_cb_hook_t callback. More...
 
typedef uint8(* agt_cb_order_hook_t) (agt_cfg_transaction_t *txcb, op_editop_t editop, val_value_t *newval, val_value_t *curval, status_t *res)
 Typedef of the agt_order_hook_cb callback. More...
 
typedef status_t(* agt_cb_trans_start_t) (agt_cfg_transaction_t *txcb)
 Typedef of the trans_start callback. More...
 
typedef status_t(* agt_cb_sa_trans_start_t) (const xmlChar *transaction_id, boolean isvalidate, boolean isrollback, boolean isrunning)
 Typedef of the sa_trans_start callback. More...
 
typedef void(* agt_cb_sa_trans_complete_t) (const xmlChar *transaction_id_val)
 Typedef of the sa_trans_complete callback. More...
 
typedef void(* agt_cb_trans_complete_t) (agt_cfg_transaction_t *txcb)
 Typedef of the trans_complete callback. More...
 
typedef status_t(* agt_cb_validate_complete_t) (ses_cb_t *scb, rpc_msg_t *msg, val_value_t *candidate, val_value_t *running)
 Typedef of the agt_validate_complete_cb_t callback. More...
 
typedef status_t(* agt_cb_startup_hook_t) (ses_cb_t *scb, rpc_msg_t *msg, cfg_template_t *source_config, cfg_template_t *target_config)
 Typedef of the agt_cb_startup_hook_t callback. More...
 
typedef status_t(* agt_cb_apply_complete_t) (ses_cb_t *scb, rpc_msg_t *msg, val_value_t *candidate, val_value_t *running)
 Typedef of the agt_apply_complete_cb_t callback. More...
 
typedef status_t(* agt_cb_rollback_complete_t) (ses_cb_t *scb, rpc_msg_t *msg, val_value_t *candidate, val_value_t *running)
 Typedef of the agt_rollback_complete_cb_t callback. More...
 
typedef void(* agt_cb_command_complete_t) (ses_cb_t *scb, rpc_msg_t *msg, const xmlChar *command_modname, const xmlChar *command_name)
 Typedef of the agt_command_complete_cb_t callback. More...
 
typedef void(* agt_cb_shutdown_t) (void)
 Typedef of the agt_shutdown_cb_t callback. More...
 
typedef void(* agt_cb_session_hook_t) (ncx_ses_event_t ses_event, const ses_cb_t *scb)
 Typedef of the agt_cb_session_hook_t callback. More...
 
typedef status_t(* agt_cb_sa_hook_t) (ses_cb_t *scb, rpc_msg_t *msg, op_editop_t editop, val_value_t *newval, val_value_t *curval, const xmlChar *transaction_id, boolean isvalidate, boolean isload, boolean isrunning)
 Typedef of the SIL-SA version of agt_cb_hook_t callback. More...
 

Enumerations

Detailed Description

Macros and data structures used to manage YANG instrumentation callbacks and hooks.

Registration is done when the YANG module SIL or SIL-SA code is loaded.

Macro Definition Documentation

#define AGT_CB_FL_PSHOOK   bit3

3 flags for the HOOKS support in agt_cb_subsys_t.flags field

Post Set Hook

#define AGT_CB_FL_SETHOOK_TREE   bit0

4 flags for the agt_cb_fnset_t.flags field

set-hook tree

Typedef Documentation

typedef status_t(* agt_cb_apply_complete_t) (ses_cb_t *scb, rpc_msg_t *msg, val_value_t *candidate, val_value_t *running)

Typedef of the agt_apply_complete_cb_t callback.

The Apply Complete callback is the user/system callback that is invoked after the Validate Phase has been processed during the <commit> operation.

The Validate Complete is object independent and module independent which means you don't have to link them to the specific object as it's done for EDIT or GET callbacks, and you don't have to link them to any specific module

Max Callbacks: No limit (except available heap memory)

Parameters
scbsession control block making the request
msgincoming rpc_msg_t in progress
candidatecandidate val_value_t for the config database to use
runningrunning val_value_t for the config database to use
Returns
status
typedef void(* agt_cb_command_complete_t) (ses_cb_t *scb, rpc_msg_t *msg, const xmlChar *command_modname, const xmlChar *command_name)

Typedef of the agt_command_complete_cb_t callback.

The Command Complete callback is the user/system callback that is invoked after each client command is executed for the NETCONF or RESTCONF protocols.

The Command Complete is typically used for retrieval operations (get, get-config, get-bulk) to release resources used during GET2 callbacks invoked during the operation.

Max Callbacks: No limit (except available heap memory)

Parameters
scbsession control block making the request
msgincoming rpc_msg_t in progress
command_modnameYANG module name of command that is completed
command_nameYANG RPC object name of command that is completed
typedef status_t(* agt_cb_fn_t) (ses_cb_t *scb, rpc_msg_t *msg, agt_cbtyp_t cbtyp, op_editop_t editop, val_value_t *newval, val_value_t *curval)

Callback function for server object handler.

Used to provide a callback sub-mode for a specific named object

Parameters
scbsession control block making the request
msgincoming rpc_msg_t in progress
cbtypreason for the callback
editopthe parent edit-config operation type, which is also used for all other callbacks that operate on objects
newvalcontainer object holding the proposed changes to apply to the current config, depending on the editop value. Will not be NULL.
curvalcurrent container values from the <running> or <candidate> configuration, if any. Could be NULL for create and other operations.
Returns
status:
typedef status_t(* agt_cb_hook_t) (ses_cb_t *scb, rpc_msg_t *msg, agt_cfg_transaction_t *txcb, op_editop_t editop, val_value_t *newval, val_value_t *curval)

Typedef of the agt_cb_hook_t callback.

Callback function for server object handler Used to provide a callback for a specific named object

Set Hook: Similar to the EDIT1 or EDIT2 callbacks, except this callback is only invoked once at the start of the edit for a particular data node. This callback can alter the data in the current edit and also add new edits to the current transaction. This callback will be invoked before a EDIT1 or EDIT2 callback for the same object.

Post Set Hook: Is a postponed Set Hook callback analogous function that is invoked within the transaction when an object is modified but AFTER EDIT callback is done for the same object. This callback will be invoked AFTER a EDIT1 or EDIT2 callback for the same object.

Transaction Hook: Similar to a Set Hook except this callback is invoked just before the data is committed to the running datastore. This callback will be invoked after a EDIT1 or EDIT2 callbacks for the same object.

Parameters
scbsession control block making the request
msgincoming rpc_msg_t in progress
txcbtransaction control block in progress
editopedit operation enumeration for the node being edited
newvalcontainer object holding the proposed changes to apply to the current config, depending on the editop value. Will not be NULL.
curvalcurrent container values from the <running> or <candidate> configuration, if any. Could be NULL for create and other operations.
Returns
status
typedef uint8(* agt_cb_order_hook_t) (agt_cfg_transaction_t *txcb, op_editop_t editop, val_value_t *newval, val_value_t *curval, status_t *res)

Typedef of the agt_order_hook_cb callback.

Callback function for server object handler Used to provide a callback for a specific named object

Set-Order-Hook: Invoked in document order for each edited instance of the specified object. The callback needs to return the desired secondary SIL priority for the specific list instance

This callback is invoked once per edited instance and after any Set Hook is called for the object and instance.

Parameters
txcbtransaction control block in progress
editopedit operation enumeration for the node being edited
newvalcontainer object holding the proposed changes to apply to the current config, depending on the editop value. Will not be NULL.
curvalcurrent container values from the <running> or <candidate> configuration, if any. Could be NULL for create and other operations.
resaddress of return status
Return values
*resstatus of callback; status error will cause the transaction to be terminated and rollback started
Returns
the secondary SIL priority to assign to the object instance
typedef status_t(* agt_cb_rollback_complete_t) (ses_cb_t *scb, rpc_msg_t *msg, val_value_t *candidate, val_value_t *running)

Typedef of the agt_rollback_complete_cb_t callback.

The Rollback Complete callback is the user/system callback that is invoked after and if the Rollback Phase has been processed during the <commit> operation.

The Rollback Complete is object independent and module independent which means you don't have to link them to the specific object as it's done for EDIT or GET callbacks, and you don't have to link them to any specific module.

Max Callbacks: No limit (except available heap memory)

Parameters
scbsession control block making the request
msgincoming rpc_msg_t in progress
candidatecandidate val_value_t for the config database to use
runningrunning val_value_t for the config database to use
Returns
status
typedef status_t(* agt_cb_sa_hook_t) (ses_cb_t *scb, rpc_msg_t *msg, op_editop_t editop, val_value_t *newval, val_value_t *curval, const xmlChar *transaction_id, boolean isvalidate, boolean isload, boolean isrunning)

Typedef of the SIL-SA version of agt_cb_hook_t callback.

Callback function for server object handler Used to provide a callback for a specific named object

Set Hook: Similar to the EDIT1 or EDIT2 callbacks, except this callback is only invoked once at the start of the edit for a particular data node. This callback can alter the data in the current edit and also add new edits to the current transaction. This callback will be invoked before a EDIT1 or EDIT2 callback for the same object.

Post Set Hook: Is a postponed Set Hook callback analogous function that is invoked within the transaction when an object is modified but AFTER EDIT callback is done for the same object. This callback will be invoked AFTER a EDIT1 or EDIT2 callback for the same object.

Transaction Hook: Similar to a Set Hook except this callback is invoked just before the data is committed to the running datastore. This callback will be invoked after a EDIT1 or EDIT2 callbacks for the same object.

Parameters
scbsession control block making the request
msgincoming rpc_msg_t in progress
editopedit operation enumeration for the node being edited
newvalcontainer object holding the proposed changes to apply to the current config, depending on the editop value. Will not be NULL.
curvalcurrent container values from the <running> or <candidate> configuration, if any. Could be NULL for create and other operations.
transaction_idtransaction ID of the transaction control block in progress
isvalidateTRUE if this Transaction is for <validate> operation
isloadTRUE if this Transaction is for a Load operation
isrunningTRUE if this Transaction is for the the running datastore
Returns
status
typedef void(* agt_cb_sa_trans_complete_t) (const xmlChar *transaction_id_val)

Typedef of the sa_trans_complete callback.

The Complete Transaction function is the user/system callback that is invoked at the end of the transaction This is for SIL-SA subsystem only

Max Callbacks: No limit (except available heap memory)

Parameters
transaction_id_valtransaction ID in progress
typedef status_t(* agt_cb_sa_trans_start_t) (const xmlChar *transaction_id, boolean isvalidate, boolean isrollback, boolean isrunning)

Typedef of the sa_trans_start callback.

The Start Transaction function is the user/system callback that is invoked before any changes to the candidate database will be committed. This is for SIL-SA subsystem only

Max Callbacks: No limit (except available heap memory)

Parameters
txcbtransaction ID in progress
isvalidateTRUE if this is Transaction is for Validate
isrollbackTRUE if this is Transaction for Rollback or Load
isrunningTRUE if running datastore is being modified
Returns
status
typedef void(* agt_cb_session_hook_t) (ncx_ses_event_t ses_event, const ses_cb_t *scb)

Typedef of the agt_cb_session_hook_t callback.

The Session Hook callback is invoked when a session starts and ends. Use ses.h macros like SES_MY_USERNAME(scb) to get data like client username. Max Callbacks: No limit (except available heap memory)

Parameters
ses_eventsession event type
scbsession control block for the session event
typedef void(* agt_cb_shutdown_t) (void)

Typedef of the agt_shutdown_cb_t callback.

The Shutdown callback is the user/system callback that is invoked at the start of a normal agt_cleanup A normal shutdown or restart is in progress. This callback is not invoked if the server crashes.

Max Callbacks: No limit (except available heap memory)

typedef status_t(* agt_cb_startup_hook_t) (ses_cb_t *scb, rpc_msg_t *msg, cfg_template_t *source_config, cfg_template_t *target_config)

Typedef of the agt_cb_startup_hook_t callback.

The Startup Hook callback is the user/system callback that is invoked right before the <startup> is getting modified.

The Startup Hook is object independent and module independent which means you don't have to link them to the specific object as it's done for EDIT or GET callbacks, and you don't have to link them to any specific module

Parameters
scbsession control block making the request
msgincoming rpc_msg_t in progress
source_configdatastore which is being copied
target_configdatastore that is being edited
Returns
status
typedef void(* agt_cb_trans_complete_t) (agt_cfg_transaction_t *txcb)

Typedef of the trans_complete callback.

The Transaction Complete function is the user/system callback that is invoked after the transactions has been processed.

Max Callbacks: No limit (except available heap memory) 1 Per SIL

Parameters
txcbtransaction control block in progress
typedef status_t(* agt_cb_trans_start_t) (agt_cfg_transaction_t *txcb)

Typedef of the trans_start callback.

The Start Transaction function is the user/system callback that is invoked before any changes to the candidate database will be committed.

Max Callbacks: No limit (except available heap memory)

Parameters
txcbtransaction control block in progress
Returns
status
typedef status_t(* agt_cb_validate_complete_t) (ses_cb_t *scb, rpc_msg_t *msg, val_value_t *candidate, val_value_t *running)

Typedef of the agt_validate_complete_cb_t callback.

The Validate Complete callback is the user/system callback that is invoked after the Validate Phase has been processed during the <commit> operation.

The Validate Complete is object independent and module independent which means you don't have to link them to the specific object as it's done for EDIT or GET callbacks, and you don't have to link them to any specific module

Max Callbacks: No limit (except available heap memory)

Parameters
scbsession control block making the request
msgincoming rpc_msg_t in progress
candidatecandidate val_value_t for the config database to use
runningrunning val_value_t for the config database to use
Returns
status

Enumeration Type Documentation

different data node callback types for SIL and SIL-SA to register

Enumerator
AGT_CB_CALLTYPE_NONE 

not set

AGT_CB_CALLTYPE_EDIT 

EDIT1 callback.

AGT_CB_CALLTYPE_EDIT2 

EDIT2 callback.

AGT_CB_CALLTYPE_GET 

GET2 callback.