From f8324df9176885e773ed6357da6a68c55a1ba594 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Thu, 13 Apr 2023 21:11:57 +0200 Subject: [PATCH] Creator tagging for leafs, sort-modules: remove flag setting, yang_lib2yspec patch --- apps/backend/backend_client.c | 5 +++-- lib/src/clixon_datastore_write.c | 4 ++++ lib/src/clixon_yang_module.c | 9 ++++++--- lib/src/clixon_yang_parse_lib.c | 5 ----- test/test_c++.sh | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/apps/backend/backend_client.c b/apps/backend/backend_client.c index 31cdf977..31808577 100644 --- a/apps/backend/backend_client.c +++ b/apps/backend/backend_client.c @@ -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: * 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 - * 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")){ 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; } 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 */ xnacm = NULL; diff --git a/lib/src/clixon_datastore_write.c b/lib/src/clixon_datastore_write.c index be251e59..b99ea1d4 100644 --- a/lib/src/clixon_datastore_write.c +++ b/lib/src/clixon_datastore_write.c @@ -695,6 +695,10 @@ text_modify(clicon_handle h, xml_flag_reset(x0, XML_FLAG_DEFAULT); } } /* x1bstr */ + if (creator){ + if (xml_creator_add(x0, creator) < 0) + goto done; + } if (changed){ if (xml_insert(x0p, x0, insert, valstr, NULL) < 0) goto done; diff --git a/lib/src/clixon_yang_module.c b/lib/src/clixon_yang_module.c index 20e25ec6..6165dfcb 100644 --- a/lib/src/clixon_yang_module.c +++ b/lib/src/clixon_yang_module.c @@ -83,7 +83,7 @@ #include "clixon_yang_parse_lib.h" /*! 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 @@ -883,9 +883,12 @@ yang_lib2yspec(clicon_handle h, } else if (yang_parse_module(h, "ietf-yang-library", "2019-01-04", yspec, NULL) < 0) goto fail; -#endif - if (yang_parse_post(h, yspec, 0) < 0) + if (yang_parse_post(h, yspec, yang_len_get(yspec) - (1+veclen - modmin)) < 0) goto done; +#else + if (yang_parse_post(h, yspec, yang_len_get(yspec) - (veclen - modmin)) < 0) + goto done; +#endif retval = 1; done: if (vec) diff --git a/lib/src/clixon_yang_parse_lib.c b/lib/src/clixon_yang_parse_lib.c index 209db252..06dc2f67 100644 --- a/lib/src/clixon_yang_parse_lib.c +++ b/lib/src/clixon_yang_parse_lib.c @@ -1433,11 +1433,6 @@ yang_sort_modules(yang_stmt *yspec, if (*ylen != modmax-modmin){ clicon_err(OE_YANG, EFAULT, "Internal error: mismatch sort vector lengths"); } - /* Unmark all nodes */ - for (i=modmin; i");