Commit graph

119 commits

Author SHA1 Message Date
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
911e6e6ed3 stream debugging 2018-11-01 21:34:27 +01:00
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
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
a4e29bcdb7 * All yang modules are stored in the clicon_dbspec_yang() option.
* Except clixon-config module due to bug reported below
* Bug: Top-level Yang symbol cannot be called "config" in any imported yang file.
  * datastore uses "config" as reserved keyword for storing any XML whoich collides with code for detecting Yang sanit
2018-10-19 15:26:22 +02:00
Olof hagsand
40cda7b6a4 * ietf-netconf yang module added with candidate, validate, startup and xpath features enabled.
* Added urn:ietf:params:netconf:capability:yang-library:1.0
* Thanks SCadilhac for helping out, see https://github.com/clicon/clixon/issues/39
* uri_percent_encode() and xml_chardata_encode() changed to use stdarg parameters
2018-10-17 22:36:59 +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
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
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
656800cdd3 order backend cmd options; open syslog only if syslog is enabled 2018-08-01 07:13:33 +00:00
Olof Hagsand
c53f3f2fe3 Added file logging (-l f or -l f<file>) for cases where neither syslog nor stderr is useful\
.
2018-07-30 17:35:45 +00:00
Olof Hagsand
e48f8dd00e clixon_netconf -S is obsolete. Use clixon_netconf -l s instead.
* Unified log handling for all clicon applications using -l e|o|s|f.
  * The options stand for e:stderr, o:stdout, s: syslog, f:file
2018-07-29 19:41:10 +02:00
Olof Hagsand
5164db3603 Added clicon_log_init(.., CLICON_LOG_FILE) option and clicon_log_file() for c\
ases where neither syslog or stderr is useful.
2018-07-26 20:13:02 +02:00
Olof Hagsand
968435ec5e internal backend socket family 2018-07-25 12:45:00 +02:00
Olof Hagsand
666d74bf1b Added -l option for clixon_backend for directing syslog to stderr or stdout i\
f running in foreground
2018-07-24 17:59:17 +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
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
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
3758c8dab4 * The following backward compatible options to configure have been obsoleted. If you havent already migrated this code you must do this now.
* Backend startup modes prior to 3.3.3. As enabled with `configure --with-startup-compat`. Configure option CLICON_USE_STARTUP_CONFIG is also obsoleted.
  * Configuration files (non-XML) prior to 3.3.3. As enabled with `configure --with-config-compat`. The template clicon.conf.cpp files are also removed.
  * Clixon XML C-lib prior to 3.4.0. As enabled with `configure --with-xml-compat`
2018-01-01 14:48:57 +01:00
Olof hagsand
38f0b446fa 2017->2018 2018-01-01 12:25:33 +01:00
Olof hagsand
79767045ad mem leaks 2017-12-31 12:05:21 +01:00
Olof hagsand
174cfc02c6 Added CLICON_XMLDB_PRETTY option. If set to false, XML database files will be more compact.
Added CLICON_XMLDB_FORMAT option. Default is "xml". If set to "json", XML database files uses JSON format.
Escape " in JSON names and strings and values
Optimized search performance for large lists by sorting and binary search.
2017-12-29 18:09:26 +01:00
Olof Hagsand
ca16007b66 Clixon_backend now returns -1/255 on error instead of 0 2017-12-12 22:40:28 +01:00
Olof Hagsand
dd7f790193 Fixed bug that deletes running on startup if backup started with -m running 2017-12-10 15:29:22 +01:00
Olof Hagsand
4742fde1e9 XML creation and parse API changes 2017-12-09 14:14:40 +01:00
Olof hagsand
056b5c97dd experimental netconf yang spec 2017-12-08 19:37:09 +01:00
Olof hagsand
4cb00bedfa optimization 2017-12-03 20:22:05 +01:00
Olof hagsand
e169485985 Datastore cache introduced; Added yang to XML API 2017-12-02 14:49:49 +01:00
Olof hagsand
2ebd89d636 Added --with-config-compat and --with-startup-compat to configure 2017-11-23 20:51:33 +01:00
Olof hagsand
96a7ec86f0 Fixed DESTDIR make install/uninstall and break immediately on errors 2017-11-22 22:21:12 +01:00
Olof Hagsand
3d3ecd4e4d startup_mode: did not clear running 2017-11-20 22:25:55 +01:00
Olof hagsand
548ffd2da6 Disabled key-value datastore; Removed mandatory requirements for BACKEND, NETCONF, RESTCONF and CLI dirs 2017-11-19 18:04:23 +01:00
Olof hagsand
496d676ad3 Backend daemon startup modes 2017-11-19 11:52:30 +01:00
Olof hagsand
4b0c060667 Added option CLICON_CLISPEC_FILE; Replaced cli_ functiuons with cligen_ 2017-10-17 19:35: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
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
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
4bcb966dac xmldb_init -> xmldb_create 2017-05-02 22:29:56 +02:00