]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ipfc.c
When checking for pcap_if_t, add $V_INCLS to CFLAGS, so we look at the
[tcpdump] / print-ipfc.c
index a33cfbdf49444bf13311cdbc76f99abaf847f998..cf3f5626f204948d312ecb1cfebd483c832dd916 100644 (file)
@@ -20,8 +20,8 @@
  */
 
 #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 2004-03-17 23:24:37 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -93,13 +93,6 @@ ipfc_print(const u_char *p, u_int length, u_int caplen)
         */
        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));
 
@@ -130,33 +123,15 @@ ipfc_print(const u_char *p, u_int length, u_int 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);
 }