* Added message-id attributes in error and hello replies

* See [namespace prefix nc is not supported in full #154](https://github.com/clicon/clixon/issues/154)
* Removed mandatory loading of clixon_restconf.yang
This commit is contained in:
Olof hagsand 2020-12-01 12:13:46 +01:00
parent 26a4b14060
commit c32950c8a9
20 changed files with 119 additions and 56 deletions

View file

@ -297,14 +297,21 @@ example_rpc(clicon_handle h, /* Clicon handle */
{
int retval = -1;
cxobj *x = NULL;
cxobj *xp;
char *namespace;
char *msgid;
/* get namespace from rpc name, return back in each output parameter */
if ((namespace = xml_find_type_value(xe, NULL, "xmlns", CX_ATTR)) == NULL){
clicon_err(OE_XML, ENOENT, "No namespace given in rpc %s", xml_name(xe));
goto done;
}
cprintf(cbret, "<rpc-reply xmlns=\"%s\">", NETCONF_BASE_NAMESPACE);
cprintf(cbret, "<rpc-reply xmlns=\"%s\"", NETCONF_BASE_NAMESPACE);
if ((xp = xml_parent(xe)) != NULL &&
(msgid = xml_find_value(xp, "message-id"))){
cprintf(cbret, " message-id=\"%s\">", msgid);
}
cprintf(cbret, ">");
if (!xml_child_nr_type(xe, CX_ELMNT))
cprintf(cbret, "<ok/>");
else while ((x = xml_child_each(xe, x, CX_ELMNT)) != NULL) {