summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/print-sl.c
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2004-03-31 14:57:24 +0000
committerbms <bms@FreeBSD.org>2004-03-31 14:57:24 +0000
commit55b12ee1997869e5aed19e4145ad34c6d874a423 (patch)
tree5b810dd82a76f16819dd3cc55ffa53ff444b2d5a /contrib/tcpdump/print-sl.c
parent34f833a812abe250ad28d7dadb1fdc086b1d4ecd (diff)
downloadFreeBSD-src-55b12ee1997869e5aed19e4145ad34c6d874a423.zip
FreeBSD-src-55b12ee1997869e5aed19e4145ad34c6d874a423.tar.gz
Merge of tcpdump 3.8.3 from tcpdump.org, with the following caveats:
print-atm.c no longer performs special handling for FORE headers; these can no doubt be re-added at a later date. print-fr.c is effectively a no-op. print-llc.c has had the default_print_unaligned() call removed as tcpdump no longer defines this function, however the prototype is still present. Suggest we roll in a diff to use print_unknown_data().
Diffstat (limited to 'contrib/tcpdump/print-sl.c')
-rw-r--r--contrib/tcpdump/print-sl.c60
1 files changed, 11 insertions, 49 deletions
diff --git a/contrib/tcpdump/print-sl.c b/contrib/tcpdump/print-sl.c
index 6f2e872..87f31bb 100644
--- a/contrib/tcpdump/print-sl.c
+++ b/contrib/tcpdump/print-sl.c
@@ -22,21 +22,16 @@
*/
#ifndef lint
-static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-sl.c,v 1.57 2001/07/05 18:54:17 guy Exp $ (LBL)";
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/print-sl.c,v 1.62.2.2 2003/11/16 08:51:44 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <sys/param.h>
-#include <sys/time.h>
+#include <tcpdump-stdinc.h>
-#include <netinet/in.h>
-
-#include <ctype.h>
-#include <netdb.h>
#include <pcap.h>
#include <stdio.h>
@@ -55,27 +50,17 @@ static u_int lastconn = 255;
static void sliplink_print(const u_char *, const struct ip *, u_int);
static void compressed_sl_print(const u_char *, const struct ip *, u_int, int);
-void
-sl_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+u_int
+sl_if_print(const struct pcap_pkthdr *h, const u_char *p)
{
register u_int caplen = h->caplen;
register u_int length = h->len;
register const struct ip *ip;
- ++infodelay;
- ts_print(&h->ts);
-
if (caplen < SLIP_HDRLEN) {
printf("[|slip]");
- goto out;
+ return (caplen);
}
- /*
- * Some printers want to get back at the link level addresses,
- * and/or check that they're not walking off the end of the packet.
- * Rather than pass them all the way down, we set these globals.
- */
- packetp = p;
- snapend = p + caplen;
length -= SLIP_HDRLEN;
@@ -97,37 +82,20 @@ sl_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
printf ("ip v%d", IP_V(ip));
}
- if (xflag)
- default_print((u_char *)ip, caplen - SLIP_HDRLEN);
- out:
- putchar('\n');
- --infodelay;
- if (infoprint)
- info(0);
+ return (SLIP_HDRLEN);
}
-
-void
-sl_bsdos_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+u_int
+sl_bsdos_if_print(const struct pcap_pkthdr *h, const u_char *p)
{
register u_int caplen = h->caplen;
register u_int length = h->len;
register const struct ip *ip;
- ++infodelay;
- ts_print(&h->ts);
-
if (caplen < SLIP_HDRLEN) {
printf("[|slip]");
- goto out;
+ return (caplen);
}
- /*
- * Some printers want to get back at the link level addresses,
- * and/or check that they're not walking off the end of the packet.
- * Rather than pass them all the way down, we set these globals.
- */
- packetp = p;
- snapend = p + caplen;
length -= SLIP_HDRLEN;
@@ -140,13 +108,7 @@ sl_bsdos_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
ip_print((u_char *)ip, length);
- if (xflag)
- default_print((u_char *)ip, caplen - SLIP_HDRLEN);
- out:
- putchar('\n');
- --infodelay;
- if (infoprint)
- info(0);
+ return (SLIP_HDRLEN);
}
static void
OpenPOWER on IntegriCloud