Commit graph

50 commits

Author SHA1 Message Date
Olof hagsand
b103599a1a * Clixon transaction mechanism has changed which may affect your backend plugin callbacks:
* Validate-only transactions are terminated by an `end` or `abort` callback.
* If a commit user callback fails, a new `revert` callback will be made to plugins that have made a succesful commit.
2019-05-10 14:45:23 +02:00
Olof hagsand
99b7a1fe5b Clixon config option CLICON_XMLDB_CACHE renamed to CLICON_DATASTORE_CACHE and changed type from boolean to datastore_cache 2019-05-09 14:25:16 +02:00
Olof hagsand
06e6ef80d1 Non-key list now not accepted in edit-config (before only on validation) 2019-05-08 12:51:10 +02:00
Olof hagsand
8c36083e16 * A yang type regex cache added, this helps the performance by avoiding re-running the regcomp command on every iteration.
* An XML namespace cache added (see `xml2ns()`)
* Better performance of XML whitespace parsing/scanning.
2019-04-19 16:01:39 +02:00
Olof hagsand
728c97ab6d Failure in startup - modified to handle memory exhaustion when loading file 2019-04-18 15:38:15 +02:00
Olof hagsand
4a1e0f2cbc xmldb_get cache bug 2019-04-10 15:58: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
b5f1f7346e Structural C-code change: Merged yang_spec and yang_node types into yang_stmt 2019-04-02 12:27:33 +02:00
Olof hagsand
4de15343c9 optimize 2019-04-02 11:46:28 +02:00
Olof Hagsand
c07577b42b startup diff vector should be children of config root, not root itself 2019-03-29 15:31:00 +01:00
Olof hagsand
8624be0a67 xml changelog next iteration 2019-03-26 12:04:51 +01:00
Olof hagsand
7b9edd7112 ret error 2019-03-25 14:31:21 +01:00
Olof hagsand
a0abf8436e XML chanelog revision 2019-03-25 10:42:27 +01:00
Olof hagsand
3f68cca06c * New yang changelog experimental feature for automatic upgrade
* Added modules-state diff parameter to xmldb_get datastore function for startup scenarios.
* Allowed Yang extended Xpath functions (syntax only):
  * re-match, deref, derived-from, derived-from-or-self, enum-value, bit-is-set
* XSD regular expression handling of dash(`-`)
  *: Translate XDS `[xxx\-yyy]` to POSIX `[xxxyyy-]`.
* YANG Anydata treated same as Anyxml
2019-03-21 18:05:55 +01:00
Olof hagsand
606245ef02 * Added flags to example backend to control its behaviour:
* Start with `-- -r` to run the reset plugin
  * Start with `-- -s` to run the state callback
* Rewrote yang dir load algorithm to follow the algorithm in [FAQ](FAQ(doc/FAQ.md#how-are-yang-files-found) with more precise timestamp checks, etc.
2019-03-18 16:31:34 +01: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
a529546c88 Merge branch 'master' of https://github.com/clicon/clixon 2019-02-28 13:11:22 +01:00
Olof hagsand
560110b4e8 * New backend startup and upgrade support, see [doc/startup.md] for details
* Datastore files contain RFC7895 module-state information
2019-02-26 15:48:15 +01:00
Olof hagsand
057f4835db Did not check for missing list keys in validate. [Key of a list isn't mandatory](https://github.com/clicon/clixon/issues/73) 2019-02-13 18:19:33 +01:00
Olof hagsand
1e4022e73c NACM cleanup, uniform rule function, change of function names, etc. 2019-02-02 11:35:50 +01:00
Olof hagsand
ffecebf32a * NACM Data node READ access module support (RFC8341 3.4.5)
* Access control points added for `get` and `get-config` in addition to incoming rpc.
   * RFC 8341 Example A.2 implemented, see: [test/test_nacm_module.sh]
* Added `username` argument on `xmldb_put()` datastore function for NACM data-node write checks
* Added `xml_rootchild_node()` lib function as variant of `xml_rootchild()`
2019-01-27 13:26:15 +01:00
Olof hagsand
5b6af82e29 Validation of mandatory choice and recursive mandatory containers. 2019-01-05 11:08:16 +01:00
Olof hagsand
6c48165340 three-valued return values for datastore text_modify 2019-01-02 18:20:50 +01:00
Olof hagsand
0103d58994 2019 2019-01-02 15:48:30 +01:00
Olof hagsand
0baebc93fd * Strict namespace setting can be a problem when upgrading existing database files, such as startup-db or persistent running-db, or any other saved XML file.
* For backward compatibility, load of startup and running set CLICON_XML_NS_STRICT to false temporarily.
* Added three-valued return values for several validate functions where -1 is fatal error, 0 is validation failed and 1 is validation OK.
  * This includes: `xmldb_put`, `xml_yang_validate_all`, `xml_yang_validate_add`, `xml_yang_validate_rpc`, `api_path2xml`, `api_path2xpath`
* Added new xml functions for specific types: `xml_child_nr_notype`, `xml_child_nr_notype`, `xml_child_i_type`, `xml_find_type`.
2019-01-02 15:18:29 +01:00
Olof hagsand
f872c7e295 * More precise Yang validation and better error messages
* For Example, adding bad-, missing-, or unknown-element error messages, etc instead of operation-failed
* Removed delete-config support for candidate db since it is not supported in RFC6241.
* Switched the order of `error-type` and `error-tag` in all netconf and restconf error messages to comply to RFC order.
* Added example_rpc RPC to example backend
* Renamed xml_namespace[_set]() to xml_prefix[_set]()
* Some restconf error messages contained "rpc-reply" or "rpc-error" which have now been removed.
* Netconf/Restconf RPC extra input arguments are ignored (https://github.com/clicon/clixon/issues/47)
2018-12-21 01:33:41 +01:00
Olof hagsand
85c4782e36 Dedicated xml,json,yang and xsl parser utility programs added
Sanity check of stdarg (...) added
Cleanup of error messages.
2018-06-17 19:40:06 +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
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
38f0b446fa 2017->2018 2018-01-01 12:25:33 +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
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
1b6c9aacbe Added validation for leafref forward and nackward references. 2017-07-18 19:56:54 +02:00
Olof hagsand
f5c19d8586 Added state data 2017-07-01 17:42:39 +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
18093441a8 revert xsl for . and .. 2017-04-03 15:21:13 +02:00
Olof hagsand
eec5896797 internal netconf mods 2017-03-25 18:24:52 +01:00
Olof hagsand
2fcefda831 Change internal protocol from clicon_proto.h to netconf. 2017-03-25 11:10:50 +01:00
Olof hagsand
4461cc9598 Netconf startup configuration support. Set CLICON_USE_STARTUP_CONFIG to 1 to
enable. Eg, if backend_main is started with -CIr startup will be copied to
  running.
 Added .. as valid step in xpath
2017-02-10 11:54:34 +01:00
Olof hagsand
7f0b9909b3 Library functions in clixon_cli_api.h (e.g cli_commit) is rewritten in new
for (eg cli_commitv). See clixon_cli_api.h for new names.
Use restconf format for internal xmldb keys. Eg /a/b=3,4
Changed example to use multiple cli callbacks
2017-01-31 22:36:14 +01:00
Olof hagsand
bc2b606167 dual license 2016-12-30 16:14:48 +01:00
Olof hagsand
741fb97a9f double predicates in xpath; leaks; grideye debug 2016-03-26 10:47:58 +01:00
Olof hagsand
c1c1670a74 getting legacy grideye application to work on clixon 2016-03-20 22:25:42 +01:00
Olof hagsand
6d8acdea9f truncate helptext 2016-03-09 21:01:57 +01:00
Olof hagsand
0a812696c2 xmldb 2016-03-07 20:55:55 +01:00
Olof Hagsand
79b77943f9 renamed .h and libs clicon->clixon 2016-02-28 15:27:36 +01:00
Olof hagsand
5a45eca301 file rearrangement 2016-02-26 16:05:34 +01:00
Olof hagsand
9bd941ab76 commit xpath 2016-02-24 21:16:15 +01:00
Olof hagsand
33fac8a4c6 fixed commit 2016-02-22 23:07:30 +01:00
Olof hagsand
d6e393ea58 Inital commit 2016-02-22 22:17:30 +01:00