diff --git a/CHANGELOG.md b/CHANGELOG.md index 2229a78c..8ecaa987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,9 @@ Users may have to change how they access the system * Added 404 return without body if neither restconf, data or streams prefix match * Netconf: Usage of chunked framing" * To keep existing end-of-message encoding, set `CLICON_NETCONF_BASE_CAPABILITY` to `0` + * Added `clixon_netconf` command-line option `-0`and changed `-H` to `-1` + * `-0` means dont send hello, but fix netconf base version to 0 and use EOM framing + * `-1` means dont send hello, but fix netconf base version to 1 and use chunked framing * New `clixon-config@2022-03-21.yang` revision * Added option: * `CLICON_RESTCONF_API_ROOT` diff --git a/apps/netconf/netconf_main.c b/apps/netconf/netconf_main.c index 4132092d..ee83b258 100644 --- a/apps/netconf/netconf_main.c +++ b/apps/netconf/netconf_main.c @@ -70,7 +70,7 @@ #include "netconf_rpc.h" /* Command line options to be passed to getopt(3) */ -#define NETCONF_OPTS "hD:f:E:l:qHa:u:d:p:y:U:t:eo:" +#define NETCONF_OPTS "hD:f:E:l:q01ca:u:d:p:y:U:t:eo:" #define NETCONF_LOGFILE "/tmp/clixon_netconf.log" @@ -727,7 +727,8 @@ usage(clicon_handle h, "\t-E \tExtra configuration file directory\n" "\t-l (e|o|s|f) Log on std(e)rr, std(o)ut, (s)yslog(default), (f)ile\n" "\t-q\t\tServer does not send hello message on startup\n" - "\t-H \t\tServer does not expect hello message from client.\n" + "\t-0 \t\tSet netconf base capability to 0, server does not expect hello, force EOM framing\n" + "\t-1 \t\tSet netconf base capability to 1, server does not expect hello, force chunked framing\n" "\t-a UNIX|IPv4|IPv6 Internal backend socket family\n" "\t-u \tInternal socket domain path or IP addr (see -a)\n" "\t-d \tSpecify netconf plugin directory dir (default: %s)\n" @@ -866,7 +867,12 @@ main(int argc, case 'e': /* dont ignore packet errors */ ignore_packet_errors = 0; break; - case 'H': /* Hello messages are optional */ + case '0': /* Force EOM */ + clicon_option_int_set(h, "CLICON_NETCONF_BASE_CAPABILITY", 0); + clicon_option_bool_set(h, "CLICON_NETCONF_HELLO_OPTIONAL", 1); + break; + case '1': /* Hello messages are optional */ + clicon_option_int_set(h, "CLICON_NETCONF_BASE_CAPABILITY", 1); clicon_option_bool_set(h, "CLICON_NETCONF_HELLO_OPTIONAL", 1); break; case 'o':{ /* Configuration option */ diff --git a/test/lib.sh b/test/lib.sh index dbf58f1e..6bb6105f 100755 --- a/test/lib.sh +++ b/test/lib.sh @@ -442,7 +442,7 @@ function stop_backend(){ # Wait for restconf to stop sending 502 Bad Gateway function wait_backend(){ freq=$(chunked_framing "") - reply=$(echo "$freq" | $clixon_netconf -qHef $cfg) + reply=$(echo "$freq" | $clixon_netconf -q1ef $cfg) # freply=$(chunked_framing "") # chunked_equal "$reply" "$freply" let i=0;