Added options: CLICON_CONFIG_EXTEND
This commit is contained in:
Olof hagsand 2023-06-01 17:43:15 +02:00
parent b3a7e39d26
commit bd6a67f1d9
5 changed files with 53 additions and 7 deletions

View file

@ -45,6 +45,8 @@ Expected: July 2023
### API changes on existing protocol/config features
* New `clixon-config@2023-05-01.yang` revision
* Added options: `CLICON_CONFIG_EXTEND`
* New `clixon-lib@2023-05-01.yang` revision
* Restructured and extended stats rpc to schema mountpoints
* rpc `<stats>` is not backward compatible

View file

@ -490,6 +490,7 @@ clicon_options_main(clicon_handle h)
cxobj *xconfig = NULL;
yang_stmt *yspec = NULL;
char *extraconfdir = NULL;
char *yangspec = "clixon-config";
/* Create configure yang-spec */
if ((yspec = yspec_new()) == NULL)
@ -547,10 +548,9 @@ clicon_options_main(clicon_handle h)
goto done;
#endif
/* Parse clixon yang spec */
if (yang_spec_parse_module(h, "clixon-config", NULL, yspec) < 0)
goto done;
/* Load restconf yang. Note this is also a part of clixon-config */
if (yang_spec_parse_module(h, "clixon-restconf", NULL, yspec)< 0)
if (clicon_option_str(h, "CLICON_CONFIG_EXTEND") != NULL)
yangspec = clicon_option_str(h, "CLICON_CONFIG_EXTEND");
if (yang_spec_parse_module(h, yangspec, NULL, yspec) < 0)
goto done;
clicon_conf_xml_set(h, NULL);
if (xconfig){

View file

@ -74,7 +74,7 @@ DATASTORE_TOP="config"
# clixon yang revisions occuring in tests (see eg yang/clixon/Makefile.in)
CLIXON_AUTOCLI_REV="2022-02-11"
CLIXON_LIB_REV="2023-05-01"
CLIXON_CONFIG_REV="2023-03-01"
CLIXON_CONFIG_REV="2023-05-01"
CLIXON_RESTCONF_REV="2022-08-01"
CLIXON_EXAMPLE_REV="2022-11-01"

View file

@ -42,7 +42,7 @@ datarootdir = @datarootdir@
YANG_INSTALLDIR = @YANG_INSTALLDIR@
# Note: mirror these to test/config.sh.in
YANGSPECS = clixon-config@2023-03-01.yang # 6.2
YANGSPECS = clixon-config@2023-05-01.yang # 6.3
YANGSPECS += clixon-lib@2023-05-01.yang # 6.3
YANGSPECS += clixon-rfc5277@2008-07-01.yang
YANGSPECS += clixon-xml-changelog@2019-03-21.yang

View file

@ -46,6 +46,20 @@ module clixon-config {
***** END LICENSE BLOCK *****";
revision 2023-05-01 {
description
"Added options:
CLICON_CONFIG_EXTEND
Override this yang with an application-specific extended config file
Released in Clixon 6.3";
}
revision 2023-03-01 {
description
"Added options:
CLICON_RESTCONF_NOALPN_DEFAULT
Extended datastore-format with CLI and text
Released in Clixon 6.2";
}
revision 2022-12-01 {
description
"Added options:
@ -269,7 +283,7 @@ module clixon-config {
}
typedef datastore_format{
description
"Datastore format.";
"Datastore format (only xml and json implemented in actual data.";
type enumeration{
enum xml{
description
@ -280,6 +294,12 @@ module clixon-config {
enum json{
description "Save and load xmldb as JSON";
}
enum text{
description "'Curly' C-like text format";
}
enum cli{
description "CLI format";
}
}
}
typedef datastore_cache{
@ -448,6 +468,15 @@ module clixon-config {
You can override file setting with -E <dir> command-line option.
Note that due to bootstraping this value is only meaningful in the main config file";
}
leaf CLICON_CONFIG_EXTEND {
type string;
description
"If specified load an application-specific configuration YANG that overrides
this config.
Normally, that YANG imports clixon-config.
This field is a 'bootstrap' field.
";
}
leaf CLICON_YANG_MAIN_FILE {
type string;
description
@ -633,6 +662,21 @@ module clixon-config {
Note this also disables plain http/2 in prior-knowledge, that is, in http/2-only mode.
HTTP/2 in https(TLS) is unaffected";
}
leaf CLICON_NOALPN_DEFAULT {
type string;
description
"By default Clixon Restconf over TLS/HTTPS uses ALPN for protocol selection.
This option controls the behavior if a client does NOT use ALPN for TLS.
AND both http/1 and http/2 is configured in Clixon.
If the value is not set (or other value), Clixon closes the socket(reset)
If the value is 'http/1.1' then HTTP/1.1 is selected
If the value is 'http/2' then HTTP/2 is selected
Note that if Clixon is configured for only HTTP/1 (--disable-nghttp2),
then HTTP/1 is selected if the client does not use ALPN.
Likewise, if Clixon is configured for only HTTP/2 (--disable-http1),
then HTTP/2 is selected if the client does not use ALPN.
This option does not apply for plain (non-TLS) HTTP";
}
leaf CLICON_HTTP_DATA_PATH {
if-feature "clrc:http-data";
default "/";