* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.248 2005-04-26 07:26:33 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.249 2005-05-03 20:35:41 hannes Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
extern u_int juniper_mfr_print(const struct pcap_pkthdr *, register const u_char *);
extern u_int juniper_mlfr_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_mlppp_print(const struct pcap_pkthdr *, const u_char *);
+extern u_int juniper_pppoe_print(const struct pcap_pkthdr *, const u_char *);
extern u_int sll_if_print(const struct pcap_pkthdr *, const u_char *);
extern void snmp_print(const u_char *, u_int);
extern void sunrpcrequest_print(const u_char *, u_int, const u_char *);
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-juniper.c,v 1.11 2005-04-25 18:53:27 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-juniper.c,v 1.12 2005-05-03 20:35:42 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
JUNIPER_ATM2,
JUNIPER_MLPPP,
JUNIPER_MLFR,
- JUNIPER_MFR
+ JUNIPER_MFR,
+ JUNIPER_PPPOE
};
enum {
{ JUNIPER_MLPPP, 2, "MLPPP"},
{ JUNIPER_MLFR, 2, "MLFR"},
{ JUNIPER_MFR, 4, "MFR"},
+ { JUNIPER_PPPOE, 0, "PPPoE"},
};
struct juniper_l2info_t {
int juniper_ppp_heuristic_guess(register const u_char *, u_int);
static int juniper_parse_header (const u_char *, const struct pcap_pkthdr *, struct juniper_l2info_t *);
+u_int
+juniper_pppoe_print(const struct pcap_pkthdr *h, register const u_char *p)
+{
+ struct juniper_l2info_t l2info;
+
+ l2info.pictype = JUNIPER_PPPOE;
+ if(juniper_parse_header(p, h, &l2info) == 0)
+ return l2info.header_len;
+
+ p+=l2info.header_len;
+ /* this DLT contains nothing but raw ethernet frames */
+ ether_print(p, l2info.length, l2info.caplen);
+ return l2info.header_len;
+}
+
+
u_int
juniper_mlppp_print(const struct pcap_pkthdr *h, register const u_char *p)
{
} else l2info->bundle = l2info->cookie[0];
if (eflag)
- printf("%s-PIC, cookie-len %u, cookie 0x",
+ printf("%s-PIC, cookie-len %u",
lp->s,
l2info->cookie_len);
-
- for (idx = 0; idx < l2info->cookie_len; idx++) {
- l2info->cookie[idx] = p[idx]; /* copy cookie data */
- if (eflag) printf("%02x",p[idx]);
+
+ if (eflag && l2info->cookie_len > 0) {
+ printf(", cookie 0x");
+ for (idx = 0; idx < l2info->cookie_len; idx++) {
+ l2info->cookie[idx] = p[idx]; /* copy cookie data */
+ if (eflag) printf("%02x",p[idx]);
+ }
}
-
+
if (eflag) printf(": "); /* print demarc b/w L2/L3*/
"@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\
The Regents of the University of California. All rights reserved.\n";
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.254 2005-04-20 12:41:44 hannes Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.255 2005-05-03 20:35:41 hannes Exp $ (LBL)";
#endif
/*
#endif
#ifdef DLT_JUNIPER_MLPPP
{ juniper_mlppp_print, DLT_JUNIPER_MLPPP },
+#endif
+#ifdef DLT_JUNIPER_PPPOE
+ { juniper_pppoe_print, DLT_JUNIPER_PPPOE },
#endif
{ NULL, 0 },
};