#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.57 2000-12-04 06:47:18 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.66 2002-05-29 10:32:02 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
switch (proto) {
case PPP_IP: return "IP";
+ case PPP_IPV6: return "IPv6";
#ifdef PPP_XNS
case PPP_XNS: return "XNS";
#endif
case PPP_IPX: return "IPX";
+ case PPP_OSI: return "OSI";
case PPP_VJC: return "VJC";
case PPP_VJNC: return "VJNC";
-#ifdef PPP_COMP
case PPP_COMP: return "COMP";
-#endif
case PPP_IPCP: return "IPCP";
- case PPP_IPV6CP: return "IPV6CP";
+ case PPP_IPV6CP: return "IPv6CP";
case PPP_IPXCP: return "IPXCP";
+ case PPP_OSICP: return "OSICP";
case PPP_CCP: return "CCP";
case PPP_LCP: return "LCP";
case PPP_PAP: return "PAP";
case PPP_IPX:
ipx_print(p, length);
break;
+ case PPP_OSI:
+ isoclns_print(p, length, length, NULL, NULL);
+ break;
+ default:
+ break;
}
}
/* Standard PPP printer */
-void
+u_int
ppp_print(register const u_char *p, u_int length)
{
u_int proto;
u_int full_length = length;
+ u_int hdr_len = 0;
/*
* Here, we assume that p points to the Address and Control
if (*p == PPP_ADDRESS && *(p + 1) == PPP_CONTROL) {
p += 2; /* ACFC not used */
length -= 2;
+ hdr_len += 2;
}
if (length < 2)
proto = *p; /* PFC is used */
p++;
length--;
+ hdr_len++;
} else {
proto = EXTRACT_16BITS(p);
p += 2;
length -= 2;
+ hdr_len += 2;
}
printf("%s %d: ", ppp_protoname(proto), full_length);
handle_ppp(proto, p, length);
- return;
+ return (hdr_len);
trunc:
printf("[|ppp]");
+ return (0);
}
register u_int length = h->len;
register u_int caplen = h->caplen;
+ ++infodelay;
ts_print(&h->ts);
if (caplen < PPP_HDRLEN) {
default_print(p, caplen);
out:
putchar('\n');
+ --infodelay;
+ if (infoprint)
+ info(0);
}
/*
register u_int caplen = h->caplen;
u_int proto;
+ ++infodelay;
+ ts_print(&h->ts);
+
if (caplen < 2) {
printf("[|ppp]");
goto out;
goto out;
}
- ts_print(&h->ts);
if (eflag)
printf("%02x %02x %d ", p[0], p[1], length);
p += 2;
case CHDLC_UNICAST:
case CHDLC_BCAST:
- /*
- * Have the Cisco HDLC print routine do all the work.
- */
- chdlc_if_print(user, h, p);
- return;
+ chdlc_print(p, length, caplen);
+ goto out;
default:
- ts_print(&h->ts);
if (eflag)
printf("%02x %02x %d ", p[0], p[1], length);
p += 2;
default_print(p, caplen);
out:
putchar('\n');
+ --infodelay;
+ if (infoprint)
+ info(0);
}
const u_char *q;
int i;
+ ++infodelay;
ts_print(&h->ts);
if (caplen < PPP_BSDI_HDRLEN) {
default_print((const u_char *)p, caplen - hdrlength);
out:
putchar('\n');
+ --infodelay;
+ if (infoprint)
+ info(0);
#endif /* __bsdi__ */
}