summaryrefslogtreecommitdiffstats
path: root/test/patches
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2018-02-27 16:35:03 -0500
committerNeale Ranns <nranns@cisco.com>2018-03-01 13:09:57 +0000
commit2bf8b8154d0e1707fbf8502eb8e85fdda885a8e5 (patch)
tree24804592e3a4a738dfe306b468547ad9377c6541 /test/patches
parent3c6a976325f32f880b7e53f50ebe86fa0e8476c9 (diff)
Fix ERSPAN encap to set EN bits in the header and add test case
For ERSPAN encap, both bits in the EN field of the header should be set to indicate any VLAN tag in the original Ethernet frame is preserved. Added SPAN L2 test case where the mirrored packet output is a GRE ERSPAN tunnel. Change-Id: Ie7a40992a9278469c24aa6fa9e122b4505797d10 Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'test/patches')
-rw-r--r--test/patches/scapy-2.3.3/gre-layers.patch30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/patches/scapy-2.3.3/gre-layers.patch b/test/patches/scapy-2.3.3/gre-layers.patch
index 605a705b0f7..6090050fc5f 100644
--- a/test/patches/scapy-2.3.3/gre-layers.patch
+++ b/test/patches/scapy-2.3.3/gre-layers.patch
@@ -14,12 +14,40 @@ diff --git a/scapy/layers/l2.py b/scapy/layers/l2.py
index 4f491d2..661a5da 100644
--- a/scapy/layers/l2.py
+++ b/scapy/layers/l2.py
-@@ -628,7 +628,7 @@ bind_layers( CookedLinux, EAPOL, proto=34958)
+@@ -570,6 +570,20 @@
+ return getmacbyip(l3.pdst)
+ conf.neighbor.register_l3(Ether, ARP, l2_register_l3_arp)
+
++
++class ERSPAN(Packet):
++ name = "ERSPAN"
++ fields_desc = [ BitField("ver",0,4),
++ BitField("vlan",0,12),
++ BitField("cos",0,3),
++ BitField("en",0,2),
++ BitField("t",0,1),
++ BitField("session_id",0,10),
++ BitField("reserved",0,12),
++ BitField("index",0,20),
++ ]
++
++
+ class GRErouting(Packet):
+ name = "GRE routing informations"
+ fields_desc = [ ShortField("address_family",0),
+@@ -628,12 +642,14 @@ bind_layers( CookedLinux, EAPOL, proto=34958)
bind_layers( GRE, LLC, proto=122)
bind_layers( GRE, Dot1Q, proto=33024)
bind_layers( GRE, Dot1AD, type=0x88a8)
-bind_layers( GRE, Ether, proto=1)
+bind_layers( GRE, Ether, proto=0x6558)
++bind_layers( GRE, ERSPAN, proto=0x88be, seqnum_present=1)
bind_layers( GRE, ARP, proto=2054)
bind_layers( GRE, EAPOL, proto=34958)
bind_layers( GRE, GRErouting, { "routing_present" : 1 } )
+ bind_layers( GRErouting, conf.raw_layer,{ "address_family" : 0, "SRE_len" : 0 })
+ bind_layers( GRErouting, GRErouting, { } )
++bind_layers( ERSPAN, Ether)
+ bind_layers( EAPOL, EAP, type=0)
+ bind_layers(EAP, EAP_TLS, type=13)
+ bind_layers(EAP, EAP_FAST, type=43)