Commit graph

625 commits

Author SHA1 Message Date
Olof hagsand
77b4468eb3 Updated copyright statements to 2022 2022-01-18 16:36:00 +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
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
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
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
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
Olof hagsand
448aa4c994 include signal.h 2021-10-21 16:29:43 +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
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
a74fbdecdb Dispatcher fixes: user callback arg, changing handler to NULL 2021-10-12 14:45:10 +02:00
Olof hagsand
8469664075 Updated contribution and statedata callback docs 2021-10-10 18:48:10 +02:00
Olof hagsand
8ede8a87b2 Moved fuzz dir to test/fuzz
Extended contributing document to testing and licensing
2021-10-10 18:05:45 +02:00
Olof hagsand
edbbb43e1f Removed remaining and replaced pagination-mode with locked parameter
Dispatcher: Added dispatcher_free(), fixed mem-leaks and malloc return
checks
2021-10-10 11:40:47 +02:00
Olof hagsand
ce06f25be7 Merge branch dispatcher and broke out pagination callbacks to use it
* Merge branch 'dcornejo-master'
* Broke out pagination callback API from state data callbacks
  * New pagination callback API uses new dispatcher from netgate, thanks @dcornejo
   * Register callback with: `clixon_pagination_cb_register()`
   * Use accessor functions `pagination_offset()`, `pagination_limit()`, etc
 * Reverted state data callback API to pre-5.3 (see C/CLI API changes below)
2021-10-08 15:19:37 +02:00
Olof hagsand
7631c3f0a3 coverage: added tests for all ints 2021-10-06 08:36:34 +02:00
Olof hagsand
d175720b7e Cleaned up Makefiles, especially LINKAGE=static vs dynamic
Added LIBSTATIC_SUFFIX instead of hardcoded .a
Changed building of build.c not to be triggered by install
2021-09-30 21:40:46 +02:00
Olof hagsand
9b6bb3ecbf - Added transaction_arg_set()
- Modifed coverage script
2021-09-27 16:31:21 +02:00
Olof hagsand
5a875e3152 Fix some LINKAGE=static compile issues:
- Makefile circularity by fixing .so suffix
- simplify example/main Makefile
2021-09-26 11:22:48 +02:00
Olof hagsand
c00162aec1 - Modified linkage constant in makefile to test for dynamic only
- CLIXON_STATIC_PLUGIN to support statically linked plugins
- Added -H option to clixon_netconf: Do not require hello before request
2021-09-25 16:36:37 +02:00
Olof hagsand
b70e22096e - Pagination: enabled LIST_PAGINATION and remobved constant
- Changed logic on how to find clixon_restconf in pseudo plugin
- Removed ==== in constants to avoid conflict with git merge
- Remove assert
- Added fuzzing for netconf
2021-09-23 13:33:26 +02:00
Olof hagsand
a7a699a8b5 New state plugin callback for pagination.
* You need to change all statedata plugin callback for the new pagination feature
  * If you dont use pagination you can ignore the values of the new parameters
  * See [User manual pagination](https://clixon-docs.readthedocs.io/en/latest/misc.html#pagination)
  * The updated callback signature is as follows:
  ```
  int statedata(clicon_handle     h,
                cvec             *nsc,
	        char             *xpath,
	        pagination_mode_t pagmode,   // NEW
	        uint32_t          offset,    // NEW
	        uint32_t          limit,     // NEW
	        uint32_t         *remaining, // NEW
	        cxobj            *xstate)
  ```
2021-09-21 15:02:46 +02:00
Olof hagsand
384ce70d7c memory leak and nacm recovery test fix 2021-09-21 13:24:34 +02:00
Olof hagsand
ff3f600920 Renamed paging to pagination 2021-09-21 11:28:29 +02:00
Olof hagsand
60193cca0d - Add remaining argument to state callback 2021-09-21 11:27:58 +02:00
Olof hagsand
6e316b519b - Refactoring of get_common/get_list_pagination with two sub-functions
- Fixed memory leak
2021-09-21 11:27:58 +02:00
Olof hagsand
caabfd464e * New state callback signature (ca_statedata2)
* The new callback contains parameters for paging
   * Goal is to replace ca_statedata callback
* New plugin callback when lock/unlock occurs
  * Add `ca_lockdb` tro plugin init to use it.
* Fixed: Typing 'q' in CLI more paging did not properly quit output
  * Output continued but was not shown, for a very large file this could cause considerable delay
* Fixed: Lock was broken in first get get access
  * if the first netconf operation to a backend was lock;get;unlock, the lock was broken in the first get access.
2021-09-21 11:27:58 +02:00
Olof hagsand
aaf9a89183 - Added an extended state plugin callback: ca_statedata2 with offset and limit parameters
- Fixed memory errors
2021-09-21 11:26:28 +02:00
Olof hagsand
28f58fb7d6 - Fixed list pagination for CLI 2021-09-21 11:24:53 +02:00
Olof hagsand
a046306270 - New netconf-specific uint32 parse functions
- Added failure handling to xpath traverse_canonical
- Started pagination cli code
2021-09-21 11:24:53 +02:00
Olof hagsand
390b0886ed - pageing offset working 2021-09-21 11:24:53 +02:00
Olof hagsand
fb0b9409f3 - Moved restrconf code from pageing rpc to get 2021-09-21 11:24:53 +02:00
Olof hagsand
c9843b34a6 - Rewrite of netconf get/get-config code
- Unified get and get-config code to single function get_common
  - Integrated list-pagination code
  - Moved get code to new files backend_get.[ch]
2021-09-21 11:24:53 +02:00
Olof hagsand
b03cf426a4 * Protyped netconf native pagination 2021-09-21 11:24:53 +02:00
Olof hagsand
6bf3112fe7 * JSON encoding of YANG metadata according to RFC 7952
* XML -> JSON translation
2021-09-21 11:23:40 +02:00
Olof hagsand
76e59873c2 - Changed media name: yang.collection+xml/yang to application-collection+xml/json
- Modified ietf-netconf-list-pagination.yang:
     - changed get-pagable ->  get-pageable
     - renamed count -> limit
     - renamed skip -> offset
     - added import ietf-yang-metadata
     - added md:annotation remaining
2021-09-21 11:22:41 +02:00
Olof hagsand
0c7f2043f3 * Pagination according to new draft
* count/skip -> limit/offset
* ietf-yang-metadata RFC 7952 support, placeholder parsing and extension
2021-09-21 11:22:41 +02:00
Olof hagsand
77bacc93bb - Updated code to clixon 5.2 status
- Added LIST_PAGINATION clixon_custom constant
- Fix: leafs added as augments on rpc input/output lacked cv:s
2021-09-21 11:22:40 +02:00
Olof hagsand
2485bec483 fixes for compilation 2021-09-21 11:22:40 +02:00
Olof hagsand
2b5dceb82c cli pagination 2021-09-21 11:22:40 +02:00
Olof hagsand
8e266dd136 skip+count 2021-09-21 11:22:40 +02:00
Olof hagsand
78f5a6983c Pagination draft 2021-09-21 11:22:40 +02:00
Olof hagsand
2e857bb417 First working prototype 2021-09-21 11:22:40 +02:00
Olof hagsand
9fce0a1214 - IPC socket: add REUSEADDR when using IP (remove comment)
- Test: remove variable to use backend restconf, since that is the only option
- Docs C-style: describe return values better
2021-08-24 13:46:47 +02:00
Olof hagsand
8352e25860 * Restconf internal start: fail early if clixon_restconf binary is not found
* If CLICON_BACKEND_RESTCONF_PROCESS is true
2021-08-17 10:08:04 +02:00
Olof hagsand
93a4777f0f Removed default of CLICON_RESTCONF_INSTALLDIR
* The default behaviour is changed to use the config $(sbindir) to locate `clixon_restconf` when starting restconf internally
2021-07-27 10:53:47 +02:00