Cleanup master for 4.9.0.PRE

This commit is contained in:
Olof hagsand 2020-10-19 20:06:20 +02:00
parent 6fdc42a42b
commit 1614bcd19c
10 changed files with 51 additions and 43 deletions

View file

@ -330,11 +330,25 @@ xml_yang_validate_rpc(clicon_handle h,
int retval = -1;
yang_stmt *yn=NULL; /* rpc name */
cxobj *xn; /* rpc name */
char *rpcprefix;
char *namespace = NULL;
if (strcmp(xml_name(xrpc), "rpc")){
clicon_err(OE_XML, EINVAL, "Expected RPC");
goto done;
}
rpcprefix = xml_prefix(xrpc);
if (xml2ns(xrpc, rpcprefix, &namespace) < 0){
fprintf(stderr, "%s ERROR\n", __FUNCTION__);
goto done;
}
/* Only accept resolved NETCONF base namespace */
if (namespace == NULL || strcmp(namespace, NETCONF_BASE_NAMESPACE) != 0){
fprintf(stderr, "%s UNKNOWN\n", __FUNCTION__);
if (netconf_unknown_namespace_xml(xret, "protocol", rpcprefix, "No appropriate namespace associated with prefix")< 0)
goto done;
goto fail;
}
xn = NULL;
/* xn is name of rpc, ie <rcp><xn/></rpc> */
while ((xn = xml_child_each(xrpc, xn, CX_ELMNT)) != NULL) {