* 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
This commit is contained in:
Olof hagsand 2019-01-10 20:52:19 +01:00
parent c7e847cd24
commit 207858e20d
26 changed files with 635 additions and 256 deletions

View file

@ -80,6 +80,10 @@ enum startup_mode_t{
/* Print registry on file. For debugging. */
void clicon_option_dump(clicon_handle h, int dblevel);
/* Add a clicon options overriding file setting */
int clicon_option_add(clicon_handle h, char *name, char *value);
/* Initialize options: set defaults, read config-file, etc */
int clicon_options_main(clicon_handle h, yang_spec *yspec);
@ -174,10 +178,8 @@ int clicon_dbspec_yang_set(clicon_handle h, struct yang_spec *ys);
cxobj * clicon_nacm_ext(clicon_handle h);
int clicon_nacm_ext_set(clicon_handle h, cxobj *xn);
#if 1 /* Temporary function until "Top-level Yang symbol cannot be called "config"" is fixed */
yang_spec * clicon_config_yang(clicon_handle h);
int clicon_config_yang_set(clicon_handle h, struct yang_spec *ys);
#endif
cxobj *clicon_conf_xml(clicon_handle h);
int clicon_conf_xml_set(clicon_handle h, cxobj *x);

View file

@ -212,7 +212,6 @@ struct yang_stmt{
yang_type_cache *ys_typecache; /* If ys_keyword==Y_TYPE, cache all typedef data except unions */
};
/*! top-level yang parse-tree */
struct yang_spec{
int yp_len; /* Number of children */
@ -269,9 +268,6 @@ int yang_print(FILE *f, yang_node *yn);
int yang_print_cbuf(cbuf *cb, yang_node *yn, int marginal);
int ys_populate(yang_stmt *ys, void *arg);
yang_stmt *yang_parse_file(int fd, const char *name, yang_spec *ysp);
int yang_parse(clicon_handle h, const char *filename,
const char *module,
const char *revision, yang_spec *ysp);
int yang_apply(yang_node *yn, enum rfc_6020 key, yang_applyfn_t fn,
void *arg);
int yang_abs_schema_nodeid(yang_spec *yspec, yang_stmt *ys,
@ -283,8 +279,9 @@ cg_var *ys_parse(yang_stmt *ys, enum cv_type cvtype);
int ys_parse_sub(yang_stmt *ys, char *extra);
int yang_mandatory(yang_stmt *ys);
int yang_config(yang_stmt *ys);
int yang_spec_parse_module(clicon_handle h, char *module, char *revision, yang_spec *yspec);
int yang_spec_parse_file(clicon_handle h, char *filename, yang_spec *yspec);
int yang_spec_parse_module(clicon_handle h, const char *module,
const char *revision, yang_spec *yspec);
int yang_spec_parse_file(clicon_handle h, const char *filename, yang_spec *yspec);
int yang_spec_load_dir(clicon_handle h, char *dir, yang_spec *yspec);
cvec *yang_arg2cvec(yang_stmt *ys, char *delimi);
int yang_key_match(yang_node *yn, char *name);

View file

@ -71,7 +71,7 @@ int clicon_type2cv(char *type, char *rtype, enum cv_type *cvtype);
int yang_type_get(yang_stmt *ys, char **otype, yang_stmt **restype,
int *options, cvec **cvv, char **pattern,
uint8_t *fraction_digits);
int yang_type_resolve(yang_stmt *ys, yang_stmt *ytype,
int yang_type_resolve(yang_stmt *yorig, yang_stmt *ys, yang_stmt *ytype,
yang_stmt **restype, int *options,
cvec **cvv, char **pattern, uint8_t *fraction);