]> The Tcpdump Group git mirrors - libpcap/commitdiff
add minimalistic code support for DLT_JUNIPER_PPPOE
authorhannes <hannes>
Tue, 3 May 2005 20:33:51 +0000 (20:33 +0000)
committerhannes <hannes>
Tue, 3 May 2005 20:33:51 +0000 (20:33 +0000)
gencode.c

index 9708408d9f156e9105d49c345aed28cfed46a0d6..1df1fb0d9d4ec6f186068eb538d6cb202197932f 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -21,7 +21,7 @@
  */
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.221.2.17 2005-05-02 21:22:57 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.221.2.18 2005-05-03 20:33:51 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -1112,6 +1112,14 @@ init_linktype(p)
                off_nl_nosnap = 18;
                return;
 
+                /* frames captured on a Juniper PPPoE service PIC
+                 * contain raw ethernet frames */
+        case DLT_JUNIPER_PPPOE:
+            off_linktype = 16;
+            off_nl = 18;            /* Ethernet II */
+            off_nl_nosnap = 21;     /* 802.3+802.2 */
+            return;
+
 #ifdef DLT_PFSYNC
        case DLT_PFSYNC:
                off_linktype = -1;
@@ -2176,6 +2184,7 @@ gen_linktype(proto)
         case DLT_JUNIPER_MLPPP:
        case DLT_JUNIPER_ATM1:
        case DLT_JUNIPER_ATM2:
+       case DLT_JUNIPER_PPPOE:
                /* just lets verify the magic number for now -
                 * on ATM we may have up to 6 different encapsulations on the wire
                 * and need a lot of heuristics to figure out that the payload
@@ -5913,6 +5922,7 @@ gen_inbound(dir)
         case DLT_JUNIPER_MLPPP:
        case DLT_JUNIPER_ATM1:
        case DLT_JUNIPER_ATM2:
+       case DLT_JUNIPER_PPPOE:
                /* juniper flags (including direction) are stored
                 * the byte after the 3-byte magic number */
                if (dir) {