Plugin RPC callback interface have been unified between backend, netconf and restconf.
* Backend RPC register callback function (Netconf RPC or restconf operation POST) has been changed from: `backend_rpc_cb_register()` to `rpc_callback_register()`
* Backend RPC callback signature has been changed from: `int cb(clicon_handle h, cxobj *xe, struct client_entry *ce, cbuf *cbret, void *arg)` has been changed to : `int cb(clicon_handle h, cxobj *xe, struct client_entry *ce, cbuf *cbret, void *arg)`
* Frontend netconf and restconf plugins can register callbacks as well with same API as backends.
This commit is contained in:
parent
7a4371e76f
commit
d541c49c6f
20 changed files with 323 additions and 229 deletions
|
|
@ -44,6 +44,15 @@
|
|||
/* The dynamicically loadable plugin object handle */
|
||||
typedef void *plghndl_t;
|
||||
|
||||
/* Registered RPC callback function */
|
||||
typedef int (*clicon_rpc_cb)(
|
||||
clicon_handle h, /* Clicon handle */
|
||||
cxobj *xn, /* Request: <rpc><xn></rpc> */
|
||||
cbuf *cbret, /* Return xml tree, eg <rpc-reply>..., <rpc-error.. */
|
||||
void *arg, /* Domain specific arg, ec client-entry */
|
||||
void *regarg /* User argument given at rpc_callback_register() */
|
||||
);
|
||||
|
||||
/*
|
||||
* Prototypes
|
||||
*/
|
||||
|
|
@ -161,4 +170,10 @@ int clixon_plugin_exit(clicon_handle h);
|
|||
|
||||
int clixon_plugin_auth(clicon_handle h, void *arg);
|
||||
|
||||
/* rpc callback API */
|
||||
int rpc_callback_register(clicon_handle h, clicon_rpc_cb cb, void *arg, char *tag);
|
||||
int rpc_callback_delete_all(void);
|
||||
|
||||
int rpc_callback_call(clicon_handle h, cxobj *xe, cbuf *cbret, void *arg);
|
||||
|
||||
#endif /* _CLIXON_PLUGIN_H_ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue