Commit graph

66 commits

Author SHA1 Message Date
Olof hagsand
fa9b9c7e2e Stream debug and tests 2018-10-30 22:28:24 +01:00
Olof hagsand
f23a21d5db stream replay and subscription update 2018-10-28 21:07:13 +01:00
Olof hagsand
fb0d0606e3 stream replay and subscription update 2018-10-28 17:17:36 +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
65c44b41e8 RFC 7895:
* Changed Netconf hello to single capabilty urn:ietf:params:netconf:capability:yang-library:1.0 according to YANG 1.1 RFC7950 Sec 5.6.4.
  * Set by option: CLICON_MODULE_LIBRARY_RFC7895 - enabled by default
  * Option CLICON_MODULE_SET_ID is set and changed when modules change.
2018-10-12 18:41:53 +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
Olof hagsand
07542269ec Event stream discovery support
Added config options CLICON_MODULE_LIBRARY_RFC7895, CLICON_STREAM_DISCOVERY_RFC5277, LICON_STREAM_DISCOVERY_RFC804
2018-09-23 17:45:22 +02:00
Olof hagsand
74fc0800ae * Limited support of RFC 7895 YANG Module Library to list modules:
* That is, limited support of: ietf-yang-library.yang
  * For example: `<module><name>example</name><revision/></module><module><name>ietf-restconf-monitoring</name><revision>2017-01-26</revision></module>...`
* Comply to RFC 8040 3.5.3.1 rule: api-identifier = [module-name ":"] identifier
  * The "module-name" was a no-op before.
  * This means that there was no difference between eg: GET /restconf/data/ietf-yang-library:modules-state and GET /restconf/data/XXXX:modules-state
2018-09-22 16:30:58 +02:00
Olof hagsand
0631be19cb * Notification event streams enhancements
* Yang 1.1 notification support
  * Event stream discovery support according to RFC 5277 Sec 3.2.5.1 (netconf) and RFC 8040 (restconf)
2018-09-18 22:49:29 +02:00
Olof hagsand
56e51f1a8d 3.8.0.PRE preparations and
* Obsoleted COMPAT_CLIV and COMPAT_XSL that were optional in 3.7
2018-07-22 21:29:21 +02:00
Olof hagsand
deb89600ed memleaks 2018-07-20 23:16:26 +02:00
Olof hagsand
0eb9e6c8b2 * Support for YANG conditionals "must" and "when" according to RFC 7950 Sec 7.5.3 and 7.21.5
* XPATH checked at validation time
2018-07-18 09:51:33 +02:00
Olof hagsand
ba7f84afee * Much better support for XPATH 1.0 according to https://www.w3.org/TR/xpath-10 using yacc/lex
* NOTE: Due to an error in the previous implementation, all XPATH calls on the form `x[a=str]` where `str` is a string (not a number or XML symbol), must be changed to: `x[a='str'] or x[a="str"]`
    * This includes all calls to `xpath_vec, xpath_first`, etc.
    * All calls to cli_copy_config in CLI spec files must replace 2nd argument from `x[%s=%s]` to `x[%s='%s']`
  * The old API is stillenabled. To define the new, define XPATH_USE_NEW in include/clixon_custom.h and recompile
2018-07-17 16:59:32 +02:00
Olof hagsand
5e587b3a01 Validation of yang bits type space-separated list value 2018-06-10 10:41:06 +02:00
Olof hagsand
5cabc11bfb * Added -U <user> command line to clixon_cli and clixon_netconf for NACM pseudo-user tests 2018-06-07 21:34:52 +02:00
Olof Hagsand
20a677cb6c code cleanup and doc 2018-05-12 19:00:46 +02:00
Olof hagsand
602f5034b4 NACM external file support. CLICON_NACM_FILE config option, if CLICON_NACM_MODE is external 2018-04-23 23:09:55 +02:00
Olof hagsand
3ed1c98556 * Fixed issue https://github.com/clicon/clixon/issues/18 RPC response issues reported by Stephen Jones at Netgate 2018-04-22 16:53:12 +02:00
Olof hagsand
67c0abead7 Fixed issue https://github.com/clicon/clixon/issues/17 special character in strings can break RPCs 2018-04-21 16:32:46 +02:00
Olof hagsand
7650803475 * Experimental NACM RFC8341 Network Configuration Access Control Model.
* CLICON_NACM_MODE config option, default is disabled.
  * Added username attribute to all rpc:s from frontend to backend
  * Added NACM backend module in example
2018-04-19 22:44:15 +02:00
Olof hagsand
d541c49c6f Plugin RPC callback interface have been unified between backend, netconf and restconf.
* Backend RPC register callback function (Netconf RPC or restconf operation POST) has been changed from: `backend_rpc_cb_register()` to `rpc_callback_register()`
    * Backend RPC callback signature has been changed from: `int cb(clicon_handle h, cxobj *xe, struct client_entry *ce, cbuf *cbret, void *arg)` has been changed to : `int cb(clicon_handle h, cxobj *xe, struct client_entry *ce, cbuf *cbret, void *arg)`
    * Frontend netconf and restconf plugins can register callbacks as well with same API as backends.
2018-04-07 18:20:33 +02:00
Olof hagsand
b9a54f07f3 Restructure and more generic plugin API for backend 2018-04-02 19:27:57 +02:00
Olof hagsand
efa72e9e6f * Proper RFC 6241 Netconf error handling
* New functions added in clixon_netconf_lib.[ch]
  * Datastore code modified for RFC 6241
  * Remaining: validate, generic restconf and netconf code
2018-03-18 18:06:02 +00:00
Olof hagsand
55010e7541 restconf credentials plugin 2018-02-09 12:18:39 +07:00
Olof hagsand
38f0b446fa 2017->2018 2018-01-01 12:25:33 +01:00
Olof hagsand
19301ae240 sort xml children on parsing 2017-12-31 18:25:53 +01:00
Olof hagsand
013a0dba14 editt changelog 2017-11-19 19:11:34 +01:00
Olof hagsand
61551b07d6 When user callbacks p_statedata() clixon_backend nolonger silently exit 2017-11-14 23:14:51 +01:00
Olof Hagsand
3c41a79102 hen user callbacks such as statedata() call returns -1, clixon_backend no
longer silently exits. Instead a log is printed and an RPC error is returned.
2017-11-12 15:50:22 +00:00
Olof hagsand
d9c126eed0 en user callbacks such as statedata() call returns -1, clixon_backend no
longer silently exits. Instead a log is printed and an RPC error is returned.
2017-11-12 16:48:48 +01:00
Olof Hagsand
178a09cf3b Removed unused functions: cli_exec, cli_ptpush, cli_ptpop 2017-10-21 19:15:24 +02:00
Olof hagsand
ed8f145968 use-before-assign 2017-07-28 20:53:46 +02:00
Olof hagsand
5ae1aeb427 Added support for YANG anyxml; Yang union CLI generation and validation; Removed yang string escaping 2017-07-27 11:54:28 +02:00
Olof hagsand
2d65fdbe93 Changed top-level netconf get-config and get to return <data>..</data> instead of <data><config>...</config></data> to comply to the RFC. 2017-07-23 14:45:33 +02:00
Olof hagsand
e5b625e722 Added support for yang presence and no-presence containers. 2017-07-23 12:59:02 +02:00
Olof hagsand
4e986d6660 Added new backend plugin callback: plugin_statedata() for getting state data; Added generic xml_merge() function. 2017-07-05 12:30:42 +02:00
Olof hagsand
f5c19d8586 Added state data 2017-07-01 17:42:39 +02:00
Olof hagsand
abd3eee17d Generic map_str2int generic mapping tables; Removed vector return values from xmldb_get() 2017-06-21 21:02:09 +02:00
Olof hagsand
3453dae0db - removed api_path extension from internal netconf
- Strings in xmldb_put not properly encoded, eg eth/0 became eth.00000
2017-05-30 21:57:06 +02:00
Olof hagsand
a18f66b6d0 Preparing for 3.3.0 2017-05-07 17:38:43 +02:00
Olof Hagsand
9c4ac8678d Merge branch 'develop' of https://github.com/clicon/clixon into develop 2017-05-07 16:15:11 +02:00
Olof Hagsand
24578767e7 sigpipe problems 2017-05-07 16:14:49 +02:00
Olof hagsand
4bcb966dac xmldb_init -> xmldb_create 2017-05-02 22:29:56 +02:00
Olof hagsand
69ff0e3891 Refined netconf none semantics in tests and text datastore 2017-05-01 12:46:09 +02:00
Olof hagsand
ee9b74d735 formalizing xmldb api 2017-04-16 19:06:19 +02:00
Olof hagsand
236b661e43 cleaned up string functions 2017-04-04 17:11:21 +02:00
Olof Hagsand
18093441a8 revert xsl for . and .. 2017-04-03 15:21:13 +02:00
Olof hagsand
19813a4d9c restconf post/put/head/patch, memtests 2017-03-26 15:14:37 +02:00