89#define AGT_RPC_NUM_CALLBACK_PHASES 3
109typedef enum agt_rpc_phase_t_ {
153typedef struct agt_rpc_cbset_t_ {
186typedef struct agt_rpc_subsys_t_ {
242 const xmlChar *method_name,
257 const xmlChar *method_name);
270 const xmlChar *method_name);
282 const xmlChar *method_name);
336 boolean do_config_change,
628 const xmlChar *modname,
629 const xmlChar *revision,
630 const xmlChar *rpcname);
644 const xmlChar *modname,
645 const xmlChar *revision,
646 const xmlChar *rpcname);
702 const xmlChar *modname,
703 const xmlChar *rpcname,
706 dlq_hdr_t *return_dataQ);
729 dlq_hdr_t *return_dataQ);
792 const xmlChar *subsys_id);
814 const xmlChar *rpc_module,
815 const xmlChar *rpc_name,
817 const xmlChar *out_filespec);
@ brief NCX configuration database manager
status_t agt_rpc_parse_rpc_input(ses_cb_t *scb, rpc_msg_t *msg, obj_template_t *rpcobj, xml_node_t *method)
RPC received, parse parameters against rpcio for 'input'.
Definition: agt_rpc.c:4194
status_t agt_rpc_register_subsys_callback(const xmlChar *subsys_id, const xmlChar *modname, const xmlChar *revision, const xmlChar *rpcname)
Register an object specific RPC callback function.
Definition: agt_rpc.c:4584
status_t agt_rpc_replay_config(void)
Dispatch an internal <replay-config> request used for OP_EDITOP_LOAD to load the running from startup...
Definition: agt_rpc.c:3704
boolean agt_rpc_callback_set(obj_template_t *obj)
Check if an RPC callback is registered for this object for SIL-SA usage.
Definition: agt_rpc.c:4412
void agt_rpc_support_method(const xmlChar *module, const xmlChar *method_name)
mark an RPC method or action as supported within the server
Definition: agt_rpc.c:2945
void agt_rpc_unregister_subsys_callback(const xmlChar *subsys_id, const xmlChar *modname, const xmlChar *revision, const xmlChar *rpcname)
Unregister an object specific RPC callback function.
Definition: agt_rpc.c:4746
status_t agt_rpc_handle_subsys_request(void *sil_sa_cb, ses_cb_t *scb, const xmlChar *modname, const xmlChar *rpcname, val_value_t *rpc_input_val, val_value_t *mpid_val, dlq_hdr_t *return_dataQ)
Handles incoming <rpc-request> server request messages from a subsystem.
Definition: agt_rpc.c:4885
rpc_msg_t * agt_rpc_new_dummy_msg(void)
Create a dummy rpc_msg_t.
Definition: agt_rpc.c:4379
void agt_rpc_unload_module(ncx_module_t *mod)
Check all the rpc objects from this module and clean any callbacks because the module is being unload...
Definition: agt_rpc.c:5663
status_t agt_rpc_subrpc_dispatch(ses_cb_t *scb, rpc_msg_t *msg, const xmlChar *rpc_module, const xmlChar *rpc_name, val_value_t *rpc_method, const xmlChar *out_filespec)
Dispatch an incoming <subrpc-request> request.
Definition: agt_rpc.c:5436
boolean agt_rpc_callback_is_regdone(obj_template_t *obj)
Set the RPC as register done.
Definition: agt_rpc.c:4473
status_t agt_rpc_check_rpc_invoke(ses_cb_t *scb, rpc_msg_t *msg, obj_template_t *rpcobj)
Some RPC node parsed, check if it can be invoked or not.
Definition: agt_rpc.c:4141
status_t agt_rpc_post_psd_state(ses_cb_t *scb, rpc_msg_t *msg, status_t psdres)
Fixup parmset after parse phase.
Definition: agt_rpc.c:4272
status_t agt_rpc_handle_subsys_action(void *sil_sa_cb, ses_cb_t *scb, const xmlChar *path, val_value_t *action_input_val, val_value_t *mpid_val, dlq_hdr_t *return_dataQ)
Handles incoming <action-request> server request messages.
Definition: agt_rpc.c:5061
agt_rpc_subsys_t * agt_rpc_new_subsys(const xmlChar *subsys_id)
Malloc and Initialize a subsys record.
Definition: agt_rpc.c:5374
void agt_rpc_cleanup(void)
Cleanup the agt_rpc module.
Definition: agt_rpc.c:2839
void agt_rpc_send_error_reply(ses_cb_t *scb, status_t retres)
Operation failed or was never attempted.
Definition: agt_rpc.c:3949
agt_rpc_subsys_t * agt_rpc_find_subsys(dlq_hdr_t *subsysQ, const xmlChar *subsys_id)
Find a subsystem control block.
Definition: agt_rpc.c:5396
status_t agt_rpc_register_method(const xmlChar *module, const xmlChar *method_name, agt_rpc_phase_t phase, agt_rpc_method_t method)
add callback for 1 phase of RPC processing
Definition: agt_rpc.c:2866
#define AGT_RPC_NUM_CALLBACK_PHASES
this constant is for the number of callback slots allocated in a 'cbset', and only includes the RPC p...
Definition: agt_rpc.h:89
status_t agt_rpc_invoke_action(ses_cb_t *scb, rpc_msg_t *msg, xml_node_t *method_node, val_value_t *action_val)
Invoke an Action – need to call following functions first:
Definition: agt_rpc.c:4346
status_t agt_rpc_fill_rpc_error(const rpc_err_rec_t *err, val_value_t *rpcerror)
Fill one <rpc-error> like element using the specified namespace and name, which may be different than...
Definition: agt_rpc.c:3819
status_t(* agt_rpc_method_t)(ses_cb_t *scb, rpc_msg_t *msg, xml_node_t *methnode)
Template for RPC server callbacks.
Definition: agt_rpc.h:147
status_t agt_rpc_send_rpc_error(ses_cb_t *scb, xml_msg_hdr_t *msg, const rpc_err_rec_t *err, int32 indent, boolean isfirst, boolean islast)
Send one <rpc-error> element on the specified session.
Definition: agt_rpc.c:4063
status_t agt_rpc_invoke_rpc(ses_cb_t *scb, rpc_msg_t *msg, xml_node_t *method_node)
Invoke an RPC – need to call following functions first:
Definition: agt_rpc.c:4304
boolean agt_rpc_dispatch(ses_cb_t *scb, xml_node_t *top)
Dispatch an incoming <rpc> request.
Definition: agt_rpc.c:3115
void agt_rpc_add_return_vals(dlq_hdr_t *return_valQ, rpc_msg_t *msg)
Add a Q of return values to the msg.
Definition: agt_rpc.c:4835
void agt_rpc_reorder_dataQ(rpc_msg_t *msg)
Reorder the dataQ.
Definition: agt_rpc.c:5288
void agt_rpc_unregister_method(const xmlChar *module, const xmlChar *method_name)
remove the callback functions for all phases of RPC or Action processing for the specified RPC method...
Definition: agt_rpc.c:3063
ncx_backptr_t * agt_rpc_get_next_backptr(ncx_backptr_t *curptr)
Get the next backptr to the registered and supported RPC methods on the server.
Definition: agt_rpc.c:4121
status_t agt_rpc_load_config_file_val(const xmlChar *filespec, ses_id_t use_sid, val_value_t **configval, dlq_hdr_t *errorQ)
Dispatch an internal <load-config> request used for COPY-CONFIG for URL to Candidate.
Definition: agt_rpc.c:5720
void agt_rpc_free_subsys(agt_rpc_subsys_t *cb)
Clean and free a subsys record.
Definition: agt_rpc.c:5356
status_t agt_rpc_init(void)
Initialize the agt_rpc module.
Definition: agt_rpc.c:2804
void agt_rpc_callback_regdone(obj_template_t *obj)
Set the RPC as register done.
Definition: agt_rpc.c:4444
status_t agt_rpc_process_rpc_request(ses_cb_t *scb, rpc_msg_t *msg, val_value_t *action_val, xml_node_t *method, obj_template_t *rpcobj)
Setup Action Parent nodes for when/must processing.
Definition: agt_rpc.c:5858
void agt_rpc_unsupport_method(const xmlChar *module, const xmlChar *method_name)
mark an RPC method or action as unsupported within the server
Definition: agt_rpc.c:2989
status_t(* agt_rpc_data_cb_t)(ses_cb_t *scb, rpc_msg_t *msg, uint32 indent)
Callback template for RPCs that use an inline callback function instead of generating a malloced val_...
Definition: agt_rpc.h:177
void agt_rpc_finish_reply(uint32 sid, void *msg)
Finish the rpc-reply for a remote operation.
Definition: agt_rpc.c:5249
status_t agt_rpc_load_config_file(const xmlChar *filespec, cfg_template_t *cfg, boolean isload, ses_id_t use_sid, dlq_hdr_t *errQ, boolean do_config_change, const rpc_msg_t *reqmsg)
Dispatch an internal <load-config> request.
Definition: agt_rpc.c:3589
val_value_t * agt_rpc_get_config_file(const xmlChar *filespec, cfg_template_t *targetcfg, ses_id_t use_sid, dlq_hdr_t *errorQ, status_t *res)
Dispatch an internal <load-config> request except skip the INVOKE phase and just remove the 'config' ...
Definition: agt_rpc.c:3657
ncx_backptr_t * agt_rpc_get_first_backptr(void)
Get the first backptr to the registered and supported RPC methods on the server.
Definition: agt_rpc.c:4104
void agt_rpc_add_return_val(val_value_t *return_val, rpc_msg_t *msg)
Add a return value to the msg.
Definition: agt_rpc.c:4813
agt_rpc_phase_t
There are 3 different callbacks possible in the server processing chain.
Definition: agt_rpc.h:109
void agt_rpc_clear_return_data(rpc_msg_t *msg)
Clear the return data Q.
Definition: agt_rpc.c:4856
@ AGT_RPC_PH_INVOKE
(3) cb to invoke the requested method
Definition: agt_rpc.h:114
@ AGT_RPC_PH_VALIDATE
(2) cb after the input is parsed
Definition: agt_rpc.h:111
@ AGT_RPC_PH_REPLY
(4) NO CB FOR THIS STATE
Definition: agt_rpc.h:123
@ AGT_RPC_PH_PARSE
(1) NO CB FOR THIS STATE
Definition: agt_rpc.h:120
@ AGT_RPC_PH_POST_REPLY
(5) cb after the reply is generated
Definition: agt_rpc.h:117
status_t
global error return code
Definition: status_enum.h:210
uint32 ses_id_t
Session ID.
Definition: ses.h:335
NETCONF protocol remote procedure call common definitions.
NETCONF protocol standard error definitions.
NETCONF Session Common definitions module.
global error status code enumerations
the agt_rpc module stores a set of callbacks for each RPC
Definition: agt_rpc.h:153
boolean regdone
registration done flag
Definition: agt_rpc.h:158
dlq_hdr_t subsysQ
only used if WITH_YCONTROL set
Definition: agt_rpc.h:161
header for 1 subsystem that has a SIL-SA callback function registered for the RPC method in the agt_r...
Definition: agt_rpc.h:186
dlq_hdr_t qhdr
queue header
Definition: agt_rpc.h:188
status_t res
subsystem status
Definition: agt_rpc.h:194
const xmlChar * subsys_id
backptr to agt_sil_state->subsys_id
Definition: agt_rpc.h:191
struct representing 1 configuration database
Definition: cfg.h:229
used with various structs to cache back-ptrs the 'node' pointer may or may not be malloced!...
Definition: ncxtypes.h:1530
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1138
One YANG data-def-stmt.
Definition: obj.h:1229
One RPC error record built by the server before an <rpc-error> element is generated.
Definition: rpc_err.h:484
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:181
Session Control Block.
Definition: ses.h:573
one value to match one type
Definition: val.h:912
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:404
gather node data into a simple struct.
Definition: xml_util.h:207