diff --git a/CHANGELOG.md b/CHANGELOG.md index 337005a0..147d973e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ Expected: February 2024 ### Minor features -* Added us resolution to logs via stderr/stdout +* Added micro-second resolution to logs via stderr/stdout * New command-line debug mechanism * Separation between subject-area and details * Multiple subject-areas @@ -25,6 +25,7 @@ Expected: February 2024 * All clixon applications added command-line option `-V` for printing version * New ca_version callback for customized version output * Optimization: + * Removed reply sanity if `CLICON_VALIDATE_STATE_XML` not set * Improved performance of GET and PUT operations * Optimized datastore access by ensuring REPORT_ALL in memory and EXPLICIT in file * Added mountpoint cache as yang flag `YANG_FLAG_MTPOINT_POTENTIAL` @@ -41,6 +42,8 @@ Users may have to change how they access the system * New `clixon-lib@2024-01-01.yang` revision * Replaced container creators to grouping/uses * New `clixon-config@2024-01-01.yang` revision + * Changed semantics: + * `CLICON_VALIDATE_STATE_XML` - disable return sanity checks if false * Marked as obsolete: * `CLICON_DATASTORE_CACHE` Replaced with enhanced datastore read API * `CLICON_NETCONF_CREATOR_ATTR` reverting 6.5 functionality diff --git a/apps/backend/backend_get.c b/apps/backend/backend_get.c index bd583497..7049d18f 100644 --- a/apps/backend/backend_get.c +++ b/apps/backend/backend_get.c @@ -884,8 +884,8 @@ get_common(clixon_handle h, /* Read configuration */ switch (content){ case CONTENT_CONFIG: /* config data only */ - /* specific xpath */ - if (xmldb_get0(h, db, YB_MODULE, nsc, xpath?xpath:"/", 1, wdef, &xret, NULL, NULL) < 0) { + /* specific xpath. with-default gets masked in get_nacm_and_reply */ + if (xmldb_get0(h, db, YB_MODULE, nsc, xpath?xpath:"/", 1, WITHDEFAULTS_REPORT_ALL, &xret, NULL, NULL) < 0) { if ((cbmsg = cbuf_new()) == NULL){ clixon_err(OE_UNIX, errno, "cbuf_new"); goto done; @@ -900,7 +900,7 @@ get_common(clixon_handle h, case CONTENT_NONCONFIG: /* state data only */ if (clicon_option_bool(h, "CLICON_VALIDATE_STATE_XML")){ /* Whole config tree, for validate debug */ - if (xmldb_get0(h, "running", YB_MODULE, nsc, NULL, 1, wdef, &xret, NULL, NULL) < 0) { + if (xmldb_get0(h, "running", YB_MODULE, nsc, NULL, 1, WITHDEFAULTS_REPORT_ALL, &xret, NULL, NULL) < 0) { if ((cbmsg = cbuf_new()) == NULL){ clixon_err(OE_UNIX, errno, "cbuf_new"); goto done; @@ -913,7 +913,7 @@ get_common(clixon_handle h, } else if (content == CONTENT_ALL){ /* specific xpath */ - if (xmldb_get0(h, db, YB_MODULE, nsc, xpath?xpath:"/", 1, wdef, &xret, NULL, NULL) < 0) { + if (xmldb_get0(h, db, YB_MODULE, nsc, xpath?xpath:"/", 1, WITHDEFAULTS_REPORT_ALL, &xret, NULL, NULL) < 0) { if ((cbmsg = cbuf_new()) == NULL){ clixon_err(OE_UNIX, errno, "cbuf_new"); goto done; diff --git a/lib/src/clixon_log.c b/lib/src/clixon_log.c index 5608e546..14981527 100644 --- a/lib/src/clixon_log.c +++ b/lib/src/clixon_log.c @@ -254,7 +254,7 @@ flogtime(FILE *f) gettimeofday(&tv, NULL); localtime_r((time_t*)&tv.tv_sec, &tm); - fprintf(f, "%s %2d %02d:%02d:%02d.%06d: ", + fprintf(f, "%s %2d %02d:%02d:%02d.%06ld: ", mon2name(tm.tm_mon), tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, tv.tv_usec); diff --git a/lib/src/clixon_plugin.c b/lib/src/clixon_plugin.c index a2460060..7d11957f 100644 --- a/lib/src/clixon_plugin.c +++ b/lib/src/clixon_plugin.c @@ -1292,7 +1292,9 @@ rpc_callback_call(clixon_handle h, rc = NEXTQ(rpc_callback_t *, rc); } while (rc != ms->ms_rpc_callbacks); /* action reply checked in action_callback_call */ - if (nr && !xml_rpc_isaction(xe)){ + if (nr && + clicon_option_bool(h, "CLICON_VALIDATE_STATE_XML") && + !xml_rpc_isaction(xe)){ if ((ret = rpc_reply_check(h, name, cbret)) < 0) goto done; if (ret == 0) diff --git a/lib/src/clixon_yang.c b/lib/src/clixon_yang.c index 7964d2c8..66d2ba76 100644 --- a/lib/src/clixon_yang.c +++ b/lib/src/clixon_yang.c @@ -3537,14 +3537,18 @@ yang_config(yang_stmt *ys) int yang_config_ancestor(yang_stmt *ys) { - yang_stmt *yp; + yang_stmt *yp; + enum rfc_6020 keyw; yp = ys; do { if (yang_flag_get(yp, YANG_FLAG_STATE_LOCAL) != 0) return 0; - else if (yang_keyword_get(yp) == Y_INPUT || yang_keyword_get(yp) == Y_OUTPUT || yang_keyword_get(yp) == Y_NOTIFICATION){ - return 0; + else { + keyw = yang_keyword_get(yp); + if (keyw == Y_INPUT || keyw == Y_OUTPUT || keyw == Y_NOTIFICATION){ + return 0; + } } } while((yp = yang_parent_get(yp)) != NULL); return 1; diff --git a/yang/clixon/clixon-config@2024-01-01.yang b/yang/clixon/clixon-config@2024-01-01.yang index 8194b6a2..2a1e9a14 100644 --- a/yang/clixon/clixon-config@2024-01-01.yang +++ b/yang/clixon/clixon-config@2024-01-01.yang @@ -51,9 +51,12 @@ module clixon-config { revision 2024-01-01 { description - "Makred as obsolete: + "Changed semantics: + CLICON_VALIDATE_STATE_XML - disable return sanity checks if false + Marked as obsolete: CLICON_DATASTORE_CACHE CLICON_NETCONF_CREATOR_ATTR + Changed semantics of Released in Clixon 6.6"; } revision 2023-11-01 { @@ -1013,6 +1016,7 @@ module clixon-config { default false; description "Validate user state callback content. + AND NETCONF reply sanity (misnomer) Users may register state callbacks using ca_statedata callback When set, the XML returned from the callback is validated after merging with the running db. If it fails, an internal error is returned to the originating