This commit was generated by cvs2svn to compensate for changes in r111726,
which included commits to RCS files with non-trunk default branches.
This commit is contained in:
commit
af30588ecb
@ -1,4 +1,24 @@
|
||||
$Header: /tcpdump/master/tcpdump/CHANGES,v 1.81 2002/01/21 11:03:33 mcr Exp $
|
||||
$Header: /tcpdump/master/tcpdump/CHANGES,v 1.81.2.1 2003/02/26 07:08:58 fenner Exp $
|
||||
|
||||
Tuesday, February 25, 2003. fenner@research.att.com. 3.7.2 release
|
||||
|
||||
Fixed infinite loop when parsing malformed isakmp packets.
|
||||
(reported by iDefense; already fixed in CVS)
|
||||
Fixed infinite loop when parsing malformed BGP packets.
|
||||
Fixed buffer overflow with certain malformed NFS packets.
|
||||
Pretty-print unprintable network names in 802.11 printer.
|
||||
Handle truncated nbp (appletalk) packets.
|
||||
Updated DHCPv6 printer to match draft-ietf-dhc-dhcpv6-22.txt
|
||||
Print IP protocol name even if we don't have a printer for it.
|
||||
Print IP protocol name or number for fragments.
|
||||
Print the whole MPLS label stack, not just the top label.
|
||||
Print request header and file handle for NFS v3 FSINFO and PATHCONF
|
||||
requests.
|
||||
Fix NFS packet truncation checks.
|
||||
Handle "old" DR-Priority and Bidir-Capable PIM HELLO options.
|
||||
Handle unknown RADIUS attributes properly.
|
||||
Fix an ASN.1 parsing error that would cause e.g. the OID
|
||||
2.100.3 to be misrepresented as 4.20.3 .
|
||||
|
||||
Monday, January 21, 2002. mcr@sandelman.ottawa.on.ca. Summary for 3.7 release
|
||||
see http://www.tcpdump.org/cvs-log/2002-01-21.10:16:48.html for commit log.
|
||||
@ -653,4 +673,4 @@ v2.0 Sun Jan 13 12:20:40 PST 1991
|
||||
|
||||
- Initial public release.
|
||||
|
||||
@(#) $Header: /tcpdump/master/tcpdump/CHANGES,v 1.81 2002/01/21 11:03:33 mcr Exp $ (LBL)
|
||||
@(#) $Header: /tcpdump/master/tcpdump/CHANGES,v 1.81.2.1 2003/02/26 07:08:58 fenner Exp $ (LBL)
|
||||
|
@ -13,6 +13,7 @@ The current maintainers:
|
||||
Additional people who have contributed patches:
|
||||
|
||||
Alfredo Andres <aandres@s21sec.com>
|
||||
Andrew Hintz <adhintz@users.sourceforge.net>
|
||||
Andrew Tridgell <tridge@linuxcare.com>
|
||||
Arkadiusz Miskiewicz <misiek@pld.org.pl>
|
||||
Armando L. Caro Jr. <acaro@mail.eecis.udel.edu>
|
||||
@ -46,13 +47,14 @@ Additional people who have contributed patches:
|
||||
Kazushi Sugyo <sugyo@pb.jp.nec.com>
|
||||
Kelly Carmichael <kcarmich@ipapp.com>
|
||||
Ken Hornstein <kenh@cmf.nrl.navy.mil>
|
||||
Kevin Steves <stevesk@sweden.hp.com>
|
||||
Kevin Steves <stevesk@pobox.com>
|
||||
Klaus Klein <kleink@reziprozitaet.de>
|
||||
Kris Kennaway <kris@freebsd.org>
|
||||
Larry Lile <lile@stdio.com>
|
||||
Lennert Buytenhek <buytenh@gnu.org>
|
||||
Love Hörnquist-Åstrand <lha@stacken.kth.se>
|
||||
Maciej W. Rozycki <macro@ds2.pg.gda.pl>
|
||||
Marc A. Lehmann <pcg@goof.com>
|
||||
Marko Kiiskila <carnil@cs.tut.fi>
|
||||
Marshall Rose <mrose@dbc.mtview.ca.us>
|
||||
Martin Husemann <martin@netbsd.org>
|
||||
@ -72,11 +74,12 @@ Additional people who have contributed patches:
|
||||
Peter Jeremy <peter.jeremy@alcatel.com.au>
|
||||
Rafal Maszkowski <rzm@icm.edu.pl>
|
||||
Rick Jones <raj@cup.hp.com>
|
||||
Rick Watson <watsonrick@users.sourceforge.net>
|
||||
Roderick Schertler <roderick@argon.org>
|
||||
Sebastian Krahmer <krahmer@cs.uni-potsdam.de>
|
||||
Seth Webster <swebster@sst.ll.mit.edu>
|
||||
Timo Koskiahde
|
||||
Tony Li <tli@jnx.com>
|
||||
Tony Li <tli@procket.com>
|
||||
Uns Lider <unslider@miranda.org>
|
||||
Wilbert de Graaf <wilbertdg@hetnet.nl>
|
||||
|
||||
|
@ -23,8 +23,6 @@ config.sub
|
||||
configure
|
||||
configure.in
|
||||
decnet.h
|
||||
dhcp6.h
|
||||
dhcp6opt.h
|
||||
esp.h
|
||||
ether.h
|
||||
ethertype.h
|
||||
|
@ -1,4 +1,4 @@
|
||||
@(#) $Header: /tcpdump/master/tcpdump/INSTALL,v 1.47 2000/12/16 09:07:45 guy Exp $ (LBL)
|
||||
@(#) $Header: /tcpdump/master/tcpdump/INSTALL,v 1.47.6.1 2002/07/16 04:41:57 guy Exp $ (LBL)
|
||||
|
||||
If you have not built libpcap, do so first. See the README
|
||||
file in this directory for the ftp location.
|
||||
@ -27,8 +27,8 @@ Note that most systems ship tcpdump, but usually an older version.
|
||||
Remember to remove or rename the installed binary when upgrading.
|
||||
|
||||
If you use Linux, this version of libpcap is known to compile and run
|
||||
with 2.0.25 and more modern, and 2.2.x kernels. It is guaranteed not
|
||||
to work with 1.X kernels.
|
||||
with 2.0.25 and more modern, and 2.2 and later, kernels. It is
|
||||
guaranteed not to work with 1.X kernels.
|
||||
|
||||
If your system is not one which we have tested tcpdump on, you may have
|
||||
to modify the configure script and Makefile.in. Please send us patches
|
||||
@ -43,6 +43,7 @@ CHANGES - description of differences between releases
|
||||
CREDITS - people that have helped tcpdump along
|
||||
FILES - list of files exported as part of the distribution
|
||||
INSTALL - this file
|
||||
LICENSE - the license under which tcpdump is distributed
|
||||
Makefile.in - compilation rules (input to the configure script)
|
||||
README - description of distribution
|
||||
VERSION - version of this release
|
||||
@ -50,32 +51,40 @@ acconfig.h - autoconf input
|
||||
aclocal.m4 - autoconf macros
|
||||
addrtoname.c - address to hostname routines
|
||||
addrtoname.h - address to hostname definitions
|
||||
ah.h - IPSEC Authentication Header definitions
|
||||
appletalk.h - AppleTalk definitions
|
||||
arcnet.h - ARCNET definitions
|
||||
atime.awk - TCP ack awk script
|
||||
bootp.h - BOOTP definitions
|
||||
bpf_dump.c - BPF program printing routines, in case libpcap doesn't
|
||||
have them
|
||||
chdlc.h - Cisco HDLC definitions
|
||||
config.guess - autoconf support
|
||||
config.h.in - autoconf input
|
||||
config.sub - autoconf support
|
||||
configure - configure script (run this first)
|
||||
configure.in - configure script source
|
||||
decnet.h - DECnet definitions
|
||||
dhcp6.h - IPv6 DHCP definitions
|
||||
dhcp6opt.h - IPv6 DHCP options
|
||||
ethertype.h - ethernet definitions
|
||||
esp.h - IPSEC Encapsulating Security Payload definitions
|
||||
ether.h - Ethernet definitions
|
||||
ethertype.h - Ethernet type value definitions
|
||||
extract.h - alignment definitions
|
||||
fddi.h - Fiber Distributed Data Interface definitions
|
||||
gmt2local.c - time conversion routines
|
||||
gmt2local.h - time conversion prototypes
|
||||
icmp6.h - ICMPv6 definitiions
|
||||
ieee802_11.h - IEEE 802.11 definitions
|
||||
igrp.h - Interior Gateway Routing Protocol definitions
|
||||
install-sh - BSD style install script
|
||||
interface.h - globals, prototypes and definitions
|
||||
ip.h - IP definitions
|
||||
ip6.h - IPv6 definitions
|
||||
ipsec_doi.h - ISAKMP packet definitions - RFC2407
|
||||
ipx.h - IPX definitions
|
||||
isakmp.h - ISAKMP packet definitions - RFC2408
|
||||
l2tp.h -
|
||||
lane.h -
|
||||
lbl/gnuc.h - gcc macros and defines
|
||||
lbl/os-*.h - os dependent defines and prototypes
|
||||
l2tp.h - Layer Two Tunneling Protocol definitions
|
||||
lane.h - ATM LANE definitions
|
||||
lbl/os-*.h - OS-dependent defines and prototypes
|
||||
llc.h - LLC definitions
|
||||
machdep.c - machine dependent routines
|
||||
machdep.h - machine dependent definitions
|
||||
@ -94,14 +103,18 @@ ospf6.h - IPv6 Open Shortest Path First definitions
|
||||
packetdat.awk - TCP chunk summary awk script
|
||||
parsenfsfh.c - Network File System file parser routines
|
||||
ppp.h - Point to Point Protocol definitions
|
||||
print-802_11.c - IEEE 802.11 printer routines
|
||||
print-ah.c - IPSEC Authentication Header printer routines
|
||||
print-arcnet.c - ARCNET printer routines
|
||||
print-arp.c - Address Resolution Protocol printer routines
|
||||
print-ascii.c - ASCII packet dump routines
|
||||
print-atalk.c - AppleTalk printer routines
|
||||
print-atm.c - atm printer routines
|
||||
print-atm.c - ATM printer routines
|
||||
print-bgp.c - Border Gateway Protocol printer routines
|
||||
print-bootp.c - BOOTP and IPv4 DHCP printer routines
|
||||
print-chdlc.c - CHDLC printer routines
|
||||
print-beep.c - BEEP printer routines
|
||||
print-cdp.c - Cisco Discovery Protocol printer routines
|
||||
print-chdlc.c - Cisco HDLC printer routines
|
||||
print-cip.c - Classical-IP over ATM routines
|
||||
print-cnfp.c - Cisco NetFlow printer routines
|
||||
print-decnet.c - DECnet printer routines
|
||||
@ -110,65 +123,84 @@ print-domain.c - Domain Name System printer routines
|
||||
print-dvmrp.c - Distance Vector Multicast Routing Protocol printer routines
|
||||
print-egp.c - External Gateway Protocol printer routines
|
||||
print-esp.c - IPSEC Encapsulating Security Payload printer routines
|
||||
print-ether.c - ethernet printer routines
|
||||
print-ether.c - Ethernet printer routines
|
||||
print-fddi.c - Fiber Distributed Data Interface printer routines
|
||||
print-frag6.c - IPv6 fragmentation header printer routines
|
||||
print-gre.c - Generic Routing Encapsulation printer routines
|
||||
print-hsrp.c - Cisco Hot Standby Router Protocol printer routines
|
||||
print-icmp.c - Internet Control Message Protocol printer routines
|
||||
print-icmp6.c - IPv6 Internet Control Message Protocol printer routines
|
||||
print-igmp.c - Internet Group Management Protocol printer routines
|
||||
print-igrp.c - Interior Gateway Routing Protocol printer routines
|
||||
print-ip.c - ip printer routines
|
||||
print-ip.c - IP printer routines
|
||||
print-ip6.c - IPv6 printer routines
|
||||
print-ip6opts.c - IPv6 header option printer routines
|
||||
print-ipcomp.c - IP Payload Compression Protocol printer routines
|
||||
print-ipx.c - IPX printer routines
|
||||
print-isakmp.c - Internet Security Association and Key Management Protocol
|
||||
print-isoclns.c - isoclns printer routines
|
||||
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 -
|
||||
print-lcp.c -
|
||||
print-llc.c - llc 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
|
||||
print-netbios.c - netbios printer routines
|
||||
print-mpls.c - Multi-Protocol Label Switching printer routines
|
||||
print-msdp.c - Multicast Source Discovery Protocol printer routines
|
||||
print-netbios.c - NetBIOS frame protocol printer routines
|
||||
print-nfs.c - Network File System printer routines
|
||||
print-ntp.c - Network Time Protocol printer routines
|
||||
print-null.c - null printer routines
|
||||
print-null.c - BSD loopback device printer routines
|
||||
print-ospf.c - Open Shortest Path First printer routines
|
||||
print-ospf6.c - IPv6 Open Shortest Path First printer routines
|
||||
print-pim.c - Protocol Independent Multicast printer routines
|
||||
print-ppp.c - Point to Point Protocol printer routines
|
||||
print-pppoe.c -
|
||||
print-raw.c - raw printer routines
|
||||
print-pppoe.c - PPP-over-Ethernet printer routines
|
||||
print-pptp.c - Point-to-Point Tunnelling Protocol printer routines
|
||||
print-radius.c - Radius protocol printer routines
|
||||
print-raw.c - Raw IP printer routines
|
||||
print-rip.c - Routing Information Protocol printer routines
|
||||
print-ripng.c - IPv6 Routing Information Protocol printer routines
|
||||
print-rt6.c - IPv6 routing header printer routines
|
||||
print-rx.c - AFS RX printer routines
|
||||
print-sctp.c - Stream Control Transmission Protocol printer routines
|
||||
print-sl.c - Compressed Serial Line Internet Protocol printer routines
|
||||
print-smb.c - SMB (samba) printer routines
|
||||
print-sll.c - Linux "cooked" capture printer routines
|
||||
print-smb.c - SMB/CIFS printer routines
|
||||
print-snmp.c - Simple Network Management Protocol printer routines
|
||||
print-stp.c - IEEE 802.1d spanning tree protocol printer routines
|
||||
print-sunrpc.c - Sun Remote Procedure Call printer routines
|
||||
print-tcp.c - TCP printer routines
|
||||
print-telnet.c - Telnet option printer routines
|
||||
print-tftp.c - Trivial File Transfer Protocol printer routines
|
||||
print-timed.c - BSD time daemon protocol printer routines
|
||||
print-token.c - Token Ring printer routines
|
||||
print-udp.c - UDP printer routines
|
||||
print-vjc.c - PPP Van Jacovson compression (RFC1144) printer routines
|
||||
print-vjc.c - PPP Van Jacobson compression (RFC1144) printer routines
|
||||
print-vrrp.c - Virtual Router Redundancy Protocol
|
||||
print-wb.c - white board printer routines
|
||||
print-wb.c - White Board printer routines
|
||||
print-zephyr.c - Zephyr printer routines
|
||||
route6d.h - packet definition for IPv6 Routing Information Protocol
|
||||
rx.h -
|
||||
savestr.c - strdup() replacement
|
||||
savestr.h - savestr prototypes
|
||||
rx.h - AFS RX definitions
|
||||
sctpConstants.h - Stream Control Transmission Protocol constant definitions
|
||||
sctpHeader.h - Stream Control Transmission Protocol packet definitions
|
||||
send-ack.awk - unidirectional tcp send/ack awk script
|
||||
setsignal.c - os independent signal routines
|
||||
setsignal.h - os independent signal prototypes
|
||||
smb.h -
|
||||
smbutil.c -
|
||||
setsignal.c - OS-independent signal routines
|
||||
setsignal.h - OS-independent signal prototypes
|
||||
slcompress.h - SLIP/PPP Van Jacobson compression (RFC1144) definitions
|
||||
slip.h - SLIP definitions
|
||||
sll.h - Linux "cooked" capture definitions
|
||||
smb.h - SMB/CIFS definitions
|
||||
smbutil.c - SMB/CIFS utility routines
|
||||
stime.awk - TCP send awk script
|
||||
strcasecmp.c - missing routine
|
||||
tcp.h - TCP definitions
|
||||
tcpdump.1 - manual entry
|
||||
tcpdump.c - main program
|
||||
telnet.h - Telnet definitions
|
||||
timed.h - BSD time daemon protocol definitions
|
||||
token.h - Token Ring definitions
|
||||
udp.h - UDP definitions
|
||||
util.c - utility routines
|
||||
vfprintf.c - emulation routine
|
||||
|
@ -1,18 +1,18 @@
|
||||
@(#) $Header: /tcpdump/master/tcpdump/README,v 1.60 2002/01/21 11:16:33 mcr Exp $ (LBL)
|
||||
@(#) $Header: /tcpdump/master/tcpdump/README,v 1.60.2.3 2003/02/26 07:08:58 fenner Exp $ (LBL)
|
||||
|
||||
TCPDUMP 3.7.1
|
||||
TCPDUMP 3.7.2
|
||||
Now maintained by "The Tcpdump Group"
|
||||
See www.tcpdump.org
|
||||
|
||||
Please send inquiries/comments/reports to tcpdump-workers@tcpdump.org
|
||||
|
||||
Anonymous CVS is available via:
|
||||
cvs -d cvs.tcpdump.org:/tcpdump/master login
|
||||
cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master login
|
||||
(password "anoncvs")
|
||||
cvs -d cvs.tcpdump.org:/tcpdump/master checkout tcpdump
|
||||
cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout tcpdump
|
||||
|
||||
Version 3.7.1 of TCPDUMP can be retrived with the CVS tag "tcpdump_3_7rel1":
|
||||
cvs -d cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_3_7rel1 tcpdump
|
||||
Version 3.7.2 of TCPDUMP can be retrived with the CVS tag "tcpdump_3_7rel2":
|
||||
cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_3_7rel2 tcpdump
|
||||
|
||||
Please send patches against the master copy to patches@tcpdump.org.
|
||||
|
||||
@ -66,13 +66,19 @@ It is a program that can be used to extract portions of tcpdump binary
|
||||
trace files. See the above distribution for further details and
|
||||
documentation.
|
||||
|
||||
Problems, bugs, questions, desirable enhancements, etc.
|
||||
should be sent to the address "tcpdump-workers@tcpdump.org".
|
||||
Problems, bugs, questions, desirable enhancements, etc. should be sent
|
||||
to the address "tcpdump-workers@tcpdump.org". Bugs, support requests,
|
||||
and feature requests may also be submitted on the SourceForge site for
|
||||
tcpdump at
|
||||
|
||||
Source code contributions, etc. should be sent to the email address
|
||||
"patches@tcpdump.org".
|
||||
http://sourceforge.net/projects/tcpdump/
|
||||
|
||||
Current versions can be found at www.tcpdump.org
|
||||
Source code contributions, etc. should be sent to the email address
|
||||
"patches@tcpdump.org", or submitted as patches on the SourceForge site
|
||||
for tcpdump.
|
||||
|
||||
Current versions can be found at www.tcpdump.org, or the SourceForge
|
||||
site for tcpdump.
|
||||
|
||||
- The TCPdump team
|
||||
|
||||
|
@ -1 +1 @@
|
||||
3.7.1+multidlt
|
||||
3.7.2+multidlt
|
||||
|
@ -5,9 +5,6 @@
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
#undef inline
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
@ -189,6 +186,9 @@
|
||||
/* Define if you have the smi library (-lsmi). */
|
||||
#undef HAVE_LIBSMI
|
||||
|
||||
/* Define as token for inline if inlining supported */
|
||||
#undef inline
|
||||
|
||||
/* define if your compiler has __attribute__ */
|
||||
#undef HAVE___ATTRIBUTE__
|
||||
|
||||
|
536
contrib/tcpdump/configure
vendored
536
contrib/tcpdump/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.145 2002/01/17 05:00:16 guy Exp $ (LBL)
|
||||
dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.145.2.1 2002/06/28 10:48:31 guy Exp $ (LBL)
|
||||
dnl
|
||||
dnl Copyright (c) 1994, 1995, 1996, 1997
|
||||
dnl The Regents of the University of California. All rights reserved.
|
||||
@ -6,14 +6,14 @@ dnl
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
|
||||
AC_REVISION($Revision: 1.145 $)
|
||||
AC_REVISION($Revision: 1.145.2.1 $)
|
||||
AC_PREREQ(2.13)
|
||||
AC_INIT(tcpdump.c)
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
|
||||
AC_C_INLINE
|
||||
AC_LBL_C_INLINE
|
||||
AC_C___ATTRIBUTE__
|
||||
|
||||
AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netinet/if_ether.h)
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/gmt2local.c,v 1.4 2000/07/11 00:49:02 assar Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/gmt2local.c,v 1.4.6.1 2002/06/01 23:43:53 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -29,12 +29,9 @@ static const char rcsid[] =
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OS_PROTO_H
|
||||
#include "os-proto.h"
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.6 2001/09/17 21:57:53 fenner Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.6.4.1 2002/05/13 08:34:50 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -47,11 +47,16 @@ static const char rcsid[] =
|
||||
|
||||
#include "ieee802_11.h"
|
||||
|
||||
#define RATEStoBUF(p, buf) \
|
||||
#define PRINT_RATES(p) \
|
||||
do { \
|
||||
int z = 0; \
|
||||
for (z = 0 ; z < p.rates.length ; z++) \
|
||||
snprintf(buf, sizeof(buf), "%s %2.1f", buf, (.5 * (p.rates.rate[z] & 0x7f))); \
|
||||
int z; \
|
||||
char *sep = " ["; \
|
||||
for (z = 0; z < p.rates.length ; z++) { \
|
||||
printf("%s%2.1f", sep, (.5 * (p.rates.rate[z] & 0x7f))); \
|
||||
sep = " "; \
|
||||
} \
|
||||
if (p.rates.length != 0) \
|
||||
printf(" Mbit]"); \
|
||||
} while (0)
|
||||
|
||||
static const char *auth_alg_text[]={"Open System","Shared Key","EAP"};
|
||||
@ -131,9 +136,7 @@ static int parse_elements(struct mgmt_body_t *pbody,const u_char *p,int offset)
|
||||
{
|
||||
for (;;) {
|
||||
if (!TTEST2(*(p + offset), 1))
|
||||
return 0;
|
||||
if (*(p + offset) == 0xff)
|
||||
break;
|
||||
return 1;
|
||||
switch (*(p + offset)) {
|
||||
case E_SSID:
|
||||
if (!TTEST2(*(p+offset), 2))
|
||||
@ -216,9 +219,7 @@ static int handle_beacon(u_int16_t fc, const struct mgmt_header_t *pmh,
|
||||
{
|
||||
struct mgmt_body_t pbody;
|
||||
int offset = 0;
|
||||
char buf[128];
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
memset(&pbody, 0, sizeof(pbody));
|
||||
|
||||
if (!TTEST2(*p, 12))
|
||||
@ -233,10 +234,11 @@ static int handle_beacon(u_int16_t fc, const struct mgmt_header_t *pmh,
|
||||
if (!parse_elements(&pbody,p,offset))
|
||||
return 0;
|
||||
|
||||
RATEStoBUF(pbody, buf);
|
||||
|
||||
printf("%s (%s) [%s Mbit] %s CH: %x %s",
|
||||
subtype_text[FC_SUBTYPE(fc)], pbody.ssid.ssid, buf,
|
||||
printf("%s (", subtype_text[FC_SUBTYPE(fc)]);
|
||||
fn_print(pbody.ssid.ssid, NULL);
|
||||
printf(")");
|
||||
PRINT_RATES(pbody);
|
||||
printf(" %s CH: %u %s",
|
||||
CAPABILITY_ESS(pbody.capability_info) ? "ESS" : "IBSS",
|
||||
pbody.ds.channel,
|
||||
CAPABILITY_PRIVACY(pbody.capability_info) ? ", PRIVACY" : "" );
|
||||
@ -249,9 +251,7 @@ static int handle_assoc_request(u_int16_t fc, const struct mgmt_header_t *pmh,
|
||||
{
|
||||
struct mgmt_body_t pbody;
|
||||
int offset = 0;
|
||||
char buf[128];
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
memset(&pbody, 0, sizeof(pbody));
|
||||
|
||||
if (!TTEST2(*p, 4))
|
||||
@ -264,10 +264,10 @@ static int handle_assoc_request(u_int16_t fc, const struct mgmt_header_t *pmh,
|
||||
if (!parse_elements(&pbody,p,offset))
|
||||
return 0;
|
||||
|
||||
RATEStoBUF(pbody,buf);
|
||||
|
||||
printf("%s (%s) [%s Mbit] ",
|
||||
subtype_text[FC_SUBTYPE(fc)], pbody.ssid.ssid,buf);
|
||||
printf("%s (", subtype_text[FC_SUBTYPE(fc)]);
|
||||
fn_print(pbody.ssid.ssid, NULL);
|
||||
printf(")");
|
||||
PRINT_RATES(pbody);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -291,7 +291,7 @@ static int handle_assoc_response(u_int16_t fc, const struct mgmt_header_t *pmh,
|
||||
if (!parse_elements(&pbody,p,offset))
|
||||
return 0;
|
||||
|
||||
printf("%s AID(%x) :%s: %s ", subtype_text[FC_SUBTYPE(fc)],
|
||||
printf("%s AID(%x) :%s: %s", subtype_text[FC_SUBTYPE(fc)],
|
||||
((u_int16_t)(pbody.aid << 2 )) >> 2 ,
|
||||
CAPABILITY_PRIVACY(pbody.capability_info) ? " PRIVACY " : "",
|
||||
(pbody.status_code < 19 ? status_text[pbody.status_code] : "n/a"));
|
||||
@ -320,7 +320,9 @@ static int handle_reassoc_request(u_int16_t fc, const struct mgmt_header_t *pmh,
|
||||
if (!parse_elements(&pbody,p,offset))
|
||||
return 0;
|
||||
|
||||
printf("%s (%s) AP : %s",subtype_text[FC_SUBTYPE(fc)], pbody.ssid.ssid, etheraddr_string( pbody.ap ));
|
||||
printf("%s (", subtype_text[FC_SUBTYPE(fc)]);
|
||||
fn_print(pbody.ssid.ssid, NULL);
|
||||
printf(") AP : %s", etheraddr_string( pbody.ap ));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -337,19 +339,16 @@ static int handle_probe_request(u_int16_t fc, const struct mgmt_header_t *pmh,
|
||||
{
|
||||
struct mgmt_body_t pbody;
|
||||
int offset = 0;
|
||||
char buf[128];
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
memset(&pbody, 0, sizeof(pbody));
|
||||
|
||||
if (!parse_elements(&pbody, p, offset))
|
||||
return 0;
|
||||
|
||||
RATEStoBUF(pbody, buf);
|
||||
|
||||
printf("%s (%s) [%s Mbit] ", subtype_text[FC_SUBTYPE(fc)],
|
||||
pbody.ssid.ssid,buf);
|
||||
printf("%s (", subtype_text[FC_SUBTYPE(fc)]);
|
||||
fn_print(pbody.ssid.ssid, NULL);
|
||||
printf(")");
|
||||
PRINT_RATES(pbody);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -359,9 +358,6 @@ static int handle_probe_response(u_int16_t fc, const struct mgmt_header_t *pmh,
|
||||
{
|
||||
struct mgmt_body_t pbody;
|
||||
int offset = 0;
|
||||
char buf[128];
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
memset(&pbody, 0, sizeof(pbody));
|
||||
|
||||
@ -377,8 +373,12 @@ static int handle_probe_response(u_int16_t fc, const struct mgmt_header_t *pmh,
|
||||
if (!parse_elements(&pbody, p, offset))
|
||||
return 0;
|
||||
|
||||
printf("%s (%s) CH: %x %s", subtype_text[FC_SUBTYPE(fc)], pbody.ssid.ssid,pbody.ds.channel,
|
||||
CAPABILITY_PRIVACY(pbody.capability_info) ? ",PRIVACY " : "" );
|
||||
printf("%s (", subtype_text[FC_SUBTYPE(fc)]);
|
||||
fn_print(pbody.ssid.ssid, NULL);
|
||||
printf(") ");
|
||||
PRINT_RATES(pbody);
|
||||
printf(" CH: %u%s", pbody.ds.channel,
|
||||
CAPABILITY_PRIVACY(pbody.capability_info) ? ", PRIVACY" : "" );
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -404,7 +404,7 @@ static int handle_disassoc(u_int16_t fc, const struct mgmt_header_t *pmh,
|
||||
pbody.reason_code = EXTRACT_LE_16BITS(p);
|
||||
offset += 2;
|
||||
|
||||
printf("%s: %s ", subtype_text[FC_SUBTYPE(fc)],
|
||||
printf("%s: %s", subtype_text[FC_SUBTYPE(fc)],
|
||||
pbody.reason_code < 10 ? reason_text[pbody.reason_code] : "Reserved" );
|
||||
|
||||
return 1;
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-arcnet.c,v 1.6 2001/09/17 21:57:54 fenner Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-arcnet.c,v 1.6.4.1 2002/06/01 23:51:11 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -33,9 +33,6 @@ static const char rcsid[] =
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
struct mbuf;
|
||||
struct rtentry;
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-beep.c,v 1.1 2001/12/10 08:21:24 guy Exp $";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-beep.c,v 1.1.2.1 2002/07/11 07:47:01 guy Exp $";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -54,19 +54,19 @@ void
|
||||
beep_print(const u_char *bp, u_int length)
|
||||
{
|
||||
|
||||
if (l_strnstart("MSG", 4, bp, length)) /* A REQuest */
|
||||
if (l_strnstart("MSG", 4, (const char *)bp, length)) /* A REQuest */
|
||||
printf(" BEEP MSG");
|
||||
else if (l_strnstart("RPY ", 4, bp, length))
|
||||
else if (l_strnstart("RPY ", 4, (const char *)bp, length))
|
||||
printf(" BEEP RPY");
|
||||
else if (l_strnstart("ERR ", 4, bp, length))
|
||||
else if (l_strnstart("ERR ", 4, (const char *)bp, length))
|
||||
printf(" BEEP ERR");
|
||||
else if (l_strnstart("ANS ", 4, bp, length))
|
||||
else if (l_strnstart("ANS ", 4, (const char *)bp, length))
|
||||
printf(" BEEP ANS");
|
||||
else if (l_strnstart("NUL ", 4, bp, length))
|
||||
else if (l_strnstart("NUL ", 4, (const char *)bp, length))
|
||||
printf(" BEEP NUL");
|
||||
else if (l_strnstart("SEQ ", 4, bp, length))
|
||||
else if (l_strnstart("SEQ ", 4, (const char *)bp, length))
|
||||
printf(" BEEP SEQ");
|
||||
else if (l_strnstart("END", 4, bp, length))
|
||||
else if (l_strnstart("END", 4, (const char *)bp, length))
|
||||
printf(" BEEP END");
|
||||
else
|
||||
printf(" BEEP (payload or undecoded)");
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.27 2001/10/18 09:52:17 itojun Exp $";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.27.2.1 2003/02/26 05:51:56 fenner Exp $";
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -469,11 +469,19 @@ bgp_attr_print(const struct bgp_attr *attr, const u_char *dat, int len)
|
||||
switch (af) {
|
||||
case AFNUM_INET:
|
||||
advance = decode_prefix4(p, buf, sizeof(buf));
|
||||
if (advance < 0) {
|
||||
p = dat + len;
|
||||
break;
|
||||
}
|
||||
printf(" %s", buf);
|
||||
break;
|
||||
#ifdef INET6
|
||||
case AFNUM_INET6:
|
||||
advance = decode_prefix6(p, buf, sizeof(buf));
|
||||
if (advance < 0) {
|
||||
p = dat + len;
|
||||
break;
|
||||
}
|
||||
printf(" %s", buf);
|
||||
break;
|
||||
#endif
|
||||
@ -505,11 +513,19 @@ bgp_attr_print(const struct bgp_attr *attr, const u_char *dat, int len)
|
||||
switch (af) {
|
||||
case AFNUM_INET:
|
||||
advance = decode_prefix4(p, buf, sizeof(buf));
|
||||
if (advance < 0) {
|
||||
p = dat + len;
|
||||
break;
|
||||
}
|
||||
printf(" %s", buf);
|
||||
break;
|
||||
#ifdef INET6
|
||||
case AFNUM_INET6:
|
||||
advance = decode_prefix6(p, buf, sizeof(buf));
|
||||
if (advance < 0) {
|
||||
p = dat + len;
|
||||
break;
|
||||
}
|
||||
printf(" %s", buf);
|
||||
break;
|
||||
#endif
|
||||
@ -598,6 +614,7 @@ bgp_update_print(const u_char *dat, int length)
|
||||
printf(" (Withdrawn routes: %d bytes)", len);
|
||||
#else
|
||||
char buf[MAXHOSTNAMELEN + 100];
|
||||
int wpfx;
|
||||
|
||||
TCHECK2(p[2], len);
|
||||
i = 2;
|
||||
@ -605,7 +622,10 @@ bgp_update_print(const u_char *dat, int length)
|
||||
printf(" (Withdrawn routes:");
|
||||
|
||||
while(i < 2 + len) {
|
||||
i += decode_prefix4(&p[i], buf, sizeof(buf));
|
||||
wpfx = decode_prefix4(&p[i], buf, sizeof(buf));
|
||||
if (wpfx < 0)
|
||||
break;
|
||||
i += wpfx;
|
||||
printf(" %s", buf);
|
||||
}
|
||||
printf(")\n");
|
||||
@ -666,9 +686,9 @@ bgp_update_print(const u_char *dat, int length)
|
||||
while (dat + length > p) {
|
||||
char buf[MAXHOSTNAMELEN + 100];
|
||||
i = decode_prefix4(p, buf, sizeof(buf));
|
||||
printf(" %s", buf);
|
||||
if (i < 0)
|
||||
break;
|
||||
printf(" %s", buf);
|
||||
p += i;
|
||||
}
|
||||
|
||||
|
@ -26,10 +26,13 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
/*
|
||||
* draft-ietf-dhc-dhcpv6-22.txt
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-dhcp6.c,v 1.14 2001/09/17 21:57:59 fenner Exp $";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-dhcp6.c,v 1.14.4.2 2002/06/01 23:51:12 guy Exp $";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -40,9 +43,6 @@ static const char rcsid[] =
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
struct mbuf;
|
||||
struct rtentry;
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <ctype.h>
|
||||
@ -52,172 +52,125 @@ struct rtentry;
|
||||
|
||||
#include "interface.h"
|
||||
#include "addrtoname.h"
|
||||
#include "dhcp6.h"
|
||||
#include "dhcp6opt.h"
|
||||
|
||||
#if 0
|
||||
static void dhcp6opttab_init(void);
|
||||
static struct dhcp6_opt *dhcp6opttab_byname(char *);
|
||||
#endif
|
||||
static struct dhcp6_opt *dhcp6opttab_bycode(u_int);
|
||||
/* Error Values */
|
||||
#define DH6ERR_FAILURE 16
|
||||
#define DH6ERR_AUTHFAIL 17
|
||||
#define DH6ERR_POORLYFORMED 18
|
||||
#define DH6ERR_UNAVAIL 19
|
||||
#define DH6ERR_OPTUNAVAIL 20
|
||||
|
||||
static const char tstr[] = " [|dhcp6]";
|
||||
/* Message type */
|
||||
#define DH6_REPLY 7
|
||||
#define DH6_INFORM_REQ 11
|
||||
|
||||
static struct dhcp6_opt dh6opttab[] = {
|
||||
/* IP Address Extension */
|
||||
{ 1, OL6_N, "IP Address", OT6_NONE, },
|
||||
/* DHCP6 base packet format */
|
||||
struct dhcp6 {
|
||||
union {
|
||||
u_int8_t m;
|
||||
u_int32_t x;
|
||||
} dh6_msgtypexid;
|
||||
struct in6_addr dh6_servaddr;
|
||||
/* options follow */
|
||||
} __attribute__ ((__packed__));
|
||||
#define dh6_msgtype dh6_msgtypexid.m
|
||||
#define dh6_xid dh6_msgtypexid.x
|
||||
#define DH6_XIDMASK 0x00ffffff
|
||||
|
||||
/* General Extension */
|
||||
{ 8193, OL6_N, "IEEE 1003.1 POSIX Timezone", OT6_STR, },
|
||||
{ 8194, OL6_16N, "Domain Name Server", OT6_V6, },
|
||||
{ 8195, OL6_N, "Domain Name", OT6_STR, },
|
||||
|
||||
{ 8196, OL6_N, "SLP Agent", OT6_NONE, },
|
||||
{ 8197, OL6_N, "SLP Scope" , OT6_NONE, },
|
||||
{ 8198, OL6_16N, "Network Time Protocol Servers", OT6_V6, },
|
||||
{ 8199, OL6_N, "NIS Domain", OT6_STR, },
|
||||
{ 8200, OL6_16N, "NIS Servers", OT6_V6, },
|
||||
{ 8201, OL6_N, "NIS+ Domain", OT6_STR, },
|
||||
{ 8202, OL6_16N, "NIS+ Servers", OT6_V6, },
|
||||
|
||||
/* TCP Parameters */
|
||||
{ 8203, 4, "TCP Keepalive Interval", OT6_NUM, },
|
||||
|
||||
/* DHCPv6 Extensions */
|
||||
{ 8204, 4, "Maximum DHCPv6 Message Size", OT6_NUM, },
|
||||
{ 8205, OL6_N, "DHCP Retransmission and Configuration Parameter",
|
||||
OT6_NONE, },
|
||||
{ 8206, OL6_N, "Extension Request", OT6_NONE, },
|
||||
{ 8207, OL6_N, "Subnet Prefix", OT6_NONE, },
|
||||
{ 8208, OL6_N, "Platform Specific Information", OT6_NONE, },
|
||||
{ 8209, OL6_N, "Platform Class Identifier", OT6_STR, },
|
||||
{ 8210, OL6_N, "Class Identifier", OT6_STR, },
|
||||
{ 8211, 16, "Reconfigure Multicast Address", OT6_V6, },
|
||||
{ 8212, 16, "Renumber DHCPv6 Server Address",
|
||||
OT6_V6, },
|
||||
{ 8213, OL6_N, "Client-Server Authentication", OT6_NONE, },
|
||||
{ 8214, 4, "Client Key Selection", OT6_NUM, },
|
||||
|
||||
/* End Extension */
|
||||
{ 65536, OL6_Z, "End", OT6_NONE, },
|
||||
|
||||
{ 0 },
|
||||
};
|
||||
|
||||
#if 0
|
||||
static struct dhcp6_opt *dh6o_pad;
|
||||
static struct dhcp6_opt *dh6o_end;
|
||||
/* option */
|
||||
#define DH6OPT_DUID 1 /* TBD */
|
||||
#define DH6OPT_DNS 11 /* TBD */
|
||||
struct dhcp6opt {
|
||||
u_int16_t dh6opt_type;
|
||||
u_int16_t dh6opt_len;
|
||||
/* type-dependent data follows */
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
static void
|
||||
dhcp6opttab_init()
|
||||
dhcp6opt_print(u_char *cp, u_char *ep)
|
||||
{
|
||||
dh6o_pad = dhcp6opttab_bycode(0);
|
||||
dh6o_end = dhcp6opttab_bycode(65536);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
static struct dhcp6_opt *
|
||||
dhcp6opttab_byname(name)
|
||||
char *name;
|
||||
{
|
||||
struct dhcp6_opt *p;
|
||||
|
||||
for (p = dh6opttab; p->code; p++)
|
||||
if (strcmp(name, p->name) == 0)
|
||||
return p;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct dhcp6_opt *
|
||||
dhcp6opttab_bycode(code)
|
||||
u_int code;
|
||||
{
|
||||
struct dhcp6_opt *p;
|
||||
|
||||
for (p = dh6opttab; p->code; p++)
|
||||
if (p->code == code)
|
||||
return p;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
dhcp6ext_print(u_char *cp, u_char *ep)
|
||||
{
|
||||
u_int16_t code, len;
|
||||
struct dhcp6_opt *p;
|
||||
char buf[BUFSIZ];
|
||||
struct dhcp6opt *dh6o;
|
||||
u_char *tp;
|
||||
int i;
|
||||
size_t optlen;
|
||||
|
||||
if (cp == ep)
|
||||
return;
|
||||
while (cp < ep) {
|
||||
if (ep - cp < sizeof(u_int16_t))
|
||||
break;
|
||||
code = ntohs(*(u_int16_t *)&cp[0]);
|
||||
if (ep - cp < sizeof(u_int16_t) * 2)
|
||||
break;
|
||||
if (code != 65535)
|
||||
len = ntohs(*(u_int16_t *)&cp[2]);
|
||||
else
|
||||
len = 0;
|
||||
if (ep - cp < len + 4)
|
||||
break;
|
||||
p = dhcp6opttab_bycode(code);
|
||||
if (p == NULL) {
|
||||
printf("(unknown, len=%d)", len);
|
||||
cp += len + 4;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* sanity check on length */
|
||||
switch (p->len) {
|
||||
case OL6_N:
|
||||
break;
|
||||
case OL6_16N:
|
||||
if (len % 16 != 0)
|
||||
goto trunc;
|
||||
break;
|
||||
case OL6_Z:
|
||||
if (len != 0)
|
||||
goto trunc;
|
||||
break;
|
||||
default:
|
||||
if (len != p->len)
|
||||
goto trunc;
|
||||
break;
|
||||
}
|
||||
if (cp + 4 + len > ep) {
|
||||
printf(" [|%s]", p->name);
|
||||
return;
|
||||
}
|
||||
|
||||
printf(" (%s, ", p->name);
|
||||
switch (p->type) {
|
||||
case OT6_V6:
|
||||
for (i = 0; i < len; i += 16) {
|
||||
inet_ntop(AF_INET6, &cp[4 + i], buf,
|
||||
sizeof(buf));
|
||||
if (i != 0)
|
||||
printf(",");
|
||||
printf("%s", buf);
|
||||
if (ep - cp < sizeof(*dh6o))
|
||||
goto trunc;
|
||||
dh6o = (struct dhcp6opt *)cp;
|
||||
optlen = ntohs(dh6o->dh6opt_len);
|
||||
if (ep - cp < sizeof(*dh6o) + optlen)
|
||||
goto trunc;
|
||||
switch (ntohs(dh6o->dh6opt_type)) {
|
||||
case DH6OPT_DUID:
|
||||
printf(" (duid"); /*)*/
|
||||
if (optlen < 2) {
|
||||
/*(*/
|
||||
printf(" ??)");
|
||||
break;
|
||||
}
|
||||
tp = (u_char *)(dh6o + 1);
|
||||
switch (ntohs(*(u_int16_t *)tp)) {
|
||||
case 1:
|
||||
if (optlen >= 2 + 6) {
|
||||
printf(" hwaddr/time time %u type %u ",
|
||||
ntohl(*(u_int32_t *)&tp[2]),
|
||||
ntohs(*(u_int16_t *)&tp[6]));
|
||||
for (i = 8; i < optlen; i++)
|
||||
printf("%02x", tp[i]);
|
||||
/*(*/
|
||||
printf(")");
|
||||
} else {
|
||||
/*(*/
|
||||
printf(" ??)");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (optlen >= 2 + 8) {
|
||||
printf(" vid ");
|
||||
for (i = 2; i < 2 + 8; i++)
|
||||
printf("%02x", tp[i]);
|
||||
/*(*/
|
||||
printf(")");
|
||||
} else {
|
||||
/*(*/
|
||||
printf(" ??)");
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (optlen >= 2 + 2) {
|
||||
printf(" hwaddr type %u ",
|
||||
ntohs(*(u_int16_t *)&tp[2]));
|
||||
for (i = 4; i < optlen; i++)
|
||||
printf("%02x", tp[i]);
|
||||
/*(*/
|
||||
printf(")");
|
||||
} else {
|
||||
/*(*/
|
||||
printf(" ??)");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OT6_STR:
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
strncpy(buf, &cp[4], len);
|
||||
printf("%s", buf);
|
||||
break;
|
||||
case OT6_NUM:
|
||||
printf("%d", (u_int32_t)ntohl(*(u_int32_t *)&cp[4]));
|
||||
break;
|
||||
case DH6OPT_DNS:
|
||||
printf(" (dnsserver"); /*)*/
|
||||
if (optlen % 16) {
|
||||
/*(*/
|
||||
printf(" ??)");
|
||||
break;
|
||||
}
|
||||
tp = (u_char *)(dh6o + 1);
|
||||
for (i = 0; i < optlen; i += 16)
|
||||
printf(" %s", ip6addr_string(&tp[i]));
|
||||
/*(*/
|
||||
printf(")");
|
||||
default:
|
||||
for (i = 0; i < len; i++)
|
||||
printf("%02x", cp[4 + i] & 0xff);
|
||||
printf(" (opt-%u)", ntohs(dh6o->dh6opt_type));
|
||||
break;
|
||||
}
|
||||
printf(")");
|
||||
cp += len + 4;
|
||||
|
||||
cp += sizeof(*dh6o) + optlen;
|
||||
}
|
||||
return;
|
||||
|
||||
@ -226,128 +179,57 @@ dhcp6ext_print(u_char *cp, u_char *ep)
|
||||
}
|
||||
|
||||
/*
|
||||
* Print dhcp6 requests
|
||||
* Print dhcp6 packets
|
||||
*/
|
||||
void
|
||||
dhcp6_print(register const u_char *cp, u_int length,
|
||||
u_int16_t sport, u_int16_t dport)
|
||||
{
|
||||
union dhcp6 *dh6;
|
||||
struct dhcp6 *dh6;
|
||||
u_char *ep;
|
||||
u_char *extp;
|
||||
u_int16_t field16;
|
||||
const char *name;
|
||||
|
||||
printf("dhcp6");
|
||||
|
||||
ep = (u_char *)snapend;
|
||||
|
||||
dh6 = (union dhcp6 *)cp;
|
||||
TCHECK(dh6->dh6_msgtype);
|
||||
dh6 = (struct dhcp6 *)cp;
|
||||
TCHECK(dh6->dh6_servaddr);
|
||||
switch (dh6->dh6_msgtype) {
|
||||
case DH6_SOLICIT:
|
||||
if (!(vflag && TTEST(dh6->dh6_sol.dh6sol_relayaddr))) {
|
||||
printf(" solicit");
|
||||
break;
|
||||
}
|
||||
|
||||
printf(" solicit ("); /*)*/
|
||||
if (dh6->dh6_sol.dh6sol_flags != 0) {
|
||||
u_int8_t f = dh6->dh6_sol.dh6sol_flags;
|
||||
printf("%s%s ",
|
||||
(f & DH6SOL_PREFIX) ? "P" : "",
|
||||
(f & DH6SOL_CLOSE) ? "C" : "");
|
||||
}
|
||||
|
||||
memcpy(&field16, &dh6->dh6_sol.dh6sol_plen_id,
|
||||
sizeof(field16));
|
||||
field16 = ntohs(field16);
|
||||
if (field16 & ~DH6SOL_SOLICIT_PLEN_MASK)
|
||||
printf("plen=%d ", DH6SOL_SOLICIT_PLEN(field16));
|
||||
printf("solicit-ID=%d", DH6SOL_SOLICIT_ID(field16));
|
||||
|
||||
printf(" cliaddr=%s",
|
||||
ip6addr_string(&dh6->dh6_sol.dh6sol_cliaddr));
|
||||
printf(" relayaddr=%s",
|
||||
ip6addr_string(&dh6->dh6_sol.dh6sol_relayaddr));
|
||||
/*(*/
|
||||
printf(")");
|
||||
break;
|
||||
case DH6_ADVERT:
|
||||
if (!(vflag && TTEST(dh6->dh6_adv.dh6adv_serveraddr))) {
|
||||
printf(" advert");
|
||||
break;
|
||||
}
|
||||
printf(" advert ("); /*)*/
|
||||
memcpy(&field16, &dh6->dh6_adv.dh6adv_rsv_id, sizeof(field16));
|
||||
printf("solicit-ID=%d",
|
||||
ntohs(field16) & DH6SOL_SOLICIT_ID_MASK);
|
||||
printf(" pref=%u", dh6->dh6_adv.dh6adv_pref);
|
||||
printf(" cliaddr=%s",
|
||||
ip6addr_string(&dh6->dh6_adv.dh6adv_cliaddr));
|
||||
printf(" relayaddr=%s",
|
||||
ip6addr_string(&dh6->dh6_adv.dh6adv_relayaddr));
|
||||
printf(" servaddr=%s",
|
||||
ip6addr_string(&dh6->dh6_adv.dh6adv_serveraddr));
|
||||
extp = (u_char *)((&dh6->dh6_adv) + 1);
|
||||
dhcp6ext_print(extp, ep);
|
||||
/*(*/
|
||||
printf(")");
|
||||
break;
|
||||
case DH6_REQUEST:
|
||||
if (!(vflag && TTEST(dh6->dh6_req.dh6req_relayaddr))) {
|
||||
printf(" request");
|
||||
break;
|
||||
}
|
||||
printf(" request ("); /*)*/
|
||||
if (dh6->dh6_req.dh6req_flags != 0) {
|
||||
u_int8_t f = dh6->dh6_req.dh6req_flags;
|
||||
printf("%s%s ",
|
||||
(f & DH6REQ_CLOSE) ? "C" : "",
|
||||
(f & DH6REQ_REBOOT) ? "R" : "");
|
||||
}
|
||||
printf("xid=0x%04x", dh6->dh6_req.dh6req_xid);
|
||||
printf(" cliaddr=%s",
|
||||
ip6addr_string(&dh6->dh6_req.dh6req_cliaddr));
|
||||
printf(" relayaddr=%s",
|
||||
ip6addr_string(&dh6->dh6_req.dh6req_relayaddr));
|
||||
printf(" servaddr=%s",
|
||||
ip6addr_string(&dh6->dh6_req.dh6req_serveraddr));
|
||||
dhcp6ext_print((char *)(&dh6->dh6_req + 1), ep);
|
||||
/*(*/
|
||||
printf(")");
|
||||
break;
|
||||
case DH6_REPLY:
|
||||
if (!(vflag && TTEST(dh6->dh6_rep.dh6rep_xid))) {
|
||||
printf(" reply");
|
||||
break;
|
||||
}
|
||||
printf(" reply ("); /*)*/
|
||||
if ((dh6->dh6_rep.dh6rep_flagandstat & DH6REP_RELAYPRESENT) != 0)
|
||||
printf("R ");
|
||||
printf("stat=0x%02x",
|
||||
dh6->dh6_rep.dh6rep_flagandstat & DH6REP_STATMASK);
|
||||
printf(" xid=0x%04x", dh6->dh6_rep.dh6rep_xid);
|
||||
printf(" cliaddr=%s",
|
||||
ip6addr_string(&dh6->dh6_rep.dh6rep_cliaddr));
|
||||
extp = (u_char *)((&dh6->dh6_rep) + 1);
|
||||
if ((dh6->dh6_rep.dh6rep_flagandstat & DH6REP_RELAYPRESENT) !=
|
||||
0) {
|
||||
printf(" relayaddr=%s", ip6addr_string(extp));
|
||||
extp += sizeof(struct in6_addr);
|
||||
}
|
||||
dhcp6ext_print(extp, ep);
|
||||
/*(*/
|
||||
printf(")");
|
||||
name = "reply";
|
||||
break;
|
||||
case DH6_RELEASE:
|
||||
printf(" release");
|
||||
case DH6_INFORM_REQ:
|
||||
name= "inf-req";
|
||||
break;
|
||||
case DH6_RECONFIG:
|
||||
printf(" reconfig");
|
||||
default:
|
||||
name = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!vflag) {
|
||||
if (name)
|
||||
printf(" %s", name);
|
||||
else
|
||||
printf(" msgtype-%u", dh6->dh6_msgtype);
|
||||
return;
|
||||
}
|
||||
|
||||
/* XXX relay agent messages have to be handled differently */
|
||||
|
||||
if (name)
|
||||
printf(" %s (", name); /*)*/
|
||||
else
|
||||
printf(" msgtype-%u (", dh6->dh6_msgtype); /*)*/
|
||||
printf("xid=%x", ntohl(dh6->dh6_xid) & DH6_XIDMASK);
|
||||
printf(" server=%s", ip6addr_string(&dh6->dh6_servaddr));
|
||||
extp = (u_char *)(dh6 + 1);
|
||||
dhcp6opt_print(extp, ep);
|
||||
/*(*/
|
||||
printf(")");
|
||||
return;
|
||||
|
||||
trunc:
|
||||
printf("%s", tstr);
|
||||
printf("[|dhcp6]");
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.28 2001/09/17 21:58:01 fenner Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.28.4.1 2002/06/01 23:51:12 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -29,7 +29,6 @@ static const char rcsid[] =
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.20 2002/01/21 11:39:59 mcr Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.20.4.2 2002/02/22 09:26:27 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -35,6 +35,7 @@ static const char rcsid[] =
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
@ -50,7 +51,6 @@ static const char rcsid[] =
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "ip.h"
|
||||
#include "esp.h"
|
||||
@ -120,7 +120,7 @@ static int hex2byte(char *hexstring)
|
||||
}
|
||||
|
||||
|
||||
void esp_print_decodesecret()
|
||||
static void esp_print_decodesecret(void)
|
||||
{
|
||||
char *colon;
|
||||
int len, i;
|
||||
@ -359,8 +359,8 @@ esp_print(register const u_char *bp, register const u_char *bp2,
|
||||
|
||||
des_check_key = 1;
|
||||
des_set_odd_parity((void *)secret);
|
||||
des_set_odd_parity((void *)secret+8);
|
||||
des_set_odd_parity((void *)secret+16);
|
||||
des_set_odd_parity((void *)(secret + 8));
|
||||
des_set_odd_parity((void *)(secret + 16));
|
||||
if(des_set_key((void *)secret, s1) != 0) {
|
||||
printf("failed to schedule key 1\n");
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-gre.c,v 1.13 2001/06/15 22:17:31 fenner Exp $";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-gre.c,v 1.13.4.1 2002/06/01 23:51:13 guy Exp $";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -33,7 +33,6 @@ static const char rcsid[] =
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.56 2001/06/27 02:48:43 itojun Exp $";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.56.4.1 2002/05/31 10:08:31 guy Exp $";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -574,7 +574,7 @@ icmp6_opt_print(const u_char *bp, int resid)
|
||||
printf(")");
|
||||
break;
|
||||
default:
|
||||
printf("(unknwon opt_type=%d, opt_len=%d)",
|
||||
printf("(unknown opt_type=%d, opt_len=%d)",
|
||||
op->nd_opt_type, op->nd_opt_len);
|
||||
break;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-igmp.c,v 1.5 2001/09/17 21:58:02 fenner Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-igmp.c,v 1.5.4.1 2002/06/02 18:25:05 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -32,8 +32,6 @@ static const char rcsid[] =
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/ip.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.29 2001/10/26 03:41:29 itojun Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.29.2.2 2003/02/26 05:58:39 fenner Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -43,9 +43,6 @@ static const char rcsid[] =
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
struct mbuf;
|
||||
struct rtentry;
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <stdio.h>
|
||||
@ -1028,6 +1025,7 @@ isakmp_sub0_print(u_char np, struct isakmp_gen *ext, u_char *ep,
|
||||
{
|
||||
u_char *cp;
|
||||
struct isakmp_gen e;
|
||||
u_int item_len;
|
||||
|
||||
cp = (u_char *)ext;
|
||||
safememcpy(&e, ext, sizeof(e));
|
||||
@ -1036,7 +1034,16 @@ isakmp_sub0_print(u_char np, struct isakmp_gen *ext, u_char *ep,
|
||||
cp = (*NPFUNC(np))(ext, ep, phase, doi, proto);
|
||||
else {
|
||||
printf("%s", NPSTR(np));
|
||||
cp += ntohs(e.len);
|
||||
item_len = ntohs(e.len);
|
||||
if (item_len == 0) {
|
||||
/*
|
||||
* We don't want to loop forever processing this
|
||||
* bogus (zero-length) item; return NULL so that
|
||||
* we stop dissecting.
|
||||
*/
|
||||
cp = NULL;
|
||||
} else
|
||||
cp += item_len;
|
||||
}
|
||||
return cp;
|
||||
}
|
||||
@ -1069,6 +1076,11 @@ isakmp_sub_print(u_char np, struct isakmp_gen *ext, u_char *ep,
|
||||
printf(")");
|
||||
depth--;
|
||||
|
||||
if (cp == NULL) {
|
||||
/* Zero-length subitem */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
np = e.np;
|
||||
ext = (struct isakmp_gen *)cp;
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-l2tp.c,v 1.10 2001/11/10 21:37:58 guy Exp $";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-l2tp.c,v 1.10.2.1 2002/05/25 09:47:07 guy Exp $";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -38,6 +38,7 @@ static const char rcsid[] =
|
||||
|
||||
#include "l2tp.h"
|
||||
#include "interface.h"
|
||||
#include "extract.h"
|
||||
|
||||
static char tstr[] = " [|l2tp]";
|
||||
|
||||
@ -263,13 +264,13 @@ print_octets(const u_char *dat, u_int length)
|
||||
static void
|
||||
print_16bits_val(const u_int16_t *dat)
|
||||
{
|
||||
printf("%u", ntohs(*dat));
|
||||
printf("%u", EXTRACT_16BITS(dat));
|
||||
}
|
||||
|
||||
static void
|
||||
print_32bits_val(const u_int32_t *dat)
|
||||
{
|
||||
printf("%lu", (u_long)ntohl(*dat));
|
||||
printf("%lu", (u_long)EXTRACT_32BITS(dat));
|
||||
}
|
||||
|
||||
/***********************************/
|
||||
@ -280,7 +281,8 @@ l2tp_msgtype_print(const u_char *dat)
|
||||
{
|
||||
u_int16_t *ptr = (u_int16_t*)dat;
|
||||
|
||||
printf("%s", tok2str(l2tp_msgtype2str, "MSGTYPE-#%u", ntohs(*ptr)));
|
||||
printf("%s", tok2str(l2tp_msgtype2str, "MSGTYPE-#%u",
|
||||
EXTRACT_16BITS(ptr)));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -288,11 +290,11 @@ l2tp_result_code_print(const u_char *dat, u_int length)
|
||||
{
|
||||
u_int16_t *ptr = (u_int16_t *)dat;
|
||||
|
||||
printf("%u", ntohs(*ptr++)); /* Result Code */
|
||||
if (length > 2) { /* Error Code (opt) */
|
||||
printf("/%u", ntohs(*ptr++));
|
||||
printf("%u", EXTRACT_16BITS(ptr)); ptr++; /* Result Code */
|
||||
if (length > 2) { /* Error Code (opt) */
|
||||
printf("/%u", EXTRACT_16BITS(ptr)); ptr++;
|
||||
}
|
||||
if (length > 4) { /* Error Message (opt) */
|
||||
if (length > 4) { /* Error Message (opt) */
|
||||
printf(" ");
|
||||
print_string((u_char *)ptr, length - 4);
|
||||
}
|
||||
@ -301,7 +303,8 @@ l2tp_result_code_print(const u_char *dat, u_int length)
|
||||
static void
|
||||
l2tp_proto_ver_print(const u_int16_t *dat)
|
||||
{
|
||||
printf("%u.%u", (ntohs(*dat) >> 8), (ntohs(*dat) & 0xff));
|
||||
printf("%u.%u", (EXTRACT_16BITS(dat) >> 8),
|
||||
(EXTRACT_16BITS(dat) & 0xff));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -309,10 +312,10 @@ l2tp_framing_cap_print(const u_char *dat)
|
||||
{
|
||||
u_int32_t *ptr = (u_int32_t *)dat;
|
||||
|
||||
if (ntohl(*ptr) & L2TP_FRAMING_CAP_ASYNC_MASK) {
|
||||
if (EXTRACT_32BITS(ptr) & L2TP_FRAMING_CAP_ASYNC_MASK) {
|
||||
printf("A");
|
||||
}
|
||||
if (ntohl(*ptr) & L2TP_FRAMING_CAP_SYNC_MASK) {
|
||||
if (EXTRACT_32BITS(ptr) & L2TP_FRAMING_CAP_SYNC_MASK) {
|
||||
printf("S");
|
||||
}
|
||||
}
|
||||
@ -322,10 +325,10 @@ l2tp_bearer_cap_print(const u_char *dat)
|
||||
{
|
||||
u_int32_t *ptr = (u_int32_t *)dat;
|
||||
|
||||
if (ntohl(*ptr) & L2TP_BEARER_CAP_ANALOG_MASK) {
|
||||
if (EXTRACT_32BITS(ptr) & L2TP_BEARER_CAP_ANALOG_MASK) {
|
||||
printf("A");
|
||||
}
|
||||
if (ntohl(*ptr) & L2TP_BEARER_CAP_DIGITAL_MASK) {
|
||||
if (EXTRACT_32BITS(ptr) & L2TP_BEARER_CAP_DIGITAL_MASK) {
|
||||
printf("D");
|
||||
}
|
||||
}
|
||||
@ -346,10 +349,10 @@ l2tp_bearer_type_print(const u_char *dat)
|
||||
{
|
||||
u_int32_t *ptr = (u_int32_t *)dat;
|
||||
|
||||
if (ntohl(*ptr) & L2TP_BEARER_TYPE_ANALOG_MASK) {
|
||||
if (EXTRACT_32BITS(ptr) & L2TP_BEARER_TYPE_ANALOG_MASK) {
|
||||
printf("A");
|
||||
}
|
||||
if (ntohl(*ptr) & L2TP_BEARER_TYPE_DIGITAL_MASK) {
|
||||
if (EXTRACT_32BITS(ptr) & L2TP_BEARER_TYPE_DIGITAL_MASK) {
|
||||
printf("D");
|
||||
}
|
||||
}
|
||||
@ -359,10 +362,10 @@ l2tp_framing_type_print(const u_char *dat)
|
||||
{
|
||||
u_int32_t *ptr = (u_int32_t *)dat;
|
||||
|
||||
if (ntohl(*ptr) & L2TP_FRAMING_TYPE_ASYNC_MASK) {
|
||||
if (EXTRACT_32BITS(ptr) & L2TP_FRAMING_TYPE_ASYNC_MASK) {
|
||||
printf("A");
|
||||
}
|
||||
if (ntohl(*ptr) & L2TP_FRAMING_TYPE_SYNC_MASK) {
|
||||
if (EXTRACT_32BITS(ptr) & L2TP_FRAMING_TYPE_SYNC_MASK) {
|
||||
printf("S");
|
||||
}
|
||||
}
|
||||
@ -379,7 +382,7 @@ l2tp_proxy_auth_type_print(const u_char *dat)
|
||||
u_int16_t *ptr = (u_int16_t *)dat;
|
||||
|
||||
printf("%s", tok2str(l2tp_authentype2str,
|
||||
"AuthType-#%u", ntohs(*ptr)));
|
||||
"AuthType-#%u", EXTRACT_16BITS(ptr)));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -387,7 +390,7 @@ l2tp_proxy_auth_id_print(const u_char *dat)
|
||||
{
|
||||
u_int16_t *ptr = (u_int16_t *)dat;
|
||||
|
||||
printf("%u", ntohs(*ptr) & L2TP_PROXY_AUTH_ID_MASK);
|
||||
printf("%u", EXTRACT_16BITS(ptr) & L2TP_PROXY_AUTH_ID_MASK);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -398,28 +401,28 @@ l2tp_call_errors_print(const u_char *dat)
|
||||
|
||||
ptr++; /* skip "Reserved" */
|
||||
|
||||
val_h = ntohs(*ptr++);
|
||||
val_l = ntohs(*ptr++);
|
||||
val_h = EXTRACT_16BITS(ptr); ptr++;
|
||||
val_l = EXTRACT_16BITS(ptr); ptr++;
|
||||
printf("CRCErr=%u ", (val_h<<16) + val_l);
|
||||
|
||||
val_h = ntohs(*ptr++);
|
||||
val_l = ntohs(*ptr++);
|
||||
val_h = EXTRACT_16BITS(ptr); ptr++;
|
||||
val_l = EXTRACT_16BITS(ptr); ptr++;
|
||||
printf("FrameErr=%u ", (val_h<<16) + val_l);
|
||||
|
||||
val_h = ntohs(*ptr++);
|
||||
val_l = ntohs(*ptr++);
|
||||
val_h = EXTRACT_16BITS(ptr); ptr++;
|
||||
val_l = EXTRACT_16BITS(ptr); ptr++;
|
||||
printf("HardOver=%u ", (val_h<<16) + val_l);
|
||||
|
||||
val_h = ntohs(*ptr++);
|
||||
val_l = ntohs(*ptr++);
|
||||
val_h = EXTRACT_16BITS(ptr); ptr++;
|
||||
val_l = EXTRACT_16BITS(ptr); ptr++;
|
||||
printf("BufOver=%u ", (val_h<<16) + val_l);
|
||||
|
||||
val_h = ntohs(*ptr++);
|
||||
val_l = ntohs(*ptr++);
|
||||
val_h = EXTRACT_16BITS(ptr); ptr++;
|
||||
val_l = EXTRACT_16BITS(ptr); ptr++;
|
||||
printf("Timeout=%u ", (val_h<<16) + val_l);
|
||||
|
||||
val_h = ntohs(*ptr++);
|
||||
val_l = ntohs(*ptr++);
|
||||
val_h = EXTRACT_16BITS(ptr); ptr++;
|
||||
val_l = EXTRACT_16BITS(ptr); ptr++;
|
||||
printf("AlignErr=%u ", (val_h<<16) + val_l);
|
||||
}
|
||||
|
||||
@ -431,12 +434,12 @@ l2tp_accm_print(const u_char *dat)
|
||||
|
||||
ptr++; /* skip "Reserved" */
|
||||
|
||||
val_h = ntohs(*ptr++);
|
||||
val_l = ntohs(*ptr++);
|
||||
val_h = EXTRACT_16BITS(ptr); ptr++;
|
||||
val_l = EXTRACT_16BITS(ptr); ptr++;
|
||||
printf("send=%08x ", (val_h<<16) + val_l);
|
||||
|
||||
val_h = ntohs(*ptr++);
|
||||
val_l = ntohs(*ptr++);
|
||||
val_h = EXTRACT_16BITS(ptr); ptr++;
|
||||
val_l = EXTRACT_16BITS(ptr); ptr++;
|
||||
printf("recv=%08x ", (val_h<<16) + val_l);
|
||||
}
|
||||
|
||||
@ -445,8 +448,8 @@ l2tp_ppp_discon_cc_print(const u_char *dat, u_int length)
|
||||
{
|
||||
u_int16_t *ptr = (u_int16_t *)dat;
|
||||
|
||||
printf("%04x, ", ntohs(*ptr++)); /* Disconnect Code */
|
||||
printf("%04x ", ntohs(*ptr++)); /* Control Protocol Number */
|
||||
printf("%04x, ", EXTRACT_16BITS(ptr)); ptr++; /* Disconnect Code */
|
||||
printf("%04x ", EXTRACT_16BITS(ptr)); ptr++; /* Control Protocol Number */
|
||||
printf("%s", tok2str(l2tp_cc_direction2str,
|
||||
"Direction-#%u", *((u_char *)ptr++)));
|
||||
|
||||
@ -471,33 +474,33 @@ l2tp_avp_print(const u_char *dat, int length)
|
||||
printf(" ");
|
||||
|
||||
TCHECK(*ptr); /* Flags & Length */
|
||||
len = ntohs(*ptr) & L2TP_AVP_HDR_LEN_MASK;
|
||||
len = EXTRACT_16BITS(ptr) & L2TP_AVP_HDR_LEN_MASK;
|
||||
|
||||
/* If it is not long enough to decode the entire AVP, we'll
|
||||
abandon. */
|
||||
TCHECK2(*ptr, len);
|
||||
/* After this point, no need to worry about truncation */
|
||||
|
||||
if (ntohs(*ptr) & L2TP_AVP_HDR_FLAG_MANDATORY) {
|
||||
if (EXTRACT_16BITS(ptr) & L2TP_AVP_HDR_FLAG_MANDATORY) {
|
||||
printf("*");
|
||||
}
|
||||
if (ntohs(*ptr) & L2TP_AVP_HDR_FLAG_HIDDEN) {
|
||||
if (EXTRACT_16BITS(ptr) & L2TP_AVP_HDR_FLAG_HIDDEN) {
|
||||
hidden = TRUE;
|
||||
printf("?");
|
||||
}
|
||||
ptr++;
|
||||
|
||||
if (ntohs(*ptr)) {
|
||||
if (EXTRACT_16BITS(ptr)) {
|
||||
/* Vendor Specific Attribute */
|
||||
printf("VENDOR%04x:", ntohs(*ptr++));
|
||||
printf("ATTR%04x", ntohs(*ptr++));
|
||||
printf("VENDOR%04x:", EXTRACT_16BITS(ptr)); ptr++;
|
||||
printf("ATTR%04x", EXTRACT_16BITS(ptr)); ptr++;
|
||||
printf("(");
|
||||
print_octets((u_char *)ptr, len-6);
|
||||
printf(")");
|
||||
} else {
|
||||
/* IETF-defined Attributes */
|
||||
ptr++;
|
||||
attr_type = ntohs(*ptr++);
|
||||
attr_type = EXTRACT_16BITS(ptr); ptr++;
|
||||
printf("%s", tok2str(l2tp_avp2str, "AVP-#%u", attr_type));
|
||||
printf("(");
|
||||
if (hidden) {
|
||||
@ -613,9 +616,9 @@ l2tp_print(const u_char *dat, u_int length)
|
||||
flag_t = flag_l = flag_s = flag_o = flag_p = FALSE;
|
||||
|
||||
TCHECK(*ptr); /* Flags & Version */
|
||||
if ((ntohs(*ptr) & L2TP_VERSION_MASK) == L2TP_VERSION_L2TP) {
|
||||
if ((EXTRACT_16BITS(ptr) & L2TP_VERSION_MASK) == L2TP_VERSION_L2TP) {
|
||||
printf(" l2tp:");
|
||||
} else if ((ntohs(*ptr) & L2TP_VERSION_MASK) == L2TP_VERSION_L2F) {
|
||||
} else if ((EXTRACT_16BITS(ptr) & L2TP_VERSION_MASK) == L2TP_VERSION_L2F) {
|
||||
printf(" l2f:");
|
||||
return; /* nothing to do */
|
||||
} else {
|
||||
@ -624,23 +627,23 @@ l2tp_print(const u_char *dat, u_int length)
|
||||
}
|
||||
|
||||
printf("[");
|
||||
if (ntohs(*ptr) & L2TP_FLAG_TYPE) {
|
||||
if (EXTRACT_16BITS(ptr) & L2TP_FLAG_TYPE) {
|
||||
flag_t = TRUE;
|
||||
printf("T");
|
||||
}
|
||||
if (ntohs(*ptr) & L2TP_FLAG_LENGTH) {
|
||||
if (EXTRACT_16BITS(ptr) & L2TP_FLAG_LENGTH) {
|
||||
flag_l = TRUE;
|
||||
printf("L");
|
||||
}
|
||||
if (ntohs(*ptr) & L2TP_FLAG_SEQUENCE) {
|
||||
if (EXTRACT_16BITS(ptr) & L2TP_FLAG_SEQUENCE) {
|
||||
flag_s = TRUE;
|
||||
printf("S");
|
||||
}
|
||||
if (ntohs(*ptr) & L2TP_FLAG_OFFSET) {
|
||||
if (EXTRACT_16BITS(ptr) & L2TP_FLAG_OFFSET) {
|
||||
flag_o = TRUE;
|
||||
printf("O");
|
||||
}
|
||||
if (ntohs(*ptr) & L2TP_FLAG_PRIORITY) {
|
||||
if (EXTRACT_16BITS(ptr) & L2TP_FLAG_PRIORITY) {
|
||||
flag_p = TRUE;
|
||||
printf("P");
|
||||
}
|
||||
@ -651,31 +654,31 @@ l2tp_print(const u_char *dat, u_int length)
|
||||
|
||||
if (flag_l) {
|
||||
TCHECK(*ptr); /* Length */
|
||||
l2tp_len = ntohs(*ptr++);
|
||||
l2tp_len = EXTRACT_16BITS(ptr); ptr++;
|
||||
cnt += 2;
|
||||
} else {
|
||||
l2tp_len = 0;
|
||||
}
|
||||
|
||||
TCHECK(*ptr); /* Tunnel ID */
|
||||
printf("(%u/", ntohs(*ptr++));
|
||||
printf("(%u/", EXTRACT_16BITS(ptr)); ptr++;
|
||||
cnt += 2;
|
||||
TCHECK(*ptr); /* Session ID */
|
||||
printf("%u)", ntohs(*ptr++));
|
||||
printf("%u)", EXTRACT_16BITS(ptr)); ptr++;
|
||||
cnt += 2;
|
||||
|
||||
if (flag_s) {
|
||||
TCHECK(*ptr); /* Ns */
|
||||
printf("Ns=%u,", ntohs(*ptr++));
|
||||
printf("Ns=%u,", EXTRACT_16BITS(ptr)); ptr++;
|
||||
cnt += 2;
|
||||
TCHECK(*ptr); /* Nr */
|
||||
printf("Nr=%u", ntohs(*ptr++));
|
||||
printf("Nr=%u", EXTRACT_16BITS(ptr)); ptr++;
|
||||
cnt += 2;
|
||||
}
|
||||
|
||||
if (flag_o) {
|
||||
TCHECK(*ptr); /* Offset Size */
|
||||
pad = ntohs(*ptr++);
|
||||
pad = EXTRACT_16BITS(ptr); ptr++;
|
||||
ptr += pad / sizeof(*ptr);
|
||||
cnt += (2 + pad);
|
||||
}
|
||||
|
@ -42,12 +42,11 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.7 2001/08/20 17:53:54 fenner Exp $";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.7.4.1 2002/06/01 23:51:14 guy Exp $";
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-mpls.c,v 1.2 2001/06/26 06:24:57 guy Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-mpls.c,v 1.2.4.1 2002/05/07 18:36:28 fenner Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -83,23 +83,24 @@ mpls_print(const u_char *bp, u_int length)
|
||||
|
||||
p = bp;
|
||||
printf("MPLS");
|
||||
TCHECK2(*p, sizeof(v));
|
||||
memcpy(&v, p, sizeof(v));
|
||||
v = (u_int32_t)ntohl(v);
|
||||
printf(" ("); /*)*/
|
||||
printf("label 0x%x", MPLS_LABEL(v));
|
||||
if (vflag &&
|
||||
MPLS_LABEL(v) < sizeof(mpls_labelname) / sizeof(mpls_labelname[0]))
|
||||
printf("(%s)", mpls_labelname[MPLS_LABEL(v)]);
|
||||
if (MPLS_EXP(v))
|
||||
printf(" exp 0x%x", MPLS_EXP(v));
|
||||
if (MPLS_STACK(v))
|
||||
printf("[S]");
|
||||
printf(" TTL %u", MPLS_TTL(v));
|
||||
/*(*/
|
||||
printf(")");
|
||||
do {
|
||||
TCHECK2(*p, sizeof(v));
|
||||
v = EXTRACT_32BITS(p);
|
||||
printf(" ("); /*)*/
|
||||
printf("label 0x%x", MPLS_LABEL(v));
|
||||
if (vflag &&
|
||||
MPLS_LABEL(v) < sizeof(mpls_labelname) / sizeof(mpls_labelname[0]))
|
||||
printf("(%s)", mpls_labelname[MPLS_LABEL(v)]);
|
||||
if (MPLS_EXP(v))
|
||||
printf(" exp 0x%x", MPLS_EXP(v));
|
||||
if (MPLS_STACK(v))
|
||||
printf("[S]");
|
||||
printf(" TTL %u", MPLS_TTL(v));
|
||||
/*(*/
|
||||
printf(")");
|
||||
|
||||
p += sizeof(v);
|
||||
p += sizeof(v);
|
||||
} while (!MPLS_STACK(v));
|
||||
|
||||
switch (MPLS_LABEL(v)) {
|
||||
case 0: /* IPv4 explicit NULL label */
|
||||
|
@ -44,7 +44,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"$Id: print-radius.c,v 1.10 2001/10/22 06:58:33 itojun Exp $";
|
||||
"$Id: print-radius.c,v 1.10.2.2 2002/07/03 16:35:04 fenner Exp $";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -59,6 +59,10 @@ static const char rcsid[] =
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#include "interface.h"
|
||||
#include "addrtoname.h"
|
||||
#include "extract.h"
|
||||
@ -522,7 +526,8 @@ print_attr_num(register u_char *data, u_int length, u_short attr_code )
|
||||
data_value = EXTRACT_32BITS(data);
|
||||
}
|
||||
if ( data_value <= (attr_type[attr_code].siz_subtypes - 1 +
|
||||
attr_type[attr_code].first_subtype) )
|
||||
attr_type[attr_code].first_subtype) &&
|
||||
data_value >= attr_type[attr_code].first_subtype )
|
||||
printf("{%s}",table[data_value]);
|
||||
else
|
||||
printf("{#%d}",data_value);
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.34 2001/07/05 18:54:17 guy Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.34.4.1 2002/06/01 23:51:15 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -31,8 +31,6 @@ static const char rcsid[] =
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-rx.c,v 1.27 2001/10/20 07:41:55 itojun Exp $";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-rx.c,v 1.27.2.2 2002/07/10 07:17:57 guy Exp $";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -44,7 +44,9 @@ static const char rcsid[] =
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
#include <time.h>
|
||||
#endif
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
@ -755,15 +757,15 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, int sport,
|
||||
* This is the sickest one of all
|
||||
*/
|
||||
|
||||
#define VECOUT(MAX) { char *sp; \
|
||||
char s[AFSNAMEMAX]; \
|
||||
#define VECOUT(MAX) { u_char *sp; \
|
||||
u_char s[AFSNAMEMAX]; \
|
||||
int k; \
|
||||
if ((MAX) + 1 > sizeof(s)) \
|
||||
goto trunc; \
|
||||
TCHECK2(bp[0], (MAX) * sizeof(int32_t)); \
|
||||
sp = s; \
|
||||
for (k = 0; k < (MAX); k++) { \
|
||||
*sp++ = (char) EXTRACT_32BITS(bp); \
|
||||
*sp++ = (u_char) EXTRACT_32BITS(bp); \
|
||||
bp += sizeof(int32_t); \
|
||||
} \
|
||||
s[(MAX)] = '\0'; \
|
||||
@ -1128,7 +1130,7 @@ acl_print(u_char *s, int maxsize, u_char *end)
|
||||
goto finish;
|
||||
s += n;
|
||||
printf(" +{");
|
||||
fn_print(user, NULL);
|
||||
fn_print((u_char *)user, NULL);
|
||||
printf(" ");
|
||||
ACLOUT(acl);
|
||||
printf("}");
|
||||
@ -1141,7 +1143,7 @@ acl_print(u_char *s, int maxsize, u_char *end)
|
||||
goto finish;
|
||||
s += n;
|
||||
printf(" -{");
|
||||
fn_print(user, NULL);
|
||||
fn_print((u_char *)user, NULL);
|
||||
printf(" ");
|
||||
ACLOUT(acl);
|
||||
printf("}");
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.7 2001/12/12 07:16:40 guy Exp $ (NETLAB/PEL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.7.2.1 2002/07/10 07:20:57 guy Exp $ (NETLAB/PEL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -74,25 +74,25 @@ void sctp_print(const u_char *bp, /* beginning of sctp packet */
|
||||
const struct ip6_hdr *ip6;
|
||||
#endif
|
||||
const u_char *cp;
|
||||
void *endPacketPtr;
|
||||
const void *endPacketPtr;
|
||||
u_short sourcePort, destPort;
|
||||
int chunkCount;
|
||||
struct sctpChunkDesc *chunkDescPtr;
|
||||
void *nextChunk;
|
||||
const struct sctpChunkDesc *chunkDescPtr;
|
||||
const void *nextChunk;
|
||||
|
||||
sctpPktHdr = (struct sctpHeader*) bp;
|
||||
endPacketPtr = ((u_char*)((u_char*)sctpPktHdr+sctpPacketLength));
|
||||
sctpPktHdr = (const struct sctpHeader*) bp;
|
||||
endPacketPtr = (const u_char*)sctpPktHdr+sctpPacketLength;
|
||||
|
||||
if( (u_long) endPacketPtr > (u_long) snapend)
|
||||
endPacketPtr = (void *) snapend;
|
||||
endPacketPtr = (const void *) snapend;
|
||||
ip = (struct ip *)bp2;
|
||||
#ifdef INET6
|
||||
if (IP_V(ip) == 6)
|
||||
ip6 = (struct ip6_hdr *)bp2;
|
||||
ip6 = (const struct ip6_hdr *)bp2;
|
||||
else
|
||||
ip6 = NULL;
|
||||
#endif /*INET6*/
|
||||
cp = (u_char *)(sctpPktHdr + 1);
|
||||
cp = (const u_char *)(sctpPktHdr + 1);
|
||||
if (cp > snapend)
|
||||
{
|
||||
printf("[|sctp]");
|
||||
@ -145,31 +145,32 @@ void sctp_print(const u_char *bp, /* beginning of sctp packet */
|
||||
|
||||
/* cycle through all chunks, printing information on each one */
|
||||
for (chunkCount = 0,
|
||||
chunkDescPtr = (struct sctpChunkDesc *) ( (u_char*) sctpPktHdr +
|
||||
sizeof(struct sctpHeader));
|
||||
chunkDescPtr = (const struct sctpChunkDesc *)
|
||||
((const u_char*) sctpPktHdr + sizeof(struct sctpHeader));
|
||||
chunkDescPtr != NULL &&
|
||||
( (void *) ((u_char *) chunkDescPtr + sizeof(struct sctpChunkDesc))
|
||||
( (const void *)
|
||||
((const u_char *) chunkDescPtr + sizeof(struct sctpChunkDesc))
|
||||
<= endPacketPtr);
|
||||
|
||||
chunkDescPtr = (struct sctpChunkDesc *) nextChunk, chunkCount++)
|
||||
chunkDescPtr = (const struct sctpChunkDesc *) nextChunk, chunkCount++)
|
||||
{
|
||||
u_short align;
|
||||
u_char *chunkEnd;
|
||||
const u_char *chunkEnd;
|
||||
|
||||
chunkEnd = ((u_char*)chunkDescPtr + ntohs(chunkDescPtr->chunkLength));
|
||||
chunkEnd = ((const u_char*)chunkDescPtr + ntohs(chunkDescPtr->chunkLength));
|
||||
|
||||
align=ntohs(chunkDescPtr->chunkLength) % 4;
|
||||
if (align != 0)
|
||||
align = 4 - align;
|
||||
|
||||
nextChunk = (void *) (chunkEnd + align);
|
||||
nextChunk = (const void *) (chunkEnd + align);
|
||||
|
||||
printf("\n\t%d) ", chunkCount+1);
|
||||
switch (chunkDescPtr->chunkID)
|
||||
{
|
||||
case SCTP_DATA :
|
||||
{
|
||||
struct sctpDataPart *dataHdrPtr;
|
||||
const struct sctpDataPart *dataHdrPtr;
|
||||
|
||||
printf("[DATA] ");
|
||||
|
||||
@ -195,7 +196,7 @@ void sctp_print(const u_char *bp, /* beginning of sctp packet */
|
||||
== SCTP_DATA_LAST_FRAG) )
|
||||
printf(" ");
|
||||
|
||||
dataHdrPtr=(struct sctpDataPart*)(chunkDescPtr+1);
|
||||
dataHdrPtr=(const struct sctpDataPart*)(chunkDescPtr+1);
|
||||
|
||||
printf("[TSN: %u] ", (u_int32_t)ntohl(dataHdrPtr->TSN));
|
||||
printf("[SID: %u] ", ntohs(dataHdrPtr->streamId));
|
||||
@ -205,12 +206,12 @@ void sctp_print(const u_char *bp, /* beginning of sctp packet */
|
||||
|
||||
if (vflag) /* if verbose output is specified */
|
||||
{ /* at the command line */
|
||||
char *payloadPtr;
|
||||
const u_char *payloadPtr;
|
||||
|
||||
printf("[Payload");
|
||||
|
||||
if (!xflag && !qflag) {
|
||||
payloadPtr = (char *) (++dataHdrPtr);
|
||||
payloadPtr = (const u_char *) (++dataHdrPtr);
|
||||
printf(":");
|
||||
default_print(payloadPtr,
|
||||
htons(chunkDescPtr->chunkLength)-1 -
|
||||
@ -222,10 +223,10 @@ void sctp_print(const u_char *bp, /* beginning of sctp packet */
|
||||
}
|
||||
case SCTP_INITIATION :
|
||||
{
|
||||
struct sctpInitiation *init;
|
||||
const struct sctpInitiation *init;
|
||||
|
||||
printf("[INIT] ");
|
||||
init=(struct sctpInitiation*)(chunkDescPtr+1);
|
||||
init=(const struct sctpInitiation*)(chunkDescPtr+1);
|
||||
printf("[init tag: %u] ", (u_int32_t)ntohl(init->initTag));
|
||||
printf("[rwnd: %u] ", (u_int32_t)ntohl(init->rcvWindowCredit));
|
||||
printf("[OS: %u] ", ntohs(init->NumPreopenStreams));
|
||||
@ -241,10 +242,10 @@ void sctp_print(const u_char *bp, /* beginning of sctp packet */
|
||||
}
|
||||
case SCTP_INITIATION_ACK :
|
||||
{
|
||||
struct sctpInitiation *init;
|
||||
const struct sctpInitiation *init;
|
||||
|
||||
printf("[INIT ACK] ");
|
||||
init=(struct sctpInitiation*)(chunkDescPtr+1);
|
||||
init=(const struct sctpInitiation*)(chunkDescPtr+1);
|
||||
printf("[init tag: %u] ", (u_int32_t)ntohl(init->initTag));
|
||||
printf("[rwnd: %u] ", (u_int32_t)ntohl(init->rcvWindowCredit));
|
||||
printf("[OS: %u] ", ntohs(init->NumPreopenStreams));
|
||||
@ -260,13 +261,13 @@ void sctp_print(const u_char *bp, /* beginning of sctp packet */
|
||||
}
|
||||
case SCTP_SELECTIVE_ACK:
|
||||
{
|
||||
struct sctpSelectiveAck *sack;
|
||||
struct sctpSelectiveFrag *frag;
|
||||
const struct sctpSelectiveAck *sack;
|
||||
const struct sctpSelectiveFrag *frag;
|
||||
int fragNo, tsnNo;
|
||||
u_long *dupTSN;
|
||||
const u_long *dupTSN;
|
||||
|
||||
printf("[SACK] ");
|
||||
sack=(struct sctpSelectiveAck*)(chunkDescPtr+1);
|
||||
sack=(const struct sctpSelectiveAck*)(chunkDescPtr+1);
|
||||
printf("[cum ack %u] ", (u_int32_t)ntohl(sack->highestConseqTSN));
|
||||
printf("[a_rwnd %u] ", (u_int32_t)ntohl(sack->updatedRwnd));
|
||||
printf("[#gap acks %u] ", ntohs(sack->numberOfdesc));
|
||||
@ -274,10 +275,10 @@ void sctp_print(const u_char *bp, /* beginning of sctp packet */
|
||||
|
||||
|
||||
/* print gaps */
|
||||
for (frag = ( (struct sctpSelectiveFrag *)
|
||||
((struct sctpSelectiveAck *) sack+1)),
|
||||
for (frag = ( (const struct sctpSelectiveFrag *)
|
||||
((const struct sctpSelectiveAck *) sack+1)),
|
||||
fragNo=0;
|
||||
(void *)frag < nextChunk && fragNo < ntohs(sack->numberOfdesc);
|
||||
(const void *)frag < nextChunk && fragNo < ntohs(sack->numberOfdesc);
|
||||
frag++, fragNo++)
|
||||
printf("\n\t\t[gap ack block #%d: start = %u, end = %u] ",
|
||||
fragNo+1,
|
||||
@ -286,8 +287,8 @@ void sctp_print(const u_char *bp, /* beginning of sctp packet */
|
||||
|
||||
|
||||
/* print duplicate TSNs */
|
||||
for (dupTSN = (u_long*)frag, tsnNo=0;
|
||||
(void *) dupTSN < nextChunk && tsnNo<ntohs(sack->numDupTsns);
|
||||
for (dupTSN = (const u_long*)frag, tsnNo=0;
|
||||
(const void *) dupTSN < nextChunk && tsnNo<ntohs(sack->numDupTsns);
|
||||
dupTSN++, tsnNo++)
|
||||
printf("\n\t\t[dup TSN #%u: %u] ", tsnNo+1,
|
||||
(u_int32_t)ntohl(*dupTSN));
|
||||
@ -296,9 +297,9 @@ void sctp_print(const u_char *bp, /* beginning of sctp packet */
|
||||
}
|
||||
case SCTP_HEARTBEAT_REQUEST :
|
||||
{
|
||||
struct sctpHBsender *hb;
|
||||
const struct sctpHBsender *hb;
|
||||
|
||||
hb=(struct sctpHBsender*)chunkDescPtr;
|
||||
hb=(const struct sctpHBsender*)chunkDescPtr;
|
||||
|
||||
printf("[HB REQ] ");
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-sll.c,v 1.6 2001/07/05 18:54:18 guy Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-sll.c,v 1.6.4.1 2002/06/01 23:51:16 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -31,9 +31,6 @@ static const char rcsid[] =
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
struct mbuf;
|
||||
struct rtentry;
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -12,13 +12,15 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-smb.c,v 1.20 2002/01/17 04:38:29 guy Exp $";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-smb.c,v 1.20.2.4 2002/07/11 07:47:01 guy Exp $";
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include "interface.h"
|
||||
#include "extract.h"
|
||||
#include "smb.h"
|
||||
@ -173,7 +175,7 @@ print_trans2(const u_char *words, const u_char *dat, const u_char *buf, const u_
|
||||
static struct smbfnsint *fn = &trans2_fns[0];
|
||||
const u_char *data, *param;
|
||||
const u_char *w = words + 1;
|
||||
const u_char *f1 = NULL, *f2 = NULL;
|
||||
const char *f1 = NULL, *f2 = NULL;
|
||||
int pcnt, dcnt;
|
||||
|
||||
TCHECK(words[0]);
|
||||
@ -224,8 +226,8 @@ print_trans2(const u_char *words, const u_char *dat, const u_char *buf, const u_
|
||||
if (fn->descript.fn)
|
||||
(*fn->descript.fn)(param, data, pcnt, dcnt);
|
||||
else {
|
||||
smb_fdata(param, f1 ? f1 : (u_char *)"Paramaters=\n", param + pcnt);
|
||||
smb_fdata(data, f2 ? f2 : (u_char *)"Data=\n", data + dcnt);
|
||||
smb_fdata(param, f1 ? f1 : "Parameters=\n", param + pcnt);
|
||||
smb_fdata(data, f2 ? f2 : "Data=\n", data + dcnt);
|
||||
}
|
||||
return;
|
||||
trunc:
|
||||
@ -329,7 +331,7 @@ print_ipc(const u_char *param, int paramlen, const u_char *data, int datalen)
|
||||
static void
|
||||
print_trans(const u_char *words, const u_char *data1, const u_char *buf, const u_char *maxbuf)
|
||||
{
|
||||
const u_char *f1, *f2, *f3, *f4;
|
||||
const char *f1, *f2, *f3, *f4;
|
||||
const u_char *data, *param;
|
||||
const u_char *w = words + 1;
|
||||
int datalen, paramlen;
|
||||
@ -359,12 +361,12 @@ print_trans(const u_char *words, const u_char *data1, const u_char *buf, const u
|
||||
smb_fdata(words + 1, f1, SMBMIN(words + 1 + 2 * words[0], maxbuf));
|
||||
smb_fdata(data1 + 2, f2, maxbuf - (paramlen + datalen));
|
||||
|
||||
if (!strcmp(data1 + 2, "\\MAILSLOT\\BROWSE")) {
|
||||
if (strcmp((const char *)(data1 + 2), "\\MAILSLOT\\BROWSE") == 0) {
|
||||
print_browse(param, paramlen, data, datalen);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcmp(data1 + 2, "\\PIPE\\LANMAN")) {
|
||||
if (strcmp((const char *)(data1 + 2), "\\PIPE\\LANMAN") == 0) {
|
||||
print_ipc(param, paramlen, data, datalen);
|
||||
return;
|
||||
}
|
||||
@ -383,7 +385,7 @@ print_trans(const u_char *words, const u_char *data1, const u_char *buf, const u
|
||||
static void
|
||||
print_negprot(const u_char *words, const u_char *data, const u_char *buf, const u_char *maxbuf)
|
||||
{
|
||||
u_char *f1 = NULL, *f2 = NULL;
|
||||
const char *f1 = NULL, *f2 = NULL;
|
||||
|
||||
TCHECK(words[0]);
|
||||
if (request)
|
||||
@ -418,7 +420,7 @@ static void
|
||||
print_sesssetup(const u_char *words, const u_char *data, const u_char *buf, const u_char *maxbuf)
|
||||
{
|
||||
int wcnt;
|
||||
u_char *f1 = NULL, *f2 = NULL;
|
||||
const char *f1 = NULL, *f2 = NULL;
|
||||
|
||||
TCHECK(words[0]);
|
||||
wcnt = words[0];
|
||||
@ -762,7 +764,7 @@ print_smb(const u_char *buf, const u_char *maxbuf)
|
||||
TCHECK(words[0]);
|
||||
|
||||
for (;;) {
|
||||
const u_char *f1, *f2;
|
||||
const char *f1, *f2;
|
||||
int wct;
|
||||
int bcc;
|
||||
|
||||
@ -857,9 +859,9 @@ nbt_tcp_print(const u_char *data, int length)
|
||||
return;
|
||||
|
||||
if (vflag > 1)
|
||||
printf ("\n>>> ");
|
||||
printf ("\n>>>");
|
||||
|
||||
printf("NBT Packet");
|
||||
printf(" NBT Packet");
|
||||
|
||||
if (vflag < 2)
|
||||
return;
|
||||
@ -949,7 +951,7 @@ nbt_udp137_print(const u_char *data, int length)
|
||||
int name_trn_id, response, opcode, nm_flags, rcode;
|
||||
int qdcount, ancount, nscount, arcount;
|
||||
char *opcodestr;
|
||||
const char *p;
|
||||
const u_char *p;
|
||||
int total, i;
|
||||
|
||||
TCHECK2(data[10], 2);
|
||||
@ -1078,14 +1080,14 @@ nbt_udp137_print(const u_char *data, int length)
|
||||
p += 2;
|
||||
}
|
||||
} else {
|
||||
print_data(p, min(rdlen, length - ((const u_char *)p - data)));
|
||||
print_data(p, min(rdlen, length - (p - data)));
|
||||
p += rdlen;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((u_char*)p < maxbuf)
|
||||
if (p < maxbuf)
|
||||
smb_fdata(p, "AdditionalData:\n", maxbuf);
|
||||
|
||||
out:
|
||||
|
@ -58,7 +58,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-snmp.c,v 1.50 2001/09/17 22:16:53 fenner Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-snmp.c,v 1.50.4.2 2002/07/20 23:33:08 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -688,13 +688,17 @@ asn1_print(struct be *elem)
|
||||
|
||||
/*
|
||||
* first subitem encodes two items with 1st*OIDMUX+2nd
|
||||
* (see X.690:1997 clause 8.19 for the details)
|
||||
*/
|
||||
if (first < 0) {
|
||||
int s;
|
||||
if (!nflag)
|
||||
objp = mibroot;
|
||||
first = 0;
|
||||
OBJ_PRINT(o/OIDMUX, first);
|
||||
o %= OIDMUX;
|
||||
s = o / OIDMUX;
|
||||
if (s > 2) s = 2;
|
||||
OBJ_PRINT(s, first);
|
||||
o -= s * OIDMUX;
|
||||
}
|
||||
OBJ_PRINT(o, first);
|
||||
if (--first < 0)
|
||||
@ -875,16 +879,19 @@ static void smi_decode_oid(struct be *elem, unsigned int *oid,
|
||||
|
||||
/*
|
||||
* first subitem encodes two items with 1st*OIDMUX+2nd
|
||||
* (see X.690:1997 clause 8.19 for the details)
|
||||
*/
|
||||
if (first < 0) {
|
||||
first = 0;
|
||||
if (*oidlen < oidsize) {
|
||||
oid[(*oidlen)++] = o/OIDMUX;
|
||||
oid[*oidlen] = o / OIDMUX;
|
||||
if (oid[*oidlen] > 2) oid[*oidlen] = 2;
|
||||
}
|
||||
o %= OIDMUX;
|
||||
o -= oid[*oidlen] * OIDMUX;
|
||||
if (*oidlen < oidsize) (*oidlen)++;
|
||||
}
|
||||
if (*oidlen < oidsize) {
|
||||
oid[(*oidlen)++] = o;
|
||||
oid[(*oidlen)++] = o;
|
||||
}
|
||||
o = 0;
|
||||
}
|
||||
@ -1530,8 +1537,9 @@ community_print(const u_char *np, u_int length, int version)
|
||||
return;
|
||||
}
|
||||
/* default community */
|
||||
if (strncmp((char *)elem.data.str, DEF_COMMUNITY,
|
||||
sizeof(DEF_COMMUNITY) - 1))
|
||||
if (!(elem.asnlen == sizeof(DEF_COMMUNITY) - 1 &&
|
||||
strncmp((char *)elem.data.str, DEF_COMMUNITY,
|
||||
sizeof(DEF_COMMUNITY) - 1) == 0))
|
||||
/* ! "public" */
|
||||
printf("C=%.*s ", (int)elem.asnlen, elem.data.str);
|
||||
length -= count;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-stp.c,v 1.6 2000/09/29 04:58:50 guy Exp $";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-stp.c,v 1.6.6.1 2002/05/29 10:00:00 guy Exp $";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -96,7 +96,7 @@ stp_print(const u_char *p, u_int length)
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("unknown type %i\n", p[6]);
|
||||
printf("unknown type %i", p[6]);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-zephyr.c,v 1.2 2001/09/11 02:37:12 guy Exp $";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/print-zephyr.c,v 1.2.4.2 2002/07/11 07:49:19 guy Exp $";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -56,7 +56,7 @@ struct z_packet {
|
||||
/* Other fields follow here.. */
|
||||
};
|
||||
|
||||
enum {
|
||||
enum z_packet_type {
|
||||
Z_PACKET_UNSAFE = 0,
|
||||
Z_PACKET_UNACKED,
|
||||
Z_PACKET_ACKED,
|
||||
@ -66,7 +66,7 @@ enum {
|
||||
Z_PACKET_SERVNAK,
|
||||
Z_PACKET_CLIENTACK,
|
||||
Z_PACKET_STAT
|
||||
} z_packet_type;
|
||||
};
|
||||
|
||||
static struct tok z_types[] = {
|
||||
{ Z_PACKET_UNSAFE, "unsafe" },
|
||||
@ -122,7 +122,7 @@ str_to_lower(char *string)
|
||||
|
||||
string = z_buf;
|
||||
while (*string) {
|
||||
*string = tolower(*string);
|
||||
*string = tolower((unsigned char)(*string));
|
||||
string++;
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.18 2002/01/17 04:38:29 guy Exp $";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.18.2.3 2002/07/10 07:29:23 guy Exp $";
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -26,7 +26,9 @@ static const char rcsid[] =
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#include "interface.h"
|
||||
#include "extract.h"
|
||||
@ -336,7 +338,7 @@ write_bits(unsigned int val, char *fmt)
|
||||
|
||||
/* convert a UCS2 string into iso-8859-1 string */
|
||||
static const char *
|
||||
unistr(const char *s, int *len)
|
||||
unistr(const u_char *s, int *len)
|
||||
{
|
||||
static char buf[1000];
|
||||
int l=0;
|
||||
@ -352,8 +354,8 @@ unistr(const char *s, int *len)
|
||||
|
||||
/* maybe it isn't unicode - a cheap trick */
|
||||
if (!use_unicode || (s[0] && s[1])) {
|
||||
*len = strlen(s) + 1;
|
||||
return s;
|
||||
*len = strlen((const char *)s) + 1;
|
||||
return (const char *)s;
|
||||
}
|
||||
|
||||
*len = 0;
|
||||
@ -398,8 +400,11 @@ smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf)
|
||||
case '{':
|
||||
{
|
||||
char bitfmt[128];
|
||||
char *p = strchr(++fmt, '}');
|
||||
int l = PTR_DIFF(p, fmt);
|
||||
char *p;
|
||||
int l;
|
||||
|
||||
p = strchr(++fmt, '}');
|
||||
l = PTR_DIFF(p, fmt);
|
||||
strncpy(bitfmt, fmt, l);
|
||||
bitfmt[l] = 0;
|
||||
fmt = p + 1;
|
||||
@ -413,7 +418,7 @@ smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf)
|
||||
int l = atoi(fmt + 1);
|
||||
buf += l;
|
||||
fmt++;
|
||||
while (isdigit(*fmt))
|
||||
while (isdigit((unsigned char)*fmt))
|
||||
fmt++;
|
||||
break;
|
||||
}
|
||||
@ -527,7 +532,7 @@ smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf)
|
||||
printf("%-*.*s", l, l, buf);
|
||||
buf += l;
|
||||
fmt++;
|
||||
while (isdigit(*fmt))
|
||||
while (isdigit((unsigned char)*fmt))
|
||||
fmt++;
|
||||
break;
|
||||
}
|
||||
@ -537,7 +542,7 @@ smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf)
|
||||
while (l--)
|
||||
printf("%02x", *buf++);
|
||||
fmt++;
|
||||
while (isdigit(*fmt))
|
||||
while (isdigit((unsigned char)*fmt))
|
||||
fmt++;
|
||||
break;
|
||||
}
|
||||
@ -569,7 +574,7 @@ smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf)
|
||||
break;
|
||||
}
|
||||
fmt++;
|
||||
while (isdigit(*fmt))
|
||||
while (isdigit((unsigned char)*fmt))
|
||||
fmt++;
|
||||
break;
|
||||
}
|
||||
@ -601,7 +606,7 @@ smb_fdata1(const u_char *buf, const char *fmt, const u_char *maxbuf)
|
||||
}
|
||||
printf("%s", t ? asctime(localtime(&t)) : "NULL\n");
|
||||
fmt++;
|
||||
while (isdigit(*fmt))
|
||||
while (isdigit((unsigned char)*fmt))
|
||||
fmt++;
|
||||
break;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.72 2001/10/08 16:12:13 fenner Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.72.2.2 2002/07/16 04:03:54 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -354,8 +354,8 @@ safeputchar(int c)
|
||||
unsigned char ch;
|
||||
|
||||
ch = (unsigned char)(c & 0xff);
|
||||
if (c < 0x80 && isprint(c))
|
||||
printf("%c", c & 0xff);
|
||||
if (ch < 0x80 && isprint(ch))
|
||||
printf("%c", ch);
|
||||
else
|
||||
printf("\\%03o", c & 0xff);
|
||||
printf("\\%03o", ch);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user