X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/e070cf232ffadbdbbca68b132ef369675890e566..fb8b947488c7f22b518de1df1a91e663dc7ab33c:/print-fddi.c diff --git a/print-fddi.c b/print-fddi.c index 762feaca..84aea552 100644 --- a/print-fddi.c +++ b/print-fddi.c @@ -20,8 +20,8 @@ */ #ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.59 2002-12-18 08:53:21 guy Exp $ (LBL)"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.64 2004-03-17 23:24:37 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -255,13 +255,6 @@ fddi_print(const u_char *p, u_int length, u_int caplen) */ extract_fddi_addrs(fddip, (char *)ESRC(&ehdr), (char *)EDST(&ehdr)); - /* - * 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; - if (eflag) fddi_hdr_print(fddip, length, ESRC(&ehdr), EDST(&ehdr)); @@ -305,31 +298,13 @@ fddi_print(const u_char *p, u_int length, u_int caplen) /* * This is the top level routine of the printer. 'p' points * to the FDDI header of the packet, 'h->ts' is the timestamp, - * 'h->length' is the length of the packet off the wire, and 'h->caplen' + * 'h->len' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ -void -fddi_if_print(u_char *pcap _U_, const struct pcap_pkthdr *h, - register const u_char *p) +u_int +fddi_if_print(const struct pcap_pkthdr *h, register const u_char *p) { - u_int caplen = h->caplen; - u_int length = h->len; - - ++infodelay; - ts_print(&h->ts); - - fddi_print(p, length, caplen); - - /* - * If "-x" was specified, print stuff past the FDDI header, - * if there's anything to print. - */ - if (xflag && caplen > FDDI_HDRLEN) - default_print(p + FDDI_HDRLEN, caplen - FDDI_HDRLEN); - - putchar('\n'); + fddi_print(p, h->len, h->caplen); - --infodelay; - if (infoprint) - info(0); + return (FDDI_HDRLEN); }