Skip to content
Snippets Groups Projects
Commit 89b266a3 authored by Guillaume Valadon's avatar Guillaume Valadon Committed by GitHub
Browse files

Merge pull request #755 from p-l-/impr-ppp

Minor improvements to PPP support
parents 695913c5 0ff702ff
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,9 @@ ARPHDR_TUN = 65534 ...@@ -32,6 +32,9 @@ ARPHDR_TUN = 65534
# From pcap/dlt.h # From pcap/dlt.h
DLT_NULL = 0 DLT_NULL = 0
DLT_PPP = 9
DLT_PPP_SERIAL = 50
DLT_PPP_ETHER = 51
DLT_RAW = 101 DLT_RAW = 101
DLT_IPV4 = 228 DLT_IPV4 = 228
DLT_IPV6 = 229 DLT_IPV6 = 229
......
...@@ -10,6 +10,8 @@ PPP (Point to Point Protocol) ...@@ -10,6 +10,8 @@ PPP (Point to Point Protocol)
""" """
import struct import struct
from scapy.config import conf
from scapy.data import DLT_PPP, DLT_PPP_SERIAL, DLT_PPP_ETHER
from scapy.packet import Packet, bind_layers from scapy.packet import Packet, bind_layers
from scapy.layers.eap import EAP from scapy.layers.eap import EAP
from scapy.layers.l2 import Ether, CookedLinux, GRE_PPTP from scapy.layers.l2 import Ether, CookedLinux, GRE_PPTP
...@@ -364,8 +366,11 @@ class PPP_LCP(Packet): ...@@ -364,8 +366,11 @@ class PPP_LCP(Packet):
StrLenField("data", "", StrLenField("data", "",
length_from=lambda p:p.len-4)] length_from=lambda p:p.len-4)]
def mysummary(self):
return self.sprintf('LCP %code%')
def extract_padding(self, pay): def extract_padding(self, pay):
return "",pay return "", pay
@classmethod @classmethod
def dispatch_hook(cls, _pkt = None, *args, **kargs): def dispatch_hook(cls, _pkt = None, *args, **kargs):
...@@ -706,3 +711,8 @@ bind_layers( PPP, PPP_PAP, proto=0xc023) ...@@ -706,3 +711,8 @@ bind_layers( PPP, PPP_PAP, proto=0xc023)
bind_layers( Ether, PPP_IPCP, type=0x8021) bind_layers( Ether, PPP_IPCP, type=0x8021)
bind_layers( Ether, PPP_ECP, type=0x8053) bind_layers( Ether, PPP_ECP, type=0x8053)
bind_layers( GRE_PPTP, PPP, proto=0x880b) bind_layers( GRE_PPTP, PPP, proto=0x880b)
conf.l2types.register(DLT_PPP, PPP)
conf.l2types.register(DLT_PPP_SERIAL, HDLC)
conf.l2types.register(DLT_PPP_ETHER, PPPoE)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment