Commit graph

274 commits

Author SHA1 Message Date
Olof hagsand
42e61f461c - Memleaks in xpath parse error
- Static linkage cli fix (worked in 5.3.0 but restructuring broke it)
- Renamed all cligen_ph_active_get to cligen_pt_active_get
- Added AFL deferred init
- test_install.sh for static .a suffix
2021-10-03 18:49:25 +02:00
Olof hagsand
51278d5901 Fixed static linking for coverage and fuzzing
Preparations for Clixon 5.3 release
2021-09-27 12:26:53 +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
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
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
2b5dceb82c cli pagination 2021-09-21 11:22:40 +02:00
Olof hagsand
bd8cbbc393 Merge branch 'alanyanigersiklu-yang-patch-alanfork' 2021-08-10 19:50:27 +02:00
Olof hagsand
8fafe4a67e revert main example 2021-08-10 19:47:46 +02:00
Olof hagsand
75f5dc8500 Misc cleanups, remove old yangs, typos, etc 2021-08-05 15:15:28 +03:00
Alan Yaniger
8d2fbf39de implement yang-patch 2021-08-05 15:15:28 +03:00
Olof hagsand
df6f26c0de Misc cleanups, remove old yangs, typos, etc 2021-07-19 22:08:23 +02:00
Olof hagsand
fe0541959f * Native Restconf is now default, not fcgi/nginx
* That is, to configure with fcgi, you need to explicitly configure: `--with-restconf=fcgi`
* Updated main example to native restconf and several other fixes
2021-07-07 16:14:58 +02:00
Olof hagsand
d6c175e76e - Improved debugs for native restconf config reads
- Docker: restconf native added nghttp2
2021-06-23 10:53:27 +02:00
Olof hagsand
603f70e51f Vagrant and test updates for restconf /www-data mods 2021-05-23 19:55:01 +02:00
Olof hagsand
5baf8642ea * Fixed union in XPATH [XPATH issues #219](https://github.com/clicon/clixon/issues/219) 2021-05-15 22:28:10 +02:00
Olof hagsand
6cb75f5492 Add tab mode in example. Make coverage script sh->bash script 2021-04-22 20:44:37 +02:00
Olof hagsand
b88722fa25 - Restructure plugin module using a "module struct" rather than global variables.
This include plugin module init and exit functions
  New type: clixon_plugin_t exposed via public API while struct clixon_plugin is private
- Makefile changes for static linkage using "LINKAGE=static"
- Moved nacm external init to later stage in backend_main
2021-04-19 11:06:40 +02:00
Olof hagsand
7ebb538ebf - Changed master to 5.2.0.PRE
- Modified Makefiles for static linkage and coverage
- test namespace abstractions
2021-04-17 15:23:10 +02:00
Olof hagsand
8469a0962e * Add multiple yang support also for obsolete versions
* This means that files and datastores supporting modstate also looks for deleted or updated yang modules.
  * A stricter binding which gives error if loading outdated YANG file does not exist.
* Stricter yang checks: you cannot do get-config on datastores that have obsolete YANG
* Added xerr output parameter to `xmldb_get0()`
2021-04-12 12:42:26 +02:00
Olof hagsand
d542cd5530 Add cli debug commands for cli/backend/restconf 2021-04-12 12:38:16 +02:00
Olof hagsand
244060fddc - Added specific WITH_RESTCONF compile contants for _NATIVE and _FCGI for C code
- Restconf auth=none changes
  - Load clixon-restconf and resolve features earlier so that config features work
  - Removed auth=none code from example (this was non-std half-baked basic auth)
  - Changed tests that used auth-type=none to enable feature clixon-restconf:allow-auth-none
- Moved cert creation from sub-shell to servercert function
- Fixed typos for dockerfile rename of restconf evhtp to native
2021-04-07 20:54:41 +02:00
Olof hagsand
2def5d2367 * Fixed Yang parsing of comments in (extension) unknown statements, to allow multiple white space
* Fixed cli_start_shell: comments and cli_error
* Fixed [making cli_show_options's output more human readable #199](https://github.com/clicon/clixon/issues/199)
* Fixed SSL/evhtp limited read buffer problem
2021-04-01 15:56:56 +02:00
Olof hagsand
e9df7b81f2 Building problems with evhtp 2021-03-31 22:38:24 +02:00
Olof hagsand
fb9917e81e * Removed endtag parameter of clixon_xml_parse_file() 2021-03-15 13:24:27 +01:00
Olof hagsand
f536b1dc67 Added: CLICON_CLI_AUTOCLI_EXCLUDE
Added openconfig interfaces tests
2021-03-15 13:08:42 +01:00
Olof hagsand
a8d29b1e7e * Restconf authentication callback (ca_auth) signature changed
* Not backward compatible: All uses of the ca-auth callback in restconf plugins must be changed
  * New version is: `int ca_auth(h, req, auth_type, authp, userp)`
    * where `auth_type` is the requested authentication-type (none, client-cert or user-defined)
    * `authp` is the returned authentication flag
    * `userp` is the returned associated authenticated user
    * and the return value is three-valued: -1: Error, 0: not handled, 1: OK
  * For more info see [clixon-docs/restconf](https://clixon-docs.readthedocs.io/en/latest/restconf.html)
2021-03-07 15:34:26 +01:00
Olof hagsand
3d07db24d9 * Added CLICON_ANONYMOUS_USER to clicon-config.yang
* evhtp restconf closes session on -1 fatal error (no hang)
* restconf auth-type=none call ca_auth callback
* main example for auth_type=none uses basic auth to get user but without passwd check
2021-02-21 14:48:12 +01:00
Olof hagsand
dee4e87edf Fixed [xml bind yang error in xml_bind_yang_rpc_reply #175](https://github.com/clicon/clixon/issues/175) 2021-02-16 17:21:33 +01:00
Olof Hagsand
d1e5599572 reorder clixon-restconf.yang and some test fixes 2021-02-14 14:48:52 +00:00
Olof hagsand
710fc76887 * Restconf authentication callback (ca_auth) signature changed
* Not backward compatible: All uses of the ca-auth callback in restconf plugins must be changed
  * New version is: `int ca_auth(h, req, auth_type, authp, userp)`
    * where `auth_type` is the requested authentication-type (none, client-cert or user-defined)
    * `authp` is the returned authentication flag
    * `userp` is the returned associated authenticated user
    * and the return value is three-valued: -1: Error, 0: ignored, 1: OK
  * For more info see [clixon-docs](https://clixon-docs.readthedocs.io/en/latest/restconf.html)
* New clixon-restconf@2020-12-30.yang revision
2021-02-09 21:26:35 +01:00
Olof hagsand
b41f68b677 debug print of backend state, split test-stream into a netconf and restconf part, change restconf yang auth-type from leaf-list to leaf 2021-01-27 14:40:34 +01:00
Olof hagsand
68371d4fc5 upgrade copyright, aux tools, etc 2021-01-21 12:23:46 +01:00
Olof hagsand
96b50b88e8 Copyright 2021 2021-01-13 14:40:34 +01:00
Olof hagsand
4de0a475d3 4.10.PRE 2020-12-28 13:16:25 +01:00
Olof hagsand
b8f5d1dcae * Added CLICON_BACKEND_RESTCONF_PROCESS to clixon-config.yang 2020-12-17 12:13:06 +01:00
Olof Hagsand
53cdfebe11
Merge pull request #161 from s-bauer/patch-1
Fixed example_reset function
2020-12-16 10:03:21 +01:00
Olof hagsand
22adc58187 * New process-control RPC feature in clixon-lib.yang to manage processes
* This is an alternative to manage a clixon daemon via sudtemd, containerd or other
  * One important special case is starting the clixon-restconf daemon internally
  * This is how it works:
    * Register a process via `clixon_process_register(h, name, namespace, argv, argc)`
    * Use process-control RPC defined in clixon-lib.yang to start/stop/restart or query status on that process
  * Example code in the main example
2020-12-15 15:48:42 +01:00
Olof hagsand
8540820698 * New clixon-lib@2020-12-08.yang revision
* Added: autocli-op extension (see new features)
  * Added: rpc process-control for process/daemon management
* Added enable flag and removed presence in clixon-restconf
2020-12-13 22:19:25 +01:00
Simon Bauer
4ea547ac6f
Fixed example_reset function
The `xmldb_put` is failing due to the `x_spec` field not being set on the xml tree (`xt`) due to no yang spec being passed to the `clixon_xml_parse_string` function.
2020-12-13 17:04:43 +01:00
Olof hagsand
e1b94d94d2 * Ensure all fopen check for NULL (not -1)
* Improve test-perf cycles
2020-12-07 13:33:21 +01:00
Olof hagsand
e46f6f4a36 * Error-type changed from protocol to application for data-not-unique netconf/restconf errors
* Added new revision of main example yang: `clixon-example@2020-12-01.yang`
* Fixed [YANG: key statement in rpc/notification list #148](https://github.com/clicon/clixon/issues/148)
  * Do not check uniqueness among lists without keys
2020-12-01 18:58:20 +01:00
Olof hagsand
c32950c8a9 * Added message-id attributes in error and hello replies
* See [namespace prefix nc is not supported in full #154](https://github.com/clicon/clixon/issues/154)
* Removed mandatory loading of clixon_restconf.yang
2020-12-01 12:14:30 +01:00
Olof hagsand
75f85e0253 revert yang2cli sub code, use existing yang2cli solution 2020-11-27 15:31:27 +01:00