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. |
| curval | 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 |
| isvalidate | TRUE if this Transaction is for <validate> operation |
| isload | TRUE if this Transaction is for a Load operation |
| isrunning | TRUE if this Transaction is for the the running datastore |
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 |
extern void
agt_cb_sa_post_sethook_unregister (const xmlChar *defpath);NOTE:
EXAMPLE
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?