Commit graph

160 commits

Author SHA1 Message Date
Olof hagsand
a80c9b0f8e Fix: wrong typedef 2024-06-20 21:58:35 +02:00
Olof hagsand
0234ed94bc Added CLICON_LOG_DESTINATION and CLICON_LOG_FILE for al applications 2024-06-19 12:46:09 +02:00
Olof hagsand
ca701b0c1a Changed intermediate version numbers to be git-style, eg 7.0.0-39 instead of 7.1.0-PRE
* Changed datastore modstate to be last in file, as prior to 7.0
2024-05-08 16:51:45 +02:00
Olof hagsand
9bc60abe2e Fixed memory leaks at -V 2024-02-18 22:42:55 +01:00
Olof hagsand
ff171afd65 Added debug level INIT 2024-02-17 22:16:56 +01:00
Olof hagsand
3b0b734de1 Fix same -V version string
Restconf exit segv
2024-02-17 22:11:35 +01:00
Olof hagsand
4e3bd6fbdd Symbolic and combined debug names in cmd-line of all applications
New debug levels: BACKEND, CLI, NETCONF,RESTCONF, SNMP, STREAM
2024-02-02 11:54:12 +01:00
Philip Prindeville
cf2e27b43d Drop __FUNCTION__ from clixon_debug() calls 2024-01-11 17:29:37 +01:00
Philip Prindeville
0ec1e0a686 Discriminate APP debugging 2024-01-10 20:06:38 +01:00
Philip Prindeville
063c8d664f Messages can't be DETAIL alone so pair with DEFAULT 2024-01-10 20:06:38 +01:00
Philip Prindeville
86667a0190 Don't use literal for CLIXON_DBG_XXX 2024-01-10 20:06:38 +01:00
Olof hagsand
9e54f0602f Changed ca_errmsg callback to a more generic variant
Includes all error, log and debug messages
See [Customized NETCONF error message](https://github.com/clicon/clixon/issues/454)
2024-01-05 16:41:53 +01:00
Olof hagsand
24a4991ec8 Restructured error,debug anf log API
Renamed functions clicon->clixon, replaced global variables w access functions
Unified clicon_netconf_error with clixon_err()
2023-12-18 08:29:14 +01:00
Olof hagsand
261469be16 Feature: [Add support for -V option to give version](https://github.com/clicon/clixon/issues/472) 2023-12-14 23:10:51 +01:00
Olof hagsand
62348fc9c7 C-style update: Unified comment, retvals in order, remove trailing spaces
Changed function name for `clicon_debug` functions
2023-10-23 09:58:13 +02:00
Olof hagsand
a7ef2c4f12 Rewrote parsing of extra config-files to work recursively over structured data
Fixed that modified config variables were not properly overwritten in XML
Added `pretty` parameter to clicon_options_dump
Added testcases for recursive and structure extra config files
2023-08-23 11:10:24 +02:00
Olof hagsand
124afb8788 Modified -C command-line handling and added to SNMP 2023-08-23 10:52:47 +02:00
Olof hagsand
c101799e74 New command-line option for dumping configuration options for all clixon applications after load
Removed -s dump
2023-08-22 12:41:36 +02:00
Olof hagsand
5d1c6b5759 Preparations for 6.2.0
Openssl 3.0 and autoconf 2.71
2023-04-29 16:23:54 +02:00
Olof hagsand
447b8eb1d3 test fix breaking actions. Minor doc changes 2023-04-25 16:22:25 +02:00
Olof hagsand
5cb41c8d8a Fixed: unified netconf input: wrong yang-bind 2023-04-20 21:47:33 +02:00
Olof hagsand
e7c9f3d075 Unified netconf input function
First for external use, later internal
2023-04-20 21:28:01 +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
1e136bc9df Added clicon_data_init API, and yang_mount_get API
Moved dynamic options from options to data API
2023-03-12 21:04:23 +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
51ebbdf12f * C-API: Added clicon_handle parameter to all xml_bind_* calls 2023-01-27 14:56:58 +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
923b998774 * Fixed: Initialized session-id to 1 instead of 0 following ietf-netconf.yang
* Clearer debug levels `clicon_debug()`:
  1: Logical debug message
  2: Input and output packets
  3: Message dump in hex, xpath parse trees
2023-01-18 15:51:31 +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
779fcf5458 Fixed xpath crashes discovered by fuzzing
Added fuzz code for xpath
Test: added negative xpath tests
2022-11-04 17:45:54 +01:00
Olof hagsand
05cdbf5c4f * List-pagination: Adhere to ietf-draft: Removed list-pagination "presence"
* Remove default expansion in NETCONF client
* C-API: Added `expanddefault` parameter to `xml_yang_validate_rpc()`
2022-11-02 11:25:06 +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
Olof hagsand
e3f3d772c7 Fixed: [message-id present on netconf app "hello"](https://github.com/clicon/clixon/issues/369) 2022-09-28 15:04:11 +02:00
Olof hagsand
795ac0cc7d Clixon-netconf: Redirect logs to syslog by default, instead of stderr 2022-08-23 19:41:02 +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
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
5551d753ef Logging fixes
* Fixed: [Error message seen twice in some cases](https://github.com/clicon/clixon/issues/325)
* Extended `-l` command-line option to all clixon commands with a `none` option, eg `-l n` directs logging to `dev/null`
2022-04-30 11:31:51 +02:00
Olof hagsand
28bd146e5c Added clixon_netconf command-line option -0and changed -H to -1
* `-0` means dont send hello, but fix netconf base version to 0 and use EOM framing
    * `-1` means dont send hello, but fix netconf base version to 1 and use chunked framing
2022-04-29 19:07:12 +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
c038c9a27f * Implementation of "chunked framing" according to RFC6242 for Netconf 1.1.
* First hello is 1.0 EOM framing, then successing rpc is chunked framing
  * See
    * [Netconf framing](https://github.com/clicon/clixon/issues/50), and
    * [Clixon does not switch to chunked framing after NETCONF 1.1 is negotiated](https://github.com/clicon/clixon/issues/314)
* C:
  * Moved netconf framing code from netconf application to clixon lib
* Test:
  * New expecteof_netconf and adjusted other expect scripts to handle NETCONF 1.1 framing
2022-03-28 12:36:44 +02:00
Olof hagsand
dfeb7cef75 * CLI reconnects to backend if backend restarts with a warning
* Note that edits to the candidate database or locks will be lost
  * To force the CLI to exit if backend restarts, undef `PROTO_RESTART_RECONNECT`
  * This is an effect of the fix of [Broken pipe error seen in client (cli) when backend restarts and CLICON_SOCK is recreated](https://github.com/clicon/clixon/issues/312), the CLI behavior on backend restart is changed.
* Added `eof` parameter to `clicon_rpc()` and `clicon_rpc1()` and error handling modified
2022-03-16 18:30:21 +01:00
Olof hagsand
6ae749c9dd * New clixon-config@2022-02-11.yang revision
* Added option: `CLICON_LOG_STRING_LIMIT`
2022-02-12 21:45:50 +01:00
Olof hagsand
77b4468eb3 Updated copyright statements to 2022 2022-01-18 16:36:00 +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
Olof hagsand
b91ce762d5 * Performance improvement
* Added ancestor config cache indicating wether the node or an ancestor is config false or true
  * Improved yang cardinality lookup
* Added yang_init(), called from all apps using yang
2021-11-18 08:37:54 +01:00
Olof hagsand
26d37352f4 NETCONF hello error handling, changed YANG PATCH enabling, refactored static linking
NETCONF hello errors, such as wrong session-id, prefix, namespace terminates session
  * Instead of returning an rpc-error reply
Changed YANG PATCH enabling:
  * Now: `./configure --enable-yang-patch`
  * Before: set YANG_PATCH constant in `include/clixon_custom.h`
Refactored Makefile for static linking
2021-10-05 12:04:53 +02:00
Olof hagsand
42e61f461c - Memleaks in xpath parse error
- Static linkage cli fix (worked in 5.3.0 but restructuring broke it)
- Renamed all cligen_ph_active_get to cligen_pt_active_get
- Added AFL deferred init
- test_install.sh for static .a suffix
2021-10-03 18:49:25 +02:00
Olof hagsand
c00162aec1 - Modified linkage constant in makefile to test for dynamic only
- CLIXON_STATIC_PLUGIN to support statically linked plugins
- Added -H option to clixon_netconf: Do not require hello before request
2021-09-25 16:36:37 +02:00
Olof hagsand
0c7f2043f3 * Pagination according to new draft
* count/skip -> limit/offset
* ietf-yang-metadata RFC 7952 support, placeholder parsing and extension
2021-09-21 11:22:41 +02:00
Olof hagsand
b88722fa25 - Restructure plugin module using a "module struct" rather than global variables.
This include plugin module init and exit functions
  New type: clixon_plugin_t exposed via public API while struct clixon_plugin is private
- Makefile changes for static linkage using "LINKAGE=static"
- Moved nacm external init to later stage in backend_main
2021-04-19 11:06:40 +02:00