Clixon 5.5.0
This commit is contained in:
parent
95f6fe8b1a
commit
6d955160ed
6 changed files with 87 additions and 76 deletions
50
CHANGELOG.md
50
CHANGELOG.md
|
|
@ -1,6 +1,6 @@
|
|||
# Clixon Changelog
|
||||
|
||||
* [5.5.0](#550) Planned January, 2022
|
||||
* [5.5.0](#550) 20 January 2022
|
||||
* [5.4.0](#540) 30 November 2021
|
||||
* [5.3.0](#530) 27 September 2021
|
||||
* [5.2.0](#520) 1 July 2021
|
||||
|
|
@ -33,58 +33,50 @@
|
|||
* [3.3.1](#331) June 7 2017
|
||||
|
||||
## 5.5.0
|
||||
Planned: January, 2022
|
||||
20 January 2022
|
||||
|
||||
This release introduces a new autocli design with a new clixon-autocli YANG file
|
||||
|
||||
### New features
|
||||
|
||||
* Changed auto-cli design
|
||||
* See [autocli documentation](https://clixon-docs.readthedocs.io/en/latest/cli.html#autocli)
|
||||
* Added new YANG clixon-autocli.yang, placing autocli options there
|
||||
* Default rules for module exclusion, list-keywords, completion, edit-modes, treeref-state
|
||||
* See [autocli documentation](https://clixon-docs.readthedocs.io/en/latest/cli.html#autocli) for overview
|
||||
* Added new YANG `clixon-autocli.yang` moving all autocli options there
|
||||
* Default rules for module exclusion, list-keywords, edit-modes, treeref-state and completion
|
||||
* Specialized rules for module exclusion and compression
|
||||
* Replaced separate autocli trees with a single `@basemodel` tree by using filter labels
|
||||
* Filter labels are added to the fill tree and then filtered out using `@remove:<label>`
|
||||
* Labels include: termfirstkeys, termlist, termleaf, leafvar, nonconfig,
|
||||
* For detailed docs see yang2cli_post()
|
||||
* Filter labels are added to the basemodel tree and then filtered out using `@remove:<label>`
|
||||
* This method reduces memory usage and is more generic
|
||||
* Backward compatible: can continue use the "old" trees.
|
||||
* Translation to new method as follows:
|
||||
* `@datamodel` translated to `@basemodel, @remove:termfirstkeys, @remove:termlist, @remove:termleaf, @remove:nonconfig`
|
||||
* `@datamodelshow` translated to `@basemodel, @remove:leafvar, @remove:nonconfig`
|
||||
* `@datamodelstate` translated to `@basemodel, @remove:leafvar`
|
||||
* Note: while @datamodel etc are backward compatible, the autocli redesign is NOT backward compatible
|
||||
* see API changes
|
||||
* New automatic edit-mode design
|
||||
* New autocli edit-mode design
|
||||
* Control which modes to use with `edit-mode-default`
|
||||
* Default is create edit-mode for all containers and list entries
|
||||
* New edit-mode tree: @datamodelmode
|
||||
* New edit-mode tree: `@datamodelmode`
|
||||
* Moved hide extensions from `clixon-lib` to `clixon-autocli`
|
||||
|
||||
### API changes on existing protocol/config features
|
||||
|
||||
Users may have to change how they access the system
|
||||
|
||||
* Auto-cli edit-modes changed
|
||||
* CLI-spec variable `CLICON_PROMPT` `%W` changed semantics due to long prompt
|
||||
* From "Full Working edit path" to "Last element of working path"
|
||||
* New `%w` has "Full working path"
|
||||
* Auto-cli edit-modes changed
|
||||
* Use `%w` if you want to keep "Full working path"
|
||||
* Edit modes only for list and container nodes
|
||||
* Change cli spec entry to `edit @datamodelmode, cli_auto_edit("basemodel");`
|
||||
* This is part of new clixon-autocli.yang feature
|
||||
* New `clixon-lib@2021-12-05.yang` revision
|
||||
* Extension `autocli-op` obsoleted and no longer supported
|
||||
* You need to change to use clixon-autocli `hide` and `hide-show` instead.
|
||||
* Translate as follows:
|
||||
* Extension `autocli-op` obsoleted and no longer supported, use clixon-autocli `hide` and `hide-show` instead as follows:
|
||||
* `cl:autocli-op hide` -> `autocli:hide`
|
||||
* `cl:autocli-op hide-database` -> `autocli:hide-show`
|
||||
* `cl:autocli-op hide-database-auto-completion` -> `autocli:hide; autocli:hide-show`
|
||||
* New `clixon-config@2021-12-05.yang` revision
|
||||
* Imported (as a sub-spec): clixon-clispec.yang
|
||||
* Removed obsolete options:
|
||||
* `CLICON_YANG_LIST_CHECK`
|
||||
* Fixed: Configure option `CLICON_RESTCONF_PRETTY` was marked as obsolete but was still used.
|
||||
* `CLICON_RESTCONF_PRETTY` is now obsolete for sure
|
||||
* Instead restconf/pretty is used with API function restconf_pretty_get()
|
||||
* Use: `restconf/pretty`
|
||||
* Fixed: Configure option `CLICON_RESTCONF_PATH` was marked as obsolete but was still used.
|
||||
* `CLICON_RESTCONF_PATH` is now obsolete for sure
|
||||
* Instead if you use fgci/nginx:
|
||||
|
|
@ -92,17 +84,19 @@ Users may have to change how they access the system
|
|||
* Ensure `<CLICON_FEATURE>clixon-restconf:fcgi</CLICON_FEATURE>` is set
|
||||
* Marked as obsolete and moved autocli config options from clixon-config.yang to clixon-autocli.yang
|
||||
* Use: `<config><autocli>...` for configuring the autocli
|
||||
* For details, see [autocli upgrade documentation](https://clixon-docs.readthedocs.io/en/latest/cli.html#upgrade-from-clixon-5-4)
|
||||
* For details, see [autocli upgrade documentation](https://clixon-docs.readthedocs.io/en/latest/cli.html#upgrade-from-pre-clixon-5-5)
|
||||
|
||||
### Minor features
|
||||
### C/CLI-API changes on existing features
|
||||
|
||||
Developers may need to change their code
|
||||
|
||||
* Removed `#ifdef __GNUC__` around printf-like prototypes since both clang and gcc have format/printf macros defined
|
||||
|
||||
* Removed ifdef __GNUC__ around printf-like prototypes since both clang and gcc have format/printf macros defined
|
||||
* Test changes
|
||||
* Use `YANG_STANDARD_DIR` from `./configure --with-yang-standard-dir=DIR` instead of `YANGMODELS` from site.sh
|
||||
* Remove dependency of IETF YANGs on most tests
|
||||
* Remove dependnency of example/main in most tests, instead make local copy of example yang
|
||||
* New `clixon-dev` development container (Work-in-progress)
|
||||
* Changed typo `configure --with-yang-standard-installdir` to `configure --with-yang-standard-dir`
|
||||
* Remove dependency of example/main in most tests, instead make local copy of example yang
|
||||
* Changed `configure --with-yang-standard-installdir` to `configure --with-yang-standard-dir`
|
||||
|
||||
### Corrected Bugs
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,6 @@ Clixon has a master branch continuously tested with CI, but releases are made ca
|
|||
|
||||
Clixon interaction is best done posting issues, pull requests, or joining the
|
||||
[slack channel](https://clixondev.slack.com).
|
||||
[Slack invite](https://join.slack.com/t/clixondev/shared_invite/zt-za7p40vq-l_Ib1Cq9rX~cHCkLCdu~Aw) (updated 26/11 2021)
|
||||
[Slack invite](https://join.slack.com/t/clixondev/shared_invite/zt-11yvaaum9-J4zEVnp~8KkTXFlQSE0Kmg)(updated 20/1 2022)
|
||||
|
||||
Clixon is sponsored by [Rubicon Communications LLC(Netgate)](https://www.netgate.com/)
|
||||
|
|
|
|||
|
|
@ -244,50 +244,18 @@ cli_interactive(clicon_handle h)
|
|||
return retval;
|
||||
}
|
||||
|
||||
/*! Generate autocli, ie if enabled, generate clispec from YANG and add to cligen parse-trees
|
||||
*
|
||||
* Generate clispec (basemodel) from YANG dataspec and add to the set of cligen trees
|
||||
* This tree is referenced from the main CLI spec (CLICON_CLISPEC_DIR) using the
|
||||
* "tree reference" syntax.
|
||||
*
|
||||
* @param[in] h Clixon handle
|
||||
* @param[in] printgen Print CLI syntax generated from dbspec
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
/*! Create pre-5.5 tree-refs for backward compatibility
|
||||
* should probably be moved to clispec default
|
||||
*/
|
||||
static int
|
||||
autocli_start(clicon_handle h,
|
||||
int printgen)
|
||||
autocli_trees_default(clicon_handle h)
|
||||
{
|
||||
int retval = -1;
|
||||
yang_stmt *yspec;
|
||||
pt_head *ph;
|
||||
parse_tree *pt = NULL;
|
||||
int enable = 0;
|
||||
cbuf *cb = NULL;
|
||||
int mode = 0;
|
||||
parse_tree *pt = NULL;
|
||||
pt_head *ph;
|
||||
|
||||
clicon_debug(1, "%s", __FUNCTION__);
|
||||
/* There is no single "enable-autocli" flag,
|
||||
* but set
|
||||
* <module-default>false</module-default>
|
||||
* with no rules:
|
||||
* <rule><operation>enable</operation>
|
||||
* is disable
|
||||
*/
|
||||
if (autocli_module(h, NULL, &enable) < 0)
|
||||
goto done;
|
||||
if (!enable){
|
||||
clicon_debug(1, "%s Autocli not enabled (clixon-autocli)", __FUNCTION__);
|
||||
goto ok;
|
||||
}
|
||||
/* Init yang2cli */
|
||||
if (yang2cli_init(h) < 0)
|
||||
goto done;
|
||||
yspec = clicon_dbspec_yang(h);
|
||||
/* The actual generating call from yang to clispec for the complete yang spec */
|
||||
if (yang2cli_yspec(h, yspec, AUTOCLI_TREENAME, printgen) < 0)
|
||||
goto done;
|
||||
/* Create backward compatible tree: @datamodel */
|
||||
if ((ph = cligen_ph_add(cli_cligen(h), "datamodel")) == NULL)
|
||||
goto done;
|
||||
|
|
@ -302,6 +270,7 @@ autocli_start(clicon_handle h,
|
|||
if (cligen_ph_parsetree_set(ph, pt) < 0)
|
||||
goto done;
|
||||
|
||||
|
||||
/* Create backward compatible tree: @datamodelshow */
|
||||
if ((ph = cligen_ph_add(cli_cligen(h), "datamodelshow")) == NULL)
|
||||
goto done;
|
||||
|
|
@ -368,8 +337,6 @@ autocli_start(clicon_handle h,
|
|||
goto done;
|
||||
if (cligen_ph_parsetree_set(ph, pt) < 0)
|
||||
goto done;
|
||||
|
||||
ok:
|
||||
retval = 0;
|
||||
done:
|
||||
if (cb)
|
||||
|
|
@ -377,6 +344,55 @@ autocli_start(clicon_handle h,
|
|||
return retval;
|
||||
}
|
||||
|
||||
/*! Generate autocli, ie if enabled, generate clispec from YANG and add to cligen parse-trees
|
||||
*
|
||||
* Generate clispec (basemodel) from YANG dataspec and add to the set of cligen trees
|
||||
* This tree is referenced from the main CLI spec (CLICON_CLISPEC_DIR) using the
|
||||
* "tree reference" syntax.
|
||||
*
|
||||
* @param[in] h Clixon handle
|
||||
* @param[in] printgen Print CLI syntax generated from dbspec
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
*/
|
||||
static int
|
||||
autocli_start(clicon_handle h,
|
||||
int printgen)
|
||||
{
|
||||
int retval = -1;
|
||||
yang_stmt *yspec;
|
||||
int enable = 0;
|
||||
|
||||
clicon_debug(1, "%s", __FUNCTION__);
|
||||
/* There is no single "enable-autocli" flag,
|
||||
* but set
|
||||
* <module-default>false</module-default>
|
||||
* with no rules:
|
||||
* <rule><operation>enable</operation>
|
||||
* is disable
|
||||
*/
|
||||
if (autocli_module(h, NULL, &enable) < 0)
|
||||
goto done;
|
||||
if (!enable){
|
||||
clicon_debug(1, "%s Autocli not enabled (clixon-autocli)", __FUNCTION__);
|
||||
goto ok;
|
||||
}
|
||||
/* Init yang2cli */
|
||||
if (yang2cli_init(h) < 0)
|
||||
goto done;
|
||||
yspec = clicon_dbspec_yang(h);
|
||||
/* The actual generating call from yang to clispec for the complete yang spec */
|
||||
if (yang2cli_yspec(h, yspec, AUTOCLI_TREENAME, printgen) < 0)
|
||||
goto done;
|
||||
/* XXX Create pre-5.5 tree-refs for backward compatibility */
|
||||
if (autocli_trees_default(h) < 0)
|
||||
goto done;
|
||||
ok:
|
||||
retval = 0;
|
||||
done:
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
usage(clicon_handle h,
|
||||
char *argv0)
|
||||
|
|
|
|||
|
|
@ -393,6 +393,7 @@ done:
|
|||
* CLI .so plugins have been loaded: syntax table in place.
|
||||
* Now load cligen syntax files and create cligen pt trees.
|
||||
* @param[in] h Clicon handle
|
||||
* XXX The parsetree loading needs a rewrite for multiple parse-trees
|
||||
*/
|
||||
int
|
||||
cli_syntax_load(clicon_handle h)
|
||||
|
|
|
|||
2
configure
vendored
2
configure
vendored
|
|
@ -2267,7 +2267,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
|
|||
CLIXON_VERSION_MAJOR="5"
|
||||
CLIXON_VERSION_MINOR="5"
|
||||
CLIXON_VERSION_PATCH="0"
|
||||
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}.PRE\""
|
||||
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\""
|
||||
|
||||
# Debug flag
|
||||
# Check whether --enable-debug was given.
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ AC_CONFIG_AUX_DIR(config-aux)
|
|||
CLIXON_VERSION_MAJOR="5"
|
||||
CLIXON_VERSION_MINOR="5"
|
||||
CLIXON_VERSION_PATCH="0"
|
||||
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}.PRE\""
|
||||
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\""
|
||||
|
||||
# Debug flag
|
||||
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[Build with debug symbols, default: no]),[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue