* Implementation of "chunked framing" according to RFC6242 for Netconf 1.1.

* First hello is 1.0 EOM framing, then successing rpc is chunked framing
  * See
    * [Netconf framing](https://github.com/clicon/clixon/issues/50), and
    * [Clixon does not switch to chunked framing after NETCONF 1.1 is negotiated](https://github.com/clicon/clixon/issues/314)
* C:
  * Moved netconf framing code from netconf application to clixon lib
* Test:
  * New expecteof_netconf and adjusted other expect scripts to handle NETCONF 1.1 framing
This commit is contained in:
Olof hagsand 2022-03-27 17:39:24 +02:00
parent bf983d7ca4
commit c038c9a27f
95 changed files with 1758 additions and 1208 deletions

View file

@ -226,6 +226,7 @@ clixon_client_hello(int sock)
cprintf(msg, "<hello xmlns=\"%s\">", NETCONF_BASE_NAMESPACE);
cprintf(msg, "<capabilities><capability>%s</capability></capabilities>", NETCONF_BASE_CAPABILITY_1_1);
cprintf(msg, "</hello>");
cprintf(msg, "]]>]]>");
if (clicon_msg_send1(sock, msg) < 0)
goto done;
retval = 0;
@ -444,6 +445,8 @@ clixon_client_get_xdata(int sock,
cprintf(msg, "/>");
}
cprintf(msg, "</get-config></rpc>");
if (netconf_output_encap(NETCONF_SSH_CHUNKED, msg) < 0)
goto done;
if (clicon_rpc1(sock, msg, msgret, &eof) < 0)
goto done;
if (eof){