aboutsummaryrefslogtreecommitdiffstats
path: root/test/patches/scapy-2.4/geneve.patch
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-02-25 12:27:18 -0800
committerDave Wallace <dwallacelf@gmail.com>2018-03-19 13:09:45 +0000
commit2bc940272ec75d1094326eafb4a3fa2c614e3a7b (patch)
treed813084708e143fc9eb6edbca408ba93beadaf41 /test/patches/scapy-2.4/geneve.patch
parentf38bef46a3511249f352d18072f97a49f2c5b06c (diff)
Scapy upgrade to 2.4.0.rc5
- many of the patches fd.io applies in test/patches/2.3.3 are now upstreamed in 2.4 - 2.4 adds support for IGMPv3 which is my main motivation for the upgrade Change-Id: If2c0a524e3cba320b4a5d8cd07817c6ea2bf0c5a Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'test/patches/scapy-2.4/geneve.patch')
-rw-r--r--test/patches/scapy-2.4/geneve.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/test/patches/scapy-2.4/geneve.patch b/test/patches/scapy-2.4/geneve.patch
new file mode 100644
index 00000000000..92752f1196e
--- /dev/null
+++ b/test/patches/scapy-2.4/geneve.patch
@@ -0,0 +1,56 @@
+diff --git a/scapy/layers/geneve.py b/scapy/layers/geneve.py
+new file mode 100644
+index 0000000..e2ca888
+--- /dev/null
++++ b/scapy/layers/geneve.py
+@@ -0,0 +1,50 @@
++#! /usr/bin/env python
++# (GENEVE):
++# A Framework for Overlaying Virtualized Layer 2 Networks over Layer 3 Networks
++
++from scapy.packet import Packet, bind_layers
++from scapy.layers.l2 import Ether
++from scapy.layers.inet import IP, UDP
++from scapy.layers.inet6 import IPv6
++from scapy.fields import FlagsField, XByteField, ThreeBytesField, \
++ ConditionalField, ShortField, ByteEnumField, X3BytesField
++
++#
++# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
++# |Ver| Opt Len |O|C| Rsvd. | Protocol Type |
++# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
++# | Virtual Network Identifier (VNI) | Reserved |
++# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
++# | Variable Length Options |
++# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
++#
++
++class GENEVE(Packet):
++ name = "GENEVE"
++
++ fields_desc = [
++ # INIT = ver + optlen + o + c + rsvd (all zeros)
++ ShortField("init", 0x0),
++ # PROTOCOL is a 2-bytes field
++ ShortField("protocol", 0x6558),
++ ThreeBytesField("vni", 0),
++ XByteField("reserved2", 0),
++ ]
++
++ def mysummary(self):
++ return self.sprintf("GENEVE (vni=%GENEVE.vni%)")
++
++bind_layers(UDP, GENEVE, dport=6081) # RFC standard port
++bind_layers(UDP, GENEVE, dport=6081) # New IANA assigned port for use with NSH
++bind_layers(UDP, GENEVE, dport=8472) # Linux implementation port
++# By default, set both ports to the RFC standard
++bind_layers(UDP, GENEVE, sport=6081, dport=6081)
++
++bind_layers(GENEVE, Ether)
++bind_layers(GENEVE, IP, NextProtocol=1)
++bind_layers(GENEVE, IPv6, NextProtocol=2)
++bind_layers(GENEVE, Ether, flags=4, NextProtocol=0)
++bind_layers(GENEVE, IP, flags=4, NextProtocol=1)
++bind_layers(GENEVE, IPv6, flags=4, NextProtocol=2)
++bind_layers(GENEVE, Ether, flags=4, NextProtocol=3)
++