From 7fb6f8bc2231ecfc9db2c103761d8d654c1b4f60 Mon Sep 17 00:00:00 2001
From: gpotter2 <gabriel@potter.fr>
Date: Wed, 21 Dec 2016 17:18:44 +0100
Subject: [PATCH] [Layers] Added fields desc on CookedLinux + L3pcapsocket

- Added fields on CookedLinux
- Tiny tiny tiny fix: added description to L3pcapsocket
---
 scapy/arch/pcapdnet.py | 1 +
 scapy/layers/l2.py     | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/scapy/arch/pcapdnet.py b/scapy/arch/pcapdnet.py
index 95df0c94..0f815ca8 100644
--- a/scapy/arch/pcapdnet.py
+++ b/scapy/arch/pcapdnet.py
@@ -304,6 +304,7 @@ if conf.use_winpcapy:
               self.outs.close()
 
   class L3pcapSocket(L2pcapSocket):
+      desc = "read/write packets at layer 3 using only libpcap"
       #def __init__(self, iface = None, type = ETH_P_ALL, filter=None, nofilter=0):
       #    L2pcapSocket.__init__(self, iface, type, filter, nofilter)
       def recv(self, x = MTU):
diff --git a/scapy/layers/l2.py b/scapy/layers/l2.py
index 9edbf710..83ec881d 100644
--- a/scapy/layers/l2.py
+++ b/scapy/layers/l2.py
@@ -203,9 +203,14 @@ conf.neighbor.register_l3(Dot3, LLC, l2_register_l3)
 
 
 class CookedLinux(Packet):
+    # Documentation: http://www.tcpdump.org/linktypes/LINKTYPE_LINUX_SLL.html
     name = "cooked linux"
+    # from wireshark's database
     fields_desc = [ ShortEnumField("pkttype",0, {0: "unicast",
-                                                 4:"sent-by-us"}), #XXX incomplete
+                                                 1: "broadcast",
+                                                 2: "multicast",
+                                                 3: "unicast-to-another-host",
+                                                 4:"sent-by-us"}),
                     XShortField("lladdrtype",512),
                     ShortField("lladdrlen",0),
                     StrFixedLenField("src","",8),
-- 
GitLab