Commit graph

324 commits

Author SHA1 Message Date
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
7a4371e76f debug function 2018-04-07 08:09:55 +00: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
7fbd95d491 Updated ietf-netconf-acm to ietf-netconf-acm@2018-02-14.yang from RFC 8341 2018-04-02 13:33:24 +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
0e52e86c0f CHANGELOG formatting 2018-04-02 11:15:24 +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
b8e35742b9 README update 2018-03-25 16:04:30 +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
cce76faa79 Fixed three-key list entry problem (reported by jdl@netgate) 2018-03-24 14:37:36 +01:00
Olof hagsand
835674bbe0 \r\n in restconf code and tests 2018-03-22 21:33:41 +01:00
Olof hagsand
ba3ca7e07f added clixon_netconf_lib.h 2018-03-20 18:39:24 +01: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
52e510cfdf The key-value datastore is no longer supported. Use the default text datastore. 2018-03-18 16:57:18 +00:00
Olof hagsand
9b951b5ce6 restconf json err return: too many {} 2018-03-13 23:17:36 +00:00
Olof hagsand
03be9c0567 Restconf error handling 2018-03-11 22:49:10 +01:00
Olof hagsand
96a3b586b8 Restconf error handling 2018-03-11 20:25:31 +01:00
Olof hagsand
859d424ea3 (Work in progress) Restconf error handling for get and edit operations 2018-03-11 20:17:11 +01:00
Olof hagsand
0a11445963 cprintf sanity checks 2018-03-10 12:35:11 +01:00
Olof hagsand
11e2b91a05 Experimental: Added CLICON_TRANSACTION_MOD configurqation option. If set,
modifications in validation and commit callbacks are written back
  into the datastore.
2018-03-07 22:33:47 +01:00
Olof hagsand
695aef2cb6 changelog 2018-03-07 21:12:10 +01:00
Olof Hagsand
ac7480b9f5 * Invalid key to api_path2xml gives warning instead of error and quit. 2018-03-05 20:00:10 +00:00
Olof hagsand
990700b68d https://github.com/clicon/clixon/issues/16
Added restconf/operations get, see RFC8040 Sec 3.3.2:
2018-03-04 21:24:38 +01:00
Olof hagsand
6a22524d38 Fix issue: https://github.com/clicon/clixon/issues/15 Replace whole config 2018-02-25 20:09:11 +01:00
Olof hagsand
e9b61d4ed7 Merge branch 'develop' of https://github.com/clicon/clixon into develop 2018-02-25 20:02:55 +01: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
1e88c38877 translate xml->json \n correctly 2018-02-17 20:51:42 +00:00
Olof hagsand
2acacbf087 Use <config> instead of <data> when save/load configuration 2018-02-15 09:29:10 +07:00
Olof hagsand
67f4478f76 Merge branch 'master' into develop 2018-02-13 09:42:06 +07:00
Olof hagsand
439bacf2e4 FAQ update 2018-02-13 09:41:11 +07:00
Olof hagsand
278f3de840 Adding username to all restconf backend calls 2018-02-13 09:17:32 +07:00
Olof hagsand
36d310de88 developbranch 3.6.0.PRE 2018-02-12 09:18:52 +07:00
Olof hagsand
1b51c5d7c4 Merge branch 'master' into develop 2018-02-12 09:17:18 +07:00
Olof hagsand
54826065a9 3.5.0 2018-02-12 09:14:01 +07:00
Olof hagsand
6c2327a0b8 Merge branch 'develop' for 3.5.0 2018-02-12 09:11:40 +07:00
Olof hagsand
7431757e53 Preparing for 3.5.0 2018-02-12 09:05:27 +07:00
Olof hagsand
6b0e0a9d18 preparations for 3.5.0 2018-02-11 16:46:10 +07:00
Olof hagsand
55010e7541 restconf credentials plugin 2018-02-09 12:18:39 +07:00
Olof hagsand
e40d785d5c * Added a "user" parameter to plugin_credentials() restconf callback.
To enable authentication and in preparation for access control a la RFC 6536.
* yang string length "max" keyword set to MAXPATHLEN
2018-02-08 15:24:05 +07:00
Olof Hagsand
3ffe68d124
Merge pull request #13 from rbgarga/fix_config_path2
Make default config to respect sysconfdir
2018-02-07 13:31:20 +01:00
Renato Botelho do Couto
d670b6af8a Make default config to respect sysconfdir
Instead of hardcode default config to /etc/clixon.xml, make it to
respect sysconfdir variable. Since autoconf doesn't expand variables on
header substitution it would end up being defined on clixon_config.h as
"${prefix}/etc/clixon.xml" what makes no sense for the header file.

Use eval to expand ${sysconfdir} and make .h file to be defined with
final directory name.
2018-02-07 02:50:02 -06:00
Olof hagsand
eea8cd7660 xml2cvec: range error (eg 1000 for int8) is not treated as error, just log and skip. 2018-02-03 14:56:27 +07:00
Olof hagsand
2bbf0b8a15 xml2json dont put doublequotes on numbers and bool values in json 2018-02-02 16:35:37 +07:00
Olof hagsand
ffe77c9127 restconf performance test 2018-01-27 14:46:53 +01:00
Olof hagsand
f65187df7f code cleanup 2018-01-27 14:28:57 +01:00
Olof hagsand
7db1de19de Merge branch 'develop' of https://github.com/clicon/clixon into develop 2018-01-27 13:33:16 +01:00
Olof hagsand
9914847d6a GET Single element JSON lists use {list:[element]}, not {list:element}. 2018-01-27 13:32:51 +01:00
Olof Hagsand
ed8c371fce
Merge pull request #8 from mgsmith1000/develop
Augment help text for --with-configfile
2018-01-25 22:32:12 +01:00
Olof hagsand
99abac76a7 Fix for cli expansion of two variables 2018-01-25 22:16:44 +01:00