Commit graph

33 commits

Author SHA1 Message Date
Olof hagsand
73bbcded87 Added restconf handle specialization to implement restconf parameters 2020-06-22 12:47:43 +02:00
Olof hagsand
3af184c655 Modify restconf tests to run for both evhtp and fcgi: , curl -sik, etc 2020-06-21 15:49:46 +02:00
Olof hagsand
6e714beea5 * Restconf FCGI (eg via nginx) have changed reply message syntax slightly
* native http: new restconf_err files, generic data input, restconf_methods generalized.
* test: expecteq removed.
2020-06-16 21:51:00 +02:00
Olof hagsand
e898dda016 * Auto-CLI enhancements
* A generated clispec including state (default @datanodestate) also generated along with the config clispec tree (default @datanode)
  * New mode `GT_HIDE` set by option `CLICON_CLI_GENMODEL_TYPE` to collapse non-presence containers that only contain a single list
  * Added a prfix for cli_show_config/cli_show_auto so that it can produce parseable output
  * Thanks dcornejo@netgate.com for trying it out and suggestions
2020-06-13 12:05:26 +02:00
Olof hagsand
e2d9c046af further restconf refactoring 2020-06-11 21:54:09 +02:00
Olof hagsand
14b03f63a3 all clixon event functions prepended with clixon_
Replaced fcgi getparam code with clixon-data parameters
2020-06-05 16:19:03 +02:00
Olof hagsand
a455b15f03 Changed --with-restconf directive to have package as argument, with either null, evhtp or fcgi.
This effects configure script and makefiles
2020-06-04 11:26:38 +02:00
Olof hagsand
e00dffadc5 libevht baseline 2020-06-02 15:49:40 +02:00
Olof hagsand
8c1372d26a libhttp compile 2020-05-28 17:19:15 +02:00
Olof hagsand
ac1f36009f Makefile copyright 2020-05-12 13:59:45 +02:00
Olof hagsand
19e21be0bc Very large commit for upcoming 4.4 release
Major New features

* New and updated search functions using xpath, api-path and instance-id
  * New search functions using api-path and instance_id:
    * C search functions: `clixon_find_instance_id()` and `clixon_find_api_path()`
  * Binary search optimization in lists for indexed leafs in all three formats.
    * This improves search performance to O(logN) which is drastical improvements for large lists.
  * You can also register explicit indexes for making binary search (not only list keys)
  * For more info, see docs at [paths](https://clixon-docs.readthedocs.io/en/latest/paths.html) and
[search](https://clixon-docs.readthedocs.io/en/latest/xml.html#searching-in-xml)

API changes on existing features (you may need to change your code)
* On failed validation of leafrefs, error message changed from: `No such leaf` to `No leaf <name> matching path <path>`.
* CLI Error message (clicon_rpc_generate_error()) changed when backend returns netconf error to be more descriptive:
  * Original: `Config error: Validate failed. Edit and try again or discard changes: Invalid argument`
  * New (example): `Netconf error: application operation-failed Identityref validation failed, undefined not derived from acl-base . Validate failed. Edit and try again or discard changes"

Minor changes

* Test framework
  * Added `-- -S <file>` command-line to main example to be able to return any state to main example.
  * Added `test/cicd` test scripts for running on a set of other hosts
* C-code restructuring
  * clixon_yang.c partitioned and moved code into clixon_yang_parse_lib.c and clixon_yang_module.c and move back some code from clixon_yang_type.c.
    * partly to reduce size, but most important to limit code that accesses internal yang structures, only clixon_yang.c does this now.
2020-02-02 15:52:30 +01:00
Olof Hagsand
d7bb96b9cf FreeBSD modifications: Configure, makefiles and test scripts modification for Freebsd 2019-10-20 09:03:31 -10:00
Olof hagsand
46b6a8008a RESTCONF PATCH (plain patch) is supported according to RFC 8040 4.6.1 2019-08-08 11:42:45 +02:00
Olof hagsand
70ebfa4d80 * Identity/identityref mapped between XML and JSON 2019-07-28 18:09:55 +02:00
Olof hagsand
c1bae276ff * RESTCONF PUT/POST erroneously returned 200 OK. Instead restconf now returns:
* `201 Created` for created resources
  * `204 No Content` for replaced resources.
  * See [RESTCONF: HTTP return codes are not according to RFC 8040](https://github.com/clicon/clixon/issues/56)

* HTTP `Location:` fields added in RESTCONF POST replies
2019-07-25 13:15:31 +02:00
Olof hagsand
434f0b930e Made Makefile concurrent so that it can be compiled with -jN 2019-03-21 10:40:00 +01:00
Olof Hagsand
d64d433468 * Changed base OS in clixon-system container to Alpine
* Moved datastore/text/ code to datastore/ since there is only one type of datastore.
* Added "magic script line" to test script for sourced and scriped exits
2019-02-16 17:45:39 +01:00
Olof hagsand
0103d58994 2019 2019-01-02 15:48:30 +01: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
f9a97c57ca set /www-data access only if sudo 2018-07-29 20:22:20 +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
156660419e * Set dir /www-data with www-data as owner, see https://github.com/clicon/clixo\
n/issues/37
2018-07-26 12:54:14 +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
Renato Botelho do Couto
680753a5e2 Improve permissions and strip binaries (part 2)
- Use 0755 for directories
- Use 0644 for libraries, includes and shared files
- Use -s (strip) parameter when installing binaries and libraries
2018-04-25 13:56:25 -05: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
afb6aa31db Cleaned up apps/* Makefile.in:s 2018-04-07 19:04:56 +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
38f0b446fa 2017->2018 2018-01-01 12:25: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
19813a4d9c restconf post/put/head/patch, memtests 2017-03-26 15:14:37 +02:00
Olof hagsand
bc2b606167 dual license 2016-12-30 16:14:48 +01:00
Olof hagsand
0356b2225f experimental restconf 2016-05-20 18:33:48 +02:00