#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.64 2001-09-09 02:04:19 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
}
/* 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;
}
- if (eflag)
- printf("%s %d: ", ppp_protoname(proto), full_length);
+ printf("%s %d: ", ppp_protoname(proto), full_length);
handle_ppp(proto, p, length);
- return;
+ return (hdr_len);
trunc:
printf("[|ppp]");
+ return (0);
}
proto = EXTRACT_16BITS(p);
p += 2;
length -= 2;
- if (eflag)
- printf("%s: ", ppp_protoname(proto));
+ printf("%s: ", ppp_protoname(proto));
handle_ppp(proto, p, length);
break;