From 081e6871b3416497a52e5d8b1643889c78853572 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Tue, 28 Dec 2021 19:21:52 +0100 Subject: [PATCH] * Renamed clixon-clispec.yang to clixon-autocli.yang * First version of clixon-autocli.yang semantics * Default rules for module exclusion, list-keywords, completion, treeref-state * Specialized rules for compress and exclusion of modules * See [autocli documentation](https://clixon-docs.readthedocs.io/en/latest/cli.html#autocli) * Obsoleted and moved autocli config options from clixon-config.yang to clixon-autocli.yang as follows: * `CLICON_CLI_GENMODEL`, use: `autocli/module-default=false` instead * Removed `clicon_cli_genmodel()` * `CLICON_CLI_GENMODEL_TYPE`, use `autocli/list-keyword-default` and compress rules instead) * Removed `clicon_cli_genmodel_type()` * `CLICON_CLI_GENMODEL_COMPLETION`, use `autocli/completion-default` instead * Removed `clicon_cli_genmodel_completion()` * `CLICON_CLI_AUTOCLI_EXCLUDE`, use `autocli/rule/operation=exclude` instead * `CLICON_CLI_MODEL_TREENAME`, use constant `AUTOCLI_TREENAME` instead * Removed `clicon_cli_model_treename()` * New YANG functions: yang_single_child_type, yang_find_namespace_by_prefix, yang_str2key * Changed return values of yang_find_prefix_by_namespace * Merged `cli_cli2xml()` into `cli2xml()` --- .gitignore | 2 + CHANGELOG.md | 13 +- apps/cli/Makefile.in | 3 +- apps/cli/cli_auto.c | 126 +----- apps/cli/cli_autocli.c | 462 ++++++++++++++++++++ apps/cli/cli_autocli.h | 59 +++ apps/cli/cli_common.c | 6 +- apps/cli/cli_generate.c | 360 +++++++-------- apps/cli/cli_generate.h | 6 +- apps/cli/cli_main.c | 29 +- apps/cli/cli_plugin.c | 23 +- apps/cli/cli_show.c | 142 +++++- apps/cli/clixon_cli_api.h | 21 +- example/main/clixon-example@2020-12-01.yang | 7 + example/main/example.xml.in | 17 +- lib/clixon/clixon_data.h | 2 +- lib/clixon/clixon_options.h | 29 -- lib/clixon/clixon_xml_map.h | 2 - lib/clixon/clixon_yang.h | 5 +- lib/src/clixon_data.c | 12 +- lib/src/clixon_options.c | 60 --- lib/src/clixon_string.c | 17 +- lib/src/clixon_xml_map.c | 150 +------ lib/src/clixon_yang.c | 177 +++++--- lib/src/clixon_yang_module.c | 2 + test/fuzz/cli/runfuzz.sh | 12 +- test/fuzz/netconf/runfuzz.sh | 3 - test/lib.sh | 29 ++ test/test_cli_apipath.sh | 6 +- test/test_cli_auto_extension.sh | 8 +- test/test_cli_auto_genmodel.sh | 205 ++++++--- test/test_cli_auto_spec.sh | 222 ++++++++++ test/test_cli_auto_sub.sh | 7 +- test/test_cli_auto_treeref.sh | 7 +- test/test_cli_multikey.sh | 6 +- test/test_cli_translate.sh | 4 +- test/test_openconfig.sh | 45 +- test/test_openconfig_interfaces.sh | 5 +- test/test_openconfig_network_instance.sh | 45 +- test/test_openconfig_system.sh | 5 +- test/test_yang_when.sh | 7 +- yang/clixon/Makefile.in | 2 +- yang/clixon/clixon-autocli@2021-12-05.yang | 202 +++++++++ yang/clixon/clixon-clispec@2021-12-05.yang | 115 ----- yang/clixon/clixon-config@2021-12-05.yang | 37 +- 45 files changed, 1804 insertions(+), 900 deletions(-) create mode 100644 apps/cli/cli_autocli.c create mode 100644 apps/cli/cli_autocli.h create mode 100755 test/test_cli_auto_spec.sh create mode 100644 yang/clixon/clixon-autocli@2021-12-05.yang delete mode 100644 yang/clixon/clixon-clispec@2021-12-05.yang diff --git a/.gitignore b/.gitignore index 85db1c84..747d78b7 100644 --- a/.gitignore +++ b/.gitignore @@ -74,4 +74,6 @@ test/vagrant/site.mk test/cicd/site.mk doc/html +test/fuzz/*/conf.xml + .idea/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c0e67d1..a69c967c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,10 @@ Planned: January, 2022 ### 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, treeref-state + * 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: