Commit graph

456 commits

Author SHA1 Message Date
Olof hagsand
2bcd429bee CLI pipe changes: added arg to tail, exit on error. 2023-08-15 20:45:15 +02:00
Olof hagsand
fc73493881 Docs update, externalized cvec_concat_cb, example mem-leak 2023-08-15 20:45:15 +02:00
Olof hagsand
4a605ff25e Fixed: ["show configuration devices" and "show configuration devices | display cli" differs](https://github.com/clicon/clixon-controller/issues/24) 2023-08-12 16:28:08 +02:00
Olof hagsand
6d53603c55 CLI output pipes: Add CLICON_PIPETREE to any cli files, not just the first 2023-08-09 18:53:32 +02:00
Olof hagsand
f067968535 Clarified clixon_cli command-line: clixon_cli [options] [commands] [-- extra-options] 2023-08-07 18:15:49 +02:00
Olof hagsand
2485528515 cli: fixed callback append of empty prefix 2023-07-29 13:29:35 +02:00
Olof hagsand
851242a948 Minor valgrind and vagrant problems 2023-07-28 17:16:26 +02:00
Olof hagsand
7577245077 Changes due to CLIgen removal of expand-prepend code 2023-07-28 16:35:12 +02:00
Olof hagsand
05c082b202 init variables, vagrant with-cligen 2023-07-28 12:49:51 +02:00
Olof hagsand
f526d5b7a0 Autocli optimization feature for generating smaller CLISPECs for large YANGs using treerefs
New `grouping-treeref` option added to clixon-autocli.yang
Default is disabled, set to true to generate smaller memory footprint of clixon_cl
Add prefix "mtpoint:" to cli api-paths to identify change of yang schemas
2023-07-23 15:21:59 +02:00
Olof hagsand
e0cbc10fad Pipe function renaming 2023-07-13 14:36:01 +02:00
Renato Botelho do Couto
a773384ccc cli_show_option_bool: Rename bool -> result
bool will conflict with boolean type if stdbool.h is included.  No
functional changes intended.
2023-07-07 15:09:12 +02:00
Olof hagsand
fab8d35dff Output pipe function detection in configure.ac 2023-07-05 15:49:30 +02:00
Olof hagsand
3858cd93c2 Add pipe functions 2023-07-04 20:50:41 +02:00
Olof hagsand
c16b9cbba4 Use pipe functions from /bin 2023-07-04 09:45:00 +02:00
Olof hagsand
b33603107d Output pipe functionality
Based on output pipe code in CLIgen
Clixon adaptions include `CLICON_PIPETREE=` variable and a new cli_pipe.c callback file
2023-07-03 15:14:11 +02:00
Olof hagsand
e498e09570 Adapt to CLIgen refactoring of tree expansion code 2023-07-02 13:56:18 +02:00
Olof hagsand
b39ee078c4 Refactored cli-syntax code to use cligen pt_head instead (long overdue) 2023-06-28 13:44:06 +02:00
Olof hagsand
e1a8e0d40b Adapt to cligen parse API 2023-06-28 13:39:40 +02:00
Olof hagsand
080eef0278 C-API: Added cli_process_control(), added uid to cli_process_control() 2023-06-01 17:50:23 +02:00
Olof hagsand
307a992f36 * Added output function to JSON output:
* `xml2json_vec(...,skiptop)` --> `xml2json_vec(..., cligen_output, skiptop)`
2023-05-17 16:25:35 +02:00
Olof hagsand
25cc14c1a2 Minor rearrangement for exporting cli fns 2023-05-12 11:03:36 +02:00
Olof hagsand
ad07eb3adf API change: remove yang2cli_yspec last argument printgen, removed obsolete: `cli_auto_show() 2023-05-11 16:57:19 +02:00
Olof hagsand
9550ba808b cli show for mtpoint: increased range for arg check 2023-05-08 14:34:35 +02:00
Olof hagsand
b6116261a3 * Restructured and extended <stats> rpc to schema mountpoints
* New revision of clixon-lib.yang
* CLI: Added `show statistics` example code for backend and CLI memory stats
2023-05-05 17:54:10 +02:00
Olof hagsand
e8a8b17e1b Removed obsolete compile options introduced in 6.1:
`NETCONF_DEFAULT_RETRIEVAL_REPORT_ALL` and `AUTOCLI_DEPRECATED_HIDE`
2023-05-05 08:55:47 +02:00
Olof hagsand
bd5b51d860 CLI edit modes and mountpoints 2023-05-03 17:52:10 +02:00
Olof hagsand
05da8ef3c1 Add mount-point aware code to cli_auto_show
Revert patch in xpath2canonical for mountpoints
2023-04-23 17:54:02 +02:00
Olof hagsand
6335f810d3 C-API: clixon_xml2file and clixon_xml2cbuf added prefix argument
Added in-mem xml diff function: `xml_tree_diff_print`
2023-04-12 10:44:58 +02:00
Olof hagsand
45d8e5b6ce C-API xmldb_validate() removed. compare_db_names() added. 2023-04-09 21:13:12 +02:00
Olof Hagsand
7eb37273b8 Formatting of comments 2023-03-30 15:39:35 +02:00
Olof hagsand
da2edceb7e * Added new functions: xml_tree_equal and xpath2xml
* RFC 8528 yang schema mount-points:
  * Made expand_dbvar and cli_dbxml mountpoint-aware (RFC 8528)
  * autocli supportgenerate
  * Made api_path2xml and xml2api_path mount-point-aware
  * Temporar fix in clixon_custom.h: XPATH_CANONICAL_SKIP_CHECK
* `xml2xpath()`: Added `apostrophe` as 4th parameter, default 0
* removed extra assert.h includes
2023-03-23 22:16:33 +01:00
Olof hagsand
5822c1a72a * clicon_msg_rcv: Added intr parameter for interrupting on ^C (default 0)
* Internal NETCONF (client <-> backend)
  * Ensure message-id increments
  * Separated rpc from notification socket in same session
* Removed coverage icon from homepage since it stopped working some time ago
2023-03-08 21:41:29 +01:00
Olof Hagsand
360e4beb1f
Merge pull request #425 from vvsosed/fix_cli_via_ssh_issue
Error message stucks in stdout buffer
2023-03-03 17:54:55 +01:00
Olof hagsand
5f2978d06c Files: Rearranged backend .h files: moved client_entry to clixon_backend_client.h 2023-03-03 16:05:31 +01:00
Volodymyr Sosiedkin
9a6a378c99 Fix cli via ssh error log output issue 2023-03-01 17:52:38 +02:00
Olof hagsand
0ef0970c04 Implemented: [Request to suppress auto-completion for "deprecated" / "obsolete" status and warn the user.](https://github.com/clicon/clixon/issues/410) 2023-02-14 16:42:43 +01:00
Olof Hagsand
fcf9a8b0b0 C-API: Exposed diff function
Test: double leaf validate test
2023-02-13 20:23:18 +01:00
Olof hagsand
d358387d39 * Fixed: [State XML validation error when CLICON_MODULE_LIBRARY_RFC7895=true and ietf-yang-libra$
* Removed obsolete option: `CLICON_MODULE_LIBRARY_RFC7895'
  * Obsolete config options given in the confi file are considered an error
* Added section in CONTRIBUTING relating to optimzation
* Changed reset merge to implicit default values.
  * This avoids a potential overwriting of explicitly set default values in the existing config
* Adapted some code to [Make cligen_* functions const ](https://github.com/clicon/cligen/pull/83)
* Test: fixed test for * Fixed: [datamodel tree generated from basemodel tree is not proper when a list has more than one key and key is of enum type](https://github.com/clicon/clixon/issues/417)
2023-02-12 16:19:27 +01:00
Olof hagsand
da9bfcbb53 * Changed debug levels in clicon_debug() to be based on maskable flags
* Added flag names: `CLIXON_DBG_*`
  * Added maskable flags that can be combined when debugging:
    * `DEFAULT` = 1: Basic debug message, espcially initialization
    * `MSG` = 2: Input and output packets, read datastore
    * `DETAIL` = 4: Details: message dump in hex, xpath parse trees, etc
    * `EXTRA` = 8: Extra detailed logs
* Test: some errors in yang-lib where content-id was in wrong place
2023-01-27 14:56:58 +01:00
Olof Hagsand
b3dcee9639 * YANG schema mount RFC 8528, Initial commit (work in progress)
* Keep track of YANG unknowns with ys_cvec of EXTENSION
* C-API: Init ys_cvec to NULL, added yang_cvec_add() and adjusted code to use it
2023-01-20 16:16:02 +01:00
Olof hagsand
000cb866c2 RFC 8525:
- Change from RFC 7805: Remove revision if empty instead of sending empty revision
RFC 6022
  - Added cli identity to RFC6022 transport
  - Added source-host for natove restconf, bit no other sessions
2023-01-15 22:44:00 +01:00
Olof hagsand
3916fa919c Netconf monitoring RFC 6022 Sessions (https://github.com/clicon/clixon/issues/370)
- statistics and transport/source-host parameters
  - extended internal NETCONF hello with transport and source-host attributes
clixon-lib,yang
  - Moved all extended internal NETCONF attributes to the clicon-lib namespace
C-API:
  - wrapped most attribute creation into new fn xml_add_attr()
2023-01-15 12:36:59 +01:00
Olof hagsand
e27336e054 C-API change yang_print: print top-level and add pretty-print parameter
Test: Fix valgrind dlclose suppresion
2022-11-24 17:42:48 +01:00
Olof hagsand
a3bb271432 cli show config json: add {} clause for empty 2022-11-19 11:13:27 +01:00
Olof hagsand
caef594dbe Error handling for CLI
Continue, do not exit on read/expand errors
Accept -1 error without clicon_err in callbacks / expand
C-API: Three-value return of clicon_cliread
2022-11-19 11:11:08 +01:00
Olof hagsand
4b21a05bcc Fixed IDENTITYREF_KLUDGE removal #2 2022-11-07 09:19:29 +01:00
Olof hagsand
b0f898cf66 Fixed: [Yang identityref XML encoding is not general](https://github.com/clicon/clixon/issues/90)
* Revisiting this issue now seems to work, there are no regressions that fail when disabling IDENTITYREF_KLUDGE.
2022-11-05 12:07:44 +01:00
Olof hagsand
56f4bb45cc * Added PRETTYPRINT_INDENT compile-time option controlling indentation level for XML,JSON and TEXT
* Default value is `3`
2022-10-31 14:20:14 +01:00
Olof hagsand
c93f264215 Added final \n to JSON pretty-print output
This was a correction of fix to: [CLI Show config JSON with multiple top-level elements is broken](https://github.com/clicon/clixon/issues/381)
2022-10-29 16:06:15 +02:00