Commit graph

772 commits

Author SHA1 Message Date
Olof hagsand
19fb063f82 Support for building static lib: 2020-11-29 17:00:35 +01:00
Olof hagsand
542c0495b3 autocli sub fixes 2020-11-28 18:17:32 +01:00
Olof hagsand
75f85e0253 revert yang2cli sub code, use existing yang2cli solution 2020-11-27 15:31:27 +01:00
Olof hagsand
dda3244252 * Auto-cli changed singature of yang2cli()
* Auto-cli: create generated CLI for sub-parts of a YANG spec
2020-11-26 17:32:09 +01:00
Olof hagsand
ae8e287dd9 test / restconf /vagrant fixes 2020-11-21 16:10:38 +01:00
Olof hagsand
6eb18da5e9 * Multi-socket feature (eg IPv4/IPv6 http/https) to restconf evhtp
* Added by-ref parameter to `ys_cv_validate()` returning which sub-yang spec was validated in a union.
2020-11-15 12:34:40 +01:00
Olof hagsand
c31b1c471b * 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)
2020-11-04 22:21:42 +01:00
Olof hagsand
7a0838da3a * Restconf configuration has a new configure model: clixon-restconf.yang enabling restconf daemon configuration from datastore instead of from config file. 2020-11-03 21:26:34 +01:00
Olof hagsand
5c5e45d10a Added new backend plugin: ca_pre-demon called if backend is daemonized just prior to forking. 2020-10-31 17:08:59 +01:00
Olof hagsand
1df420255e Fixed [Clixon backend generates wrong XML on empty string value #144](https://github.com/clicon/clixon/issues/144) 2020-10-28 14:28:34 +01:00
Olof hagsand
fab261cb53 * Added XPATH functions position 2020-10-27 09:40:45 +01:00
Olof hagsand
1614bcd19c Cleanup master for 4.9.0.PRE 2020-10-19 20:06:20 +02:00
Olof hagsand
e176330a74 * Removed string limit on cli prompt and cli mode name 2020-10-18 16:24:11 +02:00
Olof hagsand
a77cd27abb * Fixed: [namespace prefix nc is not supported](https://github.com/clicon/clixon/issues/143)
* Added more sanity checks on incoming top-level rpc and hello messages, including verifying top-level namespace
2020-10-17 18:04:46 +02:00
Olof hagsand
46bee9e358 Crash seen with startup mode as running with the XML_DB format being set to JSON. [clixon : 4.7.0] #138 2020-10-17 10:01:04 +02:00
Olof hagsand
3d1ac2692d Fixed: Performance enhancement of unique list check (of duplicate keys) 2020-10-16 12:48:51 +02:00
Olof hagsand
0b3391836f * Fixed: Validate/commit error with false positive yang choice changes detected in validation found in ietf-ipfix-psamp.yang. 2020-10-15 21:35:14 +02:00
Olof hagsand
2d56c9674a * New YANG generated auto-cli feature with syntax modes
* The existing autocli does not support modes, complete paths must be given, eg: `set a b c d 42`.
  * In the new auto-cli, automatic modes are present at each YANG syntax node level, eg the above can be given as: `edit a b c; set d 4; top`
  * The existing CLI API remains, the new API is as follows: `cli_auto_edit()`, `cli_auto_up()`, `cli_auto_top()`, `cli_auto_show()`, `cli_auto_set()`, `cli_auto_merge()`, `cli_auto_create()`, `cli_auto_del()`.
  * See `test/test_cli_auto.sh` for an example of the new API, and `apps/cli/cli_auto.c` for the source code of the new callback API.
  * Documentation will be appear and full integration with the main example.
* Added inline state field to clixon-example.yang
* Added new clicon_data_cvec_*() API for generic cvec structs
2020-10-14 10:54:10 +02:00
Olof hagsand
469cbe0d64 Fixed: Accepted added subtrees containing lists with duplicate keys 2020-10-08 15:15:22 +02:00
Olof hagsand
8ae647c32b * More explanatory validation error messages for when and augments error messages.
* Example: error-message: `Mandatory variable` -> `Mandatory variable of edit-config in module ietf-netconf`.
2020-10-07 20:57:49 +02:00
Olof hagsand
6f2c4a076d * Configuration directory
* A new configuration option `CLICON_CONFIGDIR` has been added for loading of extra config files
  * If not given, only the main configfile is loaded.
  * If given, and if the directory exists, the files in this directory will be loaded alphabetically AFTER the main config file in the following way:
    * leaf values are overwritten
    * leaf-list values are appended
  * You can override file setting with `-E <dir>` command-line option.
* New clixon-config@2020-10-01.yang revision
  * Added option for configuration directory: `CLICON_CONFIGDIR`
2020-10-01 11:04:25 +02:00
Olof hagsand
b3545871c0 * Added stricter check on schema-node identifier checking, such as for augments.
* These checks are now made at YANG loading time
2020-09-29 20:53:24 +02:00
Olof hagsand
9984cfa1c8 Fixed: [default state data returned with get-config](https://github.com/clicon/clixon/issues/140)
* Generalized default code for both config and state
2020-09-27 17:14:28 +02:00
Olof hagsand
da54dae396 Added sanity check that a yang module name matches the filename 2020-09-25 13:39:13 +02:00
Olof hagsand
21ac47915b More XPath function support
* `count`, `name`, `contains`, `not`, as defined in [xpath 1.0](https://www.w3.org/TR/xpath-10)
  * `deref`, `derived-from` and `derived-from-or-self` from RFC7950 Section 10.
    * in particular in augment/when statements
  * Improved error handling
    * Verification of XPath functions is done at startup when yang modules are loaded, not when XPaths are evaluated.
    * Separation of "not found" and "not implemented" XPath functions
    * Both give a fatal error (backend does not start).
2020-09-25 11:52:06 +02:00
Olof hagsand
c616aa1569 Added support for XPATH functions:
* `contains`,
  * `derived-from` and `derived-from-or-self`
    * in particular in augment/when statements as shown in eg RFC 7950.
2020-09-22 22:40:42 +02:00
Olof hagsand
41ef682bdd 4.8.0.PRE 2020-09-15 12:12:26 +02:00
Olof hagsand
bf102ca575 4.7.0 2020-09-14 11:48:51 +02:00
Olof hagsand
1d333e39d1 4.7 preparations 2020-09-14 09:21:54 +02:00
Olof hagsand
6c22935463 code comments 2020-09-12 13:04:59 +02:00
Olof hagsand
27bb0a1d2b * Fixed: Restconf failed put/post could leave residue in candidate causing errors in next put/post
* Added -v option for backend plugins to generate validation error
2020-09-10 18:09:17 +02:00
Olof hagsand
a61bdffbab evhtp mem leak, debug 1->2 2020-09-10 18:06:44 +02:00
Olof hagsand
8f8b49331f Debug messages
* Added cli command debug printf on debug level 1
  * Moved all parse debug printfs to level 3
2020-09-09 11:12:14 +02:00
Olof hagsand
5b5dce7e39 Fixed: [clixon_netconf does not respond to hello #136](https://github.com/clicon/clixon/issues/136)
* The error showed only when CLICON_MODULE_LIBRARY_RFC7895 was disabled.
2020-09-08 15:59:12 +02:00
Olof hagsand
1ef3c0db7a Fixed: Do not check min/max constraints on state data in config validate code 2020-09-08 13:25:28 +02:00
Olof hagsand
a61da8715d Fixed: [min-elements attribute prevents from deleting list entries #133](https://github.com/clicon/clixon/issues/133) 2020-09-08 10:47:43 +02:00
Olof hagsand
5ee6283526 Fixed: [xmldb_get0 returns invalid candidate on startup transaction callbacks #126](https://github.com/clicon/clixon/issues/126). Always clear candidate-db before db initialization. 2020-09-07 15:09:19 +02:00
Olof hagsand
ee057d5244 * Added -r command-line option to restconf daemon to NOT lower privileges to wwwuser if started from root. 2020-09-04 16:25:49 +02:00
Olof hagsand
f524a89b2d * Fixed: YANG uses statements in sub-modules did not search for grouping statements in other submodules of the module it belongs to. 2020-09-04 16:23:18 +02:00
Olof hagsand
b8955c81d8 * Changed CLI help strings behaviour on query (?) for long and multi-line help strings.
* If multiple strings (eg "\n" in text), indent before each new line
  * Primarily for auto-cli where long help strings are generated from YANG descriptions, but applies as well for manual long/multi-line help strings
  * New config option: `CLICON_CLI_HELPSTRING_TRUNCATE`: Truncate help string on right margin mode
  * New config option: `CLICON_CLI_HELPSTRING_LINES`: Limit of number of help strings to show
2020-09-04 13:15:53 +02:00
Olof hagsand
81fc7f742b * Netconf as default namespace has been disabled by default.
* Only requests on the form: `<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><edit-config>...` will be accepted
  * All replies will be on the form: `<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">...`
  * Requests such as: `<rpc><edit-config>...` will not  be accepted.
  * You can revert this behaviour (to clixon pre-4.6 behaviour) by enabling `CLICON_NAMESPACE_NETCONF_DEFAULT`
  * This API change is a consequence of: [copy-config's RPC cxobj parameter does not contain namespace #131](https://github.com/clicon/clixon/issues/131)
2020-09-02 15:44:10 +02:00
Olof hagsand
a01fe04613 Fixed: [CLI crash if error-info is empty #134](https://github.com/clicon/clixon/issues/134) 2020-09-01 16:19:58 +02:00
Olof hagsand
41ac192362 Fixed: [Cannot create or modify NACM data node access rule with path using JSON encoding #129](https://github.com/clicon/clixon/issues/129). The evaluation of NACM datanode rule path is assumed to be canonical namespace and cannot be overruled with xmlns rules. 2020-08-30 17:03:49 +02:00
Olof hagsand
558abb1f9b Corrected error message for list min/max-value to comply to RFC 7950: a proper path is now returned, peviously only the list symbol. it is also exposed in the CLI correctly.
* Example: `<error-path>/c/a1</error-path>`
2020-08-27 15:52:31 +02:00
Olof hagsand
96a8192cd2 Fixed: [Yang modules skipped if the name is a proper prefix of other module name](https://github.com/clicon/clixon/issues/130) 2020-08-27 11:55:42 +02:00
Olof hagsand
3e054fedc3 Fixed an error in global default values. Global default values were not written to datastore after startup, but AFTER an edit/commit. 2020-08-24 22:26:31 +02:00
Olof hagsand
6be4b18391 Fixed: [Type / Endianism problem in yang_parse_file #128](https://github.com/clicon/clixon/issues/128) 2020-08-21 13:33:38 +02:00
Olof hagsand
0e4df0e8fc Added options for Restconf evhtp setting default bind socket address and ports CLICON_RESTCONF_IPV4_ADDR, CLICON_RESTCONF_IPV6_ADDR, CLICON_RESTCONF_HTTP_PORT, CLICON_RESTCONF_HTTPS_PORT 2020-08-21 13:13:20 +02:00
Olof hagsand
25f67d1eb9 Fixed: [(CLI) the description of a used grouping is shown instead of the encapsulating container #124](https://github.com/clicon/clixon/issues/124) 2020-08-19 15:55:55 +02:00
Olof hagsand
adc6edf545 * New clixon-config@2020-08-17.yang revision
* Added `CLICON_RESTCONF_ADDRESS` for setting evhtp bind address
2020-08-17 14:48:40 +02:00