Commit graph

83 commits

Author SHA1 Message Date
Olof hagsand
e9df7b81f2 Building problems with evhtp 2021-03-31 22:38:24 +02:00
Olof hagsand
c7e7598e3b * Updated "evhtp" restconf mode
* No reliance on libevent or libevhtp, but on libssl >= 1.1 directly
    * Moved out event handling to clixon event handling
    * Moved out all ssl calls to clixon
  * New code MUST use libevhtp from https://github.com/clixon/clixon-libevhtp.git
    * This does NOT work: libevhtp from https://github.com/criticalstack/libevhtp.git
2021-03-30 16:00:03 +02:00
Olof hagsand
e8cd587ded Changed libevhtp tests to compile from clicon instead of criticalstack 2021-03-03 21:57:19 +01:00
Olof hagsand
ab18946880 * Fixed extension/unknown problem shown in latest openconfig where other than a single space was used between the unknown identifier and string
* Removed skiplist of openconfig/yangmodels tests to inside the test
2021-02-23 13:47:17 +01:00
Olof hagsand
94c6bd9c49 Added proc socket and text proto rpc 2021-01-22 14:41:47 +01:00
Olof hagsand
96b50b88e8 Copyright 2021 2021-01-13 14:40:34 +01:00
Olof hagsand
8cde7a4ded * Handling empty netconf XML messages "]]>]]>" is changed from being accepted to return an error.
* Netconf split lines input (input fragments) fixed
  * Netconf input split on several lines, eg using stdin: "<a>\nfoo</a>]]>]]>" could under some circumstances be split so that only "</a>]]>]]>" be properly processed. This could also happen to a socket receiving a sub-string and then after a delay receive the rest.
  * Fixed by storing residue and add that to the input string if later input is received on the same socket.
* Use [https://github.com/clicon/libevhtp](https://github.com/clicon/libevhtp) instead of [https://github.com/criticalstack/libevhtp](https://github.com/criticalstack/libevhtp) as a source of the evhtp source
2021-01-07 16:57:47 +01:00
Olof Hagsand
99c570e278 test/vagrant fixes 2020-12-03 14:23:59 +00:00
Olof hagsand
3d10c3bfcb evhtp debugging: memleaks, test errors, etc 2020-11-19 18:06:20 +01:00
Olof hagsand
6eb18da5e9 * Multi-socket feature (eg IPv4/IPv6 http/https) to restconf evhtp
* Added by-ref parameter to `ys_cv_validate()` returning which sub-yang spec was validated in a union.
2020-11-15 12:34:40 +01:00
Jonathan Ben-Avraham
a1f54d71ac Update yang/mandatory files for rfc8527 compliance
Updated the yang/mandatory files and test scripts for rfc8527.
2020-11-07 22:06:05 +02:00
Olof hagsand
ac13729cdc sleep 1 for docker test race condition 2020-10-20 10:46:46 +02:00
Olof hagsand
1db43ca45b yang augment sanity checks 2020-10-05 15:49:22 +02:00
Olof hagsand
b7cb2e2526 tests and docker ports diffs 2020-10-04 16:06:55 +02:00
Olof hagsand
70bdaf83bd clixon 4.7.0 2020-09-14 11:30:39 +02:00
Olof Hagsand
afe64cbd5e cicd tests 2020-09-07 16:15:12 +00:00
Olof hagsand
3c36300e74 Merge branch 'master' of https://github.com/clicon/clixon 2020-08-18 17:26:44 +02:00
Olof hagsand
89fddd4cca variables in docker start 2020-08-18 17:26:39 +02:00
Olof Hagsand
11d1788370 docker base use evhtp 2020-08-18 15:24:50 +00:00
Olof hagsand
6d38603a79 skip parts of nacm_recovery test when user runs as root 2020-08-13 15:29:17 +02:00
Olof hagsand
f7e44185a5 recovery still dont work 2020-08-13 15:06:33 +02:00
Olof hagsand
3d33335f4b Last minute documentation and testing changes befoire 4.6 2020-08-13 14:58:42 +02:00
Olof hagsand
de85f20415 remove nacm-recovery from test 2020-08-06 22:55:54 +02:00
Olof hagsand
8fabc430fd remove nacm-recovery from test 2020-08-06 22:35:41 +02:00
Olof Hagsand
57d7587d9a vagrant, docker and remote test small changes 2020-07-23 17:23:08 +00:00
Olof hagsand
2f6458dd41 new travis 2020-07-07 22:27:47 +02:00
Olof hagsand
a5bf3d57ce tolerate errors in docker startscripts 2020-07-07 15:51:42 +02:00
Olof hagsand
5464eec540 Added docker support for three restconf modes: nginx/fcgi(default); evhtp ; and none. 2020-07-07 13:26:38 +02:00
Olof hagsand
0a985e6618 skip c++ tests in travis 2020-07-02 18:14:59 +02:00
Olof hagsand
1597bd303c changed cligen repo from olofhagsand/cligen to clicon/cligen 2020-06-21 15:57:43 +02:00
Olof hagsand
65806f1ef2 Copyright change: LLC -> LLC(Netgate) 2020-04-23 16:55:56 +02:00
Olof hagsand
e6178858f0 In the bbuild system, you dont need to do make install-include for installing include files for compiling. This is now included in the actions done by make install. 2020-04-05 12:25:33 +02:00
Olof hagsand
9fa5e216c4 * New "general-purpose" datastore upgrade callback added which i called once on startup, intended for lo
w-level general upgrades and as a complement to module-specific upgrade.
  * Called on startup after initial XML parsing, but before module-specific upgrades
  * Enabled by definign the `.ca_datastore_upgrade`
  * [General-purpose upgrade documentation](https://clixon-docs.readthedocs.io/en/latest/backend.html#ge
neral-purpose)
* JSON parse error messages change from ` on line x: syntax error,..` to `json_parse: line x: syntax err
or`
* Unknown-element error message is more descriptive, eg from `namespace is: urn:example:clixon` to: `Fai
led to find YANG spec of XML node: x with parent: xp in namespace urn:example:clixon`.
* C-API parse and validation API more capable
  * `xml_spec_populate` family of functions extended with three-value return values
    * -1: error, 0: parse OK, 1: parse and YANG binding OK.
  * `xml_parse` and `json_parse` API changes
    * Three value returns: -1: error, 0: parse OK, 1: parse and YANG binding OK.
    * Extended `xml_parse_file2` and `xml_parse_string2` extended API functions with all options available.
      * New concept called `yang_bind` that defines how XML symbols are bound to YANG after parsing
    * Existing API same except `xml_parse_file` `endtag` argument moved to `xml_parse_file2`
* C-API: Added instrumentation: `xml_size` and `xml_stats_get`.
* Fixed: Enabling modstate (CLICON_XMLDB_MODSTATE), changing a revision on a yang, and restarting made the backend daemon exit at start (thanks Matt)
  * Also: ensure to load `ietf-yang-library.yang ` if CLICON_XMLDB_MODSTATE is set
2020-02-20 14:00:01 +01:00
Olof hagsand
5831c053fa clixon_util_path did not sort XML properly 2020-02-08 17:00:47 +01: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
9090fe6484 Merge branch 'master' of https://github.com/clicon/clixon 2019-11-26 21:52:08 +01:00
Olof hagsand
0d22a8b6d0 Yang files reorganized into three classes: clixon, mandatory, optional 2019-11-26 21:51:28 +01:00
Anthony Hinsinger
ba472bf15f
Update xml root element 2019-11-19 14:40:48 +01:00
Olof hagsand
0129fe285e skip privileges in docker test 2019-09-14 18:45:29 +02:00
Olof hagsand
3d5abb77f9 * Backend daemon drops privileges after initialization (to not run as root)
* New config option `CLICON_USER` with default value `clicon`
  * Can also be set with `-U <user>` clixon_backend command-line option
2019-09-11 21:24:14 +02:00
Olof hagsand
6bcaea259c documentation 2019-09-01 19:45:54 +02:00
Olof hagsand
d9cf43bd46 Preparing for 4.1.0 2019-08-17 17:25:20 +02:00
Olof Hagsand
388da01d0b base hello docker example 2019-08-17 14:55:44 +00:00
Olof hagsand
14d319dd9b * A new "hello world" example is added
* The directory `docker/system` has been moved to `docker/main`
2019-04-17 11:26:05 +02:00
Olof hagsand
d46ca41c8b Further optimizions and bugfixing of that 2019-04-16 12:09:21 +02:00
Olof hagsand
e29cd7cfb9 * Optimized validation by making xml_diff work on raw cache tree (not copies)
* xmldb_get() removed unnecessary config option
2019-04-07 15:55:53 +02:00
Olof Hagsand
34196456a2 mv example to example/main 2019-03-31 18:34:30 +02:00
Olof hagsand
b1c74b5f1f * Ensured you can add multiple callbacks for any RPC, including basic ones.
* Extra RPC:s will be called _after_ the basic ones.
  * One specific usecase is hook for `copy-config` (see [doc/ROADMAP.md] that can be implemented thus way.
* `rpc_callback_register` added a namespace parameter. Example:
   ```
     rpc_callback_register(h, empty_rpc, NULL, "urn:example:clixon", "empty");
   ```
2019-03-10 17:27:52 +01:00
Olof Hagsand
ff3ff0daa9 * There was a problem with ordered-by-user for XML children that appeared in so\
me circumstances and difficult to trigger. Entries entered by the user did not \
appear in the order they were entered. This should now be fixed by adding an enumeration to xml children for sorting ordered by user properly
2019-02-27 18:20:23 +01:00
Olof Hagsand
f035c3ca23 * Removed all dependency on strverscmp
* Added libgen.h for baseline()
2019-02-27 10:46:05 +01:00