sync with 3.8.3

This commit is contained in:
dyoung 2004-09-27 17:06:28 +00:00
parent d297b5849e
commit 64657f857f
60 changed files with 15685 additions and 3975 deletions

84
dist/tcpdump/CHANGES vendored
View File

@ -1,4 +1,84 @@
Header: /tcpdump/master/tcpdump/CHANGES,v 1.81 2002/01/21 11:03:33 mcr Exp Header: /tcpdump/master/tcpdump/CHANGES,v 1.84.2.3 2004/03/30 14:36:24 mcr Exp
Tue. March 30, 2004. mcr@sandelman.ottawa.on.ca. Summary for 3.8.3 release
No changes from 3.8.2. Version bumped only to maintain consistency
with libpcap 0.8.3.
Mon. March 29, 2004. mcr@sandelman.ottawa.on.ca. Summary for 3.8.2 release
Fixes for print-isakmp.c CVE: CAN-2004-0183, CAN-2004-0184
http://www.rapid7.com/advisories/R7-0017.html
IP-over-IEEE1394 printing.
some MINGW32 changes.
updates for autoconf 2.5
fixes for print-aodv.c - check for too short packets
formatting changes to print-ascii for hex output.
check for too short packets: print-bgp.c, print-bootp.c, print-cdp.c,
print-chdlc.c, print-domain.c, print-icmp.c, print-icmp6.c,
print-ip.c, print-lwres.c, print-ospf.c, print-pim.c,
print-ppp.c,print-pppoe.c, print-rsvp.c, print-wb.c
print-ether.c - better handling of unknown types.
print-isoclns.c - additional decoding of types.
print-llc.c - strings for LLC names added.
print-pfloc.c - various enhancements
print-radius.c - better decoding to strings.
Wed. November 12, 2003. mcr@sandelman.ottawa.on.ca. Summary for 3.8 release
changed syntax of -E argument so that multiple SAs can be decrypted
fixes for Digital Unix headers and Documentation
__attribute__ fixes
CDP changes from Terry Kennedy <terry@tmk.com>.
IPv6 mobility updates from Kazushi Sugyo <sugyo@pb.jp.nec.com>
Fixes for ASN.1 decoder for 2.100.3 forms.
Added a count of packets received and processed to clarify numbers.
Incorporated WinDUMP patches for Win32 builds.
PPPoE payload length headers.
Fixes for HP C compiler builds.
Use new pcap_breakloop() and pcap_findalldevs() if we can.
BGP output split into multiple lines.
Fixes to 802.11 decoding.
Fixes to PIM decoder.
SuperH is a CPU that can't handle unaligned access. Many fixes for
unaligned access work.
Fixes to Frame-Relay decoder for Q.933/922 frames.
Clarified when Solaris can do captures as non-root.
Added tests/ subdir for examples/regression tests.
New -U flag. -flush stdout after every packet
New -A flag -print ascii only
support for decoding IS-IS inside Cisco HDLC Frames
more verbosity for tftp decoder
mDNS decoder
new BFD decoder
cross compilation patches
RFC 3561 AODV support.
UDP/TCP pseudo-checksum properly for source-route options.
sanitized all files to modified BSD license
Add support for RFC 2625 IP-over-Fibre Channel.
fixes for DECnet support.
Support RFC 2684 bridging of Ethernet, 802.5 Token Ring, and FDDI.
RFC 2684 encapsulation of BPDUs.
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 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. see http://www.tcpdump.org/cvs-log/2002-01-21.10:16:48.html for commit log.
@ -652,5 +732,3 @@ v2.0.1 Sun Jan 26 21:10:10 PDT
v2.0 Sun Jan 13 12:20:40 PST 1991 v2.0 Sun Jan 13 12:20:40 PST 1991
- Initial public release. - Initial public release.
@(#) Header: /tcpdump/master/tcpdump/CHANGES,v 1.81 2002/01/21 11:03:33 mcr Exp (LBL)

51
dist/tcpdump/CREDITS vendored
View File

@ -2,90 +2,117 @@ This file lists people who have contributed to tcpdump:
The current maintainers: The current maintainers:
Bill Fenner <fenner@research.att.com> Bill Fenner <fenner@research.att.com>
Assar Westerlund <assar@sics.se> Fulvio Risso <risso@polito.it>
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Guy Harris <guy@alum.mit.edu>
Hannes Gredler <hannes@juniper.net>
Jun-ichiro itojun Hagino <itojun@iijlab.net> Jun-ichiro itojun Hagino <itojun@iijlab.net>
Guy Harris <guy@alum.mit.edu> Michael Richardson <mcr@sandelman.ottawa.on.ca>
Torsten Landschoff <t.landschoff@gmx.net>
Michael Richardson <mcr@sandelman.ottawa.on.ca>
Ken Hornstein <kenh@cmf.nrl.navy.mil>
Additional people who have contributed patches: Additional people who have contributed patches:
Andrew Brown <atatat@atatdot.net>
Alfredo Andres <aandres@s21sec.com> Alfredo Andres <aandres@s21sec.com>
Andrew Hintz <adhintz@users.sourceforge.net>
Andrew Tridgell <tridge@linuxcare.com> Andrew Tridgell <tridge@linuxcare.com>
Arkadiusz Miskiewicz <misiek@pld.org.pl> Arkadiusz Miskiewicz <misiek@pld.org.pl>
Armando L. Caro Jr. <acaro@mail.eecis.udel.edu> Armando L. Caro Jr. <acaro@mail.eecis.udel.edu>
Atsushi Onoe <onoe@netbsd.org>
Ben Smithurst <ben@scientia.demon.co.uk> Ben Smithurst <ben@scientia.demon.co.uk>
Brent L. Bates <blbates@vigyan.com> Brent L. Bates <blbates@vigyan.com>
Brian Ginsbach <ginsbach@cray.com>
Bruce M. Simpson <bms@spc.org>
Carles Kishimoto Bisbe <ckishimo@ac.upc.es>
Charlie Lenahan <clenahan@fortresstech.com> Charlie Lenahan <clenahan@fortresstech.com>
Charles M. Hannum <mycroft@netbsd.org>
Chris Cogdon <chris@cogdon.org>
Chris G. Demetriou <cgd@netbsd.org> Chris G. Demetriou <cgd@netbsd.org>
Chris Jepeway <jepeway@blasted-heath.com> Chris Jepeway <jepeway@blasted-heath.com>
Craig Rodrigues <rodrigc@mediaone.net> Craig Rodrigues <rodrigc@mediaone.net>
Crist J. Clark <cjclark@alum.mit.edu> Crist J. Clark <cjclark@alum.mit.edu>
Daniel Hagerty <hag@ai.mit.edu> Daniel Hagerty <hag@ai.mit.edu>
Darren Reed <darrenr@reed.wattle.id.au> Darren Reed <darrenr@reed.wattle.id.au>
David Binderman <d.binderman@virgin.net>
David Young <dyoung@ojctech.com>
Francisco Matias Cuenca-Acuna <mcuenca@george.rutgers.edu> Francisco Matias Cuenca-Acuna <mcuenca@george.rutgers.edu>
Frank Volf <volf@oasis.IAEhv.nl> Frank Volf <volf@oasis.IAEhv.nl>
Fulvio Risso <risso@polito.it>
George Bakos <gbakos@ists.dartmouth.edu>
Gerald Combs <gerald@ethereal.com>
Gert Doering <gert@greenie.muc.de> Gert Doering <gert@greenie.muc.de>
Greg Stark <gsstark@mit.edu>
Gilbert Ramirez Jr. <gram@xiexie.org> Gilbert Ramirez Jr. <gram@xiexie.org>
Gisle Vanem <gvanem@eunet.no> Gisle Vanem <giva@bgnett.no>
Hannes Gredler <hannes@juniper.net> Hank Leininger <tcpdump-workers@progressive-comp.com>
Harry Raaymakers <harryr@connect.com.au> Harry Raaymakers <harryr@connect.com.au>
Heinz-Ado Arnolds <Ado.Arnolds@dhm-systems.de> Heinz-Ado Arnolds <Ado.Arnolds@dhm-systems.de>
Hendrik Scholz <hendrik@scholz.net> Hendrik Scholz <hendrik@scholz.net>
Jakob Schlyter <jakob@openbsd.org> Jakob Schlyter <jakob@openbsd.org>
Jan Oravec <wsx@wsx6.net> Jan Oravec <wsx@wsx6.net>
Jason R. Thorpe <thorpej@zembu.com> Jason R. Thorpe <thorpej@netbsd.org>
Jefferson Ogata <jogata@nodc.noaa.gov> Jefferson Ogata <jogata@nodc.noaa.gov>
Jeffrey Hutzelman <jhutz@cmu.edu> Jeffrey Hutzelman <jhutz@cmu.edu>
Jesper Peterson <jesper@endace.com>
Jim Hutchins <jim@ca.sandia.gov> Jim Hutchins <jim@ca.sandia.gov>
JINMEI Tatuya <jinmei@kame.net> Jonathan Heusser <jonny@drugphish.ch>
Tatuya Jinmei <jinmei@kame.net>
Jørgen Thomsen <jth@jth.net> Jørgen Thomsen <jth@jth.net>
Juergen Schoenwaelder <schoenw@ibr.cs.tu-bs.de>
Julian Cowley <julian@lava.net> Julian Cowley <julian@lava.net>
Kaarthik Sivakumar <kaarthik@torrentnet.com> Kaarthik Sivakumar <kaarthik@torrentnet.com>
Kazushi Sugyo <sugyo@pb.jp.nec.com> Kazushi Sugyo <sugyo@pb.jp.nec.com>
Kelly Carmichael <kcarmich@ipapp.com> Kelly Carmichael <kcarmich@ipapp.com>
Ken Hornstein <kenh@cmf.nrl.navy.mil> Ken Hornstein <kenh@cmf.nrl.navy.mil>
Kevin Steves <stevesk@sweden.hp.com> Kevin Steves <stevesk@pobox.com>
Klaus Klein <kleink@reziprozitaet.de> Klaus Klein <kleink@reziprozitaet.de>
Kris Kennaway <kris@freebsd.org> Kris Kennaway <kris@freebsd.org>
Krzysztof Halasa <khc@pm.waw.pl>
Larry Lile <lile@stdio.com> Larry Lile <lile@stdio.com>
Lennert Buytenhek <buytenh@gnu.org> Lennert Buytenhek <buytenh@gnu.org>
Loris Degioanni <loris@netgroup-serv.polito.it>
Love Hörnquist-Åstrand <lha@stacken.kth.se> Love Hörnquist-Åstrand <lha@stacken.kth.se>
Maciej W. Rozycki <macro@ds2.pg.gda.pl> Maciej W. Rozycki <macro@ds2.pg.gda.pl>
Marc A. Lehmann <pcg@goof.com> Marc A. Lehmann <pcg@goof.com>
Mark Ellzey Thomas <mark@ackers.net>
Marko Kiiskila <carnil@cs.tut.fi> Marko Kiiskila <carnil@cs.tut.fi>
Marshall Rose <mrose@dbc.mtview.ca.us> Marshall Rose <mrose@dbc.mtview.ca.us>
Martin Husemann <martin@netbsd.org> Martin Husemann <martin@netbsd.org>
Michael Madore <mmadore@turbolinux.com> Michael Madore <mmadore@turbolinux.com>
Michael Shalayeff <mickey@openbsd.org> Michael Shalayeff <mickey@openbsd.org>
Michael T. Stolarchuk <mts@off.to> Michael T. Stolarchuk <mts@off.to>
Michele "mydecay" Marchetto <smarchetto1@tin.it>
Monroe Williams <monroe@pobox.com> Monroe Williams <monroe@pobox.com>
Motonori Shindo <mshindo@mshindo.net> Motonori Shindo <mshindo@mshindo.net>
Nathan J. Williams <nathanw@MIT.EDU> Nathan J. Williams <nathanw@MIT.EDU>
Nathaniel Couper-Noles <Nathaniel@isi1.tccisi.com> Nathaniel Couper-Noles <Nathaniel@isi1.tccisi.com>
Neil T. Spring <bluehal@users.sourceforge.net>
Niels Provos <provos@openbsd.org> Niels Provos <provos@openbsd.org>
Nickolai Zeldovich <kolya@MIT.EDU> Nickolai Zeldovich <kolya@MIT.EDU>
Olaf Kirch <okir@caldera.de> Olaf Kirch <okir@caldera.de>
Onno van der Linden <onno@simplex.nl> Onno van der Linden <onno@simplex.nl>
Pascal Hennequin <pascal.hennequin@int-evry.fr> Pascal Hennequin <pascal.hennequin@int-evry.fr>
Pasvorn Boonmark <boonmark@juniper.net> Pasvorn Boonmark <boonmark@juniper.net>
Paul Mundt <lethal@linux-sh.org>
Paul S. Traina <pst@freebsd.org>
Pavlin Radoslavov <pavlin@icir.org>
Pekka Savola <pekkas@netcore.fi> Pekka Savola <pekkas@netcore.fi>
Peter Fales <peter@fales-lorenz.net>
Peter Jeremy <peter.jeremy@alcatel.com.au> Peter Jeremy <peter.jeremy@alcatel.com.au>
Phil Wood <cpw@lanl.gov> Phil Wood <cpw@lanl.gov>
Rafal Maszkowski <rzm@icm.edu.pl> Rafal Maszkowski <rzm@icm.edu.pl>
Rick Jones <raj@cup.hp.com> Rick Jones <raj@cup.hp.com>
Rick Watson <watsonrick@users.sourceforge.net> Rick Watson <watsonrick@users.sourceforge.net>
Rob Braun <bbraun@synack.net>
Roderick Schertler <roderick@argon.org> Roderick Schertler <roderick@argon.org>
Sami Farin <safari@iki.fi> Sami Farin <safari@iki.fi>
Scott Rose <syberpunk@users.sourceforge.net>
Sebastian Krahmer <krahmer@cs.uni-potsdam.de> Sebastian Krahmer <krahmer@cs.uni-potsdam.de>
Seth Webster <swebster@sst.ll.mit.edu> Seth Webster <swebster@sst.ll.mit.edu>
Takashi Yamamoto <yamt@mwd.biglobe.ne.jp>
Terry Kennedy <terry@tmk.com>
Timo Koskiahde Timo Koskiahde
Tony Li <tli@procket.com> Tony Li <tli@procket.com>
Uns Lider <unslider@miranda.org> Uns Lider <unslider@miranda.org>
Wilbert de Graaf <wilbertdg@hetnet.nl> Wilbert de Graaf <wilbertdg@hetnet.nl>
Yen Yen Lim
The original LBL crew: The original LBL crew:
Steve McCanne Steve McCanne

41
dist/tcpdump/FILES vendored
View File

@ -5,15 +5,19 @@ INSTALL
LICENSE LICENSE
Makefile.in Makefile.in
README README
Readme.Win32
VERSION VERSION
acconfig.h acconfig.h
aclocal.m4 aclocal.m4
addrtoname.c addrtoname.c
addrtoname.h addrtoname.h
ah.h ah.h
aodv.h
appletalk.h appletalk.h
arcnet.h arcnet.h
atime.awk atime.awk
atm.h
atmuni31.h
bootp.h bootp.h
bpf_dump.c bpf_dump.c
chdlc.h chdlc.h
@ -23,11 +27,14 @@ config.sub
configure configure
configure.in configure.in
decnet.h decnet.h
enc.h
esp.h esp.h
ether.h ether.h
ethertype.h ethertype.h
extract.h extract.h
fddi.h fddi.h
gmpls.c
gmpls.h
gmt2local.c gmt2local.c
gmt2local.h gmt2local.h
icmp6.h icmp6.h
@ -37,11 +44,14 @@ install-sh
interface.h interface.h
ip.h ip.h
ip6.h ip6.h
ipfc.h
ipproto.h
ipsec_doi.h ipsec_doi.h
ipx.h ipx.h
isakmp.h isakmp.h
l2tp.h l2tp.h
lane.h lane.h
lbl/os-osf4.h
lbl/os-solaris2.h lbl/os-solaris2.h
lbl/os-sunos4.h lbl/os-sunos4.h
lbl/os-ultrix4.h lbl/os-ultrix4.h
@ -53,6 +63,8 @@ mib.h
missing/addrinfo.h missing/addrinfo.h
missing/addrsize.h missing/addrsize.h
missing/bittypes.h missing/bittypes.h
missing/dlnames.c
missing/datalinks.c
missing/getaddrinfo.c missing/getaddrinfo.c
missing/getnameinfo.c missing/getnameinfo.c
missing/inet_aton.c missing/inet_aton.c
@ -65,6 +77,7 @@ missing/sockstorage.h
missing/strdup.c missing/strdup.c
missing/strlcat.c missing/strlcat.c
missing/strlcpy.c missing/strlcpy.c
missing/strsep.c
mkdep mkdep
nameser.h nameser.h
netbios.h netbios.h
@ -76,17 +89,21 @@ ospf.h
ospf6.h ospf6.h
packetdat.awk packetdat.awk
parsenfsfh.c parsenfsfh.c
pcap-missing.h
ppp.h ppp.h
print-802_11.c print-802_11.c
print-ap1394.c
print-ah.c print-ah.c
print-aodv.c
print-arcnet.c print-arcnet.c
print-arp.c print-arp.c
print-ascii.c print-ascii.c
print-atalk.c print-atalk.c
print-atm.c print-atm.c
print-beep.c
print-bfd.c
print-bgp.c print-bgp.c
print-bootp.c print-bootp.c
print-beep.c
print-cdp.c print-cdp.c
print-chdlc.c print-chdlc.c
print-cip.c print-cip.c
@ -96,9 +113,11 @@ print-dhcp6.c
print-domain.c print-domain.c
print-dvmrp.c print-dvmrp.c
print-egp.c print-egp.c
print-enc.c
print-esp.c print-esp.c
print-ether.c print-ether.c
print-fddi.c print-fddi.c
print-fr.c
print-frag6.c print-frag6.c
print-gre.c print-gre.c
print-hsrp.c print-hsrp.c
@ -110,16 +129,18 @@ print-ip.c
print-ip6.c print-ip6.c
print-ip6opts.c print-ip6opts.c
print-ipcomp.c print-ipcomp.c
print-ipfc.c
print-ipx.c print-ipx.c
print-isakmp.c print-isakmp.c
print-isoclns.c print-isoclns.c
print-krb.c print-krb.c
print-l2tp.c print-l2tp.c
print-lane.c print-lane.c
print-lcp.c print-ldp.c
print-llc.c print-llc.c
print-lwres.c print-lwres.c
print-mobile.c print-mobile.c
print-mobility.c
print-mpls.c print-mpls.c
print-msdp.c print-msdp.c
print-netbios.c print-netbios.c
@ -137,6 +158,7 @@ print-radius.c
print-raw.c print-raw.c
print-rip.c print-rip.c
print-ripng.c print-ripng.c
print-rsvp.c
print-rt6.c print-rt6.c
print-rx.c print-rx.c
print-sctp.c print-sctp.c
@ -145,6 +167,7 @@ print-sll.c
print-smb.c print-smb.c
print-snmp.c print-snmp.c
print-stp.c print-stp.c
print-sunatm.c
print-sunrpc.c print-sunrpc.c
print-tcp.c print-tcp.c
print-telnet.c print-telnet.c
@ -173,9 +196,23 @@ strcasecmp.c
tcp.h tcp.h
tcpdump.1 tcpdump.1
tcpdump.c tcpdump.c
tcpdump-stdinc.h
telnet.h telnet.h
timed.h timed.h
token.h token.h
udp.h udp.h
util.c util.c
vfprintf.c vfprintf.c
win32/Include/Arpa/tftp.h
win32/Include/errno.h
win32/Include/getopt.h
win32/Include/inetprivate.h
win32/Include/telnet.h
win32/Include/w32_fzs.h
win32/Include/Netinet/in_systm.h
win32/Include/Netinet/ip.h
win32/Include/Rpc/rpc.h
win32/Src/getopt.c
win32/prj/GNUmakefile
win32/prj/WinDump.dsp
win32/prj/WinDump.dsw

118
dist/tcpdump/INSTALL vendored
View File

@ -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.56.2.3 2004/03/17 19:47:47 guy Exp (LBL)
If you have not built libpcap, do so first. See the README If you have not built libpcap, do so first. See the README
file in this directory for the ftp location. 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. Remember to remove or rename the installed binary when upgrading.
If you use Linux, this version of libpcap is known to compile and run 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 with 2.0.25 and more modern, and 2.2 and later, kernels. It is
to work with 1.X kernels. guaranteed not to work with 1.X kernels.
If your system is not one which we have tested tcpdump on, you may have 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 to modify the configure script and Makefile.in. Please send us patches
@ -39,43 +39,61 @@ Please see "PLATFORMS" for notes about tested platforms.
FILES FILES
----- -----
CHANGES - description of differences between releases CHANGES - description of differences between releases
CREDITS - people that have helped tcpdump along CREDITS - people that have helped tcpdump along
FILES - list of files exported as part of the distribution FILES - list of files exported as part of the distribution
INSTALL - this file INSTALL - this file
LICENSE - the license under which tcpdump is distributed
Makefile.in - compilation rules (input to the configure script) Makefile.in - compilation rules (input to the configure script)
README - description of distribution README - description of distribution
Readme.Win32 - notes on building tcpdump on Win32 systems (with WinPcap)
VERSION - version of this release VERSION - version of this release
acconfig.h - autoconf input acconfig.h - autoconf input
aclocal.m4 - autoconf macros aclocal.m4 - autoconf macros
addrtoname.c - address to hostname routines addrtoname.c - address to hostname routines
addrtoname.h - address to hostname definitions addrtoname.h - address to hostname definitions
ah.h - IPSEC Authentication Header definitions
aodv.h - AODV definitions
appletalk.h - AppleTalk definitions appletalk.h - AppleTalk definitions
arcnet.h - ARCNET definitions
atime.awk - TCP ack awk script atime.awk - TCP ack awk script
atm.h - ATM traffic type definitions
atmuni31.h - ATM Q.2931 definitions
bootp.h - BOOTP definitions 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.guess - autoconf support
config.h.in - autoconf input config.h.in - autoconf input
config.sub - autoconf support config.sub - autoconf support
configure - configure script (run this first) configure - configure script (run this first)
configure.in - configure script source configure.in - configure script source
decnet.h - DECnet definitions decnet.h - DECnet definitions
dhcp6.h - IPv6 DHCP definitions enc.h - OpenBSD IPsec encapsulation BPF layer definitions
dhcp6opt.h - IPv6 DHCP options esp.h - IPSEC Encapsulating Security Payload definitions
ethertype.h - ethernet definitions ether.h - Ethernet definitions
ethertype.h - Ethernet type value definitions
extract.h - alignment definitions extract.h - alignment definitions
fddi.h - Fiber Distributed Data Interface definitions fddi.h - Fiber Distributed Data Interface definitions
gmpls.c - GMPLS definitions
gmpls.h - GMPLS declarations
gmt2local.c - time conversion routines gmt2local.c - time conversion routines
gmt2local.h - time conversion prototypes gmt2local.h - time conversion prototypes
icmp6.h - ICMPv6 definitiions
ieee802_11.h - IEEE 802.11 definitions
igrp.h - Interior Gateway Routing Protocol definitions igrp.h - Interior Gateway Routing Protocol definitions
install-sh - BSD style install script install-sh - BSD style install script
interface.h - globals, prototypes and definitions interface.h - globals, prototypes and definitions
ip.h - IP definitions
ip6.h - IPv6 definitions
ipfc.h - IP-over-Fibre Channel definitions
ipproto.h - IP protocol type value definitions
ipsec_doi.h - ISAKMP packet definitions - RFC2407 ipsec_doi.h - ISAKMP packet definitions - RFC2407
ipx.h - IPX definitions ipx.h - IPX definitions
isakmp.h - ISAKMP packet definitions - RFC2408 isakmp.h - ISAKMP packet definitions - RFC2408
l2tp.h - l2tp.h - Layer Two Tunneling Protocol definitions
lane.h - lane.h - ATM LANE definitions
lbl/gnuc.h - gcc macros and defines lbl/os-*.h - OS-dependent defines and prototypes
lbl/os-*.h - os dependent defines and prototypes
llc.h - LLC definitions llc.h - LLC definitions
machdep.c - machine dependent routines machdep.c - machine dependent routines
machdep.h - machine dependent definitions machdep.h - machine dependent definitions
@ -93,82 +111,114 @@ ospf.h - Open Shortest Path First definitions
ospf6.h - IPv6 Open Shortest Path First definitions ospf6.h - IPv6 Open Shortest Path First definitions
packetdat.awk - TCP chunk summary awk script packetdat.awk - TCP chunk summary awk script
parsenfsfh.c - Network File System file parser routines parsenfsfh.c - Network File System file parser routines
pcap-missing.h - declarations of functions possibly missing from libpcap
ppp.h - Point to Point Protocol definitions ppp.h - Point to Point Protocol definitions
print-802_11.c - IEEE 802.11 printer routines
print-ap1394.c - Apple IP-over-IEEE 1394 printer routines
print-ah.c - IPSEC Authentication Header printer routines print-ah.c - IPSEC Authentication Header printer routines
print-aodv.c - AODV printer routines
print-arcnet.c - ARCNET printer routines
print-arp.c - Address Resolution Protocol printer routines print-arp.c - Address Resolution Protocol printer routines
print-ascii.c - ASCII packet dump routines print-ascii.c - ASCII packet dump routines
print-atalk.c - AppleTalk printer 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-bgp.c - Border Gateway Protocol printer routines
print-bootp.c - BOOTP and IPv4 DHCP 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-cip.c - Classical-IP over ATM routines
print-cnfp.c - Cisco NetFlow printer routines print-cnfp.c - Cisco NetFlow printer routines
print-decnet.c - DECnet printer routines print-decnet.c - DECnet printer routines
print-dhcp6.c - IPv6 DHCP printer routines print-dhcp6.c - IPv6 DHCP printer routines
print-domain.c - Domain Name System printer routines print-domain.c - Domain Name System printer routines
print-dvmrp.c - Distance Vector Multicast Routing Protocol printer routines print-dvmrp.c - Distance Vector Multicast Routing Protocol printer routines
print-enc.c - OpenBSD IPsec encapsulation BPF layer printer routines
print-egp.c - External Gateway Protocol printer routines print-egp.c - External Gateway Protocol printer routines
print-esp.c - IPSEC Encapsulating Security Payload 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-fddi.c - Fiber Distributed Data Interface printer routines
print-fr.c - Frame Relay printer routines
print-frag6.c - IPv6 fragmentation header printer routines print-frag6.c - IPv6 fragmentation header printer routines
print-gre.c - Generic Routing Encapsulation 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-icmp.c - Internet Control Message Protocol printer routines
print-icmp6.c - IPv6 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-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-ip6.c - IPv6 printer routines
print-ip6opts.c - IPv6 header option printer routines print-ip6opts.c - IPv6 header option printer routines
print-ipcomp.c - IP Payload Compression Protocol printer routines print-ipcomp.c - IP Payload Compression Protocol printer routines
print-ipx.c - IPX printer routines print-ipx.c - IPX printer routines
print-isakmp.c - Internet Security Association and Key Management Protocol 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-krb.c - Kerberos printer routines
print-l2tp.c - Layer Two Tunneling Protocol printer routines print-l2tp.c - Layer Two Tunneling Protocol printer routines
print-lane.c - print-lane.c - ATM LANE printer routines
print-lcp.c - print-llc.c - IEEE 802.2 LLC printer routines
print-llc.c - llc printer routines print-lwres.c - Lightweight Resolver protocol printer routines
print-mobile.c - IPv4 mobility printer routines print-mobile.c - IPv4 mobility printer routines
print-netbios.c - netbios printer routines print-mobility.c - IPv6 mobility 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-nfs.c - Network File System printer routines
print-ntp.c - Network Time Protocol 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-ospf.c - Open Shortest Path First printer routines
print-ospf6.c - IPv6 Open Shortest Path First printer routines print-ospf6.c - IPv6 Open Shortest Path First printer routines
print-pflog.c - OpenBSD packet filter log file printer routines
print-pim.c - Protocol Independent Multicast printer routines print-pim.c - Protocol Independent Multicast printer routines
print-ppp.c - Point to Point Protocol printer routines print-ppp.c - Point to Point Protocol printer routines
print-pppoe.c - print-pppoe.c - PPP-over-Ethernet printer routines
print-raw.c - raw 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-rip.c - Routing Information Protocol printer routines
print-ripng.c - IPv6 Routing Information Protocol printer routines print-ripng.c - IPv6 Routing Information Protocol printer routines
print-rsvp.c - Resource reSerVation Protocol (RSVP) printer routines
print-rt6.c - IPv6 routing header printer routines print-rt6.c - IPv6 routing header printer routines
print-rx.c - AFS RX 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-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-snmp.c - Simple Network Management Protocol printer routines
print-stp.c - IEEE 802.1d spanning tree protocol printer routines print-stp.c - IEEE 802.1d spanning tree protocol printer routines
print-sunatm.c - SunATM DLPI capture printer routines
print-sunrpc.c - Sun Remote Procedure Call printer routines print-sunrpc.c - Sun Remote Procedure Call printer routines
print-tcp.c - TCP printer routines print-tcp.c - TCP printer routines
print-telnet.c - Telnet option printer routines print-telnet.c - Telnet option printer routines
print-tftp.c - Trivial File Transfer Protocol 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-token.c - Token Ring printer routines
print-udp.c - UDP 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-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 route6d.h - packet definition for IPv6 Routing Information Protocol
rx.h - rx.h - AFS RX definitions
savestr.c - strdup() replacement sctpConstants.h - Stream Control Transmission Protocol constant definitions
savestr.h - savestr prototypes sctpHeader.h - Stream Control Transmission Protocol packet definitions
send-ack.awk - unidirectional tcp send/ack awk script send-ack.awk - unidirectional tcp send/ack awk script
setsignal.c - os independent signal routines setsignal.c - OS-independent signal routines
setsignal.h - os independent signal prototypes setsignal.h - OS-independent signal prototypes
smb.h - slcompress.h - SLIP/PPP Van Jacobson compression (RFC1144) definitions
smbutil.c - 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 stime.awk - TCP send awk script
strcasecmp.c - missing routine strcasecmp.c - missing routine
tcp.h - TCP definitions
tcpdump.1 - manual entry tcpdump.1 - manual entry
tcpdump.c - main program 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 util.c - utility routines
vfprintf.c - emulation routine vfprintf.c - emulation routine
win32 - headers and routines for building on Win32 systems

View File

@ -17,7 +17,7 @@
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
# #
# @(#) Header: /tcpdump/master/tcpdump/Makefile.in,v 1.261 2002/02/05 10:07:39 guy Exp (LBL) # @(#) Header: /tcpdump/master/tcpdump/Makefile.in,v 1.276.2.4 2004/03/28 21:25:02 fenner Exp (LBL)
# #
# Various configurable paths (remember to edit Makefile.in, not Makefile) # Various configurable paths (remember to edit Makefile.in, not Makefile)
@ -43,7 +43,7 @@ CC = @CC@
PROG = tcpdump PROG = tcpdump
CCOPT = @V_CCOPT@ CCOPT = @V_CCOPT@
INCLS = -I. @V_INCLS@ INCLS = -I. @V_INCLS@
DEFS = @DEFS@ DEFS = @DEFS@ @V_DEFS@
# Standard CFLAGS # Standard CFLAGS
CFLAGS = $(CCOPT) $(DEFS) $(INCLS) CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
@ -65,25 +65,26 @@ INSTALL_DATA = @INSTALL_DATA@
@rm -f $@ @rm -f $@
$(CC) $(CFLAGS) -c $(srcdir)/$*.c $(CC) $(CFLAGS) -c $(srcdir)/$*.c
CSRC = addrtoname.c gmt2local.c machdep.c parsenfsfh.c \ CSRC = addrtoname.c gmpls.c gmt2local.c machdep.c oui.c parsenfsfh.c \
print-802_11.c print-ah.c print-arcnet.c print-arp.c \ print-802_11.c print-ap1394.c print-ah.c print-arcnet.c \
print-ascii.c print-atalk.c print-atm.c print-bgp.c \ print-aodv.c print-arp.c print-ascii.c print-atalk.c print-atm.c \
print-bootp.c print-beep.c print-cdp.c print-chdlc.c \ print-beep.c print-bfd.c print-bgp.c print-bootp.c print-cdp.c \
print-cip.c print-cnfp.c print-decnet.c print-domain.c \ print-chdlc.c print-cip.c print-cnfp.c print-decnet.c \
print-dvmrp.c print-egp.c print-esp.c print-ether.c \ print-domain.c print-dvmrp.c print-enc.c print-egp.c \
print-fddi.c print-gre.c print-hsrp.c print-icmp.c \ print-esp.c print-ether.c print-fddi.c print-fr.c \
print-igmp.c print-igrp.c print-ip.c print-ipcomp.c \ print-gre.c print-hsrp.c print-icmp.c print-igmp.c \
print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c \
print-ipx.c print-isakmp.c print-isoclns.c print-krb.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-l2tp.c print-lane.c print-ldp.c print-llc.c \
print-msdp.c print-mobile.c print-mpls.c print-nfs.c \ print-lwres.c print-mobile.c print-mpls.c print-msdp.c \
print-ntp.c print-null.c print-ospf.c print-pflog.c \ print-nfs.c print-ntp.c print-null.c print-ospf.c \
print-pim.c print-ppp.c print-pppoe.c print-pptp.c \ print-pflog.c print-pim.c print-ppp.c print-pppoe.c \
print-radius.c print-raw.c print-rip.c print-rx.c \ print-pptp.c print-radius.c print-raw.c print-rip.c \
print-sctp.c print-sl.c print-sll.c print-snmp.c \ print-rsvp.c print-rx.c print-sctp.c print-sl.c print-sll.c \
print-stp.c print-sunrpc.c print-tcp.c \ print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \
print-telnet.c print-tftp.c print-timed.c print-token.c \ print-tcp.c print-telnet.c print-tftp.c print-timed.c \
print-udp.c print-vjc.c print-vrrp.c print-wb.c print-zephyr.c \ print-token.c print-udp.c print-vjc.c print-vrrp.c \
setsignal.c tcpdump.c util.c print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c
LOCALSRC = @LOCALSRC@ LOCALSRC = @LOCALSRC@
GENSRC = version.c GENSRC = version.c
@ -99,7 +100,7 @@ HDR = addrtoname.h appletalk.h bootp.h decnet.h \
ipx.h llc.h machdep.h mib.h nfsfh.h nfsv2.h ntp.h ospf.h \ ipx.h llc.h machdep.h mib.h nfsfh.h nfsv2.h ntp.h ospf.h \
setsignal.h \ setsignal.h \
gnuc.h ipsec_doi.h isakmp.h l2tp.h nameser.h \ gnuc.h ipsec_doi.h isakmp.h l2tp.h nameser.h \
netbios.h oakley.h ospf6.h ppp.h route6d.h netbios.h oakley.h ospf6.h pf.h ppp.h route6d.h
TAGHDR = \ TAGHDR = \
/usr/include/arpa/tftp.h \ /usr/include/arpa/tftp.h \
@ -122,6 +123,10 @@ $(PROG): $(OBJ) @V_PCAPDEP@
@rm -f $@ @rm -f $@
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
datalinks.o: $(srcdir)/missing/datalinks.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
dlnames.o: $(srcdir)/missing/dlnames.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
getnameinfo.o: $(srcdir)/missing/getnameinfo.c getnameinfo.o: $(srcdir)/missing/getnameinfo.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c
getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c
@ -138,6 +143,8 @@ strlcat.o: $(srcdir)/missing/strlcat.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
strlcpy.o: $(srcdir)/missing/strlcpy.c strlcpy.o: $(srcdir)/missing/strlcpy.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
strsep.o: $(srcdir)/missing/strsep.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
version.o: version.c version.o: version.c
$(CC) $(CFLAGS) -c version.c $(CC) $(CFLAGS) -c version.c

8
dist/tcpdump/README vendored
View File

@ -1,6 +1,6 @@
@(#) Header: /tcpdump/master/tcpdump/README,v 1.62 2002/05/29 07:04:09 guy Exp (LBL) @(#) Header: /tcpdump/master/tcpdump/README,v 1.63.2.1 2003/11/16 10:17:30 guy Exp (LBL)
TCPDUMP 3.7.1 TCPDUMP 3.8
Now maintained by "The Tcpdump Group" Now maintained by "The Tcpdump Group"
See www.tcpdump.org See www.tcpdump.org
@ -11,8 +11,8 @@ Anonymous CVS is available via:
(password "anoncvs") (password "anoncvs")
cvs -d :pserver: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": Version 3.8 of TCPDUMP can be retrived with the CVS tag "tcpdump_3_8rel1":
cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_3_7rel1 tcpdump cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_3_8rel1 tcpdump
Please send patches against the master copy to patches@tcpdump.org. Please send patches against the master copy to patches@tcpdump.org.

View File

@ -1 +1 @@
3.7.1 3.8.3

View File

@ -1,4 +1,4 @@
/* $NetBSD: acconfig.h,v 1.1.1.3 2002/05/31 09:28:27 itojun Exp $ */ /* $NetBSD: acconfig.h,v 1.1.1.4 2004/09/27 17:06:29 dyoung Exp $ */
/* "generated automatically" means DO NOT MAKE CHANGES TO config.h.in -- /* "generated automatically" means DO NOT MAKE CHANGES TO config.h.in --
* make them to acconfig.h and rerun autoheader */ * make them to acconfig.h and rerun autoheader */
@ -67,6 +67,27 @@
/* define if you have ether_ntohost() and it works */ /* define if you have ether_ntohost() and it works */
#undef USE_ETHER_NTOHOST #undef USE_ETHER_NTOHOST
/* define if libpcap has pcap_version */
#undef HAVE_PCAP_VERSION
/* define if libpcap has pcap_debug */
#undef HAVE_PCAP_DEBUG
/* define if libpcap has yydebug */
#undef HAVE_YYDEBUG
/* define if libpcap has pcap_list_datalinks() */
#undef HAVE_PCAP_LIST_DATALINKS
/* define if libpcap has pcap_set_datalink() */
#undef HAVE_PCAP_SET_DATALINK
/* define if libpcap has pcap_datalink_name_to_val() */
#undef HAVE_PCAP_DATALINK_NAME_TO_VAL
/* define if libpcap has pcap_datalink_val_to_description() */
#undef HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION
/* define if unaligned memory accesses fail */ /* define if unaligned memory accesses fail */
#undef LBL_ALIGN #undef LBL_ALIGN
@ -84,6 +105,7 @@
/* Workaround for missing sized types */ /* Workaround for missing sized types */
/* XXX this should move to the more standard uint*_t */ /* XXX this should move to the more standard uint*_t */
#undef int8_t
#undef int16_t #undef int16_t
#undef int32_t #undef int32_t
#undef u_int16_t #undef u_int16_t

View File

@ -1,4 +1,4 @@
dnl @(#) Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.81 2002/04/24 06:34:18 guy Exp (LBL) dnl @(#) Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.98.2.4 2004/03/28 21:04:49 fenner Exp (LBL)
dnl dnl
dnl Copyright (c) 1995, 1996, 1997, 1998 dnl Copyright (c) 1995, 1996, 1997, 1998
dnl The Regents of the University of California. All rights reserved. dnl The Regents of the University of California. All rights reserved.
@ -157,6 +157,51 @@ AC_DEFUN(AC_LBL_C_INIT,
fi fi
]) ])
#
# Try compiling a sample of the type of code that appears in
# gencode.c with "inline", "__inline__", and "__inline".
#
# Autoconf's AC_C_INLINE, at least in autoconf 2.13, isn't good enough,
# as it just tests whether a function returning "int" can be inlined;
# at least some versions of HP's C compiler can inline that, but can't
# inline a function that returns a struct pointer.
#
AC_DEFUN(AC_LBL_C_INLINE,
[AC_MSG_CHECKING(for inline)
AC_CACHE_VAL(ac_cv_lbl_inline, [
ac_cv_lbl_inline=""
ac_lbl_cc_inline=no
for ac_lbl_inline in inline __inline__ __inline
do
AC_TRY_COMPILE(
[#define inline $ac_lbl_inline
static inline struct iltest *foo(void);
struct iltest {
int iltest1;
int iltest2;
};
static inline struct iltest *
foo()
{
static struct iltest xxx;
return &xxx;
}],,ac_lbl_cc_inline=yes,)
if test "$ac_lbl_cc_inline" = yes ; then
break;
fi
done
if test "$ac_lbl_cc_inline" = yes ; then
ac_cv_lbl_inline=$ac_lbl_inline
fi])
if test ! -z "$ac_cv_lbl_inline" ; then
AC_MSG_RESULT($ac_cv_lbl_inline)
else
AC_MSG_RESULT(no)
fi
AC_DEFINE_UNQUOTED(inline, $ac_cv_lbl_inline, [Define as token for inline if inlining supported])])
dnl dnl
dnl Use pfopen.c if available and pfopen() not in standard libraries dnl Use pfopen.c if available and pfopen() not in standard libraries
dnl Require libpcap dnl Require libpcap
@ -191,9 +236,9 @@ AC_DEFUN(AC_LBL_LIBPCAP,
AC_MSG_CHECKING(for local pcap library) AC_MSG_CHECKING(for local pcap library)
libpcap=FAIL libpcap=FAIL
lastdir=FAIL lastdir=FAIL
places=`ls .. | sed -e 's,/$,,' -e 's,^,../,' | \ places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'` egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
for dir in $places ../libpcap libpcap ; do for dir in $places $srcdir/../libpcap $srcdir/libpcap ; do
basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//'` basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//'`
if test $lastdir = $basedir ; then if test $lastdir = $basedir ; then
dnl skip alphas when an actual release is present dnl skip alphas when an actual release is present
@ -212,6 +257,36 @@ AC_DEFUN(AC_LBL_LIBPCAP,
if test $libpcap = FAIL ; then if test $libpcap = FAIL ; then
AC_MSG_ERROR(see the INSTALL doc for more info) AC_MSG_ERROR(see the INSTALL doc for more info)
fi fi
dnl
dnl Good old Red Hat Linux puts "pcap.h" in
dnl "/usr/include/pcap"; had the LBL folks done so,
dnl that would have been a good idea, but for
dnl the Red Hat folks to do so just breaks source
dnl compatibility with other systems.
dnl
dnl We work around this by assuming that, as we didn't
dnl find a local libpcap, libpcap is in /usr/lib or
dnl /usr/local/lib and that the corresponding header
dnl file is under one of those directories; if we don't
dnl find it in either of those directories, we check to
dnl see if it's in a "pcap" subdirectory of them and,
dnl if so, add that subdirectory to the "-I" list.
dnl
AC_MSG_CHECKING(for extraneous pcap header directories)
if test \( ! -r /usr/local/include/pcap.h \) -a \
\( ! -r /usr/include/pcap.h \); then
if test -r /usr/local/include/pcap/pcap.h; then
d="/usr/local/include/pcap"
elif test -r /usr/include/pcap/pcap.h; then
d="/usr/include/pcap"
fi
fi
if test -z "$d" ; then
AC_MSG_RESULT(not found)
else
$2="-I$d $$2"
AC_MSG_RESULT(found -- -I$d added)
fi
else else
$1=$libpcap $1=$libpcap
places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \ places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
@ -235,8 +310,42 @@ AC_DEFUN(AC_LBL_LIBPCAP,
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
LIBS="$LIBS -I:$pseexe" LIBS="$LIBS -I:$pseexe"
fi fi
#
# We need "-lodm" and "-lcfg", as libpcap requires them on
# AIX, and we just build a static libpcap.a and thus can't
# arrange that when you link with libpcap you automatically
# link with those libraries.
#
LIBS="$LIBS -lodm -lcfg"
;; ;;
esac]) esac
dnl
dnl Check for "pcap_list_datalinks()", "pcap_set_datalink()",
dnl and "pcap_datalink_name_to_val()", and use substitute versions
dnl if they're not present
dnl
AC_CHECK_FUNC(pcap_list_datalinks,
AC_DEFINE(HAVE_PCAP_LIST_DATALINKS),
AC_LIBOBJ(datalinks))
AC_CHECK_FUNC(pcap_set_datalink,
AC_DEFINE(HAVE_PCAP_SET_DATALINK))
AC_CHECK_FUNC(pcap_datalink_name_to_val,
[
AC_DEFINE(HAVE_PCAP_DATALINK_NAME_TO_VAL)
AC_CHECK_FUNC(pcap_datalink_val_to_description,
AC_DEFINE(HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION),
AC_LIBOBJ(dlnames))
],
AC_LIBOBJ(dlnames))
dnl
dnl Check for "pcap_breakloop()"; you can't substitute for it if
dnl it's absent (it has hooks into the live capture routines),
dnl so just define the HAVE_ value if it's there.
dnl
AC_CHECK_FUNCS(pcap_breakloop)
])
dnl dnl
dnl Define RETSIGTYPE and RETSIGVAL dnl Define RETSIGTYPE and RETSIGVAL
@ -493,8 +602,39 @@ AC_DEFUN(AC_LBL_UNALIGNED_ACCESS,
AC_CACHE_VAL(ac_cv_lbl_unaligned_fail, AC_CACHE_VAL(ac_cv_lbl_unaligned_fail,
[case "$host_cpu" in [case "$host_cpu" in
#
# These are CPU types where:
#
# the CPU faults on an unaligned access, but at least some
# OSes that support that CPU catch the fault and simulate
# the unaligned access (e.g., Alpha/{Digital,Tru64} UNIX) -
# the simulation is slow, so we don't want to use it;
#
# the CPU, I infer (from the old
#
# XXX: should also check that they don't do weird things (like on arm) # XXX: should also check that they don't do weird things (like on arm)
alpha*|arm*|hp*|mips*|sparc*|ia64) #
# comment) doesn't fault on unaligned accesses, but doesn't
# do a normal unaligned fetch, either (e.g., presumably, ARM);
#
# for whatever reason, the test program doesn't work
# (this has been claimed to be the case for several of those
# CPUs - I don't know what the problem is; the problem
# was reported as "the test program dumps core" for SuperH,
# but that's what the test program is *supposed* to do -
# it dumps core before it writes anything, so the test
# for an empty output file should find an empty output
# file and conclude that unaligned accesses don't work).
#
# This run-time test won't work if you're cross-compiling, so
# in order to support cross-compiling for a particular CPU,
# we have to wire in the list of CPU types anyway, as far as
# I know, so perhaps we should just have a set of CPUs on
# which we know it doesn't work, a set of CPUs on which we
# know it does work, and have the script just fail on other
# cpu types and update it when such a failure occurs.
#
alpha*|arm*|hp*|mips*|sh*|sparc*|ia64|nv1)
ac_cv_lbl_unaligned_fail=yes ac_cv_lbl_unaligned_fail=yes
;; ;;
@ -549,7 +689,8 @@ EOF
dnl dnl
dnl If using gcc and the file .devel exists: dnl If using gcc and the file .devel exists:
dnl Compile with -g (if supported) and -Wall dnl Compile with -g (if supported) and -Wall
dnl If using gcc 2, do extra prototype checking dnl If using gcc 2 or later, do extra prototype checking and some other
dnl checks
dnl If an os prototype include exists, symlink os-proto.h to it dnl If an os prototype include exists, symlink os-proto.h to it
dnl dnl
dnl usage: dnl usage:
@ -575,7 +716,7 @@ AC_DEFUN(AC_LBL_DEVEL,
fi fi
$1="$$1 -Wall" $1="$$1 -Wall"
if test $ac_cv_lbl_gcc_vers -gt 1 ; then if test $ac_cv_lbl_gcc_vers -gt 1 ; then
$1="$$1 -Wmissing-prototypes -Wstrict-prototypes" $1="$$1 -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -W"
fi fi
fi fi
else else
@ -613,6 +754,11 @@ dnl results:
dnl dnl
dnl LIBS dnl LIBS
dnl dnl
dnl XXX - "AC_LBL_LIBRARY_NET" was redone to use "AC_SEARCH_LIBS"
dnl rather than "AC_LBL_CHECK_LIB", so this isn't used any more.
dnl We keep it around for reference purposes in case it's ever
dnl useful in the future.
dnl
define(AC_LBL_CHECK_LIB, define(AC_LBL_CHECK_LIB,
[AC_MSG_CHECKING([for $2 in -l$1]) [AC_MSG_CHECKING([for $2 in -l$1])
@ -1052,6 +1198,9 @@ ac_cv___attribute__=yes,
ac_cv___attribute__=no)]) ac_cv___attribute__=no)])
if test "$ac_cv___attribute__" = "yes"; then if test "$ac_cv___attribute__" = "yes"; then
AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__]) AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
V_DEFS="$V_DEFS -D_U_=\"__attribute__((unused))\""
else
V_DEFS="$V_DEFS -D_U_=\"\""
fi fi
AC_MSG_RESULT($ac_cv___attribute__) AC_MSG_RESULT($ac_cv___attribute__)
]) ])

192
dist/tcpdump/aodv.h vendored Normal file
View File

@ -0,0 +1,192 @@
/* $NetBSD: aodv.h,v 1.1.1.1 2004/09/27 17:06:30 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/aodv.h,v 1.3 2003/09/13 01:34:42 guy Exp (LBL) */
/*
* Copyright (c) 2003 Bruce M. Simpson <bms@spc.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Bruce M. Simpson.
* 4. Neither the name of Bruce M. Simpson nor the names of co-
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY Bruce M. Simpson AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Bruce M. Simpson OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _AODV_H_
#define _AODV_H_
struct aodv_rreq {
u_int8_t rreq_type; /* AODV message type (1) */
u_int8_t rreq_flags; /* various flags */
u_int8_t rreq_zero0; /* reserved, set to zero */
u_int8_t rreq_hops; /* number of hops from originator */
u_int32_t rreq_id; /* request ID */
u_int32_t rreq_da; /* destination IPv4 address */
u_int32_t rreq_ds; /* destination sequence number */
u_int32_t rreq_oa; /* originator IPv4 address */
u_int32_t rreq_os; /* originator sequence number */
};
#ifdef INET6
struct aodv_rreq6 {
u_int8_t rreq_type; /* AODV message type (1) */
u_int8_t rreq_flags; /* various flags */
u_int8_t rreq_zero0; /* reserved, set to zero */
u_int8_t rreq_hops; /* number of hops from originator */
u_int32_t rreq_id; /* request ID */
struct in6_addr rreq_da; /* destination IPv6 address */
u_int32_t rreq_ds; /* destination sequence number */
struct in6_addr rreq_oa; /* originator IPv6 address */
u_int32_t rreq_os; /* originator sequence number */
};
struct aodv_rreq6_draft_01 {
u_int8_t rreq_type; /* AODV message type (16) */
u_int8_t rreq_flags; /* various flags */
u_int8_t rreq_zero0; /* reserved, set to zero */
u_int8_t rreq_hops; /* number of hops from originator */
u_int32_t rreq_id; /* request ID */
u_int32_t rreq_ds; /* destination sequence number */
u_int32_t rreq_os; /* originator sequence number */
struct in6_addr rreq_da; /* destination IPv6 address */
struct in6_addr rreq_oa; /* originator IPv6 address */
};
#endif
#define RREQ_JOIN 0x80 /* join (reserved for multicast */
#define RREQ_REPAIR 0x40 /* repair (reserved for multicast */
#define RREQ_GRAT 0x20 /* gratuitous RREP */
#define RREQ_DEST 0x10 /* destination only */
#define RREQ_UNKNOWN 0x08 /* unknown destination sequence num */
#define RREQ_FLAGS_MASK 0xF8 /* mask for rreq_flags */
struct aodv_rrep {
u_int8_t rrep_type; /* AODV message type (2) */
u_int8_t rrep_flags; /* various flags */
u_int8_t rrep_ps; /* prefix size */
u_int8_t rrep_hops; /* number of hops from o to d */
u_int32_t rrep_da; /* destination IPv4 address */
u_int32_t rrep_ds; /* destination sequence number */
u_int32_t rrep_oa; /* originator IPv4 address */
u_int32_t rrep_life; /* lifetime of this route */
};
#ifdef INET6
struct aodv_rrep6 {
u_int8_t rrep_type; /* AODV message type (2) */
u_int8_t rrep_flags; /* various flags */
u_int8_t rrep_ps; /* prefix size */
u_int8_t rrep_hops; /* number of hops from o to d */
struct in6_addr rrep_da; /* destination IPv6 address */
u_int32_t rrep_ds; /* destination sequence number */
struct in6_addr rrep_oa; /* originator IPv6 address */
u_int32_t rrep_life; /* lifetime of this route */
};
struct aodv_rrep6_draft_01 {
u_int8_t rrep_type; /* AODV message type (17) */
u_int8_t rrep_flags; /* various flags */
u_int8_t rrep_ps; /* prefix size */
u_int8_t rrep_hops; /* number of hops from o to d */
u_int32_t rrep_ds; /* destination sequence number */
struct in6_addr rrep_da; /* destination IPv6 address */
struct in6_addr rrep_oa; /* originator IPv6 address */
u_int32_t rrep_life; /* lifetime of this route */
};
#endif
#define RREP_REPAIR 0x80 /* repair (reserved for multicast */
#define RREP_ACK 0x40 /* acknowledgement required */
#define RREP_FLAGS_MASK 0xC0 /* mask for rrep_flags */
#define RREP_PREFIX_MASK 0x1F /* mask for prefix size */
struct rerr_unreach {
u_int32_t u_da; /* IPv4 address */
u_int32_t u_ds; /* sequence number */
};
#ifdef INET6
struct rerr_unreach6 {
struct in6_addr u_da; /* IPv6 address */
u_int32_t u_ds; /* sequence number */
};
struct rerr_unreach6_draft_01 {
struct in6_addr u_da; /* IPv6 address */
u_int32_t u_ds; /* sequence number */
};
#endif
struct aodv_rerr {
u_int8_t rerr_type; /* AODV message type (3 or 18) */
u_int8_t rerr_flags; /* various flags */
u_int8_t rerr_zero0; /* reserved, set to zero */
u_int8_t rerr_dc; /* destination count */
union {
struct rerr_unreach dest[1];
#ifdef INET6
struct rerr_unreach6 dest6[1];
struct rerr_unreach6_draft_01 dest6_draft_01[1];
#endif
} r;
};
#define RERR_NODELETE 0x80 /* don't delete the link */
#define RERR_FLAGS_MASK 0x80 /* mask for rerr_flags */
struct aodv_rrep_ack {
u_int8_t ra_type;
u_int8_t ra_zero0;
};
union aodv {
struct aodv_rreq rreq;
struct aodv_rrep rrep;
struct aodv_rerr rerr;
struct aodv_rrep_ack rrep_ack;
#ifdef INET6
struct aodv_rreq6 rreq6;
struct aodv_rreq6_draft_01 rreq6_draft_01;
struct aodv_rrep6 rrep6;
struct aodv_rrep6_draft_01 rrep6_draft_01;
#endif
};
#define AODV_RREQ 1 /* route request */
#define AODV_RREP 2 /* route response */
#define AODV_RERR 3 /* error report */
#define AODV_RREP_ACK 4 /* route response acknowledgement */
#define AODV_V6_DRAFT_01_RREQ 16 /* IPv6 route request */
#define AODV_V6_DRAFT_01_RREP 17 /* IPv6 route response */
#define AODV_V6_DRAFT_01_RERR 18 /* IPv6 error report */
#define AODV_V6_DRAFT_01_RREP_ACK 19 /* IPV6 route response acknowledgment */
struct aodv_ext {
u_int8_t type; /* extension type */
u_int8_t length; /* extension length */
};
struct aodv_hello {
struct aodv_ext eh; /* extension header */
u_int32_t interval; /* expect my next hello in
* (n) ms */
};
#define AODV_EXT_HELLO 1
#endif /* _AODV_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: appletalk.h,v 1.1.1.1 2001/06/25 19:26:29 itojun Exp $ */ /* $NetBSD: appletalk.h,v 1.1.1.2 2004/09/27 17:06:30 dyoung Exp $ */
/* /*
* Copyright (c) 1988, 1989, 1990, 1993, 1994, 1995, 1996 * Copyright (c) 1988, 1989, 1990, 1993, 1994, 1995, 1996
@ -22,7 +22,7 @@
* *
* AppleTalk protocol formats (courtesy Bill Croft of Stanford/SUMEX). * AppleTalk protocol formats (courtesy Bill Croft of Stanford/SUMEX).
* *
* @(#) Header: /tcpdump/master/tcpdump/appletalk.h,v 1.13 2000/10/03 02:54:54 itojun Exp (LBL) * @(#) Header: /tcpdump/master/tcpdump/appletalk.h,v 1.15 2002/12/11 07:13:49 guy Exp (LBL)
*/ */
struct LAP { struct LAP {

27
dist/tcpdump/atm.h vendored Normal file
View File

@ -0,0 +1,27 @@
/* $NetBSD: atm.h,v 1.1.1.1 2004/09/27 17:06:30 dyoung Exp $ */
/*
* Copyright (c) 2002 Guy Harris.
* 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, and (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.
* The name of Guy Harris may not 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.
*
* @(#) Header: /tcpdump/master/tcpdump/atm.h,v 1.1 2002/07/11 09:17:22 guy Exp
*/
/*
* Traffic types for ATM.
*/
#define ATM_UNKNOWN 0 /* Unknown */
#define ATM_LANE 1 /* LANE */
#define ATM_LLC 2 /* LLC encapsulation */

89
dist/tcpdump/atmuni31.h vendored Normal file
View File

@ -0,0 +1,89 @@
/* $NetBSD: atmuni31.h,v 1.1.1.1 2004/09/27 17:06:30 dyoung Exp $ */
/*
* Copyright (c) 1997 Yen Yen Lim and North Dakota State University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Yen Yen Lim and
North Dakota State University
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* @(#) Header: /tcpdump/master/tcpdump/atmuni31.h,v 1.2 2002/08/05 07:47:23 guy Exp (LBL)
*/
/* Based on UNI3.1 standard by ATM Forum */
/* ATM traffic types based on VPI=0 and (the following VCI */
#define PPC 0x05 /* Point-to-point signal msg */
#define BCC 0x02 /* Broadcast signal msg */
#define OAMF4SC 0x03 /* Segment OAM F4 flow cell */
#define OAMF4EC 0x04 /* End-to-end OAM F4 flow cell */
#define METAC 0x01 /* Meta signal msg */
#define ILMIC 0x10 /* ILMI msg */
/* Q.2931 signalling messages */
#define CALL_PROCEED 0x02 /* call proceeding */
#define CONNECT 0x07 /* connect */
#define CONNECT_ACK 0x0f /* connect_ack */
#define SETUP 0x05 /* setup */
#define RELEASE 0x4d /* release */
#define RELEASE_DONE 0x5a /* release_done */
#define RESTART 0x46 /* restart */
#define RESTART_ACK 0x4e /* restart ack */
#define STATUS 0x7d /* status */
#define STATUS_ENQ 0x75 /* status ack */
#define ADD_PARTY 0x80 /* add party */
#define ADD_PARTY_ACK 0x81 /* add party ack */
#define ADD_PARTY_REJ 0x82 /* add party rej */
#define DROP_PARTY 0x83 /* drop party */
#define DROP_PARTY_ACK 0x84 /* drop party ack */
/* Information Element Parameters in the signalling messages */
#define CAUSE 0x08 /* cause */
#define ENDPT_REF 0x54 /* endpoint reference */
#define AAL_PARA 0x58 /* ATM adaptation layer parameters */
#define TRAFF_DESCRIP 0x59 /* atm traffic descriptors */
#define CONNECT_ID 0x5a /* connection identifier */
#define QOS_PARA 0x5c /* quality of service parameters */
#define B_HIGHER 0x5d /* broadband higher layer information */
#define B_BEARER 0x5e /* broadband bearer capability */
#define B_LOWER 0x5f /* broadband lower information */
#define CALLING_PARTY 0x6c /* calling party number */
#define CALLED_PARTY 0x70 /* called party nmber */
#define Q2931 0x09
/* Q.2931 signalling general messages format */
#define PROTO_POS 0 /* offset of protocol discriminator */
#define CALL_REF_POS 2 /* offset of call reference value */
#define MSG_TYPE_POS 5 /* offset of message type */
#define MSG_LEN_POS 7 /* offset of mesage length */
#define IE_BEGIN_POS 9 /* offset of first information element */
/* format of signalling messages */
#define TYPE_POS 0
#define LEN_POS 2
#define FIELD_BEGIN_POS 4

11
dist/tcpdump/bootp.h vendored
View File

@ -1,6 +1,6 @@
/* $NetBSD: bootp.h,v 1.1.1.1 2001/06/25 19:26:29 itojun Exp $ */ /* $NetBSD: bootp.h,v 1.1.1.2 2004/09/27 17:06:30 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/bootp.h,v 1.11 2001/01/09 07:39:13 fenner Exp (LBL) */ /* @(#) Header: /tcpdump/master/tcpdump/bootp.h,v 1.15 2003/07/01 19:16:06 guy Exp (LBL) */
/* /*
* Bootstrap Protocol (BOOTP). RFC951 and RFC1048. * Bootstrap Protocol (BOOTP). RFC951 and RFC1048.
* *
@ -29,7 +29,7 @@ struct bootp {
u_int8_t bp_hops; /* gateway hops */ u_int8_t bp_hops; /* gateway hops */
u_int32_t bp_xid; /* transaction ID */ u_int32_t bp_xid; /* transaction ID */
u_int16_t bp_secs; /* seconds since boot began */ u_int16_t bp_secs; /* seconds since boot began */
u_int16_t bp_flags; /* flags: 0x8000 is broadcast */ u_int16_t bp_flags; /* flags - see bootp_flag_values[] in print-bootp.c */
struct in_addr bp_ciaddr; /* client IP address */ struct in_addr bp_ciaddr; /* client IP address */
struct in_addr bp_yiaddr; /* 'your' IP address */ struct in_addr bp_yiaddr; /* 'your' IP address */
struct in_addr bp_siaddr; /* server IP address */ struct in_addr bp_siaddr; /* server IP address */
@ -46,9 +46,8 @@ struct bootp {
#define IPPORT_BOOTPS 67 #define IPPORT_BOOTPS 67
#define IPPORT_BOOTPC 68 #define IPPORT_BOOTPC 68
#define BOOTREPLY 2 #define BOOTPREPLY 2
#define BOOTREQUEST 1 #define BOOTPREQUEST 1
/* /*
* Vendor magic cookie (v_magic) for CMU * Vendor magic cookie (v_magic) for CMU

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,7 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */ /* config.h.in. Generated from configure.in by autoheader. */
/* "generated automatically" means DO NOT MAKE CHANGES TO config.h.in -- /* "generated automatically" means DO NOT MAKE CHANGES TO config.h.in --
* make them to acconfig.h and rerun autoheader */ * make them to acconfig.h and rerun autoheader */
/* 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
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define if you have SSLeay 0.9.0b with the buggy cast128. */ /* Define if you have SSLeay 0.9.0b with the buggy cast128. */
#undef HAVE_BUGGY_CAST128 #undef HAVE_BUGGY_CAST128
@ -23,12 +11,24 @@
/* Define if you enable support for the libsmi. */ /* Define if you enable support for the libsmi. */
#undef LIBSMI #undef LIBSMI
/* Define if you have the <smi.h> header file. */
#undef HAVE_SMI_H
/* define if you have struct __res_state_ext */ /* define if you have struct __res_state_ext */
#undef HAVE_RES_STATE_EXT #undef HAVE_RES_STATE_EXT
/* define if your struct __res_state has the nsort member */ /* define if your struct __res_state has the nsort member */
#undef HAVE_NEW_RES_STATE #undef HAVE_NEW_RES_STATE
/*
* define if struct ether_header.ether_dhost is a struct with ether_addr_octet
*/
#undef ETHER_HEADER_HAS_EA
/* define if struct ether_arp contains arp_xsha */
#undef ETHER_ARP_HAS_X
/* define if you have the addrinfo function. */ /* define if you have the addrinfo function. */
#undef HAVE_ADDRINFO #undef HAVE_ADDRINFO
@ -47,6 +47,9 @@
/* define if this is a development version, to use additional prototypes. */ /* define if this is a development version, to use additional prototypes. */
#undef HAVE_OS_PROTO_H #undef HAVE_OS_PROTO_H
/* define if <unistd.h> defines __P() */
#undef HAVE_PORTABLE_PROTOTYPE
/* define if RES_USE_INET6 is defined */ /* define if RES_USE_INET6 is defined */
#undef HAVE_RES_USE_INET6 #undef HAVE_RES_USE_INET6
@ -56,9 +59,33 @@
/* define if you have struct sockaddr_storage */ /* define if you have struct sockaddr_storage */
#undef HAVE_SOCKADDR_STORAGE #undef HAVE_SOCKADDR_STORAGE
/* define if you have both getipnodebyname() and getipnodebyaddr() */
#undef USE_GETIPNODEBY
/* define if you have ether_ntohost() and it works */ /* define if you have ether_ntohost() and it works */
#undef USE_ETHER_NTOHOST #undef USE_ETHER_NTOHOST
/* define if libpcap has pcap_version */
#undef HAVE_PCAP_VERSION
/* define if libpcap has pcap_debug */
#undef HAVE_PCAP_DEBUG
/* define if libpcap has yydebug */
#undef HAVE_YYDEBUG
/* define if libpcap has pcap_list_datalinks() */
#undef HAVE_PCAP_LIST_DATALINKS
/* define if libpcap has pcap_set_datalink() */
#undef HAVE_PCAP_SET_DATALINK
/* define if libpcap has pcap_datalink_name_to_val() */
#undef HAVE_PCAP_DATALINK_NAME_TO_VAL
/* define if libpcap has pcap_datalink_val_to_description() */
#undef HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION
/* define if unaligned memory accesses fail */ /* define if unaligned memory accesses fail */
#undef LBL_ALIGN #undef LBL_ALIGN
@ -76,6 +103,7 @@
/* Workaround for missing sized types */ /* Workaround for missing sized types */
/* XXX this should move to the more standard uint*_t */ /* XXX this should move to the more standard uint*_t */
#undef int8_t
#undef int16_t #undef int16_t
#undef int32_t #undef int32_t
#undef u_int16_t #undef u_int16_t
@ -99,102 +127,167 @@
/* Define if you have a dnet_htoa declaration in <netdnet/dnetdb.h>. */ /* Define if you have a dnet_htoa declaration in <netdnet/dnetdb.h>. */
#undef HAVE_NETDNET_DNETDB_H_DNET_HTOA #undef HAVE_NETDNET_DNETDB_H_DNET_HTOA
/* The number of bytes in a char. */ /* Define to 1 if you have the `bpf_dump' function. */
#undef SIZEOF_CHAR
/* The number of bytes in a int. */
#undef SIZEOF_INT
/* The number of bytes in a long. */
#undef SIZEOF_LONG
/* The number of bytes in a short. */
#undef SIZEOF_SHORT
/* Define if you have the bpf_dump function. */
#undef HAVE_BPF_DUMP #undef HAVE_BPF_DUMP
/* Define if you have the ether_ntohost function. */ /* Define to 1 if you have the `ether_ntohost' function. */
#undef HAVE_ETHER_NTOHOST #undef HAVE_ETHER_NTOHOST
/* Define if you have the getaddrinfo function. */ /* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_GETADDRINFO
/* Define if you have the getnameinfo function. */
#undef HAVE_GETNAMEINFO
/* Define if you have the inet_aton function. */
#undef HAVE_INET_ATON
/* Define if you have the inet_ntop function. */
#undef HAVE_INET_NTOP
/* Define if you have the inet_pton function. */
#undef HAVE_INET_PTON
/* Define if you have the pfopen function. */
#undef HAVE_PFOPEN
/* Define if you have the setlinebuf function. */
#undef HAVE_SETLINEBUF
/* Define if you have the sigaction function. */
#undef HAVE_SIGACTION
/* Define if you have the sigset function. */
#undef HAVE_SIGSET
/* Define if you have the snprintf function. */
#undef HAVE_SNPRINTF
/* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP
/* Define if you have the strdup function. */
#undef HAVE_STRDUP
/* Define if you have the strlcat function. */
#undef HAVE_STRLCAT
/* Define if you have the strlcpy function. */
#undef HAVE_STRLCPY
/* Define if you have the vfprintf function. */
#undef HAVE_VFPRINTF
/* Define if you have the vsnprintf function. */
#undef HAVE_VSNPRINTF
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H #undef HAVE_FCNTL_H
/* Define if you have the <netdnet/dnetdb.h> header file. */ /* Define to 1 if you have the `getaddrinfo' function. */
#undef HAVE_NETDNET_DNETDB_H #undef HAVE_GETADDRINFO
/* Define if you have the <netinet/if_ether.h> header file. */ /* Define to 1 if you have the `getnameinfo' function. */
#undef HAVE_NETINET_IF_ETHER_H #undef HAVE_GETNAMEINFO
/* Define if you have the <openssl/cast.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_OPENSSL_CAST_H #undef HAVE_INTTYPES_H
/* Define if you have the <openssl/rc5.h> header file. */ /* Define to 1 if you have the `crypto' library (-lcrypto). */
#undef HAVE_OPENSSL_RC5_H
/* Define if you have the <rpc/rpcent.h> header file. */
#undef HAVE_RPC_RPCENT_H
/* Define if you have the <smi.h> header file. */
#undef HAVE_SMI_H
/* Define if you have the crypto library (-lcrypto). */
#undef HAVE_LIBCRYPTO #undef HAVE_LIBCRYPTO
/* Define if you have the rpc library (-lrpc). */ /* Define to 1 if you have the `rpc' library (-lrpc). */
#undef HAVE_LIBRPC #undef HAVE_LIBRPC
/* Define if you have the smi library (-lsmi). */ /* Define to 1 if you have the `smi' library (-lsmi). */
#undef HAVE_LIBSMI #undef HAVE_LIBSMI
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <netdnet/dnetdb.h> header file. */
#undef HAVE_NETDNET_DNETDB_H
/* Define to 1 if you have the <netinet/ether.h> header file. */
#undef HAVE_NETINET_ETHER_H
/* Define to 1 if you have the <netinet/if_ether.h> header file. */
#undef HAVE_NETINET_IF_ETHER_H
/* Define to 1 if you have the <openssl/evp.h> header file. */
#undef HAVE_OPENSSL_EVP_H
/* Define to 1 if you have the `pcap_breakloop' function. */
#undef HAVE_PCAP_BREAKLOOP
/* Define to 1 if you have the `pcap_dump_flush' function. */
#undef HAVE_PCAP_DUMP_FLUSH
/* Define to 1 if you have the `pcap_findalldevs' function. */
#undef HAVE_PCAP_FINDALLDEVS
/* Define to 1 if the system has the type `pcap_if_t'. */
#undef HAVE_PCAP_IF_T
/* Define to 1 if you have the `pcap_lib_version' function. */
#undef HAVE_PCAP_LIB_VERSION
/* Define to 1 if you have the `pfopen' function. */
#undef HAVE_PFOPEN
/* Define to 1 if you have the <rpc/rpcent.h> header file. */
#undef HAVE_RPC_RPCENT_H
/* Define to 1 if you have the `setlinebuf' function. */
#undef HAVE_SETLINEBUF
/* Define to 1 if you have the `sigaction' function. */
#undef HAVE_SIGACTION
/* Define to 1 if you have the `sigset' function. */
#undef HAVE_SIGSET
/* Define to 1 if you have the <smi.h> header file. */
#undef HAVE_SMI_H
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strlcat' function. */
#undef HAVE_STRLCAT
/* Define to 1 if you have the `strlcpy' function. */
#undef HAVE_STRLCPY
/* Define to 1 if you have the `strsep' function. */
#undef HAVE_STRSEP
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vfprintf' function. */
#undef HAVE_VFPRINTF
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* define if your compiler has __attribute__ */ /* define if your compiler has __attribute__ */
#undef HAVE___ATTRIBUTE__ #undef HAVE___ATTRIBUTE__
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* The size of a `char', as computed by sizeof. */
#undef SIZEOF_CHAR
/* The size of a `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of a `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of a `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define as token for inline if inlining supported */
#undef inline

View File

@ -1,9 +1,9 @@
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# Free Software Foundation, Inc. # 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
timestamp='2001-04-20' timestamp='2003-11-03'
# This file is (in principle) common to ALL GNU software. # This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software # The presence of a machine in this file suggests that SOME GNU software
@ -29,7 +29,8 @@ timestamp='2001-04-20'
# configuration script generated by Autoconf, you may include it under # configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that program.
# Please send patches to <config-patches@gnu.org>. # Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
# #
# Configuration subroutine to validate and canonicalize a configuration type. # Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument. # Supply the specified configuration type as an argument.
@ -117,7 +118,8 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations. # Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in case $maybe_os in
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*) nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;; ;;
@ -157,6 +159,14 @@ case $os in
os=-vxworks os=-vxworks
basic_machine=$1 basic_machine=$1
;; ;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*) -hiux*)
os=-hiuxwe2 os=-hiuxwe2
;; ;;
@ -215,26 +225,50 @@ esac
case $basic_machine in case $basic_machine in
# Recognize the basic CPU types without company name. # Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below. # Some are omitted here because they have special meanings below.
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \ 1750a | 580 \
| arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \ | a29k \
| pyramid | mn10200 | mn10300 | tron | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| 580 | i960 | h8300 \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| x86 | ppcbe | mipsbe | mipsle | shbe | shle \ | am33_2.0 \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| hppa64 \ | c4x | clipper \
| alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ | d10v | d30v | dlx | dsp16xx \
| alphaev6[78] \ | fr30 | frv \
| we32k | ns16k | clipper | i370 | sh | sh[34] \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| powerpc | powerpcle \ | i370 | i860 | i960 | ia64 \
| 1750a | dsp16xx | pdp10 | pdp11 \ | ip2k | iq2000 \
| mips16 | mips64 | mipsel | mips64el \ | m32r | m68000 | m68k | m88k | mcore \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \ | mips | mipsbe | mipseb | mipsel | mipsle \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ | mips16 \
| mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \ | mips64 | mips64el \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \ | mips64vr | mips64vrel \
| v850 | c4x \ | mips64orion | mips64orionel \
| thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \ | mips64vr4100 | mips64vr4100el \
| pj | pjl | h8500) | mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| msp430 \
| ns16k | ns32k \
| openrisc | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
;; ;;
m6811 | m68hc11 | m6812 | m68hc12) m6811 | m68hc11 | m6812 | m68hc12)
@ -242,7 +276,7 @@ case $basic_machine in
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
os=-none os=-none
;; ;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65) m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;; ;;
# We use `pc' rather than `unknown' # We use `pc' rather than `unknown'
@ -257,31 +291,61 @@ case $basic_machine in
exit 1 exit 1
;; ;;
# Recognize the basic CPU types with company name. # Recognize the basic CPU types with company name.
# FIXME: clean up the formatting here. 580-* \
vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ | a29k-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| xmp-* | ymp-* \ | avr-* \
| x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \ | bs2000-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| hppa2.0n-* | hppa64-* \ | clipper-* | cydra-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ | d10v-* | d30v-* | dlx-* \
| alphaev6[78]-* \ | elxsi-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| clipper-* | orion-* \ | h8300-* | h8500-* \
| sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \ | i*86-* | i860-* | i960-* | ia64-* \
| mips16-* | mips64-* | mipsel-* \ | ip2k-* | iq2000-* \
| mips64el-* | mips64orion-* | mips64orionel-* \ | m32r-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| mipstx39-* | mipstx39el-* | mcore-* \ | m88110-* | m88k-* | mcore-* \
| f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| [cjt]90-* \ | mips16-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ | mips64-* | mips64el-* \
| thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \ | mips64vr-* | mips64vrel-* \
| bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*) | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| msp430-* \
| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
| xtensa-* \
| ymp-* \
| z8k-*)
;; ;;
# Recognize the various machine names and aliases which stand # Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS. # for a CPU type and a company and sometimes even an OS.
@ -313,6 +377,9 @@ case $basic_machine in
basic_machine=a29k-none basic_machine=a29k-none
os=-bsd os=-bsd
;; ;;
amd64)
basic_machine=x86_64-pc
;;
amdahl) amdahl)
basic_machine=580-amdahl basic_machine=580-amdahl
os=-sysv os=-sysv
@ -344,6 +411,10 @@ case $basic_machine in
basic_machine=ns32k-sequent basic_machine=ns32k-sequent
os=-dynix os=-dynix
;; ;;
c90)
basic_machine=c90-cray
os=-unicos
;;
convex-c1) convex-c1)
basic_machine=c1-convex basic_machine=c1-convex
os=-bsd os=-bsd
@ -364,16 +435,8 @@ case $basic_machine in
basic_machine=c38-convex basic_machine=c38-convex
os=-bsd os=-bsd
;; ;;
cray | ymp) cray | j90)
basic_machine=ymp-cray basic_machine=j90-cray
os=-unicos
;;
cray2)
basic_machine=cray2-cray
os=-unicos
;;
[cjt]90)
basic_machine=${basic_machine}-cray
os=-unicos os=-unicos
;; ;;
crds | unos) crds | unos)
@ -388,6 +451,14 @@ case $basic_machine in
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec basic_machine=mips-dec
;; ;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \ delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola) | 3300-motorola | delta-motorola)
basic_machine=m68k-motorola basic_machine=m68k-motorola
@ -568,14 +639,6 @@ case $basic_machine in
basic_machine=m68k-atari basic_machine=m68k-atari
os=-mint os=-mint
;; ;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux-gnu
;;
mips*-linux*)
basic_machine=mips-unknown
os=-linux-gnu
;;
mips3*-*) mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;; ;;
@ -590,6 +653,10 @@ case $basic_machine in
basic_machine=m68k-rom68k basic_machine=m68k-rom68k
os=-coff os=-coff
;; ;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
msdos) msdos)
basic_machine=i386-pc basic_machine=i386-pc
os=-msdos os=-msdos
@ -662,6 +729,10 @@ case $basic_machine in
np1) np1)
basic_machine=np1-gould basic_machine=np1-gould
;; ;;
nv1)
basic_machine=nv1-cray
os=-unicosmp
;;
nsr-tandem) nsr-tandem)
basic_machine=nsr-tandem basic_machine=nsr-tandem
;; ;;
@ -669,6 +740,14 @@ case $basic_machine in
basic_machine=hppa1.1-oki basic_machine=hppa1.1-oki
os=-proelf os=-proelf
;; ;;
or32 | or32-*)
basic_machine=or32-unknown
os=-coff
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000) OSE68000 | ose68000)
basic_machine=m68000-ericsson basic_machine=m68000-ericsson
os=-ose os=-ose
@ -691,42 +770,58 @@ case $basic_machine in
pbb) pbb)
basic_machine=m68k-tti basic_machine=m68k-tti
;; ;;
pc532 | pc532-*) pc532 | pc532-*)
basic_machine=ns32k-pc532 basic_machine=ns32k-pc532
;; ;;
pentium | p5 | k5 | k6 | nexgen) pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc basic_machine=i586-pc
;; ;;
pentiumpro | p6 | 6x86 | athlon) pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc basic_machine=i686-pc
;; ;;
pentiumii | pentium2) pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc basic_machine=i686-pc
;; ;;
pentium-* | p5-* | k5-* | k6-* | nexgen-*) pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumpro-* | p6-* | 6x86-* | athlon-*) pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumii-* | pentium2-*) pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn) pn)
basic_machine=pn-gould basic_machine=pn-gould
;; ;;
power) basic_machine=power-ibm power) basic_machine=power-ibm
;; ;;
ppc) basic_machine=powerpc-unknown ppc) basic_machine=powerpc-unknown
;; ;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppcle | powerpclittle | ppc-le | powerpc-little) ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown basic_machine=powerpcle-unknown
;; ;;
ppcle-* | powerpclittle-*) ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2) ps2)
basic_machine=i386-ibm basic_machine=i386-ibm
;; ;;
@ -744,10 +839,26 @@ case $basic_machine in
rtpc | rtpc-*) rtpc | rtpc-*)
basic_machine=romp-ibm basic_machine=romp-ibm
;; ;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200) sa29200)
basic_machine=a29k-amd basic_machine=a29k-amd
os=-udi os=-udi
;; ;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent) sequent)
basic_machine=i386-sequent basic_machine=i386-sequent
;; ;;
@ -755,7 +866,10 @@ case $basic_machine in
basic_machine=sh-hitachi basic_machine=sh-hitachi
os=-hms os=-hms
;; ;;
sparclite-wrs) sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs basic_machine=sparclite-wrs
os=-vxworks os=-vxworks
;; ;;
@ -822,22 +936,42 @@ case $basic_machine in
os=-dynix os=-dynix
;; ;;
t3e) t3e)
basic_machine=t3e-cray basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos os=-unicos
;; ;;
tic54x | c54x*) tic54x | c54x*)
basic_machine=tic54x-unknown basic_machine=tic54x-unknown
os=-coff os=-coff
;; ;;
tic55x | c55x*)
basic_machine=tic55x-unknown
os=-coff
;;
tic6x | c6x*)
basic_machine=tic6x-unknown
os=-coff
;;
tx39) tx39)
basic_machine=mipstx39-unknown basic_machine=mipstx39-unknown
;; ;;
tx39el) tx39el)
basic_machine=mipstx39el-unknown basic_machine=mipstx39el-unknown
;; ;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32) tower | tower-32)
basic_machine=m68k-ncr basic_machine=m68k-ncr
;; ;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k) udi29k)
basic_machine=a29k-amd basic_machine=a29k-amd
os=-udi os=-udi
@ -859,8 +993,8 @@ case $basic_machine in
os=-vms os=-vms
;; ;;
vpp*|vx|vx-*) vpp*|vx|vx-*)
basic_machine=f301-fujitsu basic_machine=f301-fujitsu
;; ;;
vxworks960) vxworks960)
basic_machine=i960-wrs basic_machine=i960-wrs
os=-vxworks os=-vxworks
@ -881,13 +1015,13 @@ case $basic_machine in
basic_machine=hppa1.1-winbond basic_machine=hppa1.1-winbond
os=-proelf os=-proelf
;; ;;
xmp) xps | xps100)
basic_machine=xmp-cray
os=-unicos
;;
xps | xps100)
basic_machine=xps100-honeywell basic_machine=xps100-honeywell
;; ;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff) z8k-*-coff)
basic_machine=z8k-unknown basic_machine=z8k-unknown
os=-sim os=-sim
@ -908,13 +1042,6 @@ case $basic_machine in
op60c) op60c)
basic_machine=hppa1.1-oki basic_machine=hppa1.1-oki
;; ;;
mips)
if [ x$os = x-linux-gnu ]; then
basic_machine=mips-unknown
else
basic_machine=mips-mips
fi
;;
romp) romp)
basic_machine=romp-ibm basic_machine=romp-ibm
;; ;;
@ -934,13 +1061,16 @@ case $basic_machine in
we32k) we32k)
basic_machine=we32k-att basic_machine=we32k-att
;; ;;
sh3 | sh4) sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown basic_machine=sh-unknown
;; ;;
sh64)
basic_machine=sh64-unknown
;;
sparc | sparcv9 | sparcv9b) sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun basic_machine=sparc-sun
;; ;;
cydra) cydra)
basic_machine=cydra-cydrome basic_machine=cydra-cydrome
;; ;;
orion) orion)
@ -955,10 +1085,6 @@ case $basic_machine in
pmac | pmac-mpw) pmac | pmac-mpw)
basic_machine=powerpc-apple basic_machine=powerpc-apple
;; ;;
c4x*)
basic_machine=c4x-none
os=-coff
;;
*-unknown) *-unknown)
# Make sure to match an already-canonicalized machine name. # Make sure to match an already-canonicalized machine name.
;; ;;
@ -1014,15 +1140,19 @@ case $os in
| -aos* \ | -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*) | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
-qnx*) -qnx*)
@ -1034,8 +1164,10 @@ case $os in
;; ;;
esac esac
;; ;;
-nto-qnx*)
;;
-nto*) -nto*)
os=-nto-qnx os=`echo $os | sed -e 's|nto|nto-qnx|'`
;; ;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
@ -1044,6 +1176,9 @@ case $os in
-mac*) -mac*)
os=`echo $os | sed -e 's|mac|macos|'` os=`echo $os | sed -e 's|mac|macos|'`
;; ;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*) -linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'` os=`echo $os | sed -e 's|linux|linux-gnu|'`
;; ;;
@ -1056,6 +1191,9 @@ case $os in
-opened*) -opened*)
os=-openedition os=-openedition
;; ;;
-os400*)
os=-os400
;;
-wince*) -wince*)
os=-wince os=-wince
;; ;;
@ -1074,14 +1212,20 @@ case $os in
-acis*) -acis*)
os=-aos os=-aos
;; ;;
-atheos*)
os=-atheos
;;
-386bsd) -386bsd)
os=-bsd os=-bsd
;; ;;
-ctix* | -uts*) -ctix* | -uts*)
os=-sysv os=-sysv
;; ;;
-nova*)
os=-rtmk-nova
;;
-ns2 ) -ns2 )
os=-nextstep2 os=-nextstep2
;; ;;
-nsk*) -nsk*)
os=-nsk os=-nsk
@ -1093,6 +1237,9 @@ case $os in
-sinix*) -sinix*)
os=-sysv4 os=-sysv4
;; ;;
-tpf*)
os=-tpf
;;
-triton*) -triton*)
os=-sysv3 os=-sysv3
;; ;;
@ -1120,8 +1267,14 @@ case $os in
-xenix) -xenix)
os=-xenix os=-xenix
;; ;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint os=-mint
;;
-aros*)
os=-aros
;;
-kaos*)
os=-kaos
;; ;;
-none) -none)
;; ;;
@ -1154,10 +1307,14 @@ case $basic_machine in
arm*-semi) arm*-semi)
os=-aout os=-aout
;; ;;
c4x-* | tic4x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*) pdp10-*)
os=-tops20 os=-tops20
;; ;;
pdp11-*) pdp11-*)
os=-none os=-none
;; ;;
*-dec | vax-*) *-dec | vax-*)
@ -1184,6 +1341,9 @@ case $basic_machine in
mips*-*) mips*-*)
os=-elf os=-elf
;; ;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os. *-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3 os=-sysv3
;; ;;
@ -1247,19 +1407,19 @@ case $basic_machine in
*-next) *-next)
os=-nextstep3 os=-nextstep3
;; ;;
*-gould) *-gould)
os=-sysv os=-sysv
;; ;;
*-highlevel) *-highlevel)
os=-bsd os=-bsd
;; ;;
*-encore) *-encore)
os=-bsd os=-bsd
;; ;;
*-sgi) *-sgi)
os=-irix os=-irix
;; ;;
*-siemens) *-siemens)
os=-sysv4 os=-sysv4
;; ;;
*-masscomp) *-masscomp)
@ -1328,10 +1488,16 @@ case $basic_machine in
-mvs* | -opened*) -mvs* | -opened*)
vendor=ibm vendor=ibm
;; ;;
-os400*)
vendor=ibm
;;
-ptx*) -ptx*)
vendor=sequent vendor=sequent
;; ;;
-vxsim* | -vxworks*) -tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs vendor=wrs
;; ;;
-aux*) -aux*)
@ -1346,6 +1512,9 @@ case $basic_machine in
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari vendor=atari
;; ;;
-vos*)
vendor=stratus
;;
esac esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;; ;;

12193
dist/tcpdump/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
dnl @(#) Header: /tcpdump/master/tcpdump/configure.in,v 1.149 2002/04/07 02:16:03 guy Exp (LBL) dnl @(#) Header: /tcpdump/master/tcpdump/configure.in,v 1.169.2.3 2004/03/28 21:04:48 fenner Exp (LBL)
dnl dnl
dnl Copyright (c) 1994, 1995, 1996, 1997 dnl Copyright (c) 1994, 1995, 1996, 1997
dnl The Regents of the University of California. All rights reserved. dnl The Regents of the University of California. All rights reserved.
@ -6,17 +6,19 @@ dnl
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
dnl dnl
AC_REVISION(Revision: 1.149) AC_REVISION(Revision: 1.169.2.3)
AC_PREREQ(2.13) AC_PREREQ(2.50)
AC_INIT(tcpdump.c) AC_INIT(tcpdump.c)
AC_CANONICAL_HOST AC_CANONICAL_HOST
AC_LBL_C_INIT(V_CCOPT, V_INCLS) AC_LBL_C_INIT(V_CCOPT, V_INCLS)
AC_C_INLINE AC_LBL_C_INLINE
AC_C___ATTRIBUTE__ AC_C___ATTRIBUTE__
AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netinet/if_ether.h netdnet/dnetdb.h) AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netdnet/dnetdb.h netinet/ether.h)
AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
#include <sys/socket.h>])
AC_HEADER_TIME AC_HEADER_TIME
case "$host_os" in case "$host_os" in
@ -102,14 +104,13 @@ yes) AC_MSG_RESULT(yes)
;; ;;
esac esac
CFLAGS="$CFLAGS -Dss_family=__ss_family -Dss_len=__ss_len"
AC_MSG_CHECKING([whether to enable ipv6]) AC_MSG_CHECKING([whether to enable ipv6])
AC_ARG_ENABLE(ipv6, AC_ARG_ENABLE(ipv6,
[ --enable-ipv6 enable ipv6 (with ipv4) support [ --enable-ipv6 enable ipv6 (with ipv4) support
--disable-ipv6 disable ipv6 support], --disable-ipv6 disable ipv6 support],
[ case "$enableval" in [ case "$enableval" in
yes) AC_MSG_RESULT(yes) yes) AC_MSG_RESULT(yes)
LOCALSRC="print-ip6.c print-ip6opts.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC" LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC"
AC_DEFINE(INET6) AC_DEFINE(INET6)
ipv6=yes ipv6=yes
;; ;;
@ -131,7 +132,7 @@ main()
} }
], ],
[ AC_MSG_RESULT(yes) [ AC_MSG_RESULT(yes)
LOCALSRC="print-ip6.c print-ip6opts.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC" LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC"
AC_DEFINE(INET6) AC_DEFINE(INET6)
ipv6=yes], ipv6=yes],
[ AC_MSG_RESULT(no) [ AC_MSG_RESULT(no)
@ -150,8 +151,8 @@ if test "$ipv6" = "yes"; then
case $i in case $i in
inria) inria)
dnl http://www.kame.net/ dnl http://www.kame.net/
AC_EGREP_CPP(yes, [dnl AC_EGREP_CPP(yes,
#include <netinet/in.h> [#include <netinet/in.h>
#ifdef IPV6_INRIA_VERSION #ifdef IPV6_INRIA_VERSION
yes yes
#endif], #endif],
@ -160,8 +161,8 @@ yes
;; ;;
kame) kame)
dnl http://www.kame.net/ dnl http://www.kame.net/
AC_EGREP_CPP(yes, [dnl AC_EGREP_CPP(yes,
#include <netinet/in.h> [#include <netinet/in.h>
#ifdef __KAME__ #ifdef __KAME__
yes yes
#endif], #endif],
@ -173,8 +174,8 @@ yes
;; ;;
linux-glibc) linux-glibc)
dnl http://www.v6.linux.or.jp/ dnl http://www.v6.linux.or.jp/
AC_EGREP_CPP(yes, [dnl AC_EGREP_CPP(yes,
#include <features.h> [#include <features.h>
#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
yes yes
#endif], #endif],
@ -183,6 +184,10 @@ yes
;; ;;
linux-libinet6) linux-libinet6)
dnl http://www.v6.linux.or.jp/ dnl http://www.v6.linux.or.jp/
dnl
dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
dnl and possibly other versions of those OSes
dnl
if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
ipv6type=$i ipv6type=$i
ipv6lib=inet6 ipv6lib=inet6
@ -192,8 +197,8 @@ yes
fi fi
;; ;;
toshiba) toshiba)
AC_EGREP_CPP(yes, [dnl AC_EGREP_CPP(yes,
#include <sys/param.h> [#include <sys/param.h>
#ifdef _TOSHIBA_INET6 #ifdef _TOSHIBA_INET6
yes yes
#endif], #endif],
@ -203,8 +208,8 @@ yes
CFLAGS="-DINET6 $CFLAGS"]) CFLAGS="-DINET6 $CFLAGS"])
;; ;;
v6d) v6d)
AC_EGREP_CPP(yes, [dnl AC_EGREP_CPP(yes,
#include </usr/local/v6/include/sys/v6config.h> [#include </usr/local/v6/include/sys/v6config.h>
#ifdef __V6D__ #ifdef __V6D__
yes yes
#endif], #endif],
@ -214,8 +219,8 @@ yes
CFLAGS="-I/usr/local/v6/include $CFLAGS"]) CFLAGS="-I/usr/local/v6/include $CFLAGS"])
;; ;;
zeta) zeta)
AC_EGREP_CPP(yes, [dnl AC_EGREP_CPP(yes,
#include <sys/param.h> [#include <sys/param.h>
#ifdef _ZETA_MINAMI_INET6 #ifdef _ZETA_MINAMI_INET6
yes yes
#endif], #endif],
@ -250,6 +255,19 @@ fi
if test "$ipv6" = "yes"; then if test "$ipv6" = "yes"; then
#
# XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
# function in libc; there are "ngetaddrinfo()" and
# "ogetaddrinfo()" functions, and <netdb.h> #defines
# "getaddrinfo" to be either "ngetaddrinfo" or
# "ogetaddrinfo", depending on whether _SOCKADDR_LEN
# or _XOPEN_SOURCE_EXTENDED are defined or not.
#
# So this test doesn't work on Tru64 5.1, and possibly
# on other 5.x releases. This causes the configure
# script to become confused, and results in libpcap
# being unbuildable.
#
AC_SEARCH_LIBS(getaddrinfo, socket, [dnl AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
AC_MSG_CHECKING(getaddrinfo bug) AC_MSG_CHECKING(getaddrinfo bug)
AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([ AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
@ -270,6 +288,7 @@ main()
hints.ai_family = AF_UNSPEC; hints.ai_family = AF_UNSPEC;
hints.ai_flags = passive ? AI_PASSIVE : 0; hints.ai_flags = passive ? AI_PASSIVE : 0;
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) { if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
(void)gai_strerror(gaierr); (void)gai_strerror(gaierr);
goto bad; goto bad;
@ -356,52 +375,26 @@ main()
fi fi
if test "$td_cv_buggygetaddrinfo" = "yes"; then if test "$td_cv_buggygetaddrinfo" = "yes"; then
#
# XXX - it doesn't appear that "ipv6type" can ever be
# set to "linux". Should this be testing for
# "linux-glibc", or for that *or* "linux-libinet6"?
# If the latter, note that "linux-libinet6" is also
# the type given to some non-Linux OSes.
#
if test "$ipv6type" != "linux"; then if test "$ipv6type" != "linux"; then
echo 'Fatal: You must get working getaddrinfo() function.' echo 'Fatal: You must get working getaddrinfo() function.'
echo ' or you can specify "--disable-ipv6"'. echo ' or you can specify "--disable-ipv6"'.
exit 1 exit 1
else else
echo 'Warning: getaddrinfo() implementation on your system seems be buggy.' echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
echo ' Better upgreade your system library to newest version' echo ' Better upgrade your system library to newest version'
echo ' of GNU C library (aka glibc).' echo ' of GNU C library (aka glibc).'
fi fi
fi fi
]) ])
AC_REPLACE_FUNCS(getaddrinfo getnameinfo) AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
fi fi
dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
AC_MSG_CHECKING(for inet_ntop)
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>], [char src[4], dst[128];
inet_ntop(AF_INET, src, dst, sizeof(dst));],
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
AC_REPLACE_FUNCS(inet_ntop)])
AC_MSG_CHECKING(for inet_pton)
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>], [char src[128], dst[4];
inet_pton(AF_INET, src, dst);],
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
AC_REPLACE_FUNCS(inet_pton)])
AC_MSG_CHECKING(for inet_aton)
AC_TRY_COMPILE([#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>], [char src[128];
struct in_addr dst;
inet_aton(src, &dst);],
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
AC_REPLACE_FUNCS(inet_aton)])
dnl portability macros for getaddrinfo/getnameinfo
dnl
dnl Check for sa_len
AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
if test "$ac_cv_sockaddr_has_sa_len" = no; then
missing_includes=yes
fi
AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h], AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
[td_cv_decl_netdnet_dnetdb_h_dnet_htoa], [td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
@ -488,7 +481,8 @@ if test "$missing_includes" = "yes"; then
fi fi
AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup) AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
AC_CHECK_FUNCS(strftime)
AC_CHECK_FUNCS(ether_ntohost, [ AC_CHECK_FUNCS(ether_ntohost, [
AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [ AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
AC_TRY_RUN([ AC_TRY_RUN([
@ -519,7 +513,7 @@ needsnprintf=no
AC_CHECK_FUNCS(vsnprintf snprintf,, AC_CHECK_FUNCS(vsnprintf snprintf,,
[needsnprintf=yes]) [needsnprintf=yes])
if test $needsnprintf = yes; then if test $needsnprintf = yes; then
LIBOBJS="$LIBOBJS snprintf.o" AC_LIBOBJ(snprintf.o)
fi fi
AC_LBL_TYPE_SIGNAL AC_LBL_TYPE_SIGNAL
@ -536,6 +530,121 @@ dnl AC_CHECK_HEADERS(zlib.h)
AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS) AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
#
# Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
# libraries (e.g., "-lsocket -lnsl" on Solaris).
#
# We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
# use AC_CHECK_FUNC which doesn't let us specify the right #includes
# to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
# resolver, and the way it defines inet_{ntop,pton} is rather strange;
# it does not ship with a libc symbol "inet_ntop()", it ships with
# "_inet_ntop()", and has a #define macro in one of the system headers
# to rename it.
#
dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
AC_MSG_CHECKING(for inet_ntop)
AC_TRY_LINK([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>], [char src[4], dst[128];
inet_ntop(AF_INET, src, dst, sizeof(dst));],
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
AC_LIBOBJ(inet_ntop.o)])
AC_MSG_CHECKING(for inet_pton)
AC_TRY_LINK([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>], [char src[128], dst[4];
inet_pton(AF_INET, src, dst);],
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
AC_LIBOBJ(inet_pton.o)])
AC_MSG_CHECKING(for inet_aton)
AC_TRY_LINK([#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>], [char src[128];
struct in_addr dst;
inet_aton(src, &dst);],
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
AC_LIBOBJ(inet_aton.o)])
dnl portability macros for getaddrinfo/getnameinfo
dnl
dnl Check for sa_len
AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
if test "$ac_cv_sockaddr_has_sa_len" = no; then
missing_includes=yes
fi
AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
if test $ac_cv_func_pcap_findalldevs = "yes" ; then
dnl Check for MacOS X, which may ship pcap.h from 0.6 but libpcap may
dnl be 0.8; this means that lib has pcap_findalldevs but header doesn't
dnl have pcap_if_t.
AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
fi
if test $ac_cv_func_pcap_lib_version = "no" ; then
AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
AC_TRY_LINK([],
[
char *
return_pcap_version(void)
{
extern char pcap_version[];
return pcap_version;
}
],
ac_lbl_cv_pcap_version_defined=yes,
ac_lbl_cv_pcap_version_defined=no)
if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PCAP_VERSION)
else
AC_MSG_RESULT(no)
fi
fi
AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
AC_TRY_LINK([],
[
int
return_pcap_debug(void)
{
extern int pcap_debug;
return pcap_debug;
}
],
ac_lbl_cv_pcap_debug_defined=yes,
ac_lbl_cv_pcap_debug_defined=no)
if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PCAP_DEBUG)
else
AC_MSG_RESULT(no)
#
# OK, what about "yydebug"?
#
AC_MSG_CHECKING(whether yydebug is defined by libpcap)
AC_TRY_LINK([],
[
int
return_yydebug(void)
{
extern int yydebug;
return yydebug;
}
],
ac_lbl_cv_yydebug_defined=yes,
ac_lbl_cv_yydebug_defined=no)
if test "$ac_lbl_cv_yydebug_defined" = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_YYDEBUG)
else
AC_MSG_RESULT(no)
fi
fi
AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6 AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
V_GROUP=0 V_GROUP=0
@ -566,6 +675,7 @@ if test -f /dev/bpf0 ; then
V_GROUP=bpf V_GROUP=bpf
fi fi
AC_LBL_CHECK_TYPE(int8_t, signed char)
AC_LBL_CHECK_TYPE(u_int8_t, u_char) AC_LBL_CHECK_TYPE(u_int8_t, u_char)
AC_LBL_CHECK_TYPE(int16_t, short) AC_LBL_CHECK_TYPE(int16_t, short)
AC_LBL_CHECK_TYPE(u_int16_t, u_short) AC_LBL_CHECK_TYPE(u_int16_t, u_short)
@ -586,7 +696,20 @@ AC_MSG_CHECKING(for SSLeay)
ac_cv_ssleay_path=no ac_cv_ssleay_path=no
incdir=no incdir=no
for dir in /usr/${host_alias} /usr /usr/local /usr/local/ssl /usr/pkg; do for dir in /usr/${host_alias} /usr /usr/local /usr/local/ssl /usr/pkg; do
if test -d $dir/lib -a -f $dir/lib/libcrypto.a; then #
# XXX - is there a better way to check if a given library is
# in a given directory than checking each of the possible
# shared library suffixes?
#
# Are there any other suffixes we need to look for? Do we have to
# worry about ".so.{version}"?
#
# Or should we just look for "libcrypto.*"?
#
if test -d $dir/lib -a \( -f $dir/lib/libcrypto.a -o \
-f $dir/lib/libcrypto.so -o \
-f $dir/lib/libcrypto.sl -o \
-f $dir/lib/libcrypto.dylib \); then
ac_cv_ssleay_path=$dir ac_cv_ssleay_path=$dir
fi fi
if test -d $dir/include/openssl -a -f $dir/include/openssl/des.h; then if test -d $dir/include/openssl -a -f $dir/include/openssl/des.h; then
@ -611,46 +734,13 @@ if test "$ac_cv_ssleay_path" != no; then
fi fi
AC_CHECK_LIB(crypto, des_cbc_encrypt) AC_CHECK_LIB(crypto, des_cbc_encrypt)
bak_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $V_INCLS" CPPFLAGS="$CPPFLAGS $V_INCLS"
AC_CHECK_HEADERS(openssl/cast.h) AC_CHECK_HEADERS(openssl/evp.h)
if test "$ac_cv_header_openssl_cast_h" = "yes"; then
AC_MSG_CHECKING(for buggy CAST128)
AC_CACHE_VAL(td_cv_buggy_cast128, [AC_TRY_RUN(dnl
[
#include <openssl/cast.h>
main()
{
unsigned char key[] = {0x01,0x23,0x45,0x67,0x12};
unsigned char in[] = {0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF};
unsigned char out[sizeof(in)];
unsigned char ok[] = {0x7A,0xC8,0x16,0xD1,0x6E,0x9B,0x30,0x2E};
CAST_KEY ks;
CAST_set_key(&ks, sizeof(key), key);
CAST_ecb_encrypt(in, out, &ks, CAST_ENCRYPT);
if (memcmp(out, ok, sizeof(ok)) != 0)
return 0;
else
return 1;
}],
[td_cv_buggy_cast128=yes],
[td_cv_buggy_cast128=no],
[td_cv_buggy_cast128="cross-compiling, assume yes"])])
AC_MSG_RESULT($td_cv_buggy_cast128)
if test "$td_cv_buggy_cast128" != no; then
echo "NOTE: SSLeay 0.9.0b has a bug in CAST128 en/decoding routine."
echo "disabling CAST128 support."
AC_DEFINE(HAVE_BUGGY_CAST128)
fi
fi
CPPFLAGS=$bak_CPPFLAGS
fi fi
]) ])
AC_CHECK_HEADERS(openssl/rc5.h)
AC_SUBST(V_CCOPT) AC_SUBST(V_CCOPT)
AC_SUBST(V_DEFS)
AC_SUBST(V_GROUP) AC_SUBST(V_GROUP)
AC_SUBST(V_INCLS) AC_SUBST(V_INCLS)
AC_SUBST(V_PCAPDEP) AC_SUBST(V_PCAPDEP)

12
dist/tcpdump/decnet.h vendored
View File

@ -1,4 +1,4 @@
/* $NetBSD: decnet.h,v 1.1.1.1 2001/06/25 19:26:31 itojun Exp $ */ /* $NetBSD: decnet.h,v 1.1.1.2 2004/09/27 17:06:44 dyoung Exp $ */
/* /*
* Copyright (c) 1992, 1994, 1996 * Copyright (c) 1992, 1994, 1996
@ -20,10 +20,18 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* @(#) Header: /tcpdump/master/tcpdump/decnet.h,v 1.7 2000/10/03 02:54:55 itojun Exp (LBL) * @(#) Header: /tcpdump/master/tcpdump/decnet.h,v 1.11 2002/12/11 07:13:50 guy Exp (LBL)
*/ */
#ifndef WIN32
typedef u_int8_t byte[1]; /* single byte field */ typedef u_int8_t byte[1]; /* single byte field */
#else
/*
* the keyword 'byte' generates conflicts in Windows
*/
typedef unsigned char Byte[1]; /* single byte field */
#define byte Byte
#endif /* WIN32 */
typedef u_int8_t word[2]; /* 2 byte field */ typedef u_int8_t word[2]; /* 2 byte field */
typedef u_int8_t longword[4]; /* 4 bytes field */ typedef u_int8_t longword[4]; /* 4 bytes field */

49
dist/tcpdump/enc.h vendored Normal file
View File

@ -0,0 +1,49 @@
/* $NetBSD: enc.h,v 1.1.1.1 2004/09/27 17:06:44 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/enc.h,v 1.1 2003/03/08 08:55:33 guy Exp (LBL) */
/* From $OpenBSD: if_enc.h,v 1.8 2001/06/25 05:14:00 angelos Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
* Niels Provos (provos@physnet.uni-hamburg.de).
*
* This code was written by John Ioannidis for BSD/OS in Athens, Greece,
* in November 1995.
*
* Ported to OpenBSD and NetBSD, with additional transforms, in December 1996,
* by Angelos D. Keromytis.
*
* Additional transforms and features in 1997 and 1998 by Angelos D. Keromytis
* and Niels Provos.
*
* Copyright (C) 1995, 1996, 1997, 1998 by John Ioannidis, Angelos D. Keromytis
* and Niels Provos.
* Copyright (c) 2001, Angelos D. Keromytis.
*
* Permission to use, copy, and modify this software with or without fee
* is hereby granted, provided that this entire notice is included in
* all copies of any software which is or includes a copy or
* modification of this software.
* You may use this code under the GNU public license if you so wish. Please
* contribute changes back to the authors under this freer than GPL license
* so that we may further the use of strong encryption without limitations to
* all.
*
* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
* MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
* PURPOSE.
*/
#define ENC_HDRLEN 12
/* From $OpenBSD: mbuf.h,v 1.56 2002/01/25 15:50:23 art Exp $ */
#define M_CONF 0x0400 /* packet was encrypted (ESP-transport) */
#define M_AUTH 0x0800 /* packet was authenticated (AH) */
struct enchdr {
u_int32_t af;
u_int32_t spi;
u_int32_t flags;
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: ethertype.h,v 1.1.1.1 2001/06/25 19:26:31 itojun Exp $ */ /* $NetBSD: ethertype.h,v 1.1.1.2 2004/09/27 17:06:44 dyoung Exp $ */
/* /*
* Copyright (c) 1993, 1994, 1996 * Copyright (c) 1993, 1994, 1996
@ -20,7 +20,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* @(#) Header: /tcpdump/master/tcpdump/ethertype.h,v 1.16 2001/06/21 17:56:02 itojun Exp (LBL) * @(#) Header: /tcpdump/master/tcpdump/ethertype.h,v 1.20 2003/07/01 19:10:26 guy Exp (LBL)
*/ */
/* /*
@ -71,9 +71,6 @@
#ifndef ETHERTYPE_SCA #ifndef ETHERTYPE_SCA
#define ETHERTYPE_SCA 0x6007 #define ETHERTYPE_SCA 0x6007
#endif #endif
#ifndef ETHERTYPE_REVARP
#define ETHERTYPE_REVARP 0x8035
#endif
#ifndef ETHERTYPE_LANBRIDGE #ifndef ETHERTYPE_LANBRIDGE
#define ETHERTYPE_LANBRIDGE 0x8038 #define ETHERTYPE_LANBRIDGE 0x8038
#endif #endif
@ -122,3 +119,11 @@
#ifndef ETHERTYPE_LOOPBACK #ifndef ETHERTYPE_LOOPBACK
#define ETHERTYPE_LOOPBACK 0x9000 #define ETHERTYPE_LOOPBACK 0x9000
#endif #endif
#ifndef ETHERTYPE_VMAN
#define ETHERTYPE_VMAN 0x9100 /* Extreme VMAN Protocol */
#endif
#ifndef ETHERTYPE_ISO
#define ETHERTYPE_ISO 0xfefe /* nonstandard - used in Cisco HDLC encapsulation */
#endif
extern const struct tok ethertype_values[];

View File

@ -1,4 +1,4 @@
/* $NetBSD: extract.h,v 1.1.1.2 2002/02/18 09:07:27 itojun Exp $ */ /* $NetBSD: extract.h,v 1.1.1.3 2004/09/27 17:06:44 dyoung Exp $ */
/* /*
* Copyright (c) 1992, 1993, 1994, 1995, 1996 * Copyright (c) 1992, 1993, 1994, 1995, 1996
@ -20,40 +20,81 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* @(#) Header: /tcpdump/master/tcpdump/extract.h,v 1.17 2001/09/17 21:57:52 fenner Exp (LBL) * @(#) Header: /tcpdump/master/tcpdump/extract.h,v 1.19 2002/12/11 07:13:51 guy Exp (LBL)
*/ */
/* Network to host order macros */ /* Network to host order macros */
#ifdef LBL_ALIGN #ifdef LBL_ALIGN
/*
* The processor doesn't natively handle unaligned loads.
*/
#ifdef HAVE___ATTRIBUTE__
/*
* We have __attribute__; we assume that means we have __attribute__((packed)).
* Declare packed structures containing a u_int16_t and a u_int32_t,
* cast the pointer to point to one of those, and fetch through it;
* the GCC manual doesn't appear to explicitly say that
* __attribute__((packed)) causes the compiler to generate unaligned-safe
* code, but it apppears to do so.
*
* We do this in case the compiler can generate, for this instruction set,
* better code to do an unaligned load and pass stuff to "ntohs()" or
* "ntohl()" than the code to fetch the bytes one at a time and
* assemble them. (That might not be the case on a little-endian platform,
* where "ntohs()" and "ntohl()" might not be done inline.)
*/
typedef struct {
u_int16_t val;
} __attribute__((packed)) unaligned_u_int16_t;
typedef struct {
u_int32_t val;
} __attribute__((packed)) unaligned_u_int32_t;
#define EXTRACT_16BITS(p) \ #define EXTRACT_16BITS(p) \
((u_int16_t)*((const u_int8_t *)(p) + 0) << 8 | \ ((u_int16_t)ntohs(((const unaligned_u_int16_t *)(p))->val))
(u_int16_t)*((const u_int8_t *)(p) + 1))
#define EXTRACT_32BITS(p) \ #define EXTRACT_32BITS(p) \
((u_int32_t)*((const u_int8_t *)(p) + 0) << 24 | \ ((u_int32_t)ntohl(((const unaligned_u_int32_t *)(p))->val))
(u_int32_t)*((const u_int8_t *)(p) + 1) << 16 | \ #else /* HAVE___ATTRIBUTE__ */
(u_int32_t)*((const u_int8_t *)(p) + 2) << 8 | \ /*
(u_int32_t)*((const u_int8_t *)(p) + 3)) * We don't have __attribute__, so do unaligned loads of big-endian
#else * quantities the hard way - fetch the bytes one at a time and
* assemble them.
*/
#define EXTRACT_16BITS(p) \
((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 0) << 8 | \
(u_int16_t)*((const u_int8_t *)(p) + 1)))
#define EXTRACT_32BITS(p) \
((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 0) << 24 | \
(u_int32_t)*((const u_int8_t *)(p) + 1) << 16 | \
(u_int32_t)*((const u_int8_t *)(p) + 2) << 8 | \
(u_int32_t)*((const u_int8_t *)(p) + 3)))
#endif /* HAVE___ATTRIBUTE__ */
#else /* LBL_ALIGN */
/*
* The processor natively handles unaligned loads, so we can just
* cast the pointer and fetch through it.
*/
#define EXTRACT_16BITS(p) \ #define EXTRACT_16BITS(p) \
((u_int16_t)ntohs(*(const u_int16_t *)(p))) ((u_int16_t)ntohs(*(const u_int16_t *)(p)))
#define EXTRACT_32BITS(p) \ #define EXTRACT_32BITS(p) \
((u_int32_t)ntohl(*(const u_int32_t *)(p))) ((u_int32_t)ntohl(*(const u_int32_t *)(p)))
#endif #endif /* LBL_ALIGN */
#define EXTRACT_24BITS(p) \ #define EXTRACT_24BITS(p) \
((u_int32_t)*((const u_int8_t *)(p) + 0) << 16 | \ ((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 0) << 16 | \
(u_int32_t)*((const u_int8_t *)(p) + 1) << 8 | \ (u_int32_t)*((const u_int8_t *)(p) + 1) << 8 | \
(u_int32_t)*((const u_int8_t *)(p) + 2)) (u_int32_t)*((const u_int8_t *)(p) + 2)))
/* Little endian protocol host order macros */ /* Little endian protocol host order macros */
#define EXTRACT_LE_8BITS(p) (*(p)) #define EXTRACT_LE_8BITS(p) (*(p))
#define EXTRACT_LE_16BITS(p) \ #define EXTRACT_LE_16BITS(p) \
((u_int16_t)*((const u_int8_t *)(p) + 1) << 8 | \ ((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 1) << 8 | \
(u_int16_t)*((const u_int8_t *)(p) + 0)) (u_int16_t)*((const u_int8_t *)(p) + 0)))
#define EXTRACT_LE_32BITS(p) \ #define EXTRACT_LE_32BITS(p) \
((u_int32_t)*((const u_int8_t *)(p) + 3) << 24 | \ ((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 3) << 24 | \
(u_int32_t)*((const u_int8_t *)(p) + 2) << 16 | \ (u_int32_t)*((const u_int8_t *)(p) + 2) << 16 | \
(u_int32_t)*((const u_int8_t *)(p) + 1) << 8 | \ (u_int32_t)*((const u_int8_t *)(p) + 1) << 8 | \
(u_int32_t)*((const u_int8_t *)(p) + 0)) (u_int32_t)*((const u_int8_t *)(p) + 0)))

4
dist/tcpdump/fddi.h vendored
View File

@ -1,4 +1,4 @@
/* $NetBSD: fddi.h,v 1.1.1.1 2001/06/25 19:26:31 itojun Exp $ */ /* $NetBSD: fddi.h,v 1.1.1.2 2004/09/27 17:06:46 dyoung Exp $ */
/* /*
* Copyright (c) 1992, 1993, 1994, 1995, 1996 * Copyright (c) 1992, 1993, 1994, 1995, 1996
@ -20,7 +20,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* @(#) Header: /tcpdump/master/tcpdump/fddi.h,v 1.9 2000/10/09 02:59:39 guy Exp (LBL) * @(#) Header: /tcpdump/master/tcpdump/fddi.h,v 1.11 2002/12/11 07:13:51 guy Exp (LBL)
*/ */
/* /*

136
dist/tcpdump/gmpls.c vendored Normal file
View File

@ -0,0 +1,136 @@
/* $NetBSD: gmpls.c,v 1.1.1.1 2004/09/27 17:06:46 dyoung Exp $ */
/*
* 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, and (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.
* 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.
*
* Original code by Hannes Gredler (hannes@juniper.net)
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/gmpls.c,v 1.2.2.2 2003/11/16 08:51:05 guy Exp (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include "interface.h"
/* rfc3471 */
struct tok gmpls_link_prot_values[] = {
{ 0x01, "Extra Traffic"},
{ 0x02, "Unprotected"},
{ 0x04, "Shared"},
{ 0x08, "Dedicated 1:1"},
{ 0x10, "Dedicated 1+1"},
{ 0x20, "Enhanced"},
{ 0x40, "Reserved"},
{ 0x80, "Reserved"},
{ 0, NULL }
};
/* rfc3471 */
struct tok gmpls_switch_cap_values[] = {
{ 1, "Packet-Switch Capable-1"},
{ 2, "Packet-Switch Capable-2"},
{ 3, "Packet-Switch Capable-3"},
{ 4, "Packet-Switch Capable-4"},
{ 51, "Layer-2 Switch Capable"},
{ 100, "Time-Division-Multiplex"},
{ 150, "Lambda-Switch Capable"},
{ 200, "Fiber-Switch Capable"},
{ 0, NULL }
};
/* rfc3471 */
struct tok gmpls_encoding_values[] = {
{ 1, "Packet"},
{ 2, "Ethernet V2/DIX"},
{ 3, "ANSI/ETSI PDH"},
{ 4, "Reserved"},
{ 5, "SDH ITU-T G.707/SONET ANSI T1.105"},
{ 6, "Reserved"},
{ 7, "Digital Wrapper"},
{ 8, "Lambda (photonic)"},
{ 9, "Fiber"},
{ 10, "Reserved"},
{ 11, "FiberChannel"},
{ 0, NULL }
};
/* rfc3471 */
struct tok gmpls_payload_values[] = {
{ 0, "Unknown"},
{ 1, "Reserved"},
{ 2, "Reserved"},
{ 3, "Reserved"},
{ 4, "Reserved"},
{ 5, "Asynchronous mapping of E4"},
{ 6, "Asynchronous mapping of DS3/T3"},
{ 7, "Asynchronous mapping of E3"},
{ 8, "Bit synchronous mapping of E3"},
{ 9, "Byte synchronous mapping of E3"},
{ 10, "Asynchronous mapping of DS2/T2"},
{ 11, "Bit synchronous mapping of DS2/T2"},
{ 12, "Reserved"},
{ 13, "Asynchronous mapping of E1"},
{ 14, "Byte synchronous mapping of E1"},
{ 15, "Byte synchronous mapping of 31 * DS0"},
{ 16, "Asynchronous mapping of DS1/T1"},
{ 17, "Bit synchronous mapping of DS1/T1"},
{ 18, "Byte synchronous mapping of DS1/T1"},
{ 19, "VC-11 in VC-12"},
{ 20, "Reserved"},
{ 21, "Reserved"},
{ 22, "DS1 SF Asynchronous"},
{ 23, "DS1 ESF Asynchronous"},
{ 24, "DS3 M23 Asynchronous"},
{ 25, "DS3 C-Bit Parity Asynchronous"},
{ 26, "VT/LOVC"},
{ 27, "STS SPE/HOVC"},
{ 28, "POS - No Scrambling, 16 bit CRC"},
{ 29, "POS - No Scrambling, 32 bit CRC"},
{ 30, "POS - Scrambling, 16 bit CRC"},
{ 31, "POS - Scrambling, 32 bit CRC"},
{ 32, "ATM mapping"},
{ 33, "Ethernet PHY"},
{ 34, "SONET/SDH"},
{ 35, "Reserved (SONET deprecated)"},
{ 36, "Digital Wrapper"},
{ 37, "Lambda"},
{ 38, "ANSI/ETSI PDH"},
{ 39, "Reserved"},
{ 40, "Link Access Protocol SDH (X.85 and X.86)"},
{ 41, "FDDI"},
{ 42, "DQDB (ETSI ETS 300 216)"},
{ 43, "FiberChannel-3 (Services)"},
{ 44, "HDLC"},
{ 45, "Ethernet V2/DIX (only)"},
{ 46, "Ethernet 802.3 (only)"},
/* draft-ietf-ccamp-gmpls-g709-04.txt */
{ 47, "G.709 ODUj"},
{ 48, "G.709 OTUk(v)"},
{ 49, "CBR/CBRa"},
{ 50, "CBRb"},
{ 51, "BSOT"},
{ 52, "BSNT"},
{ 53, "IP/PPP (GFP)"},
{ 54, "Ethernet MAC (framed GFP)"},
{ 55, "Ethernet PHY (transparent GFP)"},
{ 56, "ESCON"},
{ 57, "FICON"},
{ 58, "Fiber Channel"},
{ 0, NULL }
};

22
dist/tcpdump/gmpls.h vendored Normal file
View File

@ -0,0 +1,22 @@
/* $NetBSD: gmpls.h,v 1.1.1.1 2004/09/27 17:06:46 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/gmpls.h,v 1.2 2003/06/09 23:28:09 guy Exp (LBL) */
/*
* 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, and (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.
* 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.
*
* Original code by Hannes Gredler (hannes@juniper.net)
*/
extern struct tok gmpls_link_prot_values[];
extern struct tok gmpls_switch_cap_values[];
extern struct tok gmpls_encoding_values[];
extern struct tok gmpls_payload_values[];

View File

@ -1,6 +1,6 @@
/* $NetBSD: ieee802_11.h,v 1.1.1.1 2001/06/25 19:26:31 itojun Exp $ */ /* $NetBSD: ieee802_11.h,v 1.1.1.2 2004/09/27 17:06:46 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.3 2001/06/14 09:50:01 guy Exp (LBL) */ /* @(#) Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.9 2003/07/22 17:36:57 guy Exp (LBL) */
/* /*
* Copyright (c) 2001 * Copyright (c) 2001
* Fortress Technologies * Fortress Technologies
@ -23,52 +23,87 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/ */
#define IEEE802_11_FC_LEN 2 /* Lengths of 802.11 header components. */
#define IEEE802_11_FC_LEN 2
#define IEEE802_11_DUR_LEN 2
#define IEEE802_11_DA_LEN 6
#define IEEE802_11_SA_LEN 6
#define IEEE802_11_BSSID_LEN 6
#define IEEE802_11_RA_LEN 6
#define IEEE802_11_TA_LEN 6
#define IEEE802_11_SEQ_LEN 2
#define IEEE802_11_IV_LEN 3
#define IEEE802_11_KID_LEN 1
#define T_MGMT 0x0 /* management */ /* Frame check sequence length. */
#define T_CTRL 0x1 /* control */ #define IEEE802_11_FCS_LEN 4
#define T_DATA 0x2 /* data */
#define T_RESV 0x3 /* reserved */
#define ST_ASSOC_REQUEST 0x0 /* Lengths of beacon components. */
#define ST_ASSOC_RESPONSE 0x1 #define IEEE802_11_TSTAMP_LEN 8
#define ST_REASSOC_REQUEST 0x2 #define IEEE802_11_BCNINT_LEN 2
#define ST_REASSOC_RESPONSE 0x3 #define IEEE802_11_CAPINFO_LEN 2
#define ST_PROBE_REQUEST 0x4 #define IEEE802_11_LISTENINT_LEN 2
#define ST_PROBE_RESPONSE 0x5
#define IEEE802_11_AID_LEN 2
#define IEEE802_11_STATUS_LEN 2
#define IEEE802_11_REASON_LEN 2
/* Length of previous AP in reassocation frame */
#define IEEE802_11_AP_LEN 6
#define T_MGMT 0x0 /* management */
#define T_CTRL 0x1 /* control */
#define T_DATA 0x2 /* data */
#define T_RESV 0x3 /* reserved */
#define ST_ASSOC_REQUEST 0x0
#define ST_ASSOC_RESPONSE 0x1
#define ST_REASSOC_REQUEST 0x2
#define ST_REASSOC_RESPONSE 0x3
#define ST_PROBE_REQUEST 0x4
#define ST_PROBE_RESPONSE 0x5
/* RESERVED 0x6 */ /* RESERVED 0x6 */
/* RESERVED 0x7 */ /* RESERVED 0x7 */
#define ST_BEACON 0x8 #define ST_BEACON 0x8
#define ST_ATIM 0x9 #define ST_ATIM 0x9
#define ST_DISASSOC 0xA #define ST_DISASSOC 0xA
#define ST_AUTH 0xB #define ST_AUTH 0xB
#define ST_DEAUTH 0xC #define ST_DEAUTH 0xC
/* RESERVED 0xD */ /* RESERVED 0xD */
/* RESERVED 0xE */ /* RESERVED 0xE */
/* RESERVED 0xF */ /* RESERVED 0xF */
#define CTRL_PS_POLL 0xA #define CTRL_PS_POLL 0xA
#define CTRL_RTS 0xB #define CTRL_RTS 0xB
#define CTRL_CTS 0xC #define CTRL_CTS 0xC
#define CTRL_ACK 0xD #define CTRL_ACK 0xD
#define CTRL_CF_END 0xE #define CTRL_CF_END 0xE
#define CTRL_END_ACK 0xF #define CTRL_END_ACK 0xF
#define DATA_DATA 0x0
#define DATA_DATA_CF_ACK 0x1
#define DATA_DATA_CF_POLL 0x2
#define DATA_DATA_CF_ACK_POLL 0x3
#define DATA_NODATA 0x4
#define DATA_NODATA_CF_ACK 0x5
#define DATA_NODATA_CF_POLL 0x6
#define DATA_NODATA_CF_ACK_POLL 0x7
/* /*
* Bits in the frame control field. * Bits in the frame control field.
*/ */
#define FC_VERSION(fc) ((fc) & 0x3) #define FC_VERSION(fc) ((fc) & 0x3)
#define FC_TYPE(fc) (((fc) >> 2) & 0x3) #define FC_TYPE(fc) (((fc) >> 2) & 0x3)
#define FC_SUBTYPE(fc) (((fc) >> 4) & 0xF) #define FC_SUBTYPE(fc) (((fc) >> 4) & 0xF)
#define FC_TO_DS(fc) ((fc) & 0x0100) #define FC_TO_DS(fc) ((fc) & 0x0100)
#define FC_FROM_DS(fc) ((fc) & 0x0200) #define FC_FROM_DS(fc) ((fc) & 0x0200)
#define FC_MORE_FLAG(fc) ((fc) & 0x0400) #define FC_MORE_FLAG(fc) ((fc) & 0x0400)
#define FC_RETRY(fc) ((fc) & 0x0800) #define FC_RETRY(fc) ((fc) & 0x0800)
#define FC_POWER_MGMT(fc) ((fc) & 0x1000) #define FC_POWER_MGMT(fc) ((fc) & 0x1000)
#define FC_MORE_DATA(fc) ((fc) & 0x2000) #define FC_MORE_DATA(fc) ((fc) & 0x2000)
#define FC_WEP(fc) ((fc) & 0x4000) #define FC_WEP(fc) ((fc) & 0x4000)
#define FC_ORDER(fc) ((fc) & 0x8000) #define FC_ORDER(fc) ((fc) & 0x8000)
struct mgmt_header_t { struct mgmt_header_t {
u_int16_t fc; u_int16_t fc;
@ -79,19 +114,21 @@ struct mgmt_header_t {
u_int16_t seq_ctrl; u_int16_t seq_ctrl;
}; };
#define MGMT_HEADER_LEN (2+2+6+6+6+2) #define MGMT_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\
IEEE802_11_DA_LEN+IEEE802_11_SA_LEN+\
IEEE802_11_BSSID_LEN+IEEE802_11_SEQ_LEN)
#define CAPABILITY_ESS(cap) ((cap) & 0x0001) #define CAPABILITY_ESS(cap) ((cap) & 0x0001)
#define CAPABILITY_IBSS(cap) ((cap) & 0x0002) #define CAPABILITY_IBSS(cap) ((cap) & 0x0002)
#define CAPABILITY_CFP(cap) ((cap) & 0x0004) #define CAPABILITY_CFP(cap) ((cap) & 0x0004)
#define CAPABILITY_CFP_REQ(cap) ((cap) & 0x0008) #define CAPABILITY_CFP_REQ(cap) ((cap) & 0x0008)
#define CAPABILITY_PRIVACY(cap) ((cap) & 0x0010) #define CAPABILITY_PRIVACY(cap) ((cap) & 0x0010)
struct ssid_t { struct ssid_t {
u_int8_t element_id; u_int8_t element_id;
u_int8_t length; u_int8_t length;
u_char ssid[33]; /* 32 + 1 for null */ u_char ssid[33]; /* 32 + 1 for null */
} ; };
struct rates_t { struct rates_t {
u_int8_t element_id; u_int8_t element_id;
@ -137,13 +174,13 @@ struct tim_t {
u_int8_t bitmap[251]; u_int8_t bitmap[251];
}; };
#define E_SSID 0 #define E_SSID 0
#define E_RATES 1 #define E_RATES 1
#define E_FH 2 #define E_FH 2
#define E_DS 3 #define E_DS 3
#define E_CF 4 #define E_CF 4
#define E_TIM 5 #define E_TIM 5
#define E_IBSS 6 #define E_IBSS 6
/* reserved 7 */ /* reserved 7 */
/* reserved 8 */ /* reserved 8 */
/* reserved 9 */ /* reserved 9 */
@ -155,7 +192,7 @@ struct tim_t {
/* reserved 15 */ /* reserved 15 */
/* reserved 16 */ /* reserved 16 */
#define E_CHALLENGE 16 #define E_CHALLENGE 16
/* reserved 17 */ /* reserved 17 */
/* reserved 18 */ /* reserved 18 */
/* reserved 19 */ /* reserved 19 */
@ -191,7 +228,8 @@ struct ctrl_rts_t {
u_int8_t fcs[4]; u_int8_t fcs[4];
}; };
#define CTRL_RTS_LEN (2+2+6+6+4) #define CTRL_RTS_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\
IEEE802_11_RA_LEN+IEEE802_11_TA_LEN)
struct ctrl_cts_t { struct ctrl_cts_t {
u_int16_t fc; u_int16_t fc;
@ -200,7 +238,7 @@ struct ctrl_cts_t {
u_int8_t fcs[4]; u_int8_t fcs[4];
}; };
#define CTRL_CTS_LEN (2+2+6+4) #define CTRL_CTS_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+IEEE802_11_RA_LEN)
struct ctrl_ack_t { struct ctrl_ack_t {
u_int16_t fc; u_int16_t fc;
@ -209,7 +247,7 @@ struct ctrl_ack_t {
u_int8_t fcs[4]; u_int8_t fcs[4];
}; };
#define CTRL_ACK_LEN (2+2+6+4) #define CTRL_ACK_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+IEEE802_11_RA_LEN)
struct ctrl_ps_poll_t { struct ctrl_ps_poll_t {
u_int16_t fc; u_int16_t fc;
@ -219,7 +257,8 @@ struct ctrl_ps_poll_t {
u_int8_t fcs[4]; u_int8_t fcs[4];
}; };
#define CTRL_PS_POLL_LEN (2+2+6+6+4) #define CTRL_PS_POLL_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_AID_LEN+\
IEEE802_11_BSSID_LEN+IEEE802_11_TA_LEN)
struct ctrl_end_t { struct ctrl_end_t {
u_int16_t fc; u_int16_t fc;
@ -229,7 +268,8 @@ struct ctrl_end_t {
u_int8_t fcs[4]; u_int8_t fcs[4];
}; };
#define CTRL_END_LEN (2+2+6+6+4) #define CTRL_END_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\
IEEE802_11_RA_LEN+IEEE802_11_BSSID_LEN)
struct ctrl_end_ack_t { struct ctrl_end_ack_t {
u_int16_t fc; u_int16_t fc;
@ -239,8 +279,9 @@ struct ctrl_end_ack_t {
u_int8_t fcs[4]; u_int8_t fcs[4];
}; };
#define CTRL_END_ACK_LEN (2+2+6+6+4) #define CTRL_END_ACK_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\
IEEE802_11_RA_LEN+IEEE802_11_BSSID_LEN)
#define IV_IV(iv) ((iv) & 0xFFFFFF) #define IV_IV(iv) ((iv) & 0xFFFFFF)
#define IV_PAD(iv) (((iv) >> 24) & 0x3F) #define IV_PAD(iv) (((iv) >> 24) & 0x3F)
#define IV_KEYID(iv) (((iv) >> 30) & 0x03) #define IV_KEYID(iv) (((iv) >> 30) & 0x03)

4
dist/tcpdump/igrp.h vendored
View File

@ -1,6 +1,6 @@
/* $NetBSD: igrp.h,v 1.1.1.1 2001/06/25 19:26:31 itojun Exp $ */ /* $NetBSD: igrp.h,v 1.1.1.2 2004/09/27 17:06:46 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/igrp.h,v 1.4 2000/12/17 23:07:49 guy Exp (LBL) */ /* @(#) Header: /tcpdump/master/tcpdump/igrp.h,v 1.6 2002/12/11 07:13:52 guy Exp (LBL) */
/* Cisco IGRP definitions */ /* Cisco IGRP definitions */
/* IGRP Header */ /* IGRP Header */

31
dist/tcpdump/ipfc.h vendored Normal file
View File

@ -0,0 +1,31 @@
/* $NetBSD: ipfc.h,v 1.1.1.1 2004/09/27 17:06:30 dyoung Exp $ */
/*
* Copyright (c) 1992, 1993, 1994, 1995, 1996
* 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.
*
* @(#) Header: /tcpdump/master/tcpdump/ipfc.h,v 1.4 2002/12/11 07:13:53 guy Exp (LBL)
*/
struct ipfc_header {
u_char ipfc_dhost[8];
u_char ipfc_shost[8];
};
#define IPFC_HDRLEN 16

138
dist/tcpdump/ipproto.h vendored Normal file
View File

@ -0,0 +1,138 @@
/* $NetBSD: ipproto.h,v 1.1.1.1 2004/09/27 17:06:28 dyoung Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
* 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 the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. 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 BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#) Header: /tcpdump/master/tcpdump/ipproto.h,v 1.1.2.1 2003/11/24 20:31:22 guy Exp (LBL)
*
* From:
* @(#)in.h 8.3 (Berkeley) 1/3/94
* $FreeBSD: src/sys/netinet/in.h,v 1.38.2.3 1999/08/29 16:29:34 peter Exp $
*/
#ifndef IPPROTO_IP
#define IPPROTO_IP 0 /* dummy for IP */
#endif
#ifndef IPPROTO_HOPOPTS
#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */
#endif
#ifndef IPPROTO_ICMP
#define IPPROTO_ICMP 1 /* control message protocol */
#endif
#ifndef IPPROTO_IGMP
#define IPPROTO_IGMP 2 /* group mgmt protocol */
#endif
#ifndef IPPROTO_IPV4
#define IPPROTO_IPV4 4
#endif
#ifndef IPPROTO_TCP
#define IPPROTO_TCP 6 /* tcp */
#endif
#ifndef IPPROTO_EGP
#define IPPROTO_EGP 8 /* exterior gateway protocol */
#endif
#ifndef IPPROTO_IGRP
#define IPPROTO_IGRP 9
#endif
#ifndef IPPROTO_UDP
#define IPPROTO_UDP 17 /* user datagram protocol */
#endif
#ifndef IPPROTO_IPV6
#define IPPROTO_IPV6 41
#endif
#ifndef IPPROTO_ROUTING
#define IPPROTO_ROUTING 43 /* IPv6 routing header */
#endif
#ifndef IPPROTO_FRAGMENT
#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */
#endif
#ifndef IPPROTO_RSVP
#define IPPROTO_RSVP 46 /* resource reservation */
#endif
#ifndef IPPROTO_GRE
#define IPPROTO_GRE 47 /* General Routing Encap. */
#endif
#ifndef IPPROTO_ESP
#define IPPROTO_ESP 50 /* SIPP Encap Sec. Payload */
#endif
#ifndef IPPROTO_AH
#define IPPROTO_AH 51 /* SIPP Auth Header */
#endif
#ifndef IPPROTO_MOBILE
#define IPPROTO_MOBILE 55
#endif
#ifndef IPPROTO_ICMPV6
#define IPPROTO_ICMPV6 58 /* ICMPv6 */
#endif
#ifndef IPPROTO_NONE
#define IPPROTO_NONE 59 /* IPv6 no next header */
#endif
#ifndef IPPROTO_DSTOPTS
#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */
#endif
#ifndef IPPROTO_MOBILITY_OLD
/*
* The current Protocol Numbers list says that the IP protocol number for
* mobility headers is 135; it cites draft-ietf-mobileip-ipv6-24, but
* that draft doesn't actually give a number.
*
* It appears that 62 used to be used, even though that's assigned to
* a protocol called CFTP; however, the only reference for CFTP is a
* Network Message from BBN back in 1982, so, for now, we support 62,
* aas well as 135, as a protocol number for mobility headers.
*/
#define IPPROTO_MOBILITY_OLD 62
#endif
#ifndef IPPROTO_ND
#define IPPROTO_ND 77 /* Sun net disk proto (temp.) */
#endif
#ifndef IPPROTO_IGRP
#define IPPROTO_IGRP 88 /* Cisco/GXS IGRP */
#endif
#ifndef IPPROTO_OSPF
#define IPPROTO_OSPF 89
#endif
#ifndef IPPROTO_PIM
#define IPPROTO_PIM 103
#endif
#ifndef IPPROTO_IPCOMP
#define IPPROTO_IPCOMP 108
#endif
#ifndef IPPROTO_VRRP
#define IPPROTO_VRRP 112
#endif
#ifndef IPPROTO_SCTP
#define IPPROTO_SCTP 132
#endif
#ifndef IPPROTO_MOBILITY
#define IPPROTO_MOBILITY 135
#endif

View File

@ -1,9 +1,9 @@
/* $NetBSD: ipsec_doi.h,v 1.1.1.1 2001/06/25 19:26:32 itojun Exp $ */ /* $NetBSD: ipsec_doi.h,v 1.1.1.2 2004/09/27 17:06:48 dyoung Exp $ */
/* /*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
@ -15,7 +15,7 @@
* 3. Neither the name of the project nor the names of its contributors * 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
/* YIPS @(#)Id: ipsec_doi.h,v 1.4 2000/10/04 03:00:29 itojun Exp */ /* YIPS @(#)Id: ipsec_doi.h,v 1.7 2002/12/11 07:13:53 guy Exp */
/* refer to RFC 2407 */ /* refer to RFC 2407 */

6
dist/tcpdump/ipx.h vendored
View File

@ -1,9 +1,9 @@
/* $NetBSD: ipx.h,v 1.1.1.2 2002/05/31 09:28:27 itojun Exp $ */ /* $NetBSD: ipx.h,v 1.1.1.3 2004/09/27 17:06:48 dyoung Exp $ */
/* /*
* IPX protocol formats * IPX protocol formats
* *
* @(#) Header: /tcpdump/master/tcpdump/ipx.h,v 1.5 2002/03/05 11:35:45 guy Exp * @(#) Header: /tcpdump/master/tcpdump/ipx.h,v 1.8 2002/12/11 07:13:54 guy Exp
*/ */
/* well-known sockets */ /* well-known sockets */

View File

@ -1,9 +1,9 @@
/* $NetBSD: isakmp.h,v 1.1.1.1 2001/06/25 19:26:32 itojun Exp $ */ /* $NetBSD: isakmp.h,v 1.1.1.2 2004/09/27 17:06:48 dyoung Exp $ */
/* /*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
@ -15,7 +15,7 @@
* 3. Neither the name of the project nor the names of its contributors * 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
/* YIPS @(#)Id: isakmp.h,v 1.7 2000/10/03 05:16:38 itojun Exp */ /* YIPS @(#)Id: isakmp.h,v 1.10 2002/12/11 07:13:54 guy Exp */
/* refer to RFC 2408 */ /* refer to RFC 2408 */

19
dist/tcpdump/lane.h vendored
View File

@ -1,8 +1,8 @@
/* $NetBSD: lane.h,v 1.1.1.1 2001/06/25 19:26:32 itojun Exp $ */ /* $NetBSD: lane.h,v 1.1.1.2 2004/09/27 17:06:48 dyoung Exp $ */
/* /*
* Marko Kiiskila carnil@cs.tut.fi * Marko Kiiskila carnil@cs.tut.fi
* *
* Tampere University of Technology - Telecommunications Laboratory * Tampere University of Technology - Telecommunications Laboratory
* *
* Permission to use, copy, modify and distribute this * Permission to use, copy, modify and distribute this
@ -14,15 +14,15 @@
* documentation, and that the use of this software is * documentation, and that the use of this software is
* acknowledged in any publications resulting from using * acknowledged in any publications resulting from using
* the software. * the software.
* *
* TUT ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * TUT ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION AND DISCLAIMS ANY LIABILITY OF ANY KIND FOR * CONDITION AND DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS
* SOFTWARE. * SOFTWARE.
* *
*/ */
/* Id: lane.h,v 1.3 2000/10/03 02:54:56 itojun Exp */ /* Id: lane.h,v 1.7 2002/12/11 07:13:54 guy Exp */
#ifndef ETHER_ADDR_LEN #ifndef ETHER_ADDR_LEN
#define ETHER_ADDR_LEN 6 #define ETHER_ADDR_LEN 6
@ -34,3 +34,10 @@ struct lecdatahdr_8023 {
u_int8_t h_source[ETHER_ADDR_LEN]; u_int8_t h_source[ETHER_ADDR_LEN];
u_int16_t h_type; u_int16_t h_type;
}; };
struct lane_controlhdr {
u_int16_t lec_header;
u_int8_t lec_proto;
u_int8_t lec_vers;
u_int16_t lec_opcode;
};

4
dist/tcpdump/llc.h vendored
View File

@ -1,4 +1,4 @@
/* $NetBSD: llc.h,v 1.1.1.2 2002/05/31 09:27:59 itojun Exp $ */ /* $NetBSD: llc.h,v 1.1.1.3 2004/09/27 17:06:49 dyoung Exp $ */
/* /*
* Copyright (c) 1993, 1994, 1997 * Copyright (c) 1993, 1994, 1997
@ -20,7 +20,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
* *
* @(#) Header: /tcpdump/master/tcpdump/llc.h,v 1.14 2002/04/07 09:50:30 guy Exp (LBL) * @(#) Header: /tcpdump/master/tcpdump/llc.h,v 1.16 2002/12/11 07:13:54 guy Exp (LBL)
*/ */
/* /*

View File

@ -1,9 +1,9 @@
/* $NetBSD: netbios.h,v 1.1.1.1 2001/06/25 19:26:32 itojun Exp $ */ /* $NetBSD: netbios.h,v 1.1.1.2 2004/09/27 17:06:51 dyoung Exp $ */
/* /*
* NETBIOS protocol formats * NETBIOS protocol formats
* *
* @(#) Header: /tcpdump/master/tcpdump/netbios.h,v 1.1.1.1 1999/10/07 23:47:10 mcr Exp * @(#) Header: /tcpdump/master/tcpdump/netbios.h,v 1.3 2002/12/11 07:13:55 guy Exp
*/ */
struct p8022Hdr { struct p8022Hdr {

6
dist/tcpdump/ntp.h vendored
View File

@ -1,6 +1,6 @@
/* $NetBSD: ntp.h,v 1.1.1.1 2001/06/25 19:26:32 itojun Exp $ */ /* $NetBSD: ntp.h,v 1.1.1.2 2004/09/27 17:06:51 dyoung Exp $ */
/* Header: /tcpdump/master/tcpdump/ntp.h,v 1.4 2000/10/03 02:54:57 itojun Exp */ /* Header: /tcpdump/master/tcpdump/ntp.h,v 1.7 2003/08/06 04:58:21 guy Exp */
/* /*
* Based on ntp.h from the U of MD implementation * Based on ntp.h from the U of MD implementation
@ -10,7 +10,7 @@
/* /*
* Definitions for the masses * Definitions for the masses
*/ */
#define JAN_1970 2208988800 /* 1970 - 1900 in seconds */ #define JAN_1970 2208988800U /* 1970 - 1900 in seconds */
/* /*
* Structure definitions for NTP fixed point values * Structure definitions for NTP fixed point values

View File

@ -1,9 +1,9 @@
/* $NetBSD: oakley.h,v 1.1.1.1 2001/06/25 19:26:32 itojun Exp $ */ /* $NetBSD: oakley.h,v 1.1.1.2 2004/09/27 17:06:51 dyoung Exp $ */
/* /*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
@ -15,7 +15,7 @@
* 3. Neither the name of the project nor the names of its contributors * 3. Neither the name of the project nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
*/ */
/* YIPS @(#)Id: oakley.h,v 1.1 1999/10/30 05:11:10 itojun Exp */ /* YIPS @(#)Id: oakley.h,v 1.4 2002/12/11 07:13:56 guy Exp */
/* refer to RFC 2409 */ /* refer to RFC 2409 */

100
dist/tcpdump/ospf.h vendored
View File

@ -1,6 +1,6 @@
/* $NetBSD: ospf.h,v 1.1.1.1 2001/06/25 19:26:33 itojun Exp $ */ /* $NetBSD: ospf.h,v 1.1.1.2 2004/09/27 17:06:52 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/ospf.h,v 1.3 2000/12/17 23:07:50 guy Exp (LBL) */ /* @(#) Header: /tcpdump/master/tcpdump/ospf.h,v 1.11 2003/10/22 17:08:46 hannes Exp (LBL) */
/* /*
* Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997 * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
@ -23,25 +23,34 @@
* *
* OSPF support contributed by Jeffrey Honig (jch@mitchell.cit.cornell.edu) * OSPF support contributed by Jeffrey Honig (jch@mitchell.cit.cornell.edu)
*/ */
#define OSPF_TYPE_UMD 0 /* UMd's special monitoring packets */ #define OSPF_TYPE_UMD 0 /* UMd's special monitoring packets */
#define OSPF_TYPE_HELLO 1 /* Hello */ #define OSPF_TYPE_HELLO 1 /* Hello */
#define OSPF_TYPE_DB 2 /* Database Description */ #define OSPF_TYPE_DD 2 /* Database Description */
#define OSPF_TYPE_LSR 3 /* Link State Request */ #define OSPF_TYPE_LS_REQ 3 /* Link State Request */
#define OSPF_TYPE_LSU 4 /* Link State Update */ #define OSPF_TYPE_LS_UPDATE 4 /* Link State Update */
#define OSPF_TYPE_LSA 5 /* Link State Ack */ #define OSPF_TYPE_LS_ACK 5 /* Link State Ack */
#define OSPF_TYPE_MAX 6
/* Options *_options */ /* Options field
*
* +------------------------------------+
* | * | O | DC | EA | N/P | MC | E | T |
* +------------------------------------+
*
*/
#define OSPF_OPTION_T 0x01 /* T bit: TOS support */ #define OSPF_OPTION_T 0x01 /* T bit: TOS support */
#define OSPF_OPTION_E 0x02 /* E bit: External routes advertised */ #define OSPF_OPTION_E 0x02 /* E bit: External routes advertised */
#define OSPF_OPTION_MC 0x04 /* MC bit: Multicast capable */ #define OSPF_OPTION_MC 0x04 /* MC bit: Multicast capable */
#define OSPF_OPTION_NP 0x08 /* N/P bit: NSSA capable */
#define OSPF_OPTION_EA 0x10 /* EA bit: External Attribute capable */
#define OSPF_OPTION_DC 0x20 /* DC bit: Demand circuit capable */
#define OSPF_OPTION_O 0x40 /* O bit: Opaque LSA capable */
/* ospf_authtype */ /* ospf_authtype */
#define OSPF_AUTH_NONE 0 /* No auth-data */ #define OSPF_AUTH_NONE 0 /* No auth-data */
#define OSPF_AUTH_SIMPLE 1 /* Simple password */ #define OSPF_AUTH_SIMPLE 1 /* Simple password */
#define OSPF_AUTH_MD5 2 /* MD5 authentication */ #define OSPF_AUTH_MD5 2 /* MD5 authentication */
#define OSPF_AUTH_MD5_LEN 16 /* length of MD5 authentication */ #define OSPF_AUTH_MD5_LEN 16 /* length of MD5 authentication */
/* db_flags */ /* db_flags */
#define OSPF_DB_INIT 0x04 /* */ #define OSPF_DB_INIT 0x04 /* */
@ -56,7 +65,33 @@
#define LS_TYPE_ASE 5 /* ASE */ #define LS_TYPE_ASE 5 /* ASE */
#define LS_TYPE_GROUP 6 /* Group membership (multicast */ #define LS_TYPE_GROUP 6 /* Group membership (multicast */
/* extensions 23 July 1991) */ /* extensions 23 July 1991) */
#define LS_TYPE_MAX 7 #define LS_TYPE_NSSA 7 /* rfc1587 - Not so Stubby Areas */
#define LS_TYPE_OPAQUE_LL 9 /* rfc2370 - Opaque Link Local */
#define LS_TYPE_OPAQUE_AL 10 /* rfc2370 - Opaque Link Local */
#define LS_TYPE_OPAQUE_DW 11 /* rfc2370 - Opaque Domain Wide */
#define LS_OPAQUE_TYPE_TE 1 /* rfc3630 */
#define LS_OPAQUE_TYPE_GRACE 3 /* draft-ietf-ospf-hitless-restart */
#define LS_OPAQUE_TE_TLV_ROUTER 1 /* rfc3630 */
#define LS_OPAQUE_TE_TLV_LINK 2 /* rfc3630 */
#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE 1 /* rfc3630 */
#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_ID 2 /* rfc3630 */
#define LS_OPAQUE_TE_LINK_SUBTLV_LOCAL_IP 3 /* rfc3630 */
#define LS_OPAQUE_TE_LINK_SUBTLV_REMOTE_IP 4 /* rfc3630 */
#define LS_OPAQUE_TE_LINK_SUBTLV_TE_METRIC 5 /* rfc3630 */
#define LS_OPAQUE_TE_LINK_SUBTLV_MAX_BW 6 /* rfc3630 */
#define LS_OPAQUE_TE_LINK_SUBTLV_MAX_RES_BW 7 /* rfc3630 */
#define LS_OPAQUE_TE_LINK_SUBTLV_UNRES_BW 8 /* rfc3630 */
#define LS_OPAQUE_TE_LINK_SUBTLV_ADMIN_GROUP 9 /* rfc3630 */
#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_LOCAL_REMOTE_ID 11 /* draft-ietf-ccamp-ospf-gmpls-extensions */
#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_PROTECTION_TYPE 14 /* draft-ietf-ccamp-ospf-gmpls-extensions */
#define LS_OPAQUE_TE_LINK_SUBTLV_INTF_SW_CAP_DESCR 15 /* draft-ietf-ccamp-ospf-gmpls-extensions */
#define LS_OPAQUE_TE_LINK_SUBTLV_SHARED_RISK_GROUP 16 /* draft-ietf-ccamp-ospf-gmpls-extensions */
#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE_PTP 1 /* rfc3630 */
#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE_MA 2 /* rfc3630 */
/************************************************* /*************************************************
* *
@ -97,12 +132,18 @@ struct lsa_hdr {
u_int16_t ls_age; u_int16_t ls_age;
u_int8_t ls_options; u_int8_t ls_options;
u_int8_t ls_type; u_int8_t ls_type;
struct in_addr ls_stateid; union {
struct in_addr lsa_id;
struct { /* opaque LSAs change the LSA-ID field */
u_int8_t opaque_type;
u_int8_t opaque_id[3];
} opaque_field;
} un_lsa_id;
struct in_addr ls_router; struct in_addr ls_router;
u_int32_t ls_seq; u_int32_t ls_seq;
u_int16_t ls_chksum; u_int16_t ls_chksum;
u_int16_t ls_length; u_int16_t ls_length;
} ; };
/* link state advertisement */ /* link state advertisement */
struct lsa { struct lsa {
@ -151,8 +192,21 @@ struct lsa {
u_int32_t mcla_vtype; u_int32_t mcla_vtype;
struct in_addr mcla_vid; struct in_addr mcla_vid;
} un_mcla[1]; } un_mcla[1];
/* Opaque TE LSA */
struct {
u_int16_t type;
u_int16_t length;
u_int8_t data[1]; /* may repeat */
} un_te_lsa_tlv;
/* Unknown LSA */
struct unknown {
u_int8_t data[1]; /* may repeat */
} un_unknown[1];
} lsa_un; } lsa_un;
} ; };
/* /*
@ -162,7 +216,7 @@ struct tos_metric {
u_int8_t tos_type; u_int8_t tos_type;
u_int8_t tos_zero; u_int8_t tos_zero;
u_int16_t tos_metric; u_int16_t tos_metric;
} ; };
#define OSPF_AUTH_SIZE 8 #define OSPF_AUTH_SIZE 8
@ -203,8 +257,14 @@ struct ospfhdr {
/* Link State Request */ /* Link State Request */
struct lsr { struct lsr {
u_int32_t ls_type; u_int8_t ls_type[4];
struct in_addr ls_stateid; union {
struct in_addr ls_stateid;
struct { /* opaque LSAs change the LSA-ID field */
u_int8_t opaque_type;
u_int8_t opaque_id[3];
} opaque_field;
} un_ls_stateid;
struct in_addr ls_router; struct in_addr ls_router;
} un_lsr[1]; /* may repeat */ } un_lsr[1]; /* may repeat */
@ -219,7 +279,7 @@ struct ospfhdr {
struct lsa_hdr lsa_lshdr[1]; /* may repeat */ struct lsa_hdr lsa_lshdr[1]; /* may repeat */
} un_lsa ; } un_lsa ;
} ospf_un ; } ospf_un ;
} ; };
#define ospf_hello ospf_un.un_hello #define ospf_hello ospf_un.un_hello
#define ospf_db ospf_un.un_db #define ospf_db ospf_un.un_db

14
dist/tcpdump/ospf6.h vendored
View File

@ -1,6 +1,6 @@
/* $NetBSD: ospf6.h,v 1.1.1.1 2001/06/25 19:26:33 itojun Exp $ */ /* $NetBSD: ospf6.h,v 1.1.1.2 2004/09/27 17:06:52 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/ospf6.h,v 1.3 2000/12/17 23:07:50 guy Exp (LBL) */ /* @(#) Header: /tcpdump/master/tcpdump/ospf6.h,v 1.6 2002/12/11 07:13:56 guy Exp (LBL) */
/* /*
* Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997 * Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved. * The Regents of the University of California. All rights reserved.
@ -107,7 +107,7 @@ struct lsa_hdr {
u_int32_t ls_seq; u_int32_t ls_seq;
u_int16_t ls_chksum; u_int16_t ls_chksum;
u_int16_t ls_length; u_int16_t ls_length;
} ; };
struct lsa_prefix { struct lsa_prefix {
u_int8_t lsa_p_len; u_int8_t lsa_p_len;
@ -155,7 +155,7 @@ struct lsa {
/* AS external links advertisements */ /* AS external links advertisements */
struct { struct {
u_int32_t asla_metric; u_int32_t asla_metric;
struct lsa_prefix asla_prefix[1]; struct lsa_prefix asla_prefix[1];
/* some optional fields follow */ /* some optional fields follow */
} un_asla; } un_asla;
@ -197,7 +197,7 @@ struct lsa {
struct lsa_prefix intra_ap_prefix[1]; struct lsa_prefix intra_ap_prefix[1];
} un_intra_ap; } un_intra_ap;
} lsa_un; } lsa_un;
} ; };
/* /*
@ -207,7 +207,7 @@ struct tos_metric {
u_int8_t tos_type; u_int8_t tos_type;
u_int8_t tos_zero; u_int8_t tos_zero;
u_int16_t tos_metric; u_int16_t tos_metric;
} ; };
#define OSPF_AUTH_SIZE 8 #define OSPF_AUTH_SIZE 8
@ -270,7 +270,7 @@ struct ospf6hdr {
struct lsa_hdr lsa_lshdr[1]; /* may repeat */ struct lsa_hdr lsa_lshdr[1]; /* may repeat */
} un_lsa ; } un_lsa ;
} ospf6_un ; } ospf6_un ;
} ; };
#define ospf6_hello ospf6_un.un_hello #define ospf6_hello ospf6_un.un_hello
#define ospf6_db ospf6_un.un_db #define ospf6_db ospf6_un.un_db

64
dist/tcpdump/oui.c vendored Normal file
View File

@ -0,0 +1,64 @@
/* $NetBSD: oui.c,v 1.1.1.1 2004/09/27 17:06:52 dyoung Exp $ */
/*
* 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, and (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.
* 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.
*
* Original code by Hannes Gredler (hannes@juniper.net)
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/oui.c,v 1.2.2.1 2004/02/06 14:38:51 hannes Exp (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include "interface.h"
#include "oui.h"
/* FIXME complete OUI list using a script */
struct tok oui_values[] = {
{ 0x009069, "Juniper"},
{ 0x00000c, "Cisco"},
};
/* list taken from ethereal/packet-radius.c */
struct tok smi_values[] = {
{ SMI_ACC, "ACC"},
{ SMI_CISCO, "Cisco"},
{ SMI_SHIVA, "Shiva"},
{ SMI_MICROSOFT, "Microsoft"},
{ SMI_LIVINGSTON, "Livingston"},
{ SMI_3COM, "3Com"},
{ SMI_ASCEND, "Ascend"},
{ SMI_BAY, "Bay Networks"},
{ SMI_FOUNDRY, "Foundry"},
{ SMI_VERSANET, "Versanet"},
{ SMI_REDBACK, "Redback"},
{ SMI_JUNIPER, "Juniper Networks"},
{ SMI_APTIS, "Aptis"},
{ SMI_COSINE, "CoSine Communications"},
{ SMI_SHASTA, "Shasta"},
{ SMI_NOMADIX, "Nomadix"},
{ SMI_UNISPHERE, "Unisphere Networks"},
{ SMI_ISSANNI, "Issanni Communications"},
{ SMI_QUINTUM, "Quintum"},
{ SMI_COLUBRIS, "Colubris"},
{ SMI_COLUMBIA_UNIVERSITY, "Columbia University"},
{ SMI_THE3GPP, "3GPP"},
{ 0, NULL }
};

43
dist/tcpdump/oui.h vendored Normal file
View File

@ -0,0 +1,43 @@
/* $NetBSD: oui.h,v 1.1.1.1 2004/09/27 17:06:52 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/oui.h,v 1.2.2.1 2004/02/06 14:38:50 hannes Exp (LBL) */
/*
* 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, and (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.
* 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.
*
* Original code by Hannes Gredler (hannes@juniper.net)
*/
extern struct tok oui_values[];
extern struct tok smi_values[];
#define SMI_ACC 5
#define SMI_CISCO 9
#define SMI_SHIVA 166
#define SMI_LIVINGSTON 307
#define SMI_MICROSOFT 311
#define SMI_3COM 429
#define SMI_ASCEND 529
#define SMI_BAY 1584
#define SMI_FOUNDRY 1991
#define SMI_VERSANET 2180
#define SMI_REDBACK 2352
#define SMI_JUNIPER 2636
#define SMI_APTIS 2637
#define SMI_COSINE 3085
#define SMI_SHASTA 3199
#define SMI_NOMADIX 3309
#define SMI_UNISPHERE 4874
#define SMI_ISSANNI 5948
#define SMI_QUINTUM 6618
#define SMI_COLUBRIS 8744
#define SMI_COLUMBIA_UNIVERSITY 11862
#define SMI_THE3GPP 10415

58
dist/tcpdump/pcap-missing.h vendored Normal file
View File

@ -0,0 +1,58 @@
/* $NetBSD: pcap-missing.h,v 1.1.1.1 2004/09/27 17:06:52 dyoung Exp $ */
/*
* Copyright (c) 1988-2002
* 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.
*
* @(#) Header: /tcpdump/master/tcpdump/pcap-missing.h,v 1.1.2.1 2003/11/18 23:12:11 guy Exp (LBL)
*/
#ifndef tcpdump_pcap_missing_h
#define tcpdump_pcap_missing_h
/*
* Declarations of functions that might be missing from libpcap.
*/
#ifndef HAVE_PCAP_LIST_DATALINKS
extern int pcap_list_datalinks(pcap_t *, int **);
#endif
#ifndef HAVE_PCAP_DATALINK_NAME_TO_VAL
/*
* We assume no platform has one but not the other.
*/
extern int pcap_datalink_name_to_val(const char *);
extern const char *pcap_datalink_val_to_name(int);
#endif
#ifndef HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION
extern const char *pcap_datalink_val_to_description(int);
#endif
#endif

79
dist/tcpdump/pf.h vendored Normal file
View File

@ -0,0 +1,79 @@
/* $NetBSD: pf.h,v 1.1.1.1 2004/09/27 17:06:52 dyoung Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* @(#) Header: /tcpdump/master/tcpdump/pf.h,v 1.1.2.1 2004/03/28 21:25:03 fenner Exp (LBL)
*/
/* from $OpenBSD: pfvar.h,v 1.170 2003/08/22 21:50:34 david Exp $ */
enum { PF_INOUT=0, PF_IN=1, PF_OUT=2 };
enum { PF_PASS=0, PF_DROP=1, PF_SCRUB=2, PF_NAT=3, PF_NONAT=4,
PF_BINAT=5, PF_NOBINAT=6, PF_RDR=7, PF_NORDR=8, PF_SYNPROXY_DROP=9 };
/* Reasons code for passing/dropping a packet */
#define PFRES_MATCH 0 /* Explicit match of a rule */
#define PFRES_BADOFF 1 /* Bad offset for pull_hdr */
#define PFRES_FRAG 2 /* Dropping following fragment */
#define PFRES_SHORT 3 /* Dropping short packet */
#define PFRES_NORM 4 /* Dropping by normalizer */
#define PFRES_MEMORY 5 /* Dropped due to lacking mem */
#define PFRES_MAX 6 /* total+1 */
#define PFRES_NAMES { \
"match", \
"bad-offset", \
"fragment", \
"short", \
"normalize", \
"memory", \
NULL \
}
#define PF_RULESET_NAME_SIZE 16
/* from $OpenBSD: if_pflog.h,v 1.9 2003/07/15 20:27:27 dhartmei Exp $ */
#ifndef IFNAMSIZ
#define IFNAMSIZ 16
#endif
struct pfloghdr {
u_int8_t length;
sa_family_t af;
u_int8_t action;
u_int8_t reason;
char ifname[IFNAMSIZ];
char ruleset[PF_RULESET_NAME_SIZE];
u_int32_t rulenr;
u_int32_t subrulenr;
u_int8_t dir;
u_int8_t pad[3];
};
#define PFLOG_HDRLEN sizeof(struct pfloghdr)

10
dist/tcpdump/ppp.h vendored
View File

@ -1,6 +1,6 @@
/* $NetBSD: ppp.h,v 1.1.1.1 2001/06/25 19:26:33 itojun Exp $ */ /* $NetBSD: ppp.h,v 1.1.1.2 2004/09/27 17:06:52 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/ppp.h,v 1.12 2001/02/04 02:17:55 fenner Exp (LBL) */ /* @(#) Header: /tcpdump/master/tcpdump/ppp.h,v 1.14 2003/05/22 15:29:22 hannes Exp (LBL) */
/* /*
* Point to Point Protocol (PPP) RFC1331 * Point to Point Protocol (PPP) RFC1331
* *
@ -40,6 +40,8 @@
#define PPP_HELLO 0x0201 /* 802.1d Hello Packets */ #define PPP_HELLO 0x0201 /* 802.1d Hello Packets */
#define PPP_LUXCOM 0x0231 /* Luxcom */ #define PPP_LUXCOM 0x0231 /* Luxcom */
#define PPP_SNS 0x0233 /* Sigma Network Systems */ #define PPP_SNS 0x0233 /* Sigma Network Systems */
#define PPP_MPLS_UCAST 0x0281 /* rfc 3032 */
#define PPP_MPLS_MCAST 0x0283 /* rfc 3022 */
#define PPP_IPCP 0x8021 /* IP Control Protocol */ #define PPP_IPCP 0x8021 /* IP Control Protocol */
#define PPP_OSICP 0x8023 /* OSI Network Layer Control Protocol */ #define PPP_OSICP 0x8023 /* OSI Network Layer Control Protocol */
@ -51,13 +53,17 @@
#define PPP_VINESCP 0x8035 /* Banyan Vines Control Protocol */ #define PPP_VINESCP 0x8035 /* Banyan Vines Control Protocol */
#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */ #define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */
#define PPP_CCP 0x80fd /* Compress Control Protocol */ #define PPP_CCP 0x80fd /* Compress Control Protocol */
#define PPP_MPLSCP 0x8281 /* rfc 3022 */
#define PPP_LCP 0xc021 /* Link Control Protocol */ #define PPP_LCP 0xc021 /* Link Control Protocol */
#define PPP_PAP 0xc023 /* Password Authentication Protocol */ #define PPP_PAP 0xc023 /* Password Authentication Protocol */
#define PPP_LQM 0xc025 /* Link Quality Monitoring */ #define PPP_LQM 0xc025 /* Link Quality Monitoring */
#define PPP_SPAP 0xc027
#define PPP_CHAP 0xc223 /* Challenge Handshake Authentication Protocol */ #define PPP_CHAP 0xc223 /* Challenge Handshake Authentication Protocol */
#define PPP_BACP 0xc02b /* Bandwidth Allocation Control Protocol */ #define PPP_BACP 0xc02b /* Bandwidth Allocation Control Protocol */
#define PPP_BAP 0xc02d /* BAP */ #define PPP_BAP 0xc02d /* BAP */
#define PPP_MP 0xc03d /* Multi-Link */ #define PPP_MP 0xc03d /* Multi-Link */
#define PPP_SPAP_OLD 0xc123
#define PPP_EAP 0xc227
extern struct tok ppptype2str[]; extern struct tok ppptype2str[];

457
dist/tcpdump/print-aodv.c vendored Normal file
View File

@ -0,0 +1,457 @@
/* $NetBSD: print-aodv.c,v 1.1.1.1 2004/09/27 17:06:54 dyoung Exp $ */
/*
* Copyright (c) 2003 Bruce M. Simpson <bms@spc.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Bruce M. Simpson.
* 4. Neither the name of Bruce M. Simpson nor the names of co-
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY Bruce M. Simpson AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Bruce M. Simpson OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/print-aodv.c,v 1.8.2.3 2004/03/24 00:30:41 guy Exp (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include <stddef.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "interface.h"
#include "addrtoname.h"
#include "extract.h" /* must come after interface.h */
#include "aodv.h"
static void
aodv_extension(const struct aodv_ext *ep, u_int length)
{
u_int i;
const struct aodv_hello *ah;
switch (ep->type) {
case AODV_EXT_HELLO:
if (snapend < (u_char *) ep) {
printf(" [|hello]");
return;
}
i = min(length, (u_int)(snapend - (u_char *)ep));
if (i < sizeof(struct aodv_hello)) {
printf(" [|hello]");
return;
}
i -= sizeof(struct aodv_hello);
ah = (void *)ep;
printf("\n\text HELLO %ld ms",
(unsigned long)EXTRACT_32BITS(&ah->interval));
break;
default:
printf("\n\text %u %u", ep->type, ep->length);
break;
}
}
static void
aodv_rreq(const union aodv *ap, const u_char *dat, u_int length)
{
u_int i;
if (snapend < dat) {
printf(" [|aodv]");
return;
}
i = min(length, (u_int)(snapend - dat));
if (i < sizeof(ap->rreq)) {
printf(" [|rreq]");
return;
}
i -= sizeof(ap->rreq);
printf(" rreq %u %s%s%s%s%shops %u id 0x%08lx\n"
"\tdst %s seq %lu src %s seq %lu", length,
ap->rreq.rreq_type & RREQ_JOIN ? "[J]" : "",
ap->rreq.rreq_type & RREQ_REPAIR ? "[R]" : "",
ap->rreq.rreq_type & RREQ_GRAT ? "[G]" : "",
ap->rreq.rreq_type & RREQ_DEST ? "[D]" : "",
ap->rreq.rreq_type & RREQ_UNKNOWN ? "[U] " : " ",
ap->rreq.rreq_hops,
(unsigned long)EXTRACT_32BITS(&ap->rreq.rreq_id),
ipaddr_string(&ap->rreq.rreq_da),
(unsigned long)EXTRACT_32BITS(&ap->rreq.rreq_ds),
ipaddr_string(&ap->rreq.rreq_oa),
(unsigned long)EXTRACT_32BITS(&ap->rreq.rreq_os));
if (i >= sizeof(struct aodv_ext))
aodv_extension((void *)(&ap->rreq + 1), i);
}
static void
aodv_rrep(const union aodv *ap, const u_char *dat, u_int length)
{
u_int i;
if (snapend < dat) {
printf(" [|aodv]");
return;
}
i = min(length, (u_int)(snapend - dat));
if (i < sizeof(ap->rrep)) {
printf(" [|rrep]");
return;
}
i -= sizeof(ap->rrep);
printf(" rrep %u %s%sprefix %u hops %u\n"
"\tdst %s dseq %lu src %s %lu ms", length,
ap->rrep.rrep_type & RREP_REPAIR ? "[R]" : "",
ap->rrep.rrep_type & RREP_ACK ? "[A] " : " ",
ap->rrep.rrep_ps & RREP_PREFIX_MASK,
ap->rrep.rrep_hops,
ipaddr_string(&ap->rrep.rrep_da),
(unsigned long)EXTRACT_32BITS(&ap->rrep.rrep_ds),
ipaddr_string(&ap->rrep.rrep_oa),
(unsigned long)EXTRACT_32BITS(&ap->rrep.rrep_life));
if (i >= sizeof(struct aodv_ext))
aodv_extension((void *)(&ap->rrep + 1), i);
}
static void
aodv_rerr(const union aodv *ap, const u_char *dat, u_int length)
{
u_int i;
const struct rerr_unreach *dp = NULL;
int n, trunc;
if (snapend < dat) {
printf(" [|aodv]");
return;
}
i = min(length, (u_int)(snapend - dat));
if (i < offsetof(struct aodv_rerr, r)) {
printf(" [|rerr]");
return;
}
i -= offsetof(struct aodv_rerr, r);
dp = &ap->rerr.r.dest[0];
n = ap->rerr.rerr_dc * sizeof(ap->rerr.r.dest[0]);
printf(" rerr %s [items %u] [%u]:",
ap->rerr.rerr_flags & RERR_NODELETE ? "[D]" : "",
ap->rerr.rerr_dc, length);
trunc = n - (i/sizeof(ap->rerr.r.dest[0]));
for (; i >= sizeof(ap->rerr.r.dest[0]);
++dp, i -= sizeof(ap->rerr.r.dest[0])) {
printf(" {%s}(%ld)", ipaddr_string(&dp->u_da),
(unsigned long)EXTRACT_32BITS(&dp->u_ds));
}
if (trunc)
printf("[|rerr]");
}
static void
#ifdef INET6
aodv_v6_rreq(const union aodv *ap, const u_char *dat, u_int length)
#else
aodv_v6_rreq(const union aodv *ap _U_, const u_char *dat _U_, u_int length)
#endif
{
#ifdef INET6
u_int i;
if (snapend < dat) {
printf(" [|aodv]");
return;
}
i = min(length, (u_int)(snapend - dat));
if (i < sizeof(ap->rreq6)) {
printf(" [|rreq6]");
return;
}
i -= sizeof(ap->rreq6);
printf(" v6 rreq %u %s%s%s%s%shops %u id 0x%08lx\n"
"\tdst %s seq %lu src %s seq %lu", length,
ap->rreq6.rreq_type & RREQ_JOIN ? "[J]" : "",
ap->rreq6.rreq_type & RREQ_REPAIR ? "[R]" : "",
ap->rreq6.rreq_type & RREQ_GRAT ? "[G]" : "",
ap->rreq6.rreq_type & RREQ_DEST ? "[D]" : "",
ap->rreq6.rreq_type & RREQ_UNKNOWN ? "[U] " : " ",
ap->rreq6.rreq_hops,
(unsigned long)EXTRACT_32BITS(&ap->rreq6.rreq_id),
ip6addr_string(&ap->rreq6.rreq_da),
(unsigned long)EXTRACT_32BITS(&ap->rreq6.rreq_ds),
ip6addr_string(&ap->rreq6.rreq_oa),
(unsigned long)EXTRACT_32BITS(&ap->rreq6.rreq_os));
if (i >= sizeof(struct aodv_ext))
aodv_extension((void *)(&ap->rreq6 + 1), i);
#else
printf(" v6 rreq %u", length);
#endif
}
static void
#ifdef INET6
aodv_v6_rrep(const union aodv *ap, const u_char *dat, u_int length)
#else
aodv_v6_rrep(const union aodv *ap _U_, const u_char *dat _U_, u_int length)
#endif
{
#ifdef INET6
u_int i;
if (snapend < dat) {
printf(" [|aodv]");
return;
}
i = min(length, (u_int)(snapend - dat));
if (i < sizeof(ap->rrep6)) {
printf(" [|rrep6]");
return;
}
i -= sizeof(ap->rrep6);
printf(" rrep %u %s%sprefix %u hops %u\n"
"\tdst %s dseq %lu src %s %lu ms", length,
ap->rrep6.rrep_type & RREP_REPAIR ? "[R]" : "",
ap->rrep6.rrep_type & RREP_ACK ? "[A] " : " ",
ap->rrep6.rrep_ps & RREP_PREFIX_MASK,
ap->rrep6.rrep_hops,
ip6addr_string(&ap->rrep6.rrep_da),
(unsigned long)EXTRACT_32BITS(&ap->rrep6.rrep_ds),
ip6addr_string(&ap->rrep6.rrep_oa),
(unsigned long)EXTRACT_32BITS(&ap->rrep6.rrep_life));
if (i >= sizeof(struct aodv_ext))
aodv_extension((void *)(&ap->rrep6 + 1), i);
#else
printf(" rrep %u", length);
#endif
}
static void
#ifdef INET6
aodv_v6_rerr(const union aodv *ap, u_int length)
#else
aodv_v6_rerr(const union aodv *ap _U_, u_int length)
#endif
{
#ifdef INET6
const struct rerr_unreach6 *dp6 = NULL;
int i, j, n, trunc;
i = length - offsetof(struct aodv_rerr, r);
j = sizeof(ap->rerr.r.dest6[0]);
dp6 = &ap->rerr.r.dest6[0];
n = ap->rerr.rerr_dc * j;
printf(" rerr %s [items %u] [%u]:",
ap->rerr.rerr_flags & RERR_NODELETE ? "[D]" : "",
ap->rerr.rerr_dc, length);
trunc = n - (i/j);
for (; i -= j >= 0; ++dp6) {
printf(" {%s}(%ld)", ip6addr_string(&dp6->u_da),
(unsigned long)EXTRACT_32BITS(&dp6->u_ds));
}
if (trunc)
printf("[|rerr]");
#else
printf(" rerr %u", length);
#endif
}
static void
#ifdef INET6
aodv_v6_draft_01_rreq(const union aodv *ap, const u_char *dat, u_int length)
#else
aodv_v6_draft_01_rreq(const union aodv *ap _U_, const u_char *dat _U_,
u_int length)
#endif
{
#ifdef INET6
u_int i;
if (snapend < dat) {
printf(" [|aodv]");
return;
}
i = min(length, (u_int)(snapend - dat));
if (i < sizeof(ap->rreq6_draft_01)) {
printf(" [|rreq6]");
return;
}
i -= sizeof(ap->rreq6_draft_01);
printf(" rreq %u %s%s%s%s%shops %u id 0x%08lx\n"
"\tdst %s seq %lu src %s seq %lu", length,
ap->rreq6_draft_01.rreq_type & RREQ_JOIN ? "[J]" : "",
ap->rreq6_draft_01.rreq_type & RREQ_REPAIR ? "[R]" : "",
ap->rreq6_draft_01.rreq_type & RREQ_GRAT ? "[G]" : "",
ap->rreq6_draft_01.rreq_type & RREQ_DEST ? "[D]" : "",
ap->rreq6_draft_01.rreq_type & RREQ_UNKNOWN ? "[U] " : " ",
ap->rreq6_draft_01.rreq_hops,
(unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_id),
ip6addr_string(&ap->rreq6_draft_01.rreq_da),
(unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_ds),
ip6addr_string(&ap->rreq6_draft_01.rreq_oa),
(unsigned long)EXTRACT_32BITS(&ap->rreq6_draft_01.rreq_os));
if (i >= sizeof(struct aodv_ext))
aodv_extension((void *)(&ap->rreq6_draft_01 + 1), i);
#else
printf(" rreq %u", length);
#endif
}
static void
#ifdef INET6
aodv_v6_draft_01_rrep(const union aodv *ap, const u_char *dat, u_int length)
#else
aodv_v6_draft_01_rrep(const union aodv *ap _U_, const u_char *dat _U_,
u_int length)
#endif
{
#ifdef INET6
u_int i;
if (snapend < dat) {
printf(" [|aodv]");
return;
}
i = min(length, (u_int)(snapend - dat));
if (i < sizeof(ap->rrep6_draft_01)) {
printf(" [|rrep6]");
return;
}
i -= sizeof(ap->rrep6_draft_01);
printf(" rrep %u %s%sprefix %u hops %u\n"
"\tdst %s dseq %lu src %s %lu ms", length,
ap->rrep6_draft_01.rrep_type & RREP_REPAIR ? "[R]" : "",
ap->rrep6_draft_01.rrep_type & RREP_ACK ? "[A] " : " ",
ap->rrep6_draft_01.rrep_ps & RREP_PREFIX_MASK,
ap->rrep6_draft_01.rrep_hops,
ip6addr_string(&ap->rrep6_draft_01.rrep_da),
(unsigned long)EXTRACT_32BITS(&ap->rrep6_draft_01.rrep_ds),
ip6addr_string(&ap->rrep6_draft_01.rrep_oa),
(unsigned long)EXTRACT_32BITS(&ap->rrep6_draft_01.rrep_life));
if (i >= sizeof(struct aodv_ext))
aodv_extension((void *)(&ap->rrep6_draft_01 + 1), i);
#else
printf(" rrep %u", length);
#endif
}
static void
#ifdef INET6
aodv_v6_draft_01_rerr(const union aodv *ap, u_int length)
#else
aodv_v6_draft_01_rerr(const union aodv *ap _U_, u_int length)
#endif
{
#ifdef INET6
const struct rerr_unreach6_draft_01 *dp6 = NULL;
int i, j, n, trunc;
i = length - offsetof(struct aodv_rerr, r);
j = sizeof(ap->rerr.r.dest6_draft_01[0]);
dp6 = &ap->rerr.r.dest6_draft_01[0];
n = ap->rerr.rerr_dc * j;
printf(" rerr %s [items %u] [%u]:",
ap->rerr.rerr_flags & RERR_NODELETE ? "[D]" : "",
ap->rerr.rerr_dc, length);
trunc = n - (i/j);
for (; i -= j >= 0; ++dp6) {
printf(" {%s}(%ld)", ip6addr_string(&dp6->u_da),
(unsigned long)EXTRACT_32BITS(&dp6->u_ds));
}
if (trunc)
printf("[|rerr]");
#else
printf(" rerr %u", length);
#endif
}
void
aodv_print(const u_char *dat, u_int length, int is_ip6)
{
const union aodv *ap;
ap = (union aodv *)dat;
if (snapend < dat) {
printf(" [|aodv]");
return;
}
if (min(length, (u_int)(snapend - dat)) < sizeof(ap->rrep_ack)) {
printf(" [|aodv]");
return;
}
printf(" aodv");
switch (ap->rerr.rerr_type) {
case AODV_RREQ:
if (is_ip6)
aodv_v6_rreq(ap, dat, length);
else
aodv_rreq(ap, dat, length);
break;
case AODV_RREP:
if (is_ip6)
aodv_v6_rrep(ap, dat, length);
else
aodv_rrep(ap, dat, length);
break;
case AODV_RERR:
if (is_ip6)
aodv_v6_rerr(ap, length);
else
aodv_rerr(ap, dat, length);
break;
case AODV_RREP_ACK:
printf(" rrep-ack %u", length);
break;
case AODV_V6_DRAFT_01_RREQ:
aodv_v6_draft_01_rreq(ap, dat, length);
break;
case AODV_V6_DRAFT_01_RREP:
aodv_v6_draft_01_rrep(ap, dat, length);
break;
case AODV_V6_DRAFT_01_RERR:
aodv_v6_draft_01_rerr(ap, length);
break;
case AODV_V6_DRAFT_01_RREP_ACK:
printf(" rrep-ack %u", length);
break;
default:
printf(" %u %u", ap->rreq.rreq_type, length);
}
}

121
dist/tcpdump/print-ap1394.c vendored Normal file
View File

@ -0,0 +1,121 @@
/* $NetBSD: print-ap1394.c,v 1.1.1.1 2004/09/27 17:06:54 dyoung Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000
* 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[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/print-ap1394.c,v 1.1.2.1 2004/03/17 22:15:53 guy Exp (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include <stdio.h>
#include <pcap.h>
#include "interface.h"
#include "addrtoname.h"
#include "ethertype.h"
/*
* Structure of a header for Apple's IP-over-IEEE 1384 BPF header.
*/
#define FIREWIRE_EUI64_LEN 8
struct firewire_header {
u_char firewire_dhost[FIREWIRE_EUI64_LEN];
u_char firewire_shost[FIREWIRE_EUI64_LEN];
u_short firewire_type;
};
/*
* Length of that header; note that some compilers may pad
* "struct firewire_header" to a multiple of 4 bytes, for example, so
* "sizeof (struct firewire_header)" may not give the right answer.
*/
#define FIREWIRE_HDRLEN 18
static inline void
ap1394_hdr_print(register const u_char *bp, u_int length)
{
register const struct firewire_header *fp;
fp = (const struct firewire_header *)bp;
(void)printf("%s > %s",
linkaddr_string(fp->firewire_dhost, FIREWIRE_EUI64_LEN),
linkaddr_string(fp->firewire_shost, FIREWIRE_EUI64_LEN));
if (!qflag) {
(void)printf(", ethertype %s (0x%04x)",
tok2str(ethertype_values,"Unknown", ntohs(fp->firewire_type)),
ntohs(fp->firewire_type));
} else {
(void)printf(", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", ntohs(fp->firewire_type)));
}
(void)printf(", length %u: ", length);
}
/*
* 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.
*/
u_int
ap1394_if_print(const struct pcap_pkthdr *h, const u_char *p)
{
u_int length = h->len;
u_int caplen = h->caplen;
struct firewire_header *fp;
u_short ether_type;
u_short extracted_ether_type;
if (caplen < FIREWIRE_HDRLEN) {
printf("[|ap1394]");
return FIREWIRE_HDRLEN;
}
if (eflag)
ap1394_hdr_print(p, length);
length -= FIREWIRE_HDRLEN;
caplen -= FIREWIRE_HDRLEN;
fp = (struct firewire_header *)p;
p += FIREWIRE_HDRLEN;
ether_type = ntohs(fp->firewire_type);
extracted_ether_type = 0;
if (ether_encap_print(ether_type, p, length, caplen,
&extracted_ether_type) == 0) {
/* ether_type not known, print raw packet */
if (!eflag)
ap1394_hdr_print((u_char *)fp, length + FIREWIRE_HDRLEN);
if (!xflag && !qflag)
default_print(p, caplen);
}
return FIREWIRE_HDRLEN;
}

162
dist/tcpdump/print-bfd.c vendored Normal file
View File

@ -0,0 +1,162 @@
/* $NetBSD: print-bfd.c,v 1.1.1.1 2004/09/27 17:06:57 dyoung Exp $ */
/*
* 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, and (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.
* 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.
*
* Original code by Hannes Gredler (hannes@juniper.net)
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/print-bfd.c,v 1.3.2.2 2003/11/16 08:51:12 guy Exp";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include <stdio.h>
#include <stdlib.h>
#include "interface.h"
#include "extract.h"
#include "addrtoname.h"
#include "udp.h"
/*
* Control packet, draft-katz-ward-bfd-01.txt
*
* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |Vers | Diag |H|D|P|F| Rsvd | Detect Mult | Length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | My Discriminator |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Your Discriminator |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Desired Min TX Interval |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Required Min RX Interval |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Required Min Echo RX Interval |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct bfd_header_t {
u_int8_t version_diag;
u_int8_t flags;
u_int8_t detect_time_multiplier;
u_int8_t length;
u_int8_t my_discriminator[4];
u_int8_t your_discriminator[4];
u_int8_t desired_min_tx_interval[4];
u_int8_t required_min_rx_interval[4];
u_int8_t required_min_echo_interval[4];
};
#define BFD_EXTRACT_VERSION(x) (((x)&0xe0)>>5)
#define BFD_EXTRACT_DIAG(x) ((x)&0x1f)
static const struct tok bfd_port_values[] = {
{ BFD_CONTROL_PORT, "Control" },
{ BFD_ECHO_PORT, "Echo" },
{ 0, NULL }
};
static const struct tok bfd_diag_values[] = {
{ 0, "No Diagnostic" },
{ 1, "Control Detection Time Expired" },
{ 2, "Echo Function Failed" },
{ 3, "Neighbor Signaled Session Down" },
{ 4, "Forwarding Plane Reset" },
{ 5, "Path Down" },
{ 6, "Concatenated Path Down" },
{ 7, "Administratively Down" },
{ 0, NULL }
};
static const struct tok bfd_flag_values[] = {
{ 0x80, "I Hear You" },
{ 0x40, "Demand" },
{ 0x20, "Poll" },
{ 0x10, "Final" },
{ 0x08, "Reserved" },
{ 0x04, "Reserved" },
{ 0x02, "Reserved" },
{ 0x01, "Reserved" },
{ 0, NULL }
};
void
bfd_print(register const u_char *pptr, register u_int len, register u_int port)
{
const struct bfd_header_t *bfd_header;
bfd_header = (const struct bfd_header_t *)pptr;
TCHECK(*bfd_header);
switch (port) {
case BFD_CONTROL_PORT:
if (vflag < 1 )
{
printf("BFDv%u, %s, Flags: [%s], length: %u",
BFD_EXTRACT_VERSION(bfd_header->version_diag),
tok2str(bfd_port_values, "unknown (%u)", port),
bittok2str(bfd_flag_values, "none", bfd_header->flags),
len);
return;
}
printf("BFDv%u, length: %u\n\t%s, Flags: [%s], Diagnostic: %s (0x%02x)",
BFD_EXTRACT_VERSION(bfd_header->version_diag),
len,
tok2str(bfd_port_values, "unknown (%u)", port),
bittok2str(bfd_flag_values, "none", bfd_header->flags),
tok2str(bfd_diag_values,"unknown",BFD_EXTRACT_DIAG(bfd_header->version_diag)),
BFD_EXTRACT_DIAG(bfd_header->version_diag));
printf("\n\tDetection Timer Multiplier: %u (%u ms Detection time), BFD Length: %u",
bfd_header->detect_time_multiplier,
bfd_header->detect_time_multiplier * EXTRACT_32BITS(bfd_header->desired_min_tx_interval)/1000,
bfd_header->length);
printf("\n\tMy Discriminator: 0x%08x", EXTRACT_32BITS(bfd_header->my_discriminator));
printf(", Your Discriminator: 0x%08x", EXTRACT_32BITS(bfd_header->your_discriminator));
printf("\n\t Desired min Tx Interval: %4u ms", EXTRACT_32BITS(bfd_header->desired_min_tx_interval)/1000);
printf("\n\t Required min Rx Interval: %4u ms", EXTRACT_32BITS(bfd_header->required_min_rx_interval)/1000);
printf("\n\t Required min Echo Interval: %4u ms", EXTRACT_32BITS(bfd_header->required_min_echo_interval)/1000);
break;
case BFD_ECHO_PORT: /* not yet supported - fall through */
default:
printf("BFD, %s, length: %u",
tok2str(bfd_port_values, "unknown (%u)", port),
len);
if (vflag >= 1) {
if(!print_unknown_data(pptr,"\n\t",len))
return;
}
break;
}
return;
trunc:
printf("[|BFD]");
}

80
dist/tcpdump/print-enc.c vendored Normal file
View File

@ -0,0 +1,80 @@
/* $NetBSD: print-enc.c,v 1.1.1.1 2004/09/27 17:07:03 dyoung Exp $ */
/* $OpenBSD: print-enc.c,v 1.7 2002/02/19 19:39:40 millert Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996
* 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[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/print-enc.c,v 1.1.2.2 2003/11/16 08:51:19 guy Exp (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include <pcap.h>
#include "interface.h"
#include "addrtoname.h"
#include "enc.h"
#define ENC_PRINT_TYPE(wh, xf, nam) \
if ((wh) & (xf)) { \
printf("%s%s", nam, (wh) == (xf) ? "): " : ","); \
(wh) &= ~(xf); \
}
u_int
enc_if_print(const struct pcap_pkthdr *h, register const u_char *p)
{
register u_int length = h->len;
register u_int caplen = h->caplen;
int flags;
const struct enchdr *hdr;
if (caplen < ENC_HDRLEN) {
printf("[|enc]");
goto out;
}
hdr = (struct enchdr *)p;
flags = hdr->flags;
if (flags == 0)
printf("(unprotected): ");
else
printf("(");
ENC_PRINT_TYPE(flags, M_AUTH, "authentic");
ENC_PRINT_TYPE(flags, M_CONF, "confidential");
/* ENC_PRINT_TYPE(flags, M_TUNNEL, "tunnel"); */
printf("SPI 0x%08x: ", (u_int32_t)ntohl(hdr->spi));
length -= ENC_HDRLEN;
/* XXX - use the address family */
ip_print(p + ENC_HDRLEN, length);
out:
return (ENC_HDRLEN);
}

489
dist/tcpdump/print-fr.c vendored Normal file
View File

@ -0,0 +1,489 @@
/* $NetBSD: print-fr.c,v 1.1.1.1 2004/09/27 17:07:03 dyoung Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996
* 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[] _U_ =
"@(#)Header: /tcpdump/master/tcpdump/print-fr.c,v 1.17.2.3 2003/12/15 03:37:45 guy Exp (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include <stdio.h>
#include <string.h>
#include <pcap.h>
#include "addrtoname.h"
#include "interface.h"
#include "ethertype.h"
#include "extract.h"
static void lmi_print(const u_char *, u_int);
#define NLPID_LMI 0x08 /* ANSI T1.617 Annex D or ITU-T Q.933 Annex A */
#define NLPID_CISCO_LMI 0x09 /* The original, aka Cisco, aka Gang of Four */
#define NLPID_SNAP 0x80
#define NLPID_CLNP 0x81
#define NLPID_ESIS 0x82
#define NLPID_ISIS 0x83
#define NLPID_CONS 0x84
#define NLPID_IDRP 0x85
#define NLPID_X25_ESIS 0x8a
#define NLPID_IPV6 0x8e
#define NLPID_IP 0xcc
#define FR_EA_BIT 0x01
/* Finds out Q.922 address length, DLCI and flags. Returns 0 on success */
static int parse_q922_addr(const u_char *p, u_int *dlci, u_int *addr_len,
char **flags_ptr)
{
static char flags[32];
size_t len;
if ((p[0] & FR_EA_BIT))
return -1;
*flags_ptr = flags;
*addr_len = 2;
*dlci = ((p[0] & 0xFC) << 2) | ((p[1] & 0xF0) >> 4);
strcpy(flags, (p[0] & 0x02) ? "C!, " : "");
if (p[1] & 0x08)
strcat(flags, "FECN, ");
if (p[1] & 0x04)
strcat(flags, "BECN, ");
if (p[1] & 0x02)
strcat(flags, "DE, ");
len = strlen(flags);
if (len > 1)
flags[len - 2] = '\x0'; /* delete trailing comma and space */
if (p[1] & FR_EA_BIT)
return 0; /* 2-byte Q.922 address */
p += 2;
(*addr_len)++; /* 3- or 4-byte Q.922 address */
if ((p[0] & FR_EA_BIT) == 0) {
*dlci = (*dlci << 7) | (p[0] >> 1);
(*addr_len)++; /* 4-byte Q.922 address */
p++;
}
if ((p[0] & FR_EA_BIT) == 0)
return -1; /* more than 4 bytes of Q.922 address? */
if (p[0] & 0x02) {
len = strlen(flags);
snprintf(flags + len, sizeof(flags) - len,
"%sdlcore %x", len ? ", " : "", p[0] >> 2);
} else
*dlci = (*dlci << 6) | (p[0] >> 2);
return 0;
}
static const char *fr_nlpids[256];
static void
init_fr_nlpids(void)
{
int i;
static int fr_nlpid_flag = 0;
if (!fr_nlpid_flag) {
for (i=0; i < 256; i++)
fr_nlpids[i] = NULL;
fr_nlpids[NLPID_LMI] = "LMI";
fr_nlpids[NLPID_CISCO_LMI] = "Cisco LMI";
fr_nlpids[NLPID_SNAP] = "SNAP";
fr_nlpids[NLPID_CLNP] = "CLNP";
fr_nlpids[NLPID_ESIS] = "ESIS";
fr_nlpids[NLPID_ISIS] = "ISIS";
fr_nlpids[NLPID_CONS] = "CONS";
fr_nlpids[NLPID_IDRP] = "IDRP";
fr_nlpids[NLPID_X25_ESIS] = "X25_ESIS";
fr_nlpids[NLPID_IP] = "IP";
}
fr_nlpid_flag = 1;
}
/* Frame Relay packet structure, with flags and CRC removed
+---------------------------+
| Q.922 Address* |
+-- --+
| |
+---------------------------+
| Control (UI = 0x03) |
+---------------------------+
| Optional Pad (0x00) |
+---------------------------+
| NLPID |
+---------------------------+
| . |
| . |
| . |
| Data |
| . |
| . |
+---------------------------+
* Q.922 addresses, as presently defined, are two octets and
contain a 10-bit DLCI. In some networks Q.922 addresses
may optionally be increased to three or four octets.
*/
static u_int
fr_hdrlen(const u_char *p, u_int addr_len, u_int caplen)
{
if ((caplen > addr_len + 1 /* UI */ + 1 /* pad */) &&
!p[addr_len + 1] /* pad exist */)
return addr_len + 1 /* UI */ + 1 /* pad */ + 1 /* NLPID */;
else
return addr_len + 1 /* UI */ + 1 /* NLPID */;
}
static const char *
fr_protostring(u_int8_t proto)
{
static char buf[5+1+2+1];
init_fr_nlpids();
if (nflag || fr_nlpids[proto] == NULL) {
snprintf(buf, sizeof(buf), "proto %02x", proto);
return buf;
}
return fr_nlpids[proto];
}
static void
fr_hdr_print(int length, u_int dlci, char *flags, u_char nlpid)
{
if (qflag)
(void)printf("DLCI %u, %s%slength %d: ",
dlci, flags, *flags ? ", " : "", length);
else
(void)printf("DLCI %u, %s%s%s, length %d: ",
dlci, flags, *flags ? ", " : "",
fr_protostring(nlpid), length);
}
u_int
fr_if_print(const struct pcap_pkthdr *h, register const u_char *p)
{
register u_int length = h->len;
register u_int caplen = h->caplen;
u_short extracted_ethertype;
u_int32_t orgcode;
register u_short et;
u_int dlci;
int addr_len;
u_char nlpid;
u_int hdr_len;
char *flags;
if (caplen < 4) { /* minimum frame header length */
printf("[|fr]");
return caplen;
}
if (parse_q922_addr(p, &dlci, &addr_len, &flags)) {
printf("Invalid Q.922 address");
return caplen;
}
hdr_len = fr_hdrlen(p, addr_len, caplen);
if (caplen < hdr_len) {
printf("[|fr]");
return caplen;
}
if (p[addr_len] != 0x03)
printf("UI %02x! ", p[addr_len]);
if (!p[addr_len + 1]) { /* pad byte should be used with 3-byte Q.922 */
if (addr_len != 3)
printf("Pad! ");
} else if (addr_len == 3)
printf("No pad! ");
nlpid = p[hdr_len - 1];
p += hdr_len;
length -= hdr_len;
caplen -= hdr_len;
if (eflag)
fr_hdr_print(length, dlci, flags, nlpid);
switch (nlpid) {
case NLPID_IP:
ip_print(p, length);
break;
#ifdef INET6
case NLPID_IPV6:
ip6_print(p, length);
break;
#endif
case NLPID_CLNP:
case NLPID_ESIS:
case NLPID_ISIS:
isoclns_print(p, length, caplen);
break;
case NLPID_SNAP:
orgcode = EXTRACT_24BITS(p);
et = EXTRACT_16BITS(p + 3);
if (snap_print((const u_char *)(p + 5), length - 5,
caplen - 5, &extracted_ethertype, orgcode, et,
0) == 0) {
/* ether_type not known, print raw packet */
if (!eflag)
fr_hdr_print(length + hdr_len,
dlci, flags, nlpid);
if (extracted_ethertype) {
printf("(SNAP %s) ",
etherproto_string(htons(extracted_ethertype)));
}
if (!xflag && !qflag)
default_print(p - hdr_len, caplen + hdr_len);
}
break;
case NLPID_LMI:
lmi_print(p, length);
break;
default:
if (!eflag)
fr_hdr_print(length + hdr_len,
dlci, flags, nlpid);
if (!xflag)
default_print(p, caplen);
}
return hdr_len;
}
/*
* Q.933 decoding portion for framerelay specific.
*/
/* Q.933 packet format
Format of Other Protocols
using Q.933 NLPID
+-------------------------------+
| Q.922 Address |
+---------------+---------------+
|Control 0x03 | NLPID 0x08 |
+---------------+---------------+
| L2 Protocol ID |
| octet 1 | octet 2 |
+-------------------------------+
| L3 Protocol ID |
| octet 2 | octet 2 |
+-------------------------------+
| Protocol Data |
+-------------------------------+
| FCS |
+-------------------------------+
*/
/* L2 (Octet 1)- Call Reference Usually is 0x0 */
/*
* L2 (Octet 2)- Message Types definition 1 byte long.
*/
/* Call Establish */
#define MSG_TYPE_ESC_TO_NATIONAL 0x00
#define MSG_TYPE_ALERT 0x01
#define MSG_TYPE_CALL_PROCEEDING 0x02
#define MSG_TYPE_CONNECT 0x07
#define MSG_TYPE_CONNECT_ACK 0x0F
#define MSG_TYPE_PROGRESS 0x03
#define MSG_TYPE_SETUP 0x05
/* Call Clear */
#define MSG_TYPE_DISCONNECT 0x45
#define MSG_TYPE_RELEASE 0x4D
#define MSG_TYPE_RELEASE_COMPLETE 0x5A
#define MSG_TYPE_RESTART 0x46
#define MSG_TYPE_RESTART_ACK 0x4E
/* Status */
#define MSG_TYPE_STATUS 0x7D
#define MSG_TYPE_STATUS_ENQ 0x75
#define MSG_ANSI_LOCKING_SHIFT 0x95
#define ONE_BYTE_IE_MASK 0xF0 /* details? */
#define ANSI_REPORT_TYPE_IE 0x01
#define ANSI_LINK_VERIFY_IE_91 0x19 /* details? */
#define ANSI_LINK_VERIFY_IE 0x03
#define ANSI_PVC_STATUS_IE 0x07
#define CCITT_REPORT_TYPE_IE 0x51
#define CCITT_LINK_VERIFY_IE 0x53
#define CCITT_PVC_STATUS_IE 0x57
struct common_ie_header {
u_int8_t ie_id;
u_int8_t ie_len;
};
#define FULL_STATUS 0
#define LINK_VERIFY 1
#define ASYNC_PVC 2
/* Parses DLCI information element. */
static const char * parse_dlci_ie(const u_char *p, u_int ie_len, char *buffer,
size_t buffer_len)
{
u_int dlci;
if ((ie_len < 3) ||
(p[0] & 0x80) ||
((ie_len == 3) && !(p[1] & 0x80)) ||
((ie_len == 4) && ((p[1] & 0x80) || !(p[2] & 0x80))) ||
((ie_len == 5) && ((p[1] & 0x80) || (p[2] & 0x80) ||
!(p[3] & 0x80))) ||
(ie_len > 5) ||
!(p[ie_len - 1] & 0x80))
return "Invalid DLCI IE";
dlci = ((p[0] & 0x3F) << 4) | ((p[1] & 0x78) >> 3);
if (ie_len == 4)
dlci = (dlci << 6) | ((p[2] & 0x7E) >> 1);
else if (ie_len == 5)
dlci = (dlci << 13) | (p[2] & 0x7F) | ((p[3] & 0x7E) >> 1);
snprintf(buffer, buffer_len, "DLCI %d: status %s%s", dlci,
p[ie_len - 1] & 0x8 ? "New, " : "",
p[ie_len - 1] & 0x2 ? "Active" : "Inactive");
return buffer;
}
static void
lmi_print(const u_char *p, u_int length)
{
const u_char *ptemp = p;
const char *decode_str;
char temp_str[255];
struct common_ie_header *ie_p;
int is_ansi = 0;
if (length < 9) { /* shortest: Q.933a LINK VERIFY */
printf("[|lmi]");
return;
}
if (p[2] == MSG_ANSI_LOCKING_SHIFT)
is_ansi = 1;
/* printing out header part */
printf(is_ansi ? "ANSI" : "CCITT");
if (p[0])
printf(" Call Ref: %02x!", p[0]);
switch(p[1]) {
case MSG_TYPE_STATUS:
printf(" STATUS REPLY\n");
break;
case MSG_TYPE_STATUS_ENQ:
printf(" STATUS ENQUIRY\n");
break;
default:
printf(" UNKNOWN MSG Type %02x\n", p[1]);
break;
}
if (length < (u_int)(2 - is_ansi)) {
printf("[|lmi]");
return;
}
length -= 2 - is_ansi;
ptemp += 2 + is_ansi;
/* Loop through the rest of IE */
while (length > 0) {
ie_p = (struct common_ie_header *)ptemp;
if (length < sizeof(struct common_ie_header) ||
length < sizeof(struct common_ie_header) + ie_p->ie_len) {
printf("[|lmi]");
return;
}
if ((is_ansi && ie_p->ie_id == ANSI_REPORT_TYPE_IE) ||
(!is_ansi && ie_p->ie_id == CCITT_REPORT_TYPE_IE)) {
switch(ptemp[2]) {
case FULL_STATUS:
decode_str = "FULL STATUS";
break;
case LINK_VERIFY:
decode_str = "LINK VERIFY";
break;
case ASYNC_PVC:
decode_str = "Async PVC Status";
break;
default:
decode_str = "Reserved Value";
break;
}
} else if ((is_ansi && (ie_p->ie_id == ANSI_LINK_VERIFY_IE_91 ||
ie_p->ie_id == ANSI_LINK_VERIFY_IE)) ||
(!is_ansi && ie_p->ie_id == CCITT_LINK_VERIFY_IE)) {
snprintf(temp_str, sizeof(temp_str),
"TX Seq: %3d, RX Seq: %3d",
ptemp[2], ptemp[3]);
decode_str = temp_str;
} else if ((is_ansi && ie_p->ie_id == ANSI_PVC_STATUS_IE) ||
(!is_ansi && ie_p->ie_id == CCITT_PVC_STATUS_IE)) {
decode_str = parse_dlci_ie(ptemp + 2, ie_p->ie_len,
temp_str, sizeof(temp_str));
} else
decode_str = "Non-decoded Value";
printf("\t\tIE: %02X Len: %d, %s\n",
ie_p->ie_id, ie_p->ie_len, decode_str);
length = length - ie_p->ie_len - 2;
ptemp = ptemp + ie_p->ie_len + 2;
}
}

139
dist/tcpdump/print-ipfc.c vendored Normal file
View File

@ -0,0 +1,139 @@
/* $NetBSD: print-ipfc.c,v 1.1.1.1 2004/09/27 17:07:07 dyoung Exp $ */
/*
* Copyright (c) 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[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/print-ipfc.c,v 1.4.2.2 2003/11/16 08:51:28 guy Exp (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include <pcap.h>
#include <stdio.h>
#include <string.h>
#include "interface.h"
#include "addrtoname.h"
#include "ethertype.h"
#include "ether.h"
#include "ipfc.h"
/*
* RFC 2625 IP-over-Fibre Channel.
*/
/* Extract src, dst addresses */
static inline void
extract_ipfc_addrs(const struct ipfc_header *ipfcp, char *ipfcsrc,
char *ipfcdst)
{
/*
* We assume that, as per RFC 2625, the lower 48 bits of the
* source and destination addresses are MAC addresses.
*/
memcpy(ipfcdst, (const char *)&ipfcp->ipfc_dhost[2], 6);
memcpy(ipfcsrc, (const char *)&ipfcp->ipfc_shost[2], 6);
}
/*
* Print the Network_Header
*/
static inline void
ipfc_hdr_print(register const struct ipfc_header *ipfcp _U_,
register u_int length, register const u_char *ipfcsrc,
register const u_char *ipfcdst)
{
const char *srcname, *dstname;
srcname = etheraddr_string(ipfcsrc);
dstname = etheraddr_string(ipfcdst);
/*
* XXX - show the upper 16 bits? Do so only if "vflag" is set?
*/
(void) printf("%s %s %d: ", srcname, dstname, length);
}
static void
ipfc_print(const u_char *p, u_int length, u_int caplen)
{
const struct ipfc_header *ipfcp = (const struct ipfc_header *)p;
struct ether_header ehdr;
u_short extracted_ethertype;
if (caplen < IPFC_HDRLEN) {
printf("[|ipfc]");
return;
}
/*
* Get the network addresses into a canonical form
*/
extract_ipfc_addrs(ipfcp, (char *)ESRC(&ehdr), (char *)EDST(&ehdr));
if (eflag)
ipfc_hdr_print(ipfcp, length, ESRC(&ehdr), EDST(&ehdr));
/* Skip over Network_Header */
length -= IPFC_HDRLEN;
p += IPFC_HDRLEN;
caplen -= IPFC_HDRLEN;
/* Frame Control field determines interpretation of packet */
extracted_ethertype = 0;
/* Try to print the LLC-layer header & higher layers */
if (llc_print(p, length, caplen, ESRC(&ehdr), EDST(&ehdr),
&extracted_ethertype) == 0) {
/*
* Some kinds of LLC packet we cannot
* handle intelligently
*/
if (!eflag)
ipfc_hdr_print(ipfcp, length + IPFC_HDRLEN,
ESRC(&ehdr), EDST(&ehdr));
if (extracted_ethertype) {
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
}
if (!xflag && !qflag)
default_print(p, caplen);
}
}
/*
* This is the top level routine of the printer. 'p' points
* to the Network_Header of the packet, 'h->ts' is the timestamp,
* 'h->length' is the length of the packet off the wire, and 'h->caplen'
* is the number of bytes actually captured.
*/
u_int
ipfc_if_print(const struct pcap_pkthdr *h, register const u_char *p)
{
ipfc_print(p, h->len, h->caplen);
return (IPFC_HDRLEN);
}

384
dist/tcpdump/print-ldp.c vendored Normal file
View File

@ -0,0 +1,384 @@
/* $NetBSD: print-ldp.c,v 1.1.1.1 2004/09/27 17:07:12 dyoung Exp $ */
/*
* 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, and (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.
* 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.
*
* Original code by Hannes Gredler (hannes@juniper.net)
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/print-ldp.c,v 1.4.2.2 2003/11/16 08:51:31 guy Exp";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "interface.h"
#include "extract.h"
#include "addrtoname.h"
/*
* ldp common header
*
* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Version | PDU Length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | LDP Identifier |
* + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*/
struct ldp_common_header {
u_int8_t version[2];
u_int8_t pdu_length[2];
u_int8_t lsr_id[4];
u_int8_t label_space[2];
};
#define LDP_VERSION 1
/*
* ldp message header
*
* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |U| Message Type | Message Length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Message ID |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | |
* + +
* | Mandatory Parameters |
* + +
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | |
* + +
* | Optional Parameters |
* + +
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct ldp_msg_header {
u_int8_t type[2];
u_int8_t length[2];
u_int8_t id[4];
};
#define LDP_MASK_MSG_TYPE(x) ((x)&0x7fff)
#define LDP_MASK_U_BIT(x) ((x)&0x8000)
#define LDP_MSG_NOTIF 0x0001
#define LDP_MSG_HELLO 0x0100
#define LDP_MSG_INIT 0x0200
#define LDP_MSG_KEEPALIVE 0x0201
#define LDP_MSG_ADDRESS 0x0300
#define LDP_MSG_ADDRESS_WITHDRAW 0x0301
#define LDP_MSG_LABEL_MAPPING 0x0400
#define LDP_MSG_LABEL_REQUEST 0x0401
#define LDP_MSG_LABEL_WITHDRAW 0x0402
#define LDP_MSG_LABEL_RELEASE 0x0403
#define LDP_MSG_LABEL_ABORT_REQUEST 0x0404
#define LDP_VENDOR_PRIVATE_MIN 0x3e00
#define LDP_VENDOR_PRIVATE_MAX 0x3eff
#define LDP_EXPERIMENTAL_MIN 0x3f00
#define LDP_EXPERIMENTAL_MAX 0x3fff
static const struct tok ldp_msg_values[] = {
{ LDP_MSG_NOTIF, "Notification" },
{ LDP_MSG_HELLO, "Hello" },
{ LDP_MSG_INIT, "Initialization" },
{ LDP_MSG_KEEPALIVE, "Keepalive" },
{ LDP_MSG_ADDRESS, "Address" },
{ LDP_MSG_ADDRESS_WITHDRAW, "Address Widthdraw" },
{ LDP_MSG_LABEL_MAPPING, "Label Mapping" },
{ LDP_MSG_LABEL_REQUEST, "Label Request" },
{ LDP_MSG_LABEL_WITHDRAW, "Label Withdraw" },
{ LDP_MSG_LABEL_RELEASE, "Label Release" },
{ LDP_MSG_LABEL_ABORT_REQUEST, "Label Abort Request" },
{ 0, NULL}
};
#define LDP_MASK_TLV_TYPE(x) ((x)&0x3fff)
#define LDP_MASK_F_BIT(x) ((x)&0x4000)
#define LDP_TLV_FEC 0x0100
#define LDP_TLV_ADDRESS_LIST 0x0101
#define LDP_TLV_HOP_COUNT 0x0103
#define LDP_TLV_PATH_VECTOR 0x0104
#define LDP_TLV_GENERIC_LABEL 0x0200
#define LDP_TLV_ATM_LABEL 0x0201
#define LDP_TLV_FR_LABEL 0x0202
#define LDP_TLV_STATUS 0x0300
#define LDP_TLV_EXTD_STATUS 0x0301
#define LDP_TLV_RETURNED_PDU 0x0302
#define LDP_TLV_RETURNED_MSG 0x0303
#define LDP_TLV_COMMON_HELLO 0x0400
#define LDP_TLV_IPV4_TRANSPORT_ADDR 0x0401
#define LDP_TLV_CONFIG_SEQ_NUMBER 0x0402
#define LDP_TLV_IPV6_TRANSPORT_ADDR 0x0403
#define LDP_TLV_COMMON_SESSION 0x0500
#define LDP_TLV_ATM_SESSION_PARM 0x0501
#define LDP_TLV_FR_SESSION_PARM 0x0502
#define LDP_TLV_LABEL_REQUEST_MSG_ID 0x0600
static const struct tok ldp_tlv_values[] = {
{ LDP_TLV_FEC, "FEC" },
{ LDP_TLV_ADDRESS_LIST, "Address List" },
{ LDP_TLV_HOP_COUNT, "Hop Count" },
{ LDP_TLV_PATH_VECTOR, "Path Vector" },
{ LDP_TLV_GENERIC_LABEL, "Generic Label" },
{ LDP_TLV_ATM_LABEL, "ATM Label" },
{ LDP_TLV_FR_LABEL, "Frame-Relay Label" },
{ LDP_TLV_STATUS, "Status" },
{ LDP_TLV_EXTD_STATUS, "Extended Status" },
{ LDP_TLV_RETURNED_PDU, "Returned PDU" },
{ LDP_TLV_RETURNED_MSG, "Returned Message" },
{ LDP_TLV_COMMON_HELLO, "Common Hello Parameters" },
{ LDP_TLV_IPV4_TRANSPORT_ADDR, "IPv4 Transport Address" },
{ LDP_TLV_CONFIG_SEQ_NUMBER, "Configuration Sequence Number" },
{ LDP_TLV_IPV6_TRANSPORT_ADDR, "IPv6 Transport Address" },
{ LDP_TLV_COMMON_SESSION, "Common Session Parameters" },
{ LDP_TLV_ATM_SESSION_PARM, "ATM Session Parameters" },
{ LDP_TLV_FR_SESSION_PARM, "Frame-Relay Session Parameters" },
{ LDP_TLV_LABEL_REQUEST_MSG_ID, "Label Request Message ID" },
{ 0, NULL}
};
#define FALSE 0
#define TRUE 1
int ldp_tlv_print(register const u_char *);
/*
* ldp tlv header
*
* 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |U|F| Type | Length |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | |
* | Value |
* ~ ~
* | |
* | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
int
ldp_tlv_print(register const u_char *tptr) {
struct ldp_tlv_header {
u_int8_t type[2];
u_int8_t length[2];
};
const struct ldp_tlv_header *ldp_tlv_header;
u_short tlv_type,tlv_len,tlv_tlen;
ldp_tlv_header = (const struct ldp_tlv_header *)tptr;
tlv_len=EXTRACT_16BITS(ldp_tlv_header->length);
tlv_tlen=tlv_len;
tlv_type=LDP_MASK_TLV_TYPE(EXTRACT_16BITS(ldp_tlv_header->type));
/* FIXME vendor private / experimental check */
printf("\n\t %s TLV (0x%04x), length: %u, Flags: [%s and %s forward if unknown]",
tok2str(ldp_tlv_values,
"Unknown",
tlv_type),
tlv_type,
tlv_len,
LDP_MASK_U_BIT(EXTRACT_16BITS(&ldp_tlv_header->type)) ? "continue processing" : "ignore",
LDP_MASK_F_BIT(EXTRACT_16BITS(&ldp_tlv_header->type)) ? "do" : "don't");
tptr+=sizeof(struct ldp_tlv_header);
switch(tlv_type) {
case LDP_TLV_COMMON_HELLO:
printf("\n\t Hold Time: %us, Flags: [%s Hello%s]",
EXTRACT_16BITS(tptr),
(EXTRACT_16BITS(tptr+2)&0x8000) ? "Targeted" : "Link",
(EXTRACT_16BITS(tptr+2)&0x4000) ? ", Request for targeted Hellos" : "");
break;
case LDP_TLV_IPV4_TRANSPORT_ADDR:
printf("\n\t IPv4 Transport Address: %s", ipaddr_string(tptr));
break;
#ifdef INET6
case LDP_TLV_IPV6_TRANSPORT_ADDR:
printf("\n\t IPv6 Transport Address: %s", ip6addr_string(tptr));
break;
#endif
case LDP_TLV_CONFIG_SEQ_NUMBER:
printf("\n\t Sequence Number: %u", EXTRACT_32BITS(tptr));
break;
/*
* FIXME those are the defined TLVs that lack a decoder
* you are welcome to contribute code ;-)
*/
case LDP_TLV_FEC:
case LDP_TLV_ADDRESS_LIST:
case LDP_TLV_HOP_COUNT:
case LDP_TLV_PATH_VECTOR:
case LDP_TLV_GENERIC_LABEL:
case LDP_TLV_ATM_LABEL:
case LDP_TLV_FR_LABEL:
case LDP_TLV_STATUS:
case LDP_TLV_EXTD_STATUS:
case LDP_TLV_RETURNED_PDU:
case LDP_TLV_RETURNED_MSG:
case LDP_TLV_COMMON_SESSION:
case LDP_TLV_ATM_SESSION_PARM:
case LDP_TLV_FR_SESSION_PARM:
case LDP_TLV_LABEL_REQUEST_MSG_ID:
default:
if (vflag <= 1)
print_unknown_data(tptr,"\n\t ",tlv_tlen);
break;
}
return(tlv_len+4); /* Type & Length fields not included */
}
void
ldp_print(register const u_char *pptr, register u_int len) {
const struct ldp_common_header *ldp_com_header;
const struct ldp_msg_header *ldp_msg_header;
const u_char *tptr,*msg_tptr;
u_short tlen;
u_short msg_len,msg_type,msg_tlen;
int hexdump,processed;
tptr=pptr;
ldp_com_header = (const struct ldp_common_header *)pptr;
TCHECK(*ldp_com_header);
/*
* Sanity checking of the header.
*/
if (EXTRACT_16BITS(&ldp_com_header->version) != LDP_VERSION) {
printf("LDP version %u packet not supported",
EXTRACT_16BITS(&ldp_com_header->version));
return;
}
/* print the LSR-ID, label-space & length */
printf("%sLDP, Label-Space-ID: %s:%u, length: %u",
(vflag < 1) ? "" : "\n\t",
ipaddr_string(&ldp_com_header->lsr_id),
EXTRACT_16BITS(&ldp_com_header->label_space),
len);
/* bail out if non-verbose */
if (vflag < 1)
return;
/* ok they seem to want to know everything - lets fully decode it */
tlen=EXTRACT_16BITS(ldp_com_header->pdu_length);
tptr+=sizeof(const struct ldp_common_header);
tlen-=sizeof(const struct ldp_common_header);
while(tlen>0) {
/* did we capture enough for fully decoding the msg header ? */
if (!TTEST2(*tptr, sizeof(struct ldp_msg_header)))
goto trunc;
ldp_msg_header = (const struct ldp_msg_header *)tptr;
msg_len=EXTRACT_16BITS(ldp_msg_header->length);
msg_type=LDP_MASK_MSG_TYPE(EXTRACT_16BITS(ldp_msg_header->type));
/* FIXME vendor private / experimental check */
printf("\n\t %s Message (0x%04x), length: %u, Message ID: 0x%08x, Flags: [%s if unknown]",
tok2str(ldp_msg_values,
"Unknown",
msg_type),
msg_type,
msg_len,
EXTRACT_32BITS(&ldp_msg_header->id),
LDP_MASK_U_BIT(EXTRACT_16BITS(&ldp_msg_header->type)) ? "continue processing" : "ignore");
msg_tptr=tptr+sizeof(struct ldp_msg_header);
msg_tlen=msg_len-sizeof(struct ldp_msg_header)+4; /* Type & Length fields not included */
/* did we capture enough for fully decoding the message ? */
if (!TTEST2(*tptr, msg_len))
goto trunc;
hexdump=FALSE;
switch(msg_type) {
case LDP_MSG_HELLO:
while(msg_tlen >= 4) {
processed = ldp_tlv_print(msg_tptr);
if (processed == 0)
break;
msg_tlen-=processed;
msg_tptr+=processed;
}
break;
/*
* FIXME those are the defined messages that lack a decoder
* you are welcome to contribute code ;-)
*/
case LDP_MSG_NOTIF:
case LDP_MSG_INIT:
case LDP_MSG_KEEPALIVE:
case LDP_MSG_ADDRESS:
case LDP_MSG_ADDRESS_WITHDRAW:
case LDP_MSG_LABEL_MAPPING:
case LDP_MSG_LABEL_REQUEST:
case LDP_MSG_LABEL_WITHDRAW:
case LDP_MSG_LABEL_RELEASE:
case LDP_MSG_LABEL_ABORT_REQUEST:
default:
if (vflag <= 1)
print_unknown_data(msg_tptr,"\n\t ",msg_tlen);
break;
}
/* do we want to see an additionally hexdump ? */
if (vflag > 1 || hexdump==TRUE)
print_unknown_data(tptr+sizeof(sizeof(struct ldp_msg_header)),"\n\t ",
msg_len);
tptr+=msg_len;
tlen-=msg_len;
}
return;
trunc:
printf("\n\t\t packet exceeded snapshot");
}

316
dist/tcpdump/print-mobility.c vendored Normal file
View File

@ -0,0 +1,316 @@
/* $NetBSD: print-mobility.c,v 1.1.1.1 2004/09/27 17:07:14 dyoung Exp $ */
/*
* Copyright (C) 2002 WIDE Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the project 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 BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifndef lint
static const char rcsid[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/print-mobility.c,v 1.9.2.2 2003/11/16 08:51:33 guy Exp";
#endif
#ifdef INET6
#include <tcpdump-stdinc.h>
#include <stdio.h>
#include "ip6.h"
#include "interface.h"
#include "addrtoname.h"
#include "extract.h" /* must come after interface.h */
/* Mobility header */
struct ip6_mobility {
u_int8_t ip6m_pproto; /* following payload protocol (for PG) */
u_int8_t ip6m_len; /* length in units of 8 octets */
u_int8_t ip6m_type; /* message type */
u_int8_t reserved; /* reserved */
u_int16_t ip6m_cksum; /* sum of IPv6 pseudo-header and MH */
union {
u_int16_t ip6m_un_data16[1]; /* type-specific field */
u_int8_t ip6m_un_data8[2]; /* type-specific fiedl */
} ip6m_dataun;
};
#define ip6m_data16 ip6m_dataun.ip6m_un_data16
#define ip6m_data8 ip6m_dataun.ip6m_un_data8
#define IP6M_MINLEN 8
/* message type */
#define IP6M_BINDING_REQUEST 0 /* Binding Refresh Request */
#define IP6M_HOME_TEST_INIT 1 /* Home Test Init */
#define IP6M_CAREOF_TEST_INIT 2 /* Care-of Test Init */
#define IP6M_HOME_TEST 3 /* Home Test */
#define IP6M_CAREOF_TEST 4 /* Care-of Test */
#define IP6M_BINDING_UPDATE 5 /* Binding Update */
#define IP6M_BINDING_ACK 6 /* Binding Acknowledgement */
#define IP6M_BINDING_ERROR 7 /* Binding Error */
/* Mobility Header Options */
#define IP6MOPT_MINLEN 2
#define IP6MOPT_PAD1 0x0 /* Pad1 */
#define IP6MOPT_PADN 0x1 /* PadN */
#define IP6MOPT_REFRESH 0x2 /* Binding Refresh Advice */
#define IP6MOPT_REFRESH_MINLEN 4
#define IP6MOPT_ALTCOA 0x3 /* Alternate Care-of Address */
#define IP6MOPT_ALTCOA_MINLEN 18
#define IP6MOPT_NONCEID 0x4 /* Nonce Indices */
#define IP6MOPT_NONCEID_MINLEN 6
#define IP6MOPT_AUTH 0x5 /* Binding Authorization Data */
#define IP6MOPT_AUTH_MINLEN 12
static void
mobility_opt_print(const u_char *bp, int len)
{
int i;
int optlen;
for (i = 0; i < len; i += optlen) {
if (bp[i] == IP6MOPT_PAD1)
optlen = 1;
else {
if (i + 1 < len)
optlen = bp[i + 1] + 2;
else
goto trunc;
}
if (i + optlen > len)
goto trunc;
switch (bp[i]) {
case IP6MOPT_PAD1:
printf("(pad1)");
break;
case IP6MOPT_PADN:
if (len - i < IP6MOPT_MINLEN) {
printf("(padn: trunc)");
goto trunc;
}
printf("(padn)");
break;
case IP6MOPT_REFRESH:
if (len - i < IP6MOPT_REFRESH_MINLEN) {
printf("(refresh: trunc)");
goto trunc;
}
/* units of 4 secs */
printf("(refresh: %d)",
EXTRACT_16BITS(&bp[i+2]) << 2);
break;
case IP6MOPT_ALTCOA:
if (len - i < IP6MOPT_ALTCOA_MINLEN) {
printf("(altcoa: trunc)");
goto trunc;
}
printf("(alt-CoA: %s)", ip6addr_string(&bp[i+2]));
break;
case IP6MOPT_NONCEID:
if (len - i < IP6MOPT_NONCEID_MINLEN) {
printf("(ni: trunc)");
goto trunc;
}
printf("(ni: ho=0x%04x co=0x%04x)",
EXTRACT_16BITS(&bp[i+2]),
EXTRACT_16BITS(&bp[i+4]));
break;
case IP6MOPT_AUTH:
if (len - i < IP6MOPT_AUTH_MINLEN) {
printf("(auth: trunc)");
goto trunc;
}
printf("(auth)");
break;
default:
if (len - i < IP6MOPT_MINLEN) {
printf("(sopt_type %d: trunc)", bp[i]);
goto trunc;
}
printf("(type-0x%02x: len=%d)", bp[i], bp[i + 1]);
break;
}
}
return;
trunc:
printf("[trunc] ");
}
/*
* Mobility Header
*/
int
mobility_print(const u_char *bp, const u_char *bp2)
{
const struct ip6_mobility *mh;
const struct ip6_hdr *ip6;
const u_char *ep;
int mhlen, hlen, type;
mh = (struct ip6_mobility *)bp;
ip6 = (struct ip6_hdr *)bp2;
/* 'ep' points to the end of available data. */
ep = snapend;
if (!TTEST(mh->ip6m_len)) {
/*
* There's not enough captured data to include the
* mobility header length.
*
* Our caller expects us to return the length, however,
* so return a value that will run to the end of the
* captured data.
*
* XXX - "ip6_print()" doesn't do anything with the
* returned length, however, as it breaks out of the
* header-processing loop.
*/
mhlen = ep - bp;
goto trunc;
}
mhlen = (int)((mh->ip6m_len + 1) << 3);
/* XXX ip6m_cksum */
TCHECK(mh->ip6m_type);
type = mh->ip6m_type;
switch (type) {
case IP6M_BINDING_REQUEST:
printf("mobility: BRR");
hlen = IP6M_MINLEN;
break;
case IP6M_HOME_TEST_INIT:
case IP6M_CAREOF_TEST_INIT:
printf("mobility: %soTI",
type == IP6M_HOME_TEST_INIT ? "H" : "C");
hlen = IP6M_MINLEN;
if (vflag) {
TCHECK2(*mh, hlen + 8);
printf(" %s Init Cookie=%08x:%08x",
type == IP6M_HOME_TEST_INIT ? "Home" : "Care-of",
EXTRACT_32BITS(&bp[hlen]),
EXTRACT_32BITS(&bp[hlen + 4]));
}
hlen += 8;
break;
case IP6M_HOME_TEST:
case IP6M_CAREOF_TEST:
printf("mobility: %soT",
type == IP6M_HOME_TEST ? "H" : "C");
TCHECK(mh->ip6m_data16[0]);
printf(" nonce id=0x%x", EXTRACT_16BITS(&mh->ip6m_data16[0]));
hlen = IP6M_MINLEN;
if (vflag) {
TCHECK2(*mh, hlen + 8);
printf(" %s Init Cookie=%08x:%08x",
type == IP6M_HOME_TEST ? "Home" : "Care-of",
EXTRACT_32BITS(&bp[hlen]),
EXTRACT_32BITS(&bp[hlen + 4]));
}
hlen += 8;
if (vflag) {
TCHECK2(*mh, hlen + 8);
printf(" %s Keygen Token=%08x:%08x",
type == IP6M_HOME_TEST ? "Home" : "Care-of",
EXTRACT_32BITS(&bp[hlen]),
EXTRACT_32BITS(&bp[hlen + 4]));
}
hlen += 8;
break;
case IP6M_BINDING_UPDATE:
printf("mobility: BU");
TCHECK(mh->ip6m_data16[0]);
printf(" seq#=%d", EXTRACT_16BITS(&mh->ip6m_data16[0]));
hlen = IP6M_MINLEN;
TCHECK2(*mh, hlen + 1);
if (bp[hlen] & 0xf0)
printf(" ");
if (bp[hlen] & 0x80)
printf("A");
if (bp[hlen] & 0x40)
printf("H");
if (bp[hlen] & 0x20)
printf("L");
if (bp[hlen] & 0x10)
printf("K");
/* Reserved (4bits) */
hlen += 1;
/* Reserved (8bits) */
hlen += 1;
TCHECK2(*mh, hlen + 2);
/* units of 4 secs */
printf(" lifetime=%d", EXTRACT_16BITS(&bp[hlen]) << 2);
hlen += 2;
break;
case IP6M_BINDING_ACK:
printf("mobility: BA");
TCHECK(mh->ip6m_data8[0]);
printf(" status=%d", mh->ip6m_data8[0]);
if (mh->ip6m_data8[1] & 0x80)
printf(" K");
/* Reserved (7bits) */
hlen = IP6M_MINLEN;
TCHECK2(*mh, hlen + 2);
printf(" seq#=%d", EXTRACT_16BITS(&bp[hlen]));
hlen += 2;
TCHECK2(*mh, hlen + 2);
/* units of 4 secs */
printf(" lifetime=%d", EXTRACT_16BITS(&bp[hlen]) << 2);
hlen += 2;
break;
case IP6M_BINDING_ERROR:
printf("mobility: BE");
TCHECK(mh->ip6m_data8[0]);
printf(" status=%d", mh->ip6m_data8[0]);
/* Reserved */
hlen = IP6M_MINLEN;
TCHECK2(*mh, hlen + 16);
printf(" homeaddr %s", ip6addr_string(&bp[hlen]));
hlen += 16;
break;
default:
printf("mobility: type-#%d len=%d", type, mh->ip6m_len);
return(mhlen);
break;
}
if (vflag)
mobility_opt_print(&bp[hlen], mhlen - hlen);
return(mhlen);
trunc:
fputs("[|MOBILITY]", stdout);
return(mhlen);
}
#endif /* INET6 */

1256
dist/tcpdump/print-rsvp.c vendored Normal file

File diff suppressed because it is too large Load Diff

119
dist/tcpdump/print-sunatm.c vendored Normal file
View File

@ -0,0 +1,119 @@
/* $NetBSD: print-sunatm.c,v 1.1.1.1 2004/09/27 17:07:30 dyoung Exp $ */
/*
* Copyright (c) 1997 Yen Yen Lim and North Dakota State University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Yen Yen Lim and
North Dakota State University
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/print-sunatm.c,v 1.5.2.2 2003/11/16 08:51:47 guy Exp (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
struct mbuf;
struct rtentry;
#include <stdio.h>
#include <pcap.h>
#include "interface.h"
#include "extract.h"
#include "addrtoname.h"
#include "atm.h"
#include "atmuni31.h"
/* SunATM header for ATM packet */
#define DIR_POS 0 /* Direction (0x80 = transmit, 0x00 = receive) */
#define VPI_POS 1 /* VPI */
#define VCI_POS 2 /* VCI */
#define PKT_BEGIN_POS 4 /* Start of the ATM packet */
/* Protocol type values in the bottom for bits of the byte at SUNATM_DIR_POS. */
#define PT_LANE 0x01 /* LANE */
#define PT_LLC 0x02 /* LLC encapsulation */
/*
* 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.
*/
u_int
sunatm_if_print(const struct pcap_pkthdr *h, const u_char *p)
{
u_int caplen = h->caplen;
u_int length = h->len;
u_short vci;
u_char vpi;
u_int traftype;
if (caplen < PKT_BEGIN_POS) {
printf("[|atm]");
return (caplen);
}
if (eflag) {
if (p[DIR_POS] & 0x80)
printf("Tx: ");
else
printf("Rx: ");
}
switch (p[DIR_POS] & 0x0f) {
case PT_LANE:
traftype = ATM_LANE;
break;
case PT_LLC:
traftype = ATM_LLC;
break;
default:
traftype = ATM_UNKNOWN;
break;
}
vci = EXTRACT_16BITS(&p[VCI_POS]);
vpi = p[VPI_POS];
p += PKT_BEGIN_POS;
caplen -= PKT_BEGIN_POS;
length -= PKT_BEGIN_POS;
atm_print(vpi, vci, traftype, p, length, caplen);
return (PKT_BEGIN_POS);
}

View File

@ -1,6 +1,6 @@
/* $NetBSD: sctpConstants.h,v 1.1.1.2 2002/02/18 09:09:02 itojun Exp $ */ /* $NetBSD: sctpConstants.h,v 1.1.1.3 2004/09/27 17:07:33 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/sctpConstants.h,v 1.2 2001/06/28 10:17:22 guy Exp (LBL) */ /* @(#) Header: /tcpdump/master/tcpdump/sctpConstants.h,v 1.4 2003/06/03 23:49:23 guy Exp (LBL) */
/* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola /* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola
* *
@ -33,14 +33,14 @@
* *
* This file is part of the SCTP reference Implementation * This file is part of the SCTP reference Implementation
* *
* *
* Please send any bug reports or fixes you make to one of the following email * Please send any bug reports or fixes you make to one of the following email
* addresses: * addresses:
* *
* rstewar1@email.mot.com * rstewar1@email.mot.com
* kmorneau@cisco.com * kmorneau@cisco.com
* qxie1@email.mot.com * qxie1@email.mot.com
* *
* Any bugs reported given to us we will try to fix... any fixes shared will * Any bugs reported given to us we will try to fix... any fixes shared will
* be incorperated into the next SCTP release. * be incorperated into the next SCTP release.
*/ */
@ -60,7 +60,7 @@
*/ */
/*#define USE_MD5 1*/ /*#define USE_MD5 1*/
/* the SCTP protocol signature /* the SCTP protocol signature
* this includes the version number * this includes the version number
* encoded in the last 4 bits of the * encoded in the last 4 bits of the
* signature. * signature.
@ -84,7 +84,7 @@
/* default max I can burst out after a fast retransmit */ /* default max I can burst out after a fast retransmit */
#define SCTP_DEF_MAX_BURST 4 #define SCTP_DEF_MAX_BURST 4
/* Packet transmit states in the sent /* Packet transmit states in the sent
* field in the SCTP_transmitOnQueue struct * field in the SCTP_transmitOnQueue struct
*/ */
#define SCTP_DATAGRAM_UNSENT 0 #define SCTP_DATAGRAM_UNSENT 0
@ -108,8 +108,8 @@
#define SCTP_DATA 0x00 #define SCTP_DATA 0x00
#define SCTP_INITIATION 0x01 #define SCTP_INITIATION 0x01
#define SCTP_INITIATION_ACK 0x02 #define SCTP_INITIATION_ACK 0x02
#define SCTP_SELECTIVE_ACK 0x03 #define SCTP_SELECTIVE_ACK 0x03
#define SCTP_HEARTBEAT_REQUEST 0x04 #define SCTP_HEARTBEAT_REQUEST 0x04
#define SCTP_HEARTBEAT_ACK 0x05 #define SCTP_HEARTBEAT_ACK 0x05
#define SCTP_ABORT_ASSOCIATION 0x06 #define SCTP_ABORT_ASSOCIATION 0x06
#define SCTP_SHUTDOWN 0x07 #define SCTP_SHUTDOWN 0x07
@ -241,7 +241,7 @@
#define SCTP_STARTING_MAPARRAY 10000 #define SCTP_STARTING_MAPARRAY 10000
/* Here we define the timer types used /* Here we define the timer types used
* by the implementation has * by the implementation has
* arguments in the set/get timer type calls. * arguments in the set/get timer type calls.
*/ */
#define SCTP_TIMER_INIT 0 #define SCTP_TIMER_INIT 0
@ -250,7 +250,7 @@
#define SCTP_TIMER_SHUTDOWN 3 #define SCTP_TIMER_SHUTDOWN 3
#define SCTP_TIMER_HEARTBEAT 4 #define SCTP_TIMER_HEARTBEAT 4
#define SCTP_TIMER_PMTU 5 #define SCTP_TIMER_PMTU 5
/* number of timer types in the base SCTP /* number of timer types in the base SCTP
* structure used in the set/get and has * structure used in the set/get and has
* the base default. * the base default.
*/ */
@ -354,7 +354,7 @@
/* Events that SCTP will look for, these /* Events that SCTP will look for, these
* are or'd together to declare what SCTP * are or'd together to declare what SCTP
* wants. Each select mask/poll list should be * wants. Each select mask/poll list should be
* set for the fd, if the bit is on. * set for the fd, if the bit is on.
*/ */
#define SCTP_EVENT_READ 0x000001 #define SCTP_EVENT_READ 0x000001
@ -363,7 +363,7 @@
/* The following constant is a value for this /* The following constant is a value for this
* particular implemenation. It is quite arbitrary and * particular implemenation. It is quite arbitrary and
* is used to limit how much data will be queued up to * is used to limit how much data will be queued up to
* a sender, waiting for cwnd to be larger than flightSize. * a sender, waiting for cwnd to be larger than flightSize.
* All implementations will need this protection is some * All implementations will need this protection is some
* way due to buffer size constraints. * way due to buffer size constraints.
@ -373,9 +373,9 @@
/* This constant (SCTP_MAX_READBUFFER) define /* This constant (SCTP_MAX_READBUFFER) define
* how big the read/write buffer is * how big the read/write buffer is
* when we enter the fd event notification * when we enter the fd event notification
* the buffer is put on the stack, so the bigger * the buffer is put on the stack, so the bigger
* it is the more stack you chew up, however it * it is the more stack you chew up, however it
* has got to be big enough to handle the bigest * has got to be big enough to handle the bigest
@ -394,7 +394,7 @@
#define SCTP_MIN_RWND 1500 #define SCTP_MIN_RWND 1500
#define SCTP_WINDOW_MIN 1500 /* smallest rwnd can be */ #define SCTP_WINDOW_MIN 1500 /* smallest rwnd can be */
#define SCTP_WINDOW_MAX 1048576 /* biggest I can grow rwnd to #define SCTP_WINDOW_MAX 1048576 /* biggest I can grow rwnd to
* My playing around suggests a * My playing around suggests a
* value greater than 64k does not * value greater than 64k does not
* do much, I guess via the kernel * do much, I guess via the kernel
@ -413,7 +413,7 @@
* size to. This governs what is the * size to. This governs what is the
* largest size we will use, of course * largest size we will use, of course
* PMTU will raise this up to * PMTU will raise this up to
* the largest interface MTU or the * the largest interface MTU or the
* ceiling below if there is no * ceiling below if there is no
* SIOCGIFMTU. * SIOCGIFMTU.
*/ */
@ -516,11 +516,6 @@
#define SCTP_DEAMON_PORT 9899 #define SCTP_DEAMON_PORT 9899
#ifndef IPPROTO_SCTP
#define IPPROTO_SCTP 132 /* the Official IANA number :-) */
#endif
/* Deamon registration message types/responses */ /* Deamon registration message types/responses */
#define DEAMON_REGISTER 0x01 #define DEAMON_REGISTER 0x01
#define DEAMON_REGISTER_ACK 0x02 #define DEAMON_REGISTER_ACK 0x02
@ -544,7 +539,7 @@
{ \ { \
(ts)->tv_sec = (tv)->tv_sec; \ (ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \ (ts)->tv_nsec = (tv)->tv_usec * 1000; \
} }
#endif #endif
/* pegs */ /* pegs */

View File

@ -1,6 +1,6 @@
/* $NetBSD: sctpHeader.h,v 1.1.1.2 2002/02/18 09:09:04 itojun Exp $ */ /* $NetBSD: sctpHeader.h,v 1.1.1.3 2004/09/27 17:07:34 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/sctpHeader.h,v 1.3 2001/08/01 03:34:00 guy Exp (LBL) */ /* @(#) Header: /tcpdump/master/tcpdump/sctpHeader.h,v 1.6 2002/12/11 07:14:11 guy Exp (LBL) */
/* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola /* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola
* *
@ -33,14 +33,14 @@
* *
* This file is part of the SCTP reference Implementation * This file is part of the SCTP reference Implementation
* *
* *
* Please send any bug reports or fixes you make to one of the following email * Please send any bug reports or fixes you make to one of the following email
* addresses: * addresses:
* *
* rstewar1@email.mot.com * rstewar1@email.mot.com
* kmorneau@cisco.com * kmorneau@cisco.com
* qxie1@email.mot.com * qxie1@email.mot.com
* *
* Any bugs reported given to us we will try to fix... any fixes shared will * Any bugs reported given to us we will try to fix... any fixes shared will
* be incorperated into the next SCTP release. * be incorperated into the next SCTP release.
*/ */
@ -59,39 +59,39 @@ extern "C" {
#ifdef TRU64 #ifdef TRU64
#define _64BITS 1 #define _64BITS 1
#endif #endif
struct sctpHeader{ struct sctpHeader{
u_short source; u_int16_t source;
u_short destination; u_int16_t destination;
u_int verificationTag; u_int32_t verificationTag;
u_int adler32; u_int32_t adler32;
}; };
/* various descriptor parsers */ /* various descriptor parsers */
struct sctpChunkDesc{ struct sctpChunkDesc{
u_char chunkID; u_int8_t chunkID;
u_char chunkFlg; u_int8_t chunkFlg;
u_short chunkLength; u_int16_t chunkLength;
}; };
struct sctpParamDesc{ struct sctpParamDesc{
u_short paramType; u_int16_t paramType;
u_short paramLength; u_int16_t paramLength;
}; };
struct sctpRelChunkDesc{ struct sctpRelChunkDesc{
struct sctpChunkDesc chk; struct sctpChunkDesc chk;
u_int serialNumber; u_int32_t serialNumber;
}; };
struct sctpVendorSpecificParam { struct sctpVendorSpecificParam {
struct sctpParamDesc p; /* type must be 0xfffe */ struct sctpParamDesc p; /* type must be 0xfffe */
u_int vendorId; /* vendor ID from RFC 1700 */ u_int32_t vendorId; /* vendor ID from RFC 1700 */
u_short vendorSpecificType; u_int16_t vendorSpecificType;
u_short vendorSpecificLen; u_int16_t vendorSpecificLen;
}; };
@ -103,55 +103,55 @@ struct sctpVendorSpecificParam {
/* this is used for init ack, too */ /* this is used for init ack, too */
struct sctpInitiation{ struct sctpInitiation{
u_int initTag; /* tag of mine */ u_int32_t initTag; /* tag of mine */
u_int rcvWindowCredit; /* rwnd */ u_int32_t rcvWindowCredit; /* rwnd */
u_short NumPreopenStreams; /* OS */ u_int16_t NumPreopenStreams; /* OS */
u_short MaxInboundStreams; /* MIS */ u_int16_t MaxInboundStreams; /* MIS */
u_int initialTSN; u_int32_t initialTSN;
/* optional param's follow in sctpParamDesc form */ /* optional param's follow in sctpParamDesc form */
}; };
struct sctpV4IpAddress{ struct sctpV4IpAddress{
struct sctpParamDesc p; /* type is set to SCTP_IPV4_PARAM_TYPE, len=10 */ struct sctpParamDesc p; /* type is set to SCTP_IPV4_PARAM_TYPE, len=10 */
u_int ipAddress; u_int32_t ipAddress;
}; };
struct sctpV6IpAddress{ struct sctpV6IpAddress{
struct sctpParamDesc p; /* type is set to SCTP_IPV6_PARAM_TYPE, len=22 */ struct sctpParamDesc p; /* type is set to SCTP_IPV6_PARAM_TYPE, len=22 */
u_char ipAddress[16]; u_int8_t ipAddress[16];
}; };
struct sctpDNSName{ struct sctpDNSName{
struct sctpParamDesc param; struct sctpParamDesc param;
u_char name[1]; u_int8_t name[1];
}; };
struct sctpCookiePreserve{ struct sctpCookiePreserve{
struct sctpParamDesc p; /* type is set to SCTP_COOKIE_PRESERVE, len=8 */ struct sctpParamDesc p; /* type is set to SCTP_COOKIE_PRESERVE, len=8 */
u_int extraTime; u_int32_t extraTime;
}; };
struct sctpTimeStamp{ struct sctpTimeStamp{
u_int ts_sec; u_int32_t ts_sec;
u_int ts_usec; u_int32_t ts_usec;
}; };
/* wire structure of my cookie */ /* wire structure of my cookie */
struct cookieMessage{ struct cookieMessage{
u_int TieTag_curTag; /* copied from assoc if present */ u_int32_t TieTag_curTag; /* copied from assoc if present */
u_int TieTag_hisTag; /* copied from assoc if present */ u_int32_t TieTag_hisTag; /* copied from assoc if present */
int cookieLife; /* life I will award this cookie */ int32_t cookieLife; /* life I will award this cookie */
struct sctpTimeStamp timeEnteringState; /* the time I built cookie */ struct sctpTimeStamp timeEnteringState; /* the time I built cookie */
struct sctpInitiation initAckISent; /* the INIT-ACK that I sent to my peer */ struct sctpInitiation initAckISent; /* the INIT-ACK that I sent to my peer */
u_int addressWhereISent[4]; /* I make this 4 ints so I get 128bits for future */ u_int32_t addressWhereISent[4]; /* I make this 4 ints so I get 128bits for future */
int addrtype; /* address type */ int32_t addrtype; /* address type */
u_short locScope; /* V6 local scope flag */ u_int16_t locScope; /* V6 local scope flag */
u_short siteScope; /* V6 site scope flag */ u_int16_t siteScope; /* V6 site scope flag */
/* at the end is tacked on the INIT chunk sent in /* at the end is tacked on the INIT chunk sent in
* its entirety and of course our * its entirety and of course our
* signature. * signature.
*/ */
}; };
@ -173,23 +173,23 @@ struct sctpSendableInit{
}; };
/* Selective Acknowledgement /* Selective Acknowledgement
* has the following structure with * has the following structure with
* a optional ammount of trailing int's * a optional ammount of trailing int's
* on the last part (based on the numberOfDesc * on the last part (based on the numberOfDesc
* field). * field).
*/ */
struct sctpSelectiveAck{ struct sctpSelectiveAck{
u_int highestConseqTSN; u_int32_t highestConseqTSN;
u_int updatedRwnd; u_int32_t updatedRwnd;
u_short numberOfdesc; u_int16_t numberOfdesc;
u_short numDupTsns; u_int16_t numDupTsns;
}; };
struct sctpSelectiveFrag{ struct sctpSelectiveFrag{
u_short fragmentStart; u_int16_t fragmentStart;
u_short fragmentEnd; u_int16_t fragmentEnd;
}; };
@ -199,12 +199,12 @@ struct sctpUnifiedSack{
}; };
/* for both RTT request/response the /* for both RTT request/response the
* following is sent * following is sent
*/ */
struct sctpHBrequest { struct sctpHBrequest {
u_int time_value_1; u_int32_t time_value_1;
u_int time_value_2; u_int32_t time_value_2;
}; };
/* here is what I read and respond with to. */ /* here is what I read and respond with to. */
@ -219,13 +219,13 @@ struct sctpHBsender{
struct sctpChunkDesc hdr; struct sctpChunkDesc hdr;
struct sctpParamDesc hb; struct sctpParamDesc hb;
struct sctpHBrequest rtt; struct sctpHBrequest rtt;
char addrFmt[SCTP_ADDRMAX]; int8_t addrFmt[SCTP_ADDRMAX];
unsigned short userreq; u_int16_t userreq;
}; };
/* for the abort and shutdown ACK
/* for the abort and shutdown ACK
* we must carry the init tag in the common header. Just the * we must carry the init tag in the common header. Just the
* common header is all that is needed with a chunk descriptor. * common header is all that is needed with a chunk descriptor.
*/ */
@ -241,15 +241,15 @@ struct sctpUnifiedAbortLight{
struct sctpUnifiedAbortHeavy{ struct sctpUnifiedAbortHeavy{
struct sctpHeader mh; struct sctpHeader mh;
struct sctpChunkDesc uh; struct sctpChunkDesc uh;
unsigned short causeCode; u_int16_t causeCode;
unsigned short causeLen; u_int16_t causeLen;
}; };
/* For the graceful shutdown we must carry /* For the graceful shutdown we must carry
* the tag (in common header) and the highest consequitive acking value * the tag (in common header) and the highest consequitive acking value
*/ */
struct sctpShutdown { struct sctpShutdown {
u_int TSN_Seen; u_int32_t TSN_Seen;
}; };
struct sctpUnifiedShutdown{ struct sctpUnifiedShutdown{
@ -262,8 +262,8 @@ struct sctpUnifiedShutdown{
* that is defined as a operation error. * that is defined as a operation error.
*/ */
struct sctpOpErrorCause{ struct sctpOpErrorCause{
u_short cause; u_int16_t cause;
u_short causeLen; u_int16_t causeLen;
}; };
struct sctpUnifiedOpError{ struct sctpUnifiedOpError{
@ -275,15 +275,15 @@ struct sctpUnifiedStreamError{
struct sctpHeader mh; struct sctpHeader mh;
struct sctpChunkDesc uh; struct sctpChunkDesc uh;
struct sctpOpErrorCause c; struct sctpOpErrorCause c;
u_short strmNum; u_int16_t strmNum;
u_short reserved; u_int16_t reserved;
}; };
struct staleCookieMsg{ struct staleCookieMsg{
struct sctpHeader mh; struct sctpHeader mh;
struct sctpChunkDesc uh; struct sctpChunkDesc uh;
struct sctpOpErrorCause c; struct sctpOpErrorCause c;
u_int moretime; u_int32_t moretime;
}; };
/* the following is used in all sends /* the following is used in all sends
@ -296,10 +296,10 @@ struct sctpUnifiedSingleMsg{
}; };
struct sctpDataPart{ struct sctpDataPart{
u_int TSN; u_int32_t TSN;
u_short streamId; u_int16_t streamId;
u_short sequence; u_int16_t sequence;
u_int payloadtype; u_int32_t payloadtype;
}; };
struct sctpUnifiedDatagram{ struct sctpUnifiedDatagram{
@ -309,14 +309,14 @@ struct sctpUnifiedDatagram{
struct sctpECN_echo{ struct sctpECN_echo{
struct sctpChunkDesc uh; struct sctpChunkDesc uh;
u_int Lowest_TSN; u_int32_t Lowest_TSN;
}; };
struct sctpCWR{ struct sctpCWR{
struct sctpChunkDesc uh; struct sctpChunkDesc uh;
u_int TSN_reduced_at; u_int32_t TSN_reduced_at;
}; };
#ifdef __cplusplus #ifdef __cplusplus
} }

6
dist/tcpdump/smb.h vendored
View File

@ -1,7 +1,7 @@
/* $NetBSD: smb.h,v 1.1.1.2 2002/02/18 09:09:06 itojun Exp $ */ /* $NetBSD: smb.h,v 1.1.1.3 2004/09/27 17:07:35 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/smb.h,v 1.7 2002/01/17 04:38:29 guy Exp (LBL) */ /* @(#) Header: /tcpdump/master/tcpdump/smb.h,v 1.8 2002/06/11 17:09:00 itojun Exp (LBL) */
/* /*
* Copyright (C) Andrew Tridgell 1995-1999 * Copyright (C) Andrew Tridgell 1995-1999
* *
* This software may be distributed either under the terms of the * This software may be distributed either under the terms of the

130
dist/tcpdump/tcpdump-stdinc.h vendored Normal file
View File

@ -0,0 +1,130 @@
/* $NetBSD: tcpdump-stdinc.h,v 1.1.1.1 2004/09/27 17:07:36 dyoung Exp $ */
/*
* Copyright (c) 2002 - 2003
* NetGroup, Politecnico di Torino (Italy)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Politecnico di Torino 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* @(#) Header: /tcpdump/master/tcpdump/tcpdump-stdinc.h,v 1.7.2.1 2003/11/16 09:57:50 guy Exp (LBL)
*/
/*
* Include the appropriate OS header files on Windows and various flavors
* of UNIX, and also define some additional items and include various
* non-OS header files on Windows, and; this isolates most of the platform
* differences to this one file.
*/
#ifndef tcpdump_stdinc_h
#define tcpdump_stdinc_h
#ifdef WIN32
#include <stdio.h>
#include <winsock2.h>
#include "bittypes.h"
#include <ctype.h>
#include <time.h>
#include <io.h>
#include "IP6_misc.h"
#include <fcntl.h>
#ifdef __MINGW32__
#include <stdint.h>
int* _errno();
#define errno (*_errno())
#define INET_ADDRSTRLEN 16
#define INET6_ADDRSTRLEN 46
#endif /* __MINGW32__ */
#ifndef toascii
#define toascii(c) ((c) & 0x7f)
#endif
#ifndef caddr_t
typedef char* caddr_t;
#endif /* caddr_t */
#define MAXHOSTNAMELEN 64
#define NI_MAXHOST 1025
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#define RETSIGTYPE void
#if !defined(__MINGW32__) && !defined(__WATCOMC__)
#undef toascii
#define isascii __isascii
#define toascii __toascii
#define stat _stat
#define open _open
#define fstat _fstat
#define read _read
#define O_RDONLY _O_RDONLY
typedef short ino_t;
#endif /* __MINGW32__ */
#else /* WIN32 */
#include <ctype.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/param.h>
#include <sys/types.h> /* concession to AIX */
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#ifdef TIME_WITH_SYS_TIME
#include <time.h>
#endif
#include <arpa/inet.h>
#endif /* WIN32 */
#ifdef INET6
#include "ip6.h"
#endif
#if defined(WIN32) || defined(MSDOS)
#define FOPEN_READ_TXT "rt"
#define FOPEN_READ_BIN "rb"
#define FOPEN_WRITE_TXT "wt"
#define FOPEN_WRITE_BIN "wb"
#else
#define FOPEN_READ_TXT "r"
#define FOPEN_READ_BIN FOPEN_READ_TXT
#define FOPEN_WRITE_TXT "w"
#define FOPEN_WRITE_BIN FOPEN_WRITE_TXT
#endif
#endif /* tcpdump_stdinc_h */

View File

@ -1,6 +1,6 @@
/* $NetBSD: token.h,v 1.1.1.1 2001/06/25 19:26:41 itojun Exp $ */ /* $NetBSD: token.h,v 1.1.1.2 2004/09/27 17:07:36 dyoung Exp $ */
/* @(#) Header: /tcpdump/master/tcpdump/token.h,v 1.3 2000/10/03 02:55:03 itojun Exp (LBL) */ /* @(#) Header: /tcpdump/master/tcpdump/token.h,v 1.6 2002/12/11 07:14:12 guy Exp (LBL) */
/* /*
* Copyright (c) 1998, Larry Lile * Copyright (c) 1998, Larry Lile
* All rights reserved. * All rights reserved.
@ -42,7 +42,7 @@
#define LARGEST_FRAME(trp) ((ntohs((trp)->token_rcf) & 0x0070) >> 4) #define LARGEST_FRAME(trp) ((ntohs((trp)->token_rcf) & 0x0070) >> 4)
#define RING_NUMBER(trp, x) ((ntohs((trp)->token_rseg[x]) & 0xfff0) >> 4) #define RING_NUMBER(trp, x) ((ntohs((trp)->token_rseg[x]) & 0xfff0) >> 4)
#define BRIDGE_NUMBER(trp, x) ((ntohs((trp)->token_rseg[x]) & 0x000f)) #define BRIDGE_NUMBER(trp, x) ((ntohs((trp)->token_rseg[x]) & 0x000f))
#define SEGMENT_COUNT(trp) ((RIF_LENGTH(trp) - 2) / 2) #define SEGMENT_COUNT(trp) ((int)((RIF_LENGTH(trp) - 2) / 2))
struct token_header { struct token_header {
u_int8_t token_ac; u_int8_t token_ac;