Commit graph

155 commits

Author SHA1 Message Date
Olof hagsand
bd290e4594 Fixed: Fail on return errors when reading from datastore 2024-04-24 13:48:06 +02:00
Olof hagsand
407b4703b3 [Autolock](https://github.com/clicon/clixon/issues/508)
Added option: `CLICON_AUTOLOCK`
2024-04-12 13:09:27 +02:00
Olof hagsand
9826ac16ff Formatting and CHANGELOG updates 2024-04-03 17:40:32 +02:00
Olof hagsand
8f2601bfdf Fixed several backend memory leacks 2024-02-18 17:55:38 +01:00
Olof hagsand
d660c01a58 Optimization of xldb_put
Added flags parameter to default functions
removed call to bind
2024-02-06 09:27:51 +01:00
Olof hagsand
23dcb58758 Optimization of PUT 2024-02-05 17:14:36 +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
Olof hagsand
9989ee4d52 Removed other datastore options than cached
Marked `CLICON_DATASTORE_CACHE` as obsolete
2024-02-01 19:28:41 +01:00
Olof hagsand
121cd3ed2e Debug: ensured all exit logs are on the format: retval:%s 2024-01-24 10:03:28 +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
Olof hagsand
558a0df1f3 Fixed proper restore of cttl-C in msg rcv
Rename and move plugin_context_check to clixon_resource_check
2023-12-21 15:00:12 +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
e9c5287c36 Debug: improved debug level 2 with socket-description, also for notification 2023-11-01 13:48:41 +01:00
Alexander Skorichenko
71431dcd82 Let restart-plugin RPC pick up on yang's defaults
In the transaction that applies plugin's config don't include
yang's defaults in the transaction source.
2023-10-31 14:57:20 +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
86ef8053a2 Typo in previous commit 2023-05-29 10:55:05 +02:00
Olof hagsand
a97a66cb92 Performance: A change in the merge code made "co-located" config and non-config get retrieval go considerable faster. 2023-05-29 10:47:00 +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
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
5f2978d06c Files: Rearranged backend .h files: moved client_entry to clixon_backend_client.h 2023-03-03 16:05:31 +01: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
fe8636bb77 Move validation flag to include diff 2023-02-21 20:19:59 +01:00
Olof Hagsand
034ab632f1 * C-API: Added vlev validate level parameter to candidate_commit
* `vlev` : validate level
2023-01-29 20:02:56 +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
46137e1394 Fixed: [Netconf commit confirm session-id mismatch #407](https://github.com/clicon/clixon/issues/407) 2023-01-18 15:55:49 +01:00
Olof hagsand
0df023c70e Typo in xpath ilen
Doc of backend code
2023-01-02 21:21:37 +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
8ebab16c4c Add proper error message if namespace not found in module-set header 2022-11-28 13:50:41 +01:00
Olof hagsand
f82ce896a9 Typos and docker test fix for ubuntu-22.04 2022-11-10 11:40:54 +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
a9d1ab006c Confirmed commit: lock check on running 2022-10-26 20:18:57 +02:00
Olof hagsand
62e652bbcf Confirm-commit refactoring
Moved commit-confirm code to backend_confirm.c and removed (almost all) globals vars
2022-10-24 10:54:51 +02:00
Olof hagsand
6f0bd01a6a Confirm-commit RESTCONF support 2022-10-18 10:56:14 +02:00
Olof hagsand
11eccd5478 Confirm commit:
- Removed confirm-commit 1.0 capability (only 1.1 present)
- Made startup capability conditional (as confirmed-commit)
- Fixed startup error when rollback did not exist
- Adjust snmp commit calls
- Move failsafe to lib
- Test: Minimized test application, test capability
2022-10-07 16:04:31 +02:00
Phil Heller
8abcda6f85 confirmed-commit fixes, tests
- fixed typo preventing evaluation of confirmed-commit logic in backend_startup
- fixed uninitialized variable warnings
- added details to CHANGELOG.MD
- added capabilities advertisement for confirmed-commit 1.0 and 1.1
- added xml hello message that uses only eom framing, for simplicity in asynch tests
- add stty restore after wait_restconf to fix console corruption in tests
- adjust test_confirmed_commit to drop perms and run as the invoking user.  This will require running user to have permissions on /usr/local/var/example
- added CLI tests
2022-10-03 21:47:09 -06:00
Phil Heller
284316b646 Initial implementation of NETCONF confirmed-commit 2022-10-03 21:44:35 -06:00
Olof hagsand
f0c8201762 Added warning if modstate is not present in datastore if is set 2022-10-03 10:29:48 +02:00
Olof hagsand
d1553471f7 Fixed: [Validation of mandatory in choice/case does not work in some cases](https://github.com/clicon/clixon/issues/349) 2022-08-10 13:25:30 +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
77b4468eb3 Updated copyright statements to 2022 2022-01-18 16:36:00 +01:00
Olof hagsand
5388aace12 Refactoring for better performance of large auto-cli specs
* Fixed: [very slow execution of load_set_file #288](https://github.com/clicon/clixon/issues/288)
* New `clixon-lib@2021-11-11.yang` revision
  * Modified option: RPC stats extended with YANG stats
* Modified `clixon-config@2021-11-11.yang` revision
  * Added option:
    * CLICON_PLUGIN_CALLBACK_CHECK
    * Enable to make plugin context check before and after all callbacks.
* Added statistics for YANG: number of objects and memory used
* Use the treeref no-copy option of CLIgen to reduce memory
* Refactored cli-generation/autocli-start code
* Refactored cligen glue functions to use cligen_eval directly (remove clicon_eval,clixon_cligen_eval)
2021-11-25 12:04:05 +01:00
Olof hagsand
c93348d8d5 Hide plugin check handler struct with a handler 2021-10-19 17:36:23 +02:00