Commit graph

386 commits

Author SHA1 Message Date
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
Olof hagsand
dda3244252 * Auto-cli changed singature of yang2cli()
* Auto-cli: create generated CLI for sub-parts of a YANG spec
2020-11-26 17:32:09 +01:00
Olof hagsand
0b948248e4 * Reworked evhtp restconf config to only use clixon-restconf.yang and marked local restconf options as obsolete
* Extended clicon-config with clixon-restconf for local config
* Removed obsolete CLICON_TRANSACTION_MOD
2020-11-21 13:16:29 +01:00
Olof hagsand
9016dde319 Modify tests so they all work with evhtp and backend config, eg that CLICON_RESTCONF_CONFIG is default true.
Note that some tests are forced to CLICON_RESTCONF_CONFIG is false due to test complexities.
2020-11-18 13:57:25 +01:00
Olof hagsand
a0006075c3 Merge branch 'topic_benavrhm_rfc8527a_20201103' of https://github.com/benavrhm/clixon into benavrhm-topic_benavrhm_rfc8527a_20201103 2020-11-11 13:41:05 +01:00
Jonathan Ben-Avraham
a1f54d71ac Update yang/mandatory files for rfc8527 compliance
Updated the yang/mandatory files and test scripts for rfc8527.
2020-11-07 22:06:05 +02:00
Olof hagsand
c31b1c471b * Changed first parameter from int fd to FILE *f in the following functions:
* clixon_xml_parse_file(), clixon_json_parse_file(), yang_parse_file()
  * See [Bytewise read() of files is slow #146](https://github.com/clicon/clixon/issues/146)
2020-11-04 22:21:42 +01:00
Olof hagsand
1614bcd19c Cleanup master for 4.9.0.PRE 2020-10-19 20:06:20 +02:00
Olof hagsand
f07f291bdd Main examples uses new auto-mode 2020-10-18 00:02:38 +02:00
Olof hagsand
2d56c9674a * New YANG generated auto-cli feature with syntax modes
* The existing autocli does not support modes, complete paths must be given, eg: `set a b c d 42`.
  * In the new auto-cli, automatic modes are present at each YANG syntax node level, eg the above can be given as: `edit a b c; set d 4; top`
  * The existing CLI API remains, the new API is as follows: `cli_auto_edit()`, `cli_auto_up()`, `cli_auto_top()`, `cli_auto_show()`, `cli_auto_set()`, `cli_auto_merge()`, `cli_auto_create()`, `cli_auto_del()`.
  * See `test/test_cli_auto.sh` for an example of the new API, and `apps/cli/cli_auto.c` for the source code of the new callback API.
  * Documentation will be appear and full integration with the main example.
* Added inline state field to clixon-example.yang
* Added new clicon_data_cvec_*() API for generic cvec structs
2020-10-14 10:54:10 +02:00
Olof hagsand
09d33acd45 cli show options. doc and testing 2020-10-01 11:07:57 +02:00
Olof hagsand
101a8cb6e0 minor fixes 2020-09-27 17:15:36 +02:00
Olof hagsand
27bb0a1d2b * Fixed: Restconf failed put/post could leave residue in candidate causing errors in next put/post
* Added -v option for backend plugins to generate validation error
2020-09-10 18:09:17 +02:00
Olof hagsand
2c96cf71ea Changed main example: removed translate yang and replaced testcases w table/parameter 2020-09-08 11:39:55 +02:00
Olof hagsand
1db969d3a7 Main example: remove translate cli line, changed 'startup' to 'copy running startup' 2020-09-07 15:12:20 +02:00
Olof hagsand
81fc7f742b * Netconf as default namespace has been disabled by default.
* Only requests on the form: `<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><edit-config>...` will be accepted
  * All replies will be on the form: `<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">...`
  * Requests such as: `<rpc><edit-config>...` will not  be accepted.
  * You can revert this behaviour (to clixon pre-4.6 behaviour) by enabling `CLICON_NAMESPACE_NETCONF_DEFAULT`
  * This API change is a consequence of: [copy-config's RPC cxobj parameter does not contain namespace #131](https://github.com/clicon/clixon/issues/131)
2020-09-02 15:44:10 +02:00
Olof hagsand
0e4df0e8fc Added options for Restconf evhtp setting default bind socket address and ports CLICON_RESTCONF_IPV4_ADDR, CLICON_RESTCONF_IPV6_ADDR, CLICON_RESTCONF_HTTP_PORT, CLICON_RESTCONF_HTTPS_PORT 2020-08-21 13:13:20 +02:00
Olof hagsand
65733ffe69 * Added yang-binding yb parameter to xmldb_get0() and all xmldb get functions. 2020-08-03 13:57:04 +02:00
Olof hagsand
daeab85446 removed obsolete example yang, mod cli_dbxml to only append leaf in cli_set 2020-07-30 22:52:42 +02:00
Olof hagsand
593ed2ef3b Added const char * in multiple places 2020-07-02 19:25:48 +02:00
Olof hagsand
c049a397b0 Fixed ssl client certs for evhtp.
* Added SSL cert info as options: CLICON_SSL_SERVER_CERT, CLICON_SSL_SERVER_KEY, CLICON_SSL_CA_CERT
Added config.sh for testing for autotools
2020-07-01 15:11:22 +02:00
Olof hagsand
9c82e97072 Added http support for evhtp (not only https) 2020-06-29 14:41:08 +02:00
Olof hagsand
c2e459e8bb Three errors in new upgrade code: DEL didnt work, empty config did now work, neither did no yang files in a dir 2020-06-27 13:02:04 +02:00
Olof hagsand
8f1de15ad3 Changed module-specific upgrade API, not backward compatible. The API has been simplified which means more has to be done by the programmer.
* In summary, a user registers an upgrade callback per module. The callback is called at startup if the module is added, has been removed or if the revision on file is different from the one in the system.
  * The register function has removed `from` and `rev` parameters: `upgrade_callback_register(h, cb, namespace, arg)`
  * The callback function has a new `op` parameter with possible values: `XML_FLAG_ADD`, `XML_FLAG_CHANGE` or `XML_FLAG_CHANGE`: `clicon_upgrade_cb(h, xn, ns, op, from, to, arg, cbret)`
2020-06-26 14:39:04 +02:00
Olof hagsand
e2b3cdb3f6 Moved restconf_stream.c -> restconf_stream_fcgi.c, made some generaizations and documented what was hardcoded to FCGI 2020-06-23 15:00:41 +02:00
Olof hagsand
73bbcded87 Added restconf handle specialization to implement restconf parameters 2020-06-22 12:47:43 +02:00
Olof hagsand
0adcd94f3f * Added new cli show functions to work with cligen_output for cligen pageing to work. To acheive this, add a callback function as follows:
* xml2txt(...) --> xml2txt_cb(..., cligen_output)
  * xml2cli(...) --> xml2cli_cb(..., cligen_output)
  * clicon_xml2file(...) --> clicon_xml2file_cb(..., cligen_output)
  * xml2json(...) --> xml2json_cb(..., cligen_output)
  * yang_print(...) --> yang_print_cb(..., cligen_output)
2020-06-17 14:04:19 +02:00
Olof hagsand
5120409a56 Auto-cli updates and sync with clixon-docs 2020-06-15 16:07:04 +02:00
Olof hagsand
ff5462ecac Replaced the global variable debug with access function: clicon_debug_get(). 2020-06-09 16:04:49 +02:00
Olof hagsand
14b03f63a3 all clixon event functions prepended with clixon_
Replaced fcgi getparam code with clixon-data parameters
2020-06-05 16:19:03 +02:00
Olof hagsand
8c1372d26a libhttp compile 2020-05-28 17:19:15 +02:00
Olof hagsand
bf04131e54 Added decriptive error message when plugins produce invalid state XML. 2020-05-10 17:10:07 +02:00
Olof hagsand
bc0eb921d0 Added functionality to restart an individual plugin.: New clixon-lib:restart-plugin RPC 2020-05-04 15:04:02 +02:00
Olof hagsand
592c513b83 Fix up state bypass get code 2020-05-04 13:10:43 +02:00
Olof hagsand
94cf4a88b3 * Optimizations
* Reduced memory for attribute and body objects, see `XML_NEW_DIFFERENTIATE` compile-time option.
  * Optimized cbuf handling in parsing and xml2cbuf functions.
  * Optimized xml scanner to read strings rather than single chars
  * Optimized xml_merge for the case of disjunct trees.
2020-04-28 22:31:58 +02:00
Olof hagsand
9a8c6cf3e6 * New clixon-lib@2020-04-23.yang revision
* Added: stats RPC for clixon XML and memory statistics.
  * Added: restart-plugin RPC for restarting individual plugins without restarting backend.
* xml-stats moved from clixon-config.yang as state data to an rpc `datastats` in clixon-lib.yang
* Experimental: restart_plugin
* Two new plugin callbacks added
  * ca_daemon: Called just after a server has "daemonized", ie put in background.
  * ca_trans_commit_done: Called when all plugin commits have been done.
    * Note: If you have used "end" callback and usign transaction data, you should probably use this instead.
2020-04-28 22:10:06 +02:00
Olof hagsand
1c99bd6a9b * xml-stats moved from clixon-config.yang as state data to an rpc datastatsin clixon-lib.yang
* Two new plugin callbacks added
  * ca_daemon: Called just after a server has "daemonized", ie put in background.
  * ca_trans_commit_done: Called when all plugin commits have been done.
2020-04-23 22:58:57 +02:00
Olof hagsand
65806f1ef2 Copyright change: LLC -> LLC(Netgate) 2020-04-23 16:55:56 +02:00
Olof hagsand
04017c97ba Length of xml vector in many structs changed from to since it is a vector size, not byte size. This includes transaction_data_t 2020-04-21 10:17:09 +02:00