AVAILABLE SINCE 20.10-0 RELEASE
Post Set Hook can be invoked during the Load; However, it is not allowed to add new edits. So, callbacks are treated as Transaction Hook style callbacks and can perform only validation tasks and cannot edit datastore. Any sil_sa_add_edit() API during Load will be ignored, it is not an error just skip the call and go back with NO_ERR status.
The following function template definition is used for Post Set Hook callback functions:
/* Typedef of the agt_cb_sa_hook_t callback */ 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);
|scb||session control block making the request|
|msg||incoming rpc_msg_t in progress|
|editop||edit operation enumeration for the node being edited|
|newval||value holding the proposed changes to apply to the current config, depending on the editop value.|
current values from the <running> or <candidate> configuration, if any. Could be NULL for create and other operations.
|transaction_id||transaction ID of the transaction control block in progress|
TRUE if this Transaction is for <validate> operation
TRUE if this Transaction is for a Load operation
TRUE if this Transaction is for the the running datastore
Post Set Hook callback function is hooked into the server with the agt_cb_sa_post_sethook_register function, described below. The registration is done during the Initialization Phase 1before the startup configuration is loaded into the running configuration database and before running configurations are loaded.
extern status_t agt_cb_sa_post_sethook_register (const xmlChar *defpath, agt_cb_sa_hook_t cbfn)
|defpath||Absolute path expression string indicating which node the callback function is for.|
|cbfn||address of SIL-SA callback function to use|
The following example code illustrates how Post Set Hook callbacks can be cleaned up. The callbacks cleanup is getting done during Cleanup Phase.
extern void agt_cb_sa_post_sethook_unregister (const xmlChar *defpath);
For examples, refer to Set Hook callback article How do I use Set Hook callbacks? and How do I use SIL-SA version of the Set Hook callback?