diff --git a/CHANGELOG.md b/CHANGELOG.md index 066cc3d4..3ce5cf28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Clixon Changelog -* [6.1.0](#610) Expected: 19 Feb 2023 +* [6.1.0](#610) 19 Feb 2023 * [6.0.0](#600) 29 Nov 2022 * [5.9.0](#590) 24 September 2022 * [5.8.0](#580) 28 July 2022 @@ -39,7 +39,7 @@ * [3.3.1](#331) June 7 2017 ## 6.1.0 -Expected: 19 Feb 2023 +19 Feb 2023 The Clixon 6.1 release completes Network monitoring (RFC 6022) and introduces a first version of YANG schema mount (RFC 8528). The main focus has been interoperability and basic support for the ongoing [Clixon controller](https://github.com/clicon/clixon-controller) work. @@ -93,15 +93,27 @@ Developers may need to change their code * Added netconf ssh subsystem * Renamed from `clixon` built in `docker/base` * C-API - * Added `spec` parameter to `xml2xpath()`, default 0 - * Added `clicon_handle` parameter to all `xml_bind_*` calls - * All calls to `clicon_log_xml()` changed to new function `clicon_debug_xml()` - * Changed type of `veclen` parameter to `size_t` in `xpath_vec_flag()` - * Added `with-defaults` parameter (default 0) to `xmldb_get0()` - * Added `sock_flags` parameter to `clixon_proc_socket()` + * `xml2xpath()`: Added `int spec` as third parameter, default 0 + * This was for making an xpath to a yang-mount point (only for yang-mount) + * Example change: + * `xml2xpath(x, n, xp)` -> `xml2xpath(x, n, 0, xp)` + * `xml_bind_*()` functions: Added `clicon_handle h` as first parameter + * Example change: + * `xml_bind_yang(x, y, yp, xe)` -> `xml_bind_yang(h, x, y, yp, xe)` -> + * `xmldb_get0()`: Added `with-defaults` parameter, default 0 + * Example change: + * `xmldb_get0(0, db, yb, n, xp, c, x, m, x)` -> `xmldb_get0(0, db, yb, n, xp, c, WITHDEFAULTS_REPORT_ALL, x, m, x)` + * `candidate_commit()`: Add myid as fourth and validate_level as fifth parameter, default 0 + * Example change: + * `candidate_commit(h, x, d, c)` -> `candidate_commit(h, x, d, 0, VL_FULL, c)` + * `xpath_vec_flag()`: Changed type of sixth `veclen` parameter to `size_t *` + * `clicon_log_xml()`: All calls changed to new function `clicon_debug_xml()` + * `clixon_proc_socket()`: Added `sock_flags` parameter ### Minor features +* Misc. build fixes encountered when cross-compiling by @troglobit in https://github.com/clicon/clixon/pull/418 +* Update FAQ.md hello world example url by @jarrodb in https://github.com/clicon/clixon/pull/419 * Done: [Request to suppress auto-completion for "deprecated" / "obsolete" status and warn the user.](https://github.com/clicon/clixon/issues/410) * Implemented by: * Not generating any autocli syntax for obsolete YANG statements, @@ -121,10 +133,13 @@ Developers may need to change their code ### Corrected Bugs +* Added translation from Yang type to SNMP type by @StasSt-siklu in https://github.com/clicon/clixon/pull/406 * Fixed: [State XML validation error when CLICON_MODULE_LIBRARY_RFC7895=true and ietf-yang-library@2019-01-04 is loaded](https://github.com/clicon/clixon/issues/408) * Fixed: [SNMP: snmpwalk is slow and can timeout #404 ](https://github.com/clicon/clixon/issues/404) * Fixed: [SNMP accepts only u32 & u64 #405](https://github.com/clicon/clixon/issues/405) * Fixed: [Yang leaves without smiv2:oid directive are not shown well in snmpwalk #398](https://github.com/clicon/clixon/issues/398) + * Yang leaves without smiv2:oid directive are not shown well in]… by @doron2020 in https://github.com/clicon/clixon/pull/402 + * Fixed: [Netconf commit confirm session-id mismatch #407](https://github.com/clicon/clixon/issues/407) * Fixed: Initialized session-id to 1 instead of 0 following ietf-netconf.yang * Fixed: [snmpwalk doesn't show properly SNMP boolean values which equal false](https://github.com/clicon/clixon/issues/400) diff --git a/configure b/configure index 422673e8..cfbffb27 100755 --- a/configure +++ b/configure @@ -2286,7 +2286,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. CLIXON_VERSION_MAJOR="6" CLIXON_VERSION_MINOR="1" CLIXON_VERSION_PATCH="0" -CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}.PRE\"" +CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\"" # Debug flag # Check whether --enable-debug was given. diff --git a/configure.ac b/configure.ac index 6045506a..1a4d6daf 100644 --- a/configure.ac +++ b/configure.ac @@ -50,7 +50,7 @@ AC_CONFIG_AUX_DIR(config-aux) CLIXON_VERSION_MAJOR="6" CLIXON_VERSION_MINOR="1" CLIXON_VERSION_PATCH="0" -CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}.PRE\"" +CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\"" # Debug flag AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[Build with debug symbols, default: no]),[ diff --git a/doc/DEVELOP.md b/doc/DEVELOP.md index 28aef6fa..e097024c 100644 --- a/doc/DEVELOP.md +++ b/doc/DEVELOP.md @@ -2,34 +2,11 @@ (See also CONTRIBUTING.md) - * [Code documentation](#documentation) * [How to work in git (how-to-work-in-git)](#how-to-work-in-git) * [How the meta-configure stuff works](#meta-configure) * [How to debug](#debug) * [New release](#new-release) -## Documentation -How to document the code - -``` -/*! This is a small comment on one line - * - * This is a detailed description - * spanning several lines. - * - * Example usage: - * @code - * fn(a, &b); - * @endcode - * - * @param[in] src This is a description of the first parameter - * @param[in,out] dest This is a description of the second parameter - * @retval TRUE This is a description of the return value - * @retval FALSE This is a description of another return value - * @see See also this function - */ -``` - ## How to work in git Clixon uses semantic versioning (https://semver.org). @@ -180,10 +157,13 @@ gdb clixon_cli ``` ## New release + What to think about when doing a new release. -* Ensure all tests run OK -* review CHANGELOG, write one-liner -* review README.md wording about latest release +* Ensure all CI tests run OK +* Ensure all extended tests run OK: valgrind, vagrant, afl +* Review CHANGELOG, write one-liner + * Draft a new release and review generated release notes and use info to update CHANGELOG +* Review README.md wording about latest release * New yang/clicon/clixon-config@XXX.yang revision? * In configure.ac, for minor releases change CLIXON_VERSION in configure.ac to eg: (minor should have been bumped): ``` @@ -196,7 +176,8 @@ What to think about when doing a new release. git tag -a git push origin ``` -* Add a github "release" and copy release info from CHANGELOG + +* Add a github release and copy release info from CHANGELOG After release: * Bump minor version and add a "PRE": diff --git a/lib/src/clixon_proto.c b/lib/src/clixon_proto.c index 432bb528..e961e5b9 100644 --- a/lib/src/clixon_proto.c +++ b/lib/src/clixon_proto.c @@ -412,7 +412,6 @@ clicon_msg_rcv(int s, clicon_err(OE_PROTO, errno, "header too short (%d)", hlen); goto done; } - mlen = ntohl(hdr.op_len); clicon_debug(16, "op-len:%u op-id:%u", mlen, ntohl(hdr.op_id)); diff --git a/lib/src/clixon_xml_bind.c b/lib/src/clixon_xml_bind.c index abf10e47..17aa7157 100644 --- a/lib/src/clixon_xml_bind.c +++ b/lib/src/clixon_xml_bind.c @@ -693,7 +693,7 @@ xml_bind_yang_rpc_action(clicon_handle h, * @retval -1 Error * The * @code - * if ((ret = xml_bind_yang_rpc(x, NULL, &xerr)) < 0) + * if ((ret = xml_bind_yang_rpc(h, x, NULL, &xerr)) < 0) * err; * @endcode * @see xml_bind_yang For other generic cases @@ -824,7 +824,7 @@ xml_bind_yang_rpc(clicon_handle h, * @retval -1 Error * * @code - * if ((ret = xml_bind_yang_rpc_reply(x, "get-config", yspec, &xerr)) < 0) + * if ((ret = xml_bind_yang_rpc_reply(h, x, "get-config", yspec, &xerr)) < 0) * err; * @endcode * @see xml_bind_yang For other generic cases diff --git a/lib/src/clixon_xpath.c b/lib/src/clixon_xpath.c index d5598bf6..c794c332 100644 --- a/lib/src/clixon_xpath.c +++ b/lib/src/clixon_xpath.c @@ -1259,7 +1259,7 @@ xml2xpath1(cxobj *x, * Therefore, if nsc is "canonical", the returned xpath is also "canonical", even though the XML is not. * @param[in] x XML object * @param[in] nsc Namespace context - * @param[in] spec If set, recursively continue only to root without spec + * @param[in] spec If set, recursively continue only to root without spec (added in 6.1 for yang mount) * @param[out] xpath Malloced xpath string. Need to free() after use * @retval 0 OK * @retval -1 Error. (eg XML malformed) @@ -1267,7 +1267,7 @@ xml2xpath1(cxobj *x, * char *xpath = NULL; * cxobj *x; * ... x is inside an xml tree ... - * if (xml2xpath(x, nsc, &xpath) < 0) + * if (xml2xpath(x, nsc, 0, &xpath) < 0) * err; * free(xpath); * @endcode diff --git a/test/fuzz/backend/input/1.xml b/test/fuzz/backend/input/1.xml index 9272e718..670fbe8e 100644 --- a/test/fuzz/backend/input/1.xml +++ b/test/fuzz/backend/input/1.xml @@ -1 +1 @@ -nonetest-then-setstop-on-erroreth/0/0]]>]]> +mergetest-then-setstop-on-erroreth/0/0x
]]>]]> diff --git a/test/fuzz/backend/runfuzz.sh b/test/fuzz/backend/runfuzz.sh index 7f38bbd2..0ddf0026 100755 --- a/test/fuzz/backend/runfuzz.sh +++ b/test/fuzz/backend/runfuzz.sh @@ -44,10 +44,11 @@ cat < $cfg EOF -# Run script -# CC=/usr/bin/afl-clang -sudo LD_PRELOAD="/usr/local/lib/desock.so" afl-fuzz -i input -o output -d -m $MEGS -- /usr/local/sbin/clixon_backend -Fs init -f $cfg +# kill old +sudo /usr/local/sbin/clixon_backend -Fz -f $cfg -# Dryrun without afl: -#echo "sudo LD_PRELOAD=\"/usr/local/lib/desock.so\" /usr/local/sbin/clixon_backend -Fs init -f ./conf.xml < input/1.xml" +# Dryrun without afl (commit this for real run): #sudo LD_PRELOAD="/usr/local/lib/desock.so" /usr/local/sbin/clixon_backend -Fs init -f ./conf.xml < input/1.xml + +# Run script +sudo LD_PRELOAD="/usr/local/lib/desock.so" afl-fuzz -i input -o output -d -m $MEGS -- /usr/local/sbin/clixon_backend -Fs init -f $cfg diff --git a/test/fuzz/cli/README.md b/test/fuzz/cli/README.md index 4dc2a1b1..38026b4c 100644 --- a/test/fuzz/cli/README.md +++ b/test/fuzz/cli/README.md @@ -22,7 +22,10 @@ Build clixon cli statically with the afl-clang compiler: ``` CC=/usr/bin/afl-clang-fast LINKAGE=static INSTALLFLAGS="" ./configure # Dont care about restconf make clean - cd apps/cli + cd lib + make + sudo make install + cd ../apps/cli make clixon_cli sudo make install ``` diff --git a/test/fuzz/cli/runfuzz.sh b/test/fuzz/cli/runfuzz.sh index 8dfef6f9..60968e8f 100755 --- a/test/fuzz/cli/runfuzz.sh +++ b/test/fuzz/cli/runfuzz.sh @@ -26,12 +26,11 @@ cat < $cfg 0 0 - true false include $APPNAME enable - $APPNAME/module-name> + $APPNAME diff --git a/test/fuzz/http1/README.md b/test/fuzz/http1/README.md index 125b575e..d403d8fc 100644 --- a/test/fuzz/http1/README.md +++ b/test/fuzz/http1/README.md @@ -7,7 +7,6 @@ Install AFL, see [..](..) Enable `RESTCONF_HTTP1_UNITTEST` in `include/clixon_custom.h`. - Build and install clixon libraries and restconf statically ``` ./configure --disable-nghttp2 LINKAGE=static INSTALLFLAGS="" CC=/usr/bin/afl-clang-fast CFLAGS="-g" @@ -17,7 +16,6 @@ Build and install clixon libraries and restconf statically ./runfuzz.sh ``` - To view crashes ``` sudo chmod o+x output/crashes diff --git a/test/fuzz/netconf/README.md b/test/fuzz/netconf/README.md index edc3091b..e85f4b2b 100644 --- a/test/fuzz/netconf/README.md +++ b/test/fuzz/netconf/README.md @@ -14,7 +14,10 @@ Build clixon netconf statically with the afl-clang compiler: ``` CC=/usr/bin/afl-clang-fast LINKAGE=static ./configure # Dont care about restconf make clean - cd apps/netconf + cd lib + make + sudo make install + cd ../apps/netconf make clixon_netconf sudo make install ``` @@ -27,4 +30,3 @@ Run the script `runfuzz.sh` to run one test with a cli spec and an input string, ``` After (or during) the test, investigate results in the output dir. -