* Fixed issue https://github.com/clicon/clixon/issues/18 RPC response issues reported by Stephen Jones at Netgate
This commit is contained in:
parent
67c0abead7
commit
3ed1c98556
11 changed files with 215 additions and 113 deletions
|
|
@ -121,7 +121,9 @@ notification_timer_setup(clicon_handle h)
|
|||
return event_reg_timeout(t, notification_timer, h, "notification timer");
|
||||
}
|
||||
|
||||
/*! IETF Routing fib-route rpc */
|
||||
/*! IETF Routing fib-route rpc
|
||||
* @see ietf-routing@2014-10-26.yang (fib-route)
|
||||
*/
|
||||
static int
|
||||
fib_route(clicon_handle h, /* Clicon handle */
|
||||
cxobj *xe, /* Request: <rpc><xn></rpc> */
|
||||
|
|
@ -136,19 +138,9 @@ fib_route(clicon_handle h, /* Clicon handle */
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*! Smallest possible RPC declaration for test */
|
||||
static int
|
||||
empty(clicon_handle h, /* Clicon handle */
|
||||
cxobj *xe, /* Request: <rpc><xn></rpc> */
|
||||
cbuf *cbret, /* Reply eg <rpc-reply>... */
|
||||
void *arg, /* client_entry */
|
||||
void *regarg) /* Argument given at register */
|
||||
{
|
||||
cprintf(cbret, "<rpc-reply/>");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! IETF Routing route-count rpc */
|
||||
/*! IETF Routing route-count rpc
|
||||
* @see ietf-routing@2014-10-26.yang (route-count)
|
||||
*/
|
||||
static int
|
||||
route_count(clicon_handle h,
|
||||
cxobj *xe, /* Request: <rpc><xn></rpc> */
|
||||
|
|
@ -156,7 +148,24 @@ route_count(clicon_handle h,
|
|||
void *arg,
|
||||
void *regarg) /* Argument given at register */
|
||||
{
|
||||
cprintf(cbret, "<rpc-reply><ok/></rpc-reply>");
|
||||
cprintf(cbret, "<rpc-reply><number-of-routes>42</number-of-routes></rpc-reply>");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! Smallest possible RPC declaration for test
|
||||
* Yang/XML:
|
||||
* If the RPC operation invocation succeeded and no output parameters
|
||||
* are returned, the <rpc-reply> contains a single <ok/> element defined
|
||||
* in [RFC6241].
|
||||
*/
|
||||
static int
|
||||
empty(clicon_handle h, /* Clicon handle */
|
||||
cxobj *xe, /* Request: <rpc><xn></rpc> */
|
||||
cbuf *cbret, /* Reply eg <rpc-reply>... */
|
||||
void *arg, /* client_entry */
|
||||
void *regarg) /* Argument given at register */
|
||||
{
|
||||
cprintf(cbret, "<rpc-reply><ok/></rpc-reply>");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,6 @@ nacm_statedata(clicon_handle h,
|
|||
return retval;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
plugin_start(clicon_handle h,
|
||||
int argc,
|
||||
|
|
@ -103,8 +102,8 @@ static clixon_plugin_api api = {
|
|||
clixon_plugin_init, /* init */
|
||||
plugin_start, /* start */
|
||||
NULL, /* exit */
|
||||
.ca_reset=NULL, /* reset */ /*--- Backend plugin only ---*/
|
||||
.ca_statedata=nacm_statedata, /* statedata */
|
||||
.ca_reset=NULL, /* reset */
|
||||
.ca_statedata=nacm_statedata, /* statedata */
|
||||
};
|
||||
|
||||
/*! Backend plugin initialization
|
||||
|
|
@ -115,6 +114,6 @@ static clixon_plugin_api api = {
|
|||
clixon_plugin_api *
|
||||
clixon_plugin_init(clicon_handle h)
|
||||
{
|
||||
clicon_debug(1, "%s backend secondary", __FUNCTION__);
|
||||
clicon_debug(1, "%s backend nacm", __FUNCTION__);
|
||||
return &api;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue