Commit graph

1844 commits

Author SHA1 Message Date
Olof hagsand
ee5c0a08d5 - yang sorting did not use "stable" qsort: fixed by using vector index 2021-11-26 15:17:23 +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
b91ce762d5 * Performance improvement
* Added ancestor config cache indicating wether the node or an ancestor is config false or true
  * Improved yang cardinality lookup
* Added yang_init(), called from all apps using yang
2021-11-18 08:37:54 +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
cfe1f2936e stronger defaults test 2021-11-16 15:29:00 +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
a64464beda -* xml_dump debug function 2021-11-15 13:11:56 +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
7976c11f11 Add restart plugin library code for netconf and cli 2021-11-13 17:03:12 +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
2dcc14a0db Added error handling in yang_path_arg triggered by no filter in get paginated
Fixed cornercase of restconf error return when no body
Fixed cornercase when exactly / given as xpath
Better error message when YANG not found: added which YANG file imports it
2021-11-10 18:35:24 +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
52e63a14d0
Merge pull request #285 from krihal/feature_recursive_search
Fix for issue #284, do recursive lookup when reading YANG files from directory
2021-11-09 10:07:44 +01:00
Kristofer Hallin
02a5d97377
Only test recursive dirs for OpenConfig tests. 2021-11-09 09:23:43 +01:00
Kristofer Hallin
9ce20ea449
Resolved conflict. 2021-11-09 08:53:47 +01:00
Kristofer Hallin
057abe56e0
Fix for issue #284, do recursive lookup when reading YANG files from directory. 2021-11-08 20:09:19 +01:00
Olof hagsand
a1fe080111 CLIgen mem leak, test augment 2021-11-05 14:43:28 +01:00
Olof Hagsand
9daa214b3e
Merge pull request #279 from dus7eh/fix_array_parsing
Append prefix when cloning json node
2021-11-05 14:32:14 +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
d335a72659 Use 5.3 cligen API 2021-10-31 16:36:29 +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
a52b92bd43 Added negative openconfig path compress test 2021-10-31 15:48:01 +01:00
Olof hagsand
39960cc205 fix: restore signal mask must not use 0 2021-10-31 15:48:01 +01:00
Olof hagsand
52744c9301 Revert "List pagination locking for state-data changes"
This reverts commit eea6d549f6.
2021-10-30 15:49:23 +02:00
Olof hagsand
eea6d549f6 List pagination locking for state-data changes
Changed semantics of locking: instead of relying of locking running-db,
an automatic lock bound to a session is maintained. When the session closes
the lock is released.
2021-10-28 14:49:33 +02:00
Damian E
c1bcef37a7 Append prefix before cloning 2021-10-26 22:13:04 +02:00
Olof Hagsand
197fc16e69
Merge pull request #276 from krihal/feature_openconfig_compress
Feature: OpenConfig path compression
2021-10-22 09:32:44 +02:00
Olof Hagsand
9d8d9ac042
Merge branch 'master' into feature_openconfig_compress 2021-10-22 09:23:48 +02:00
Kristofer Hallin
b29387ce1d
Changes as per review. 2021-10-21 22:01:04 +02:00
Olof hagsand
063e6d6faa Added "exist" parameter to yang_extension_value() 2021-10-21 21:45:14 +02:00
Olof hagsand
448aa4c994 include signal.h 2021-10-21 16:29:43 +02: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
Olof hagsand
c93348d8d5 Hide plugin check handler struct with a handler 2021-10-19 17:36:23 +02:00
Olof hagsand
764e9c628c Added checks of changed handlers or blocked signal after plugin function calls 2021-10-19 16:42:34 +02:00
Kristofer Hallin
4ac1f0bad0
Implementation of OpenConfig path compression. 2021-10-15 13:55:31 +02:00
Kristofer Hallin
2f56357adb
Added enum OC_COMPRESS to Clixon yang. 2021-10-15 13:54:44 +02:00
Kristofer Hallin
aeff754110
Added tests for OpenConfig compress. 2021-10-15 13:46:38 +02:00
Olof hagsand
a242cf47bd Pagination callback modifications: ensure xml is bound to yang, removed
code not used (eg remaining) and avoiding an extra xpath_vec call.
Moved debug prints from plugin-callback-one to plugin-callback-all
Fixed memory error in data-cvec access function
2021-10-14 14:06:01 +02:00
Olof hagsand
2bfb02de64 Typo: forgot clixon_util_dispatcher.c 2021-10-14 09:14:12 +02:00
Olof hagsand
93d1149925 Dispatcher test additions 2021-10-14 08:58:35 +02:00
Olof hagsand
d2d3454177 Dispatcher: modified key handling and added print function
also added dispatcher utility and test functions
2021-10-13 21:03:59 +02:00
Olof hagsand
e0ea85d6d5 Configure: changed --with-restconf= to say fcgi is NOT default
test_openconfig: Fixed upgrade of git added new dependencies (openconfig-platform)
2021-10-13 10:00:15 +02:00
Olof hagsand
daf37f6ad7 Fixed: [Doxygen - Typo in Input #275](https://github.com/clicon/clixon/issues/275) 2021-10-12 15:28:40 +02:00
Olof hagsand
a74fbdecdb Dispatcher fixes: user callback arg, changing handler to NULL 2021-10-12 14:45:10 +02:00
Olof hagsand
fccf315235 Added .editorconfig, added licensing section to CONTRIB 2021-10-12 13:35:21 +02:00