Creator tagging for leafs, sort-modules: remove flag setting, yang_lib2yspec patch

This commit is contained in:
Olof hagsand 2023-04-13 21:11:57 +02:00
parent 6335f810d3
commit f8324df917
5 changed files with 14 additions and 11 deletions

View file

@ -1555,7 +1555,7 @@ from_client_msg(clicon_handle h,
* op_id from internal message can be out-of-sync from client's sessions-id for the following reasons: * op_id from internal message can be out-of-sync from client's sessions-id for the following reasons:
* 1. Its a hello when the client starts with op_id=0 to get its proper id on hello reply * 1. Its a hello when the client starts with op_id=0 to get its proper id on hello reply
* 2. The backend has restarted and the client uses an old op_id * 2. The backend has restarted and the client uses an old op_id
* 3. Its a create-subsciption message that uses a separate socket(=client) * 3. Its a create-subscription message that uses a separate socket(=client)
*/ */
if (op_id != 0 && ce->ce_id != op_id && strcmp(rpcname, "create-subscription")){ if (op_id != 0 && ce->ce_id != op_id && strcmp(rpcname, "create-subscription")){
clicon_debug(1, "%s Warning: incoming session-id:%u does not match ce_id:%u on socket: %d", __FUNCTION__, op_id, ce->ce_id, ce->ce_s); clicon_debug(1, "%s Warning: incoming session-id:%u does not match ce_id:%u on socket: %d", __FUNCTION__, op_id, ce->ce_id, ce->ce_s);
@ -1636,7 +1636,8 @@ from_client_msg(clicon_handle h,
goto done; goto done;
} }
module = yang_argument_get(ymod); module = yang_argument_get(ymod);
clicon_debug(1, "%s module:%s rpc:%s", __FUNCTION__, module, rpc); clicon_debug(CLIXON_DBG_DEFAULT, "%s module:%s rpc:%s ce_id:%u s:%d", __FUNCTION__, module,
rpc, ce->ce_id, ce->ce_s);
/* Pre-NACM access step */ /* Pre-NACM access step */
xnacm = NULL; xnacm = NULL;

View file

@ -695,6 +695,10 @@ text_modify(clicon_handle h,
xml_flag_reset(x0, XML_FLAG_DEFAULT); xml_flag_reset(x0, XML_FLAG_DEFAULT);
} }
} /* x1bstr */ } /* x1bstr */
if (creator){
if (xml_creator_add(x0, creator) < 0)
goto done;
}
if (changed){ if (changed){
if (xml_insert(x0p, x0, insert, valstr, NULL) < 0) if (xml_insert(x0p, x0, insert, valstr, NULL) < 0)
goto done; goto done;

View file

@ -83,7 +83,7 @@
#include "clixon_yang_parse_lib.h" #include "clixon_yang_parse_lib.h"
/*! Force add ietf-yang-library@2019-01-04 on all mount-points /*! Force add ietf-yang-library@2019-01-04 on all mount-points
* This is a limitation of othe current implementation * This is a limitation of of the current implementation
*/ */
#define YANG_SCHEMA_MOUNT_YANG_LIB_FORCE #define YANG_SCHEMA_MOUNT_YANG_LIB_FORCE
@ -883,9 +883,12 @@ yang_lib2yspec(clicon_handle h,
} }
else if (yang_parse_module(h, "ietf-yang-library", "2019-01-04", yspec, NULL) < 0) else if (yang_parse_module(h, "ietf-yang-library", "2019-01-04", yspec, NULL) < 0)
goto fail; goto fail;
#endif if (yang_parse_post(h, yspec, yang_len_get(yspec) - (1+veclen - modmin)) < 0)
if (yang_parse_post(h, yspec, 0) < 0)
goto done; goto done;
#else
if (yang_parse_post(h, yspec, yang_len_get(yspec) - (veclen - modmin)) < 0)
goto done;
#endif
retval = 1; retval = 1;
done: done:
if (vec) if (vec)

View file

@ -1433,11 +1433,6 @@ yang_sort_modules(yang_stmt *yspec,
if (*ylen != modmax-modmin){ if (*ylen != modmax-modmin){
clicon_err(OE_YANG, EFAULT, "Internal error: mismatch sort vector lengths"); clicon_err(OE_YANG, EFAULT, "Internal error: mismatch sort vector lengths");
} }
/* Unmark all nodes */
for (i=modmin; i<modmax; i++){
yn = yang_child_i(yspec, i);
yang_flag_set(yn, YANG_FLAG_MARK|YANG_FLAG_TMP);
}
retval = 0; retval = 0;
done: done:
return retval; return retval;

View file

@ -145,7 +145,7 @@ int example_rpc(clicon_handle h,
if (xmlns_set(x, NULL, ns) < 0) if (xmlns_set(x, NULL, ns) < 0)
goto done; goto done;
} }
if (clixon_xml2cbuf(cbret, xe, 0, 0, -1, 1) < 0) if (clixon_xml2cbuf(cbret, xe, 0, 0, NULL, -1, 1) < 0)
goto done; goto done;
} }
cprintf(cbret, "</rpc-reply>"); cprintf(cbret, "</rpc-reply>");