Commit graph

1509 commits

Author SHA1 Message Date
Olof Hagsand
fcb6e5cb03 yang path sanity checks and use of real module as root 2023-02-07 11:14:58 +01:00
Olof Hagsand
a5220805b1 New plugin callback: ca_yang_patch - for modifying existing YANG modules
C-API: Added `spec` parameter to `xml2xpath()`
2023-02-05 14:14:57 +01:00
Olof Hagsand
48a0fb9968 Sanity checks for incoming internal netconf
Hex debug of messages
2023-02-05 14:14:57 +01:00
Olof hagsand
6681eb99d3 Netconf monitoring statistics frm RFC 6022 2023-02-04 17:13:45 +01:00
Olof hagsand
6d82c70e26 Investigation of https://github.com/clicon/clixon/issues/414
New tests and help texts
2023-02-02 07:32:27 +01:00
Olof hagsand
af1f5a037d Fixed: [SNMP: snmpwalk is slow and can timeout #404 ](https://github.com/clicon/clixon/issues/404)
Optimized yang_extension_value
2023-02-01 14:57:51 +01:00
Olof hagsand
91034e5361 YANG schema mount, added configure option --enable-yang-schema-mount 2023-01-30 11:49:11 +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
a8e13047fc * YANG schema mount RFC 8528, state data 2023-01-27 15:11:08 +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
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
8451a20db7 Improved error message when mandatory key missing 2023-01-19 09:13:52 +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
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
0324135043 Loosened strict RFC6022 session transport requirement due to race condition in clixon_snmp 2023-01-16 11:03:21 +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
bc6cc2b31f C-API: All calls to clicon_log_xml() changed to new function `clicon_debug_xml()\
Debugging, moved many detailed debugs from level 1 to 2
2023-01-15 13:17:58 +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
7558d40faa YANG device: allow replace of config bool as special case 2023-01-04 11:09:44 +01:00
Olof Hagsand
ddfcb9716c C-API: Add yang_parse_post() as externally accessible 2023-01-03 21:46:58 +01:00
Olof hagsand
bcca87b1a0 Fixed: [locally scoped YANG typedef in grouping does not work #394](https://github.com/clicon/clixon/issues/394) 2023-01-03 21:45:21 +01:00
Olof Hagsand
99c6f61637 Enhanced for client-side functionality:
- parse of yang from string, not only file
- Decode of xml encoding, not only decoding
2023-01-02 21:29:28 +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
5b9921933a Freebsd socketpair include problems and lack of TAB in vagrant Makefile 2022-12-27 11:58:13 +01:00
Olof hagsand
ca23b63a4e Fixed: [leafref in new type no work in union type](https://github.com/clicon/clixon/issues/388) 2022-12-27 11:29:22 +01:00
Olof hagsand
fb45085491 Include fix: need sys/time.h 2022-12-23 15:14:12 +01:00
Olof hagsand
62b40a9397 Netconf monitoring RFC 6022: datastores 2022-12-23 14:47:10 +01:00
Olof hagsand
1eefadfc74 Fixed memory leak in xmld database put code
C: refactored choice validate code
2022-12-22 17:32:40 +01:00
Olof hagsand
b67ef69b7f Fixed: XPath evaluation of two nodes reverted to strcmp even if both were numbers 2022-12-22 16:42:41 +01:00
Olof hagsand
ffe918dd0e Fixed: [Defaults in choice does not work properly](https://github.com/clicon/clixon/issues/390)
C: Added new file clixon_xml_default.[ch] and moved all default handling there
2022-12-22 12:13:20 +01:00
Olof hagsand
7e92f67f4f RFC6022 montoring fix: submodules should report main module's namespace 2022-12-20 20:09:18 +01:00
Olof Hagsand
29eb22d47c
Merge pull request #389 from clicon/issue#384
Issue#384: with-defaults basic-mode is not honored on get-config
2022-12-20 14:03:39 +01:00
Olof hagsand
8db7892e38 sanity checkof xret in param
test: updated to new openconfig network-instance version
2022-12-20 13:47:08 +01:00
Jan-Olof Carlson
e8048fa434 Conditional compilation to support report-all default retrieval 2022-12-20 10:14:09 +00:00
Olof Hagsand
f46d675370 Netconf: remove operations attribute from edit-config operations
Added `ISO/IEC 10646` encodings to XML parser: `&#[0-9]+;` and `&#[0-9a-fA-F]+;`
2022-12-20 09:38:42 +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
6baa904039 Added CLIXON_CLIENT_SSH to client API to communicate remotely via SSH netconf sub-system
configure: stringified SSH_BIN
C-API: Added `sock_flags` parameter to `clixon_proc_socket()`
2022-12-08 15:13:05 +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
a38c54e4cc Netconf monitoring:
- Announce module capability
- Return origin Yang file in get-schema
2022-12-04 13:10:14 +01:00
Olof hagsand
c94e9dad67 Feature Request: Support RFC 6022 (NETCONF Monitoring)
* Added capabilities and schema state, and get-schema rpc
* New `clixon-config@2022-11-01.yang` revision
  * Added option:
    * `CLICON_NETCONF_MONITORING`
    * `CLICON_NETCONF_MONITORING_LOCATION`
2022-11-28 15:53:24 +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
2cdc78c576 Fixed static compile of util validate
FIxed mem-leaks on xpath errors
Test: valgrind of confirmed-commit
2022-11-25 17:57:24 +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
05372c86fc Added copyright for cjson code 2022-11-23 09:59:26 +01:00
Olof hagsand
a9a82d6e0c Load RFC6022 ietf-netconf-monitoring, first step 2022-11-23 09:54:56 +01:00
jiangxiaoming
4839a633e3 add regex unicode match support 2022-11-23 11:35:41 +08: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