Refactoring for better performance of large auto-cli specs

* Fixed: [very slow execution of load_set_file #288](https://github.com/clicon/clixon/issues/288)
* New `clixon-lib@2021-11-11.yang` revision
  * Modified option: RPC stats extended with YANG stats
* Modified `clixon-config@2021-11-11.yang` revision
  * Added option:
    * CLICON_PLUGIN_CALLBACK_CHECK
    * Enable to make plugin context check before and after all callbacks.
* Added statistics for YANG: number of objects and memory used
* Use the treeref no-copy option of CLIgen to reduce memory
* Refactored cli-generation/autocli-start code
* Refactored cligen glue functions to use cligen_eval directly (remove clicon_eval,clixon_cligen_eval)
This commit is contained in:
Olof hagsand 2021-11-25 12:04:05 +01:00
parent b91ce762d5
commit 5388aace12
29 changed files with 760 additions and 451 deletions

View file

@ -45,7 +45,10 @@
/* clicon generic callback pointer */
typedef void (clicon_callback_t)(clicon_handle h);
/* List of syntax modes */
/* List of syntax modes
* XXX: syntax modes seem not needed, could be replaced by existing (new) cligen structures, such
* as pt_head and others. But code is arcane and difficult to modify.
*/
typedef struct {
qelem_t csm_qelem; /* List header */
char *csm_name; /* Syntax mode name */
@ -54,7 +57,8 @@ typedef struct {
parse_tree *csm_pt; /* CLIgen parse tree */
} cli_syntaxmode_t;
/* Plugin group object. Just a single object, not list. part of cli_handle */
/* Plugin group object. Just a single object, not list. part of cli_handle
*/
typedef struct {
int stx_nmodes; /* Number of syntax modes */
cli_syntaxmode_t *stx_active_mode; /* Current active syntax mode */
@ -64,8 +68,6 @@ typedef struct {
void *clixon_str2fn(char *name, void *handle, char **error);
int clicon_eval(clicon_handle h, char *cmd, cg_obj *match_obj, cvec *vr);
int clicon_parse(clicon_handle h, char *cmd, char **mode, cligen_result *result, int *evalres);
int clicon_cliread(clicon_handle h, char **stringp);