]> The Tcpdump Group git mirrors - libpcap/commitdiff
Add support for NetBSD DLT_PPP_ETHER, as per the NetBSD libpcap.
authorguy <guy>
Tue, 17 Apr 2001 08:10:00 +0000 (08:10 +0000)
committerguy <guy>
Tue, 17 Apr 2001 08:10:00 +0000 (08:10 +0000)
bpf/net/bpf.h
gencode.c
savefile.c

index 57f429729487fa97c15db90a5b7d3946c1d4e16a..9244fd3683976a29456fafa6b64208063dc76a6c 100644 (file)
@@ -37,7 +37,7 @@
  *
  *      @(#)bpf.h       7.1 (Berkeley) 5/7/91
  *
- * @(#) $Header: /tcpdump/master/libpcap/bpf/net/Attic/bpf.h,v 1.44 2000-12-21 10:29:24 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/libpcap/bpf/net/Attic/bpf.h,v 1.45 2001-04-17 08:10:02 guy Exp $ (LBL)
  */
 
 #ifndef BPF_MAJOR_VERSION
@@ -212,11 +212,12 @@ struct bpf_hdr {
 #define DLT_ATM_CLIP   19      /* Linux Classical-IP over ATM */
 
 /*
- * This value is defined by NetBSD; other platforms should refrain from
- * using it for other purposes, so that NetBSD savefiles with a link
- * type of 50 can be read as this type on all platforms.
+ * These values are defined by NetBSD; other platforms should refrain from
+ * using them for other purposes, so that NetBSD savefiles with link
+ * types of 50 or 51 can be read as this type on all platforms.
  */
 #define DLT_PPP_SERIAL 50      /* PPP over serial with HDLC encapsulation */
+#define DLT_PPP_ETHER  51      /* PPP over Ethernet */
 
 /*
  * This value was defined by libpcap 0.5; platforms that have defined
index a033a783a90a861604b834bd1ed2002559953172..208c5f242f6d2720d0bb85b262e095fdc04018c3 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -21,7 +21,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.149 2001-02-21 09:33:04 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.150 2001-04-17 08:10:00 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -575,12 +575,22 @@ init_linktype(type)
                return;
 
        case DLT_PPP:
-       case DLT_C_HDLC:
-       case DLT_PPP_SERIAL:
+       case DLT_C_HDLC:                /* BSD/OS Cisco HDLC */
+       case DLT_PPP_SERIAL:            /* NetBSD sync/async serial PPP */
                off_linktype = 2;
                off_nl = 4;
                return;
 
+       case DLT_PPP_ETHER:             /* NetBSD PPP over Ethernet */
+               /*
+                * This includes the Ethernet header (since we need
+                * the ethertype to dispatch Session vs. Discovery)
+                * and the PPPoE (RFC 2516) header.
+                */
+               off_linktype = 20;
+               off_nl = 22;
+               return;
+
        case DLT_PPP_BSDOS:
                off_linktype = 5;
                off_nl = 24;
index 97c9e02067c2f2886cf3afb4db3ab4f19f4da409..f1ab7493524d80a108269264c402b9c86c986e75 100644 (file)
@@ -30,7 +30,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.49 2000-12-21 10:29:23 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/savefile.c,v 1.50 2001-04-17 08:10:01 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -149,6 +149,8 @@ static const char rcsid[] =
  */
 #define LINKTYPE_PPP_HDLC      50              /* PPP in HDLC-like framing */
 
+#define LINKTYPE_PPP_ETHER     51              /* NetBSD PPP-over-Ethernet */
+
 #define LINKTYPE_ATM_RFC1483   100             /* LLC/SNAP-encapsulated ATM */
 #define LINKTYPE_RAW           101             /* raw IP */
 #define LINKTYPE_SLIP_BSDOS    102             /* BSD/OS SLIP BPF header */
@@ -216,6 +218,9 @@ static struct linktype_map {
        /* NetBSD sync/async serial PPP (or Cisco HDLC) */
        { DLT_PPP_SERIAL,       LINKTYPE_PPP_HDLC },
 
+       /* NetBSD PPP over Ethernet */
+       { DLT_PPP_ETHER,        LINKTYPE_PPP_ETHER },
+
        /* IEEE 802.11 wireless */
        { DLT_IEEE802_11,       LINKTYPE_IEEE802_11 },