* RESTCONF "depth" query parameter supported

* C API change: Added `depth` parameter to function `clicon_xml2cbuf`, default is -1.
This commit is contained in:
Olof hagsand 2019-08-17 10:54:13 +02:00
parent 10a2dbe8ec
commit ee329ee382
31 changed files with 289 additions and 117 deletions

View file

@ -248,7 +248,7 @@ example_rpc(clicon_handle h, /* Clicon handle */
else while ((x = xml_child_each(xe, x, CX_ELMNT)) != NULL) {
if (xmlns_set(x, NULL, namespace) < 0)
goto done;
if (clicon_xml2cbuf(cbret, x, 0, 0) < 0)
if (clicon_xml2cbuf(cbret, x, 0, 0, -1) < 0)
goto done;
}
cprintf(cbret, "</rpc-reply>");

View file

@ -64,11 +64,12 @@ plugin_exit(clicon_handle h)
/*! Local example netconf rpc callback
*/
int netconf_client_rpc(clicon_handle h,
cxobj *xe,
cbuf *cbret,
void *arg,
void *regarg)
int
netconf_client_rpc(clicon_handle h,
cxobj *xe,
cbuf *cbret,
void *arg,
void *regarg)
{
int retval = -1;
cxobj *x = NULL;
@ -85,7 +86,7 @@ int netconf_client_rpc(clicon_handle h,
else while ((x = xml_child_each(xe, x, CX_ELMNT)) != NULL) {
if (xmlns_set(x, NULL, namespace) < 0)
goto done;
if (clicon_xml2cbuf(cbret, x, 0, 0) < 0)
if (clicon_xml2cbuf(cbret, x, 0, 0, -1) < 0)
goto done;
}
cprintf(cbret, "</rpc-reply>");

View file

@ -287,7 +287,7 @@ restconf_client_rpc(clicon_handle h,
else while ((x = xml_child_each(xe, x, CX_ELMNT)) != NULL) {
if (xmlns_set(x, NULL, namespace) < 0)
goto done;
if (clicon_xml2cbuf(cbret, x, 0, 0) < 0)
if (clicon_xml2cbuf(cbret, x, 0, 0, -1) < 0)
goto done;
}
cprintf(cbret, "</rpc-reply>");