#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-juniper.c,v 1.8.2.2 2005-04-21 04:04:01 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-juniper.c,v 1.8.2.4 2005-05-03 20:39:26 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
JUNIPER_ATM2,
JUNIPER_MLPPP,
JUNIPER_MLFR,
- JUNIPER_MFR
+ JUNIPER_MFR,
+ JUNIPER_PPPOE
};
enum {
DEFAULT,
- LS_COOKIE,
+ LS_COOKIE
};
struct juniper_cookie_table_t {
{ 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*/