Commit graph

137 commits

Author SHA1 Message Date
Olof hagsand
a0abf8436e XML chanelog revision 2019-03-25 10:42:27 +01:00
Olof hagsand
3f68cca06c * New yang changelog experimental feature for automatic upgrade
* Added modules-state diff parameter to xmldb_get datastore function for startup scenarios.
* Allowed Yang extended Xpath functions (syntax only):
  * re-match, deref, derived-from, derived-from-or-self, enum-value, bit-is-set
* XSD regular expression handling of dash(`-`)
  *: Translate XDS `[xxx\-yyy]` to POSIX `[xxxyyy-]`.
* YANG Anydata treated same as Anyxml
2019-03-21 18:05:55 +01:00
Olof hagsand
606245ef02 * Added flags to example backend to control its behaviour:
* Start with `-- -r` to run the reset plugin
  * Start with `-- -s` to run the state callback
* Rewrote yang dir load algorithm to follow the algorithm in [FAQ](FAQ(doc/FAQ.md#how-are-yang-files-found) with more precise timestamp checks, etc.
2019-03-18 16:31:34 +01:00
Olof hagsand
b54e6c1cc0 example regression fail
FAQ table-of-content
2019-03-10 18:33:17 +01:00
Olof hagsand
b1c74b5f1f * Ensured you can add multiple callbacks for any RPC, including basic ones.
* Extra RPC:s will be called _after_ the basic ones.
  * One specific usecase is hook for `copy-config` (see [doc/ROADMAP.md] that can be implemented thus way.
* `rpc_callback_register` added a namespace parameter. Example:
   ```
     rpc_callback_register(h, empty_rpc, NULL, "urn:example:clixon", "empty");
   ```
2019-03-10 17:27:52 +01:00
Olof hagsand
8cfd72c2c5 Merge branch 'develop' 2019-03-06 09:44:43 +01:00
Olof hagsand
98fb6eceef * Clixon configuration file top-level symbols has changed to clixon-configand namespace check is enforced.
* clixon-config YAML file has new revision: 2019-03-05.
  * New URN and changed top-level symbol to `clixon-config`
* Removed obsolete `_CLICON_XML_NS_STRICT` variable and `CLICON_XML_NS_STRICT` config option.
2019-03-06 09:42:55 +01:00
Olof hagsand
efe44d60e8 Added base as CLI default mode and cli 2019-03-05 16:19:20 +01:00
Olof hagsand
2394c6f46e Merge branch 'modules-state' 2019-02-26 16:53:59 +01:00
Olof hagsand
560110b4e8 * New backend startup and upgrade support, see [doc/startup.md] for details
* Datastore files contain RFC7895 module-state information
2019-02-26 15:48:15 +01:00
Olof hagsand
54626aaae4 Documented Clixon CLIgen usage and extensions 2019-02-13 15:20:42 +01:00
Olof Hagsand
860c0c042d Added RCLOG for redirecting restconf logs at tests; with-restconf error in example 2019-02-12 13:19:52 +01:00
Olof Hagsand
973e5d7507 Example makfile honors --without-restconf 2019-02-11 21:13:12 +01:00
Olof Hagsand
663088e393 makefile cleanup for docker and example 2019-02-11 21:05:24 +01:00
Olof Hagsand
7e38dc57e3 Merge branch 'master' of https://github.com/clicon/clixon 2019-02-08 16:19:22 +01:00
Olof Hagsand
2b596591f1 Added Clixon example full system docker container, see [docker/system]. 2019-02-07 22:23:58 +01:00
Olof hagsand
5b1c3d9a86 * clixon-config YAML file has new revision: 2019-02-06.
* Replaced all calls to (obsolete) `cli_output` with `fprintf`
* Added _experimental_ config option `CLICON_CLI_UTF8` default set to 0.
  * CLIgen UTF8 does not work with scrolling and control editing
2019-02-06 14:33:04 +01:00
Olof hagsand
02d725b2c0 * xml_cmp() respects 'ordered-by user' for state nodes, which violates RFC 7950 [https://github.com/clicon/clixon/issues/63. (Thanks JDL) 2019-02-03 16:19:33 +01:00
Olof hagsand
cf4f626719 Merge branch 'nacm' into develop 2019-02-02 11:38:02 +01:00
Olof hagsand
ffecebf32a * NACM Data node READ access module support (RFC8341 3.4.5)
* Access control points added for `get` and `get-config` in addition to incoming rpc.
   * RFC 8341 Example A.2 implemented, see: [test/test_nacm_module.sh]
* Added `username` argument on `xmldb_put()` datastore function for NACM data-node write checks
* Added `xml_rootchild_node()` lib function as variant of `xml_rootchild()`
2019-01-27 13:26:15 +01:00
Olof hagsand
7113026e17 example client-rpc similar to other example rpc:s 2019-01-22 18:37:21 +01:00
Olof hagsand
04bb05c83f Upgrade testcases for nacm 2019-01-22 13:41:03 +01:00
Olof hagsand
0e09996073 verify empty body and/or empty yang input/output 2019-01-21 14:28:44 +01:00
Olof hagsand
0267afcb21 * Added -o "<option>=<value>" command-line option to all programs: backend, cli, netconf, restconf.
* Added -p <dir> command-line option to all programs: backend, cli, netconf, restconf.
* Moved and updated all standard ietf and iana yang files from example and yang/ to `yang/standard`.
* Renamed example yang from example.yang -> clixon-example.yang
2019-01-13 17:34:15 +01:00
Olof hagsand
5b6af82e29 Validation of mandatory choice and recursive mandatory containers. 2019-01-05 11:08:16 +01:00
Olof hagsand
7a8f242a09 Added new clixon-lib yang module for internal netconf protocol. Currently only extends the standard with a debug RPC. 2019-01-02 22:50:03 +01:00
Olof hagsand
6c48165340 three-valued return values for datastore text_modify 2019-01-02 18:20:50 +01:00
Olof hagsand
32ea957a52 CLICON_XML_SORT option (in clixon-config.yang) has been removed and set to true permanently since setting it to false is obsolete. 2019-01-02 17:43:58 +01:00
Olof hagsand
0103d58994 2019 2019-01-02 15:48:30 +01:00
Olof hagsand
0baebc93fd * Strict namespace setting can be a problem when upgrading existing database files, such as startup-db or persistent running-db, or any other saved XML file.
* For backward compatibility, load of startup and running set CLICON_XML_NS_STRICT to false temporarily.
* Added three-valued return values for several validate functions where -1 is fatal error, 0 is validation failed and 1 is validation OK.
  * This includes: `xmldb_put`, `xml_yang_validate_all`, `xml_yang_validate_add`, `xml_yang_validate_rpc`, `api_path2xml`, `api_path2xpath`
* Added new xml functions for specific types: `xml_child_nr_notype`, `xml_child_nr_notype`, `xml_child_i_type`, `xml_find_type`.
2019-01-02 15:18:29 +01:00
Olof hagsand
861300d6c0 netconf error handling and test summary script 2018-12-21 14:44:59 +01:00
Olof hagsand
f872c7e295 * More precise Yang validation and better error messages
* For Example, adding bad-, missing-, or unknown-element error messages, etc instead of operation-failed
* Removed delete-config support for candidate db since it is not supported in RFC6241.
* Switched the order of `error-type` and `error-tag` in all netconf and restconf error messages to comply to RFC order.
* Added example_rpc RPC to example backend
* Renamed xml_namespace[_set]() to xml_prefix[_set]()
* Some restconf error messages contained "rpc-reply" or "rpc-error" which have now been removed.
* Netconf/Restconf RPC extra input arguments are ignored (https://github.com/clicon/clixon/issues/47)
2018-12-21 01:33:41 +01:00
Olof hagsand
ae1af8da9e * NACM extension (RFC8341)
* NACM module support (RFC8341 A1+A2)
   * Recovery user "_nacm_recovery" added.
     * Example use is restconf PUT when NACM edit-config is permitted, then automatic commit and discard are permitted using recovery user.
   * Example user changed adm1 to andy to comply with RFC8341 example

 * Yang code upgrade (RFC7950)
   * RPC method input parameters validated
     * see https://github.com/clicon/clixon/issues/4
* Correct XML namespace handling
   * XML multiple modules was based on "loose" semantics so that yang modules were found by iterating thorugh namespaces until a match was made. This did not adhere to proper [XML namespace handling](https://www.w3.org/TR/2009/REC-xml-names-20091208), and causes problems with overlapping names and false positives. Below see XML accepted (but wrong), and correct namespace declaration:
```
      <rpc><my-own-method></rpc> # Wrong but accepted
      <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> # Correct
        <my-own-method xmlns="http://example.net/me/my-own/1.0">
      </rpc>
```
   * To keep old loose semantics set config option CLICON_XML_NS_ITERATE (true by default)
   * XML to JSON translator support for mapping xmlns attribute to module name prefix.
   * Default namespace is still "urn:ietf:params:xml:ns:netconf:base:1.0"
   * See https://github.com/clicon/clixon/issues/49
* Changed all make tags --> make TAGS
* Keyvalue datastore removed (it has been disabled since 3.3.3)
* debug rpc added in example application (should be in clixon-config).
2018-12-16 19:49:19 +01:00
Olof hagsand
7d5bfe5c81 YANG parser cardinality checked (https://github.com/clicon/clixon/issues/48) 2018-12-05 22:18:28 +01:00
Olof hagsand
ac1aa44fc4 * Yang Configure options changed
* `CLICON_YANG_DIR` is changed from a single directory to a path of directories
    * Note CLIXON_DATADIR (=/usr/local/share/clixon) need to be in the list
  * CLICON_YANG_MAIN_FILE Provides a filename with a single module filename.
  * CLICON_YANG_MAIN_DIR Provides a directory where all yang modules should be loaded.
* Change all @datamodel:tree to @datamodel in all CLI specification files
  * If you generate CLI code from the model (CLIXON_CLI_GENMODEL).
  * For backward compatibility, define CLICON_CLI_MODEL_TREENAME_PATCH in clixon_custom.h
* Removed return value ymodp from yang parse functions (eg yang_parse()).
* New config option: CLICON_CLI_MODEL_TREENAME defining name of generated syntax tree if CLIXON_CLI_GENMODEL is set.
2018-12-03 21:16:35 +01:00
Olof hagsand
d09a8c08aa getopt return value changed from char to int (https://github.com/clicon/clixon/issues/58) 2018-12-01 18:34:52 +01:00
Olof hagsand
39a5086218 * Yang Support of submodule, include and belongs-to.
* Improved unknown handling
* Configure option `CLICON_YANG_DIR` is changed from a single directory to a path of directories
    * Note CLIXON_DATADIR (=/usr/local/share/clixon) need to be in the list
2018-12-01 18:17:42 +01:00
Olof hagsand
a8f0aad411 * Yang parser is stricter (see cardinality below) which may break parsing of slack yang specs.
* YANG parser cardinality checked (only modules level yet)
  * See https://github.com/clicon/clixon/issues/48
2018-11-18 20:55:57 +01:00
Olof Hagsand
270bf78e1f Backward compatible testing w streams. Nchan manual tests. 2018-11-04 16:56:56 +01:00
Olof hagsand
f2810e849f Fork fcgi handler for streams 2018-11-04 14:46:15 +01:00
Olof hagsand
e4adec413a test stream util function 2018-10-29 22:38:34 +01:00
Olof hagsand
208ccd82a8 Added configure option CLICON_STREAM_RETENTION is default number of seconds before dropping replay buffers
restconf
start-time and stop-time query parameters
stream_register->stream_add
2018-10-29 20:45:11 +01:00
Olof hagsand
f23a21d5db stream replay and subscription update 2018-10-28 21:07:13 +01:00
Olof hagsand
af16760279 * Stream replay support
* RFC8040 Restconf replay support: start-time and stop-time query parameter support
    * This only applies to "native" restconf stream support, Nchan mode has different replay functionality
  * RFC5277 Netconf replay support using <startTime> and
  * Replay support is only in-memory and not persistent. External time-series DB could be added.
2018-10-27 11:12:01 +02:00
Olof hagsand
71eddeaa74 * Restconf stream notification support - two variants.
* Both a "native" stream support and one using nginx/nchan pub/sub.
  * See (apps/restconf/README.md) for details.
* clixon-config YAML file has new revision: 2018-10-21.
2018-10-21 22:19:38 +02:00
Olof Hagsand
d5f4969780 * Set access/subscribe base URL with: CLICON_STREAM_URL_PREFIX (default https\
://localhost/streams).
    * Example: new stream "foo" will get access URL: https://localhost/streams/\
foo
  * Optional pub/sub support enabled by ./configure --enable-publish
    * Set publish URL base with: CLICON_STREAM_PUB_PREFIX (default http://local\
host/pub)
    * Example: new stream "foo" will get pub URL: https://localhost/pub/foo
2018-10-15 22:08:38 +02:00
Olof Hagsand
a23c1ec68d Added CLIXON_DEFAULT_CONFIG=/usr/local/etc/clixon.xml as option and in exampl\
e (so you dont need to provide -f command-line option).
2018-10-11 19:03:35 +00:00
Olof hagsand
ea77e7f02d * YANG Features
* Yang 1.1 feature and if-feature according to RFC 7950 7.20.1 and 7.20.2.
  * See https://github.com/clicon/clixon/issues/41
  * Features are declared via CLICON_FEATURE in the configuration file.
  * logical combination of features not implemented, eg if-feature "not foo or
* Identity without any identityref:s caused SEGV
2018-10-10 20:11:20 +02:00
Olof hagsand
acb8748470 * Generilized top-level yang parsing functions
* Clarified semantics of main yang module:
    * -y option to commands MUST specify filename
    * CLICON_YANG_MODULE_MAIN MUST specify a module
    * yang_parse() changed to take either filename or module name and revision.
  * Removed clicon_dbspec_name[_set]().
    * Use yang_main_module_name() instead.
  * Replaced yang_spec_main with yang_spec_parse_module
  * Added yang_spec_parse_file
2018-10-07 11:04:33 +02:00
Olof hagsand
98f3cd0e32 * Major rewrite of event streams
* If you used old event callbacks API, you need to switch to the streams API
    * See clixon_stream.[ch]
  * Old streams API which needs to be removed include:
    * clicon_log_register_callback()
    * subscription_add() --> stream_register()
    * backend_notify() and backend_notify_xml() - use stream_notify() instead
* Example uses "NETCONF" stream instead of "ROUTING"
* Added timeout option -t for clixon_netconf - quit after max time.
2018-09-30 14:51:30 +02:00