Commit graph

365 commits

Author SHA1 Message Date
Olof hagsand
c405a08ff8 Restconf https fixes after nmap and fuzz:
- segv in PUT/POST of /
- Dont return bad request on error, just close socket
2021-05-28 16:17:52 +02:00
Olof hagsand
164aa1cb4c * Restconf: added inline configuration using -R <xml> command line as an alternative to making advanced restconf configuration 2021-05-26 11:24:39 +02:00
Olof hagsand
5b39418e92 * [Need an option to disable restconf mandatory action of overwriting startup_db #230](https://github.com/clicon/clixon/issues/230)
* Disable RFC 8040 mandatory copy of running to startup after commit
* Rename CLICON_RESTCONF_INSTALL_DIR -> CLICON_RESTCONF_INSTALLDIR
2021-05-25 11:07:41 +02:00
Olof hagsand
ae02d02d63 Several fixes to restconf internal and vagrants tests 2021-05-24 13:10:21 +02:00
Olof hagsand
c20c672d83 * Changed config and install options for Restconf
* clixon_restconf daemon is installed in /usr/local/sbin (as clixon_backend), instead of /www-data
    * `configure --with-wwwdir=<dir>` remains but only applies to fcgi socket and log
    * New option `CLICON_RESTCONF_INSTALL_DIR` is set to where clixon_restconf is installed, with default `/usr/local/sbin/`
  * Restconf drop privileges user is defined by `CLICON_RESTCONF_USER`
    * `configure --with-wwwuser=<user>` is removed
  * clixon_restconf drop of privileges is defined by `CLICON_RESTCONF_PRIVILEGES` option
* New clixon-restconf@2020-05-20.yang revision
  * Added: restconf `log-destination`
2021-05-23 17:14:18 +02:00
Olof hagsand
c3e26b004c * Fixed: [xpath function count did not work properly #224](https://github.com/clicon/clixon/issues/224) 2021-05-20 15:16:29 +02:00
Olof hagsand
9fb9024675 Fixed: native restconf 100 Continue caused hanging 2021-05-18 14:28:57 +02:00
Olof hagsand
783b0a4857 * YANG when statement in conjunction with grouping/uses/augment
* Several cases were not implemented fully according to RFC 7950
    * Do not extend default values if when statements evaluate to false
    * Do not allow edit-config of nodes if when statements evaluate to false (Sec 8.3.2)
    * If a key leaf is defined in a grouping that is used in a list, the "uses" statement MUST NOT have a "when" statement. (See 7.21.5)
  * See [yang uses's substatement when has no effect #218](https://github.com/clicon/clixon/issues/2$
2021-05-13 14:26:02 +02:00
Olof hagsand
7023fe589f patch for fixing http2 test 2021-05-09 22:12:33 +02:00
Olof hagsand
6ed2202638 - Added openssl application-layer protocol negotiation
- Added restconf tests for http/1.0 and http/2
2021-05-09 17:55:13 +02:00
Olof hagsand
ad08200931 - Added Restconf-style xml/json message bodies everywhere
- Added api_return_err0() and changed many calls to that instead of api_return_err
- Added netconf_operation_not_supported_xml()
2021-05-08 20:20:01 +02:00
Olof hagsand
0225488c39 - Moved deviation actions to include grouped/uses statements. See https://github.com/clicon/clixon/issues/211 2021-05-06 16:23:50 +02:00
Olof hagsand
866d8d1d0a - Fixed issues with mismatching Content-Length in replies causing extra bytes to spill over into the next message 2021-05-06 14:34:31 +02:00
Olof hagsand
6605ab8ce7 Restconf native: add error bodies on early errors 2021-05-05 20:40:59 +02:00
Olof hagsand
6e5e53e02e Restconf native: add body to bad request return 2021-05-01 17:53:29 +02:00
Olof hagsand
aaaeec92eb Internal RESTCONF changes:
- Kill running process directly, not schedul a kill
- fcgi: when kill, make exit more ordered, ensure fcgi-accept returns properly
2021-04-30 14:49:01 +02:00
Olof hagsand
0d7e644335 - Native restconf: use cligen buffers instead of libevent for replies 2021-04-29 14:06:05 +02:00
Olof hagsand
05009aed67 Add restconf get list extra =restval test 2021-04-28 11:31:41 +02:00
Olof hagsand
4c1249fd9b More restconf error tests for coverage 2021-04-25 17:53:32 +02:00
Olof hagsand
448b56ca0c - Removed sha1 code
- ifdef unused SOAP encoding
2021-04-24 22:06:26 +02:00
Olof hagsand
030715df61 Tests:
- Added tests for more coverage, including test_debug.sh
- Added yang deviation test
2021-04-24 17:51:39 +02:00
Olof hagsand
6981daf595 Fixed: [Multiple http requests in native restconf yields same reply #212](https://github.com/clicon/clixon/issues/212) 2021-04-24 17:43:05 +02:00
Olof hagsand
d48b8a8fad -Yang Deviation/deviate : added yacc/lex syntax 2021-04-24 12:31:40 +02:00
Olof hagsand
ecd5f7de70 * Add default network namespace constant: RESTCONF_NETNS_DEFAULT with default value "default". 2021-04-22 13:45:02 +02:00
Olof hagsand
91a583253e - Fixed plugin-module initialized twice in restconf-fcgi
- Test script: wait for restconf to stop
2021-04-19 13:54:58 +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
51df120e9e
Merge pull request #203 from dcornejo/master
Add ability to enable core dumps from RESTCONF process
2021-04-15 20:00:30 +02:00
Dave Cornejo
ec0c5118a4 Cleanup pull request
Remove clixon-restconf 2021-04-12, add changes to 2021-03-15
Remove noisy debug logging
2021-04-15 07:30:26 -10:00
Olof hagsand
bba23be444 mem fixes, evolved openconfig interfaces test 2021-04-15 10:12:35 +02:00
Dave Cornejo
e4885d51e6 Add ability to enable core dumps from RESTCONF process
Contributed by Rubicon Communications LLC, dbs Netgate
2021-04-14 09:42:37 -10:00
Olof hagsand
c43e216d67 - Restconf bind: continue with other sockets if bind fails, print address on log
- Multi-yang: Look in CLICON_YANG_MAIN_DIR, not only CLICON_MAIN_DIRs for old yangs
  - Backend -q quit option enhanced for multi-yang case
2021-04-13 18:00:27 +02:00
Olof hagsand
21a65d4a75 Build and test issues with evhtp 2021-04-12 12:50:42 +02:00
Olof hagsand
953326d39f - Rewrote process control to simpler state model: stopped/running/exiting
- Stricter CLICON_BACKEND_RESTCONF_PROCESS :
 - if set, restconf daemon queries backend for its config
 - if not set, restconf daemon reads its config from main config file
2021-04-12 10:31:17 +02:00
Olof hagsand
15d01c58d8 - Better restconf debug: when restconf debug flag set in datastore, ensure the process is started with -D set
- Fixed native http support for base container
- Changed test certs and restconf scripts to functions
2021-04-09 09:34:05 +02:00
Olof hagsand
d8be601606 * To configure native mode use: configure --with-restconf=native, changed from: configure --with-restconf=evhtp 2021-04-06 08:48:45 +02:00
Olof hagsand
d874a696f7 Shortened ssl test keys to 1024 to make tests faster
Fixed memory error in SSL code
2021-04-05 14:00:28 +02:00
Olof hagsand
6a64cf5ff1 Restconf: nonblocking constant and fixed an accept again loop error 2021-04-03 14:50:31 +02:00
Olof hagsand
3e2e4646f0 Restconf: nonblocking constant and fixed an accept again loop error 2021-04-03 10:37:29 +02:00
Olof hagsand
01d0ea905c Added nonblocking socket support for SSL_read/SSL_accept/SSL_write 2021-04-02 18:06:45 +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
0020c7ff3f cicd test fixes for libevhtp and warnings 2021-04-01 11:20:48 +02:00
Olof hagsand
e9df7b81f2 Building problems with evhtp 2021-03-31 22:38:24 +02:00
Olof hagsand
c7e7598e3b * Updated "evhtp" restconf mode
* No reliance on libevent or libevhtp, but on libssl >= 1.1 directly
    * Moved out event handling to clixon event handling
    * Moved out all ssl calls to clixon
  * New code MUST use libevhtp from https://github.com/clixon/clixon-libevhtp.git
    * This does NOT work: libevhtp from https://github.com/criticalstack/libevhtp.git
2021-03-30 16:00:03 +02:00
Olof hagsand
477059f33d Fixed again: [backend start resconf failed due to path string truncated #192](https://github.com/clicon/clixon/issues/192) 2021-03-24 12:23:00 +01:00
Olof hagsand
709459304f * Removed cli_debug(). Use cli_debug_backend() or cli_debug_restconf() instead.
* Created restconf debug rpc stub function and documented restconf debugging
2021-03-22 14:56:05 +01:00
Olof hagsand
6d23963d8b Fixed: [clixon_restconf not properly configed and started by clixon_backend #193](clixon_restconf not properly configed and started by clixon_backend #193) 2021-03-22 12:20:52 +01:00
Olof hagsand
43db8dd5c5 Fixed: [state showing error in cli with CLICON_STREAM_DISCOVERY_RFC8040 #191](https://github.com/clicon/clixon/issues/191) 2021-03-18 10:41:08 +01:00
Olof hagsand
9087694b58 Fixed: [Backend can not read datastore with container named config #147](https://github.com/clicon/clixon/issues/147) 2021-03-13 17:15:00 +01:00
Olof hagsand
7762b10cbb * Changed signal handling
* Moved clixon-proc sigchild handling	from handler to clixon_events
2021-03-11 18:12:43 +01:00