Commit graph

20 commits

Author SHA1 Message Date
Olof hagsand
ae1af8da9e * NACM extension (RFC8341)
* NACM module support (RFC8341 A1+A2)
   * Recovery user "_nacm_recovery" added.
     * Example use is restconf PUT when NACM edit-config is permitted, then automatic commit and discard are permitted using recovery user.
   * Example user changed adm1 to andy to comply with RFC8341 example

 * Yang code upgrade (RFC7950)
   * RPC method input parameters validated
     * see https://github.com/clicon/clixon/issues/4
* Correct XML namespace handling
   * XML multiple modules was based on "loose" semantics so that yang modules were found by iterating thorugh namespaces until a match was made. This did not adhere to proper [XML namespace handling](https://www.w3.org/TR/2009/REC-xml-names-20091208), and causes problems with overlapping names and false positives. Below see XML accepted (but wrong), and correct namespace declaration:
```
      <rpc><my-own-method></rpc> # Wrong but accepted
      <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> # Correct
        <my-own-method xmlns="http://example.net/me/my-own/1.0">
      </rpc>
```
   * To keep old loose semantics set config option CLICON_XML_NS_ITERATE (true by default)
   * XML to JSON translator support for mapping xmlns attribute to module name prefix.
   * Default namespace is still "urn:ietf:params:xml:ns:netconf:base:1.0"
   * See https://github.com/clicon/clixon/issues/49
* Changed all make tags --> make TAGS
* Keyvalue datastore removed (it has been disabled since 3.3.3)
* debug rpc added in example application (should be in clixon-config).
2018-12-16 19:49:19 +01:00
Olof hagsand
ac1aa44fc4 * Yang Configure options changed
* `CLICON_YANG_DIR` is changed from a single directory to a path of directories
    * Note CLIXON_DATADIR (=/usr/local/share/clixon) need to be in the list
  * CLICON_YANG_MAIN_FILE Provides a filename with a single module filename.
  * CLICON_YANG_MAIN_DIR Provides a directory where all yang modules should be loaded.
* Change all @datamodel:tree to @datamodel in all CLI specification files
  * If you generate CLI code from the model (CLIXON_CLI_GENMODEL).
  * For backward compatibility, define CLICON_CLI_MODEL_TREENAME_PATCH in clixon_custom.h
* Removed return value ymodp from yang parse functions (eg yang_parse()).
* New config option: CLICON_CLI_MODEL_TREENAME defining name of generated syntax tree if CLIXON_CLI_GENMODEL is set.
2018-12-03 21:16:35 +01:00
Olof hagsand
d09a8c08aa getopt return value changed from char to int (https://github.com/clicon/clixon/issues/58) 2018-12-01 18:34:52 +01:00
Olof hagsand
39a5086218 * Yang Support of submodule, include and belongs-to.
* Improved unknown handling
* Configure option `CLICON_YANG_DIR` is changed from a single directory to a path of directories
    * Note CLIXON_DATADIR (=/usr/local/share/clixon) need to be in the list
2018-12-01 18:17:42 +01:00
Olof hagsand
a4e29bcdb7 * All yang modules are stored in the clicon_dbspec_yang() option.
* Except clixon-config module due to bug reported below
* Bug: Top-level Yang symbol cannot be called "config" in any imported yang file.
  * datastore uses "config" as reserved keyword for storing any XML whoich collides with code for detecting Yang sanit
2018-10-19 15:26:22 +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
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
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
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
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
3453dae0db - removed api_path extension from internal netconf
- Strings in xmldb_put not properly encoded, eg eth/0 became eth.00000
2017-05-30 21:57:06 +02:00
Olof hagsand
4bcb966dac xmldb_init -> xmldb_create 2017-05-02 22:29:56 +02:00
Olof hagsand
c2f52845f8 rm xml index; added xml util functions; further xmldb development 2017-04-23 22:32:53 +02:00
Olof hagsand
d02015f456 datastore text works with replace 2017-04-17 19:47:32 +02:00
Olof hagsand
ee9b74d735 formalizing xmldb api 2017-04-16 19:06:19 +02:00
Olof hagsand
540cd96e74 datastore handles 2017-04-15 19:42:35 +02:00
Olof hagsand
d26a801bc0 Added connect/disconnect/getopt/setopt and handle to xmldb API; Added datastore 'text'; Moved apps/dbctrl to datastore/ 2017-04-15 13:53:58 +02:00