yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
agt_cb.h File Reference

NETCONF Server Data Model callback handler. More...

#include "agt.h"
#include "agt_editcb.h"
#include "getcb.h"
#include "op.h"
#include "rpc.h"
#include "ses.h"
#include "status_enum.h"
#include "val.h"
#include "xpath.h"
#include "agt_cfg.h"
#include "agt_hook_util.h"
Include dependency graph for agt_cb.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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_extra_flags_t
 Structure to hold extra flags for callback registration. 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_FL_EDIT3   bit7
 EDIT3 callbacks for this subsystem.
 
#define AGT_CB_FL_SKIP_VALIDATE   bit8
 skip validate phase
 
#define AGT_CB_FL_SKIP_APPLY   bit9
 skip apply phase
 
#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_EDIT3(S)   ((S)->flags & AGT_CB_FL_EDIT3)
 check subsystem has an EDIT3 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
 
#define AGT_CB_HAS_SKIP_VALIDATE(C)   ((C)->flags & AGT_CB_FL_SKIP_VALIDATE)
 Flags to check if the phase callback is skipped in the CBSET. More...
 
#define AGT_CB_SET_SKIP_VALIDATE(C)   (C)->flags |= AGT_CB_FL_SKIP_VALIDATE
 set the phase callback to be skipped
 

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)
 EDIT1 and EDIT2 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_trans_complete_t) (agt_cfg_transaction_t *txcb)
 Typedef of the trans_complete callback. More...
 
typedef void(* agt_cb_sa_trans_complete_t) (const xmlChar *transaction_id_val)
 Typedef of the sa_trans_complete 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_validate_complete_t) (ses_cb_t *scb, rpc_msg_t *msg, val_value_t *candidate, val_value_t *running)
 Typedef of the agt_cb_validate_complete_t callback. More...
 
typedef status_t(* agt_cb_sa_validate_complete_t) (const xmlChar *transaction_id)
 Typedef of the agt_cb_sa_validate_complete_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_cb_apply_complete_t callback. More...
 
typedef status_t(* agt_cb_sa_apply_complete_t) (const xmlChar *transaction_id)
 Typedef of the agt_cb_sa_apply_complete_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_cb_rollback_complete_t callback. More...
 
typedef status_t(* agt_cb_sa_rollback_complete_t) (const xmlChar *transaction_id)
 Typedef of the agt_cb_sa_rollback_complete_t callback. More...
 
typedef status_t(* agt_cb_sa_commit_complete_t) (const xmlChar *transaction_id, agt_commit_type_t commit_type)
 Typedef of the agt_cb_sa_commit_complete_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_cb_shutdown_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...
 
typedef status_t(* agt_cb_edit_phase_complete_t) (agt_cbtyp_t edit_phase, ses_cb_t *scb, rpc_msg_t *msg, val_value_t *source, val_value_t *target)
 Typedef of the agt_cb_edit_phase_complete_t callback. More...
 
typedef status_t(* agt_cb_sa_edit_phase_complete_t) (agt_cbtyp_t edit_phase, const xmlChar *transaction_id)
 Typedef of the agt_cb_sa_edit_phase_complete_t callback. More...
 

Enumerations

enum  agt_cb_calltype_t {
  AGT_CB_CALLTYPE_NONE ,
  AGT_CB_CALLTYPE_EDIT ,
  AGT_CB_CALLTYPE_EDIT2 ,
  AGT_CB_CALLTYPE_EDIT3 ,
  AGT_CB_CALLTYPE_GET
}
 different data node callback types for SIL and SIL-SA to register More...
 
enum  agt_edit_cbtype_t {
  AGT_EDIT_CBTYPE_NONE = 0 ,
  AGT_EDIT_CBTYPE_EDIT ,
  AGT_EDIT_CBTYPE_EDIT2 ,
  AGT_EDIT_CBTYPE_EDIT3
}
 Enumeration for EDIT callback types for SIL and SIL-SA to register. More...
 

Functions

status_t agt_cb_init (void)
 Init the server callback module. More...
 
void agt_cb_cleanup (void)
 Cleanup the server callback module. More...
 
status_t agt_cb_register_callback (const xmlChar *modname, const xmlChar *defpath, const xmlChar *version, agt_cb_fn_t cbfn)
 Register an object specific edit callback function use the same fn for all callback phases all phases will be invoked. More...
 
status_t agt_cb_register_edit2_callback (const xmlChar *modname, const xmlChar *defpath, const xmlChar *version, agt_cb_fn_t cbfn)
 Register an object specific edit2 callback function. More...
 
status_t agt_cb_register_edit3_callback (const xmlChar *modname, const xmlChar *defpath, const xmlChar *version, agt_edit3_fn_t edit3_cbfn)
 Register an object specific edit3 callback function. More...
 
status_t agt_cb_register_edit_callback_extra (const xmlChar *modname, const xmlChar *defpath, const xmlChar *version, void *cbfn, const agt_cb_extra_flags_t *extra_flags)
 Register an edit callback function with extra flags. More...
 
status_t agt_cb_register_xpath_callback (const xmlChar *modname, const xmlChar *defpath, const xmlChar *version, xpath_bool_eval_fn_t cbfn)
 Register an object specific XPath callback function. More...
 
void agt_cb_unregister_callbacks (const xmlChar *modname, const xmlChar *defpath)
 Unregister all EDIT callback functions for a specific object. More...
 
status_t agt_cb_register_get_callback (const xmlChar *modname, const xmlChar *defpath, const xmlChar *version, getcb_fn2_t get_cbfn)
 Register an object specific GET callback function. More...
 
status_t agt_cb_hook_register (const xmlChar *defpath, agt_hook_fmt_t format, agt_hook_type_t type, agt_cb_hook_t cbfn)
 Register an object specific Hook callback function. More...
 
void agt_cb_hook_unregister (const xmlChar *defpath)
 Unregister a Hook callback. More...
 
status_t agt_cb_order_hook_register (const xmlChar *defpath, agt_cb_order_hook_t cbfn)
 Register an object specific Set-Order-Hook callback function. More...
 
void agt_cb_order_hook_unregister (const xmlChar *defpath)
 Unregister a Set-Order-Hook callback. More...
 
status_t agt_cb_trans_start_register (agt_cb_trans_start_t cbfn)
 Register a Transaction Start callback. More...
 
status_t agt_cb_trans_complete_register (agt_cb_trans_complete_t cbfn)
 Register a Transaction Complete callback. More...
 
void agt_cb_trans_start_unregister (agt_cb_trans_start_t cbfn)
 Unregister a Transaction Start callback. More...
 
void agt_cb_trans_complete_unregister (agt_cb_trans_complete_t cbfn)
 Unregister a Transaction Complete callback. More...
 
status_t agt_cb_run_trans_start (ses_cb_t *scb, agt_cfg_transaction_t *txcb, boolean isvalidate, boolean isrollback, boolean isrunning, boolean no_silsa_cb)
 Run Transaction start callbacks. More...
 
void agt_cb_run_trans_complete (agt_cfg_transaction_t *txcb)
 Run Transaction Complete callbacks. More...
 
status_t agt_cb_sa_trans_start_register (agt_cb_sa_trans_start_t cbfn)
 Register a Transaction Start callback. More...
 
status_t agt_cb_sa_trans_complete_register (agt_cb_sa_trans_complete_t cbfn)
 Register a Transaction Complete callback. More...
 
void agt_cb_sa_trans_start_unregister (agt_cb_sa_trans_start_t cbfn)
 Uregister a Transaction Start callback. More...
 
void agt_cb_sa_trans_complete_unregister (agt_cb_sa_trans_complete_t cbfn)
 Uregister a Transaction Complete callback. More...
 
status_t agt_cb_invoke_trans_start_cb (const xmlChar *transaction_id, boolean isvalidate, boolean isrollback, boolean isrunning)
 Invoke Transaction start callbacks. More...
 
void agt_cb_invoke_trans_complete (const xmlChar *transaction_id)
 Invoke Transaction Complete callbacks. More...
 
void agt_cb_sa_run_trans_complete (const xmlChar *transaction_id)
 This function simply calls agt_sil_transaction_complete_cb, which makes a <server-event> message and sends it to the subsystem. More...
 
status_t agt_cb_register_subsys_callback (const xmlChar *modname, const xmlChar *defpath, const xmlChar *version, const xmlChar *subsys_id, agt_cb_calltype_t calltype)
 Register an object specific callback function. More...
 
void agt_cb_unregister_subsys_callback (const xmlChar *subsys_id, const xmlChar *modname, const xmlChar *defpath, const xmlChar *revision)
 Unregister remote subsystem callback for a specific object. More...
 
status_t agt_cb_make_register_msg (obj_template_t *request_obj, val_value_t *request_val, obj_template_t *register_obj, obj_template_t *module_obj, obj_template_t *revision_obj, obj_template_t *path_obj, obj_template_t *get_path_obj, obj_template_t *rpc_name_obj, obj_template_t *action_path_obj, obj_template_t *post_sethook_path_obj, obj_template_t *sethook_list, obj_template_t *txhook_list, obj_template_t *edit2_path_obj, obj_template_t *edit3_path_obj, boolean *any_rw_objs)
 Make a subsystem register message. More...
 
boolean agt_cb_obj_has_edit_callback (obj_template_t *obj)
 Check if the specified object has a local edit callback. More...
 
boolean agt_cb_obj_has_get_callback (obj_template_t *obj)
 Check if the specified object has a local get2 callback. More...
 
status_t agt_cb_skip_leafref_validation (const xmlChar *defpath)
 Set a previously registered callback as a node that the server should skip leafref validation in order to save processing time. More...
 
status_t agt_cb_set_sil_priority (const xmlChar *defpath, uint8 sil_priority)
 Set the desired SIL priority with a callback instead of using the YANG extension for this purpose. More...
 
status_t agt_cb_validate_complete_register (agt_cb_validate_complete_t cbfn)
 Register a Validate Complete callback. More...
 
status_t agt_cb_startup_hook_register (agt_cb_startup_hook_t cbfn)
 Register a Startup Hook callback. More...
 
void agt_cb_startup_hook_unregister (agt_cb_startup_hook_t cbfn)
 Unregister a Startup Hook callback. More...
 
void agt_cb_validate_complete_unregister (agt_cb_validate_complete_t cbfn)
 Unregister a Validate Complete callback. More...
 
status_t agt_cb_apply_complete_register (agt_cb_apply_complete_t cbfn)
 Register a Apply Complete callback. More...
 
void agt_cb_apply_complete_unregister (agt_cb_apply_complete_t cbfn)
 Unregister a Apply Complete callback. More...
 
status_t agt_cb_rollback_complete_register (agt_cb_rollback_complete_t cbfn)
 Register a Rollback Complete callback. More...
 
void agt_cb_rollback_complete_unregister (agt_cb_rollback_complete_t cbfn)
 Unregister a Rollback Complete callback. More...
 
status_t agt_cb_run_validate_complete (ses_cb_t *scb, rpc_msg_t *msg, val_value_t *candidate, val_value_t *running, boolean epc_only)
 Run Validate Complete callbacks. More...
 
status_t agt_cb_run_startup_hook (ses_cb_t *scb, rpc_msg_t *msg, cfg_template_t *source_config, cfg_template_t *target_config)
 Run startup hook callbacks. More...
 
status_t agt_cb_run_apply_complete (ses_cb_t *scb, rpc_msg_t *msg, val_value_t *candidate, val_value_t *running, boolean epc_only)
 Run Apply Complete callbacks. More...
 
status_t agt_cb_run_rollback_complete (ses_cb_t *scb, rpc_msg_t *msg, val_value_t *candidate, val_value_t *running, boolean epc_only)
 Run Rollback Complete callbacks. More...
 
status_t agt_cb_command_complete_register (agt_cb_command_complete_t cbfn)
 Register a Command Complete callback. More...
 
void agt_cb_run_command_complete (ses_cb_t *scb, rpc_msg_t *msg, const xmlChar *command_modname, const xmlChar *command_name)
 Run Command Complete callbacks. More...
 
void agt_cb_command_complete_unregister (agt_cb_command_complete_t cbfn)
 Unregister a Command Complete callback. More...
 
status_t agt_cb_shutdown_register (agt_cb_shutdown_t cbfn)
 Register a Shutdown callback. More...
 
void agt_cb_shutdown_unregister (agt_cb_shutdown_t cbfn)
 Unregister a Shutdown callback. More...
 
void agt_cb_run_shutdown (void)
 Run Shutdown callbacks. More...
 
status_t agt_cb_post_sethook_register (const xmlChar *defpath, agt_cb_hook_t cbfn)
 Register an object specific Post Set Hook callback function. More...
 
void agt_cb_post_sethook_unregister (const xmlChar *defpath)
 Unregister a Post Set Hook callback. More...
 
status_t agt_cb_session_hook_register (agt_cb_session_hook_t cbfn)
 Register a Session Hook callback. More...
 
void agt_cb_session_hook_unregister (agt_cb_session_hook_t cbfn)
 Unregister a Session Hook callback. More...
 
void agt_cb_run_session_hook (ncx_ses_event_t ses_event, const ses_cb_t *scb)
 Run Session Hook callbacks. More...
 
status_t agt_cb_def_hook_register (const xmlChar *defpath, ncx_def_hook_cbfn_t cbfn)
 Register an object specific Dynamic Default callback function to enable custom default value setup for a specified node. More...
 
void agt_cb_def_hook_unregister (const xmlChar *defpath)
 Unregister Dynamic Default callback functions for a specific object. More...
 
status_t agt_cb_sa_hook_register (const xmlChar *defpath, agt_hook_fmt_t format, agt_hook_type_t type, agt_cb_sa_hook_t cbfn)
 Register an object specific Hook callback function. More...
 
void agt_cb_sa_hook_unregister (const xmlChar *defpath)
 Unregister a SIL-SA Hook SIL-SA callback. More...
 
status_t agt_cb_sa_post_sethook_register (const xmlChar *defpath, agt_cb_sa_hook_t cbfn)
 Register an object specific SIL-SA Post Set Hook callback function. More...
 
void agt_cb_sa_post_sethook_unregister (const xmlChar *defpath)
 Unregister a SIL-SA Post Set Hook callback. More...
 
void agt_cb_unload_module (const xmlChar *modname)
 Remove the modhdr for the specified module since it is being unloaded from the server or subsystem. More...
 
status_t agt_cb_sa_validate_complete_register (agt_cb_sa_validate_complete_t cbfn)
 Register a SIL-SA Validate Complete callback. More...
 
void agt_cb_sa_validate_complete_unregister (agt_cb_sa_validate_complete_t cbfn)
 Unregister a SIL-SA Validate Complete callback. More...
 
status_t agt_cb_sa_apply_complete_register (agt_cb_sa_apply_complete_t cbfn)
 Register a SIL-SA Apply Complete callback. More...
 
void agt_cb_sa_apply_complete_unregister (agt_cb_sa_apply_complete_t cbfn)
 Unregister a SIL-SA Apply Complete callback. More...
 
status_t agt_cb_sa_commit_complete_register (agt_cb_sa_commit_complete_t cbfn)
 Register a SIL-SA Commit Complete callback. More...
 
void agt_cb_sa_commit_complete_unregister (agt_cb_sa_commit_complete_t cbfn)
 Unregister a SIL-SA Commit Complete callback. More...
 
status_t agt_cb_sa_rollback_complete_register (agt_cb_sa_rollback_complete_t cbfn)
 Register a SIL-SA Rollback Complete callback. More...
 
void agt_cb_sa_rollback_complete_unregister (agt_cb_sa_rollback_complete_t cbfn)
 Unregister a SIL-SA Rollback Complete callback. More...
 
status_t agt_cb_sa_run_commit_completeness_cb (const xmlChar *transaction_id, agt_cbtyp_t cbtyp, agt_commit_type_t commit_type)
 Run SIL-SA Commit Completeness callbacks. More...
 
status_t agt_cb_edit_phase_complete_register (agt_cb_edit_phase_complete_t cbfn)
 Register an Edit Phase Complete callback. More...
 
void agt_cb_edit_phase_complete_unregister (agt_cb_edit_phase_complete_t cbfn)
 Unregister an Edit Phase Complete callback. More...
 
status_t agt_cb_sa_edit_phase_complete_register (agt_cb_sa_edit_phase_complete_t cbfn)
 Register a SIL-SA Edit Phase Complete callback. More...
 
void agt_cb_sa_edit_phase_complete_unregister (agt_cb_sa_edit_phase_complete_t cbfn)
 Unregister a SIL-SA Edit Phase Complete callback. More...
 
boolean agt_cb_any_edit_phase_complete (void)
 Return true if any edit phase complete callbacks registered. More...
 
status_t agt_cb_run_epc_commit_complete (ses_cb_t *scb, rpc_msg_t *msg, val_value_t *source, val_value_t *target)
 agt_cb_run_epc_commit_complete More...
 
boolean agt_cb_is_skip_callback (const obj_template_t *obj, agt_cbtyp_t cbtyp)
 Determine whether the edit phase callback for the given object and callback type should be skipped based on the registered flags. More...
 

Detailed Description

NETCONF Server Data Model callback handler.