Commit graph

141 commits

Author SHA1 Message Date
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
Olof Hagsand
bb6d043d6c deprecated readdir_r with readdir 2018-08-05 16:34:45 +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
f2d2b0a8c0 readme start nginx 2018-07-22 20:49:16 +02:00
Olof hagsand
9776ee864f * Makefile change: Removed the make include file: clixon.mk and clixon.mk.in
* These generated the Makefile variables: clixon_DBSPECDIR, clixon_SYSCONFDIR, clixon_LOCALSTATEDIR, clixon_LIBDIR, clixon_DATADIR which have been replaced by generic autoconf variables instead.
2018-07-22 18:33:13 +02:00
Olof Hagsand
524e7e38f0 docker_example 2018-07-21 17:08:50 +00:00
Olof Hagsand
3a39b0361a docker update 2018-07-21 17:01:56 +00: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
0c5ef826d2 clicon group in example clarification 2018-07-13 16:58:19 +02:00
Olof hagsand
fd19640579 Added systemd example files under example/systemd 2018-07-13 13:13:11 +02:00
Olof hagsand
ee946a00f5 Changed plugin_init() backend return semantics: If returns NULL, _without_ calling clicon_err(), the module is disabled.
Also, example documentation corrected according to:
https://github.com/clicon/clixon/issues/33
2018-07-13 12:44:59 +02:00
Olof hagsand
8b31d83806 CDATA xml support (patch by David Cornejo, Netgate) 2018-06-13 21:46:32 +02:00
Olof hagsand
dacd2fe3a0 replace obsolete cvec_find_var with cvec_find 2018-06-08 15:54:43 +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
c5991c9844 * Added a generated CLI show command that works on the generated parse tree with auto completion.
* A typical call is: 	show @datamodel:example, cli_show_auto("candidate", "json");
  * The example contains a more elaborate example.
  * Thanks ngashok for request, see https://github.com/clicon/clixon/issues/24
2018-06-05 16:45:43 +02:00
Olof hagsand
0ad6703663 xmlns sanity check 2018-06-05 16:43:43 +02:00
Olof hagsand
7e4e1d6deb * Support for YANG identity and identityref according to RFC 7950 Sec 7.18 and 9.10
* Previous support did no validation of values.
  * Validation of types and CLI expansion
  * Example extended with inclusion of iana-if-type RFC 7224 interface identities
2018-06-03 15:36:05 +02:00
Olof hagsand
5bc39a9bc0 from 3.6.1: * https://github.com/clicon/clixon/issues/23 clixon_cli failing with error
* The example included a reference to nacm yang file which did not exist and was not used
* Added clixon-config@2018-04-30.yang
2018-05-29 22:27:41 +02:00
Olof hagsand
8b7cabeb36 * https://github.com/clicon/clixon/issues/23 clixon_cli failing with error
* The example included a reference to nacm yang file which did not exist and was not used
* Added clixon-config@2018-04-30.yang
2018-05-29 22:17:55 +02:00
Olof hagsand
cfe4702069 * Added cligen variable translation.
* See FAQ and example
2018-05-28 22:50:22 +02:00
Olof hagsand
7532fdde77 * INSTALLFLAGS added with default value -s(strip).
* For debug do: CFLAGS=-g INSTALLFLAGS= ./configure
2018-04-30 12:06:19 +02:00
Olof hagsand
1ac57dedaf Some memleaks and last minute 3.6 release changes. 2018-04-29 18:35:06 +02:00
Olof hagsand
d57a6cf53c * plugin_start() callbacks added for restconf
* Hard-wired users for authentication example
2018-04-24 17:43:19 +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
Renato Botelho do Couto
dabf0e5918 Improve permissions and strip binaries
- Use 0755 for directories
- Use 0644 for libraries, includes and shared files
- Use -s (strip) parameter when installing binaries and libraries
2018-04-23 13:33:21 -05:00
Olof hagsand
1913407e52 Replacing remaining badrequest() with proper restconf error msg. 2018-04-22 20:13:54 +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
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
2e00411621 CLI plugin API restructuring completed. Now all plugin APIs have the generic form
documented in README and FAQ.
2018-04-08 11:32:43 +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
843b6abbcb plugin API remake 2018-04-04 09:51:47 +00:00
Olof hagsand
b9a54f07f3 Restructure and more generic plugin API for backend 2018-04-02 19:27:57 +02:00
Olof hagsand
6ed769e082 The Clixon example has changed name from routing to example affecting all config files, plugins, tests, etc. 2018-04-02 13:18:47 +02:00
Olof hagsand
79e3fbdaa9 * Restructure and more generic plugin API (cli,backend,restconf,netconf)
* For preparation for authorization RFC8341
  * Plugins add clixon_plugin_init() and api struct for function pointers, eg:
```
static const struct clixon_plugin_api api = {
    "example",
    clixon_plugin_init,
    ...
}
clixon_plugin_api *clixon_plugin_init(clicon_handle h)
{
    return (void*)&api;
}
```
  * Moved specific plugin functions from apps/ to generic functions in lib/
    * New generic plugin load function: clixon_plugins_load()
  * Removed client-local netconf plugins netconf_plugin_callbacks()
    * This was code used before generic YANG rpc calls
  * Added username to clixon handle:
    * clicon_username_get() / clicon_username_set()
  * Added authentication plugin callback
  * Removed some obscure plugin code that seem not to be used (please report if needed!)
    * CLI parse hook
    * CLICON_FIND_PLUGIN
    * clicon_valcb()
* Removed username to rpc calls (added below)
2018-04-02 10:38:53 +02:00
Olof hagsand
bfce20c760 * Added Clixon Restconf library
* Builds and installs a new restconf library: libclixon_restconf.so and clixon_restconf.h
  * The restconf library can be included by a restconf plugin.
  * Example code in example/Makefile.in and example/restconf_lib.c
* Authorization
  * Example extended with authorization
  * Test added with http basic authorization (test/test_auth.sh)
  * Documentation in FAQ.md
* README.md extended with new yang, netconf, restconf, datastore, and auth sections.
2018-03-25 15:47:27 +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
35b142cf4d * Added Yang "extension" statement. This includes parsing unknown
statements and identifying them as extensions or not. However,
  semantics for specific extensions must still be added.
* Renamed ytype_id and ytype_prefix to yarg_id and yarg_prefix, respectively

* Added cli_show_version()
2018-02-25 20:01:53 +01:00
Olof hagsand
cd33380368 Fixed empty restconf data segv; error restconf quit; etc 2018-01-16 22:25:55 +01:00
Olof hagsand
38f0b446fa 2017->2018 2018-01-01 12:25:33 +01:00
Olof Hagsand
4742fde1e9 XML creation and parse API changes 2017-12-09 14:14:40 +01:00
Olof hagsand
e169485985 Datastore cache introduced; Added yang to XML API 2017-12-02 14:49:49 +01:00
Olof hagsand
96bc17bfa6 describe startup modes in faq 2017-11-19 18:27:25 +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
8b6bb6ff50 restconf bugs and increased restconf testing 2017-11-19 12:40:32 +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