Commit graph

28 commits

Author SHA1 Message Date
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
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
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
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
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
dadf4a778a * HTTP/1 native parser as part of the RESTCONF client
* Fixed memory error in opendir/readdir in clicon_file_dirent
* Remove MAXPATH in parsers
* New string-del function
2022-02-08 16:59:08 +01:00
Olof hagsand
77b4468eb3 Updated copyright statements to 2022 2022-01-18 16:36:00 +01:00
Olof hagsand
2dcc14a0db Added error handling in yang_path_arg triggered by no filter in get paginated
Fixed cornercase of restconf error return when no body
Fixed cornercase when exactly / given as xpath
Better error message when YANG not found: added which YANG file imports it
2021-11-10 18:35:24 +01:00
Olof hagsand
52744c9301 Revert "List pagination locking for state-data changes"
This reverts commit eea6d549f6.
2021-10-30 15:49:23 +02:00
Olof hagsand
eea6d549f6 List pagination locking for state-data changes
Changed semantics of locking: instead of relying of locking running-db,
an automatic lock bound to a session is maintained. When the session closes
the lock is released.
2021-10-28 14:49:33 +02:00
Olof hagsand
448aa4c994 include signal.h 2021-10-21 16:29:43 +02:00
Olof hagsand
edbbb43e1f Removed remaining and replaced pagination-mode with locked parameter
Dispatcher: Added dispatcher_free(), fixed mem-leaks and malloc return
checks
2021-10-10 11:40:47 +02:00
Olof hagsand
ce06f25be7 Merge branch dispatcher and broke out pagination callbacks to use it
* Merge branch 'dcornejo-master'
* Broke out pagination callback API from state data callbacks
  * New pagination callback API uses new dispatcher from netgate, thanks @dcornejo
   * Register callback with: `clixon_pagination_cb_register()`
   * Use accessor functions `pagination_offset()`, `pagination_limit()`, etc
 * Reverted state data callback API to pre-5.3 (see C/CLI API changes below)
2021-10-08 15:19:37 +02:00
Olof hagsand
9b6bb3ecbf - Added transaction_arg_set()
- Modifed coverage script
2021-09-27 16:31:21 +02:00
Olof hagsand
dd8883420c * Made backend transaction and commit/validate API available to plugin code.
* This enables that RPOC handles can call commit and validate via lib
  * The commit/validate API is now: `candidate_validate()` and `candidate_commit()`
2021-06-17 19:20:27 +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
Olof hagsand
96b50b88e8 Copyright 2021 2021-01-13 14:40:34 +01:00
Olof hagsand
662d6b0a3f Clixon 4.4 three compile-time options: MOVE_TRANS_END for changing transaction-end callbacks; STATE_ORDERED_BY_SYSTEM to make state data system ordered; XML_MERGE_TWO_ROUNDS to improve xml_merge performance. 2020-04-02 14:28:58 +02:00
Olof hagsand
ee329ee382 * RESTCONF "depth" query parameter supported
* C API change: Added `depth` parameter to function `clicon_xml2cbuf`, default is -1.
2019-08-17 10:54:13 +02:00
Olof hagsand
06e6ef80d1 Non-key list now not accepted in edit-config (before only on validation) 2019-05-08 12:51:10 +02:00
Olof hagsand
0103d58994 2019 2019-01-02 15:48:30 +01:00
Dave Cornejo
513df9b19d include limits.h for non-Linux compatibility 2018-04-23 08:49:45 -10:00
Olof hagsand
38f0b446fa 2017->2018 2018-01-01 12:25:33 +01:00
Olof hagsand
bc2b606167 dual license 2016-12-30 16:14:48 +01:00
Olof Hagsand
dfa30aa39c xml_print 2016-04-17 17:52:48 +02:00
Olof hagsand
c1c1670a74 getting legacy grideye application to work on clixon 2016-03-20 22:25:42 +01:00
Olof Hagsand
79b77943f9 renamed .h and libs clicon->clixon 2016-02-28 15:27:36 +01:00
Renamed from apps/backend/clicon_backend_transaction.c (Browse further)