Skip to content

Commit d086246

Browse files
Robin Jarryguedou
authored andcommitted
layers/l2: add QinQ 802.1ad support (#241)
Signed-off-by: Robin Jarry <[email protected]>
1 parent 2c28f06 commit d086246

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scapy/layers/l2.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ def i2m(self, pkt, x):
138138

139139
### Layers
140140

141+
ETHER_TYPES['802_AD'] = 0x88a8
141142

142143
class Ether(Packet):
143144
name = "Ethernet"
@@ -592,23 +593,31 @@ def post_build(self, p, pay):
592593
return p
593594

594595

596+
class Dot1AD(Dot1Q):
597+
name = '802_1AD'
595598

596599

597600
bind_layers( Dot3, LLC, )
598601
bind_layers( Ether, LLC, type=122)
599602
bind_layers( Ether, LLC, type=34928)
600603
bind_layers( Ether, Dot1Q, type=33024)
604+
bind_layers( Ether, Dot1AD, type=0x88a8)
605+
bind_layers( Dot1AD, Dot1AD, type=0x88a8)
606+
bind_layers( Dot1AD, Dot1Q, type=0x8100)
607+
bind_layers( Dot1Q, Dot1AD, type=0x88a8)
601608
bind_layers( Ether, Ether, type=1)
602609
bind_layers( Ether, ARP, type=2054)
603610
bind_layers( Ether, EAPOL, type=34958)
604611
bind_layers( Ether, EAPOL, dst='01:80:c2:00:00:03', type=34958)
605612
bind_layers( CookedLinux, LLC, proto=122)
606613
bind_layers( CookedLinux, Dot1Q, proto=33024)
614+
bind_layers( CookedLinux, Dot1AD, type=0x88a8)
607615
bind_layers( CookedLinux, Ether, proto=1)
608616
bind_layers( CookedLinux, ARP, proto=2054)
609617
bind_layers( CookedLinux, EAPOL, proto=34958)
610618
bind_layers( GRE, LLC, proto=122)
611619
bind_layers( GRE, Dot1Q, proto=33024)
620+
bind_layers( GRE, Dot1AD, type=0x88a8)
612621
bind_layers( GRE, Ether, proto=1)
613622
bind_layers( GRE, ARP, proto=2054)
614623
bind_layers( GRE, EAPOL, proto=34958)
@@ -621,6 +630,7 @@ def post_build(self, p, pay):
621630
bind_layers( LLC, STP, dsap=66, ssap=66, ctrl=3)
622631
bind_layers( LLC, SNAP, dsap=170, ssap=170, ctrl=3)
623632
bind_layers( SNAP, Dot1Q, code=33024)
633+
bind_layers( SNAP, Dot1AD, type=0x88a8)
624634
bind_layers( SNAP, Ether, code=1)
625635
bind_layers( SNAP, ARP, code=2054)
626636
bind_layers( SNAP, EAPOL, code=34958)

0 commit comments

Comments
 (0)