Apologies, missed to diff the json definitions. Attached.
On 04/03/14 15:19, Anton Ivanov wrote: > Attached is a revised version. > > * I am still keeping the sendmsg instead of iov_send because I > have not had the time to review udp.c in the kernel and do the > relevant regression testing to see if they connect() still breaks > bind() on multihomed hosts as it did in 2.6. We can revisit that at a > later date, without doing the proper investigation I am not > comfortable trying this. > > * I have killed completely parse6 and replaced that by a common > getaddrinfo() with a selectable address family based on the boolean > flags. This also allows to force a specific v4 or v6 address choice > for dst. > > * addresses now are specified separately from ports and ports are > deliberately strings so you can specify them as a protocol. > > * mode bitmask is gone it is all booleans now - both for option > invocation and internally in the code. > > * I have added the extra offset back in so it is feature by > feature compatible with linux kernel implementation. > > * All mallocs are now to exact size and > > * Indentation, style, debug, etc are all as requested now. > > * l2tpv3.h has become surplus to requirements and is gone now. > > * it now has proper cleanup. > > * I have tested it for a few setups (mostly v4) and it works as > advertised. I need to rewrite my tests scripts for the new options > names to give it a full test. I would not expect that to show any > problems though - core send/receive logic is unchanged from the > original version. > > * I have not yet addressed the page size and page alignment of > buffers items - leaving that open for an RFC on how to get the max > performance there and how to make it expandable lately so one can > re-configure it for large MTU/jumbo frames. > > Example magic incantation to invoke it with the new options: > > #!/bin/sh > > kvm -hda kvm.img -m 1024 \ > -net nic,vlan=0,model=virtio,macaddr=0a:98:fc:96:83:01 \ > -net > l2tpv3,vlan=0,udp,src=192.168.63.1,srcport=1700,dst=192.168.63.1,dstport=1701,cookie64,txcookie=0x0123456789abcdef,rxcookie=0xfedcba9876543210,rxsession=0xffffffff,txsession=0xffffffff,counter > > A.
diff --git a/qapi-schema.json b/qapi-schema.json index 83fa485..56eac6d 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -2940,6 +2940,62 @@ '*localaddr': 'str', '*udp': 'str' } } +# @NetdevL2TPv3Options +# +# Connect the VLAN to Ethernet over L2TPv3 Static tunnel +# +# @ipv6: #bool, use ipv6 +# +# @udp: #bool use the udp version of the L2TPv3 encapsulation +# +# @cookie64 : #use 64 bit cookies +# +# @offset : #extra offset +# +# @counter : #have sequence counter +# +# @fd: #optional file descriptor of an already opened socket +# +# @src: #source address +# +# @srcport: #source port - mandatory for udp, optional for ip +# +# @dst: #destination address +# +# @dstport: #destination port - mandatory for udp, optional for ip +# +# @txcookie: #optional 32 or 64 bit tx cookie for the tunnel +# +# @rxcookie: #optional 32 or 64 bit rx cookie for the tunnel +# +# @txsession: #tx 32 bit session +# +# @rxsession: #rx 32 bit session - if unset value for txsession is used +# +# +# Since 1.2 +## +## +{ 'type': 'NetdevL2TPv3Options', + 'data': { + '*fd': 'str', + 'src': 'str', + 'dst': 'str', + '*srcport': 'str', + '*dstport': 'str', + '*ipv6': 'bool', + '*udp': 'bool', + '*cookie64': 'bool', + '*counter': 'bool', + '*txcookie': 'uint64', + '*rxcookie': 'uint64', + 'txsession': 'uint32', + '*rxsession': 'uint32', + '*offset': 'uint32' + +} } + +## ## # @NetdevVdeOptions # @@ -3014,13 +3070,16 @@ # A discriminated record of network device traits. # # Since 1.2 -## +# +# Added in 2.0 - l2tpv3 +# { 'union': 'NetClientOptions', 'data': { 'none': 'NetdevNoneOptions', 'nic': 'NetLegacyNicOptions', 'user': 'NetdevUserOptions', 'tap': 'NetdevTapOptions', + 'l2tpv3': 'NetdevL2TPv3Options', 'socket': 'NetdevSocketOptions', 'vde': 'NetdevVdeOptions', 'dump': 'NetdevDumpOptions',