Dave Cornejo
3344adb487
initial import of dispatcher
...
this code implements a way of registering path handlers and then calling those handlers based on a path.
2021-09-07 10:14:45 -10: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
7794c619cc
test: curl error codes in github/actions
2021-08-26 18:45:12 +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
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
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
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
629757d1fd
Merge branch 'alanyanigersiklu-yang-patch-test'
2021-08-15 17:11:48 +02:00
Olof hagsand
89ca5ac154
Merge branch 'yang-patch-test' of https://github.com/alanyanigersiklu/clixon into alanyanigersiklu-yang-patch-test
2021-08-15 17:09:39 +02:00
Olof Hagsand
bf14df3c40
Merge pull request #257 from PlushBeaver/diff-path
...
Remove hardcoded path to diff binary
2021-08-15 17:08:44 +02:00
Alan Yaniger
18170fabbc
Merge branch 'yang-patch-test' of github.com:alanyanigersiklu/clixon into yang-patch-test
2021-08-14 21:22:03 +03:00
Alan Yaniger
2f9485800b
Added test for YANG patch with XML media
2021-08-14 21:21:09 +03:00
Dmitry Kozlyuk
56bfd9c36f
Remove hardcoded path to diff binary
...
Like other programs, diff can and should be located using PATH.
This fixes compare_dbs() on non-FHS systems, like NixOS.
2021-08-13 22:21:28 +03:00
Olof hagsand
c2c0a6210a
re-add CLICON_RESTCONF_INSTALLDIR
2021-08-12 21:20:31 +02:00
alanyanigersiklu
95a3664882
Merge branch 'master' into yang-patch-test
2021-08-12 21:06:57 +03:00
Alan Yaniger
8f110331d5
Add tests for yang patch
2021-08-12 21:01:48 +03: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
e780ed963b
* Fixed: [clixon_netconf errors on client XML Declaration with valid encoding spec]( https://github.com/clicon/clixon/issues/250 )
2021-08-10 19:32:02 +02:00
Phil Heller
b200361620
Testing dependency fixes, Netconf XML declaration and filter logic fix
...
Install libnghttp2-devel in ubuntu and centos per required dependencies
Ignore case when checking XML declaration encoding value per W3C recommendations
Fix filter logic to follow RFC6241 (7.1, 7.7) and default to subtree
2021-08-10 19:32:02 +02:00
Olof hagsand
26a8cfcedb
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-08-10 19:29:07 +02:00
Olof Hagsand
e6022bc088
Merge pull request #252 from pheller/filter-and-xml-encoding-fixes
...
Testing dependency fixes, Netconf XML declaration and filter logic fix
2021-08-08 13:32:24 +02:00
Alan Yaniger
f2e81be66e
fix merge conflicts
2021-08-06 12:08:13 +03:00
Alan Yaniger
2abbea4e3a
fixed Makefile.in to use name of yang patch file
2021-08-06 12:00:38 +03: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
Alan Yaniger
94b8f7fec5
fixed another rebase error
2021-08-05 15:39:27 +03:00
Alan Yaniger
17c7acfa11
fixed error in rebase
2021-08-05 15:34:38 +03:00
Olof hagsand
d4c77ffa90
Move Yang patterns: \n match from yang parse to regex compile stage
2021-08-05 15:16:29 +03:00
Olof hagsand
a6176ec773
cli exclude clixon-restconf, extra cv check in default1
2021-08-05 15:16:29 +03:00
Olof hagsand
c743b90fdd
* 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 15:16:29 +03:00
Olof hagsand
dc2b3a80ca
* Fixed: YANG when was not properly implemented for LEAF default values
2021-08-05 15:16:29 +03:00
Olof hagsand
8675620d22
* 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-05 15:16:29 +03:00
Olof hagsand
efcfb176ae
Fixed: The auto-cli identityref did not expand identities in grouping/usecases properly.
2021-08-05 15:16:29 +03:00
Olof hagsand
551a985d1b
* 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-05 15:16:29 +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
ecceda35b6
revert restconf internal tests using CLICON_RESTCONF_INSTALLDIR for docker
2021-08-05 15:16:29 +03:00
Olof hagsand
96a3ee98c6
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-08-05 15:16:29 +03:00
Olof hagsand
5de6d56822
* 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-08-05 15:15:28 +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
Olof hagsand
f64eff15a0
Removed space from xpath canonical form of relex/unionex
2021-08-05 15:15:28 +03:00
Olof hagsand
1631e23c98
added ietf-yang-patch.yang and enabled clixon_util_validate
2021-08-05 15:15:28 +03:00