Commit graph

1508 commits

Author SHA1 Message Date
Olof hagsand
f1ceec689a Refactoring search code using clixon_xvec data structures 2020-02-28 18:08:10 +01:00
Olof hagsand
bac2089a04 unsorted state data test change 2020-02-28 14:52:51 +01:00
Olof hagsand
760cdda49a Fixed: Search function checked only own not for config false statement, should have checked all ancestors. 2020-02-28 14:05:56 +01:00
Olof hagsand
451adfaf1f * Explicit search indexes
* Added object-based `clixon_xvec` as a new programming construct for contiguous XML object vectors.
2020-02-28 12:16:16 +01:00
Olof hagsand
94c7be42b6 rpc-error error tests 2020-02-27 21:16:12 +01:00
Olof hagsand
86e251f30b * Fixed: Some restconf errors were wrongly formatted such as: {"ietf-restconf:errors":{"error":{"rpc-error": . There should be no "rpc-error" level. 2020-02-26 21:33:31 +01:00
Olof hagsand
a71c256898 * New clixon-config@2020-02-22.yang revision
* C-code changes:
  - Replaced stream uri:s w constants
  - Replaced large debug print code with single clicon_log_xml
  - Restconf put and post handling refactored using new parse API
2020-02-24 15:25:06 +01:00
Olof hagsand
de3853a126 readnme buttons 2020-02-23 17:17:28 +01:00
Olof hagsand
e16ef2daff Logo 2020-02-23 17:12:59 +01:00
Olof hagsand
83b22e7c2b 2020 copyright statement 2020-02-22 15:54:15 +01:00
Olof hagsand
3c6a521a80 Merge branch 'master' of https://github.com/clicon/clixon 2020-02-22 11:15:55 +01:00
Olof hagsand
3b26b22391 internal type/var/prefix name changes for yacc parsing 2020-02-22 11:15:51 +01:00
Olof Hagsand
644cf96f44 utc time in stream test 2020-02-22 00:06:40 -10:00
Olof hagsand
e1bccfa2a7 Sorting error cornercase with invalid two choices, and also sort attributes first. 2020-02-21 16:40:35 +01:00
Olof hagsand
b31297cb21 memory leaks 2020-02-21 10:23:42 +01:00
Olof hagsand
51a28f9bbf changelog toc. disable searchindex test 2020-02-20 17:37:28 +01:00
Olof hagsand
2eae2b6000 extension search index 2020-02-20 15:08:25 +01:00
Olof hagsand
c43ee9e1ef latest commit, table-of-content, etc 2020-02-20 14:18:15 +01:00
Olof hagsand
5918efa7c1 Clixon 4.3.3 2020-02-20 14:06:10 +01:00
Olof hagsand
9fa5e216c4 * New "general-purpose" datastore upgrade callback added which i called once on startup, intended for lo
w-level general upgrades and as a complement to module-specific upgrade.
  * Called on startup after initial XML parsing, but before module-specific upgrades
  * Enabled by definign the `.ca_datastore_upgrade`
  * [General-purpose upgrade documentation](https://clixon-docs.readthedocs.io/en/latest/backend.html#ge
neral-purpose)
* JSON parse error messages change from ` on line x: syntax error,..` to `json_parse: line x: syntax err
or`
* Unknown-element error message is more descriptive, eg from `namespace is: urn:example:clixon` to: `Fai
led to find YANG spec of XML node: x with parent: xp in namespace urn:example:clixon`.
* C-API parse and validation API more capable
  * `xml_spec_populate` family of functions extended with three-value return values
    * -1: error, 0: parse OK, 1: parse and YANG binding OK.
  * `xml_parse` and `json_parse` API changes
    * Three value returns: -1: error, 0: parse OK, 1: parse and YANG binding OK.
    * Extended `xml_parse_file2` and `xml_parse_string2` extended API functions with all options available.
      * New concept called `yang_bind` that defines how XML symbols are bound to YANG after parsing
    * Existing API same except `xml_parse_file` `endtag` argument moved to `xml_parse_file2`
* C-API: Added instrumentation: `xml_size` and `xml_stats_get`.
* Fixed: Enabling modstate (CLICON_XMLDB_MODSTATE), changing a revision on a yang, and restarting made the backend daemon exit at start (thanks Matt)
  * Also: ensure to load `ietf-yang-library.yang ` if CLICON_XMLDB_MODSTATE is set
2020-02-20 14:00:01 +01:00
Olof hagsand
4338b68167 Due to increased memory usage in internal XML trees, the [use cbuf for xml value code](9575d10887) is reversed. 2020-02-19 16:48:18 +01:00
Olof hagsand
d665992f7c Uniform time cmd in performance tests 2020-02-16 10:23:03 +01:00
Olof hagsand
d78a6401c3 4.3.2 CHANGELOG updated
VALIDATE_STATE_XML disabled
2020-02-15 14:45:01 +01:00
Olof hagsand
7fd1751302 Merge branch 'datastore-repair' into release-4.3 2020-02-15 14:31:38 +01:00
Olof hagsand
5dd3243f66 Known Issues:
* If you retrieve state _and_ config data using RESTCONF or NETCONF `get`, a severe performance penalty occurs if you have large lists (eg ACLs). Workaround: disable `VALIDATE_STATE_XML` in `include/clixon_custom.h`.
2020-02-14 15:16:17 +01:00
Olof hagsand
fa257ebb88 datastore upgrade bugs 2020-02-12 17:37:23 +01:00
Olof hagsand
cdd22bc33d example typo 2020-02-12 17:01:25 +01:00
Olof hagsand
b6812793f9 General-purpose upgrade 2020-02-12 16:40:52 +01:00
Olof hagsand
3748eefb8e datastore repair test branch 2020-02-11 20:17:15 +01:00
Olof hagsand
76a4d31c4b Fixed: Enabling modstate (CLICON_XMLDB_MODSTATE), changing a revision on a yang, and restarting made the backend daemon exit at start (thanks Matt).
* Also: ensure to load `ietf-yang-library.yang ` if CLICON_XMLDB_MODSTATE is set
2020-02-10 20:23:48 +01:00
Olof hagsand
5831c053fa clixon_util_path did not sort XML properly 2020-02-08 17:00:47 +01:00
Olof hagsand
a674af6f2c Cleaning up code for xml insignificant whitespace removal
Experimenal explicit index search code
2020-02-07 14:59:57 +01:00
Olof hagsand
61e03690ca Fixed: Pretty-printed XML using prefixes not parsed correctly.
* eg `<a:x>   <y/></a:x>` could lead to errors, wheras (`<x>   <y/></x>`) works fine.
2020-02-06 18:02:14 +01:00
Olof hagsand
a2b1674708 XML namespace merge bug fixed. Example: two xmlns attributes could both survive a merge whereas one should replace the other. 2020-02-05 19:49:23 +01:00
Olof hagsand
3d5c2cc678 * Session-id CLI functionality delayed: "lazy evaluation"
* From a cli perspective this is a revert to 4.1 behaviour, where the cli does not immediately exit on start if the backend is not running, but with the new session-id function
2020-02-05 16:09:26 +01:00
Olof hagsand
c7d6f69a85 * Session-id CLI functionality delayed: "lazy evaluation"
* From a cli perspective this is a revert to 4.1 behaviour, where the cli does not immediately exit on start if the backend is not running, but with the new session-id function
2020-02-05 15:37:25 +01:00
Olof hagsand
39e7f387f8 XML namespace merge bug fixed. Example: two xmlns attributes could both survive a merge whereas one should replace the other. 2020-02-05 12:08:20 +01:00
Olof hagsand
e68753655b Obsoleted and removed XMLDB format "tree". This function did not work. Only xml and json allowed. 2020-02-02 19:15:39 +01:00
Olof hagsand
51e17671a8 cicd tests 2020-02-02 18:46:18 +01:00
Olof hagsand
7350ec1624 warnings in travis 2020-02-02 17:07:46 +01:00
Olof hagsand
7bcd6aed08 added instance_id parse files 2020-02-02 16:05:10 +01:00
Olof hagsand
5fc9fa0b8d typos 2020-02-02 15:59:26 +01:00
Olof hagsand
19e21be0bc Very large commit for upcoming 4.4 release
Major New features

* New and updated search functions using xpath, api-path and instance-id
  * New search functions using api-path and instance_id:
    * C search functions: `clixon_find_instance_id()` and `clixon_find_api_path()`
  * Binary search optimization in lists for indexed leafs in all three formats.
    * This improves search performance to O(logN) which is drastical improvements for large lists.
  * You can also register explicit indexes for making binary search (not only list keys)
  * For more info, see docs at [paths](https://clixon-docs.readthedocs.io/en/latest/paths.html) and
[search](https://clixon-docs.readthedocs.io/en/latest/xml.html#searching-in-xml)

API changes on existing features (you may need to change your code)
* On failed validation of leafrefs, error message changed from: `No such leaf` to `No leaf <name> matching path <path>`.
* CLI Error message (clicon_rpc_generate_error()) changed when backend returns netconf error to be more descriptive:
  * Original: `Config error: Validate failed. Edit and try again or discard changes: Invalid argument`
  * New (example): `Netconf error: application operation-failed Identityref validation failed, undefined not derived from acl-base . Validate failed. Edit and try again or discard changes"

Minor changes

* Test framework
  * Added `-- -S <file>` command-line to main example to be able to return any state to main example.
  * Added `test/cicd` test scripts for running on a set of other hosts
* C-code restructuring
  * clixon_yang.c partitioned and moved code into clixon_yang_parse_lib.c and clixon_yang_module.c and move back some code from clixon_yang_type.c.
    * partly to reduce size, but most important to limit code that accesses internal yang structures, only clixon_yang.c does this now.
2020-02-02 15:52:30 +01:00
Olof hagsand
ba2d18417a 4.3.1 release 2020-02-02 08:50:44 +01:00
Olof hagsand
a58f1872ad Restructure of get state/config code to enable all combinations of filtering config/state for both <get> and <get-config> 2020-02-01 20:16:11 +01:00
Olof hagsand
b7f1d72c28 read whole running config when reading state data 2020-01-31 16:13:50 +01:00
Olof hagsand
20d28b4796 Compile option VALIDATE_STATE_XML introduced in include/custom.h to control whether code for state data validation is compiled or not. 2020-01-29 21:56:50 +01:00
Olof hagsand
f5209b1fab * Fixed: Validation of user state data led to wrong validation, if state relied on config data, eg leafref/must/when etc.
* Fixed: No revision in yang module led to errors in validation of state data
2020-01-27 22:11:35 +01:00
Olof hagsand
64f73771d9 Fixed: Leafref validation did not cover case of when the "path" statement is declared within a typedef, only if it was declared in the data part directly under leaf. 2020-01-26 22:16:12 +01:00
Olof hagsand
6384fb89f1 Fixed: Yang xpath statements containing prefixes stopped working due to namespace context updates 2020-01-23 22:53:19 +01:00