diff --git a/CHANGELOG.md b/CHANGELOG.md index 8108987c..fd5edfc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,63 +30,62 @@ ### New features * New process-control RPC feature in clixon-lib.yang to manage processes - * This is an alternative to manage a clixon daemon via sudtemd, containerd or other + * This is an alternative to manage a clixon daemon direct via systemd, containerd or other ways to manage processes * One important special case is starting the clixon-restconf daemon internally * This is how it works: * Register a process via `clixon_process_register(h, name, namespace, argv, argc)` * Use process-control RPC defined in clixon-lib.yang to start/stop/restart or query status on that process - * Enable in backend for restconf using `CLICON_BACKEND_RESTCONF_PROCESS`. -* More YANG extension functionality, - * See [Augment auto-cli for hiding/modifying cli syntax #156](https://github.com/clicon/clixon/issues/156) and [hiding auto-generated CLI entries #153](https://github.com/clicon/clixon/issues/153) - * Extensions can be used in augmentations - * Extension `autocli-op` has been added to add "hidden" commands in the autocli + * Enable in backend for starting restconf internally using `CLICON_BACKEND_RESTCONF_PROCESS`. +* New YANG extension functionality: mark YANG and use in plugins * Documentation: https://clixon-docs.readthedocs.io/en/latest/misc.html#extensions -* Restconf configuration has a new configure model: `clixon-restconf.yang` enabling more flexible socket config + * As one usage of this extensions, the `autocli-op` extension has been added to annotate YANG with autocli properties, "hidden" commands being the first function. + * See [Augment auto-cli for hiding/modifying cli syntax #156](https://github.com/clicon/clixon/issues/156) and [hiding auto-generated CLI entries #153](https://github.com/clicon/clixon/issues/153) +* New restconf configuration model: `clixon-restconf.yang` * The new restconf config, including addresses, authentication type, is set either in clixon-config local config or in backend datastore (ie running) * This only applies to the evhtp restconf daemon, not fcgi/nginx, where the nginx config is used. * The RESTCONF clixon-config options are obsolete * Thanks to Dave Cornejo for the idea -* Initial NBMA functionality (thanks: @benavrhm): "ds" resource ### API changes on existing protocol/config features Users may have to change how they access the system -* Error-type changed from protocol to application for data-not-unique netconf/restconf errors * New clixon-lib@2020-12-08.yang revision * Added: autocli-op extension (see new features) * Added: rpc process-control for process/daemon management * New clixon-config@2020-11-03.yang revision - * Added CLICON_BACKEND_RESTCONF_PROCESS - * Copied to clixon-restconf.yang and marked as obsolete: - - CLICON_RESTCONF_IPV4_ADDR - - CLICON_RESTCONF_IPV6_ADDR - - CLICON_RESTCONF_HTTP_PORT - - CLICON_RESTCONF_HTTPS_PORT - - CLICON_SSL_SERVER_CERT - - CLICON_SSL_SERVER_KEY - - CLICON_SSL_CA_CERT - * Removed obsolete option CLICON_TRANSACTION_MOD"; + * Added `CLICON_BACKEND_RESTCONF_PROCESS` + * Moved to clixon-restconf.yang, still remains but marked as obsolete: + - `CLICON_RESTCONF_IPV4_ADDR` + - `CLICON_RESTCONF_IPV6_ADDR` + - `CLICON_RESTCONF_HTTP_PORT` + - `CLICON_RESTCONF_HTTPS_PORT` + - `CLICON_SSL_SERVER_CERT` + - `CLICON_SSL_SERVER_KEY` + - `CLICON_SSL_CA_CERT` + * Removed obsolete option 'CLICON_TRANSACTION_MOD`; ### C/CLI-API changes on existing features Developers may need to change their code -* Auto-cli changed singature of `yang2cli()`. -* Added by-ref parameter to `ys_cv_validate()` returning which sub-yang spec was validated in a union. +* Auto-cli changed signature of `yang2cli()`. +* Added by-ref parameter to `ys_cv_validate()` returning sub-yang spec was validated in a union. * Changed first parameter from `int fd` to `FILE *f` in the following functions: - * clixon_xml_parse_file(), clixon_json_parse_file(), yang_parse_file() - * See [Bytewise read() of files is slow #146](https://github.com/clicon/clixon/issues/146) + * `clixon_xml_parse_file()`, `clixon_json_parse_file()`, `yang_parse_file()` ### Minor changes -* Added new revision of main example yang: `clixon-example@2020-12-01.yang` +* Initial NBMA functionality (thanks: @benavrhm): "ds" resource * Support for building static lib: `LINKAGE=static configure` + * One usecase is coverage and fuzzing * Change comment character to be active anywhere to beginning of _word_ only. + * ' # This is a comment', but ' This# is not a comment' * See [Change CLIgen comments](https://github.com/clicon/cligen/issues/55) * Improved performance of parsing files as described in [Bytewise read() of files is slow #146](https://github.com/clicon/clixon/issues/146), thanks: @hjelmeland -* Added new backend plugin: ca_pre-demon called if backend is daemonized just prior to forking. -* Added XPATH functions `position` +* Added new backend plugin: `ca_pre-demon` when backend is daemonized just prior to forking. +* Added XPATH function `position` +* Added new revision of main example yang: `clixon-example@2020-12-01.yang` ### Corrected Bugs diff --git a/apps/backend/backend_client.c b/apps/backend/backend_client.c index f634167b..9cef1b8f 100644 --- a/apps/backend/backend_client.c +++ b/apps/backend/backend_client.c @@ -1873,7 +1873,7 @@ from_client(int s, struct clicon_msg *msg = NULL; struct client_entry *ce = (struct client_entry *)arg; clicon_handle h = ce->ce_handle; - int eof; + int eof = 0; clicon_debug(1, "%s", __FUNCTION__); // assert(s == ce->ce_s); diff --git a/lib/src/clixon_options.c b/lib/src/clixon_options.c index c1b2f15d..12898722 100644 --- a/lib/src/clixon_options.c +++ b/lib/src/clixon_options.c @@ -805,8 +805,10 @@ clicon_sock_family(clicon_handle h) return AF_INET; else if (strcmp(s, "IPv6")==0) return AF_INET6; + else if (strcmp(s, "UNIX")==0) + return AF_UNIX; else - return AF_UNIX; /* default */ + return -1; } /*! Get port for backend socket in case of AF_INET or AF_INET6 diff --git a/test/test_perf_state.sh b/test/test_perf_state.sh index 8fce648d..2f9ecc64 100755 --- a/test/test_perf_state.sh +++ b/test/test_perf_state.sh @@ -186,6 +186,9 @@ $TIMEFN curl $CURLOPTS -X GET $RCPROTO://localhost/restconf/data/example:interfa new "cli get large config" $TIMEFN $clixon_cli -1f $cfg show state xml interfaces a foo b 2>&1 | awk '/real/ {print $2}' +# mem test needs sleep here +sleep $DEMSLEEP + if [ $RC -ne 0 ]; then new "Kill restconf daemon" stop_restconf diff --git a/yang/clixon/clixon-config@2020-11-03.yang b/yang/clixon/clixon-config@2020-11-03.yang index f230a836..75dd0f11 100644 --- a/yang/clixon/clixon-config@2020-11-03.yang +++ b/yang/clixon/clixon-config@2020-11-03.yang @@ -280,6 +280,17 @@ module clixon-config { } } } + typedef socket_address_family { + description "Address family for internal socket"; + type enumeration{ + enum UNIX { + description "Unix domain socket"; + } + enum IPv4 { + description "IPv4"; + } + } + } container clixon-config { container restconf { @@ -656,15 +667,15 @@ module clixon-config { from a spec, such as in the autocli."; } leaf CLICON_SOCK_FAMILY { - type string; - default "UNIX"; + type socket_address_family; + default UNIX; description - "Address family for communicating with clixon_backend - (UNIX|IPv4). IPv6 not yet implemented. + "Address family for communicating with clixon_backend with one of: + Note IPv6 not implemented. Note that UNIX socket makes credential check as follows: (1) client needs rw access to the socket (2) NACM credentials can be checked according to CLICON_NACM_CREDENTIALS - Warning: IPv4 and IPv6 sockets have no credential mechanism. + Warning: Only UNIX (not IPv4) sockets have credential mechanism. "; } leaf CLICON_SOCK { @@ -717,10 +728,8 @@ module clixon-config { type boolean; default false; description - "If set: - - enable process-control of restconf daemon, ie start/stop restconf - daemon internally using fork/exec. - Set to false if you start the restconf daemon by other means."; + "If set, enable process-control of restconf daemon, ie start/stop restconf daemon internally using fork/exec. + Disable if you start the restconf daemon by other means."; } leaf CLICON_AUTOCOMMIT { type int32;