aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguy <guy>2002-09-05 21:25:34 +0000
committerguy <guy>2002-09-05 21:25:34 +0000
commitc422d3ab0f6de2d38512a4566637bc47df291e74 (patch)
tree2d4881bf0fd7ad4e433201643b5b6a66f17e997c
parentc2bfaa85753ea1cad8c3729692a6bdbb80780f91 (diff)
downloadtcpdump-c422d3ab0f6de2d38512a4566637bc47df291e74.tar.gz
Get rid of the "-Wno-unused" flag, and fix up most of the
unused-parameter problems reported by GCC. Add an _U_ tag to label parameters as unused if the function is called through a pointer (so that you can't change its signature by removing parameters) or if there are unused parameters only because the function isn't complete. Add some additional bounds checks the necessity for which was revealed while cleaning up unused-parameter problems. Make some routines static. "lcp_print()", defined in "print-lcp.c", isn't called anywhere - "print-ppp.c" has the code to dissect LCP. Get rid of "print-lcp.c".
-rw-r--r--FILES1
-rw-r--r--INSTALL3
-rw-r--r--Makefile.in14
-rw-r--r--aclocal.m44
-rwxr-xr-xconfigure2
-rw-r--r--interface.h30
-rw-r--r--machdep.c14
-rw-r--r--print-802_11.c104
-rw-r--r--print-ah.c4
-rw-r--r--print-arcnet.c10
-rw-r--r--print-atalk.c4
-rw-r--r--print-atm.c10
-rw-r--r--print-bootp.c5
-rw-r--r--print-cdp.c5
-rw-r--r--print-chdlc.c4
-rw-r--r--print-cip.c16
-rw-r--r--print-cnfp.c4
-rw-r--r--print-decnet.c6
-rw-r--r--print-domain.c14
-rw-r--r--print-dvmrp.c23
-rw-r--r--print-egp.c15
-rw-r--r--print-ether.c8
-rw-r--r--print-fddi.c12
-rw-r--r--print-fr.c8
-rw-r--r--print-igmp.c20
-rw-r--r--print-ip.c8
-rw-r--r--print-ip6.c6
-rw-r--r--print-ipcomp.c4
-rw-r--r--print-isakmp.c58
-rw-r--r--print-krb.c18
-rw-r--r--print-lane.c8
-rw-r--r--print-lcp.c212
-rw-r--r--print-llc.c12
-rw-r--r--print-null.c4
-rw-r--r--print-pflog.c4
-rw-r--r--print-ppp.c16
-rw-r--r--print-pppoe.c4
-rw-r--r--print-pptp.c4
-rw-r--r--print-raw.c4
-rw-r--r--print-rip.c10
-rw-r--r--print-rx.c19
-rw-r--r--print-sl.c6
-rw-r--r--print-sll.c8
-rw-r--r--print-smb.c8
-rw-r--r--print-stp.c10
-rw-r--r--print-sunatm.c8
-rw-r--r--print-tcp.c4
-rw-r--r--print-timed.c4
-rw-r--r--print-token.c10
-rw-r--r--print-udp.c17
-rw-r--r--print-vjc.c4
-rw-r--r--tcpdump.c4
-rw-r--r--win32/prj/GNUmakefile1
-rw-r--r--win32/prj/WinDump.dsp4
54 files changed, 307 insertions, 512 deletions
diff --git a/FILES b/FILES
index 165fd79f..52625772 100644
--- a/FILES
+++ b/FILES
@@ -119,7 +119,6 @@ print-isoclns.c
print-krb.c
print-l2tp.c
print-lane.c
-print-lcp.c
print-llc.c
print-lwres.c
print-mobile.c
diff --git a/INSTALL b/INSTALL
index 2d0a1862..66942699 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-@(#) $Header: /tcpdump/master/tcpdump/Attic/INSTALL,v 1.49 2002-07-16 04:46:41 guy Exp $ (LBL)
+@(#) $Header: /tcpdump/master/tcpdump/Attic/INSTALL,v 1.50 2002-09-05 21:25:35 guy Exp $ (LBL)
If you have not built libpcap, do so first. See the README
file in this directory for the ftp location.
@@ -145,7 +145,6 @@ print-isoclns.c - ISO CLNS, ESIS, and ISIS printer routines
print-krb.c - Kerberos printer routines
print-l2tp.c - Layer Two Tunneling Protocol printer routines
print-lane.c - ATM LANE printer routines
-print-lcp.c - PPP Link Control Protocol printer routines
print-llc.c - IEEE 802.2 LLC printer routines
print-lwres.c - Lightweight Resolver protocol printer routines
print-mobile.c - IPv4 mobility printer routines
diff --git a/Makefile.in b/Makefile.in
index 4cd3e908..95634766 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -17,7 +17,7 @@
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.265 2002-07-11 09:17:22 guy Exp $ (LBL)
+# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.266 2002-09-05 21:25:35 guy Exp $ (LBL)
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
@@ -74,12 +74,12 @@ CSRC = addrtoname.c gmt2local.c machdep.c parsenfsfh.c \
print-fddi.c print-fr.c print-gre.c print-hsrp.c \
print-icmp.c print-igmp.c print-igrp.c print-ip.c \
print-ipcomp.c print-ipx.c print-isakmp.c print-isoclns.c \
- print-krb.c print-l2tp.c print-lane.c print-lcp.c \
- print-llc.c print-lwres.c print-msdp.c print-mobile.c \
- print-mpls.c print-nfs.c print-ntp.c print-null.c \
- print-ospf.c print-pflog.c print-pim.c print-ppp.c \
- print-pppoe.c print-pptp.c print-radius.c print-raw.c \
- print-rip.c print-rx.c print-sctp.c print-sl.c print-sll.c \
+ print-krb.c print-l2tp.c print-lane.c print-llc.c \
+ print-lwres.c print-msdp.c print-mobile.c print-mpls.c \
+ print-nfs.c print-ntp.c print-null.c print-ospf.c \
+ print-pflog.c print-pim.c print-ppp.c print-pppoe.c \
+ print-pptp.c print-radius.c print-raw.c print-rip.c \
+ print-rx.c print-sctp.c print-sl.c print-sll.c \
print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \
print-tcp.c print-telnet.c print-tftp.c print-timed.c \
print-token.c print-udp.c print-vjc.c print-vrrp.c \
diff --git a/aclocal.m4 b/aclocal.m4
index 641b737a..48d5c37e 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.88 2002-09-05 00:00:07 guy Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.89 2002-09-05 21:25:35 guy Exp $ (LBL)
dnl
dnl Copyright (c) 1995, 1996, 1997, 1998
dnl The Regents of the University of California. All rights reserved.
@@ -621,7 +621,7 @@ AC_DEFUN(AC_LBL_DEVEL,
fi
$1="$$1 -Wall"
if test $ac_cv_lbl_gcc_vers -gt 1 ; then
- $1="$$1 -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -W -Wno-unused"
+ $1="$$1 -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -W"
fi
fi
else
diff --git a/configure b/configure
index 47057dd8..005bc8a0 100755
--- a/configure
+++ b/configure
@@ -4405,7 +4405,7 @@ rm -f os-proto.h
fi
V_CCOPT="$V_CCOPT -Wall"
if test $ac_cv_lbl_gcc_vers -gt 1 ; then
- V_CCOPT="$V_CCOPT -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -W -Wno-unused"
+ V_CCOPT="$V_CCOPT -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -W"
fi
fi
else
diff --git a/interface.h b/interface.h
index 9620ec21..ea7c5593 100644
--- a/interface.h
+++ b/interface.h
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.193 2002-08-01 08:52:57 risso Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.194 2002-09-05 21:25:36 guy Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
@@ -32,6 +32,8 @@
#define __attribute__(x)
#endif
+#define _U_ __attribute__((unused))
+
/* snprintf et al */
#include <stdarg.h>
@@ -196,8 +198,8 @@ extern void hex_print(const u_char *, u_int);
extern int ether_encap_print(u_short, const u_char *, u_int, u_int, u_short *);
extern int llc_print(const u_char *, u_int, u_int, const u_char *,
const u_char *, u_short *);
-extern int snap_print(const u_char *, u_int, u_int, const u_char *,
- const u_char *, u_short *, u_int32_t, u_short, u_int);
+extern int snap_print(const u_char *, u_int, u_int, u_short *, u_int32_t,
+ u_short, u_int);
extern void aarp_print(const u_char *, u_int);
extern void arp_print(const u_char *, u_int, u_int);
extern void atalk_print(const u_char *, u_int);
@@ -205,15 +207,15 @@ extern void atm_print(u_int, u_int, u_int, const u_char *, u_int, u_int);
extern void atm_if_print(u_char *, const struct pcap_pkthdr *, const u_char *);
extern void bpfatm_if_print(u_char *, const struct pcap_pkthdr *, const u_char *);
extern void sunatm_if_print(u_char *, const struct pcap_pkthdr *, const u_char *);
-extern void bootp_print(const u_char *, u_int, u_short, u_short);
+extern void bootp_print(const u_char *, u_short, u_short);
extern void bgp_print(const u_char *, int);
extern void beep_print(const u_char *, u_int);
-extern void cnfp_print(const u_char *, u_int, const u_char *);
+extern void cnfp_print(const u_char *, const u_char *);
extern void decnet_print(const u_char *, u_int, u_int);
extern void default_print(const u_char *, u_int);
extern void default_print_unaligned(const u_char *, u_int);
extern void dvmrp_print(const u_char *, u_int);
-extern void egp_print(const u_char *, u_int, const u_char *);
+extern void egp_print(const u_char *);
extern void pflog_if_print(u_char *, const struct pcap_pkthdr *,
const u_char *);
extern void arcnet_if_print(u_char *, const struct pcap_pkthdr *,
@@ -238,7 +240,7 @@ extern void ipN_print(const u_char *, u_int);
extern void ipx_print(const u_char *, u_int);
extern void isoclns_print(const u_char *, u_int, u_int, const u_char *,
const u_char *);
-extern void krb_print(const u_char *, u_int);
+extern void krb_print(const u_char *);
extern void llap_print(const u_char *, u_int);
extern void ltalk_if_print(u_char *, const struct pcap_pkthdr *,
const u_char *);
@@ -262,7 +264,7 @@ extern void ppp_bsdos_if_print(u_char *, const struct pcap_pkthdr *,
const u_char *);
extern void pppoe_if_print(u_char *, const struct pcap_pkthdr *,
const u_char *);
-extern int vjc_print(register const char *, register u_int, u_short);
+extern int vjc_print(register const char *, u_short);
extern void raw_if_print(u_char *, const struct pcap_pkthdr *, const u_char *);
extern void rip_print(const u_char *, u_int);
extern void sl_if_print(u_char *, const struct pcap_pkthdr *, const u_char *);
@@ -279,13 +281,13 @@ extern void snmp_print(const u_char *, u_int);
extern void sunrpcrequest_print(const u_char *, u_int, const u_char *);
extern void tcp_print(const u_char *, u_int, const u_char *, int);
extern void tftp_print(const u_char *, u_int);
-extern void timed_print(const u_char *, u_int);
+extern void timed_print(const u_char *);
extern void udp_print(const u_char *, u_int, const u_char *, int);
extern void wb_print(const void *, u_int);
-extern int ah_print(register const u_char *, register const u_char *);
+extern int ah_print(register const u_char *);
extern int esp_print(register const u_char *, register const u_char *, int *, int *);
extern void isakmp_print(const u_char *, u_int, const u_char *);
-extern int ipcomp_print(register const u_char *, register const u_char *, int *);
+extern int ipcomp_print(register const u_char *, int *);
extern void rx_print(register const u_char *, int, int, int, u_char *);
extern void netbeui_print(u_short, const u_char *, int);
extern void ipx_netbios_print(const u_char *, u_int);
@@ -295,14 +297,12 @@ extern void nbt_udp138_print(const u_char *, int);
extern char *smb_errstr(int, int);
extern void print_data(const unsigned char *, int);
extern void l2tp_print(const u_char *, u_int);
-extern void lcp_print(const u_char *, u_int);
extern void vrrp_print(const u_char *, u_int, int);
-extern void cdp_print(const u_char *, u_int, u_int, const u_char *,
- const u_char *);
+extern void cdp_print(const u_char *, u_int, u_int);
extern void stp_print(const u_char *, u_int);
extern void radius_print(const u_char *, u_int);
extern void lwres_print(const u_char *, u_int);
-extern void pptp_print(const u_char *, u_int);
+extern void pptp_print(const u_char *);
extern void sctp_print(const u_char *, const u_char *, u_int);
extern void mpls_print(const u_char *, u_int);
extern void zephyr_print(const u_char *, int);
diff --git a/machdep.c b/machdep.c
index d789c283..fdfcac59 100644
--- a/machdep.c
+++ b/machdep.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/machdep.c,v 1.9 2002-08-06 04:40:11 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/machdep.c,v 1.10 2002-09-05 21:25:36 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -36,15 +36,17 @@ static const char rcsid[] =
*/
#include <tcpdump-stdinc.h>
+#ifndef HAVE___ATTRIBUTE__
+#define __attribute__(x)
+#endif /* HAVE___ATTRIBUTE__ */
+
+#define _U_ __attribute__((unused))
+
#ifdef __osf__
#include <sys/sysinfo.h>
#include <sys/proc.h>
#if !defined(HAVE_SNPRINTF)
-#ifndef HAVE___ATTRIBUTE__
-#define __attribute__(x)
-#endif /* HAVE___ATTRIBUTE__ */
-
int snprintf(char *, size_t, const char *, ...)
__attribute__((format(printf, 3, 4)));
#endif /* !defined(HAVE_SNPRINTF) */
@@ -53,7 +55,7 @@ int snprintf(char *, size_t, const char *, ...)
#include "machdep.h"
int
-abort_on_misalignment(char *ebuf, size_t ebufsiz)
+abort_on_misalignment(char *ebuf _U_, size_t ebufsiz _U_)
{
#ifdef __osf__
static int buf[2] = { SSIN_UACPROC, UAC_SIGBUS };
diff --git a/print-802_11.c b/print-802_11.c
index 2897a468..1c515394 100644
--- a/print-802_11.c
+++ b/print-802_11.c
@@ -22,7 +22,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.10 2002-09-05 00:00:09 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.11 2002-09-05 21:25:36 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -113,7 +113,7 @@ static const char *reason_text[] = {
NULL
};
-static int wep_print(const u_char *p,u_int length)
+static int wep_print(const u_char *p)
{
u_int32_t iv;
@@ -210,8 +210,7 @@ static int parse_elements(struct mgmt_body_t *pbody,const u_char *p,int offset)
* Print Handle functions for the management frame types
*********************************************************************************/
-static int handle_beacon(u_int16_t fc, const struct mgmt_header_t *pmh,
- const u_char *p)
+static int handle_beacon(u_int16_t fc, const u_char *p)
{
struct mgmt_body_t pbody;
int offset = 0;
@@ -242,8 +241,7 @@ static int handle_beacon(u_int16_t fc, const struct mgmt_header_t *pmh,
return 1;
}
-static int handle_assoc_request(u_int16_t fc, const struct mgmt_header_t *pmh,
- const u_char *p)
+static int handle_assoc_request(u_int16_t fc, const u_char *p)
{
struct mgmt_body_t pbody;
int offset = 0;
@@ -267,8 +265,7 @@ static int handle_assoc_request(u_int16_t fc, const struct mgmt_header_t *pmh,
return 1;
}
-static int handle_assoc_response(u_int16_t fc, const struct mgmt_header_t *pmh,
- const u_char *p)
+static int handle_assoc_response(u_int16_t fc, const u_char *p)
{
struct mgmt_body_t pbody;
int offset = 0;
@@ -296,8 +293,7 @@ static int handle_assoc_response(u_int16_t fc, const struct mgmt_header_t *pmh,
}
-static int handle_reassoc_request(u_int16_t fc, const struct mgmt_header_t *pmh,
- const u_char *p)
+static int handle_reassoc_request(u_int16_t fc, const u_char *p)
{
struct mgmt_body_t pbody;
int offset = 0;
@@ -323,15 +319,13 @@ static int handle_reassoc_request(u_int16_t fc, const struct mgmt_header_t *pmh,
return 1;
}
-static int handle_reassoc_response(u_int16_t fc, const struct mgmt_header_t *pmh,
- const u_char *p)
+static int handle_reassoc_response(u_int16_t fc, const u_char *p)
{
/* Same as a Association Reponse */
- return handle_assoc_response(fc,pmh,p);
+ return handle_assoc_response(fc, p);
}
-static int handle_probe_request(u_int16_t fc, const struct mgmt_header_t *pmh,
- const u_char *p)
+static int handle_probe_request(u_int16_t fc, const u_char *p)
{
struct mgmt_body_t pbody;
int offset = 0;
@@ -349,8 +343,7 @@ static int handle_probe_request(u_int16_t fc, const struct mgmt_header_t *pmh,
return 1;
}
-static int handle_probe_response(u_int16_t fc, const struct mgmt_header_t *pmh,
- const u_char *p)
+static int handle_probe_response(u_int16_t fc, const u_char *p)
{
struct mgmt_body_t pbody;
int offset = 0;
@@ -379,16 +372,14 @@ static int handle_probe_response(u_int16_t fc, const struct mgmt_header_t *pmh,
return 1;
}
-static int handle_atim(u_int16_t fc, const struct mgmt_header_t *pmh,
- const u_char *p)
+static int handle_atim(void)
{
/* the frame body for ATIM is null. */
printf("ATIM");
return 1;
}
-static int handle_disassoc(u_int16_t fc, const struct mgmt_header_t *pmh,
- const u_char *p)
+static int handle_disassoc(u_int16_t fc, const u_char *p)
{
struct mgmt_body_t pbody;
int offset = 0;
@@ -406,8 +397,7 @@ static int handle_disassoc(u_int16_t fc, const struct mgmt_header_t *pmh,
return 1;
}
-static int handle_auth(u_int16_t fc, const struct mgmt_header_t *pmh,
- const u_char *p)
+static int handle_auth(u_int16_t fc, const u_char *p)
{
struct mgmt_body_t pbody;
int offset = 0;
@@ -478,36 +468,36 @@ static int handle_deauth(u_int16_t fc, const struct mgmt_header_t *pmh,
static int mgmt_body_print(u_int16_t fc, const struct mgmt_header_t *pmh,
- const u_char *p, u_int length)
+ const u_char *p)
{
switch (FC_SUBTYPE(fc)) {
case ST_ASSOC_REQUEST:
- return (handle_assoc_request(fc, pmh, p));
+ return (handle_assoc_request(fc, p));
case ST_ASSOC_RESPONSE:
- return (handle_assoc_response(fc, pmh, p));
+ return (handle_assoc_response(fc, p));
case ST_REASSOC_REQUEST:
- return (handle_reassoc_request(fc, pmh, p));
+ return (handle_reassoc_request(fc, p));
case ST_REASSOC_RESPONSE:
- return (handle_reassoc_response(fc, pmh, p));
+ return (handle_reassoc_response(fc, p));
case ST_PROBE_REQUEST:
- return (handle_probe_request(fc, pmh, p));
+ return (handle_probe_request(fc, p));
case ST_PROBE_RESPONSE:
- return (handle_probe_response(fc, pmh, p));
+ return (handle_probe_response(fc, p));
case ST_BEACON:
- return (handle_beacon(fc, pmh, p));
+ return (handle_beacon(fc, p));
case ST_ATIM:
- return (handle_atim(fc, pmh, p));
+ return (handle_atim());
case ST_DISASSOC:
- return (handle_disassoc(fc, pmh, p));
+ return (handle_disassoc(fc, p));
case ST_AUTH:
if (!TTEST2(*p, 3))
return 0;
if ((p[0] == 0 ) && (p[1] == 0) && (p[2] == 0)) {
printf("Authentication (Shared-Key)-3 ");
- return (wep_print(p, length));
+ return (wep_print(p));
}
else
- return (handle_auth(fc, pmh, p));
+ return (handle_auth(fc, p));
case ST_DEAUTH:
return (handle_deauth(fc, pmh, p));
break;
@@ -523,7 +513,7 @@ static int mgmt_body_print(u_int16_t fc, const struct mgmt_header_t *pmh,
* Handles printing all the control frame types
*********************************************************************************/
-static int ctrl_body_print(u_int16_t fc,const u_char *p, u_int length)
+static int ctrl_body_print(u_int16_t fc, const u_char *p)
{
switch (FC_SUBTYPE(fc)) {
case CTRL_PS_POLL:
@@ -599,7 +589,7 @@ static int ctrl_body_print(u_int16_t fc,const u_char *p, u_int length)
* 1 | 1 | RA | TA | DA | SA
*/
-static void data_header_print(u_int16_t fc,const u_char *p, u_int length)
+static void data_header_print(u_int16_t fc, const u_char *p)
{
#define ADDR1 (p + 4)
#define ADDR2 (p + 10)
@@ -633,7 +623,7 @@ static void data_header_print(u_int16_t fc,const u_char *p, u_int length)
}
-static void mgmt_header_print(const u_char *p, u_int length)
+static void mgmt_header_print(const u_char *p)
{
const struct mgmt_header_t *hp = (const struct mgmt_header_t *) p;
@@ -642,7 +632,7 @@ static void mgmt_header_print(const u_char *p, u_int length)
etheraddr_string((hp)->sa));
}
-static void ctrl_header_print(u_int16_t fc,const u_char *p, u_int length)
+static void ctrl_header_print(u_int16_t fc, const u_char *p)
{
switch (FC_SUBTYPE(fc)) {
case CTRL_PS_POLL:
@@ -730,19 +720,19 @@ static int GetHeaderLength(u_int16_t fc)
* Print the 802.11 MAC header
*/
static inline void
-ieee_802_11_print(u_int16_t fc, const u_char *p, u_int length)
+ieee_802_11_print(u_int16_t fc, const u_char *p)
{
switch (FC_TYPE(fc)) {
case T_MGMT:
- mgmt_header_print(p, length);
+ mgmt_header_print(p);
break;
case T_CTRL:
- ctrl_header_print(fc, p, length);
+ ctrl_header_print(fc, p);
break;
case T_DATA:
- data_header_print(fc, p, length);
+ data_header_print(fc, p);
break;
default:
@@ -753,13 +743,13 @@ ieee_802_11_print(u_int16_t fc, const u_char *p, u_int length)
}
/*
- * This is the top level routine of the printer. 'p' is the points
- * to the ether header of the packet, 'h->tv' is the timestamp,
+ * This is the top level routine of the printer. 'p' points
+ * to the 802.11 header of the packet, 'h->ts' is the timestamp,
* 'h->length' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
void
-ieee802_11_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+ieee802_11_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
u_int length = h->len;
@@ -775,10 +765,16 @@ ieee802_11_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
goto out;
}
- fc=EXTRACT_LE_16BITS(p);
+ fc = EXTRACT_LE_16BITS(p);
+ HEADER_LENGTH = GetHeaderLength(fc);
+
+ if (caplen < HEADER_LENGTH) {
+ printf("[|802.11]");
+ goto out;
+ }
if (eflag)
- ieee_802_11_print(fc, p, length);
+ ieee_802_11_print(fc, p);
/*
* Some printers want to get back at the ethernet addresses,
@@ -788,8 +784,6 @@ ieee802_11_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
packetp = p;
snapend = p + caplen;
- HEADER_LENGTH=GetHeaderLength(fc);
-
length -= HEADER_LENGTH;
caplen -= HEADER_LENGTH;
p += HEADER_LENGTH;
@@ -797,15 +791,14 @@ ieee802_11_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
switch (FC_TYPE(fc)) {
case T_MGMT:
if (!mgmt_body_print(fc, (const struct mgmt_header_t *)packetp,
- p, length)) {
+ p)) {
printf("[|802.11]");
goto out;
}
break;
case T_CTRL:
- if (!ctrl_body_print(fc, p - HEADER_LENGTH,
- length + HEADER_LENGTH)) {
+ if (!ctrl_body_print(fc, p - HEADER_LENGTH)) {
printf("[|802.11]");
goto out;
}
@@ -814,7 +807,7 @@ ieee802_11_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
case T_DATA:
/* There may be a problem w/ AP not having this bit set */
if (FC_WEP(fc)) {
- if (!wep_print(p,length)) {
+ if (!wep_print(p)) {
printf("[|802.11]");
goto out;
}
@@ -826,8 +819,7 @@ ieee802_11_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
* handle intelligently
*/
if (!eflag)
- ieee_802_11_print(fc, p - HEADER_LENGTH,
- length + HEADER_LENGTH);
+ ieee_802_11_print(fc, p - HEADER_LENGTH);
if (extracted_ethertype) {
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
diff --git a/print-ah.c b/print-ah.c
index 27616c59..aab57578 100644
--- a/print-ah.c
+++ b/print-ah.c
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.17 2002-08-01 08:52:59 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.18 2002-09-05 21:25:36 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -40,7 +40,7 @@ static const char rcsid[] =
#include "addrtoname.h"
int
-ah_print(register const u_char *bp, register const u_char *bp2)
+ah_print(register const u_char *bp)
{
register const struct ah *ah;
register const u_char *ep;
diff --git a/print-arcnet.c b/print-arcnet.c
index c8447a5a..56f7f1e3 100644
--- a/print-arcnet.c
+++ b/print-arcnet.c
@@ -22,7 +22,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-arcnet.c,v 1.9 2002-08-01 08:52:59 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-arcnet.c,v 1.10 2002-09-05 21:25:37 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -101,13 +101,13 @@ arcnet_print(const u_char *bp, u_int length, int phds, int flag, u_int seqid)
}
/*
- * This is the top level routine of the printer. 'p' is the points
- * to the ether 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 ARCNET header of the packet, 'h->ts' is the timestamp,
+ * 'h->length' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
void
-arcnet_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+arcnet_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
u_int length = h->len;
diff --git a/print-atalk.c b/print-atalk.c
index 02713752..8a5dbef5 100644
--- a/print-atalk.c
+++ b/print-atalk.c
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.73 2002-08-06 04:42:04 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.74 2002-09-05 21:25:37 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -82,7 +82,7 @@ static const char *ddpskt_string(int);
* Print LLAP packets received on a physical LocalTalk interface.
*/
void
-ltalk_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+ltalk_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
snapend = p + h->caplen;
++infodelay;
diff --git a/print-atm.c b/print-atm.c
index 6cf31475..19afb943 100644
--- a/print-atm.c
+++ b/print-atm.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.25 2002-08-01 08:53:01 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.26 2002-09-05 21:25:37 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -84,13 +84,13 @@ atm_llc_print(const u_char *p, int length, int caplen)
}
/*
- * This is the top level routine of the printer. 'p' is the points
- * to the LLC/SNAP 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 LLC/SNAP header of the packet, 'h->ts' is the timestamp,
+ * 'h->length' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
void
-atm_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+atm_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
u_int length = h->len;
diff --git a/print-bootp.c b/print-bootp.c
index a44ef804..daa69aad 100644
--- a/print-bootp.c
+++ b/print-bootp.c
@@ -22,7 +22,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.65 2002-08-06 04:42:05 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.66 2002-09-05 21:25:38 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -49,8 +49,7 @@ static char tstr[] = " [|bootp]";
* Print bootp requests
*/
void
-bootp_print(register const u_char *cp, u_int length,
- u_short sport, u_short dport)
+bootp_print(register const u_char *cp, u_short sport, u_short dport)
{
register const struct bootp *bp;
static const u_char vm_cmu[4] = VM_CMU;
diff --git a/print-cdp.c b/print-cdp.c
index a48eb5dd..72f9ea85 100644
--- a/print-cdp.c
+++ b/print-cdp.c
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-cdp.c,v 1.16 2002-08-07 05:21:07 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-cdp.c,v 1.17 2002-09-05 21:25:38 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -47,8 +47,7 @@ static int cdp_print_prefixes(const u_char *, int);
static unsigned long cdp_get_number(const u_char *, int);
void
-cdp_print(const u_char *p, u_int length, u_int caplen,
- const u_char *esrc, const u_char *edst)
+cdp_print(const u_char *p, u_int length, u_int caplen)
{
u_int i;
int type, len;
diff --git a/print-chdlc.c b/print-chdlc.c
index a23b3d51..7695b759 100644
--- a/print-chdlc.c
+++ b/print-chdlc.c
@@ -22,7 +22,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.14 2002-08-01 08:53:03 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.15 2002-09-05 21:25:38 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -45,7 +45,7 @@ static void chdlc_slarp_print(const u_char *, u_int);
/* Standard CHDLC printer */
void
-chdlc_if_print(u_char *user, const struct pcap_pkthdr *h,
+chdlc_if_print(u_char *user _U_, const struct pcap_pkthdr *h,
register const u_char *p)
{
register u_int length = h->len;
diff --git a/print-cip.c b/print-cip.c
index ff391808..e986e52c 100644
--- a/print-cip.c
+++ b/print-cip.c
@@ -22,7 +22,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.18 2002-08-01 08:53:03 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.19 2002-09-05 21:25:38 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -52,7 +52,7 @@ static unsigned char rfcllc[] = {
0x00 };
static inline void
-cip_print(register const u_char *bp, int length)
+cip_print(int length)
{
/*
* There is no MAC-layer header, so just print the length.
@@ -61,13 +61,13 @@ cip_print(register const u_char *bp, int length)
}
/*
- * This is the top level routine of the printer. 'p' is the points
- * to the raw 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 LLC/SNAP or raw header of the packet, 'h->ts' is the timestamp,
+ * 'h->length' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
void
-cip_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+cip_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
u_int length = h->len;
@@ -82,7 +82,7 @@ cip_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
}
if (eflag)
- cip_print(p, length);
+ cip_print(length);
/*
* Some printers want to get back at the ethernet addresses,
@@ -100,7 +100,7 @@ cip_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
&extracted_ethertype) == 0) {
/* ether_type not known, print raw packet */
if (!eflag)
- cip_print(p, length);
+ cip_print(length);
if (extracted_ethertype) {
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
diff --git a/print-cnfp.c b/print-cnfp.c
index 02cef037..5981557c 100644
--- a/print-cnfp.c
+++ b/print-cnfp.c
@@ -34,7 +34,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-cnfp.c,v 1.10 2002-09-05 00:00:10 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-cnfp.c,v 1.11 2002-09-05 21:25:39 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -78,7 +78,7 @@ struct nfrec {
};
void
-cnfp_print(const u_char *cp, u_int len, const u_char *bp)
+cnfp_print(const u_char *cp, const u_char *bp)
{
register const struct nfhdr *nh;
register const struct nfrec *nr;
diff --git a/print-decnet.c b/print-decnet.c
index 960669d2..da5a0ca1 100644
--- a/print-decnet.c
+++ b/print-decnet.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-decnet.c,v 1.35 2002-08-01 08:53:04 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-decnet.c,v 1.36 2002-09-05 21:25:39 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -340,13 +340,13 @@ print_i_info(int info)
}
static void
-print_elist(const char *elp, u_int len)
+print_elist(const char *elp _U_, u_int len _U_)
{
/* Not enough examples available for me to debug this */
}
static void
-print_nsp(const u_char *nspp, u_int nsplen)
+print_nsp(const u_char *nspp, u_int nsplen _U_)
{
const struct nsphdr *nsphp = (struct nsphdr *)nspp;
int dst, src, flags;
diff --git a/print-domain.c b/print-domain.c
index ecb06eb3..724c6497 100644
--- a/print-domain.c
+++ b/print-domain.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.80 2002-09-05 00:00:11 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.81 2002-09-05 21:25:39 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -54,7 +54,7 @@ static const char *ns_resp[] = {
/* skip over a domain name */
static const u_char *
-ns_nskip(register const u_char *cp, register const u_char *bp)
+ns_nskip(register const u_char *cp)
{
register u_char i;
@@ -227,7 +227,7 @@ ns_nprint(register const u_char *cp, register const u_char *bp)
/* print a <character-string> */
static const u_char *
-ns_cprint(register const u_char *cp, register const u_char *bp)
+ns_cprint(register const u_char *cp)
{
register u_int i;
@@ -308,7 +308,7 @@ ns_qprint(register const u_char *cp, register const u_char *bp)
register const u_char *np = cp;
register u_int i;
- cp = ns_nskip(cp, bp);
+ cp = ns_nskip(cp);
if (cp == NULL || !TTEST2(*cp, 4))
return(NULL);
@@ -340,7 +340,7 @@ ns_rprint(register const u_char *cp, register const u_char *bp)
if ((cp = ns_nprint(cp, bp)) == NULL)
return NULL;
} else
- cp = ns_nskip(cp, bp);
+ cp = ns_nskip(cp);
if (cp == NULL || !TTEST2(*cp, 10))
return (snapend);
@@ -416,7 +416,7 @@ ns_rprint(register const u_char *cp, register const u_char *bp)
case T_TXT:
putchar(' ');
- (void)ns_cprint(cp, bp);
+ (void)ns_cprint(cp);
break;
#ifdef INET6
@@ -538,7 +538,7 @@ ns_print(register const u_char *bp, u_int length)
if ((cp = ns_qprint(cp, bp)) == NULL)
goto trunc;
} else {
- if ((cp = ns_nskip(cp, bp)) == NULL)
+ if ((cp = ns_nskip(cp)) == NULL)
goto trunc;
cp += 4; /* skip QTYPE and QCLASS */
}
diff --git a/print-dvmrp.c b/print-dvmrp.c
index fcd1a31a..0c72264a 100644
--- a/print-dvmrp.c
+++ b/print-dvmrp.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-dvmrp.c,v 1.23 2002-09-05 00:00:11 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-dvmrp.c,v 1.24 2002-09-05 21:25:40 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -66,9 +66,9 @@ static void print_probe(const u_char *, const u_char *, u_int);
static void print_report(const u_char *, const u_char *, u_int);
static void print_neighbors(const u_char *, const u_char *, u_int);
static void print_neighbors2(const u_char *, const u_char *, u_int);
-static void print_prune(const u_char *, const u_char *, u_int);
-static void print_graft(const u_char *, const u_char *, u_int);
-static void print_graft_ack(const u_char *, const u_char *, u_int);
+static void print_prune(const u_char *);
+static void print_graft(const u_char *);
+static void print_graft_ack(const u_char *);
static u_int32_t target_level;
@@ -130,17 +130,17 @@ dvmrp_print(register const u_char *bp, register u_int len)
case DVMRP_PRUNE:
printf(" Prune");
- print_prune(bp, ep, len);
+ print_prune(bp);
break;
case DVMRP_GRAFT:
printf(" Graft");
- print_graft(bp, ep, len);
+ print_graft(bp);
break;
case DVMRP_GRAFT_ACK:
printf(" Graft-ACK");
- print_graft_ack(bp, ep, len);
+ print_graft_ack(bp);
break;
default:
@@ -313,8 +313,7 @@ trunc:
}
static void
-print_prune(register const u_char *bp, register const u_char *ep,
- register u_int len)
+print_prune(register const u_char *bp)
{
TCHECK2(bp[0], 12);
printf(" src %s grp %s", ipaddr_string(bp), ipaddr_string(bp + 4));
@@ -327,8 +326,7 @@ trunc:
}
static void
-print_graft(register const u_char *bp, register const u_char *ep,
- register u_int len)
+print_graft(register const u_char *bp)
{
TCHECK2(bp[0], 8);
printf(" src %s grp %s", ipaddr_string(bp), ipaddr_string(bp + 4));
@@ -338,8 +336,7 @@ trunc:
}
static void
-print_graft_ack(register const u_char *bp, register const u_char *ep,
- register u_int len)
+print_graft_ack(register const u_char *bp)
{
TCHECK2(bp[0], 8);
printf(" src %s grp %s", ipaddr_string(bp), ipaddr_string(bp + 4));
diff --git a/print-egp.c b/print-egp.c
index 06fc4dae..5ad20f02 100644
--- a/print-egp.c
+++ b/print-egp.c
@@ -20,7 +20,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.31 2002-09-05 00:00:12 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.32 2002-09-05 21:25:40 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -134,7 +134,7 @@ const char *egp_reasons[] = {
};
static void
-egpnrprint(register const struct egp_packet *egp, register u_int length)
+egpnrprint(register const struct egp_packet *egp)
{
register const u_char *cp;
u_int32_t addr;
@@ -213,17 +213,18 @@ trunc:
}
void
-egp_print(register const u_char *bp, register u_int length,
- register const u_char *bp2)
+egp_print(register const u_char *bp)
{
register const struct egp_packet *egp;
- register const struct ip *ip;
register int status;
register int code;
register int type;
egp = (struct egp_packet *)bp;
- ip = (struct ip *)bp2;
+ if (!TTEST(*egp)) {
+ printf("[|egp]");
+ return;
+ }
(void)printf("egp: ");
if (egp->egp_version != EGP_VERSION) {
@@ -327,7 +328,7 @@ egp_print(register const u_char *bp, register u_int length,
egp->egp_intgw,
egp->egp_extgw);
if (vflag)
- egpnrprint(egp, length);
+ egpnrprint(egp);
break;
case EGPT_ERROR:
diff --git a/print-ether.c b/print-ether.c
index ab4e7d50..5909f4c6 100644
--- a/print-ether.c
+++ b/print-ether.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.72 2002-08-01 08:53:06 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.73 2002-09-05 21:25:40 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -119,13 +119,13 @@ ether_print(const u_char *p, u_int length, u_int caplen)
}
/*
- * This is the top level routine of the printer. 'p' is the points
- * to the ether header of the packet, 'h->tv' is the timestamp,
+ * This is the top level routine of the printer. 'p' points
+ * to the ether header of the packet, 'h->ts' is the timestamp,
* 'h->length' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
void
-ether_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+ether_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
u_int length = h->len;
diff --git a/print-fddi.c b/print-fddi.c
index d493c9f7..c97134a6 100644
--- a/print-fddi.c
+++ b/print-fddi.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.57 2002-08-01 08:53:06 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.58 2002-09-05 21:25:40 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -233,7 +233,7 @@ fddi_hdr_print(register const struct fddi_header *fddip, register u_int length,
}
static inline void
-fddi_smt_print(const u_char *p, u_int length)
+fddi_smt_print(const u_char *p _U_, u_int length _U_)
{
printf("<SMT printer not yet implemented>");
}
@@ -308,13 +308,13 @@ fddi_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 FDDI 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 FDDI header of the packet, 'h->ts' is the timestamp,
+ * 'h->length' 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, const struct pcap_pkthdr *h,
+fddi_if_print(u_char *pcap _U_, const struct pcap_pkthdr *h,
register const u_char *p)
{
u_int caplen = h->caplen;
diff --git a/print-fr.c b/print-fr.c
index 87fa4b2e..a2271d67 100644
--- a/print-fr.c
+++ b/print-fr.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#)$Header: /tcpdump/master/tcpdump/print-fr.c,v 1.5 2002-09-05 00:00:12 guy Exp $ (LBL)";
+ "@(#)$Header: /tcpdump/master/tcpdump/print-fr.c,v 1.6 2002-09-05 21:25:41 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -212,7 +212,7 @@ fr_hdr_print(const u_char *p, int length)
}
void
-fr_if_print(u_char *user, const struct pcap_pkthdr *h,
+fr_if_print(u_char *user _U_, const struct pcap_pkthdr *h,
register const u_char *p)
{
register u_int length = h->len;
@@ -263,8 +263,8 @@ fr_if_print(u_char *user, const struct pcap_pkthdr *h,
orgcode = EXTRACT_24BITS(p);
et = EXTRACT_16BITS(p + 3);
if (snap_print((const u_char *)(p + 5), length - 5,
- caplen - 5, NULL, NULL,
- &extracted_ethertype, orgcode, et, 0) == 0) {
+ caplen - 5, &extracted_ethertype, orgcode, et,
+ 0) == 0) {
/* ether_type not known, print raw packet */
if (!eflag)
fr_hdr_print(p - layer2_len, length + layer2_len);
diff --git a/print-igmp.c b/print-igmp.c
index 76d176cc..9c17f62a 100644
--- a/print-igmp.c
+++ b/print-igmp.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-igmp.c,v 1.8 2002-08-01 08:53:09 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-igmp.c,v 1.9 2002-09-05 21:25:41 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -111,12 +111,21 @@ print_mtrace(register const u_char *bp, register u_int len)
{
register const struct tr_query *tr = (const struct tr_query *)(bp + 8);
+ TCHECK(*tr);
+ if (len < 8 + sizeof (struct tr_query)) {
+ (void)printf(" [invalid len %d]", len);
+ return;
+ }
printf("mtrace %lu: %s to %s reply-to %s",
(u_long)TR_GETQID(ntohl(tr->tr_rttlqid)),
ipaddr_string(&tr->tr_src), ipaddr_string(&tr->tr_dst),
ipaddr_string(&tr->tr_raddr));
if (IN_CLASSD(ntohl(tr->tr_raddr)))
printf(" with-ttl %d", TR_GETTTL(ntohl(tr->tr_rttlqid)));
+ return;
+trunc:
+ (void)printf("[|igmp]");
+ return;
}
static void
@@ -124,12 +133,21 @@ print_mresp(register const u_char *bp, register u_int len)
{
register const struct tr_query *tr = (const struct tr_query *)(bp + 8);
+ TCHECK(*tr);
+ if (len < 8 + sizeof (struct tr_query)) {
+ (void)printf(" [invalid len %d]", len);
+ return;
+ }
printf("mresp %lu: %s to %s reply-to %s",
(u_long)TR_GETQID(ntohl(tr->tr_rttlqid)),
ipaddr_string(&tr->tr_src), ipaddr_string(&tr->tr_dst),
ipaddr_string(&tr->tr_raddr));
if (IN_CLASSD(ntohl(tr->tr_raddr)))
printf(" with-ttl %d", TR_GETTTL(ntohl(tr->tr_rttlqid)));
+ return;
+trunc:
+ (void)printf("[|igmp]");
+ return;
}
static void
diff --git a/print-ip.c b/print-ip.c
index 4a3c0af2..a94ae30e 100644
--- a/print-ip.c
+++ b/print-ip.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.112 2002-09-05 00:00:13 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.113 2002-09-05 21:25:41 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -450,7 +450,7 @@ again:
#endif
case IPPROTO_AH:
nh = *cp;
- advance = ah_print(cp, (const u_char *)ip);
+ advance = ah_print(cp);
cp += advance;
len -= advance;
goto again;
@@ -476,7 +476,7 @@ again:
case IPPROTO_IPCOMP:
{
int enh;
- advance = ipcomp_print(cp, (const u_char *)ip, &enh);
+ advance = ipcomp_print(cp, &enh);
cp += advance;
len -= advance;
if (enh < 0)
@@ -513,7 +513,7 @@ again:
break;
case IPPROTO_EGP:
- egp_print(cp, len, (const u_char *)ip);
+ egp_print(cp);
break;
#ifndef IPPROTO_OSPF
diff --git a/print-ip6.c b/print-ip6.c
index e58b3f9c..d30b5b28 100644
--- a/print-ip6.c
+++ b/print-ip6.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.25 2002-08-02 04:10:14 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.26 2002-09-05 21:25:42 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -142,7 +142,7 @@ ip6_print(register const u_char *bp, register u_int length)
icmp6_print(cp, (const u_char *)ip6);
goto end;
case IPPROTO_AH:
- advance = ah_print(cp, (const u_char *)ip6);
+ advance = ah_print(cp);
nh = *cp;
break;
case IPPROTO_ESP:
@@ -161,7 +161,7 @@ ip6_print(register const u_char *bp, register u_int length)
case IPPROTO_IPCOMP:
{
int enh;
- advance = ipcomp_print(cp, (const u_char *)ip6, &enh);
+ advance = ipcomp_print(cp, &enh);
if (enh < 0)
goto end;
nh = enh & 0xff;
diff --git a/print-ipcomp.c b/print-ipcomp.c
index 0d820606..2ee01183 100644
--- a/print-ipcomp.c
+++ b/print-ipcomp.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ipcomp.c,v 1.14 2002-08-01 08:53:11 risso Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ipcomp.c,v 1.15 2002-09-05 21:25:42 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -47,7 +47,7 @@ struct ipcomp {
#include "addrtoname.h"
int
-ipcomp_print(register const u_char *bp, register const u_char *bp2, int *nhdr)
+ipcomp_print(register const u_char *bp, int *nhdr)
{
register const struct ipcomp *ipcomp;
register const u_char *ep;
diff --git a/print-isakmp.c b/print-isakmp.c
index 106d3479..43e86fb0 100644
--- a/print-isakmp.c
+++ b/print-isakmp.c
@@ -30,7 +30,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.34 2002-09-05 00:43:21 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.35 2002-09-05 21:25:42 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -411,7 +411,7 @@ isakmp_attr_print(const u_char *p, const u_char *ep)
static const u_char *
isakmp_sa_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
- u_int32_t doi0, u_int32_t proto0, int depth)
+ u_int32_t doi0 _U_, u_int32_t proto0, int depth)
{
const struct isakmp_pl_sa *p;
struct isakmp_pl_sa sa;
@@ -464,7 +464,7 @@ isakmp_sa_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
static const u_char *
isakmp_p_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
- u_int32_t doi0, u_int32_t proto0, int depth)
+ u_int32_t doi0, u_int32_t proto0 _U_, int depth)
{
const struct isakmp_pl_p *p;
struct isakmp_pl_p prop;
@@ -546,8 +546,9 @@ const struct attrmap oakley_t_map[] = {
};
static const u_char *
-isakmp_t_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
- u_int32_t doi, u_int32_t proto, int depth)
+isakmp_t_print(const struct isakmp_gen *ext, const u_char *ep,
+ u_int32_t phase _U_, u_int32_t doi _U_, u_int32_t proto,
+ int depth _U_)
{
const struct isakmp_pl_t *p;
struct isakmp_pl_t t;
@@ -609,8 +610,9 @@ isakmp_t_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
}
static const u_char *
-isakmp_ke_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
- u_int32_t doi, u_int32_t proto, int depth)
+isakmp_ke_print(const struct isakmp_gen *ext, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_, u_int32_t proto _U_,
+ int depth _U_)
{
struct isakmp_gen e;
@@ -626,8 +628,9 @@ isakmp_ke_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
}
static const u_char *
-isakmp_id_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
- u_int32_t doi, u_int32_t proto, int depth)
+isakmp_id_print(const struct isakmp_gen *ext, const u_char *ep _U_,
+ u_int32_t phase, u_int32_t doi _U_, u_int32_t proto _U_,
+ int depth _U_)
{
#define USE_IPSECDOI_IN_PHASE1 1
const struct isakmp_pl_id *p;
@@ -768,8 +771,9 @@ isakmp_id_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
}
static const u_char *
-isakmp_cert_print(const struct isakmp_gen *ext, const u_char *ep,
- u_int32_t phase, u_int32_t doi0, u_int32_t proto0, int depth)
+isakmp_cert_print(const struct isakmp_gen *ext, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi0 _U_, u_int32_t proto0 _U_,
+ int depth _U_)
{
const struct isakmp_pl_cert *p;
struct isakmp_pl_cert cert;
@@ -793,8 +797,9 @@ isakmp_cert_print(const struct isakmp_gen *ext, const u_char *ep,
}
static const u_char *
-isakmp_cr_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
- u_int32_t doi0, u_int32_t proto0, int depth)
+isakmp_cr_print(const struct isakmp_gen *ext, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi0 _U_, u_int32_t proto0 _U_,
+ int depth _U_)
{
const struct isakmp_pl_cert *p;
struct isakmp_pl_cert cert;
@@ -818,8 +823,9 @@ isakmp_cr_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
}
static const u_char *
-isakmp_hash_print(const struct isakmp_gen *ext, const u_char *ep,
- u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
+isakmp_hash_print(const struct isakmp_gen *ext, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_, u_int32_t proto _U_,
+ int depth _U_)
{
struct isakmp_gen e;
@@ -835,8 +841,9 @@ isakmp_hash_print(const struct isakmp_gen *ext, const u_char *ep,
}
static const u_char *
-isakmp_sig_print(const struct isakmp_gen *ext, const u_char *ep,
- u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
+isakmp_sig_print(const struct isakmp_gen *ext, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_, u_int32_t proto _U_,
+ int depth _U_)
{
struct isakmp_gen e;
@@ -852,8 +859,9 @@ isakmp_sig_print(const struct isakmp_gen *ext, const u_char *ep,
}
static const u_char *
-isakmp_nonce_print(const struct isakmp_gen *ext, const u_char *ep,
- u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
+isakmp_nonce_print(const struct isakmp_gen *ext, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_, u_int32_t proto _U_,
+ int depth _U_)
{
struct isakmp_gen e;
@@ -870,7 +878,7 @@ isakmp_nonce_print(const struct isakmp_gen *ext, const u_char *ep,
static const u_char *
isakmp_n_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
- u_int32_t doi0, u_int32_t proto0, int depth)
+ u_int32_t doi0 _U_, u_int32_t proto0 _U_, int depth)
{
struct isakmp_pl_n *p, n;
const u_char *cp;
@@ -1002,8 +1010,9 @@ isakmp_n_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
}
static const u_char *
-isakmp_d_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
- u_int32_t doi0, u_int32_t proto0, int depth)
+isakmp_d_print(const struct isakmp_gen *ext, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi0 _U_, u_int32_t proto0 _U_,
+ int depth _U_)
{
const struct isakmp_pl_d *p;
struct isakmp_pl_d d;
@@ -1039,8 +1048,9 @@ isakmp_d_print(const struct isakmp_gen *ext, const u_char *ep, u_int32_t phase,
}
static const u_char *
-isakmp_vid_print(const struct isakmp_gen *ext, const u_char *ep,
- u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
+isakmp_vid_print(const struct isakmp_gen *ext, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_, u_int32_t proto _U_,
+ int depth _U_)
{
struct isakmp_gen e;
diff --git a/print-krb.c b/print-krb.c
index 0417ac83..382a4b60 100644
--- a/print-krb.c
+++ b/print-krb.c
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-krb.c,v 1.17 2002-08-06 04:42:05 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-krb.c,v 1.18 2002-09-05 21:25:43 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -37,11 +37,9 @@ static const char rcsid[] =
#include "interface.h"
#include "addrtoname.h"
-const u_char *c_print(register const u_char *, register const u_char *);
-const u_char *krb4_print_hdr(const u_char *);
-void krb4_print(const u_char *);
-void krb_print(const u_char *, u_int);
-
+static const u_char *c_print(register const u_char *, register const u_char *);
+static const u_char *krb4_print_hdr(const u_char *);
+static void krb4_print(const u_char *);
#define AUTH_MSG_KDC_REQUEST 1<<1
#define AUTH_MSG_KDC_REPLY 2<<1
@@ -119,7 +117,7 @@ static struct tok kerr2str[] = {
-const u_char *
+static const u_char *
c_print(register const u_char *s, register const u_char *ep)
{
register u_char c;
@@ -148,7 +146,7 @@ c_print(register const u_char *s, register const u_char *ep)
return (s);
}
-const u_char *
+static const u_char *
krb4_print_hdr(const u_char *cp)
{
cp += 2;
@@ -169,7 +167,7 @@ trunc:
#undef PRINT
}
-void
+static void
krb4_print(const u_char *cp)
{
register const struct krb *kp;
@@ -247,7 +245,7 @@ trunc:
}
void
-krb_print(const u_char *dat, u_int length)
+krb_print(const u_char *dat)
{
register const struct krb *kp;
diff --git a/print-lane.c b/print-lane.c
index a7fa2908..41967da5 100644
--- a/print-lane.c
+++ b/print-lane.c
@@ -22,7 +22,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.15 2002-08-01 08:53:15 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.16 2002-09-05 21:25:43 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -81,8 +81,8 @@ lane_hdr_print(register const u_char *bp, int length)
}
/*
- * This is the top level routine of the printer. 'p' is the points
- * to the ether header of the packet, 'h->tv' is the timestamp,
+ * This is the top level routine of the printer. 'p' points
+ * to the LANE header of the packet, 'h->ts' is the timestamp,
* 'h->length' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*
@@ -166,7 +166,7 @@ lane_print(const u_char *p, u_int length, u_int caplen)
}
void
-lane_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+lane_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
int caplen = h->caplen;
int length = h->len;
diff --git a/print-lcp.c b/print-lcp.c
deleted file mode 100644
index ee0a3a49..00000000
--- a/print-lcp.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that: (1) source code distributions
- * retain the above copyright notice and this paragraph in its entirety, (2)
- * distributions including binary code include the above copyright notice and
- * this paragraph in its entirety in the documentation or other materials
- * provided with the distribution, and (3) all advertising materials mentioning
- * features or use of this software display the following acknowledgement:
- * ``This product includes software developed by the University of California,
- * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
- * the University nor the names of its contributors may be used to endorse
- * or promote products derived from this software without specific prior
- * written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#ifndef lint
-static const char rcsid[] =
-"@(#) $Header: /tcpdump/master/tcpdump/Attic/print-lcp.c,v 1.11 2002-08-01 08:53:17 risso Exp $ (LBL)";
-#endif
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <tcpdump-stdinc.h>
-
-#include <stdio.h>
-#include <string.h>
-
-#include "interface.h"
-#include "addrtoname.h"
-#include "extract.h" /* must come after interface.h */
-#include "ppp.h"
-
-/* Codes */
-enum {
- LCP_CONFREQ = 1,
- LCP_CONFACK = 2,
- LCP_CONFNAK = 3,
- LCP_CONFREJ = 4,
- LCP_TERMREQ = 5,
- LCP_TERMACK = 6,
- LCP_CODEREJ = 7,
- LCP_PROTREJ = 8,
- LCP_ECHOREQ = 9,
- LCP_ECHOREP = 10,
- LCP_DISCARD = 11
-};
-
-static struct tok lcpcode2str[] = {
- { LCP_CONFREQ, "ConfReq" },
- { LCP_CONFACK, "ConfAck" },
- { LCP_CONFNAK, "ConfNak" },
- { LCP_CONFREJ, "ConfRej" },
- { LCP_TERMREQ, "TermReq" },
- { LCP_TERMACK, "TermAck" },
- { LCP_CODEREJ, "CodeRej" },
- { LCP_PROTREJ, "ProtRej" },
- { LCP_ECHOREQ, "EchoReq" },
- { LCP_ECHOREP, "EchoRep" },
- { LCP_DISCARD, "Discard" },
- { 0, NULL }
-};
-
-
-enum {
- LCP_RESERVED = 0,
- LCP_MRU = 1,
- LCP_ASYNCMAP = 2,
- LCP_AUTHPROTO = 3,
- LCP_QUALPROTO = 4,
- LCP_MAGICNUM = 5,
- LCP_PCOMP = 7,
- LCP_ACFCOMP = 8,
- LCP_CALLBACK = 13
-};
-
-static struct tok lcpoption2str[] = {
- { LCP_RESERVED, "reserved"},
- { LCP_MRU, "mru"},
- { LCP_ASYNCMAP, "asyncmap"},
- { LCP_AUTHPROTO, "auth"},
- { LCP_QUALPROTO, "qual"},
- { LCP_MAGICNUM, "magic"},
- { LCP_PCOMP, "pcomp"},
- { LCP_ACFCOMP, "acfcomp"},
- { LCP_CALLBACK, "callback"},
- { 0, NULL }
-};
-
-static struct tok lcpauth2str[] = {
- {0xc023, "PAP"},
- {0xc223, "CHAP"},
- { 0, NULL }
-};
-
-static struct tok lcpqual2str[] = {
- {0xc025, "LQR"},
- { 0, NULL }
-};
-
-static struct tok lcpchap2str[] = {
- {0x05, "MD5"},
- {0x80, "MS"},
- { 0, NULL }
-};
-
-void
-lcp_print(register const u_char *bp, u_int length)
-{
- u_short lcp_code, lcp_id, lcp_length;
- const u_char *lcp_data;
-
- lcp_data = bp+4;
-
- if (snapend < lcp_data) {
- printf(" [LCP|]");
- return;
- }
-
- lcp_code = bp[0];
- lcp_id = bp[1];
- lcp_length = EXTRACT_16BITS(bp+2);
-
- printf("LCP %s id=0x%x", tok2str(lcpcode2str, "LCP-#%d", lcp_code), lcp_id);
-
- switch (lcp_code) {
- case LCP_CONFREQ:
- case LCP_CONFACK:
- case LCP_CONFNAK:
- case LCP_CONFREJ:
- /* Print Options */
- {
- u_char lcpopt_type, lcpopt_length;
- const u_char *p=lcp_data;
- while (p+2 < lcp_data+lcp_length && p+2 < snapend) {
- lcpopt_type = p[0];
- lcpopt_length = p[1];
- p+=2;
- printf(" <%s ",tok2str(lcpoption2str, "option-#%d", lcpopt_type));
- if (lcpopt_length)
- switch (lcpopt_type) {
- case LCP_MRU:
- if (snapend < p+2) return;
- printf("%d",ntohs(*(u_short*)p));
- if (lcpopt_length != 4) printf(" len=%d!",lcpopt_length);
- break;
- case LCP_AUTHPROTO:
- if (snapend < p+2) return;
- printf("%s",tok2str(lcpauth2str, "AUTH-%#x", ntohs(*(u_short*)p)));
- if (lcpopt_length < 4) printf(" len=%d!",lcpopt_length);
- if (lcpopt_length >= 5 && p < snapend)
- printf(" %s",tok2str(lcpchap2str, "%#x", p[0]));
- break;
- case LCP_QUALPROTO:
- if (snapend < p+2) return;
- printf("%s",tok2str(lcpqual2str, "QUAL-%#x", ntohs(*(u_short*)p)));
- if (lcpopt_length < 4) printf(" len=%d!",lcpopt_length);
- /* Print data field of auth? */
- break;
- case LCP_ASYNCMAP:
- case LCP_MAGICNUM:
- if (snapend < p+4) return;
- printf("%#x", (unsigned)ntohl(*(u_long*)p));
- if (lcpopt_length != 6) printf(" len=%d!",lcpopt_length);
- break;
- case LCP_PCOMP:
- case LCP_ACFCOMP:
- case LCP_RESERVED:
- if (lcpopt_length != 2) printf(" len=%d!",lcpopt_length);
- break;
- default:
- if (lcpopt_length != 2) printf(" len=%d",lcpopt_length);
- break;
- }
- printf(">");
- p+=lcpopt_length-2;
- }
- }
- break;
- case LCP_ECHOREQ:
- case LCP_ECHOREP:
- case LCP_DISCARD:
- if (snapend < lcp_data+4) return;
- printf(" magic=%#x", (unsigned)ntohl(*(u_long *) lcp_data));
- lcp_data +=4;
- break;
- case LCP_PROTREJ:
- if (snapend < lcp_data+2) return;
- printf(" prot=%s", tok2str(ppptype2str, "PROT-%#x", ntohs(*(u_short *) lcp_data)));
- /* TODO print rejected packet too ? */
- break;
- case LCP_CODEREJ:
- if (snapend < lcp_data+4) return;
- printf(" ");
- lcp_print(lcp_data, (lcp_length+lcp_data > snapend ? snapend-lcp_data : lcp_length));
- break;
- case LCP_TERMREQ:
- case LCP_TERMACK:
- break;
- default:
- break;
- }
-
- return;
-}
diff --git a/print-llc.c b/print-llc.c
index 73a0ee72..cbdd0390 100644
--- a/print-llc.c
+++ b/print-llc.c
@@ -24,7 +24,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-llc.c,v 1.49 2002-09-05 00:00:15 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-llc.c,v 1.50 2002-09-05 21:25:44 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -193,8 +193,8 @@ llc_print(const u_char *p, u_int length, u_int caplen,
* Does anybody ever bridge one form of LAN traffic
* over a networking type that uses 802.2 LLC?
*/
- ret = snap_print(p, length, caplen, esrc, edst,
- extracted_ethertype, orgcode, et, 2);
+ ret = snap_print(p, length, caplen, extracted_ethertype,
+ orgcode, et, 2);
if (ret)
return (ret);
}
@@ -286,8 +286,8 @@ llc_print(const u_char *p, u_int length, u_int caplen,
int
snap_print(const u_char *p, u_int length, u_int caplen,
- const u_char *esrc, const u_char *edst, u_short *extracted_ethertype,
- u_int32_t orgcode, u_short et, u_int bridge_pad)
+ u_short *extracted_ethertype, u_int32_t orgcode, u_short et,
+ u_int bridge_pad)
{
register int ret;
@@ -325,7 +325,7 @@ snap_print(const u_char *p, u_int length, u_int caplen,
case OUI_CISCO:
if (et == PID_CISCO_CDP) {
- cdp_print(p, length, caplen, esrc, edst);
+ cdp_print(p, length, caplen);
return (1);
}
break;
diff --git a/print-null.c b/print-null.c
index 821a447d..cfd41e66 100644
--- a/print-null.c
+++ b/print-null.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.43 2002-08-01 08:53:22 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.44 2002-09-05 21:25:44 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -97,7 +97,7 @@ null_print(u_int family, u_int length)
((((y)&0xff)<<24) | (((y)&0xff00)<<8) | (((y)&0xff0000)>>8) | (((y)>>24)&0xff))
void
-null_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+null_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
u_int length = h->len;
u_int caplen = h->caplen;
diff --git a/print-pflog.c b/print-pflog.c
index e1c8af98..b8485ea5 100644
--- a/print-pflog.c
+++ b/print-pflog.c
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.3 2002-08-01 08:53:23 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.4 2002-09-05 21:25:44 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -97,7 +97,7 @@ pflog_print(const struct pfloghdr *hdr)
}
void
-pflog_if_print(u_char *user, const struct pcap_pkthdr *h,
+pflog_if_print(u_char *user _U_, const struct pcap_pkthdr *h,
register const u_char *p)
{
u_int length = h->len;
diff --git a/print-ppp.c b/print-ppp.c
index 3427cdaa..6032b1d7 100644
--- a/print-ppp.c
+++ b/print-ppp.c
@@ -31,7 +31,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.69 2002-09-05 00:00:17 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.70 2002-09-05 21:25:45 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -801,7 +801,7 @@ handle_pap(const u_char *p, int length)
/* BAP */
static void
-handle_bap(const u_char *p, int length)
+handle_bap(const u_char *p _U_, int length _U_)
{
/* XXX: to be supported!! */
}
@@ -1029,7 +1029,7 @@ trunc:
/* PPP I/F printer */
void
-ppp_if_print(u_char *user, const struct pcap_pkthdr *h,
+ppp_if_print(u_char *user _U_, const struct pcap_pkthdr *h,
register const u_char *p)
{
register u_int length = h->len;
@@ -1113,7 +1113,7 @@ out:
* This handles, for example, DLT_PPP_SERIAL in NetBSD.
*/
void
-ppp_hdlc_if_print(u_char *user, const struct pcap_pkthdr *h,
+ppp_hdlc_if_print(u_char *user _U_, const struct pcap_pkthdr *h,
register const u_char *p)
{
register u_int length = h->len;
@@ -1227,8 +1227,8 @@ struct tok ppptype2str[] = {
/* BSD/OS specific PPP printer */
void
-ppp_bsdos_if_print(u_char *user, const struct pcap_pkthdr *h,
- register const u_char *p)
+ppp_bsdos_if_print(u_char *user _U_, const struct pcap_pkthdr *h _U_,
+ register const u_char *p _U_)
{
#ifdef __bsdi__
register u_int length = h->len;
@@ -1316,7 +1316,7 @@ ppp_bsdos_if_print(u_char *user, const struct pcap_pkthdr *h,
switch (ptype) {
case PPP_VJC:
- ptype = vjc_print(q, length - (q - p), ptype);
+ ptype = vjc_print(q, ptype);
hdrlength = PPP_BSDI_HDRLEN;
p += hdrlength;
switch (ptype) {
@@ -1331,7 +1331,7 @@ ppp_bsdos_if_print(u_char *user, const struct pcap_pkthdr *h,
}
goto printx;
case PPP_VJNC:
- ptype = vjc_print(q, length - (q - p), ptype);
+ ptype = vjc_print(q, ptype);
hdrlength = PPP_BSDI_HDRLEN;
p += hdrlength;
switch (ptype) {
diff --git a/print-pppoe.c b/print-pppoe.c
index 6abe6004..3456225b 100644
--- a/print-pppoe.c
+++ b/print-pppoe.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
-"@(#) $Header: /tcpdump/master/tcpdump/print-pppoe.c,v 1.17 2002-08-01 08:53:24 risso Exp $ (LBL)";
+"@(#) $Header: /tcpdump/master/tcpdump/print-pppoe.c,v 1.18 2002-09-05 21:25:45 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -90,7 +90,7 @@ static struct tok pppoetag2str[] = {
#define PPPOE_HDRLEN 6
void
-pppoe_if_print(u_char *user, const struct pcap_pkthdr *h,
+pppoe_if_print(u_char *user _U_, const struct pcap_pkthdr *h,
register const u_char *p)
{
register u_int length = h->len;
diff --git a/print-pptp.c b/print-pptp.c
index f5026455..2213607d 100644
--- a/print-pptp.c
+++ b/print-pptp.c
@@ -24,7 +24,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-pptp.c,v 1.6 2002-09-05 00:00:17 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pptp.c,v 1.7 2002-09-05 21:25:45 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -961,7 +961,7 @@ trunc:
}
void
-pptp_print(const u_char *dat, u_int length)
+pptp_print(const u_char *dat)
{
const struct pptp_hdr *hdr;
u_int32_t mc;
diff --git a/print-raw.c b/print-raw.c
index b4a2139d..c8cba8f7 100644
--- a/print-raw.c
+++ b/print-raw.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.36 2002-08-01 08:53:25 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.37 2002-09-05 21:25:46 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -42,7 +42,7 @@ static const char rcsid[] =
*/
void
-raw_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+raw_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
u_int length = h->len;
u_int caplen = h->caplen;
diff --git a/print-rip.c b/print-rip.c
index 5b2220e6..78403a4b 100644
--- a/print-rip.c
+++ b/print-rip.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.51 2002-09-05 00:00:18 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.52 2002-09-05 21:25:46 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -69,7 +69,7 @@ rip_printblk(const u_char *cp, const u_char *ep)
}
static void
-rip_entry_print_v1(register int vers, register const struct rip_netinfo *ni)
+rip_entry_print_v1(register const struct rip_netinfo *ni)
{
register u_short family;
@@ -97,7 +97,7 @@ rip_entry_print_v1(register int vers, register const struct rip_netinfo *ni)
}
static void
-rip_entry_print_v2(register int vers, register const struct rip_netinfo *ni)
+rip_entry_print_v2(register const struct rip_netinfo *ni)
{
register u_char *p;
register u_short family;
@@ -208,9 +208,9 @@ rip_print(const u_char *dat, u_int length)
ni = (struct rip_netinfo *)(rp + 1);
for (; i >= sizeof(*ni); ++ni) {
if (rp->rip_vers == 1)
- rip_entry_print_v1(rp->rip_vers, ni);
+ rip_entry_print_v1(ni);
else
- rip_entry_print_v2(rp->rip_vers, ni);
+ rip_entry_print_v2(ni);
i -= sizeof(*ni);
}
if (trunc)
diff --git a/print-rx.c b/print-rx.c
index 20ea3b33..ffaefe45 100644
--- a/print-rx.c
+++ b/print-rx.c
@@ -34,7 +34,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-rx.c,v 1.33 2002-09-05 00:00:19 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-rx.c,v 1.34 2002-09-05 21:25:46 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -398,7 +398,7 @@ static struct rx_cache_entry rx_cache[RX_CACHE_SIZE];
static int rx_cache_next = 0;
static int rx_cache_hint = 0;
-static void rx_cache_insert(const u_char *, const struct ip *, int, int);
+static void rx_cache_insert(const u_char *, const struct ip *, int);
static int rx_cache_find(const struct rx_header *, const struct ip *,
int, int32_t *);
@@ -418,7 +418,7 @@ static void vol_print(const u_char *, int);
static void vol_reply_print(const u_char *, int, int32_t);
static void bos_print(const u_char *, int);
static void bos_reply_print(const u_char *, int, int32_t);
-static void ubik_print(const u_char *, int);
+static void ubik_print(const u_char *);
static void ubik_reply_print(const u_char *, int, int32_t);
static void rx_ack_print(const u_char *, int);
@@ -500,7 +500,7 @@ rx_print(register const u_char *bp, int length, int sport, int dport,
* have a chance to print out replies
*/
- rx_cache_insert(bp, (const struct ip *) bp2, dport, length);
+ rx_cache_insert(bp, (const struct ip *) bp2, dport);
switch (dport) {
case FS_RX_PORT: /* AFS file service */
@@ -586,8 +586,7 @@ rx_print(register const u_char *bp, int length, int sport, int dport,
*/
static void
-rx_cache_insert(const u_char *bp, const struct ip *ip, int dport,
- int length)
+rx_cache_insert(const u_char *bp, const struct ip *ip, int dport)
{
struct rx_cache_entry *rxent;
const struct rx_header *rxh = (const struct rx_header *) bp;
@@ -1308,7 +1307,7 @@ prot_print(register const u_char *bp, int length)
printf(" pt");
if (is_ubik(pt_op)) {
- ubik_print(bp, length);
+ ubik_print(bp);
return;
}
@@ -1562,7 +1561,7 @@ vldb_print(register const u_char *bp, int length)
printf(" vldb");
if (is_ubik(vldb_op)) {
- ubik_print(bp, length);
+ ubik_print(bp);
return;
}
printf(" call %s", tok2str(vldb_req, "op#%d", vldb_op));
@@ -1841,7 +1840,7 @@ kauth_print(register const u_char *bp, int length)
printf(" kauth");
if (is_ubik(kauth_op)) {
- ubik_print(bp, length);
+ ubik_print(bp);
return;
}
@@ -2195,7 +2194,7 @@ is_ubik(u_int32_t opcode)
*/
static void
-ubik_print(register const u_char *bp, int length)
+ubik_print(register const u_char *bp)
{
int ubik_op;
int32_t temp;
diff --git a/print-sl.c b/print-sl.c
index ff2b86c7..4fec3d09 100644
--- a/print-sl.c
+++ b/print-sl.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-sl.c,v 1.58 2002-08-01 08:53:28 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-sl.c,v 1.59 2002-09-05 21:25:47 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -49,7 +49,7 @@ 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)
+sl_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
register u_int caplen = h->caplen;
register u_int length = h->len;
@@ -101,7 +101,7 @@ sl_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
void
-sl_bsdos_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+sl_bsdos_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
register u_int caplen = h->caplen;
register u_int length = h->len;
diff --git a/print-sll.c b/print-sll.c
index 4fb792e0..7454d334 100644
--- a/print-sll.c
+++ b/print-sll.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-sll.c,v 1.8 2002-08-01 08:53:28 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-sll.c,v 1.9 2002-09-05 21:25:48 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -87,13 +87,13 @@ sll_print(register const struct sll_header *sllp, u_int length)
}
/*
- * This is the top level routine of the printer. 'p' is the points
- * to the ether header of the packet, 'h->tv' is the timestamp,
+ * This is the top level routine of the printer. 'p' points to the
+ * Linux "cooked capture" header of the packet, 'h->ts' is the timestamp,
* 'h->length' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
void
-sll_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+sll_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
u_int length = h->len;
diff --git a/print-smb.c b/print-smb.c
index 058bf0e6..985575c2 100644
--- a/print-smb.c
+++ b/print-smb.c
@@ -12,7 +12,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-smb.c,v 1.26 2002-09-05 00:00:20 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-smb.c,v 1.27 2002-09-05 21:25:48 guy Exp $";
#endif
#include <tcpdump-stdinc.h>
@@ -169,7 +169,7 @@ struct smbfnsint trans2_fns[] = {
static void
-print_trans2(const u_char *words, const u_char *dat, const u_char *buf, const u_char *maxbuf)
+print_trans2(const u_char *words, const u_char *dat _U_, const u_char *buf, const u_char *maxbuf)
{
static struct smbfnsint *fn = &trans2_fns[0];
const u_char *data, *param;
@@ -382,7 +382,7 @@ trunc:
static void
-print_negprot(const u_char *words, const u_char *data, const u_char *buf, const u_char *maxbuf)
+print_negprot(const u_char *words, const u_char *data, const u_char *buf _U_, const u_char *maxbuf)
{
u_int wcnt;
const char *f1 = NULL, *f2 = NULL;
@@ -417,7 +417,7 @@ trunc:
}
static void
-print_sesssetup(const u_char *words, const u_char *data, const u_char *buf, const u_char *maxbuf)
+print_sesssetup(const u_char *words, const u_char *data, const u_char *buf _U_, const u_char *maxbuf)
{
u_int wcnt;
const char *f1 = NULL, *f2 = NULL;
diff --git a/print-stp.c b/print-stp.c
index 057272b9..dd716957 100644
--- a/print-stp.c
+++ b/print-stp.c
@@ -11,7 +11,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-stp.c,v 1.9 2002-08-01 08:53:30 risso Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-stp.c,v 1.10 2002-09-05 21:25:49 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -36,7 +36,7 @@ stp_print_bridge_id(const u_char *p)
}
static void
-stp_print_config_bpdu(const u_char *p, u_int length)
+stp_print_config_bpdu(const u_char *p)
{
printf("config ");
if (p[7] & 1)
@@ -59,7 +59,7 @@ stp_print_config_bpdu(const u_char *p, u_int length)
}
static void
-stp_print_tcn_bpdu(const u_char *p, u_int length)
+stp_print_tcn_bpdu(void)
{
printf("tcn");
}
@@ -84,11 +84,11 @@ stp_print(const u_char *p, u_int length)
case 0:
if (length < 10)
goto trunc;
- stp_print_config_bpdu(p, length);
+ stp_print_config_bpdu(p);
break;
case 1:
- stp_print_tcn_bpdu(p, length);
+ stp_print_tcn_bpdu();
break;
default:
diff --git a/print-sunatm.c b/print-sunatm.c
index f3aafe94..3df26fb2 100644
--- a/print-sunatm.c
+++ b/print-sunatm.c
@@ -31,7 +31,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-sunatm.c,v 1.3 2002-08-05 07:47:23 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-sunatm.c,v 1.4 2002-09-05 21:25:49 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -64,13 +64,13 @@ struct rtentry;
#define PT_LLC 0x02 /* LLC encapsulation */
/*
- * This is the top level routine of the printer. 'p' is the points
- * to the SunATM pseudo-header for the packet, 'h->tv' is the timestamp,
+ * This is the top level routine of the printer. 'p' points
+ * to the SunATM pseudo-header for the packet, 'h->ts' is the timestamp,
* 'h->length' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
void
-sunatm_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+sunatm_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
u_int length = h->len;
diff --git a/print-tcp.c b/print-tcp.c
index 536fd57a..e423f8c3 100644
--- a/print-tcp.c
+++ b/print-tcp.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.102 2002-09-05 00:00:22 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.103 2002-09-05 21:25:49 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -601,7 +601,7 @@ tcp_print(register const u_char *bp, register u_int length,
} else if (sport == BGP_PORT || dport == BGP_PORT)
bgp_print(bp, length);
else if (sport == PPTP_PORT || dport == PPTP_PORT)
- pptp_print(bp, length);
+ pptp_print(bp);
#ifdef TCPDUMP_DO_SMB
else if (sport == NETBIOS_SSN_PORT || dport == NETBIOS_SSN_PORT)
nbt_tcp_print(bp, length);
diff --git a/print-timed.c b/print-timed.c
index d6fc3b0f..0396cee9 100644
--- a/print-timed.c
+++ b/print-timed.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-timed.c,v 1.5 2002-09-05 00:00:23 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-timed.c,v 1.6 2002-09-05 21:25:50 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -43,7 +43,7 @@ static const char *tsptype[TSPTYPENUMBER] =
"TEST", "SETDATE", "SETDATEREQ", "LOOP" };
void
-timed_print(register const u_char *bp, u_int length)
+timed_print(register const u_char *bp)
{
#define endof(x) ((u_char *)&(x) + sizeof (x))
struct tsp *tsp = (struct tsp *)bp;
diff --git a/print-token.c b/print-token.c
index dd806691..81a30249 100644
--- a/print-token.c
+++ b/print-token.c
@@ -25,7 +25,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.18 2002-09-05 00:00:23 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.19 2002-09-05 21:25:50 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -195,13 +195,13 @@ token_print(const u_char *p, u_int length, u_int caplen)
}
/*
- * This is the top level routine of the printer. 'p' is the points
- * to the TR 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 TR header of the packet, 'h->ts' is the timestamp,
+ * 'h->length' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
void
-token_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
+token_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
u_int length = h->len;
diff --git a/print-udp.c b/print-udp.c
index 3e19a2ce..b1f46609 100644
--- a/print-udp.c
+++ b/print-udp.c
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.108 2002-08-20 00:01:38 hannes Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.109 2002-09-05 21:25:50 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -105,7 +105,7 @@ struct rtcp_rr {
#define RTCP_PT_APP 204
static void
-vat_print(const void *hdr, u_int len, register const struct udphdr *up)
+vat_print(const void *hdr, register const struct udphdr *up)
{
/* vat/vt audio */
u_int ts = *(u_int16_t *)hdr;
@@ -489,7 +489,7 @@ udp_print(register const u_char *bp, u_int length,
case PT_VAT:
udpipaddr_print(ip, sport, dport);
- vat_print((void *)(up + 1), length, up);
+ vat_print((void *)(up + 1), up);
break;
case PT_WB:
@@ -526,7 +526,7 @@ udp_print(register const u_char *bp, u_int length,
case PT_CNFP:
udpipaddr_print(ip, sport, dport);
- cnfp_print(cp, length, (const u_char *)ip);
+ cnfp_print(cp, (const u_char *)ip);
break;
}
return;
@@ -598,12 +598,11 @@ udp_print(register const u_char *bp, u_int length,
if (ISPORT(NAMESERVER_PORT) || ISPORT(MULTICASTDNS_PORT))
ns_print((const u_char *)(up + 1), length);
else if (ISPORT(TIMED_PORT))
- timed_print((const u_char *)(up + 1), length);
+ timed_print((const u_char *)(up + 1));
else if (ISPORT(TFTP_PORT))
tftp_print((const u_char *)(up + 1), length);
else if (ISPORT(IPPORT_BOOTPC) || ISPORT(IPPORT_BOOTPS))
- bootp_print((const u_char *)(up + 1), length,
- sport, dport);
+ bootp_print((const u_char *)(up + 1), sport, dport);
else if (ISPORT(RIP_PORT))
rip_print((const u_char *)(up + 1), length);
else if (ISPORT(ISAKMP_PORT))
@@ -617,7 +616,7 @@ udp_print(register const u_char *bp, u_int length,
else if (ISPORT(NTP_PORT))
ntp_print((const u_char *)(up + 1), length);
else if (ISPORT(KERBEROS_PORT) || ISPORT(KERBEROS_SEC_PORT))
- krb_print((const void *)(up + 1), length);
+ krb_print((const void *)(up + 1));
else if (ISPORT(L2TP_PORT))
l2tp_print((const u_char *)(up + 1), length);
#ifdef TCPDUMP_DO_SMB
@@ -627,7 +626,7 @@ udp_print(register const u_char *bp, u_int length,
nbt_udp138_print((const u_char *)(up + 1), length);
#endif
else if (dport == 3456)
- vat_print((const void *)(up + 1), length, up);
+ vat_print((const void *)(up + 1), up);
else if (ISPORT(ZEPHYR_SRV_PORT) || ISPORT(ZEPHYR_CLT_PORT))
zephyr_print((const void *)(up + 1), length);
/*
diff --git a/print-vjc.c b/print-vjc.c
index 51375164..52c083ba 100644
--- a/print-vjc.c
+++ b/print-vjc.c
@@ -25,7 +25,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-vjc.c,v 1.10 2002-08-01 08:53:34 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-vjc.c,v 1.11 2002-09-05 21:25:51 guy Exp $ (LBL)";
#endif
#include <tcpdump-stdinc.h>
@@ -40,7 +40,7 @@ static const char rcsid[] =
#include "ppp.h"
int
-vjc_print(register const char *bp, register u_int length, u_short proto)
+vjc_print(register const char *bp, u_short proto)
{
int i;
diff --git a/tcpdump.c b/tcpdump.c
index 56400781..8f2e5e3a 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -30,7 +30,7 @@ static const char copyright[] =
"@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\
The Regents of the University of California. All rights reserved.\n";
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.185 2002-09-05 01:31:42 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.186 2002-09-05 21:25:51 guy Exp $ (LBL)";
#endif
/*
@@ -776,7 +776,7 @@ default_print(register const u_char *bp, register u_int length)
}
#ifdef SIGINFO
-RETSIGTYPE requestinfo(int signo)
+RETSIGTYPE requestinfo(int signo _U_)
{
if (infodelay)
++infoprint;
diff --git a/win32/prj/GNUmakefile b/win32/prj/GNUmakefile
index d234d673..7a0404e0 100644
--- a/win32/prj/GNUmakefile
+++ b/win32/prj/GNUmakefile
@@ -68,7 +68,6 @@ OBJS = \
../../print-krb.o \
../../print-l2tp.o \
../../print-lane.o \
- ../../print-lcp.o \
../../print-llc.o \
../../print-lwres.o \
../../print-mobile.o \
diff --git a/win32/prj/WinDump.dsp b/win32/prj/WinDump.dsp
index 9a78dc3b..8b489b79 100644
--- a/win32/prj/WinDump.dsp
+++ b/win32/prj/WinDump.dsp
@@ -281,10 +281,6 @@ SOURCE="..\..\print-lane.c"
# End Source File
# Begin Source File
-SOURCE="..\..\print-lcp.c"
-# End Source File
-# Begin Source File
-
SOURCE="..\..\print-llc.c"
# End Source File
# Begin Source File