diff --git a/CHANGELOG.md b/CHANGELOG.md index 3386258e..c4e9000f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 `` is not backward compatible diff --git a/lib/src/clixon_options.c b/lib/src/clixon_options.c index 17375a43..d8f259dc 100644 --- a/lib/src/clixon_options.c +++ b/lib/src/clixon_options.c @@ -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,11 +548,10 @@ clicon_options_main(clicon_handle h) goto done; #endif /* Parse clixon yang spec */ - if (yang_spec_parse_module(h, "clixon-config", 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; - /* Load restconf yang. Note this is also a part of clixon-config */ - if (yang_spec_parse_module(h, "clixon-restconf", NULL, yspec)< 0) - goto done; clicon_conf_xml_set(h, NULL); if (xconfig){ xml_free(xconfig); diff --git a/test/config.sh.in b/test/config.sh.in index a08e2f5d..3523b0d9 100755 --- a/test/config.sh.in +++ b/test/config.sh.in @@ -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" diff --git a/yang/clixon/Makefile.in b/yang/clixon/Makefile.in index 639ce7fa..7102d97a 100644 --- a/yang/clixon/Makefile.in +++ b/yang/clixon/Makefile.in @@ -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 diff --git a/yang/clixon/clixon-config@2022-12-01.yang b/yang/clixon/clixon-config@2023-05-01.yang similarity index 96% rename from yang/clixon/clixon-config@2022-12-01.yang rename to yang/clixon/clixon-config@2023-05-01.yang index 38e8073f..e0326828 100644 --- a/yang/clixon/clixon-config@2022-12-01.yang +++ b/yang/clixon/clixon-config@2023-05-01.yang @@ -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 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 "/";