Commit graph

100 commits

Author SHA1 Message Date
Olof hagsand
c1e4595949 Refactoring of RESTCONF/TLS close code
Single closing function: restconf_close_ssl_socket
Added constant HTTP_ON_HTTPS_REPLY for http request on https socket
2022-09-13 23:01:19 +02:00
Olof hagsand
7d8ddf7697 Restconf RFC8071 call-home first working prototype 2022-07-31 09:59:52 +02:00
Olof hagsand
bed6d3c739 TEXT file format: Keep backward-compatible non-top-level prefix with compile-time option TEXT_SYNTAX_NOPREFIX
See https://github.com/clicon/clixon/issues/345
2022-07-26 18:10:27 +02:00
Olof hagsand
f6fe9f6a64 SNMP: fix SNMP set access of table entries
[Conversion of ethernet address (PhysAddress) and IP address (IPAddress) crashes agent](https://github.com/clicon/clixon/issues/340)
Hwaddress and IP adress for scalar and table set should now work
2022-06-26 11:31:28 +02:00
Olof hagsand
b5d17d643a SNMP: Started register table entries dynamically
Compile-time constant: SNMP_TABLE_DYNAMIC
Added MIB SNMP erroir handling
2022-06-26 11:30:29 +02:00
Olof hagsand
33c77c8a09 Cleanup, debug stmts, diff vars and obsolete compile options 2022-06-23 15:40:47 +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
4f9ed02a46 Text syntax parser/loader, fixed double leaf-list issue
Test: extended test_cli with format 4x tests
2022-06-03 14:03:01 +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
87719c623c Text syntax parser/loader
Leaf-list syntax using: "id [ leaf leaf ...]" syntax for output and input
Variables using \n\r in text
Added clixon_xvec_merge()
2022-06-01 11:08:19 +02:00
Olof hagsand
f11e4bad6c Http data server changes
* Indirect redirects from directory to `index.html`
  * Added `HTTP_DATA_INTERNAL_REDIRECT` compile-time option
* Added CLICON_RESTCONF_API_ROOT to clixon-config.yang
* Added 404 return without body if neither restconf, data or streams prefix match
* Fixed: HTTP/1 parse error for '/' path
2022-04-28 16:17:07 +02:00
Olof hagsand
76213057b6 * Extended the Restconf implementation with a limited www-data
* This is an experimental implementation
  * Added `www-data` feature and two new config options to clixon-config.yang:
     * `CLICON_WWW_DATA_PATH`
     * `CLICON_WWW_DATA_ROOT`
  * The limited implemtation is as follows:
     * path: Local files within `CLICON_WWW_DATA_ROOT`
     * operation GET, HEAD, or OPTIONS
     * query parameters not supported
     * indata should be NULL (no write operations)
     * Limited media: text/html, JavaScript, image, and css
     * Authentication as restconf
Generic changes:
  * Uniform path selection across fcgi, native http/1 + http/2
2022-04-21 16:01:33 +02:00
Olof hagsand
580396d32f - Misc documentation
- Test: move pid file from tmp to global storage to prevent multiple instances
2022-04-14 15:21:25 +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
bf983d7ca4 * New clixon-config@2022-03-21.yang revision
* Added option:
    * `CLICON_NETCONF_BASE_CAPABILITY`
* Removed `NETCONF_1_1_ANNOUNCE` compile option
2022-03-27 17:38:36 +02:00
Olof hagsand
85c6c11970 * Netconf: Disabled default announcing of Netconf 1.1, instead only announce 1.0
* See [Clixon does not switch to chunked framing after NETCONF 1.1 is negotiated](https://github.com/clicon/clixon/issues/314)
  * To enable Netconf 1.1, set `NETCONF_1_1_ANNOUNCE`
2022-03-17 20:29:41 +01: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
12695c5d87 * Unit test ifdef for restconf http1 parser
* test: fix cli-union test
2022-02-17 09:16:01 +01:00
Olof hagsand
77b4468eb3 Updated copyright statements to 2022 2022-01-18 16:36:00 +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
acc9c083a4 * Added sorting of YANG statements
* Some openconfig specs seem to have use/when before a "config" which it depends on. This leads to XML encoding being in the "wrong order.
  * When parsing, clixon now sorts container/list statements so that sub-statements with WHEN are put last.
  * See [Statements given in "load set" are order dependent](https://github.com/clicon/clixon/issues/287)
* Fixed: [Statements given in "load set" are order dependent](https://github.com/clicon/clixon/issues/287)
2021-11-16 14:40:23 +01:00
Olof hagsand
81da71ffd7 * XML to JSON CDATA translation is NOT stripped
* Example, assume XML: `<s><![CDATA[  z > x  & x < y ]]></s>`
  * Previous bevavior:
    * JSON: {"s":"  z > x  & x < y "}
  * New behavior:
    * JSON: `{"s":"<![CDATA[  z > x  & x < y ]]>"}`
  * To keep old behavior, set `JSON_CDATA_STRIP` in clixon_custom.h
2021-11-13 17:11:00 +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
b70e22096e - Pagination: enabled LIST_PAGINATION and remobved constant
- Changed logic on how to find clixon_restconf in pseudo plugin
- Removed ==== in constants to avoid conflict with git merge
- Remove assert
- Added fuzzing for netconf
2021-09-23 13:33:26 +02:00
Olof hagsand
6e316b519b - Refactoring of get_common/get_list_pagination with two sub-functions
- Fixed memory leak
2021-09-21 11:27:58 +02:00
Olof hagsand
fb0b9409f3 - Moved restrconf code from pageing rpc to get 2021-09-21 11:24:53 +02:00
Olof hagsand
b03cf426a4 * Protyped netconf native pagination 2021-09-21 11:24:53 +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
77bacc93bb - Updated code to clixon 5.2 status
- Added LIST_PAGINATION clixon_custom constant
- Fix: leafs added as augments on rpc input/output lacked cv:s
2021-09-21 11:22:40 +02:00
Olof hagsand
f7f24949d6 Merge branch 'yang-patch-alanfork' of https://github.com/alanyanigersiklu/clixon into alanyanigersiklu-yang-patch-alanfork 2021-07-19 22:54:00 +02:00
Olof hagsand
df6f26c0de Misc cleanups, remove old yangs, typos, etc 2021-07-19 22:08:23 +02:00
Olof hagsand
1ef7a280d7 * Fixed: [when condition error under augment in restconf #227](https://github.com/clicon/clixon/issues/227)
* As part of this fix added custom constant XML_PARENT_CANDIDATE
2021-05-25 15:25:26 +02:00
Olof hagsand
0d7e644335 - Native restconf: use cligen buffers instead of libevent for replies 2021-04-29 14:06:05 +02:00
Olof hagsand
6981daf595 Fixed: [Multiple http requests in native restconf yields same reply #212](https://github.com/clicon/clixon/issues/212) 2021-04-24 17:43:05 +02:00
Olof hagsand
ecd5f7de70 * Add default network namespace constant: RESTCONF_NETNS_DEFAULT with default value "default". 2021-04-22 13:45:02 +02:00
Olof hagsand
9087694b58 Fixed: [Backend can not read datastore with container named config #147](https://github.com/clicon/clixon/issues/147) 2021-03-13 17:15:00 +01:00
Olof hagsand
b7991d9b39 * Made a separate Clixon datastore XML/JSON top-level symbol
* Replaces the hardcoded "config" keyword.
  * Implemented by a compile-time option called `DATASTORE_TOP_SYMBOL` option in clixon_custom.h
* Tests: added endtest to all tests. Removed all premature exits if BE=0
2021-03-05 14:15:15 +01:00
Olof hagsand
ab18946880 * Fixed extension/unknown problem shown in latest openconfig where other than a single space was used between the unknown identifier and string
* Removed skiplist of openconfig/yangmodels tests to inside the test
2021-02-23 13:47:17 +01:00
Olof hagsand
96b50b88e8 Copyright 2021 2021-01-13 14:40:34 +01:00
Olof hagsand
7459925bd0 Limited fuzz by AFL committed, see [fuzz/README.md](fuzz/README.md) for details 2020-12-29 18:29:06 +01:00
Olof hagsand
81fc7f742b * Netconf as default namespace has been disabled by default.
* Only requests on the form: `<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><edit-config>...` will be accepted
  * All replies will be on the form: `<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">...`
  * Requests such as: `<rpc><edit-config>...` will not  be accepted.
  * You can revert this behaviour (to clixon pre-4.6 behaviour) by enabling `CLICON_NAMESPACE_NETCONF_DEFAULT`
  * This API change is a consequence of: [copy-config's RPC cxobj parameter does not contain namespace #131](https://github.com/clicon/clixon/issues/131)
2020-09-02 15:44:10 +02:00
Olof hagsand
c049a397b0 Fixed ssl client certs for evhtp.
* Added SSL cert info as options: CLICON_SSL_SERVER_CERT, CLICON_SSL_SERVER_KEY, CLICON_SSL_CA_CERT
Added config.sh for testing for autotools
2020-07-01 15:11:22 +02:00
Olof hagsand
9c82e97072 Added http support for evhtp (not only https) 2020-06-29 14:41:08 +02:00
Olof hagsand
132122c937 enabled and removed USE_CLIGEN44 2020-05-12 14:02:25 +02:00
Olof hagsand
29235d5547 Removed and enabled code for compile options: RESTART_PLUGIN_RPC, XML_NEW_DIFFERENTIATE, OPTIMIZE_45_BIND and OPTIMIZE_45_SORT 2020-05-11 15:29:58 +02:00
Olof hagsand
f9e1fe5de7 removed state path kludge 2020-05-05 17:13:38 +02:00
Olof hagsand
bc0eb921d0 Added functionality to restart an individual plugin.: New clixon-lib:restart-plugin RPC 2020-05-04 15:04:02 +02:00
Olof hagsand
3ab1f50a19 undef state path bypass 2020-05-04 13:35:04 +02:00
Olof hagsand
592c513b83 Fix up state bypass get code 2020-05-04 13:10:43 +02:00
Olof hagsand
7bc772f6a8 undef USE_STATE_PATH_KLUDGE 2020-05-01 21:43:45 +02:00