* 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()`
This commit is contained in:
parent
dec05e2cae
commit
081e6871b3
45 changed files with 1804 additions and 900 deletions
|
|
@ -96,7 +96,7 @@ cxobj *clicon_conf_xml(clicon_handle h);
|
|||
int clicon_conf_xml_set(clicon_handle h, cxobj *x);
|
||||
|
||||
cxobj *clicon_conf_restconf(clicon_handle h);
|
||||
cxobj *clicon_conf_clispec(clicon_handle h);
|
||||
cxobj *clicon_conf_autocli(clicon_handle h);
|
||||
|
||||
db_elmnt *clicon_db_elmnt_get(clicon_handle h, const char *db);
|
||||
int clicon_db_elmnt_set(clicon_handle h, const char *db, db_elmnt *xc);
|
||||
|
|
|
|||
|
|
@ -57,29 +57,6 @@
|
|||
/*
|
||||
* Types
|
||||
*/
|
||||
/*! Controls how keywords a generated in CLI syntax / prints from object model
|
||||
* Example YANG:
|
||||
* container c{
|
||||
* list a {
|
||||
* key x;
|
||||
* leaf x;
|
||||
* leaf y;
|
||||
* }
|
||||
* }
|
||||
* NONE: c a <x> <y>;
|
||||
* VARS: c a <x> y <y>;
|
||||
* ALL: c a x <x> y <y>;
|
||||
* HIDE: a x <x> y <y>;
|
||||
*/
|
||||
enum genmodel_type{
|
||||
GT_ERR =-1, /* Error */
|
||||
GT_NONE=0, /* No extra keywords */
|
||||
GT_VARS, /* Keywords on non-key variables */
|
||||
GT_ALL, /* Keywords on all variables */
|
||||
GT_HIDE, /* Keywords on all variables and hide container around lists */
|
||||
GT_OC_COMPRESS, /* OpenConfig */
|
||||
};
|
||||
typedef enum genmodel_type genmodel_type;
|
||||
|
||||
/*! See clixon-config.yang type startup_mode */
|
||||
enum startup_mode_t{
|
||||
|
|
@ -189,9 +166,6 @@ static inline char *clicon_cli_mode(clicon_handle h){
|
|||
static inline int clicon_cli_tab_mode(clicon_handle h){
|
||||
return clicon_option_int(h, "CLICON_CLI_TAB_MODE");
|
||||
}
|
||||
static inline char *clicon_cli_model_treename(clicon_handle h){
|
||||
return clicon_option_str(h, "CLICON_CLI_MODEL_TREENAME");
|
||||
}
|
||||
static inline char *clicon_sock_str(clicon_handle h){
|
||||
return clicon_option_str(h, "CLICON_SOCK");
|
||||
}
|
||||
|
|
@ -212,9 +186,6 @@ static inline char *clicon_nacm_recovery_user(clicon_handle h){
|
|||
}
|
||||
|
||||
/*-- Specific option access functions for YANG options w type conversion--*/
|
||||
int clicon_cli_genmodel(clicon_handle h);
|
||||
int clicon_cli_genmodel_completion(clicon_handle h);
|
||||
enum genmodel_type clicon_cli_genmodel_type(clicon_handle h);
|
||||
int clicon_cli_varonly(clicon_handle h);
|
||||
int clicon_sock_family(clicon_handle h);
|
||||
int clicon_sock_port(clicon_handle h);
|
||||
|
|
|
|||
|
|
@ -52,8 +52,6 @@ typedef enum yang_class yang_class;
|
|||
int isxmlns(cxobj *x);
|
||||
int xml2txt_cb(FILE *f, cxobj *x, clicon_output_cb *fn);
|
||||
int xml2txt(FILE *f, cxobj *x, int level);
|
||||
int xml2cli_cb(FILE *f, cxobj *x, char *prepend, enum genmodel_type gt, clicon_output_cb *fn);
|
||||
int xml2cli(FILE *f, cxobj *x, char *prepend, enum genmodel_type gt);
|
||||
int xmlns_assign(cxobj *x);
|
||||
int xml2cvec(cxobj *xt, yang_stmt *ys, cvec **cvv0);
|
||||
int cvec2xml_1(cvec *cvv, char *toptag, cxobj *xp, cxobj **xt0);
|
||||
|
|
|
|||
|
|
@ -229,7 +229,6 @@ int yang_stats(yang_stmt *y, uint64_t *nrp, size_t *szp);
|
|||
yang_stmt *yspec_new(void);
|
||||
yang_stmt *ys_new(enum rfc_6020 keyw);
|
||||
yang_stmt *ys_prune(yang_stmt *yp, int i);
|
||||
|
||||
int ys_free1(yang_stmt *ys, int self);
|
||||
int ys_free(yang_stmt *ys);
|
||||
int ys_cp(yang_stmt *nw, yang_stmt *old);
|
||||
|
|
@ -238,6 +237,7 @@ int yn_insert(yang_stmt *ys_parent, yang_stmt *ys_child);
|
|||
int yn_insert1(yang_stmt *ys_parent, yang_stmt *ys_child);
|
||||
yang_stmt *yn_each(yang_stmt *yn, yang_stmt *ys);
|
||||
char *yang_key2str(int keyword);
|
||||
int yang_str2key(char *str);
|
||||
int ys_module_by_xml(yang_stmt *ysp, struct xml *xt, yang_stmt **ymodp);
|
||||
yang_stmt *ys_module(yang_stmt *ys);
|
||||
int ys_real_module(yang_stmt *ys, yang_stmt **ymod);
|
||||
|
|
@ -249,6 +249,7 @@ yang_stmt *yang_find_schemanode(yang_stmt *yn, char *argument);
|
|||
char *yang_find_myprefix(yang_stmt *ys);
|
||||
char *yang_find_mynamespace(yang_stmt *ys);
|
||||
int yang_find_prefix_by_namespace(yang_stmt *ys, char *ns, char **prefix);
|
||||
int yang_find_namespace_by_prefix(yang_stmt *ys, char *prefix, char **ns);
|
||||
yang_stmt *yang_myroot(yang_stmt *ys);
|
||||
yang_stmt *yang_choice(yang_stmt *y);
|
||||
int yang_order(yang_stmt *y);
|
||||
|
|
@ -270,7 +271,6 @@ int yang_config(yang_stmt *ys);
|
|||
int yang_config_ancestor(yang_stmt *ys);
|
||||
int yang_features(clicon_handle h, yang_stmt *yt);
|
||||
cvec *yang_arg2cvec(yang_stmt *ys, char *delimi);
|
||||
int yang_container_cli_hide(yang_stmt *ys, int gt);
|
||||
int yang_key_match(yang_stmt *yn, char *name, int *lastkey);
|
||||
int yang_type_cache_regexp_set(yang_stmt *ytype, int rxmode, cvec *regexps);
|
||||
int yang_type_cache_get(yang_stmt *ytype, yang_stmt **resolved, int *options,
|
||||
|
|
@ -281,5 +281,6 @@ yang_stmt *yang_anydata_add(yang_stmt *yp, char *name);
|
|||
int yang_extension_value(yang_stmt *ys, char *name, char *ns, int *exist, char **value);
|
||||
int yang_sort_subelements(yang_stmt *ys);
|
||||
int yang_init(clicon_handle h);
|
||||
int yang_single_child_type(yang_stmt *ys, enum rfc_6020 subkeyw);
|
||||
|
||||
#endif /* _CLIXON_YANG_H_ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue