summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump/print-sl.c
diff options
context:
space:
mode:
authorbitblt <bitblt@cvs.openbsd.org>1996-12-12 16:23:06 +0000
committerbitblt <bitblt@cvs.openbsd.org>1996-12-12 16:23:06 +0000
commit60909394a7629154d32d662f864cc3dd5c52ee64 (patch)
tree0c1671db4b72cc060eed235adfc04454f88e0163 /usr.sbin/tcpdump/print-sl.c
parent2da72263fb9852691068f6bd411c3026a8fd34d4 (diff)
*** empty log message ***
Diffstat (limited to 'usr.sbin/tcpdump/print-sl.c')
-rw-r--r--usr.sbin/tcpdump/print-sl.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/usr.sbin/tcpdump/print-sl.c b/usr.sbin/tcpdump/print-sl.c
index dabd44d1cd9..405afff3eab 100644
--- a/usr.sbin/tcpdump/print-sl.c
+++ b/usr.sbin/tcpdump/print-sl.c
@@ -1,5 +1,3 @@
-/* $OpenBSD: print-sl.c,v 1.5 1996/08/18 21:47:57 deraadt Exp $ */
-
/*
* Copyright (c) 1989, 1990, 1991, 1993, 1994, 1995, 1996
* The Regents of the University of California. All rights reserved.
@@ -22,11 +20,11 @@
*/
#ifndef lint
-static char rcsid[] =
- "@(#)Header: print-sl.c,v 1.36 96/06/23 02:11:46 leres Exp (LBL)";
+static const char rcsid[] =
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-sl.c,v 1.6 1996/12/12 16:22:27 bitblt Exp $ (LBL)";
#endif
-#ifdef CSLIP
+#ifdef HAVE_NET_SLIP_H
#include <sys/param.h>
#include <sys/time.h>
#include <sys/timeb.h>
@@ -63,11 +61,11 @@ struct rtentry;
#include "addrtoname.h"
#include "extract.h" /* must come after interface.h */
-static int lastlen[2][256];
-static int lastconn = 255;
+static u_int lastlen[2][256];
+static u_int lastconn = 255;
-static void sliplink_print(const u_char *, const struct ip *, int);
-static void compressed_sl_print(const u_char *, const struct ip *, int, int);
+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);
/* XXX BSD/OS 2.1 compatibility */
#if !defined(SLIP_HDRLEN) && defined(SLC_BPFHDR)
@@ -80,8 +78,8 @@ static void compressed_sl_print(const u_char *, const struct ip *, int, int);
void
sl_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
{
- register int caplen = h->caplen;
- register int length = h->len;
+ register u_int caplen = h->caplen;
+ register u_int length = h->len;
register const struct ip *ip;
ts_print(&h->ts);
@@ -115,10 +113,10 @@ sl_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
static void
sliplink_print(register const u_char *p, register const struct ip *ip,
- register int length)
+ register u_int length)
{
int dir;
- int hlen;
+ u_int hlen;
dir = p[SLX_DIR];
putchar(dir == SLIPDIR_IN ? 'I' : 'O');
@@ -141,7 +139,7 @@ sliplink_print(register const u_char *p, register const struct ip *ip,
case TYPE_UNCOMPRESSED_TCP:
/*
- * The connection id is stored in the IP protcol field.
+ * The connection id is stored in the IP protocol field.
* Get it from the link layer since sl_uncompress_tcp()
* has restored the IP header copy to IPPROTO_TCP.
*/
@@ -168,7 +166,7 @@ print_sl_change(const char *str, register const u_char *cp)
register u_int i;
if ((i = *cp++) == 0) {
- i = EXTRACT_SHORT(cp);
+ i = EXTRACT_16BITS(cp);
cp += 2;
}
printf(" %s%d", str, i);
@@ -181,7 +179,7 @@ print_sl_winchange(register const u_char *cp)
register short i;
if ((i = *cp++) == 0) {
- i = EXTRACT_SHORT(cp);
+ i = EXTRACT_16BITS(cp);
cp += 2;
}
if (i >= 0)
@@ -193,11 +191,10 @@ print_sl_winchange(register const u_char *cp)
static void
compressed_sl_print(const u_char *chdr, const struct ip *ip,
- int length, int dir)
+ u_int length, int dir)
{
register const u_char *cp = chdr;
- register u_int flags;
- int hlen;
+ register u_int flags, hlen;
flags = *cp++;
if (flags & NEW_C) {
@@ -246,6 +243,7 @@ compressed_sl_print(const u_char *chdr, const struct ip *ip,
#include <sys/types.h>
#include <sys/time.h>
+#include <pcap.h>
#include <stdio.h>
#include "interface.h"