]> The Tcpdump Group git mirrors - libpcap/commitdiff
From Daniele Orlandi <[email protected]>: add support for capturing
authorguy <guy>
Sun, 22 Jan 2006 20:11:26 +0000 (20:11 +0000)
committerguy <guy>
Sun, 22 Jan 2006 20:11:26 +0000 (20:11 +0000)
LAPD frames with vISDN.

CREDITS
pcap-linux.c
pcap.3
pcap.c

diff --git a/CREDITS b/CREDITS
index 193f2dbd3d131723df3c27235cac7054aebb3320..c1203360fc3d84e063aa66c08050d8ddfdad06d2 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -23,6 +23,7 @@ Additional people who have contributed patches:
        Chris G. Demetriou              <[email protected]>
        Chris Lightfoot                 <[email protected]>
        Chris Pepper                    <[email protected]>
+       Daniele Orlandi                 <[email protected]>
        Darren Reed                     <[email protected]>
        David Kaelbling                 <[email protected]>
        David Young                     <[email protected]>
index 219851ade2c8ac58571d6a51cf5ee00464b567a5..c157f65390d2e5e72c14f3a23f96316c0939b412 100644 (file)
@@ -27,7 +27,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.118 2005-11-24 19:27:42 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.119 2006-01-22 20:11:26 guy Exp $ (LBL)";
 #endif
 
 /*
@@ -1340,6 +1340,16 @@ static void map_arphrd_to_dlt(pcap_t *handle, int arptype, int cooked_ok)
                //handle->md.cooked = 1;
                break;
 
+       /* ARPHRD_LAPD is unofficial and randomly allocated, if reallocation
+        * is needed, please report it to <[email protected]> */
+#ifndef ARPHRD_LAPD
+#define ARPHRD_LAPD    8445
+#endif
+       case ARPHRD_LAPD:
+               /* Don't expect IP packet out of this interfaces... */
+               handle->linktype = DLT_LINUX_LAPD;
+               break;
+
        default:
                handle->linktype = -1;
                break;
@@ -1421,6 +1431,7 @@ live_open_new(pcap_t *handle, const char *device, int promisc,
                        if (handle->linktype == -1 ||
                            handle->linktype == DLT_LINUX_SLL ||
                            handle->linktype == DLT_LINUX_IRDA ||
+                           handle->linktype == DLT_LINUX_LAPD ||
                            (handle->linktype == DLT_EN10MB &&
                             (strncmp("isdn", device, 4) == 0 ||
                              strncmp("isdY", device, 4) == 0))) {
@@ -1474,7 +1485,8 @@ live_open_new(pcap_t *handle, const char *device, int promisc,
                                }
                                /* IrDA capture is not a real "cooked" capture,
                                 * it's IrLAP frames, not IP packets. */
-                               if (handle->linktype != DLT_LINUX_IRDA)
+                               if (handle->linktype != DLT_LINUX_IRDA &&
+                                       handle->linktype != DLT_LINUX_LAPD)
                                        handle->linktype = DLT_LINUX_SLL;
                        }
 
diff --git a/pcap.3 b/pcap.3
index 4bff87d8c6541a74c39f4ab465957f7141d67989..87489c6f060d25f17ad4e14747b7dec335ca48ff 100644 (file)
--- a/pcap.3
+++ b/pcap.3
@@ -1,4 +1,4 @@
-.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3,v 1.72 2005-09-07 08:28:56 guy Exp $
+.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3,v 1.73 2006-01-22 20:11:26 guy Exp $
 .\"
 .\" Copyright (c) 1994, 1996, 1997
 .\"    The Regents of the University of California.  All rights reserved.
@@ -1079,6 +1079,11 @@ and type bytes.
 Linux-IrDA packets, with a
 .B DLT_LINUX_SLL
 header followed by the IrLAP header.
+.TP 5
+.B DLT_LINUX_LAPD
+LAPD (Q.921) frames, with a
+.B DLT_LINUX_SLL
+header captured via vISDN.
 .RE
 .PP
 .B pcap_list_datalinks()
diff --git a/pcap.c b/pcap.c
index fa3addd867cfc0a8c1dda5cee4fa22460d8fff69..69a1832901ca7c28d64b53de985057ca8e0a0929 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -33,7 +33,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap.c,v 1.97 2005-12-13 13:41:39 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap.c,v 1.98 2006-01-22 20:11:26 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -354,6 +354,7 @@ static struct dlt_choice dlt_choices[] = {
        DLT_CHOICE(DLT_ARCNET_LINUX, "Linux ARCNET"),
        DLT_CHOICE(DLT_DOCSIS, "DOCSIS"),
        DLT_CHOICE(DLT_LINUX_IRDA, "Linux IrDA"),
+       DLT_CHOICE(DLT_LINUX_LAPD, "Linux vISDN LAPD"),
        DLT_CHOICE(DLT_IEEE802_11_RADIO_AVS, "802.11 plus AVS radio information header"),
         DLT_CHOICE(DLT_SYMANTEC_FIREWALL, "Symantec Firewall"),
         DLT_CHOICE(DLT_JUNIPER_ATM1, "Juniper ATM1 PIC"),