Clixon 6.1

Reviewed documentation, changelog, etc
This commit is contained in:
Olof hagsand 2023-02-19 11:35:37 +01:00
parent 994632daac
commit 72a4494b69
13 changed files with 53 additions and 55 deletions

View file

@ -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)

2
configure vendored
View file

@ -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.

View file

@ -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]),[

View file

@ -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 <version>
git push origin <version>
```
* 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":

View file

@ -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));

View file

@ -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

View file

@ -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

View file

@ -1 +1 @@
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42" username="olof"><edit-config><target><candidate/></target><default-operation>none</default-operation><test-option>test-then-set</test-option><error-option>stop-on-error</error-option><config><interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"><interface><name>eth/0/0</name></interface></interfaces></config></edit-config></rpc>]]>]]>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42" username="olof"><edit-config><target><candidate/></target><default-operation>merge</default-operation><test-option>test-then-set</test-option><error-option>stop-on-error</error-option><config><table xmlns="urn:example:clixon"><parameter><name>eth/0/0</name><value>x</value></parameter></table></config></edit-config></rpc>]]>]]>

View file

@ -44,10 +44,11 @@ cat <<EOF > $cfg
</clixon-config>
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

View file

@ -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
```

View file

@ -26,12 +26,11 @@ cat <<EOF > $cfg
<CLICON_CLI_LINESCROLLING>0</CLICON_CLI_LINESCROLLING>
<CLICON_CLI_TAB_MODE>0</CLICON_CLI_TAB_MODE>
<autocli>
<enable-autocli>true</enable-autocli>
<module-default>false</module-default>
<rule>
<name>include $APPNAME</name>
<operation>enable</operation>
<module-name>$APPNAME/module-name>
<module-name>$APPNAME</module-name>
</rule>
</autocli>
</clixon-config>

View file

@ -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

View file

@ -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.