Commit graph

737 commits

Author SHA1 Message Date
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
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
26d37352f4 NETCONF hello error handling, changed YANG PATCH enabling, refactored static linking
NETCONF hello errors, such as wrong session-id, prefix, namespace terminates session
  * Instead of returning an rpc-error reply
Changed YANG PATCH enabling:
  * Now: `./configure --enable-yang-patch`
  * Before: set YANG_PATCH constant in `include/clixon_custom.h`
Refactored Makefile for static linking
2021-10-05 12:04:53 +02:00
Olof hagsand
8f55b8490d Refactored Makefile for static linking, removed netconf soap encoding 2021-10-04 20:06:11 +02:00
Olof hagsand
648b3f41f2 Make ready for clixon 5.4.0 development 2021-09-30 16:16:00 +02:00
Olof hagsand
9b6bb3ecbf - Added transaction_arg_set()
- Modifed coverage script
2021-09-27 16:31:21 +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
d23153e25a Removed ietf-origin and ietf-netconf-with-defaults YANGS 2021-09-21 11:28:29 +02:00
Olof hagsand
ff3f600920 Renamed paging to pagination 2021-09-21 11:28:29 +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
fb0b9409f3 - Moved restrconf code from pageing rpc to get 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
acc6a0fec7 First working prototype 2021-09-21 11:22:40 +02:00
Olof hagsand
2e857bb417 First working prototype 2021-09-21 11:22:40 +02:00
Olof hagsand
6b357dc038 * Partly Fixed: [String concatenation in YANG model leads to syntax error](https://github.com/clicon/clixon/issues/265)
* In this case, eg "uses", single quotes can now be used, but not `qstring + qstring` in this case
2021-09-20 22:54:14 +02:00
Olof hagsand
392e6679c5 * JSON errors are now labelled with JSON and not XML
* Fixed: [Performance issue when parsing large JSON param](https://github.com/clicon/clixon/issues/266)
* Moved strlen() from for end condition
* Fixed debugging of xpath parser
2021-09-20 21:35:01 +02:00
Olof hagsand
ca14879e8c - Fixed: [Duplicate lines emitted by cli_show_config (cli output style) when yang list element has composite key](https://github.com/clicon/clixon/issues/258) 2021-09-09 13:33:51 +02:00
Olof hagsand
e3d0566d3c - CLICON_RESTCONF_HTTP2_PLAIN set to default false 2021-09-06 13:30:12 +02:00
Olof hagsand
cdacca125c Native restconf: SSL client certs failures are returned as http 405 errors, not fail during SSL negotiation 2021-08-27 09:33:59 +02:00
Olof hagsand
ef4d082f4b * Restconf native HTTP/2:
* Added option `CLICON_RESTCONF_HTTP2_PLAIN`
    * if disabled non-tls HTTP/2 is disabled: both direct and upgrade
2021-08-26 16:58:52 +02:00
Olof hagsand
562320dcbc * Fixed: [JSON leaf-list output single element leaf-list does not use array](https://github.com/clicon/clixon/issues/261) 2021-08-24 17:08:31 +02:00
Olof hagsand
c35ca82083 * Fixed: Netconf diff callback did not work with choice and same value replace
* Eg if YANG is `choice c { leaf x; leaf y }` and XML changed from `<x>42</x>` to `<y>42</y>` the datastrore changed, but was not detected by diff algorithms and provided to validate callbacks.
  * Thanks: Alexander Skorichenko, Netgate
2021-08-17 16:51:08 +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
980718178a * YANG Leafref feature update
* Closer adherence to RFC 7950. Some of this is changed behavior, some is new feature.
  * Essentially instead of looking at the referring leaf, context is referred(target) node
  * Validation uses referred node
    * Validation changed to use type of referred node, instead of just "string"
  * Auto-cli
    * Changed to use type of referred node for typecheck
    * Completion uses referred node
  * Required instance / less strict validation
    * New: Leafrefs must refer to existing data leaf ONLY IF YANG `required-instance` is true
    * Previous: All leafrefs must refer to existing data leaf node
* Fixed: [Autocli does not offer completions for leafref to identityref #254](https://github.com/clicon/clixon/issues/254)
2021-08-16 17:14:27 +02:00
Olof hagsand
8db716ca07 - Moved yang patch code to new files restconf_methods_patch.[ch]
- Started modifying patch code to style guidelines
- Made patch test independent of example
- Added developers style guidelines
2021-08-15 20:43:52 +02:00
Olof hagsand
355ed7d96a * Fixed: [clixon_netconf errors on client XML Declaration with valid encoding spec](https://github.com/clicon/clixon/issues/250) 2021-08-05 21:44:52 +02:00
Olof hagsand
dcaeb581a1 * Fixed: Yang patterns: \n and other non-printable characters were broken
* Example: Clixon interpereted them two characters: `\\ n` instead of ascii 10
2021-08-05 09:59:20 +02:00
Olof hagsand
00645ee52b * Added linenumbers to all YANG symbols for better debug and errors
* Improved error messages for YANG identityref:s and leafref:s by adding original line numbers
2021-08-03 12:53:37 +02:00
Olof hagsand
4d265d63bd Fixed: The auto-cli identityref did not expand identities in grouping/usecases properly. 2021-08-03 11:15:45 +02:00
Olof hagsand
babdc6f496 * Fixed: [OpenConfig BGP afi-safi and when condition issues #249](https://github.com/clicon/clixon/issues/249)
* YANG when was not properly implemented for default values
* Improved error message on leafref validation errors
2021-08-02 15:48:38 +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
Olof hagsand
dee081646c * Fixed: SEGV in clixon_netconf_lib functions from internal errors including validation.
* Check xerr argument both before and after call on netconf lib functions
2021-07-27 10:31:16 +02:00
Olof hagsand
f7f24949d6 Merge branch 'yang-patch-alanfork' of https://github.com/alanyanigersiklu/clixon into alanyanigersiklu-yang-patch-alanfork 2021-07-19 22:54:00 +02:00
Olof hagsand
e0ee365958 * Fixed: RFC 8040 yang-data extension allows non-key lists
* Added YANG_FLAG_NOKEY as exception to mandatory key lists
2021-07-19 11:15:49 +02:00
Olof hagsand
6bb6faadc9 * Fixed: mandatory leaf in a uses statement caused abort
* Occurence was in ietf-yang-patch.yang
2021-07-19 08:14:10 +02:00
Olof hagsand
270c47b396 Native restconf fixes:
- memleak in http/1-only
- exit if http/1 request sent to http/2-only
- hang if http/1 TLS request sent to http/2 only
2021-07-09 15:08:21 +02:00
Olof hagsand
1925ac68cd * Fixed: [RESTConf GET for a specific list instance retrieves data from other submodules that have same list name and key value #244](https://github.com/clicon/clixon/issues/244)
* Fixed: Double clixon error messages in yang2cli code
* Sanity checks for submodule belongs-to
2021-07-08 16:26:39 +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
98c5fcd20f Clixon 5.3.0.PRE 2021-07-07 13:14:17 +02:00
Olof hagsand
22563ee2de - Clixon 5.2.0 release 2021-07-01 17:47:31 +02:00
Olof hagsand
ef131cf407 * 5.2.0 preparations
* Restconf native openssl - ifdef SSL_get0_next_proto_negotiated
2021-07-01 16:34:38 +02:00
Olof hagsand
89f843f919 * Fixed: [uses oc-if:interface-ref error with openconfig #233](https://github.com/clicon/clixon/issues/233) 2021-07-01 11:55:45 +02:00