From 246c8bdfe6cabcdfc33f02a722bb062c03c8b393 Mon Sep 17 00:00:00 2001 From: bartex80 <piotr.bart@gmail.com> Date: Wed, 29 Mar 2017 11:00:17 +0200 Subject: [PATCH] More layer bindings for GRE (#555) * More layer bindings for GRE * Define IPPROTO_GRE for windows --- scapy/arch/windows/__init__.py | 2 ++ scapy/layers/inet6.py | 2 ++ scapy/layers/l2.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scapy/arch/windows/__init__.py b/scapy/arch/windows/__init__.py index 8ebbf388..a3585e0e 100755 --- a/scapy/arch/windows/__init__.py +++ b/scapy/arch/windows/__init__.py @@ -33,6 +33,8 @@ if not hasattr(socket, 'IPPROTO_AH'): socket.IPPROTO_AH=51 if not hasattr(socket, 'IPPROTO_ESP'): socket.IPPROTO_ESP=50 +if not hasattr(socket, 'IPPROTO_GRE'): + socket.IPPROTO_GRE=47 from scapy.arch import pcapdnet from scapy.arch.pcapdnet import * diff --git a/scapy/layers/inet6.py b/scapy/layers/inet6.py index c6058257..1fa08c6c 100644 --- a/scapy/layers/inet6.py +++ b/scapy/layers/inet6.py @@ -3861,6 +3861,7 @@ conf.l2types.register(31, IPv6) bind_layers(Ether, IPv6, type = 0x86dd ) bind_layers(CookedLinux, IPv6, proto = 0x86dd ) +bind_layers(GRE, IPv6, proto = 0x86dd ) bind_layers(Loopback, IPv6, type = 0x1c ) bind_layers(IPerror6, TCPerror, nh = socket.IPPROTO_TCP ) bind_layers(IPerror6, UDPerror, nh = socket.IPPROTO_UDP ) @@ -3869,3 +3870,4 @@ bind_layers(IPv6, UDP, nh = socket.IPPROTO_UDP ) bind_layers(IP, IPv6, proto = socket.IPPROTO_IPV6 ) bind_layers(IPv6, IPv6, nh = socket.IPPROTO_IPV6 ) bind_layers(IPv6, IP, nh = socket.IPPROTO_IPIP ) +bind_layers(IPv6, GRE, nh = socket.IPPROTO_GRE ) diff --git a/scapy/layers/l2.py b/scapy/layers/l2.py index 252d8a22..9b3292d0 100644 --- a/scapy/layers/l2.py +++ b/scapy/layers/l2.py @@ -1107,7 +1107,7 @@ 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, ARP, proto=2054) bind_layers( GRE, EAPOL, proto=34958) bind_layers( GRE, GRErouting, { "routing_present" : 1 } ) -- GitLab