diff --git a/CHANGELOG.md b/CHANGELOG.md index 67eb96fe..bb5898b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Clixon Changelog +* [7.2.0](#720) Expected: October 2024 * [7.1.0](#710) 3 July 2024 * [7.0.1](#701) 3 April 2024 * [7.0.0](#700) 8 March 2024 @@ -10,10 +11,14 @@ * [6.1.0](#610) 19 Feb 2023 * [6.0.0](#600) 29 Nov 2022 +## 7.2.0 +Expected: October 2024 + ## 7.1.0 3 July 2024 - +The 7.1.0 release features RESTCONF notifications for native mode, +multi-datastore, and many new configure options. ### Features diff --git a/apps/cli/cli_generate.c b/apps/cli/cli_generate.c index b91d4bcb..47351382 100644 --- a/apps/cli/cli_generate.c +++ b/apps/cli/cli_generate.c @@ -291,8 +291,6 @@ yang2cli_var_identityref(yang_stmt *ys, if (nodeid_split(cv_name_get(cv), &prefix, &id) < 0) goto done; /* Translate from module-name(prefix) to global prefix - * This is really a kludge for true identityref prefix handling - * IDENTITYREF_KLUDGE * This is actually quite complicated: the cli needs to generate * a netconf statement with correct xmlns binding */ diff --git a/configure b/configure index d2d26942..e69ef543 100755 --- a/configure +++ b/configure @@ -694,6 +694,7 @@ INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM INCLUDES +CLIXON_VERSION_PATCH CLIXON_VERSION_MINOR CLIXON_VERSION_MAJOR CLIXON_VERSION @@ -2811,11 +2812,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # where autotool scripts are: install-sh, config.sub, config.guess -CLIXON_VERSION_MAJOR="7" -CLIXON_VERSION_MINOR="1" -CLIXON_VERSION_PATCH="0" -# Use GIT, if this does not work, need a fallback mechanism +# Use GIT version (what if no git?) CLIXON_VERSION="$(git log --pretty="format:%(describe) %ci" -n1)" +CLIXON_VERSION_MAJOR="$(echo $CLIXON_VERSION | awk -F "." '{print $1}')" +CLIXON_VERSION_MINOR="$(echo $CLIXON_VERSION | awk -F "." '{print $2}')" +CLIXON_VERSION_PATCH="$(echo $CLIXON_VERSION | awk -F "." '{print $3}' | awk -F " " '{print $1}')" # Debug flag # Check whether --enable-debug was given. @@ -4016,6 +4017,7 @@ test -n "$target_alias" && + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: CLIXON version is ${CLIXON_VERSION}" >&5 printf "%s\n" "CLIXON version is ${CLIXON_VERSION}" >&6; } diff --git a/configure.ac b/configure.ac index a4131d74..b92006ef 100644 --- a/configure.ac +++ b/configure.ac @@ -48,11 +48,11 @@ AC_CONFIG_SRCDIR([lib/clixon/clixon.h.in]) # where autotool scripts are: install-sh, config.sub, config.guess AC_CONFIG_AUX_DIR(config-aux) -CLIXON_VERSION_MAJOR="7" -CLIXON_VERSION_MINOR="1" -CLIXON_VERSION_PATCH="0" -# Use GIT, if this does not work, need a fallback mechanism +# Use GIT version (what if no git?) CLIXON_VERSION="$(git log --pretty="format:%(describe) %ci" -n1)" +CLIXON_VERSION_MAJOR="$(echo $CLIXON_VERSION | awk -F "." '{print $1}')" +CLIXON_VERSION_MINOR="$(echo $CLIXON_VERSION | awk -F "." '{print $2}')" +CLIXON_VERSION_PATCH="$(echo $CLIXON_VERSION | awk -F "." '{print $3}' | awk -F " " '{print $1}')" # Debug flag AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[Build with debug symbols, default: no]),[ @@ -88,6 +88,7 @@ AC_CANONICAL_TARGET AC_SUBST(CLIXON_VERSION) AC_SUBST(CLIXON_VERSION_MAJOR) AC_SUBST(CLIXON_VERSION_MINOR) +AC_SUBST(CLIXON_VERSION_PATCH) AC_MSG_RESULT(CLIXON version is ${CLIXON_VERSION}) diff --git a/include/clixon_custom.h b/include/clixon_custom.h index 22b2529b..c229f77f 100644 --- a/include/clixon_custom.h +++ b/include/clixon_custom.h @@ -47,20 +47,6 @@ */ #undef RPC_USERNAME_ASSERT -/*! Tag for wrong handling of identityref prefixes (XML encoding) - * - * See https://github.com/clicon/clixon/issues/90 - * Instead of using generic xmlns prefix bindings, the module's own prefix - * is used. - * In the CLI generation case, this is actually quite complicated: the cli - * needs to generate a netconf statement with correct xmlns binding. - * The easy way to do this is to always generate all prefix/namespace bindings - * on the top-level for the modules involved in the netconf operation. - * Update 2022-11: seems most cornercases are covered and this is now disabled. - * I am sure there are remaining cases but undef this for now and close #90 - */ -#undef IDENTITYREF_KLUDGE - /*! Optimize special list key searches in XPath finds * * Identify xpaths that search for exactly a list key, eg: "y[k='3']" and then call @@ -198,14 +184,6 @@ */ #undef RESTCONF_INLINE -/*! Backward compatible with 6.5 for Error, Log and Debug APIs - * - * Note: many(most) not covered by this constant need to GREP - * This includes lots of clicon->clixon namechanges, see CHANGELOG for whole list - * This constant will be removed after the 7.0 release - */ -#define COMPAT_6_5 - /*! Use SHA256 (32 bytes) instead of SHA1 (20 bytes) * * Digest use is not cryptographic use, so SHA1 is enough for now diff --git a/lib/clixon/clixon_err.h b/lib/clixon/clixon_err.h index 72bfe948..fb7da78d 100644 --- a/lib/clixon/clixon_err.h +++ b/lib/clixon/clixon_err.h @@ -119,15 +119,4 @@ int clixon_err_exit(void); /* doesnt work if arg != NULL */ #define clixon_netconf_error(h, x, f, a) clixon_err_fn((h), __FUNCTION__, __LINE__, OE_XML, 0,(x), (f)) -#if 1 /* COMPAT_6_5 */ -#define clicon_err(c,s,_fmt, args...) clixon_err_fn(NULL, __FUNCTION__, __LINE__, (c), (s), NULL, _fmt , ##args) -#define clicon_err_reset() clixon_err_reset() - -#define clicon_errno clixon_err_category() -#define clicon_suberrno clixon_err_subnr() -#define clicon_err_reason clixon_err_reason() - -#endif - - #endif /* _CLIXON_ERR_H_ */ diff --git a/lib/clixon/clixon_handle.h b/lib/clixon/clixon_handle.h index 0a81409e..aa8212aa 100644 --- a/lib/clixon/clixon_handle.h +++ b/lib/clixon/clixon_handle.h @@ -92,11 +92,4 @@ struct event_stream; int clicon_stream_set(clixon_handle h, struct event_stream *es); int clicon_stream_append(clixon_handle h, struct event_stream *es); -/* COMPAT_6_5 */ -#if 1 -typedef void *clicon_handle; -#define clicon_handle_init() clixon_handle_init() -#define clicon_handle_exit(h) clixon_handle_exit(h) -#endif - #endif /* _CLIXON_HANDLE_H_ */ diff --git a/lib/clixon/clixon_log.h b/lib/clixon/clixon_log.h index df7de5b4..a831c97d 100644 --- a/lib/clixon/clixon_log.h +++ b/lib/clixon/clixon_log.h @@ -83,19 +83,4 @@ int clixon_get_logflags(void); int clixon_log_str(int level, char *msg); int clixon_log_fn(clixon_handle h, int user, int level, cxobj *x, const char *format, ...) __attribute__ ((format (printf, 5, 6))); -#if 1 /* COMPAT_6_5 */ -#define CLICON_LOG_SYSLOG CLIXON_LOG_SYSLOG -#define CLICON_LOG_STDERR CLIXON_LOG_STDERR -#define CLICON_LOG_STDOUT CLIXON_LOG_STDOUT -#define CLICON_LOG_FILE CLIXON_LOG_FILE - -#define clicon_log(l, f, args...) clixon_log(NULL, (l), (f), ##args) -#define clicon_log_exit() clixon_log_exit() -#define clicon_log_opt(c) clixon_log_opt((c)) -#define clicon_log_file(f) clixon_log_file((f)) - -int clicon_log_init(char *ident, int upto, int flags); - -#endif /* COMPAT_6_5 */ - #endif /* _CLIXON_LOG_H_ */ diff --git a/lib/src/clixon_datastore_write.c b/lib/src/clixon_datastore_write.c index 27df19fd..0f3543bc 100644 --- a/lib/src/clixon_datastore_write.c +++ b/lib/src/clixon_datastore_write.c @@ -238,20 +238,6 @@ check_body_namespace(cxobj *x0, } #endif else{ /* Namespace does not exist in x0: error */ -#ifdef IDENTITYREF_KLUDGE - int ret; - if (ns1 == NULL){ - if ((ret = yang_find_namespace_by_prefix(y, prefix, &ns0)) < 0) - goto done; - if (ret == 0){ /* no such namespace in yang */ - ; - } - else{ /* Add it according to the kludge,... */ - if (xml_add_attr(x0, prefix, ns0, "xmlns", NULL) == NULL) - goto done; - } - } -#else if ((cberr = cbuf_new()) == NULL){ clixon_err(OE_UNIX, errno, "cbuf_new"); goto done; @@ -260,7 +246,6 @@ check_body_namespace(cxobj *x0, if (netconf_invalid_value(cbret, "application", cbuf_get(cberr)) < 0) goto done; goto fail; -#endif } ok: retval = 1; diff --git a/lib/src/clixon_json.c b/lib/src/clixon_json.c index 490fef1c..06bbf825 100644 --- a/lib/src/clixon_json.c +++ b/lib/src/clixon_json.c @@ -481,31 +481,15 @@ xml2json_encode_identityref(cxobj *xb, if (xml2ns(xb, prefix, &namespace) < 0) goto done; /* We got the namespace, now get the module */ - // clixon_debug(CLIXON_DBG_DEFAULT, "body:%s prefix:%s namespace:%s", body, prefix, namespace); -#ifdef IDENTITYREF_KLUDGE - if (namespace == NULL){ - /* If we dont find namespace here, we assume it is because of a missing - * xmlns that should be there, as a kludge we search for its (own) - * prefix in mymodule. - */ - if ((ymod = yang_find_module_by_prefix_yspec(yspec, prefix)) != NULL) - cprintf(cb, "%s:%s", yang_argument_get(ymod), id); - else + if ((ymod = yang_find_module_by_namespace(yspec, namespace)) != NULL){ + if (ymod == my_ymod) cprintf(cb, "%s", id); + else{ + cprintf(cb, "%s:%s", yang_argument_get(ymod), id); + } } else -#endif - { - if ((ymod = yang_find_module_by_namespace(yspec, namespace)) != NULL){ - if (ymod == my_ymod) - cprintf(cb, "%s", id); - else{ - cprintf(cb, "%s:%s", yang_argument_get(ymod), id); - } - } - else - cprintf(cb, "%s", id); - } + cprintf(cb, "%s", id); retval = 0; done: if (prefix) diff --git a/lib/src/clixon_log.c b/lib/src/clixon_log.c index 86e45796..6b1c5f12 100644 --- a/lib/src/clixon_log.c +++ b/lib/src/clixon_log.c @@ -161,19 +161,6 @@ clixon_log_init(clixon_handle h, return 0; } -#ifdef COMPAT_6_5 -/* Required for clixon-example autoconf - */ -int -clicon_log_init(char *ident, - int upto, - int flags) -{ - return clixon_log_init(NULL, ident, upto, flags); -} - -#endif - int clixon_log_exit(void) { diff --git a/lib/src/clixon_yang_module.c b/lib/src/clixon_yang_module.c index f56a39e6..51683160 100644 --- a/lib/src/clixon_yang_module.c +++ b/lib/src/clixon_yang_module.c @@ -579,9 +579,6 @@ yang_find_module_by_prefix(yang_stmt *ys, /*! Get module from its own prefix * - * This is really not a valid usecase, a kludge for the identityref derived - * list workaround (IDENTITYREF_KLUDGE) - * Actually, for canonical prefixes it is! */ yang_stmt * yang_find_module_by_prefix_yspec(yang_stmt *yspec,