Commit graph

838 commits

Author SHA1 Message Date
Olof hagsand
2291275fae Fixed: [Restconf PATCH method request failed on item defined by submodule #306](https://github.com/clicon/clixon/issues/306) 2022-02-23 11:20:52 +01:00
Olof hagsand
97316e0bfa * Follow-up on [restconf GET json response does not encode top level node with namespace as per rfc #303](https://github.com/clicon/clixon/issues/303)
* Load/save JSON config file did not work
* Added rfc7951 parameter to `clixon_json_parse_string()` and `clixon_json_parse_file()`
  * If set, honor RFC 7951: JSON Encoding of Data Modeled with YANG, eg it requires module name prefixes
  * If not set, parse as regular JSON
* Test: added test_db.sh for datastore format tests
2022-02-22 14:28:01 +01:00
Olof hagsand
bf00fdf2c1 * Fixed: [restconf GET json response does not encode top level node with namespace as per rfc #303](https://github.com/clicon/clixon/issues/303) 2022-02-17 18:42:37 +01:00
Olof hagsand
1324c914dc * Fixed: [statement: require-instance should be true if not present according to rfc7950 Sec 9.9.3](https://github.com/clicon/clixon/issues/302) 2022-02-17 10:09:23 +01:00
Olof hagsand
78bdc4eaca Backend ignore of SIGPIPE. This occurs if client quits unexpectedly over the UNIX socket.
This is a timing issue but occurs more frequently in large RESTCONF messgaes.
2022-02-14 20:56:57 +01:00
Olof hagsand
6ae749c9dd * New clixon-config@2022-02-11.yang revision
* Added option: `CLICON_LOG_STRING_LIMIT`
2022-02-12 21:45:50 +01:00
Olof hagsand
dadf4a778a * HTTP/1 native parser as part of the RESTCONF client
* Fixed memory error in opendir/readdir in clicon_file_dirent
* Remove MAXPATH in parsers
* New string-del function
2022-02-08 16:59:08 +01:00
Olof hagsand
61e8841642 test: sleep typo, override YANG_INSTALLDIR in docker tests 2022-02-07 15:43:38 +01:00
Olof hagsand
4102ca8a46 * configure --with-wwwdir=<dir> is removed
* test:
  * new test_helloworld.sh smoketest added for testing basic functions
  * stripped restconf fcgi default config
  * added yang variable
2022-02-07 13:31:39 +01:00
Olof hagsand
b5ecd6d5fa Fixed: input RPC validation of choice (non-case) 2022-02-03 15:14:09 +01:00
Olof hagsand
bdc09851f0 * Command field of clixon-lib:process-control RPC reply used CDATA encoding but now uses regular XML encoding 2022-01-27 09:56:09 +01:00
Olof hagsand
504967864d - Fixed: More than one unknown/extension in combination with augment
of extension resulted in extension being skipped.
- print yang extension argument in yang-print functions.
2022-01-25 15:39:58 +01:00
Olof hagsand
fbeefd600e Clixon 5.6.0.PRE 2022-01-24 11:07:09 +01:00
Olof hagsand
fd2f9b549f Clixon 5.5.0 CHANGELOG and README update 2022-01-20 17:42:40 +01:00
Olof hagsand
6d955160ed Clixon 5.5.0 2022-01-20 15:18:46 +01:00
Olof hagsand
95f6fe8b1a * Fixed: Autocli YANG patterns including " were not properly escaped: \" 2022-01-19 14:52:32 +01:00
Olof hagsand
b164f02277 * Removed ifdef __GNUC__ around printf-like prototypes since both clang and gcc have format/printf macros defined 2022-01-18 16:05:50 +01:00
Olof hagsand
519fe1f576 * CLI-spec variable CLICON_PROMPT %W changed semantics due to long prompt
* From "Full Working edit path" to "Last element of working path"
  * New `%w` has "Full working path"
2022-01-18 13:34:20 +01:00
Olof hagsand
f922211212 * Changed autocli tree-labels using ac_ and act_ prefixes
* New automatic edit-mode design
   * Control which modes to use with `edit-mode-default`
     * Default is create edit-mode for all
   * New edit-mode tree: @datamodelmode
2022-01-18 12:17:47 +01:00
Olof hagsand
e0bcca5405 * New clixon-lib@2021-12-05.yang revision
* Extension `autocli-op` obsoleted and no longer supported
  * You need to change to use clixon-autocli `hide`and `hide-show` instead.
  * Translate as follows:
    * `cl:autocli-op hide` -> `autocli:hide`
    * `cl:autocli-op hide-database` -> `autocli:hide-show`
    * `cl:autocli-op hide-database-auto-completion` -> `autocli:hide; autocli:hide-show`
2022-01-12 22:19:17 +01:00
Olof hagsand
081e6871b3 * Renamed clixon-clispec.yang to clixon-autocli.yang
* First version of clixon-autocli.yang semantics
   * Default rules for module exclusion, list-keywords, completion, treeref-state
   * Specialized rules for compress and exclusion of modules
   * See [autocli documentation](https://clixon-docs.readthedocs.io/en/latest/cli.html#autocli)
* Obsoleted and moved autocli config options from clixon-config.yang to clixon-autocli.yang as follows:
   * `CLICON_CLI_GENMODEL`, use: `autocli/module-default=false` instead
      * Removed `clicon_cli_genmodel()`
   * `CLICON_CLI_GENMODEL_TYPE`, use `autocli/list-keyword-default` and compress rules instead)
      * Removed `clicon_cli_genmodel_type()`
   * `CLICON_CLI_GENMODEL_COMPLETION`, use `autocli/completion-default` instead
      * Removed `clicon_cli_genmodel_completion()`
   * `CLICON_CLI_AUTOCLI_EXCLUDE`, use `autocli/rule/operation=exclude` instead
   * `CLICON_CLI_MODEL_TREENAME`, use constant `AUTOCLI_TREENAME` instead
     * Removed `clicon_cli_model_treename()`
* New YANG functions: yang_single_child_type, yang_find_namespace_by_prefix, yang_str2key
* Changed return values of yang_find_prefix_by_namespace
* Merged `cli_cli2xml()` into `cli2xml()`
2022-01-07 12:50:07 +01:00
Olof hagsand
dec05e2cae Test modifications
- Remove dependency of IETF YANGs on most tests
- Remove dependnency of example/main in most tests, instead make local copy of example yang
2022-01-03 09:57:17 +01:00
Olof hagsand
50ac510803 * Fixed: Configure option CLICON_RESTCONF_PATH was marked as obsolete but was still used.
* `CLICON_RESTCONF_PATH` is now obsolete for sure
    * Instead if you use fgci/nginx:
      * Use `restconf/fcgi-socket`
      * Ensure `<CLICON_FEATURE>clixon-restconf:fcgi</CLICON_FEATURE>` is set
* Added default values to restconf-config and save fcgi-socket-path in memory
2022-01-01 11:52:18 +01:00
Olof hagsand
1808015cf6 Fixed: SEGV when starting FCGI restconf program
- Reverted removal of CLICON_RESTCONF_PATH since it was used there
Misc fixes: initialized variables, docs, removed obsolete --enable-optyang
2021-12-30 16:35:54 +01:00
Olof hagsand
3117332ddd Changes in clixon-config.yang:
* Removed obsolete options:
    * `CLICON_YANG_LIST_CHECK`
    * `CLICON_RESTCONF_PATH` (moved to restconf/fcgi-path)
  * Fixed: Configure option `CLICON_RESTCONF_PRETTY` was marked as obsolete but was still used.
    * `CLICON_RESTCONF_PRETTY` is now obsolete for sure
    * Instead restconf/pretty is used with API function restconf_pretty_get()
2021-12-28 11:44:19 +01:00
Olof hagsand
32930f4f6b * Added new YANG clixon-clispec.yang
* This yang replaces many autocli option
* New `clixon-config@2021-12-05.yang` revision
  * Imported (as a sub-spec):  clixon-clispec.yang
2021-12-19 22:58:24 +01:00
Olof hagsand
4fbad467df * Tests: use YANG_STANDARD_DIR from ./configure --with-yang-standard-dir=DIR instead of YANGMODELS from site.sh 2021-12-16 22:44:45 +01:00
Olof hagsand
f8f34e3571 * Replaced separate autocli trees with a single @basemodel tree by using filter labels
* Added lastkey argument to yang_key_match()
* Fixed segv in process-sigchld
* Added ietf-yang-library to CLICON_CLI_AUTOCLI_EXCLUDE default value
* Added yang_spec_print() function
2021-12-16 20:23:09 +01:00
Olof hagsand
3c8c33c385 * Ensure auto-cli can be run with CLICON_CLI_VARONLY=1
* Strip constants in cli_dbxml
2021-12-07 20:09:25 +01:00
Olof hagsand
8c5a5a0fb3 * New docker build (preliminary) for a development container
* Load clixon-clispec on start
2021-12-07 20:07:22 +01:00
Olof hagsand
854958b5e8 rpc_callback_call(): Check if nrp parameter is NULL to avoid SEGV 2021-12-05 12:36:36 +01:00
Olof hagsand
478911d0f5 * Changed typo configure --with-yang-standard-installdir to `configure --with-yang-standard-dir
* Updated command-line usage of cli,netconf,backend apps in sync with clixon-docs user manual
* Documented differences between protocol stubs for external vs internal netconf
2021-12-05 12:17:11 +01:00
Olof hagsand
b67fae4d61 Started Clixon 5.5.0.PRE and removed optional YANGs (already disabled in 5.4.0) 2021-12-05 12:03:10 +01:00
Olof hagsand
01002ab14a vagrant script updates 2021-11-30 16:00:41 +01:00
Olof hagsand
6ab4e9dfdf Clixon 5.4.0 release 2021-11-30 08:57:18 +01:00
Olof hagsand
716d0cb15f * Preparations for Clixon 5.4 release, docs, readme:s, etc 2021-11-29 13:52:52 +01:00
Olof hagsand
5388aace12 Refactoring for better performance of large auto-cli specs
* Fixed: [very slow execution of load_set_file #288](https://github.com/clicon/clixon/issues/288)
* New `clixon-lib@2021-11-11.yang` revision
  * Modified option: RPC stats extended with YANG stats
* Modified `clixon-config@2021-11-11.yang` revision
  * Added option:
    * CLICON_PLUGIN_CALLBACK_CHECK
    * Enable to make plugin context check before and after all callbacks.
* Added statistics for YANG: number of objects and memory used
* Use the treeref no-copy option of CLIgen to reduce memory
* Refactored cli-generation/autocli-start code
* Refactored cligen glue functions to use cligen_eval directly (remove clicon_eval,clixon_cligen_eval)
2021-11-25 12:04:05 +01:00
Olof hagsand
0626de9431 * RPC replies now verified with YANG
* Stricter checking of outgoing RPC replies from server
  * See [RPC output not verified by yang](https://github.com/clicon/clixon/issues/283)
  * This lead to some corrections of RPC replies in system code
2021-11-16 22:12:14 +01:00
Olof hagsand
acc9c083a4 * Added sorting of YANG statements
* Some openconfig specs seem to have use/when before a "config" which it depends on. This leads to XML encoding being in the "wrong order.
  * When parsing, clixon now sorts container/list statements so that sub-statements with WHEN are put last.
  * See [Statements given in "load set" are order dependent](https://github.com/clicon/clixon/issues/287)
* Fixed: [Statements given in "load set" are order dependent](https://github.com/clicon/clixon/issues/287)
2021-11-16 14:40:23 +01:00
Olof hagsand
7d9d0017a9 Fixed an issue with openconfig path compression: the compression was always done, not exclusively
for openconfig.
See [OpenConfig path compression](https://github.com/clicon/clixon/pull/276)
2021-11-14 17:54:58 +01:00
Olof hagsand
2bb5c23856 * [RPC get-conf method returned some content not specified by select filter](https://github.com/clicon/clixon/issues/281)
* Bug introduced when upgrading of list pagination
2021-11-13 22:38:23 +01:00
Olof hagsand
81da71ffd7 * XML to JSON CDATA translation is NOT stripped
* Example, assume XML: `<s><![CDATA[  z > x  & x < y ]]></s>`
  * Previous bevavior:
    * JSON: {"s":"  z > x  & x < y "}
  * New behavior:
    * JSON: `{"s":"<![CDATA[  z > x  & x < y ]]>"}`
  * To keep old behavior, set `JSON_CDATA_STRIP` in clixon_custom.h
2021-11-13 17:11:00 +01:00
Olof hagsand
51316d5d61 Fixed: [type leafref in type union ineffective](https://github.com/clicon/clixon/issues/277)
* Leafrefs and identityrefs in unions were not validated correctly
2021-11-12 10:52:29 +01:00
Olof hagsand
fd29559b25 * New clixon-config@2021-11-11.yang revision
* Modified options:
    * CLICON_CLI_GENMODEL_TYPE: added OC_COMPRESS enum
    * CLICON_YANG_DIR: recursive search
2021-11-11 15:00:12 +01:00
Olof hagsand
a4b4dc97ce Pagination updated
* Pagination is updated to new drafts:
  * [https://datatracker.ietf.org/doc/html/draft-wwlh-netconf-list-pagination-00>]
  * [https://datatracker.ietf.org/doc/html/draft-wwlh-netconf-list-pagination-nc-02]
  * [https://datatracker.ietf.org/doc/html/draft-wwlh-netconf-list-pagination-rc-02]
  * See also updated [https://clixon-docs.readthedocs.io/en/latest/pagination.html]
* Added IETF RFC:s (included by pagination):
  * ietf-netconf-nmda@2019-01-07.yang
  * ietf-origin@2018-02-14.yang
  * ietf-netconf-with-defaults@2011-06-01.yang
* Dropped pcvec parameter to many restconf api functions
2021-11-10 18:35:24 +01:00
Olof hagsand
baa6e821a8 Fixed [yang in CLICON_YANG_MAIN_DIR can't import module's in CLICON_YANG_DIR recursively](https://github.com/clicon/clixon/issues/286)
Which was a PR for [Recursive search CLIXON_YANG_DIR](https://github.com/clicon/clixon/issues/284)
2021-11-10 18:32:17 +01:00
Olof hagsand
5297ebe3cb Fixed: [cl:autocli-op hide has no effect in yang submodule](https://github.com/clicon/clixon/issues/282) 2021-11-04 16:25:25 +01:00
Olof hagsand
46647089ad * Use new cligen cvv options.
* NOTE cannot use old CLIgen API
2021-10-31 15:48:01 +01:00
Olof hagsand
5d29d8aff0 Plugin context check: check termios settings 2021-10-21 15:44:04 +02:00
Olof hagsand
7d7024d114 Plugin-context: moved status field from struct to function retval 2021-10-20 12:30:09 +02:00