Commit graph

434 commits

Author SHA1 Message Date
Olof hagsand
77b4468eb3 Updated copyright statements to 2022 2022-01-18 16:36:00 +01:00
Olof hagsand
b164f02277 * Removed ifdef __GNUC__ around printf-like prototypes since both clang and gcc have format/printf macros defined 2022-01-18 16:05:50 +01:00
Olof hagsand
50ac510803 * Fixed: Configure option CLICON_RESTCONF_PATH was marked as obsolete but was still used.
* `CLICON_RESTCONF_PATH` is now obsolete for sure
    * Instead if you use fgci/nginx:
      * Use `restconf/fcgi-socket`
      * Ensure `<CLICON_FEATURE>clixon-restconf:fcgi</CLICON_FEATURE>` is set
* Added default values to restconf-config and save fcgi-socket-path in memory
2022-01-01 11:52:18 +01:00
Olof hagsand
1808015cf6 Fixed: SEGV when starting FCGI restconf program
- Reverted removal of CLICON_RESTCONF_PATH since it was used there
Misc fixes: initialized variables, docs, removed obsolete --enable-optyang
2021-12-30 16:35:54 +01:00
Olof hagsand
3117332ddd Changes in clixon-config.yang:
* Removed obsolete options:
    * `CLICON_YANG_LIST_CHECK`
    * `CLICON_RESTCONF_PATH` (moved to restconf/fcgi-path)
  * Fixed: Configure option `CLICON_RESTCONF_PRETTY` was marked as obsolete but was still used.
    * `CLICON_RESTCONF_PRETTY` is now obsolete for sure
    * Instead restconf/pretty is used with API function restconf_pretty_get()
2021-12-28 11:44:19 +01:00
Olof hagsand
f8f34e3571 * Replaced separate autocli trees with a single @basemodel tree by using filter labels
* Added lastkey argument to yang_key_match()
* Fixed segv in process-sigchld
* Added ietf-yang-library to CLICON_CLI_AUTOCLI_EXCLUDE default value
* Added yang_spec_print() function
2021-12-16 20:23:09 +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
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
448aa4c994 include signal.h 2021-10-21 16:29:43 +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
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
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
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
47141089c2 - Added netconf to fuzz
- Restconf internal start more robust
- Restconf fcgi fix
2021-09-22 18:55:32 +02:00
Olof hagsand
55377786c1 Fix tests for http/1 and http/2 only respectively 2021-09-21 21:23:33 +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
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
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
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
d1ed4ecd7d - Refactor yang patch code according to Clixon coding style
- Fixed all memory leaks
2021-09-08 10:38:49 +02:00
Olof hagsand
aed7dbfd8b - Restconf error: added special case for translating from netconf invalid-value to 400 vs 404
- Added media to restconf sanity checks, such as bad client cert error
2021-08-27 15:12:50 +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
6e0e45aab7 * Fixed: Some native restconf error messages did not end with \r\n.
* Specifically the error when sending http request on https.
2021-08-20 15:45:13 +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
bd8cbbc393 Merge branch 'alanyanigersiklu-yang-patch-alanfork' 2021-08-10 19:50:27 +02:00
Alan Yaniger
f2e81be66e fix merge conflicts 2021-08-06 12:08:13 +03:00
Alan Yaniger
94b8f7fec5 fixed another rebase error 2021-08-05 15:39:27 +03:00
Alan Yaniger
ad950efc32 fixed check when getting value inside xml tag given the key 2021-08-05 15:16:29 +03:00
Alan Yaniger
523407a9c1 fixed string length checks, removed unnecessary loop, changed some other code for clarity 2021-08-05 15:16:29 +03:00
Alan Yaniger
fd28fd498d - Add prefix "yang_patch_" to new functions
- use clixon cbuf functions instead of new string functions
 - moved some code into separate functions
 - added comments
 - added documentation to functions that did not have it
2021-08-05 15:16:29 +03:00
Olof hagsand
128764a570 - Added yang patch test: test_restconf_yang_patch.sh as placeholder for rfc 8072 tests
- Added patch-xml as valid media
2021-08-05 15:15:28 +03:00
Olof hagsand
659aaac5c6 - cli set debug vars
- fixed: restconf native evhtp appended indata to old data
2021-08-05 15:15:28 +03:00
Alan Yaniger
86b64c4dd0 split up long function, use safe string handling functions 2021-08-05 15:15:28 +03:00
Alan Yaniger
8d2fbf39de implement yang-patch 2021-08-05 15:15:28 +03:00
Alan Yaniger
d1f44e2f1f fixed check when getting value inside xml tag given the key 2021-08-01 17:01:40 +03:00
Alan Yaniger
db7e016aa0 fixed string length checks, removed unnecessary loop, changed some other code for clarity 2021-08-01 16:50:04 +03:00
Alan Yaniger
948fa70b44 - Add prefix "yang_patch_" to new functions
- use clixon cbuf functions instead of new string functions
 - moved some code into separate functions
 - added comments
 - added documentation to functions that did not have it
2021-07-27 18:36:46 +03:00
Olof hagsand
600f29a117 - Added yang patch test: test_restconf_yang_patch.sh as placeholder for rfc 8072 tests
- Added patch-xml as valid media
2021-07-26 12:20:06 +02:00
Olof hagsand
c1c4e5b3f3 - cli set debug vars
- fixed: restconf native evhtp appended indata to old data
2021-07-26 10:46:00 +02:00