* 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

@ -138,21 +138,24 @@ if [ "$ret" != "hello world;" ]; then
fi
new "netconf edit-config"
ret=$(echo "$DEFAULTHELLO<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><hello xmlns=\"urn:example:hello\"><world/></hello></config></edit-config></rpc>]]>]]>" | $clixon_netconf -qf $cfg)
rpc=$(chunked_framing "<rpc $DEFAULTNS><edit-config><target><candidate/></target><config><hello xmlns=\"urn:example:hello\"><world/></hello></config></edit-config></rpc>")
ret=$(echo "$DEFAULTHELLO$rpc" | $clixon_netconf -qf $cfg)
if [ $? -ne 0 ]; then
err 0 $r
fi
if [ "$ret" != "<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>" ]; then
err "$ret" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>"
reply=$(chunked_framing "<rpc-reply $DEFAULTNS><ok/></rpc-reply>")
if [ "$ret" != "$reply" ]; then
err "$ret" "$reply"
fi
new "netconf commit"
ret=$(echo "$DEFAULTHELLO<rpc $DEFAULTNS><commit/></rpc>]]>]]>" | $clixon_netconf -qf $cfg)
rpc=$(chunked_framing "<rpc $DEFAULTNS><commit/></rpc>")
ret=$(echo "$DEFAULTHELLO$rpc" | $clixon_netconf -qf $cfg)
if [ $? -ne 0 ]; then
err 0 $r
fi
if [ "$ret" != "<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>" ]; then
err "$ret" "<rpc-reply $DEFAULTNS><ok/></rpc-reply>]]>]]>"
if [ "$ret" != "$reply" ]; then
err "$ret" "$reply"
fi
new "restconf GET"