-/* @(#) $Header: /tcpdump/master/tcpdump/ppp.h,v 1.14 2003-05-22 15:29:22 hannes Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ppp.h,v 1.15 2004-08-18 14:56:28 hannes Exp $ (LBL) */
/*
* Point to Point Protocol (PPP) RFC1331
*
#define PPP_ADDRESS 0xff /* The address byte value */
#define PPP_CONTROL 0x03 /* The control byte value */
+#define PPP_WITHDIRECTION_IN 0x00 /* non-standard for DLT_PPP_WITHDIRECTION */
+#define PPP_WITHDIRECTION_OUT 0x01 /* non-standard for DLT_PPP_WITHDIRECTION */
+
/* Protocol numbers */
#define PPP_IP 0x0021 /* Raw IP */
#define PPP_OSI 0x0023 /* OSI Network Layer */
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.100 2004-07-15 00:16:49 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.101 2004-08-18 14:56:28 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
u_int
ppp_print(register const u_char *p, u_int length)
{
- u_int proto;
+ u_int proto,ppp_header;
u_int olen = length; /* _o_riginal length */
u_int hdr_len = 0;
if (length < 2)
goto trunc;
TCHECK2(*p, 2);
- if (*p == PPP_ADDRESS && *(p + 1) == PPP_CONTROL) {
- p += 2; /* ACFC not used */
- length -= 2;
- hdr_len += 2;
- }
+ ppp_header = EXTRACT_16BITS(p);
+
+ switch(ppp_header) {
+ case (PPP_WITHDIRECTION_IN << 8 | PPP_CONTROL):
+ if (eflag) printf("In ");
+ p += 2;
+ length -= 2;
+ hdr_len += 2;
+ break;
+ case (PPP_WITHDIRECTION_OUT << 8 | PPP_CONTROL):
+ if (eflag) printf("Out ");
+ p += 2;
+ length -= 2;
+ hdr_len += 2;
+ break;
+ case (PPP_ADDRESS << 8 | PPP_CONTROL):
+ p += 2; /* ACFC not used */
+ length -= 2;
+ hdr_len += 2;
+ break;
+
+ default:
+ break;
+ }
if (length < 2)
goto trunc;
"@(#) 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.246 2004-07-21 22:06:47 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.247 2004-08-18 14:56:27 hannes Exp $ (LBL)";
#endif
/*
{ sl_bsdos_if_print, DLT_SLIP_BSDOS },
#endif
{ ppp_if_print, DLT_PPP },
+#ifdef DLT_PPP_WITHDIRECTION
+ { ppp_if_print, DLT_PPP_WITHDIRECTION },
+#endif
#ifdef DLT_PPP_BSDOS
{ ppp_bsdos_if_print, DLT_PPP_BSDOS },
#endif