diff options
author | guy <guy> | 2002-12-19 09:39:10 +0000 |
---|---|---|
committer | guy <guy> | 2002-12-19 09:39:10 +0000 |
commit | 4bec97f457e593be925e92fa28d73af6a57d81cf (patch) | |
tree | fcb53f0e4e3a5749d84858f128e7f6c7e352c23e /print-pppoe.c | |
parent | 60761585472a90c34d7de7bdf50475f0d7261b2d (diff) | |
download | tcpdump-4bec97f457e593be925e92fa28d73af6a57d81cf.tar.gz |
Hoist a bunch of stuff that should be done by all if_print routines into
tcpdump.c. Have if_print routines return the length of the link-layer
header, so that the common code knows how to skip the link-layer header
when printing the packet in hex/ASCII.
Diffstat (limited to 'print-pppoe.c')
-rw-r--r-- | print-pppoe.c | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/print-pppoe.c b/print-pppoe.c index d6bafcf6..1b908281 100644 --- a/print-pppoe.c +++ b/print-pppoe.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = -"@(#) $Header: /tcpdump/master/tcpdump/print-pppoe.c,v 1.20 2002-12-18 09:41:17 guy Exp $ (LBL)"; +"@(#) $Header: /tcpdump/master/tcpdump/print-pppoe.c,v 1.21 2002-12-19 09:39:14 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -89,37 +89,10 @@ static struct tok pppoetag2str[] = { #define PPPOE_HDRLEN 6 -void -pppoe_if_print(u_char *user _U_, const struct pcap_pkthdr *h, - register const u_char *p) +u_int +pppoe_if_print(const struct pcap_pkthdr *h, register const u_char *p) { - register u_int length = h->len; - register u_int caplen = h->caplen; - u_int hdr_len; - - ++infodelay; - ts_print(&h->ts); - - /* - * Some printers want to check that they're not walking off the - * end of the packet. - * Rather than pass it all the way down, we set this global. - */ - snapend = p + caplen; - - hdr_len = pppoe_print(p, length); - - /* - * If "-x" was specified, print packet data in hex. - */ - if (xflag) - default_print_packet(p, caplen, hdr_len); - - putchar('\n'); - - --infodelay; - if (infoprint) - info(0); + return (pppoe_print(p, h->len)); } u_int |