Commit graph

335 commits

Author SHA1 Message Date
Olof Hagsand
7eb37273b8 Formatting of comments 2023-03-30 15:39:35 +02:00
Olof hagsand
55422f4187 PERF: Added a recurse parameter to xml_yang_minmax_recurse() to avoid "double recursion"
C-API: `candidate_commit()`: validate_level (added in 6.1) marked obsolete
2023-02-23 11:42:15 +01:00
Olof hagsand
2db5961169 Example: fixed mismatch between install dirs and DIRs in example.xml.in
Docker: Removed example from test container, fixed example container
2023-02-22 23:24:50 +01:00
Olof hagsand
585e725aec Yang schema mount: replaced config --enable-yang-schame-mount with runtime option CLICON_YANG_SCHEMA_MOUNT
Added config and validation-level as parameters to ca_yang_mount
2023-02-17 16:39:39 +01:00
Olof Hagsand
ecd60fbcfe
Merge pull request #418 from kernelkit/kkit
Misc. build fixes encountered when cross-compiling
2023-02-17 09:52:42 +01:00
Joachim Wiberg
9cd764f031 example/main: replace hard-coded path with variables from configure
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-09 15:53:52 +01:00
Joachim Wiberg
b48c6ad982 example/main: add missing $(DESTDIR) to standard include path
This is used everywhere else so looks loke a simple omission.  Needed
when cross-compiling (or packaging) Clixon.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-02-09 15:53:52 +01:00
Olof hagsand
8f7ae33262 Yang schema mount: repaired yanglib statedata mountpoint
Example: patch to fix "dual xpath" issue
2023-02-08 15:00:07 +01:00
Olof hagsand
a203f6cde7 Updated extraxml reset callback example and added a regression test 2023-02-02 12:17:52 +01:00
Olof Hagsand
a8e13047fc * YANG schema mount RFC 8528, state data 2023-01-27 15:11:08 +01:00
Olof hagsand
6fedf65de7 C-API: Changed type of veclen parameter to size_t in xpath_vec_flag()
Rewrite of sed -e to be portable to freebsd
2022-12-29 15:49:19 +01:00
Olof hagsand
0d41d49fa9 Moved with-defaults processing from get(-config) to xmldb_get when reading db
With-defaults: fixed cornercase in xpath used in list pagination
C-API: Added `with-defaults` parameter (default 0) to `xmldb_get0()`
2022-12-18 19:59:02 +01:00
Olof Hagsand
e885d63f68 Minor doc and err handling fixes 2022-12-16 10:48:28 +01:00
Olof hagsand
100f15b699 Add SSH_BIN compile-time option
Clarify documentation of internal netconf message struct
2022-12-07 12:15:08 +01:00
Olof hagsand
c2faf8b96c Main example: Removed dependency of external IETF RFCs
+  * See [Can't initiate clixon_backend](https://github.com/clicon/clixon/issues/382)
2022-11-01 12:20:30 +01:00
Olof hagsand
d84c529ff1 [Code formatting: Change indentation style to space](https://github.com/clicon/clixon/issues/379)
* Applies to all c/h/y/l/sh files and .editorconfig
2022-10-27 14:21:17 +02:00
Phil Heller
284316b646 Initial implementation of NETCONF confirmed-commit 2022-10-03 21:44:35 -06:00
Olof hagsand
fcc9245c35 Test: make streams optional, remove dependency on main example 2022-09-20 14:44:30 +02:00
Olof hagsand
a6f67755b3 Refactor of cli show commands:
- Changed `cli_show_config()`
- Removed `cli_show_config_state()`
- Replaced `cli_auto_show()` with `cli_show_auto_mode()`
2022-09-15 17:42:57 +02:00
Olof hagsand
9a224ea4a0 Fixed: [All values in list don't appear when writing "show <list>" in cli](https://github.com/clicon/clixon/issues/359)
CLISPEC change:
* Changed signature of `cli_show_auto()`,
* remove: `cli_show_auto_state()`
2022-09-15 09:48:08 +02:00
Olof hagsand
743076b171 With-defaults CLI support
Extended cli_auto_show() with with-defaults argument, also changing its signature
Example: Added with-defaults argument to clispec
C-API: Added with-defaults argument to clicon_rpc_get_config
Replaced with-defaults prefix/namespace with constants
2022-09-09 13:46:20 +02:00
Kristofer Hallin
68b528ac0b Make Clixon build on MacOS. 2022-08-16 08:40:04 +02:00
Olof hagsand
57bc36d5ed Fixed: [Clixon CLI issue: when I try to print the value of the leaf node nothing appeared](https://github.com/clicon/clixon/issues/345) 2022-07-26 13:32:57 +02:00
Olof hagsand
4514f2a538 Fixed: ["autocli:hide-show" extension cause bug in xmldb_put method #343](https://github.com/clicon/clixon/issues/343)
As a side-effect, added extra "autocliext" parameter to:
- clixon_xml2file()
- clixon_json2file()
- clixon_json2cbuf()
- clixon_txt2file()
2022-07-22 16:06:28 +02:00
Olof hagsand
e724dd7f40 Test: Added detail env var to sum.sh, Changed make test to include detailed test 2022-07-21 09:08:18 +02:00
Olof hagsand
42efb59a75 Example main -v/-V issues breaking previous commit tests 2022-07-21 08:07:48 +02:00
Olof hagsand
89f8567f75 Refactoring of if-feature parse code
Moved if-feature sub-parser to clixon_yang_parse_sub.[ch]
2022-07-20 22:48:09 +02:00
Olof hagsand
bdb516fec9 YANG Action (RFC 7950 Section 7.15)
See [Support for "action" statement](https://github.com/clicon/clixon/issues/101)
2022-06-21 15:44:02 +02:00
Olof hagsand
b6bfcb69f7 Text syntax parser/loader
Added support for list x y;
Uses a mechanism to parse as unknown XML body and post-parsing replace with list keys
Fixed example and test to work with new TEXT syntax
2022-06-02 19:28:49 +02:00
Olof hagsand
0c79298e76 Changed C-API for xml translation/print the internal cxobj tree data structure to other formats
New API is as follows:
  * `clixon_xml2file()` - Print internal tree as XML to file
  * `clixon_xml2cbuf()` - Print internal tree as XML to buffer
  * `clixon_json2file()` - Print internal tree as JSON to file
  * `clixon_json2cbuf()` - Print internal tree as JSON to buffer
  * `clixon_cli2file()` - Print internal tree as CLI format to file
  * `clixon_txt2file()` - Print internal tree as text format to file
2022-06-01 20:02:27 +02:00
Olof hagsand
2ece0b8f51 * Experimental text syntax parser/loader
* Added new text syntax parsing and loading from CLI
  * Unified text output functions to `xml2txt` and moved to clixon_text_syntax.[ch]
    * The following are removed: `cli_xml2txt` and `xml2txt_cb`
  * Text output format changed:
    * Namespace/modulename added to top-level
  * See [Support performant load_config_file(...) for TEXT format](https://github.com/clicon/clixon/issues/324)
2022-06-01 11:07:15 +02:00
Olof hagsand
43a57dad79 Changed C-API for xml translation/print to other formats.
* Added `skiptop` parameter, if set only apply to children of a node, skip top node
    * default is 0
* Functions are merged, ie removed and replaced with more generic functions
* `xml2json_cbuf()`: Added `skiptop` parameter: `xml2json_cbuf(..., int skiptop)`
* `xml2json()` and `xml2json_cb()` merged into `xml2json_file()` with `skiptop`
    * Replace `xml2json(...)` with `xml2json_file(..., stdout, 0)`
    * Replace `xml2json_cb(...)` with `xml2json_file(..., 0)`
* `clicon_xml2cbuf()`: Added `skiptop` parameter: `clicon_xml2cbuf(..., int skiptop)`
* `xml2cli()`: Added `skiptop` parameter: `xml2cli(..., int skiptop)`
2022-06-01 10:48:39 +02:00
Olof hagsand
8c60d81ed2 - Disabled xpath optimization for hierarchical list
- Made cli show xpath command more capable
2022-04-14 15:21:25 +02:00
Olof hagsand
ecac027d18 CLI argument to shell example callback
Save state of netconf chunked framing between inputs
Treat EBADF in internal protocol (triggered by freebsd+notifications)
Test: chunked encoding: use printf instead of echo
2022-04-11 19:09:26 +02:00
Olof hagsand
4dd71c671f example typo 2022-04-03 13:48:41 +02:00
Olof hagsand
1a9def2f6e [provide support for load config of cli format along with json and xml format as save config is supported for all 3 formats](https://github.com/clicon/clixon/issues/320) 2022-04-01 18:05:19 +02:00
Olof hagsand
451562ca77 Removed unnecessary libclixon_netconf, functions moved to libclixon 2022-03-29 15:46:38 +02:00
Olof hagsand
927d6f2d9c * Documentation: plugin start function doc 2022-03-14 12:14:55 +01:00
Olof hagsand
9a88cb5f0d * Bumped version to 5.7.0_PRE
* Fixed: SEGV in cli show yang
2022-03-14 12:13:45 +01:00
Olof hagsand
60e6477be2 Clixon 5.6.0 Release 2022-03-08 10:40:34 +01:00
Olof hagsand
dd2ac56af8 Module state upgrade: RFC7895 to RFC 8525
Changes to clixon-config:
  * Added option: 'CLICON_YANG_LIBRARY`
  * Changed default value: `CLICON_MODULE_LIBRARY_RFC7895` to false
Datastore modstate is backward compatible
Tests upgraded to RFC8525
2022-03-07 10:56:54 +01:00
Olof hagsand
97316e0bfa * Follow-up on [restconf GET json response does not encode top level node with namespace as per rfc #303](https://github.com/clicon/clixon/issues/303)
* Load/save JSON config file did not work
* Added rfc7951 parameter to `clixon_json_parse_string()` and `clixon_json_parse_file()`
  * If set, honor RFC 7951: JSON Encoding of Data Modeled with YANG, eg it requires module name prefixes
  * If not set, parse as regular JSON
* Test: added test_db.sh for datastore format tests
2022-02-22 14:28:01 +01:00
Olof hagsand
ed2ff88006 Removed example CLI unneccesary compare command for show compare 2022-01-24 11:09:38 +01:00
Olof hagsand
95f6fe8b1a * Fixed: Autocli YANG patterns including " were not properly escaped: \" 2022-01-19 14:52:32 +01:00
Olof hagsand
77b4468eb3 Updated copyright statements to 2022 2022-01-18 16:36:00 +01:00
Olof hagsand
f922211212 * Changed autocli tree-labels using ac_ and act_ prefixes
* New automatic edit-mode design
   * Control which modes to use with `edit-mode-default`
     * Default is create edit-mode for all
   * New edit-mode tree: @datamodelmode
2022-01-18 12:17:47 +01:00
Olof hagsand
e0bcca5405 * New clixon-lib@2021-12-05.yang revision
* Extension `autocli-op` obsoleted and no longer supported
  * You need to change to use clixon-autocli `hide`and `hide-show` instead.
  * Translate as follows:
    * `cl:autocli-op hide` -> `autocli:hide`
    * `cl:autocli-op hide-database` -> `autocli:hide-show`
    * `cl:autocli-op hide-database-auto-completion` -> `autocli:hide; autocli:hide-show`
2022-01-12 22:19:17 +01:00
Olof hagsand
081e6871b3 * Renamed clixon-clispec.yang to clixon-autocli.yang
* First version of clixon-autocli.yang semantics
   * Default rules for module exclusion, list-keywords, completion, treeref-state
   * Specialized rules for compress and exclusion of modules
   * See [autocli documentation](https://clixon-docs.readthedocs.io/en/latest/cli.html#autocli)
* Obsoleted and moved autocli config options from clixon-config.yang to clixon-autocli.yang as follows:
   * `CLICON_CLI_GENMODEL`, use: `autocli/module-default=false` instead
      * Removed `clicon_cli_genmodel()`
   * `CLICON_CLI_GENMODEL_TYPE`, use `autocli/list-keyword-default` and compress rules instead)
      * Removed `clicon_cli_genmodel_type()`
   * `CLICON_CLI_GENMODEL_COMPLETION`, use `autocli/completion-default` instead
      * Removed `clicon_cli_genmodel_completion()`
   * `CLICON_CLI_AUTOCLI_EXCLUDE`, use `autocli/rule/operation=exclude` instead
   * `CLICON_CLI_MODEL_TREENAME`, use constant `AUTOCLI_TREENAME` instead
     * Removed `clicon_cli_model_treename()`
* New YANG functions: yang_single_child_type, yang_find_namespace_by_prefix, yang_str2key
* Changed return values of yang_find_prefix_by_namespace
* Merged `cli_cli2xml()` into `cli2xml()`
2022-01-07 12:50:07 +01:00
Olof hagsand
f8f34e3571 * Replaced separate autocli trees with a single @basemodel tree by using filter labels
* Added lastkey argument to yang_key_match()
* Fixed segv in process-sigchld
* Added ietf-yang-library to CLICON_CLI_AUTOCLI_EXCLUDE default value
* Added yang_spec_print() function
2021-12-16 20:23:09 +01:00
Olof hagsand
478911d0f5 * Changed typo configure --with-yang-standard-installdir to `configure --with-yang-standard-dir
* Updated command-line usage of cli,netconf,backend apps in sync with clixon-docs user manual
* Documented differences between protocol stubs for external vs internal netconf
2021-12-05 12:17:11 +01:00