Olof hagsand
67b8685bab
The Clixon API has been extended with namespaces, or namespace contexts in the following cases:
...
* CLIspec functions have added namespace parameter:
* `cli_show_config <db> <format> <xpath>` --> `cli_show_config <db> <format> <xpath> <namespace>`
* `cli_copy_config <db> <xpath> ...` --> `cli_copy_config <db> <xpath> <namespace> ...`
* Xpath API
* `xpath_first(x, format, ...)` --> `xpath_first(x, nsc, format, ...)`
* `xpath_vec(x, format, vec, veclen, ...)` --> `xpath_vec(x, nsc, format, vec, veclen, ...)`
* `xpath_vec_flag(x, format, flags, vec, veclen, ...)` --> `xpath_vec_flag(x, format, flags, vec, veclen, ...)`
* `xpath_vec_bool(x, format, ...)` --> `xpath_vec_bool(x, nsc, format, ...)`
* `xpath_vec_ctx(x, xpath, xp)` --> `xpath_vec_ctx(x, nsc, xpath, xp)`
* xmldb_get0 has an added `nsc` parameter:
* `xmldb_get0(h, db, xpath, copy, xret, msd)` --> `xmldb_get0(h, db, nsc, xpath, copy, xret, msd)`
* The plugin statedata callback (ca_statedata) has been extended with an nsc parameter:
* `int example_statedata(clicon_handle h, cvec *nsc, char *xpath, cxobj *xstate);`
* rpc get and get-config api function has an added namespace argument:
* `clicon_rpc_get_config(clicon_handle h, char *db, char *xpath, char *namespace, cxobj **xt);`
* `int clicon_rpc_get(clicon_handle h, char *xpath, char *namespace, cxobj **xt);`
2019-07-08 10:36:37 +02:00
Olof hagsand
b64dd678dc
CLI ranges error shown instead of "Unknown command"
2019-06-21 17:44:52 +02:00
Olof hagsand
d12644a5ef
Fixed [Wrong yang-generated cli code for typeref identityref combination #88 ]( https://github.com/clicon/clixon/issues/88 )
2019-06-20 19:00:22 +02:00
Olof hagsand
af720e8f28
Merge branch 'master' of https://github.com/clicon/clixon
2019-06-18 14:50:30 +02:00
Olof hagsand
17e3e74ad5
All hash_ functions have been prefixed with clicon_ to avoid name collision with other packages (frr)
2019-06-18 14:49:18 +02:00
Olof hagsand
d3c392b69d
* New clixon-config@2019-06-05.yang revision
...
* Added: `CLICON_YANG_REGEXP, CLICON_CLI_TAB_MODE, CLICON_CLI_HIST_FILE, CLICON_CLI_HIST_SIZE, CLICON_XML_CHANGELOG, CLICON_XML_CHANGELOG_FILE`.
* Renamed: `CLICON_XMLDB_CACHE` to `CLICON_DATASTORE_CACHE` and type changed.
* Deleted: `CLICON_XMLDB_PLUGIN, CLICON_USE_STARTUP_CONFIG`;
* New clixon-lib@2019-06-05.yang revision
* Added: ping rpc added (for liveness)
* Check cligen tab mode, dont start if CLICON_CLI_TAB_MODE is undefined
2019-06-05 10:58:02 +02:00
Olof hagsand
55f9b7cab0
Added CLIgen tab-modes in config option CLICON_CLI_TAB_MODE, which means you can control the behaviour of <tab> in the CLI.
2019-05-29 20:11:31 +02:00
Olof Hagsand
2ae9529a3e
added regexp free routines, replaced regexp mode string with symbol
2019-05-29 14:17:30 +00:00
Olof hagsand
5706703ab4
Added support for inverted regexps
2019-05-29 14:39:36 +02:00
Olof hagsand
2fe185d683
* Support for multiple patterns as described in RFC7950 Section 9.4.7
...
* Added regex cache to type resolution
* Added compiled regexp parameter as part of internal yang type resolution functions
* All internal `ys_populate_*()` functions (except ys_populate()) have switched parameters: `clicon_handle, yang_stmt *)`
2019-05-29 11:39:09 +02:00
Olof hagsand
5b39b63698
Added --with-libxml2 to configure
2019-05-24 10:04:29 +02:00
Olof hagsand
e55a27bcac
Check for libxml2 include files, not lib in code
2019-05-23 22:55:46 +02:00
Olof hagsand
a804e05375
* Added clicon_handle as parameter to all validate functions
...
* Added libxml2 XSD regexp mode as alternative to posix translation
* Added `CLICON_YANG_REGEXP` option with possible values libxml2 and posix
2019-05-23 22:48:33 +02:00
Olof Hagsand
a7af7e7593
memleaks
2019-05-22 18:27:53 +00:00
Olof hagsand
bc54f2d04c
* Regexp improvements
...
* Added check for libxml in configure';
* Added clixon_util_regexp utility function
* Yang state get improvements
* Integrated state and config into same tree on retrieval, not separate trees
* Added cli functions `cli_show_config_state()` and `cli_show_auto_state()` for showing combined config and state info.
* Added integrated state in the main example: `interface/oper-state`.
* Added performance tests for getting state, see [test/test_perf_state.sh].
2019-05-20 16:03:29 +02:00
Olof hagsand
c17784cfe9
Removed O(n^2) in cli expand/completion code
2019-05-16 20:08:25 +02:00
Olof hagsand
6f294fe67a
Yang Enumeration including space did not generate working CLIgen code, see [Choice with space is not working in CLIgen code]( https://github.com/olofhagsand/cligen/issues/24 )
2019-05-15 11:12:23 +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
6bf2a74e24
* Restconf with startup feature will now copy all edit changes to startup db (as it should according to RFC 8040)
...
* See [Restconf does not handle startup datastore according to the RFC](https://github.com/clicon/clixon/issues/74 )
* Netconf Startup feature is no longer hardcoded, you need to explicitly enable it (See RFC 6241, Section 8.7)
* Enable in config file with: `<CLICON_FEATURE>ietf-netconf:startup</CLICON_FEATURE>`, or use `*:*`
2019-04-26 12:12:55 +02:00
Olof hagsand
cef0dc5a22
* Added yang access functions
...
* Change all y->ys_parent to yang_parent_get(y)
* Change all y->ys_keyword to yang_keyword_get(y)
* Change all y->ys_argument to yang_argument_get(y)
* Change all y->ys_cv to yang_cv_get(y)
* Change all y->ys_cvec to yang_cvec_get(y)
2019-04-11 15:53:25 +02:00
Olof hagsand
56f32371ce
* Backend plugin returning NULL was still installed - is now logged and skipped.
...
* [Parent list key is not validated if not provided via RESTCONF #83 ](https://github.com/clicon/clixon/issues/83 ), thanks achernavin22.
2019-04-11 11:25:42 +02:00
Olof hagsand
b5f1f7346e
Structural C-code change: Merged yang_spec and yang_node types into yang_stmt
2019-04-02 12:27:33 +02:00
Olof hagsand
98a5ebc76e
* Structural change: removed datastore plugin and directory, and merged into regulat clixon lib code.
...
* Moved out code from clixon_options.[ch] into a new file: clixon_data.[ch]
2019-03-31 18:17:40 +02:00
Olof hagsand
60cb87f998
Removed argc/argv parameters from ca_start plugin API function. You may need to change signatures of your startup in your plugins
2019-03-28 17:11:55 +01:00
Olof hagsand
cdbce7645e
Changed hash API for better error handling
2019-03-28 13:16:44 +01:00
Olof Hagsand
7ee4a151cf
guard CLICON_CLI_HIST_SIZE with CLIgen default
2019-03-28 09:19:43 +01:00
Olof Hagsand
0898870e68
Re-inserted cli_output_reset for what was erroneuos thought to be an obsole\
...
te function
2019-03-22 16:13:51 +01:00
Olof hagsand
434f0b930e
Made Makefile concurrent so that it can be compiled with -jN
2019-03-21 10:40:00 +01:00
Olof hagsand
b03f8332e1
* CLI history: [Preserve CLI command history across sessions. The up/down arrows]( https://github.com/clicon/clixon/issues/79 )
...
* The design is similar to bash history:
* The CLI loads/saves its complete history to a file on entry and exit, respectively
* The size (number of lines) of the file is the same as the history in memory
* Only the latest session dumping its history will survive (bash merges multiple session history).
* Tilde-expansion is supported
* Files not found or without appropriate access will not cause an exit but will be logged at debug level
* New config options: CLICON_CLI_HIST_FILE with default value `~/.clixon_cli_history`
* New config options: CLICON_CLI_HIST_SIZE with default value 300.
2019-03-08 11:26:07 +01:00
Olof hagsand
efe44d60e8
Added base as CLI default mode and cli
2019-03-05 16:19:20 +01:00
Olof hagsand
b182e8666f
[yang type range statement does not support multiple values]( https://github.com/clicon/clixon/issues/59 )
...
[Multiple ranges support](https://github.com/clicon/clixon/issues/78 )
Restructured "cb" parameter in cli_generate.c
2019-03-04 14:36:43 +01:00
Olof Hagsand
f035c3ca23
* Removed all dependency on strverscmp
...
* Added libgen.h for baseline()
2019-02-27 10:46:05 +01:00
Olof hagsand
2394c6f46e
Merge branch 'modules-state'
2019-02-26 16:53:59 +01:00
Olof hagsand
560110b4e8
* New backend startup and upgrade support, see [doc/startup.md] for details
...
* Datastore files contain RFC7895 module-state information
2019-02-26 15:48:15 +01:00
Olof hagsand
9afdd66f9a
Preparing for 3.9.0
2019-02-21 16:12:37 +01:00
Olof hagsand
83edd29678
Revert "Revert "* Added valgrind memory leak tests in testmem.sh for restconf""
...
This reverts commit a73d2bd242 .
2019-02-20 16:25:42 +01:00
Olof hagsand
a73d2bd242
Revert "* Added valgrind memory leak tests in testmem.sh for restconf"
...
String error
This reverts commit 6e63f0a77b .
2019-02-20 16:19:07 +01:00
Olof Hagsand
6e63f0a77b
* Added valgrind memory leak tests in testmem.sh for restconf
...
* Added clicon_socket_set() and clicon_socket_get() functions for cleaning up backend server and restconf FCGI socket on termination.
* Removed obsolete `-x` command-line option to clixon_cli.
2019-02-20 13:06:18 +01:00
Olof hagsand
286c2ec04f
Added valgrind memory leak tests in testmem.sh for cli and netconf
2019-02-18 16:05:51 +01:00
Olof hagsand
5b1c3d9a86
* clixon-config YAML file has new revision: 2019-02-06.
...
* Replaced all calls to (obsolete) `cli_output` with `fprintf`
* Added _experimental_ config option `CLICON_CLI_UTF8` default set to 0.
* CLIgen UTF8 does not work with scrolling and control editing
2019-02-06 14:33:04 +01:00
Olof hagsand
19343c2b21
* Partially corrected: [yang type range statement does not support multiple values]( https://github.com/clicon/clixon/issues/59 ).
...
* Should work for netconf and restconf, but not for CLI.
* Fixed again: [Range parsing is not RFC 7950 compliant](https://github.com/clicon/clixon/issues/71 )
2019-02-05 14:03:58 +01:00
Olof hagsand
ef86cda2fe
NACM Data node WRITE access module support (RFC8341 3.4.5)
2019-01-30 10:02:17 +01:00
Olof hagsand
0267afcb21
* Added -o "<option>=<value>" command-line option to all programs: backend, cli, netconf, restconf.
...
* Added -p <dir> command-line option to all programs: backend, cli, netconf, restconf.
* Moved and updated all standard ietf and iana yang files from example and yang/ to `yang/standard`.
* Renamed example yang from example.yang -> clixon-example.yang
2019-01-13 17:34:15 +01:00
Olof hagsand
f48c8f45c6
* Date-and-time type now properly uses ISO 8601 UTC timezone designators.
...
* Renamed yang file `ietf-netconf-notification@2008-07-01.yang` to `clixon-rfc5277`.
* Cligen uses posix regex while yang uses XSD. It differs in some aspects. A translator function has been added for `\d` -> `[0-9]` translation, there may be more.
* [ietf-netconf-notification@2008-07-01.yang validation problem #62 ](https://github.com/clicon/clixon/issues/62 )
2019-01-11 17:30:08 +01:00
Olof hagsand
207858e20d
* Support of yangmodels supported, see test_yangmodels.sh
...
* Added -o "<option>=<value>" command-line option to all programs: backend, cli, netconf, restconf.
* Ignore CR(\r) in yang files for DOS files
2019-01-10 20:52:19 +01:00
Olof hagsand
c7e847cd24
Keyword "min" (not only "max") can be used in built-in types "range" and "length" statements.
2019-01-06 22:11:59 +01:00
Olof hagsand
058a14579f
Yang choice functionality improved and stricter validation for CLI generation, mandatory flags, etc.
2019-01-04 11:37:26 +01:00
Olof hagsand
7a8f242a09
Added new clixon-lib yang module for internal netconf protocol. Currently only extends the standard with a debug RPC.
2019-01-02 22:50:03 +01:00
Olof hagsand
11479f7ec3
add yang-spec as arg to decode clicon msg
2019-01-02 20:59:57 +01:00
Olof hagsand
b443471e7b
Removed CLI generation for yang notifications (and other non-data yang nodes
2019-01-02 18:44:27 +01:00