*/
#ifndef lint
-static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ipfc.c,v 1.2 2002-12-18 08:53:21 guy Exp $ (LBL)";
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ipfc.c,v 1.7.2.2 2005-11-13 12:12:59 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
*/
extract_ipfc_addrs(ipfcp, (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)
ipfc_hdr_print(ipfcp, length, ESRC(&ehdr), EDST(&ehdr));
p += IPFC_HDRLEN;
caplen -= IPFC_HDRLEN;
- /* Frame Control field determines interpretation of packet */
- extracted_ethertype = 0;
/* Try to print the LLC-layer header & higher layers */
if (llc_print(p, length, caplen, ESRC(&ehdr), EDST(&ehdr),
&extracted_ethertype) == 0) {
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
}
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
}
/*
- * This is the top level routine of the printer. 'sp' is the points
- * to the Network_Header of the packet, 'tvp' is the timestamp,
- * 'length' is the length of the packet off the wire, and 'caplen'
+ * This is the top level routine of the printer. 'p' points
+ * to the Network_Header of the packet, 'h->ts' is the timestamp,
+ * 'h->len' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
-void
-ipfc_if_print(u_char *pcap _U_, const struct pcap_pkthdr *h,
- register const u_char *p)
+u_int
+ipfc_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);
-
- ipfc_print(p, length, caplen);
-
- /*
- * If "-x" was specified, print stuff past the Network_Header,
- * if there's anything to print.
- */
- if (xflag && caplen > IPFC_HDRLEN)
- default_print(p + IPFC_HDRLEN, caplen - IPFC_HDRLEN);
-
- putchar('\n');
+ ipfc_print(p, h->len, h->caplen);
- --infodelay;
- if (infoprint)
- info(0);
+ return (IPFC_HDRLEN);
}