Vendor import of tcpdump 4.6.2.

This commit is contained in:
Xin LI 2015-01-06 19:03:11 +00:00
parent 05b21c9adf
commit e91eac2449
474 changed files with 47272 additions and 26214 deletions

81
CHANGES
View File

@ -1,4 +1,61 @@
Thursday February 19, 2013 guy@alum.mit.edu.
Tuesday Sep. 2, 2014 mcr@sandelman.ca
fix out-of-source-tree builds: find libpcap that is out of source
better configure check for libsmi
Saturday Jul. 19, 2014 mcr@sandelman.ca
Summary for 4.6.1 tcpdump release
added FreeBSD capsicum
add a short option '#', same as long option '--number'
Wednesday Jul. 2, 2014 mcr@sandelman.ca
Summary for 4.6.0 tcpdump release
all of tcpdump is now using the new "NDO" code base (Thanks Denis!)
nflog, mobile, forces, pptp, AODV, AHCP, IPv6, OSPFv4, RPL, DHCPv6 enhancements/fixes
M3UA decode added.
many new test cases: 82 in 4.5.1 to 133 in 4.6.0
many improvements to travis continuous integration system: OSX, and Coverity options
cleaned up some unnecessary header files
Added bittok2str().
a number of unaligned access faults fixed
-A flag does not consider CR to be printable anymore
fx.lebail took over coverity baby sitting
default snapshot size increased to 256K for accomodate USB captures
WARNING: this release contains a lot of very worthwhile code churn.
Wednesday Jan. 15, 2014 guy@alum.mit.edu
Summary for 4.5.2 tcpdump release
Man page fix
Fix crashes on SPARC
Monday Nov. 11, 2013 mcr@sandelman.ca
Summary for 4.5.1 tcpdump release
CREDITS file fixes
Thursday Nov. 7, 2013 mcr@sandelman.ca and guy@alum.mit.edu.
Summary for 4.5.0 tcpdump release
some NFSv4 fixes for printing
fix printing of unknown TCP options, and tcp fast-open
fixes for syslog parser
some gcc-version-specific flag tuning
adopt MacOS deprecation workarounds for openssl
improvements to babel printing
add OpenFlow 1.0 (no SSL) and test cases
GeoNet printer.
added STBC Rx support
improvements to DHCPv6 decoder
clarify which autoconf is needed
Point users to the the-tcpdump-group repository on GitHub rather
than the mcr repository
Add MSDP printer.
Fixed IPv6 check on Solaris and other OSes requiring extra
networking libraries.
Add support for VXLAN (draft-mahalingam-dutt-dcops-vxlan-03),
and add "vxlan" as an option for -T.
Add support for OTV (draft-hasmit-otv-04).
fixes for DLT_IEEE802_11_RADIO datalink types
added MPTCP decoder
Saturday April 6, 2013 guy@alum.mit.edu.
Summary for 4.4.0 tcpdump release
RPKI-RTR (RFC6810) is now official (TCP Port 323)
Fix detection of OpenSSL libcrypto.
@ -16,6 +73,8 @@ Thursday February 19, 2013 guy@alum.mit.edu.
On Linux systems with cap-ng.h, drop root privileges
using Linux Capabilities.
Add support for reading multiple files.
Add MS NLB heartbeat printer.
Separate multiple nexthops in BGP.
Wednesday November 28, 2012 guy@alum.mit.edu.
Summary for 4.3.1 tcpdump release
@ -32,7 +91,7 @@ Wednesday November 28, 2012 guy@alum.mit.edu.
Use the right maximum path length
Don't treat 192_1_2, when passed to -i, as an interface number
Friday April 3, 2011. mcr@sandelman.ca.
Friday April 3, 2012. mcr@sandelman.ca.
Summary for 4.3.0 tcpdump release
fixes for forces: SPARSE data (per RFC 5810)
some more test cases added
@ -113,7 +172,7 @@ Thu. April 1, 2010. guy@alum.mit.edu.
Summary for 4.1.1 tcpdump release
Fix build on systems with PF, such as FreeBSD and OpenBSD.
Don't blow up if a zero-length link-layer address is passed to
linkaddr_string().
linkaddr_string().
Thu. March 11, 2010. ken@netfunctional.ca/guy@alum.mit.edu.
Summary for 4.1.0 tcpdump release
@ -142,7 +201,7 @@ Thu. March 11, 2010. ken@netfunctional.ca/guy@alum.mit.edu.
Add printer for ForCES
Handle frames with an FCS
Handle 802.11n Control Wrapper, Block Acq Req and Block Ack frames
Fix TCP sequence number printing
Fix TCP sequence number printing
Report 802.2 packets as 802.2 instead of 802.3
Don't include -L/usr/lib in LDFLAGS
On x86_64 Linux, look in lib64 directory too
@ -178,13 +237,13 @@ Mon. September 10, 2007. ken@xelerance.com. Summary for 3.9.8 tcpdump relea
Converted print-isakmp.c to NETDISSECT
Moved AF specific stuff into af.h
Test subsystem now table driven, and saves outputs and diffs to one place
Require <net/pfvar.h> for pf definitions - allows reading of pflog formatted
Require <net/pfvar.h> for pf definitions - allows reading of pflog formatted
libpcap files on an OS other than where the file was generated
Wed. July 23, 2007. mcr@xelerance.com. Summary for 3.9.7 libpcap release
NFS: Print unsigned values as such.
NFS: Print unsigned values as such.
RX: parse safely.
BGP: fixes for IPv6-less builds.
801.1ag: use standard codepoint.
@ -194,7 +253,7 @@ Wed. July 23, 2007. mcr@xelerance.com. Summary for 3.9.7 libpcap release
smb: squelch an uninitialized complaint from coverity.
NFS: from NetBSD; don't interpret the reply as a possible NFS reply
if it got MSG_DENIED.
BGP: don't print TLV values that didn't fit, from www.digit-labs.org.
BGP: don't print TLV values that didn't fit, from www.digit-labs.org.
revised INSTALL.txt about libpcap dependancy.
Wed. April 25, 2007. ken@xelerance.com. Summary for 3.9.6 tcpdump release
@ -212,11 +271,11 @@ Wed. April 25, 2007. ken@xelerance.com. Summary for 3.9.6 tcpdump release
Add support for 802.3ah loopback ctrl msg
Add support for Multiple-STP as per 802.1s
Add support for rapid-SPT as per 802.1w
Add support for CFM Link-trace msg, Link-trace-Reply msg,
Add support for CFM Link-trace msg, Link-trace-Reply msg,
Sender-ID tlv, private tlv, port, interface status
Add support for unidirectional link detection as per
http://www.ietf.org/internet-drafts/draft-foschiano-udld-02.txt
Add support for the olsr protocol as per RFC 3626 plus the LQ
Add support for the olsr protocol as per RFC 3626 plus the LQ
extensions from olsr.org
Add support for variable-length checksum in DCCP, as per section 9 of
RFC 4340.
@ -228,7 +287,7 @@ Wed. April 25, 2007. ken@xelerance.com. Summary for 3.9.6 tcpdump release
Tue. September 19, 2006. ken@xelerance.com. Summary for 3.9.5 tcpdump release
Fix compiling on AIX (, at end of ENUM)
Updated list of DNS RR typecodes
Use local Ethernet defs on WIN32
@ -243,7 +302,7 @@ Tue. September 19, 2006. ken@xelerance.com. Summary for 3.9.5 tcpdump release
Add support for BGP signaled VPLS
Cleanup the bootp printer
Add support for PPP over Frame-Relay
Add some bounds checking to the IP options code, and clean up
Add some bounds checking to the IP options code, and clean up
the options output a bit.
Add additional modp groups to ISAKMP printer
Add support for Address-Withdraw and Label-Withdraw Msgs

72
CREDITS
View File

@ -2,18 +2,20 @@ This file lists people who have contributed to tcpdump:
The current maintainers:
Bill Fenner <fenner at research dot att dot com>
David Young <dyoung at pobox dot com>
Denis Ovsienko <infrastation at yandex dot ru>
Fulvio Risso <risso at polito dot it>
Guy Harris <guy at alum dot mit dot edu>
Hannes Gredler <hannes at juniper dot net>
Michael Richardson <mcr at sandelman dot ottawa dot on dot ca>
Francois-Xavier Le Bail <fx dot lebail at yahoo dot com>
Additional people who have contributed patches:
A Costa <agcosta at gis dot net>
Aaron Campbell <aaron at arbor dot net>
Alfredo Andres <aandres at s21sec dot com>
A Costa <agcosta at gis dot net>
Albert Chin <china at thewrittenword dot com>
Alexandra Kossovsky <alexandra1975 at sourceforge dot net>
Alfredo Andres <aandres at s21sec dot com>
Ananth Suryanarayana <anantha at juniper dot net>
Andrea Bittau <a dot bittau at cs dot ucl dot ac dot uk>
Andrew Brown <atatat at atatdot dot net>
@ -26,17 +28,19 @@ Additional people who have contributed patches:
Arkadiusz Miskiewicz <misiek at pld dot org dot pl>
Armando L. Caro Jr. <acaro at mail dot eecis dot udel dot edu>
Arnaldo Carvalho de Melo <acme at ghostprotocols dot net>
Ben Byer <bushing at sourceforge dot net>
Atsushi Onoe <onoe at netbsd dot org>
Baptiste Jonglez <baptiste dot jonglez at ens-lyon dot org>
Ben Byer <bushing at sourceforge dot net>
Ben Smithurst <ben at scientia dot demon dot co dot uk>
Bert Vermeulen <bert at biot dot com>
Bjoern A. Zeeb <bzeeb at Zabbadoz dot NeT>
Bram <tcpdump at mail dot wizbit dot be>
Brent L. Bates <blbates at vigyan dot com>
Brian Ginsbach <ginsbach at cray dot com>
Bruce M. Simpson <bms at spc dot org>
Carles Kishimoto Bisbe <ckishimo at ac dot upc dot es>
Charlie Lenahan <clenahan at fortresstech dot com>
Charles M. Hannum <mycroft at netbsd dot org>
Charlie Lenahan <clenahan at fortresstech dot com>
Chris Cogdon <chris at cogdon dot org>
Chris G. Demetriou <cgd at netbsd dot org>
Chris Jepeway <jepeway at blasted-heath dot com>
@ -52,7 +56,7 @@ Additional people who have contributed patches:
David Horn <dhorn2000 at gmail dot com>
David Smith <dsmith at redhat dot com>
David Young <dyoung at ojctech dot com>
Denis Ovsienko <infrastation at yandex dot ru>
Dmitrij Tejblum <tejblum at yandex-team dot ru>
Dmitry Eremin-Solenikov <dbaryshkov at gmail dot com>
Don Ebright <Don dot Ebright at compuware dot com>
Eddie Kohler <xexd at sourceforge dot net>
@ -60,22 +64,24 @@ Additional people who have contributed patches:
Fang Wang <fangwang at sourceforge dot net>
Florent Drouin <Florent dot Drouin at alcatel-lucent dot fr>
Florian Forster <octo at verplant dot org>
Francis Dupont <Francis dot Dupont at enst-bretagne dot fr>
fra <foo at bar dot baz>
Francesco Fondelli <francesco dot fondelli at gmail dot com>
Francisco Matias Cuenca-Acuna <mcuenca at george dot rutgers dot edu>
Francois-Xavier Le Bail <fx dot lebail at yahoo dot com>
Francis Dupont <Francis dot Dupont at enst-bretagne dot fr>
Frank Volf <volf at oasis dot IAEhv dot nl>
Fulvio Risso <risso at polito dot it>
George Bakos <gbakos at ists dot dartmouth dot edu>
Gerald Combs <gerald at ethereal dot com>
Gerrit Renker <gerrit at erg dot abdn dot ac dot uk>
Gert Doering <gert at greenie dot muc dot de>
Greg Minshall <minshall at acm dot org>
Greg Stark <gsstark at mit dot edu>
Grégoire Henry <henry@pps.jussieu.fr>
Gilbert Ramirez Jr. <gram at xiexie dot org>
Gisle Vanem <gvanem at broadpark dot no>
Hannes Viertel <hviertel at juniper dot net>
Gisle Vanem <gvanem at yahoo dot no>
Greg Minshall <minshall at acm dot org>
Grégoire Henry <henry at pps dot jussieu dot fr>
Gregory Detal <gregory dot detal at uclouvain dot be>
Greg Stark <gsstark at mit dot edu>
Hank Leininger <tcpdump-workers at progressive-comp dot com>
Hannes Viertel <hviertel at juniper dot net>
Harry Raaymakers <harryr at connect dot com dot au>
Heinz-Ado Arnolds <Ado dot Arnolds at dhm-systems dot de>
Hendrik Scholz <hendrik at scholz dot net>
@ -90,34 +96,37 @@ Additional people who have contributed patches:
Jeffrey Hutzelman <jhutz at cmu dot edu>
Jesper Peterson <jesper at endace dot com>
Jim Hutchins <jim at ca dot sandia dot gov>
Jonathan Heusser <jonny at drugphish dot ch>
Tatuya Jinmei <jinmei at kame dot net>
João Medeiros <ignotus21 at sourceforge dot net>
Joerg Mayer <jmayer@loplof.de>
Jørgen Thomsen <jth at jth dot net>
Joerg Mayer <jmayer at loplof dot de>
Jonathan Heusser <jonny at drugphish dot ch>
Jorge Boncompte [DTI2] <jorge at dti2 dot net>
Jørgen Thomsen <jth at jth dot net>
Julian Cowley <julian at lava dot net>
Juliusz Chroboczek <jch@pps.jussieu.fr>
Juliusz Chroboczek <jch at pps dot jussieu dot fr>
Kaarthik Sivakumar <kaarthik at torrentnet dot com>
Kaladhar Musunuru <kaladharm at sourceforge dot net>
Karl Norby <karl-norby at sourceforge dot net>
Kazushi Sugyo <sugyo at pb dot jp dot nec dot com>
Kelly Carmichael <kcarmich at ipapp dot com>
Ken Hornstein <kenh at cmf dot nrl dot navy dot mil>
Kevin Steves <stevesk at pobox dot com>
Kenichi Maehashi <webmaster at kenichimaehashi dot com>
Kevin Steves <stevesk at pobox dot com>
Klaus Klein <kleink at reziprozitaet dot de>
Kris Kennaway <kris at freebsd dot org>
Krzysztof Halasa <khc at pm dot waw dot pl>
Larry Lile <lile at stdio dot com>
Lennert Buytenhek <buytenh at gnu dot org>
Loganaden Velvindron <logan at elandsys dot com>
Longinus00 <Longinus00 at gmail dot com>
Loris Degioanni <loris at netgroup-serv dot polito dot it>
Love Hörnquist-Åstrand <lha at stacken dot kth dot se>
Lucas C. Villa Real <lucasvr at us dot ibm dot com>
Luis MartinGarcia <luis dot mgarc at gmail dot com>
Maciej W. Rozycki <macro at ds2 dot pg dot gda dot pl>
Manu Pathak <mapathak at cisco dot com>
Marc Binderberger <mbind at sourceforge dot net>
Marc Abramowitz <marc at marc-abramowitz dot com>
Marc A. Lehmann <pcg at goof dot com>
Marc Binderberger <mbind at sourceforge dot net>
Mark Ellzey Thomas <mark at ackers dot net>
Marko Kiiskila <carnil at cs dot tut dot fi>
Markus Schöpflin <schoepflin at sourceforge dot net>
@ -136,14 +145,16 @@ Additional people who have contributed patches:
Minto Jeyananth <minto at juniper dot net>
Monroe Williams <monroe at pobox dot com>
Motonori Shindo <mshindo at mshindo dot net>
Nathan J. Williams <nathanw at MIT dot EDU>
Nathaniel Couper-Noles <Nathaniel at isi1 dot tccisi dot com>
Nathan J. Williams <nathanw at MIT dot EDU>
Neil T. Spring <bluehal at users dot sourceforge dot net>
Niels Provos <provos at openbsd dot org>
Nickolai Zeldovich <kolya at MIT dot EDU>
Nicolas Ferrero <toorop at babylo dot net>
Niels Provos <provos at openbsd dot org>
Noritoshi Demizu <demizu at users dot sourceforge dot net>
Olaf Kirch <okir at caldera dot de>
Ola Martin Lykkja <ola dot lykkja at q-free dot com>
Oleksij Rempel <linux at rempel-privat dot de>
Onno van der Linden <onno at simplex dot nl>
Paolo Abeni <paolo dot abeni at email dot it>
Pascal Hennequin <pascal dot hennequin at int-evry dot fr>
@ -153,11 +164,12 @@ Additional people who have contributed patches:
Paul S. Traina <pst at freebsd dot org>
Pavlin Radoslavov <pavlin at icir dot org>
Pawel Worach <pawel dot worach at gmail dot com>
Pekka Savola <pekkas at netcore dot fi>
Pekka Savola <pekkas at netcore dot fi>
Petar Alilovic <petar dot alilovic at gmail dot com>
Peter Fales <peter at fales-lorenz dot net>
Peter Jeremy <peter dot jeremy at alcatel dot com dot au>
<pfhunt at users dot sourceforge dot net>
Peter Volkov <pva at gentoo dot org>
<pfhunt at users dot sourceforge dot net>
Phil Wood <cpw at lanl dot gov>
Rafal Maszkowski <rzm at icm dot edu dot pl>
Randy Sofia <rsofia at users dot sourceforge dot net>
@ -169,9 +181,10 @@ Additional people who have contributed patches:
Robert Edmonds <stu-42 at sourceforge dot net>
Roderick Schertler <roderick at argon dot org>
Romain Francoise <rfrancoise at debian dot org>
Ruben Kerkhof <ruben at rubenkerkhof dot com>
Sagun Shakya <sagun dot shakya at sun dot com>
Sami Farin <safari at iki dot fi>
Scott Mcmillan <scott.a.mcmillan at intel dot com>
Scott Mcmillan <scott dot a dot mcmillan at intel dot com>
Scott Rose <syberpunk at users dot sourceforge dot net>
Sebastian Krahmer <krahmer at cs dot uni-potsdam dot de>
Sebastien Raveau <sebastien dot raveau at epita dot fr>
@ -181,20 +194,27 @@ Additional people who have contributed patches:
Shinsuke Suzuki <suz at kame dot net>
Simon Ruderich <simon at ruderich dot org>
Steinar Haug <sthaug at nethelp dot no>
Stephane Bortzmeyer <stephane+github at bortzmeyer dot org>
Swaminathan Chandrasekaran <chander at juniper dot net>
Swaathi Vetrivel <swaathiv at juniper dot net>
Takashi Yamamoto <yamt at mwd dot biglobe dot ne dot jp>
Tatuya Jinmei <jinmei at kame dot net>
Terry Kennedy <terry at tmk dot com>
Thomas Jacob <jacob at internet24 dot de>
Timo Koskiahde
Tony Li <tli at procket dot com>
Toshihiro Kanda <candy at fct dot kgc dot co dot jp>
Udayakumar <udaya011 at gmail dot com>
Uns Lider <unslider at miranda dot org>
Victor Oppleman <oppleman at users dot sourceforge dot net>
Vyacheslav Trushkin <dogonthesun at gmail dot com>
Weesan Lee <weesan at juniper dot net>
Wesley Griffin <wgriffin at users dot sourceforge dot net>
Wesley Shields <wxs at FreeBSD dot org>
Wilbert de Graaf <wilbertdg at hetnet dot nl>
Will Drewry <will at alum dot bu dot edu>
William J. Hulley <bill dot hulley at gmail dot com>
Wim Torfs <wtorfs at gmail dot com>
Yen Yen Lim
Yoshifumi Nishida
@ -204,4 +224,4 @@ The original LBL crew:
Van Jacobson
Past maintainers:
Jun-ichiro itojun Hagino <itojun at iijlab dot net>
Jun-ichiro itojun Hagino <itojun at iijlab dot net> Also see: http://www.wide.ad.jp/itojun-award/

View File

@ -1,5 +1,3 @@
@(#) $Header: /tcpdump/master/tcpdump/INSTALL.txt,v 1.2 2008-02-06 10:47:53 guy Exp $ (LBL)
If you have not built libpcap, and your system does not have libpcap
installed, install libpcap first. Your system might provide a version
of libpcap that can be installed; if so, to compile tcpdump you might
@ -9,9 +7,7 @@ libpcap; see the README file in this directory for the ftp location.
You will need an ANSI C compiler to build tcpdump. The configure script
will abort if your compiler is not ANSI compliant. If this happens, use
the GNU C compiler, available via anonymous ftp:
ftp://ftp.gnu.org/pub/gnu/gcc/
the generally available GNU C compiler (GCC).
After libpcap has been built (either install it with "make install" or
make sure both the libpcap and tcpdump source trees are in the same
@ -42,25 +38,20 @@ FILES
-----
CHANGES - description of differences between releases
CREDITS - people that have helped tcpdump along
FILES - list of files exported as part of the distribution
INSTALL.txt - this file
LICENSE - the license under which tcpdump is distributed
Makefile.in - compilation rules (input to the configure script)
README - description of distribution
Readme.Win32 - notes on building tcpdump on Win32 systems (with WinPcap)
VERSION - version of this release
acconfig.h - autoconf input
aclocal.m4 - autoconf macros
addrtoname.c - address to hostname routines
addrtoname.h - address to hostname definitions
ah.h - IPSEC Authentication Header definitions
aodv.h - AODV definitions
appletalk.h - AppleTalk definitions
arcnet.h - ARCNET definitions
atime.awk - TCP ack awk script
atm.h - ATM traffic type definitions
atmuni31.h - ATM Q.2931 definitions
bgp.h - BGP declarations
bootp.h - BOOTP definitions
bpf_dump.c - BPF program printing routines, in case libpcap doesn't
have them
@ -72,37 +63,21 @@ config.h.in - autoconf input
config.sub - autoconf support
configure - configure script (run this first)
configure.in - configure script source
dccp.h - DCCP definitions
decnet.h - DECnet definitions
decode_prefix.h - Declarations of "decode_prefix{4,6}()"
enc.h - OpenBSD IPsec encapsulation BPF layer definitions
esp.h - IPSEC Encapsulating Security Payload definitions
ether.h - Ethernet definitions
ethertype.h - Ethernet type value definitions
extract.h - alignment definitions
fddi.h - Fiber Distributed Data Interface definitions
gmpls.c - GMPLS definitions
gmpls.h - GMPLS declarations
gmt2local.c - time conversion routines
gmt2local.h - time conversion prototypes
icmp6.h - ICMPv6 definitiions
ieee802_11.h - IEEE 802.11 definitions
ieee802_11_radio.h - radiotap header definitions
igrp.h - Interior Gateway Routing Protocol definitions
install-sh - BSD style install script
interface.h - globals, prototypes and definitions
ip.h - IP definitions
ip6.h - IPv6 definitions
ipfc.h - IP-over-Fibre Channel definitions
ipproto.c - IP protocol type value-to-name table
ipproto.h - IP protocol type value definitions
ipsec_doi.h - ISAKMP packet definitions - RFC2407
ipx.h - IPX definitions
isakmp.h - ISAKMP packet definitions - RFC2408
l2vpn.c - L2VPN encapsulation value-to-name table
l2vpn.h - L2VPN encapsulation definitions
l2tp.h - Layer Two Tunneling Protocol definitions
lane.h - ATM LANE definitions
lbl/os-*.h - OS-dependent defines and prototypes
llc.h - LLC definitions
machdep.c - machine dependent routines
@ -113,23 +88,18 @@ missing/* - replacements for missing library functions
mkdep - construct Makefile dependency list
mpls.h - MPLS definitions
nameser.h - DNS definitions
netbios.h - NETBIOS definitions
netdissect.h - definitions and declarations for tcpdump-as-library
(under development)
nfs.h - Network File System V2 definitions
nfsfh.h - Network File System file handle definitions
nlpid.c - OSI NLPID value-to-name table
nlpid.h - OSI NLPID definitions
ntp.h - Network Time Protocol definitions
oakley.h - ISAKMP packet definitions - RFC2409
ospf.h - Open Shortest Path First definitions
ospf6.h - IPv6 Open Shortest Path First definitions
packetdat.awk - TCP chunk summary awk script
parsenfsfh.c - Network File System file parser routines
pcap_dump_ftell.c - pcap_dump_ftell() implementation, in case libpcap
doesn't have it
pcap-missing.h - declarations of functions possibly missing from libpcap
pmap_prot.h - definitions for ONC RPC portmapper protocol
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
@ -184,7 +154,6 @@ print-mobile.c - IPv4 mobility 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-ntp.c - Network Time Protocol printer routines
print-null.c - BSD loopback device printer routines
@ -226,18 +195,12 @@ print-vjc.c - PPP Van Jacobson compression (RFC1144) printer routines
print-vrrp.c - Virtual Router Redundancy Protocol
print-wb.c - White Board printer routines
print-zephyr.c - Zephyr printer routines
route6d.h - packet definition for IPv6 Routing Information Protocol
rpc_auth.h - definitions for ONC RPC authentication
rpc_msg.h - definitions for ONC RPC messages
rx.h - AFS RX definitions
sctpConstants.h - Stream Control Transmission Protocol constant definitions
sctpHeader.h - Stream Control Transmission Protocol packet definitions
send-ack.awk - unidirectional tcp send/ack awk script
setsignal.c - OS-independent signal routines
setsignal.h - OS-independent signal prototypes
slcompress.h - SLIP/PPP Van Jacobson compression (RFC1144) definitions
slip.h - SLIP definitions
sll.h - Linux "cooked" capture definitions
smb.h - SMB/CIFS definitions
smbutil.c - SMB/CIFS utility routines
stime.awk - TCP send awk script
@ -245,10 +208,6 @@ strcasecmp.c - missing routine
tcp.h - TCP definitions
tcpdump.1 - manual entry
tcpdump.c - main program
telnet.h - Telnet definitions
tftp.h - TFTP definitions
timed.h - BSD time daemon protocol definitions
token.h - Token Ring definitions
udp.h - UDP definitions
util.c - utility routines
vfprintf.c - emulation routine

View File

@ -2,12 +2,12 @@
# Auto-regenerate configure script or Makefile when things change.
# From autoconf.info . Works best with GNU Make.
#
${srcdir}/configure: configure.in
${srcdir}/configure: configure.in aclocal.m4
cd ${srcdir} && autoconf
# autoheader might not change config.h.in, so touch a stamp file.
${srcdir}/config.h.in: ${srcdir}/stamp-h.in
${srcdir}/stamp-h.in: configure.in acconfig.h
${srcdir}/stamp-h.in: configure.in aclocal.m4
cd ${srcdir} && autoheader
echo timestamp > ${srcdir}/stamp-h.in

View File

@ -16,8 +16,6 @@
# 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/Makefile.in,v 1.325 2008-11-21 23:17:26 guy Exp $ (LBL)
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
@ -41,6 +39,8 @@ VPATH = @srcdir@
#
CC = @CC@
AR = @AR@
MKDEP = @MKDEP@
PROG = tcpdump
CCOPT = @V_CCOPT@
INCLS = -I. @V_INCLS@
@ -61,6 +61,8 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
RANLIB = @RANLIB@
DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
# Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
# Also, gcc does not remove the .o before forking 'as', which can be a
# problem if you don't own the file but can write to the directory.
@ -68,126 +70,205 @@ RANLIB = @RANLIB@
@rm -f $@
$(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c
CSRC = addrtoname.c af.c checksum.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \
nlpid.c l2vpn.c machdep.c parsenfsfh.c in_cksum.c \
print-802_11.c print-802_15_4.c print-ap1394.c print-ah.c \
print-arcnet.c print-aodv.c print-arp.c print-ascii.c print-atalk.c \
print-atm.c print-beep.c print-bfd.c print-bgp.c \
print-bootp.c print-bt.c print-carp.c print-cdp.c print-cfm.c \
print-chdlc.c print-cip.c print-cnfp.c print-dccp.c print-decnet.c \
print-domain.c print-dtp.c print-dvmrp.c print-enc.c print-egp.c \
print-eap.c print-eigrp.c\
print-esp.c print-ether.c print-fddi.c print-forces.c print-fr.c \
print-gre.c print-hsrp.c print-icmp.c print-igmp.c \
print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c print-ipnet.c \
print-ipx.c print-isoclns.c print-juniper.c print-krb.c \
print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \
print-lmp.c print-lspping.c print-lwapp.c \
print-lwres.c print-mobile.c print-mpcp.c print-mpls.c print-msdp.c \
print-msnlb.c print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \
print-pgm.c print-pim.c \
print-ppi.c print-ppp.c print-pppoe.c print-pptp.c \
print-radius.c print-raw.c print-rip.c print-rpki-rtr.c print-rrcp.c print-rsvp.c \
print-rx.c print-sctp.c print-sflow.c print-sip.c print-sl.c print-sll.c \
print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \
print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \
print-timed.c print-tipc.c print-token.c print-udld.c print-udp.c \
print-usb.c print-vjc.c print-vqp.c print-vrrp.c print-vtp.c \
print-wb.c print-zephyr.c print-zeromq.c print-vxlan.c print-otv.c signature.c setsignal.c tcpdump.c util.c
CSRC = setsignal.c tcpdump.c
LIBNETDISSECT_SRC=print-isakmp.c
LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o)
LIBNETDISSECT=libnetdissect.a
LIBNETDISSECT_SRC=\
addrtoname.c \
af.c \
checksum.c \
cpack.c \
gmpls.c \
gmt2local.c \
in_cksum.c \
ipproto.c \
l2vpn.c \
machdep.c \
nlpid.c \
oui.c \
parsenfsfh.c \
print-802_11.c \
print-802_15_4.c \
print-ah.c \
print-ahcp.c \
print-aodv.c \
print-aoe.c \
print-ap1394.c \
print-arcnet.c \
print-arp.c \
print-ascii.c \
print-atalk.c \
print-atm.c \
print-beep.c \
print-bfd.c \
print-bgp.c \
print-bootp.c \
print-bt.c \
print-calm-fast.c \
print-carp.c \
print-cdp.c \
print-cfm.c \
print-chdlc.c \
print-cip.c \
print-cnfp.c \
print-dccp.c \
print-decnet.c \
print-domain.c \
print-dtp.c \
print-dvmrp.c \
print-eap.c \
print-egp.c \
print-eigrp.c \
print-enc.c \
print-esp.c \
print-ether.c \
print-fddi.c \
print-forces.c \
print-fr.c \
print-geonet.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-ipnet.c \
print-ipx.c \
print-isakmp.c \
print-isoclns.c \
print-juniper.c \
print-krb.c \
print-l2tp.c \
print-lane.c \
print-ldp.c \
print-llc.c \
print-lldp.c \
print-lmp.c \
print-loopback.c \
print-lspping.c \
print-lwapp.c \
print-lwres.c \
print-m3ua.c \
print-mobile.c \
print-mpcp.c \
print-mpls.c \
print-mptcp.c \
print-msdp.c \
print-msnlb.c \
print-nflog.c \
print-nfs.c \
print-ntp.c \
print-null.c \
print-olsr.c \
print-openflow-1.0.c \
print-openflow.c \
print-ospf.c \
print-otv.c \
print-pgm.c \
print-pim.c \
print-pktap.c \
print-ppi.c \
print-ppp.c \
print-pppoe.c \
print-pptp.c \
print-radius.c \
print-raw.c \
print-rip.c \
print-rpki-rtr.c \
print-rrcp.c \
print-rsvp.c \
print-rx.c \
print-sctp.c \
print-sflow.c \
print-sip.c \
print-sl.c \
print-sll.c \
print-slow.c \
print-snmp.c \
print-stp.c \
print-sunatm.c \
print-sunrpc.c \
print-symantec.c \
print-syslog.c \
print-tcp.c \
print-telnet.c \
print-tftp.c \
print-timed.c \
print-tipc.c \
print-token.c \
print-udld.c \
print-udp.c \
print-usb.c \
print-vjc.c \
print-vqp.c \
print-vrrp.c \
print-vtp.c \
print-vxlan.c \
print-wb.c \
print-zephyr.c \
print-zeromq.c \
signature.c \
util.c
LOCALSRC = @LOCALSRC@
GENSRC = version.c
LIBOBJS = @LIBOBJS@
LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS}
LIBNETDISSECT=libnetdissect.a
SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC)
# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
# hack the extra indirection
OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LOCALSRC:.c=.o) $(LIBOBJS) $(LIBNETDISSECT_OBJ)
OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LIBNETDISSECT_OBJ)
HDR = \
acconfig.h \
addrtoname.h \
af.h \
ah.h \
aodv.h \
appletalk.h \
arcnet.h \
atm.h \
atmuni31.h \
bootp.h \
bgp.h \
chdlc.h \
cpack.h \
dccp.h \
decnet.h \
decode_prefix.h \
enc.h \
esp.h \
ether.h \
ethertype.h \
extract.h \
fddi.h \
forces.h \
getopt_long.h \
gmpls.h \
gmt2local.h \
icmp6.h \
ieee802_11.h \
ieee802_11_radio.h \
igrp.h \
interface.h \
interface.h \
ip.h \
ip6.h \
ipfc.h \
ipnet.h \
ipproto.h \
ipsec_doi.h \
ipx.h \
isakmp.h \
l2tp.h \
l2vpn.h \
lane.h \
llc.h \
machdep.h \
mib.h \
mpls.h \
nameser.h \
netbios.h \
netdissect.h \
nfs.h \
nfsfh.h \
nlpid.h \
ntp.h \
oakley.h \
openflow.h \
ospf.h \
ospf6.h \
oui.h \
pcap-missing.h \
pmap_prot.h \
ppi.h \
ppp.h \
route6d.h \
rpc_auth.h \
rpc_msg.h \
rx.h \
sctpConstants.h \
sctpHeader.h \
rpl.h \
setsignal.h \
signature.h \
slcompress.h \
slip.h \
sll.h \
smb.h \
tcp.h \
tcpdump-stdinc.h \
telnet.h \
tftp.h \
timed.h \
token.h \
udp.h
TAGHDR = \
@ -212,7 +293,7 @@ EXTRA_DIST = \
LICENSE \
Makefile.in \
Makefile-devel-adds \
README \
README.md \
Readme.Win32 \
VERSION \
aclocal.m4 \
@ -233,11 +314,11 @@ EXTRA_DIST = \
missing/dlnames.c \
missing/datalinks.c \
missing/getnameinfo.c \
missing/getopt_long.c \
missing/inet_aton.c \
missing/inet_ntop.c \
missing/inet_pton.c \
missing/snprintf.c \
missing/sockstorage.h \
missing/strdup.c \
missing/strlcat.c \
missing/strlcpy.c \
@ -252,7 +333,6 @@ EXTRA_DIST = \
print-ip6.c \
print-ip6opts.c \
print-mobility.c \
print-netbios.c \
print-ospf6.c \
print-pflog.c \
print-ripng.c \
@ -264,18 +344,14 @@ EXTRA_DIST = \
strcasecmp.c \
tcpdump.1.in \
vfprintf.c \
win32/Include/bittypes.h \
win32/Include/errno.h \
win32/Include/getopt.h \
win32/Include/w32_fzs.h \
win32/Src/getopt.c \
win32/prj/GNUmakefile \
win32/prj/WinDump.dsp \
win32/prj/WinDump.dsw
TEST_DIST= `find tests \( -name 'DIFF' -prune \) -o \( -name NEW -prune \) -o -type f \! -name '.*' \! -name '*~' -print`
all: $(PROG)
all: $(PROG) $(LIBNETDISSECT)
$(PROG): $(OBJ) @V_PCAPDEP@
@rm -f $@
@ -283,7 +359,7 @@ $(PROG): $(OBJ) @V_PCAPDEP@
$(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
@rm -f $@
$(AR) cr $@ $(LIBNETDISSECT_OBJ)
$(AR) cr $@ $(LIBNETDISSECT_OBJ)
$(RANLIB) $@
datalinks.o: $(srcdir)/missing/datalinks.c
@ -292,8 +368,8 @@ dlnames.o: $(srcdir)/missing/dlnames.c
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
getnameinfo.o: $(srcdir)/missing/getnameinfo.c
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c
getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getaddrinfo.c
getopt_long.o: $(srcdir)/missing/getopt_long.c
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getopt_long.c
inet_pton.o: $(srcdir)/missing/inet_pton.c
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c
inet_ntop.o: $(srcdir)/missing/inet_ntop.c
@ -302,6 +378,8 @@ inet_aton.o: $(srcdir)/missing/inet_aton.c
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c
snprintf.o: $(srcdir)/missing/snprintf.c
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
strdup.o: $(srcdir)/missing/strdup.c
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strdup.c
strlcat.o: $(srcdir)/missing/strlcat.c
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
strlcpy.o: $(srcdir)/missing/strlcpy.c
@ -345,8 +423,10 @@ clean:
distclean:
rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1
rm -rf autom4te.cache
config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1 \
libnetdissect.a tests/.failed tests/.passed \
tests/failure-outputs.txt
rm -rf autom4te.cache tests/DIFF tests/NEW
check: tcpdump
(cd tests && ./TESTrun.sh)
@ -368,4 +448,4 @@ testlist:
echo $(TEST_DIST)
depend: $(GENSRC)
${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
$(MKDEP) -c $(CC) -m $(DEPENDENCY_CFLAG) $(DEFS) $(INCLS) $(SRC)

View File

@ -1,33 +1,35 @@
@(#) $Header: /tcpdump/master/tcpdump/README,v 1.68 2008-12-15 00:05:27 guy Exp $ (LBL)
# tcpdump
TCPDUMP 4.x.y
Now maintained by "The Tcpdump Group"
See www.tcpdump.org
[![Build
Status](https://travis-ci.org/the-tcpdump-group/tcpdump.png)](https://travis-ci.org/the-tcpdump-group/tcpdump)
TCPDUMP 4.x.y
Now maintained by "The Tcpdump Group"
See www.tcpdump.org
Please send inquiries/comments/reports to:
tcpdump-workers@lists.tcpdump.org
* tcpdump-workers@lists.tcpdump.org
Anonymous Git is available via:
git clone git://bpf.tcpdump.org/tcpdump
Version 4.x.y of TCPDUMP can be retrieved with the CVS tag "tcpdump_4_xrely":
cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_4_xrely tcpdump
Please submit patches by forking the branch on GitHub at:
Please submit patches by forking the branch on GitHub at
http://github.com/mcr/tcpdump/tree/master
* http://github.com/the-tcpdump-group/tcpdump/tree/master
and issuing a pull request.
formerly from Lawrence Berkeley National Laboratory
Network Research Group <tcpdump@ee.lbl.gov>
ftp://ftp.ee.lbl.gov/tcpdump.tar.Z (3.4)
formerly from Lawrence Berkeley National Laboratory
Network Research Group <tcpdump@ee.lbl.gov>
ftp://ftp.ee.lbl.gov/old/tcpdump.tar.Z (3.4)
This directory contains source code for tcpdump, a tool for network
monitoring and data acquisition. This software was originally
developed by the Network Research Group at the Lawrence Berkeley
National Laboratory. The original distribution is available via
anonymous ftp to ftp.ee.lbl.gov, in tcpdump.tar.Z. More recent
anonymous ftp to `ftp.ee.lbl.gov`, in `tcpdump.tar.Z`. More recent
development is performed at tcpdump.org, http://www.tcpdump.org/
Tcpdump uses libpcap, a system-independent interface for user-level
@ -36,7 +38,7 @@ build libpcap, also originally from LBL and now being maintained by
tcpdump.org; see http://www.tcpdump.org/ .
Once libpcap is built (either install it or make sure it's in
../libpcap), you can build tcpdump using the procedure in the INSTALL
`../libpcap`), you can build tcpdump using the procedure in the `INSTALL.txt`
file.
The program is loosely based on SMI's "etherfind" although none of the
@ -50,20 +52,20 @@ manual entry, with no access to the source of tcpdump or etherfind.
Over the past few years, tcpdump has been steadily improved by the
excellent contributions from the Internet community (just browse
through the CHANGES file). We are grateful for all the input.
through the `CHANGES` file). We are grateful for all the input.
Richard Stevens gives an excellent treatment of the Internet protocols
in his book ``TCP/IP Illustrated, Volume 1''. If you want to learn more
in his book *"TCP/IP Illustrated, Volume 1"*. If you want to learn more
about tcpdump and how to interpret its output, pick up this book.
Some tools for viewing and analyzing tcpdump trace files are available
from the Internet Traffic Archive:
http://www.acm.org/sigcomm/ITA/
* http://www.sigcomm.org/ITA/
Another tool that tcpdump users might find useful is tcpslice:
ftp://ftp.ee.lbl.gov/tcpslice.tar.Z
* https://github.com/the-tcpdump-group/tcpslice
It is a program that can be used to extract portions of tcpdump binary
trace files. See the above distribution for further details and
@ -72,14 +74,14 @@ documentation.
Problems, bugs, questions, desirable enhancements, etc. should be sent
to the address "tcpdump-workers@lists.tcpdump.org". Bugs, support
requests, and feature requests may also be submitted on the GitHub issue
tracker for tcpdump at
tracker for tcpdump at:
https://github.com/mcr/tcpdump/issues
* https://github.com/the-tcpdump-group/tcpdump/issues
Source code contributions, etc. should be sent to the email address
above or submitted by forking the branch on GitHub at
above or submitted by forking the branch on GitHub at:
http://github.com/mcr/tcpdump/tree/master
* http://github.com/the-tcpdump-group/tcpdump/tree/master
and issuing a pull request.
@ -90,6 +92,7 @@ Current versions can be found at www.tcpdump.org.
original text by: Steve McCanne, Craig Leres, Van Jacobson
-------------------------------------
```
This directory also contains some short awk programs intended as
examples of ways to reduce tcpdump data when you're tracking
particular network problems:
@ -237,3 +240,4 @@ The method was:
- Once a week, tell your funding agent that you're discovering
wonderful things and you'll write up that research report
"real soon now".
```

View File

@ -1 +1 @@
4.4.0
4.6.2

View File

@ -1,75 +0,0 @@
/* "generated automatically" means DO NOT MAKE CHANGES TO config.h.in --
* make them to acconfig.h and rerun autoheader */
@TOP@
/* Define if you enable IPv6 support */
#undef INET6
/* Define if you enable support for the libsmi. */
#undef LIBSMI
/* define if you have the addrinfo function. */
#undef HAVE_ADDRINFO
/* define if you need to include missing/addrinfoh.h. */
#undef NEED_ADDRINFO_H
/* define ifyou have the h_errno variable. */
#undef HAVE_H_ERRNO
/* define if you have struct 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 */
#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 libpcap has pcap_dump_ftell() */
#undef HAVE_PCAP_DUMP_FTELL
/* define if you have getrpcbynumber() */
#undef HAVE_GETRPCBYNUMBER
/* Workaround for missing 64-bit formats */
#undef PRId64
#undef PRIo64
#undef PRIx64
#undef PRIu64
/* Whether or not to include the possibly-buggy SMB printer */
#undef TCPDUMP_DO_SMB
/* Define if you have the dnet_htoa function. */
#undef HAVE_DNET_HTOA
/* Define if you have a dnet_htoa declaration in <netdnet/dnetdb.h>. */
#undef HAVE_NETDNET_DNETDB_H_DNET_HTOA
/* define if should drop privileges by default */
#undef WITH_USER
/* define if should chroot when dropping privileges */
#undef WITH_CHROOT

528
aclocal.m4 vendored
View File

@ -1,5 +1,3 @@
dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.116 2008-09-25 21:45:50 guy Exp $ (LBL)
dnl
dnl Copyright (c) 1995, 1996, 1997, 1998
dnl The Regents of the University of California. All rights reserved.
dnl
@ -38,16 +36,15 @@ dnl AC_LBL_C_INIT. Now, we run AC_LBL_C_INIT_BEFORE_CC, AC_PROG_CC,
dnl and AC_LBL_C_INIT at the top level.
dnl
AC_DEFUN(AC_LBL_C_INIT_BEFORE_CC,
[AC_PREREQ(2.50)
[
AC_BEFORE([$0], [AC_LBL_C_INIT])
AC_BEFORE([$0], [AC_PROG_CC])
AC_BEFORE([$0], [AC_LBL_FIXINCLUDES])
AC_BEFORE([$0], [AC_LBL_DEVEL])
AC_ARG_WITH(gcc, [ --without-gcc don't use gcc])
$1="-O"
$2=""
$1=""
if test "${srcdir}" != "." ; then
$2="-I$srcdir"
$1="-I$srcdir"
fi
if test "${CFLAGS+set}" = set; then
LBL_CFLAGS="$CFLAGS"
@ -73,9 +70,15 @@ AC_DEFUN(AC_LBL_C_INIT_BEFORE_CC,
dnl
dnl Determine which compiler we're using (cc or gcc)
dnl If using gcc, determine the version number
dnl If using cc, require that it support ansi prototypes
dnl If using gcc, use -O2 (otherwise use -O)
dnl If using cc, explicitly specify /usr/local/include
dnl If using cc:
dnl require that it support ansi prototypes
dnl use -O (AC_PROG_CC will use -g -O2 on gcc, so we don't need to
dnl do that ourselves for gcc)
dnl add -g flags, as appropriate
dnl explicitly specify /usr/local/include
dnl
dnl NOTE WELL: with newer versions of autoconf, "gcc" means any compiler
dnl that defines __GNUC__, which means clang, for example, counts as "gcc".
dnl
dnl usage:
dnl
@ -87,92 +90,82 @@ dnl $1 (copt set)
dnl $2 (incls set)
dnl CC
dnl LDFLAGS
dnl ac_cv_lbl_gcc_vers
dnl LBL_CFLAGS
dnl
AC_DEFUN(AC_LBL_C_INIT,
[AC_PREREQ(2.50)
[
AC_BEFORE([$0], [AC_LBL_FIXINCLUDES])
AC_BEFORE([$0], [AC_LBL_DEVEL])
AC_BEFORE([$0], [AC_LBL_SHLIBS_INIT])
if test "$GCC" = yes ; then
if test "$SHLICC2" = yes ; then
ac_cv_lbl_gcc_vers=2
$1="-O2"
else
AC_MSG_CHECKING(gcc version)
AC_CACHE_VAL(ac_cv_lbl_gcc_vers,
ac_cv_lbl_gcc_vers=`$CC -v 2>&1 | \
sed -e '/^gcc version /!d' \
-e 's/^gcc version //' \
-e 's/ .*//' -e 's/^[[[^0-9]]]*//' \
-e 's/\..*//'`)
AC_MSG_RESULT($ac_cv_lbl_gcc_vers)
if test $ac_cv_lbl_gcc_vers -gt 1 ; then
$1="-O2"
fi
fi
#
# -Werror forces warnings to be errors.
#
ac_lbl_cc_force_warning_errors=-Werror
#
# Use -ffloat-store so that, on 32-bit x86, we don't
# do 80-bit arithmetic with the FPU; that way we should
# get the same results for floating-point calculations
# on x86-32 and x86-64.
#
AC_LBL_CHECK_COMPILER_OPT($1, -ffloat-store)
else
AC_MSG_CHECKING(that $CC handles ansi prototypes)
AC_CACHE_VAL(ac_cv_lbl_cc_ansi_prototypes,
AC_TRY_COMPILE(
[#include <sys/types.h>],
[int frob(int, char *)],
ac_cv_lbl_cc_ansi_prototypes=yes,
ac_cv_lbl_cc_ansi_prototypes=no))
AC_MSG_RESULT($ac_cv_lbl_cc_ansi_prototypes)
if test $ac_cv_lbl_cc_ansi_prototypes = no ; then
case "$host_os" in
hpux*)
AC_MSG_CHECKING(for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE))
savedcflags="$CFLAGS"
CFLAGS="-Aa -D_HPUX_SOURCE $CFLAGS"
AC_CACHE_VAL(ac_cv_lbl_cc_hpux_cc_aa,
AC_TRY_COMPILE(
[#include <sys/types.h>],
[int frob(int, char *)],
ac_cv_lbl_cc_hpux_cc_aa=yes,
ac_cv_lbl_cc_hpux_cc_aa=no))
AC_MSG_RESULT($ac_cv_lbl_cc_hpux_cc_aa)
if test $ac_cv_lbl_cc_hpux_cc_aa = no ; then
AC_MSG_ERROR(see the INSTALL doc for more info)
fi
CFLAGS="$savedcflags"
$1="-Aa $$1"
AC_DEFINE(_HPUX_SOURCE,1,[needed on HP-UX])
;;
osf*)
AC_MSG_CHECKING(for ansi mode in DEC compiler ($CC -std1))
savedcflags="$CFLAGS"
CFLAGS="-std1"
AC_CACHE_VAL(ac_cv_lbl_cc_osf1_cc_std1,
AC_TRY_COMPILE(
[#include <sys/types.h>],
[int frob(int, char *)],
ac_cv_lbl_cc_osf1_cc_std1=yes,
ac_cv_lbl_cc_osf1_cc_std1=no))
AC_MSG_RESULT($ac_cv_lbl_cc_osf1_cc_std1)
if test $ac_cv_lbl_cc_osf1_cc_std1 = no ; then
AC_MSG_ERROR(see the INSTALL doc for more info)
fi
CFLAGS="$savedcflags"
$1="-std1 $$1"
;;
*)
AC_MSG_ERROR(see the INSTALL doc for more info)
;;
esac
fi
$2="$$2 -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
case "$host_os" in
darwin*)
#
# This is assumed either to be GCC or clang, both
# of which use -Werror to force warnings to be errors.
#
ac_lbl_cc_force_warning_errors=-Werror
;;
hpux*)
#
# HP C, which is what we presume we're using, doesn't
# exit with a non-zero exit status if we hand it an
# invalid -W flag, can't be forced to do so even with
# +We, and doesn't handle GCC-style -W flags, so we
# don't want to try using GCC-style -W flags.
#
ac_lbl_cc_dont_try_gcc_dashW=yes
;;
irix*)
$1="$$1 -xansi -signed -O"
#
# MIPS C, which is what we presume we're using, doesn't
# necessarily exit with a non-zero exit status if we
# hand it an invalid -W flag, can't be forced to do
# so, and doesn't handle GCC-style -W flags, so we
# don't want to try using GCC-style -W flags.
#
ac_lbl_cc_dont_try_gcc_dashW=yes
#
# It also, apparently, defaults to "char" being
# unsigned, unlike most other C implementations;
# I suppose we could say "signed char" whenever
# we want to guarantee a signed "char", but let's
# just force signed chars.
#
# -xansi is normally the default, but the
# configure script was setting it; perhaps -cckr
# was the default in the Old Days. (Then again,
# that would probably be for backwards compatibility
# in the days when ANSI C was Shiny and New, i.e.
# 1989 and the early '90's, so maybe we can just
# drop support for those compilers.)
#
# -g is equivalent to -g2, which turns off
# optimization; we choose -g3, which generates
# debugging information but doesn't turn off
# optimization (even if the optimization would
# cause inaccuracies in debugging).
#
$1="$$1 -xansi -signed -g3"
;;
osf*)
@ -180,7 +173,29 @@ AC_DEFUN(AC_LBL_C_INIT,
# Presumed to be DEC OSF/1, Digital UNIX, or
# Tru64 UNIX.
#
$1="$$1 -O"
# The DEC C compiler, which is what we presume we're
# using, doesn't exit with a non-zero exit status if we
# hand it an invalid -W flag, can't be forced to do
# so, and doesn't handle GCC-style -W flags, so we
# don't want to try using GCC-style -W flags.
#
ac_lbl_cc_dont_try_gcc_dashW=yes
#
# -g is equivalent to -g2, which turns off
# optimization; we choose -g3, which generates
# debugging information but doesn't turn off
# optimization (even if the optimization would
# cause inaccuracies in debugging).
#
$1="$$1 -g3"
;;
solaris*)
#
# Assumed to be Sun C, which requires -errwarn to force
# warnings to be treated as errors.
#
ac_lbl_cc_force_warning_errors=-errwarn
;;
ultrix*)
@ -199,9 +214,148 @@ AC_DEFUN(AC_LBL_C_INIT,
fi
;;
esac
$1="$$1 -O"
fi
])
dnl
dnl Check whether the compiler option specified as the second argument
dnl is supported by the compiler and, if so, add it to the macro
dnl specified as the first argument
dnl
AC_DEFUN(AC_LBL_CHECK_COMPILER_OPT,
[
AC_MSG_CHECKING([whether the compiler supports the $2 option])
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors $2"
AC_TRY_COMPILE(
[],
[return 0],
[
AC_MSG_RESULT([yes])
CFLAGS="$save_CFLAGS"
$1="$$1 $2"
],
[
AC_MSG_RESULT([no])
CFLAGS="$save_CFLAGS"
])
])
dnl
dnl Check whether the compiler supports an option to generate
dnl Makefile-style dependency lines
dnl
dnl GCC uses -M for this. Non-GCC compilers that support this
dnl use a variety of flags, including but not limited to -M.
dnl
dnl We test whether the flag in question is supported, as older
dnl versions of compilers might not support it.
dnl
dnl We don't try all the possible flags, just in case some flag means
dnl "generate dependencies" on one compiler but means something else
dnl on another compiler.
dnl
dnl Most compilers that support this send the output to the standard
dnl output by default. IBM's XLC, however, supports -M but sends
dnl the output to {sourcefile-basename}.u, and AIX has no /dev/stdout
dnl to work around that, so we don't bother with XLC.
dnl
AC_DEFUN(AC_LBL_CHECK_DEPENDENCY_GENERATION_OPT,
[
AC_MSG_CHECKING([whether the compiler supports generating dependencies])
if test "$GCC" = yes ; then
#
# GCC, or a compiler deemed to be GCC by AC_PROG_CC (even
# though it's not); we assume that, in this case, the flag
# would be -M.
#
ac_lbl_dependency_flag="-M"
else
#
# Not GCC or a compiler deemed to be GCC; what platform is
# this? (We're assuming that if the compiler isn't GCC
# it's the compiler from the vendor of the OS; that won't
# necessarily be true for x86 platforms, where it might be
# the Intel C compiler.)
#
case "$host_os" in
irix*|osf*|darwin*)
#
# MIPS C for IRIX, DEC C, and clang all use -M.
#
ac_lbl_dependency_flag="-M"
;;
solaris*)
#
# Sun C uses -xM.
#
ac_lbl_dependency_flag="-xM"
;;
hpux*)
#
# HP's older C compilers don't support this.
# HP's newer C compilers support this with
# either +M or +Make; the older compilers
# interpret +M as something completely
# different, so we use +Make so we don't
# think it works with the older compilers.
#
ac_lbl_dependency_flag="+Make"
;;
*)
#
# Not one of the above; assume no support for
# generating dependencies.
#
ac_lbl_dependency_flag=""
;;
esac
fi
#
# Is ac_lbl_dependency_flag defined and, if so, does the compiler
# complain about it?
#
# Note: clang doesn't seem to exit with an error status when handed
# an unknown non-warning error, even if you pass it
# -Werror=unknown-warning-option. However, it always supports
# -M, so the fact that this test always succeeds with clang
# isn't an issue.
#
if test ! -z "$ac_lbl_dependency_flag"; then
AC_LANG_CONFTEST(
[AC_LANG_SOURCE([[int main(void) { return 0; }]])])
echo "$CC" $ac_lbl_dependency_flag conftest.c >&5
if "$CC" $ac_lbl_dependency_flag conftest.c >/dev/null 2>&1; then
AC_MSG_RESULT([yes, with $ac_lbl_dependency_flag])
DEPENDENCY_CFLAG="$ac_lbl_dependency_flag"
MKDEP='${srcdir}/mkdep'
else
AC_MSG_RESULT([no])
#
# We can't run mkdep, so have "make depend" do
# nothing.
#
MKDEP=:
fi
rm -rf conftest*
else
AC_MSG_RESULT([no])
#
# We can't run mkdep, so have "make depend" do
# nothing.
#
MKDEP=:
fi
AC_SUBST(DEPENDENCY_CFLAG)
AC_SUBST(MKDEP)
])
#
# Try compiling a sample of the type of code that appears in
# gencode.c with "inline", "__inline__", and "__inline".
@ -289,7 +443,9 @@ AC_DEFUN(AC_LBL_LIBPCAP,
lastdir=FAIL
places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
for dir in $places $srcdir/../libpcap $srcdir/libpcap ; do
places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
egrep '/libpcap-[[0-9]]+\.[[0-9]]+(\.[[0-9]]*)?([[ab]][[0-9]]*|-PRE-GIT)?$'`
for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//' | \
sed -e 's/-PRE-GIT$//' `
if test $lastdir = $basedir ; then
@ -372,13 +528,23 @@ AC_DEFUN(AC_LBL_LIBPCAP,
$1=$libpcap
places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
pcapH=FAIL
if test -r $d/pcap.h; then
$2="-I$d $$2"
elif test -r $places/pcap.h; then
$2="-I$places $$2"
pcapH=$d
else
AC_MSG_ERROR(cannot find pcap.h, see INSTALL)
for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
if test -r $dir/pcap.h ; then
pcapH=$dir
fi
done
fi
if test $pcapH = FAIL ; then
AC_MSG_ERROR(cannot find pcap.h: see INSTALL)
fi
$2="-I$pcapH $$2"
AC_MSG_RESULT($libpcap)
AC_PATH_PROG(PCAP_CONFIG, pcap-config,, $d)
if test -n "$PCAP_CONFIG"; then
@ -461,17 +627,22 @@ reproduce this problem ourselves.])
dnl if they're not present.
dnl
AC_CHECK_FUNC(pcap_list_datalinks,
AC_DEFINE(HAVE_PCAP_LIST_DATALINKS),
[
AC_DEFINE(HAVE_PCAP_LIST_DATALINKS, 1,
[define if libpcap has pcap_list_datalinks()])
AC_CHECK_FUNCS(pcap_free_datalinks)
],
[
AC_LIBOBJ(datalinks)
])
AC_CHECK_FUNC(pcap_set_datalink,
AC_DEFINE(HAVE_PCAP_SET_DATALINK))
AC_CHECK_FUNCS(pcap_set_datalink)
AC_CHECK_FUNC(pcap_datalink_name_to_val,
[
AC_DEFINE(HAVE_PCAP_DATALINK_NAME_TO_VAL)
AC_DEFINE(HAVE_PCAP_DATALINK_NAME_TO_VAL, 1,
[define if libpcap has pcap_datalink_name_to_val()])
AC_CHECK_FUNC(pcap_datalink_val_to_description,
AC_DEFINE(HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION),
AC_DEFINE(HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION, 1,
[define if libpcap has pcap_datalink_val_to_description()]),
[
AC_LIBOBJ(dlnames)
])
@ -490,8 +661,10 @@ reproduce this problem ourselves.])
dnl
dnl Check for "pcap_dump_ftell()" and use a substitute version
dnl if it's not present.
dnl
AC_CHECK_FUNC(pcap_dump_ftell,
AC_DEFINE(HAVE_PCAP_DUMP_FTELL),
AC_DEFINE(HAVE_PCAP_DUMP_FTELL, 1,
[define if libpcap has pcap_dump_ftell()]),
[
AC_LIBOBJ(pcap_dump_ftell)
])
@ -659,16 +832,13 @@ AC_DEFUN(AC_LBL_CHECK_64BIT_FORMAT,
[[
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
# endif
# ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
# endif
#include <stdio.h>
#include <sys/types.h>
main()
{
u_int64_t t = 1;
uint64_t t = 1;
char strbuf[16+1];
sprintf(strbuf, "%016$1x", t << 32);
if (strcmp(strbuf, "0000000100000000") == 0)
@ -679,10 +849,10 @@ AC_DEFUN(AC_LBL_CHECK_64BIT_FORMAT,
]])
],
[
AC_DEFINE(PRId64, "$1d")
AC_DEFINE(PRIo64, "$1o")
AC_DEFINE(PRIx64, "$1x")
AC_DEFINE(PRIu64, "$1u")
AC_DEFINE(PRId64, "$1d", [define if the platform doesn't define PRId64])
AC_DEFINE(PRIo64, "$1o", [define if the platform doesn't define PRIo64])
AC_DEFINE(PRIx64, "$1x", [define if the platform doesn't define PRIu64])
AC_DEFINE(PRIu64, "$1u", [define if the platform doesn't define PRIx64])
AC_MSG_RESULT(yes)
],
[
@ -792,10 +962,8 @@ EOF
fi])
dnl
dnl If using gcc and the file .devel exists:
dnl Compile with -g (if supported) and -Wall
dnl If using gcc 2 or later, do extra prototype checking and some other
dnl checks
dnl If the file .devel exists:
dnl Add some warning flags if the compiler supports them
dnl If an os prototype include exists, symlink os-proto.h to it
dnl
dnl usage:
@ -814,27 +982,26 @@ AC_DEFUN(AC_LBL_DEVEL,
$1="$$1 ${LBL_CFLAGS}"
fi
if test -f .devel ; then
if test "$GCC" = yes ; then
if test "${LBL_CFLAGS+set}" != set; then
if test "$ac_cv_prog_cc_g" = yes ; then
$1="-g $$1"
fi
$1="$$1 -Wall"
if test $ac_cv_lbl_gcc_vers -gt 1 ; then
$1="$$1 -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wpointer-arith -W"
fi
fi
else
case "$host_os" in
irix6*)
V_CCOPT="$V_CCOPT -n32"
;;
*)
;;
esac
#
# Skip all the warning option stuff on some compilers.
#
if test "$ac_lbl_cc_dont_try_gcc_dashW" != yes; then
AC_LBL_CHECK_COMPILER_OPT($1, -Wall)
AC_LBL_CHECK_COMPILER_OPT($1, -Wmissing-prototypes)
AC_LBL_CHECK_COMPILER_OPT($1, -Wstrict-prototypes)
AC_LBL_CHECK_COMPILER_OPT($1, -Wwrite-strings)
AC_LBL_CHECK_COMPILER_OPT($1, -Wpointer-arith)
AC_LBL_CHECK_COMPILER_OPT($1, -W)
fi
AC_LBL_CHECK_DEPENDENCY_GENERATION_OPT()
#
# We used to set -n32 for IRIX 6 when not using GCC (presumed
# to mean that we're using MIPS C or MIPSpro C); it specified
# the "new" faster 32-bit ABI, introduced in IRIX 6.2. I'm
# not sure why that would be something to do *only* with a
# .devel file; why should the ABI for which we produce code
# depend on .devel?
#
os=`echo $host_os | sed -e 's/\([[0-9]][[0-9]]*\)[[^0-9]].*$/\1/'`
name="lbl/os-$os.h"
if test -f $name ; then
@ -977,7 +1144,7 @@ dnl documentation and/or other materials provided with the distribution.
dnl 3. Neither the name of the project nor the names of its contributors
dnl may be used to endorse or promote products derived from this software
dnl without specific prior written permission.
dnl
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
dnl ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@ -1037,9 +1204,11 @@ AC_DEFUN(AC_STRUCT_ADDRINFO, [
$1=no))
AC_MSG_RESULT($$1)
if test $$1 = yes; then
AC_DEFINE(HAVE_ADDRINFO)
AC_DEFINE(HAVE_ADDRINFO, 1,
[define if you have the addrinfo function])
else
AC_DEFINE(NEED_ADDRINFO_H)
AC_DEFINE(NEED_ADDRINFO_H, 1,
[define if you need to include missing/addrinfo.h])
fi
])
@ -1090,7 +1259,8 @@ AC_DEFUN(AC_STRUCT_SA_STORAGE, [
$1=no))
AC_MSG_RESULT($$1)
if test $$1 = yes; then
AC_DEFINE(HAVE_SOCKADDR_STORAGE)
AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1,
[define if you have struct sockaddr_storage])
fi
])
@ -1107,7 +1277,8 @@ AC_DEFUN(AC_VAR_H_ERRNO, [
ac_cv_var_h_errno=no))
AC_MSG_RESULT($ac_cv_var_h_errno)
if test "$ac_cv_var_h_errno" = "yes"; then
AC_DEFINE(HAVE_H_ERRNO)
AC_DEFINE(HAVE_H_ERRNO, 1,
[define if you have the h_errno variable])
fi
])
@ -1140,14 +1311,81 @@ ac_cv___attribute__=yes,
ac_cv___attribute__=no)])
if test "$ac_cv___attribute__" = "yes"; then
AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
V_DEFS="$V_DEFS -D_U_=\"__attribute__((unused))\""
else
#
# We can't use __attribute__, so we can't use __attribute__((unused)),
# so we define _U_ to an empty string.
#
V_DEFS="$V_DEFS -D_U_=\"\""
fi
AC_MSG_RESULT($ac_cv___attribute__)
])
dnl
dnl Test whether __attribute__((unused)) can be used without warnings
dnl
AC_DEFUN(AC_C___ATTRIBUTE___UNUSED, [
AC_MSG_CHECKING([whether __attribute__((unused)) can be used without warnings])
AC_CACHE_VAL(ac_cv___attribute___unused, [
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors"
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([[
#include <stdlib.h>
#include <stdio.h>
int
main(int argc __attribute((unused)), char **argv __attribute((unused)))
{
printf("Hello, world!\n");
return 0;
}
]])],
ac_cv___attribute___unused=yes,
ac_cv___attribute___unused=no)])
CFLAGS="$save_CFLAGS"
if test "$ac_cv___attribute___unused" = "yes"; then
V_DEFS="$V_DEFS -D_U_=\"__attribute__((unused))\""
else
V_DEFS="$V_DEFS -D_U_=\"\""
fi
AC_MSG_RESULT($ac_cv___attribute___unused)
])
dnl
dnl Test whether __attribute__((format)) can be used without warnings
dnl
AC_DEFUN(AC_C___ATTRIBUTE___FORMAT, [
AC_MSG_CHECKING([whether __attribute__((format)) can be used without warnings])
AC_CACHE_VAL(ac_cv___attribute___format, [
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors"
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([[
#include <stdlib.h>
extern int foo(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
int
main(int argc, char **argv)
{
foo("%s", "test");
}
]])],
ac_cv___attribute___format=yes,
ac_cv___attribute___format=no)])
CFLAGS="$save_CFLAGS"
if test "$ac_cv___attribute___format" = "yes"; then
AC_DEFINE(__ATTRIBUTE___FORMAT_OK, 1,
[define if your compiler allows __attribute__((format)) without a warning])
fi
AC_MSG_RESULT($ac_cv___attribute___format)
])
dnl
dnl Test whether __attribute__((format)) can be applied to function
dnl pointers
@ -1178,6 +1416,34 @@ fi
AC_MSG_RESULT($ac_cv___attribute___format_function_pointer)
])
AC_DEFUN(AC_C___ATTRIBUTE___NORETURN_FUNCTION_POINTER, [
AC_MSG_CHECKING([whether __attribute__((noreturn)) can be applied to function pointers without warnings])
AC_CACHE_VAL(ac_cv___attribute___noreturn_function_pointer, [
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $ac_lbl_cc_force_warning_errors"
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([[
#include <stdlib.h>
extern int (*foo)(int i)
__attribute__ ((noreturn));
int
main(int argc, char **argv)
{
(*foo)(1);
}
]])],
ac_cv___attribute___noreturn_function_pointer=yes,
ac_cv___attribute___noreturn_function_pointer=no)])
CFLAGS="$save_CFLAGS"
if test "$ac_cv___attribute___noreturn_function_pointer" = "yes"; then
AC_DEFINE(__ATTRIBUTE___NORETURN_OK_FOR_FUNCTION_POINTERS, 1,
[define if your compiler allows __attribute__((noreturn)) to be applied to function pointers])
fi
AC_MSG_RESULT($ac_cv___attribute___noreturn_function_pointer)
])
AC_DEFUN(AC_LBL_SSLEAY,
[
#

View File

@ -21,11 +21,8 @@
* Internet, ethernet, port, and protocol string to address
* and address to string conversion routines
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.119 2007-08-08 14:06:34 hannes Exp $ (LBL)";
#endif
#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@ -81,7 +78,7 @@ extern int ether_ntohost(char *, const struct ether_addr *);
#define HASHNAMESIZE 4096
struct hnamemem {
u_int32_t addr;
uint32_t addr;
const char *name;
struct hnamemem *nxt;
};
@ -158,7 +155,7 @@ static struct enamemem nsaptable[HASHNAMESIZE];
static struct enamemem bytestringtable[HASHNAMESIZE];
struct protoidmem {
u_int32_t p_oui;
uint32_t p_oui;
u_short p_proto;
const char *p_name;
struct protoidmem *p_nxt;
@ -170,7 +167,7 @@ static struct protoidmem protoidtable[HASHNAMESIZE];
* A faster replacement for inet_ntoa().
*/
const char *
intoa(u_int32_t addr)
intoa(uint32_t addr)
{
register char *cp;
register u_int byte;
@ -199,8 +196,8 @@ intoa(u_int32_t addr)
return cp + 1;
}
static u_int32_t f_netmask;
static u_int32_t f_localnet;
static uint32_t f_netmask;
static uint32_t f_localnet;
/*
* Return a name for the IP address pointed to by ap. This address
@ -222,10 +219,10 @@ static u_int32_t f_localnet;
* also needs to check whether they're present in the packet buffer.
*/
const char *
getname(const u_char *ap)
getname(netdissect_options *ndo, const u_char *ap)
{
register struct hostent *hp;
u_int32_t addr;
uint32_t addr;
static struct hnamemem *p; /* static for longjmp() */
memcpy(&addr, ap, sizeof(addr));
@ -244,14 +241,14 @@ getname(const u_char *ap)
* given, f_netmask and f_localnet are 0 and the test
* evaluates to true)
*/
if (!nflag &&
if (!ndo->ndo_nflag &&
(addr & f_netmask) == f_localnet) {
hp = gethostbyaddr((char *)&addr, 4, AF_INET);
if (hp) {
char *dotp;
p->name = strdup(hp->h_name);
if (Nflag) {
if (ndo->ndo_Nflag) {
/* Remove domain qualifications */
dotp = strchr(p->name, '.');
if (dotp)
@ -270,33 +267,39 @@ getname(const u_char *ap)
* is assumed to be in network byte order.
*/
const char *
getname6(const u_char *ap)
getname6(netdissect_options *ndo, const u_char *ap)
{
register struct hostent *hp;
struct in6_addr addr;
union {
struct in6_addr addr;
struct for_hash_addr {
char fill[14];
uint16_t d;
} addra;
} addr;
static struct h6namemem *p; /* static for longjmp() */
register const char *cp;
char ntop_buf[INET6_ADDRSTRLEN];
memcpy(&addr, ap, sizeof(addr));
p = &h6nametable[*(u_int16_t *)&addr.s6_addr[14] & (HASHNAMESIZE-1)];
p = &h6nametable[addr.addra.d & (HASHNAMESIZE-1)];
for (; p->nxt; p = p->nxt) {
if (memcmp(&p->addr, &addr, sizeof(addr)) == 0)
return (p->name);
}
p->addr = addr;
p->addr = addr.addr;
p->nxt = newh6namemem();
/*
* Do not print names if -n was given.
*/
if (!nflag) {
if (!ndo->ndo_nflag) {
hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET6);
if (hp) {
char *dotp;
p->name = strdup(hp->h_name);
if (Nflag) {
if (ndo->ndo_Nflag) {
/* Remove domain qualifications */
dotp = strchr(p->name, '.');
if (dotp)
@ -464,7 +467,7 @@ lookup_protoid(const u_char *pi)
}
const char *
etheraddr_string(register const u_char *ep)
etheraddr_string(netdissect_options *ndo, register const u_char *ep)
{
register int i;
register char *cp;
@ -476,7 +479,7 @@ etheraddr_string(register const u_char *ep)
if (tp->e_name)
return (tp->e_name);
#ifdef USE_ETHER_NTOHOST
if (!nflag) {
if (!ndo->ndo_nflag) {
char buf2[BUFSIZE];
/*
@ -501,7 +504,7 @@ etheraddr_string(register const u_char *ep)
*cp++ = hex[*ep++ & 0xf];
}
if (!nflag) {
if (!ndo->ndo_nflag) {
snprintf(cp, BUFSIZE - (2 + 5*3), " (oui %s)",
tok2str(oui_values, "Unknown", oui));
} else
@ -539,7 +542,7 @@ le64addr_string(const u_char *ep)
}
const char *
linkaddr_string(const u_char *ep, const unsigned int type, const unsigned int len)
linkaddr_string(netdissect_options *ndo, const u_char *ep, const unsigned int type, const unsigned int len)
{
register u_int i;
register char *cp;
@ -549,7 +552,7 @@ linkaddr_string(const u_char *ep, const unsigned int type, const unsigned int le
return ("<empty>");
if (type == LINKADDR_ETHER && len == ETHER_ADDR_LEN)
return (etheraddr_string(ep));
return (etheraddr_string(ndo, ep));
if (type == LINKADDR_FRELAY)
return (q922_string(ep));
@ -577,7 +580,7 @@ etherproto_string(u_short port)
{
register char *cp;
register struct hnamemem *tp;
register u_int32_t i = port;
register uint32_t i = port;
char buf[sizeof("0000")];
for (tp = &eprototable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt)
@ -660,7 +663,7 @@ const char *
tcpport_string(u_short port)
{
register struct hnamemem *tp;
register u_int32_t i = port;
register uint32_t i = port;
char buf[sizeof("00000")];
for (tp = &tporttable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt)
@ -679,7 +682,7 @@ const char *
udpport_string(register u_short port)
{
register struct hnamemem *tp;
register u_int32_t i = port;
register uint32_t i = port;
char buf[sizeof("00000")];
for (tp = &uporttable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt)
@ -699,7 +702,7 @@ ipxsap_string(u_short port)
{
register char *cp;
register struct hnamemem *tp;
register u_int32_t i = port;
register uint32_t i = port;
char buf[sizeof("0000")];
for (tp = &ipxsaptable[i & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt)
@ -721,7 +724,7 @@ ipxsap_string(u_short port)
}
static void
init_servarray(void)
init_servarray(netdissect_options *ndo)
{
struct servent *sv;
register struct hnamemem *table;
@ -740,7 +743,7 @@ init_servarray(void)
while (table->name)
table = table->nxt;
if (nflag) {
if (ndo->ndo_nflag) {
(void)snprintf(buf, sizeof(buf), "%d", port);
table->name = strdup(buf);
} else
@ -753,7 +756,7 @@ init_servarray(void)
/* in libpcap.a (nametoaddr.c) */
#if defined(WIN32) && !defined(USE_STATIC_LIBPCAP)
__declspec(dllimport)
extern __declspec(dllimport)
#else
extern
#endif
@ -1129,32 +1132,32 @@ init_ipxsaparray(void)
/*
* Initialize the address to name translation machinery. We map all
* non-local IP addresses to numeric addresses if fflag is true (i.e.,
* to prevent blocking on the nameserver). localnet is the IP address
* non-local IP addresses to numeric addresses if ndo->ndo_fflag is true
* (i.e., to prevent blocking on the nameserver). localnet is the IP address
* of the local network. mask is its subnet mask.
*/
void
init_addrtoname(u_int32_t localnet, u_int32_t mask)
init_addrtoname(netdissect_options *ndo, uint32_t localnet, uint32_t mask)
{
if (fflag) {
if (ndo->ndo_fflag) {
f_localnet = localnet;
f_netmask = mask;
}
if (nflag)
if (ndo->ndo_nflag)
/*
* Simplest way to suppress names.
*/
return;
init_etherarray();
init_servarray();
init_servarray(ndo);
init_eprotoarray();
init_protoidarray();
init_ipxsaparray();
}
const char *
dnaddr_string(u_short dnaddr)
dnaddr_string(netdissect_options *ndo, u_short dnaddr)
{
register struct hnamemem *tp;
@ -1165,7 +1168,7 @@ dnaddr_string(u_short dnaddr)
tp->addr = dnaddr;
tp->nxt = newhnamemem();
if (nflag)
if (ndo->ndo_nflag)
tp->name = dnnum_string(dnaddr);
else
tp->name = dnname_string(dnaddr);

View File

@ -17,8 +17,6 @@
* 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/addrtoname.h,v 1.20 2007-08-08 14:06:34 hannes Exp $ (LBL)
*/
/* Name to address translation routines. */
@ -32,25 +30,29 @@ enum {
#define BUFSIZE 128
extern const char *linkaddr_string(const u_char *, const unsigned int, const unsigned int);
extern const char *etheraddr_string(const u_char *);
extern const char *linkaddr_string(netdissect_options *, const u_char *, const unsigned int, const unsigned int);
extern const char *etheraddr_string(netdissect_options *, const u_char *);
extern const char *le64addr_string(const u_char *);
extern const char *etherproto_string(u_short);
extern const char *tcpport_string(u_short);
extern const char *udpport_string(u_short);
extern const char *getname(const u_char *);
extern const char *isonsap_string(const u_char *, register u_int);
extern const char *dnaddr_string(netdissect_options *, u_short);
extern const char *protoid_string(const u_char *);
extern const char *ipxsap_string(u_short);
extern const char *getname(netdissect_options *, const u_char *);
#ifdef INET6
extern const char *getname6(const u_char *);
extern const char *getname6(netdissect_options *, const u_char *);
#endif
extern const char *intoa(u_int32_t);
extern const char *intoa(uint32_t);
extern void init_addrtoname(u_int32_t, u_int32_t);
extern void init_addrtoname(netdissect_options *, uint32_t, uint32_t);
extern struct hnamemem *newhnamemem(void);
#ifdef INET6
extern struct h6namemem *newh6namemem(void);
#endif
#define ipaddr_string(p) getname((const u_char *)(p))
#define ipaddr_string(ndo, p) getname(ndo, (const u_char *)(p))
#ifdef INET6
#define ip6addr_string(p) getname6((const u_char *)(p))
#define ip6addr_string(ndo, p) getname6(ndo, (const u_char *)(p))
#endif

6
af.c
View File

@ -15,11 +15,7 @@
* Original code by Hannes Gredler (hannes@juniper.net)
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/af.c,v 1.3 2006-03-23 14:58:44 hannes Exp $ (LBL)";
#endif
#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

2
af.h
View File

@ -1,5 +1,3 @@
/* @(#) $Header: /tcpdump/master/tcpdump/af.h,v 1.3 2006-03-23 14:58:44 hannes Exp $ (LBL) */
/*
* Copyright (c) 1998-2006 The TCPDUMP project
*

18
ah.h
View File

@ -38,19 +38,19 @@
#define _NETINET6_AH_H_
struct ah {
u_int8_t ah_nxt; /* Next Header */
u_int8_t ah_len; /* Length of data, in 32bit */
u_int16_t ah_reserve; /* Reserved for future use */
u_int32_t ah_spi; /* Security parameter index */
uint8_t ah_nxt; /* Next Header */
uint8_t ah_len; /* Length of data, in 32bit */
uint16_t ah_reserve; /* Reserved for future use */
uint32_t ah_spi; /* Security parameter index */
/* variable size, 32bit bound*/ /* Authentication data */
};
struct newah {
u_int8_t ah_nxt; /* Next Header */
u_int8_t ah_len; /* Length of data + 1, in 32bit */
u_int16_t ah_reserve; /* Reserved for future use */
u_int32_t ah_spi; /* Security parameter index */
u_int32_t ah_seq; /* Sequence number field */
uint8_t ah_nxt; /* Next Header */
uint8_t ah_len; /* Length of data + 1, in 32bit */
uint16_t ah_reserve; /* Reserved for future use */
uint32_t ah_spi; /* Security parameter index */
uint32_t ah_seq; /* Sequence number field */
/* variable size, 32bit bound*/ /* Authentication data */
};

190
aodv.h
View File

@ -1,190 +0,0 @@
/* @(#) $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

@ -19,14 +19,12 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* AppleTalk protocol formats (courtesy Bill Croft of Stanford/SUMEX).
*
* @(#) $Header: /tcpdump/master/tcpdump/appletalk.h,v 1.16 2004-05-01 09:41:50 hannes Exp $ (LBL)
*/
struct LAP {
u_int8_t dst;
u_int8_t src;
u_int8_t type;
uint8_t dst;
uint8_t src;
uint8_t type;
};
#define lapShortDDP 1 /* short DDP type */
#define lapDDP 2 /* DDP type */
@ -35,22 +33,22 @@ struct LAP {
/* Datagram Delivery Protocol */
struct atDDP {
u_int16_t length;
u_int16_t checksum;
u_int16_t dstNet;
u_int16_t srcNet;
u_int8_t dstNode;
u_int8_t srcNode;
u_int8_t dstSkt;
u_int8_t srcSkt;
u_int8_t type;
uint16_t length;
uint16_t checksum;
uint16_t dstNet;
uint16_t srcNet;
uint8_t dstNode;
uint8_t srcNode;
uint8_t dstSkt;
uint8_t srcSkt;
uint8_t type;
};
struct atShortDDP {
u_int16_t length;
u_int8_t dstSkt;
u_int8_t srcSkt;
u_int8_t type;
uint16_t length;
uint8_t dstSkt;
uint8_t srcSkt;
uint8_t type;
};
#define ddpMaxWKS 0x7F
@ -74,10 +72,10 @@ struct atShortDDP {
/* AppleTalk Transaction Protocol */
struct atATP {
u_int8_t control;
u_int8_t bitmap;
u_int16_t transID;
int32_t userData;
uint8_t control;
uint8_t bitmap;
uint16_t transID;
int32_t userData;
};
#define atpReqCode 0x40
@ -95,8 +93,8 @@ struct atATP {
/* AppleTalk Echo Protocol */
struct atEcho {
u_int8_t echoFunction;
u_int8_t *echoData;
uint8_t echoFunction;
uint8_t *echoData;
};
#define echoSkt 4 /* the echoer socket */
@ -108,15 +106,15 @@ struct atEcho {
/* Name Binding Protocol */
struct atNBP {
u_int8_t control;
u_int8_t id;
uint8_t control;
uint8_t id;
};
struct atNBPtuple {
u_int16_t net;
u_int8_t node;
u_int8_t skt;
u_int8_t enumerator;
uint16_t net;
uint8_t node;
uint8_t skt;
uint8_t enumerator;
};
#define nbpBrRq 0x10
@ -142,8 +140,8 @@ struct atNBPtuple {
/* Zone Information Protocol */
struct zipHeader {
u_int8_t command;
u_int8_t netcount;
uint8_t command;
uint8_t netcount;
};
#define zipHeaderSize 2

101
arcnet.h
View File

@ -1,101 +0,0 @@
/*
* Copyright (c) 1982, 1986, 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.
*
* @(#) $Id: arcnet.h,v 1.3 2003-01-23 09:05:37 guy Exp $ (LBL)
*
* from: NetBSD: if_arc.h,v 1.13 1999/11/19 20:41:19 thorpej Exp
*/
/*
* Structure of a 2.5MB/s Arcnet header on the BSDs,
* as given to interface code.
*/
struct arc_header {
u_int8_t arc_shost;
u_int8_t arc_dhost;
u_int8_t arc_type;
/*
* only present for newstyle encoding with LL fragmentation.
* Don't use sizeof(anything), use ARC_HDR{,NEW}LEN instead.
*/
u_int8_t arc_flag;
u_int16_t arc_seqid;
/*
* only present in exception packets (arc_flag == 0xff)
*/
u_int8_t arc_type2; /* same as arc_type */
u_int8_t arc_flag2; /* real flag value */
u_int16_t arc_seqid2; /* real seqid value */
};
#define ARC_HDRLEN 3
#define ARC_HDRNEWLEN 6
#define ARC_HDRNEWLEN_EXC 10
/* RFC 1051 */
#define ARCTYPE_IP_OLD 240 /* IP protocol */
#define ARCTYPE_ARP_OLD 241 /* address resolution protocol */
/* RFC 1201 */
#define ARCTYPE_IP 212 /* IP protocol */
#define ARCTYPE_ARP 213 /* address resolution protocol */
#define ARCTYPE_REVARP 214 /* reverse addr resolution protocol */
#define ARCTYPE_ATALK 221 /* Appletalk */
#define ARCTYPE_BANIAN 247 /* Banyan Vines */
#define ARCTYPE_IPX 250 /* Novell IPX */
#define ARCTYPE_INET6 0xc4 /* IPng */
#define ARCTYPE_DIAGNOSE 0x80 /* as per ANSI/ATA 878.1 */
/*
* Structure of a 2.5MB/s Arcnet header on Linux. Linux has
* an extra "offset" field when given to interface code, and
* never presents packets that look like exception frames.
*/
struct arc_linux_header {
u_int8_t arc_shost;
u_int8_t arc_dhost;
u_int16_t arc_offset;
u_int8_t arc_type;
/*
* only present for newstyle encoding with LL fragmentation.
* Don't use sizeof(anything), use ARC_LINUX_HDR{,NEW}LEN
* instead.
*/
u_int8_t arc_flag;
u_int16_t arc_seqid;
};
#define ARC_LINUX_HDRLEN 5
#define ARC_LINUX_HDRNEWLEN 8

2
atm.h
View File

@ -13,8 +13,6 @@
* 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.3 2006-02-08 01:43:00 hannes Exp $
*/
/*

View File

@ -28,8 +28,6 @@
* 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.3 2007-10-22 19:37:51 guy Exp $ (LBL)
*/
/* Based on UNI3.1 standard by ATM Forum */

17
bgp.h
View File

@ -1,17 +0,0 @@
/* @(#) $Header: /tcpdump/master/tcpdump/bgp.h,v 1.3 2004-06-16 08:45:15 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 char *bgp_vpn_rd_print (const u_char *);

257
bootp.h
View File

@ -1,4 +1,3 @@
/* @(#) $Header: /tcpdump/master/tcpdump/bootp.h,v 1.19 2008-04-22 09:46:03 hannes Exp $ (LBL) */
/*
* Bootstrap Protocol (BOOTP). RFC951 and RFC1048.
*
@ -21,22 +20,22 @@
struct bootp {
u_int8_t bp_op; /* packet opcode type */
u_int8_t bp_htype; /* hardware addr type */
u_int8_t bp_hlen; /* hardware addr length */
u_int8_t bp_hops; /* gateway hops */
u_int32_t bp_xid; /* transaction ID */
u_int16_t bp_secs; /* seconds since boot began */
u_int16_t bp_flags; /* flags - see bootp_flag_values[]
uint8_t bp_op; /* packet opcode type */
uint8_t bp_htype; /* hardware addr type */
uint8_t bp_hlen; /* hardware addr length */
uint8_t bp_hops; /* gateway hops */
uint32_t bp_xid; /* transaction ID */
uint16_t bp_secs; /* seconds since boot began */
uint16_t bp_flags; /* flags - see bootp_flag_values[]
in print-bootp.c */
struct in_addr bp_ciaddr; /* client IP address */
struct in_addr bp_yiaddr; /* 'your' IP address */
struct in_addr bp_siaddr; /* server IP address */
struct in_addr bp_giaddr; /* gateway IP address */
u_int8_t bp_chaddr[16]; /* client hardware address */
u_int8_t bp_sname[64]; /* server host name */
u_int8_t bp_file[128]; /* boot file name */
u_int8_t bp_vend[64]; /* vendor-specific area */
uint8_t bp_chaddr[16]; /* client hardware address */
uint8_t bp_sname[64]; /* server host name */
uint8_t bp_file[128]; /* boot file name */
uint8_t bp_vend[64]; /* vendor-specific area */
} UNALIGNED;
/*
@ -65,132 +64,132 @@ struct bootp {
* the vendor field of the packet.
*/
#define TAG_PAD ((u_int8_t) 0)
#define TAG_SUBNET_MASK ((u_int8_t) 1)
#define TAG_TIME_OFFSET ((u_int8_t) 2)
#define TAG_GATEWAY ((u_int8_t) 3)
#define TAG_TIME_SERVER ((u_int8_t) 4)
#define TAG_NAME_SERVER ((u_int8_t) 5)
#define TAG_DOMAIN_SERVER ((u_int8_t) 6)
#define TAG_LOG_SERVER ((u_int8_t) 7)
#define TAG_COOKIE_SERVER ((u_int8_t) 8)
#define TAG_LPR_SERVER ((u_int8_t) 9)
#define TAG_IMPRESS_SERVER ((u_int8_t) 10)
#define TAG_RLP_SERVER ((u_int8_t) 11)
#define TAG_HOSTNAME ((u_int8_t) 12)
#define TAG_BOOTSIZE ((u_int8_t) 13)
#define TAG_END ((u_int8_t) 255)
#define TAG_PAD ((uint8_t) 0)
#define TAG_SUBNET_MASK ((uint8_t) 1)
#define TAG_TIME_OFFSET ((uint8_t) 2)
#define TAG_GATEWAY ((uint8_t) 3)
#define TAG_TIME_SERVER ((uint8_t) 4)
#define TAG_NAME_SERVER ((uint8_t) 5)
#define TAG_DOMAIN_SERVER ((uint8_t) 6)
#define TAG_LOG_SERVER ((uint8_t) 7)
#define TAG_COOKIE_SERVER ((uint8_t) 8)
#define TAG_LPR_SERVER ((uint8_t) 9)
#define TAG_IMPRESS_SERVER ((uint8_t) 10)
#define TAG_RLP_SERVER ((uint8_t) 11)
#define TAG_HOSTNAME ((uint8_t) 12)
#define TAG_BOOTSIZE ((uint8_t) 13)
#define TAG_END ((uint8_t) 255)
/* RFC1497 tags */
#define TAG_DUMPPATH ((u_int8_t) 14)
#define TAG_DOMAINNAME ((u_int8_t) 15)
#define TAG_SWAP_SERVER ((u_int8_t) 16)
#define TAG_ROOTPATH ((u_int8_t) 17)
#define TAG_EXTPATH ((u_int8_t) 18)
#define TAG_DUMPPATH ((uint8_t) 14)
#define TAG_DOMAINNAME ((uint8_t) 15)
#define TAG_SWAP_SERVER ((uint8_t) 16)
#define TAG_ROOTPATH ((uint8_t) 17)
#define TAG_EXTPATH ((uint8_t) 18)
/* RFC2132 */
#define TAG_IP_FORWARD ((u_int8_t) 19)
#define TAG_NL_SRCRT ((u_int8_t) 20)
#define TAG_PFILTERS ((u_int8_t) 21)
#define TAG_REASS_SIZE ((u_int8_t) 22)
#define TAG_DEF_TTL ((u_int8_t) 23)
#define TAG_MTU_TIMEOUT ((u_int8_t) 24)
#define TAG_MTU_TABLE ((u_int8_t) 25)
#define TAG_INT_MTU ((u_int8_t) 26)
#define TAG_LOCAL_SUBNETS ((u_int8_t) 27)
#define TAG_BROAD_ADDR ((u_int8_t) 28)
#define TAG_DO_MASK_DISC ((u_int8_t) 29)
#define TAG_SUPPLY_MASK ((u_int8_t) 30)
#define TAG_DO_RDISC ((u_int8_t) 31)
#define TAG_RTR_SOL_ADDR ((u_int8_t) 32)
#define TAG_STATIC_ROUTE ((u_int8_t) 33)
#define TAG_USE_TRAILERS ((u_int8_t) 34)
#define TAG_ARP_TIMEOUT ((u_int8_t) 35)
#define TAG_ETH_ENCAP ((u_int8_t) 36)
#define TAG_TCP_TTL ((u_int8_t) 37)
#define TAG_TCP_KEEPALIVE ((u_int8_t) 38)
#define TAG_KEEPALIVE_GO ((u_int8_t) 39)
#define TAG_NIS_DOMAIN ((u_int8_t) 40)
#define TAG_NIS_SERVERS ((u_int8_t) 41)
#define TAG_NTP_SERVERS ((u_int8_t) 42)
#define TAG_VENDOR_OPTS ((u_int8_t) 43)
#define TAG_NETBIOS_NS ((u_int8_t) 44)
#define TAG_NETBIOS_DDS ((u_int8_t) 45)
#define TAG_NETBIOS_NODE ((u_int8_t) 46)
#define TAG_NETBIOS_SCOPE ((u_int8_t) 47)
#define TAG_XWIN_FS ((u_int8_t) 48)
#define TAG_XWIN_DM ((u_int8_t) 49)
#define TAG_NIS_P_DOMAIN ((u_int8_t) 64)
#define TAG_NIS_P_SERVERS ((u_int8_t) 65)
#define TAG_MOBILE_HOME ((u_int8_t) 68)
#define TAG_SMPT_SERVER ((u_int8_t) 69)
#define TAG_POP3_SERVER ((u_int8_t) 70)
#define TAG_NNTP_SERVER ((u_int8_t) 71)
#define TAG_WWW_SERVER ((u_int8_t) 72)
#define TAG_FINGER_SERVER ((u_int8_t) 73)
#define TAG_IRC_SERVER ((u_int8_t) 74)
#define TAG_STREETTALK_SRVR ((u_int8_t) 75)
#define TAG_STREETTALK_STDA ((u_int8_t) 76)
#define TAG_IP_FORWARD ((uint8_t) 19)
#define TAG_NL_SRCRT ((uint8_t) 20)
#define TAG_PFILTERS ((uint8_t) 21)
#define TAG_REASS_SIZE ((uint8_t) 22)
#define TAG_DEF_TTL ((uint8_t) 23)
#define TAG_MTU_TIMEOUT ((uint8_t) 24)
#define TAG_MTU_TABLE ((uint8_t) 25)
#define TAG_INT_MTU ((uint8_t) 26)
#define TAG_LOCAL_SUBNETS ((uint8_t) 27)
#define TAG_BROAD_ADDR ((uint8_t) 28)
#define TAG_DO_MASK_DISC ((uint8_t) 29)
#define TAG_SUPPLY_MASK ((uint8_t) 30)
#define TAG_DO_RDISC ((uint8_t) 31)
#define TAG_RTR_SOL_ADDR ((uint8_t) 32)
#define TAG_STATIC_ROUTE ((uint8_t) 33)
#define TAG_USE_TRAILERS ((uint8_t) 34)
#define TAG_ARP_TIMEOUT ((uint8_t) 35)
#define TAG_ETH_ENCAP ((uint8_t) 36)
#define TAG_TCP_TTL ((uint8_t) 37)
#define TAG_TCP_KEEPALIVE ((uint8_t) 38)
#define TAG_KEEPALIVE_GO ((uint8_t) 39)
#define TAG_NIS_DOMAIN ((uint8_t) 40)
#define TAG_NIS_SERVERS ((uint8_t) 41)
#define TAG_NTP_SERVERS ((uint8_t) 42)
#define TAG_VENDOR_OPTS ((uint8_t) 43)
#define TAG_NETBIOS_NS ((uint8_t) 44)
#define TAG_NETBIOS_DDS ((uint8_t) 45)
#define TAG_NETBIOS_NODE ((uint8_t) 46)
#define TAG_NETBIOS_SCOPE ((uint8_t) 47)
#define TAG_XWIN_FS ((uint8_t) 48)
#define TAG_XWIN_DM ((uint8_t) 49)
#define TAG_NIS_P_DOMAIN ((uint8_t) 64)
#define TAG_NIS_P_SERVERS ((uint8_t) 65)
#define TAG_MOBILE_HOME ((uint8_t) 68)
#define TAG_SMPT_SERVER ((uint8_t) 69)
#define TAG_POP3_SERVER ((uint8_t) 70)
#define TAG_NNTP_SERVER ((uint8_t) 71)
#define TAG_WWW_SERVER ((uint8_t) 72)
#define TAG_FINGER_SERVER ((uint8_t) 73)
#define TAG_IRC_SERVER ((uint8_t) 74)
#define TAG_STREETTALK_SRVR ((uint8_t) 75)
#define TAG_STREETTALK_STDA ((uint8_t) 76)
/* DHCP options */
#define TAG_REQUESTED_IP ((u_int8_t) 50)
#define TAG_IP_LEASE ((u_int8_t) 51)
#define TAG_OPT_OVERLOAD ((u_int8_t) 52)
#define TAG_TFTP_SERVER ((u_int8_t) 66)
#define TAG_BOOTFILENAME ((u_int8_t) 67)
#define TAG_DHCP_MESSAGE ((u_int8_t) 53)
#define TAG_SERVER_ID ((u_int8_t) 54)
#define TAG_PARM_REQUEST ((u_int8_t) 55)
#define TAG_MESSAGE ((u_int8_t) 56)
#define TAG_MAX_MSG_SIZE ((u_int8_t) 57)
#define TAG_RENEWAL_TIME ((u_int8_t) 58)
#define TAG_REBIND_TIME ((u_int8_t) 59)
#define TAG_VENDOR_CLASS ((u_int8_t) 60)
#define TAG_CLIENT_ID ((u_int8_t) 61)
#define TAG_REQUESTED_IP ((uint8_t) 50)
#define TAG_IP_LEASE ((uint8_t) 51)
#define TAG_OPT_OVERLOAD ((uint8_t) 52)
#define TAG_TFTP_SERVER ((uint8_t) 66)
#define TAG_BOOTFILENAME ((uint8_t) 67)
#define TAG_DHCP_MESSAGE ((uint8_t) 53)
#define TAG_SERVER_ID ((uint8_t) 54)
#define TAG_PARM_REQUEST ((uint8_t) 55)
#define TAG_MESSAGE ((uint8_t) 56)
#define TAG_MAX_MSG_SIZE ((uint8_t) 57)
#define TAG_RENEWAL_TIME ((uint8_t) 58)
#define TAG_REBIND_TIME ((uint8_t) 59)
#define TAG_VENDOR_CLASS ((uint8_t) 60)
#define TAG_CLIENT_ID ((uint8_t) 61)
/* RFC 2241 */
#define TAG_NDS_SERVERS ((u_int8_t) 85)
#define TAG_NDS_TREE_NAME ((u_int8_t) 86)
#define TAG_NDS_CONTEXT ((u_int8_t) 87)
#define TAG_NDS_SERVERS ((uint8_t) 85)
#define TAG_NDS_TREE_NAME ((uint8_t) 86)
#define TAG_NDS_CONTEXT ((uint8_t) 87)
/* RFC 2242 */
#define TAG_NDS_IPDOMAIN ((u_int8_t) 62)
#define TAG_NDS_IPINFO ((u_int8_t) 63)
#define TAG_NDS_IPDOMAIN ((uint8_t) 62)
#define TAG_NDS_IPINFO ((uint8_t) 63)
/* RFC 2485 */
#define TAG_OPEN_GROUP_UAP ((u_int8_t) 98)
#define TAG_OPEN_GROUP_UAP ((uint8_t) 98)
/* RFC 2563 */
#define TAG_DISABLE_AUTOCONF ((u_int8_t) 116)
#define TAG_DISABLE_AUTOCONF ((uint8_t) 116)
/* RFC 2610 */
#define TAG_SLP_DA ((u_int8_t) 78)
#define TAG_SLP_SCOPE ((u_int8_t) 79)
#define TAG_SLP_DA ((uint8_t) 78)
#define TAG_SLP_SCOPE ((uint8_t) 79)
/* RFC 2937 */
#define TAG_NS_SEARCH ((u_int8_t) 117)
#define TAG_NS_SEARCH ((uint8_t) 117)
/* RFC 3011 */
#define TAG_IP4_SUBNET_SELECT ((u_int8_t) 118)
#define TAG_IP4_SUBNET_SELECT ((uint8_t) 118)
/* RFC 3442 */
#define TAG_CLASSLESS_STATIC_RT ((u_int8_t) 121)
#define TAG_CLASSLESS_STA_RT_MS ((u_int8_t) 249)
#define TAG_CLASSLESS_STATIC_RT ((uint8_t) 121)
#define TAG_CLASSLESS_STA_RT_MS ((uint8_t) 249)
/* ftp://ftp.isi.edu/.../assignments/bootp-dhcp-extensions */
#define TAG_USER_CLASS ((u_int8_t) 77)
#define TAG_SLP_NAMING_AUTH ((u_int8_t) 80)
#define TAG_CLIENT_FQDN ((u_int8_t) 81)
#define TAG_AGENT_CIRCUIT ((u_int8_t) 82)
#define TAG_AGENT_REMOTE ((u_int8_t) 83)
#define TAG_AGENT_MASK ((u_int8_t) 84)
#define TAG_TZ_STRING ((u_int8_t) 88)
#define TAG_FQDN_OPTION ((u_int8_t) 89)
#define TAG_AUTH ((u_int8_t) 90)
#define TAG_VINES_SERVERS ((u_int8_t) 91)
#define TAG_SERVER_RANK ((u_int8_t) 92)
#define TAG_CLIENT_ARCH ((u_int8_t) 93)
#define TAG_CLIENT_NDI ((u_int8_t) 94)
#define TAG_CLIENT_GUID ((u_int8_t) 97)
#define TAG_LDAP_URL ((u_int8_t) 95)
#define TAG_6OVER4 ((u_int8_t) 96)
#define TAG_PRINTER_NAME ((u_int8_t) 100)
#define TAG_MDHCP_SERVER ((u_int8_t) 101)
#define TAG_IPX_COMPAT ((u_int8_t) 110)
#define TAG_NETINFO_PARENT ((u_int8_t) 112)
#define TAG_NETINFO_PARENT_TAG ((u_int8_t) 113)
#define TAG_URL ((u_int8_t) 114)
#define TAG_FAILOVER ((u_int8_t) 115)
#define TAG_EXTENDED_REQUEST ((u_int8_t) 126)
#define TAG_EXTENDED_OPTION ((u_int8_t) 127)
#define TAG_USER_CLASS ((uint8_t) 77)
#define TAG_SLP_NAMING_AUTH ((uint8_t) 80)
#define TAG_CLIENT_FQDN ((uint8_t) 81)
#define TAG_AGENT_CIRCUIT ((uint8_t) 82)
#define TAG_AGENT_REMOTE ((uint8_t) 83)
#define TAG_AGENT_MASK ((uint8_t) 84)
#define TAG_TZ_STRING ((uint8_t) 88)
#define TAG_FQDN_OPTION ((uint8_t) 89)
#define TAG_AUTH ((uint8_t) 90)
#define TAG_VINES_SERVERS ((uint8_t) 91)
#define TAG_SERVER_RANK ((uint8_t) 92)
#define TAG_CLIENT_ARCH ((uint8_t) 93)
#define TAG_CLIENT_NDI ((uint8_t) 94)
#define TAG_CLIENT_GUID ((uint8_t) 97)
#define TAG_LDAP_URL ((uint8_t) 95)
#define TAG_6OVER4 ((uint8_t) 96)
#define TAG_PRINTER_NAME ((uint8_t) 100)
#define TAG_MDHCP_SERVER ((uint8_t) 101)
#define TAG_IPX_COMPAT ((uint8_t) 110)
#define TAG_NETINFO_PARENT ((uint8_t) 112)
#define TAG_NETINFO_PARENT_TAG ((uint8_t) 113)
#define TAG_URL ((uint8_t) 114)
#define TAG_FAILOVER ((uint8_t) 115)
#define TAG_EXTENDED_REQUEST ((uint8_t) 126)
#define TAG_EXTENDED_OPTION ((uint8_t) 127)
/* DHCP Message types (values for TAG_DHCP_MESSAGE option) */
@ -209,14 +208,14 @@ struct bootp {
*/
struct cmu_vend {
u_int8_t v_magic[4]; /* magic number */
u_int32_t v_flags; /* flags/opcodes, etc. */
uint8_t v_magic[4]; /* magic number */
uint32_t v_flags; /* flags/opcodes, etc. */
struct in_addr v_smask; /* Subnet mask */
struct in_addr v_dgate; /* Default gateway */
struct in_addr v_dns1, v_dns2; /* Domain name servers */
struct in_addr v_ins1, v_ins2; /* IEN-116 name servers */
struct in_addr v_ts1, v_ts2; /* Time servers */
u_int8_t v_unused[24]; /* currently unused */
uint8_t v_unused[24]; /* currently unused */
} UNALIGNED;

View File

@ -18,18 +18,14 @@
* 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/bpf_dump.c,v 1.17 2008-02-14 20:53:49 guy Exp $ (LBL)";
#endif
#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include <pcap.h>
#include <stdio.h>
#include "interface.h"

View File

@ -1,4 +1,3 @@
/* @(#) $Header: /tcpdump/master/tcpdump/chdlc.h,v 1.1 2000-09-18 05:11:43 guy Exp $ (LBL) */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved.

View File

@ -17,11 +17,7 @@
* Original code by Hannes Gredler (hannes@juniper.net)
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/checksum.c,v 1.4 2006-09-25 09:23:32 hannes Exp $";
#endif
#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@ -55,7 +51,7 @@ for i in range(len(crc_table)/8):
sys.stdout.write("\n")
*/
static const u_int16_t crc10_table[256] =
static const uint16_t crc10_table[256] =
{
0x0000, 0x0233, 0x0255, 0x0066, 0x0299, 0x00aa, 0x00cc, 0x02ff,
0x0301, 0x0132, 0x0154, 0x0367, 0x0198, 0x03ab, 0x03cd, 0x01fe,
@ -93,12 +89,12 @@ static const u_int16_t crc10_table[256] =
static void
init_crc10_table(void)
{
{
#define CRC10_POLYNOMIAL 0x633
register int i, j;
register u_int16_t accum;
u_int16_t verify_crc10_table[256];
register uint16_t accum;
uint16_t verify_crc10_table[256];
for ( i = 0; i < 256; i++ )
{
accum = ((unsigned short) i << 2);
@ -114,8 +110,8 @@ init_crc10_table(void)
#undef CRC10_POLYNOMIAL
}
u_int16_t
verify_crc10_cksum(u_int16_t accum, const u_char *p, int length)
uint16_t
verify_crc10_cksum(uint16_t accum, const u_char *p, int length)
{
register int i;
@ -140,16 +136,16 @@ init_checksum(void) {
* Creates the OSI Fletcher checksum. See 8473-1, Appendix C, section C.3.
* The checksum field of the passed PDU does not need to be reset to zero.
*/
u_int16_t
create_osi_cksum (const u_int8_t *pptr, int checksum_offset, int length)
uint16_t
create_osi_cksum (const uint8_t *pptr, int checksum_offset, int length)
{
int x;
int y;
u_int32_t mul;
u_int32_t c0;
u_int32_t c1;
u_int16_t checksum;
uint32_t mul;
uint32_t c0;
uint32_t c1;
uint16_t checksum;
int index;
c0 = 0;
@ -166,14 +162,14 @@ create_osi_cksum (const u_int8_t *pptr, int checksum_offset, int length)
} else {
c0 = c0 + *(pptr++);
c1 += c0;
}
}
}
c0 = c0 % 255;
c1 = c1 % 255;
mul = (length - checksum_offset)*(c0);
x = mul - c0 - c1;
y = c1 - mul - 1;
@ -189,6 +185,6 @@ create_osi_cksum (const u_int8_t *pptr, int checksum_offset, int length)
y &= 0x00FF;
checksum = ((x << 8) | y);
return checksum;
}

258
config.guess vendored
View File

@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012 Free Software Foundation, Inc.
timestamp='2009-12-30'
timestamp='2012-02-10'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -17,9 +17,7 @@ timestamp='2009-12-30'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -57,8 +55,8 @@ GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
Software Foundation, Inc.
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -145,7 +143,7 @@ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
@ -181,7 +179,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
fi
;;
*)
os=netbsd
os=netbsd
;;
esac
# The OS release
@ -224,7 +222,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
@ -270,7 +268,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit ;;
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
@ -296,7 +297,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
@ -395,23 +396,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit ;;
echo m68k-milan-mint${UNAME_RELEASE}
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
@ -481,8 +482,8 @@ EOF
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
@ -495,7 +496,7 @@ EOF
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit ;;
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
@ -552,7 +553,7 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[456])
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@ -595,52 +596,52 @@ EOF
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include <stdlib.h>
#include <unistd.h>
#define _HPUX_SOURCE
#include <stdlib.h>
#include <unistd.h>
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
@ -731,22 +732,22 @@ EOF
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit ;;
exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit ;;
exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit ;;
exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit ;;
exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
@ -770,14 +771,14 @@ EOF
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
@ -789,13 +790,12 @@ EOF
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
case ${UNAME_MACHINE} in
pc98)
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
UNAME_PROCESSOR=`/usr/bin/uname -p`
case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
@ -804,15 +804,18 @@ EOF
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:*)
case ${UNAME_MACHINE} in
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
@ -858,6 +861,13 @@ EOF
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
@ -867,7 +877,7 @@ EOF
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
@ -879,20 +889,29 @@ EOF
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
echo crisv32-axis-linux-gnu
echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
frv:Linux:*:*)
echo frv-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
hexagon:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
LIBC=gnu
@ -934,7 +953,7 @@ EOF
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo or32-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-gnu
@ -960,7 +979,7 @@ EOF
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@ -968,14 +987,17 @@ EOF
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
tile*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@ -984,11 +1006,11 @@ EOF
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
@ -1020,7 +1042,7 @@ EOF
fi
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
@ -1048,13 +1070,13 @@ EOF
exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
@ -1089,8 +1111,8 @@ EOF
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
@ -1133,10 +1155,10 @@ EOF
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
@ -1162,11 +1184,11 @@ EOF
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
@ -1231,6 +1253,9 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-?:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
@ -1276,13 +1301,13 @@ EOF
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
@ -1300,6 +1325,9 @@ EOF
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@ -1322,11 +1350,11 @@ main ()
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
"4"
#else
""
""
#endif
); exit (0);
); exit (0);
#endif
#endif

View File

@ -1,89 +1,36 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* "generated automatically" means DO NOT MAKE CHANGES TO config.h.in --
* make them to acconfig.h and rerun autoheader */
/* Define if you enable IPv6 support */
#undef INET6
/* Define if you enable support for the libsmi. */
#undef LIBSMI
/* define if you have the addrinfo function. */
/* define if you have the addrinfo function */
#undef HAVE_ADDRINFO
/* define if you need to include missing/addrinfoh.h. */
#undef NEED_ADDRINFO_H
/* define ifyou have the h_errno variable. */
#undef HAVE_H_ERRNO
/* define if you have struct 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 */
#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 libpcap has pcap_dump_ftell() */
#undef HAVE_PCAP_DUMP_FTELL
/* define if you have getrpcbynumber() */
#undef HAVE_GETRPCBYNUMBER
/* Workaround for missing 64-bit formats */
#undef PRId64
#undef PRIo64
#undef PRIx64
#undef PRIu64
/* Whether or not to include the possibly-buggy SMB printer */
#undef TCPDUMP_DO_SMB
/* Define if you have the dnet_htoa function. */
#undef HAVE_DNET_HTOA
/* Define if you have a dnet_htoa declaration in <netdnet/dnetdb.h>. */
#undef HAVE_NETDNET_DNETDB_H_DNET_HTOA
/* define if should drop privileges by default */
#undef WITH_USER
/* define if should chroot when dropping privileges */
#undef WITH_CHROOT
/* Define to 1 if you have the `alarm' function. */
#undef HAVE_ALARM
/* Define to 1 if you have the `bpf_dump' function. */
#undef HAVE_BPF_DUMP
/* capsicum support available */
#undef HAVE_CAPSICUM
/* Define to 1 if you have the `cap_enter' function. */
#undef HAVE_CAP_ENTER
/* Define to 1 if you have the `cap_ioctls_limit' function. */
#undef HAVE_CAP_IOCTLS_LIMIT
/* Define to 1 if you have the `cap_rights_init' function. */
#undef HAVE_CAP_RIGHTS_INIT
/* Define to 1 if you have the `cap_rights_limit' function. */
#undef HAVE_CAP_RIGHTS_LIMIT
/* Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
don't. */
#undef HAVE_DECL_ETHER_NTOHOST
/* define if you have the dnet_htoa function */
#undef HAVE_DNET_HTOA
/* Define to 1 if you have the `ether_ntohost' function. */
#undef HAVE_ETHER_NTOHOST
@ -96,6 +43,15 @@
/* Define to 1 if you have the `getnameinfo' function. */
#undef HAVE_GETNAMEINFO
/* Define to 1 if you have the `getopt_long' function. */
#undef HAVE_GETOPT_LONG
/* define if you have getrpcbynumber() */
#undef HAVE_GETRPCBYNUMBER
/* define if you have the h_errno variable */
#undef HAVE_H_ERRNO
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@ -105,15 +61,15 @@
/* Define to 1 if you have the `rpc' library (-lrpc). */
#undef HAVE_LIBRPC
/* Define to 1 if you have the `smi' library (-lsmi). */
#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 if you have a dnet_htoa declaration in <netdnet/dnetdb.h> */
#undef HAVE_NETDNET_DNETDB_H_DNET_HTOA
/* Define to 1 if you have the <netinet/ether.h> header file. */
#undef HAVE_NETINET_ETHER_H
@ -123,6 +79,9 @@
/* Define to 1 if you have the <net/pfvar.h> header file. */
#undef HAVE_NET_PFVAR_H
/* Define to 1 if you have the `openat' function. */
#undef HAVE_OPENAT
/* Define to 1 if you have the <openssl/evp.h> header file. */
#undef HAVE_OPENSSL_EVP_H
@ -138,24 +97,57 @@
/* Define to 1 if you have the `pcap_create' function. */
#undef HAVE_PCAP_CREATE
/* 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 libpcap has pcap_debug */
#undef HAVE_PCAP_DEBUG
/* Define to 1 if you have the `pcap_dump_flush' function. */
#undef HAVE_PCAP_DUMP_FLUSH
/* define if libpcap has pcap_dump_ftell() */
#undef HAVE_PCAP_DUMP_FTELL
/* Define to 1 if you have the `pcap_findalldevs' function. */
#undef HAVE_PCAP_FINDALLDEVS
/* Define to 1 if you have the `pcap_free_datalinks' function. */
#undef HAVE_PCAP_FREE_DATALINKS
/* 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 if libpcap has pcap_list_datalinks() */
#undef HAVE_PCAP_LIST_DATALINKS
/* Define to 1 if you have the <pcap/nflog.h> header file. */
#undef HAVE_PCAP_NFLOG_H
/* Define to 1 if you have the `pcap_setdirection' function. */
#undef HAVE_PCAP_SETDIRECTION
/* Define to 1 if you have the `pcap_set_datalink' function. */
#undef HAVE_PCAP_SET_DATALINK
/* Define to 1 if you have the `pcap_set_tstamp_precision' function. */
#undef HAVE_PCAP_SET_TSTAMP_PRECISION
/* Define to 1 if you have the `pcap_set_tstamp_type' function. */
#undef HAVE_PCAP_SET_TSTAMP_TYPE
/* Define to 1 if you have the <pcap/usb.h> header file. */
#undef HAVE_PCAP_USB_H
/* define if libpcap has pcap_version */
#undef HAVE_PCAP_VERSION
/* Define to 1 if you have the `pfopen' function. */
#undef HAVE_PFOPEN
@ -174,9 +166,6 @@
/* 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
@ -216,9 +205,6 @@
/* Define to 1 if the system has the type `struct ether_addr'. */
#undef HAVE_STRUCT_ETHER_ADDR
/* Define to 1 if you have the <sys/bitypes.h> header file. */
#undef HAVE_SYS_BITYPES_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
@ -237,12 +223,21 @@
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* define if libpcap has yydebug */
#undef HAVE_YYDEBUG
/* define if your compiler has __attribute__ */
#undef HAVE___ATTRIBUTE__
/* Define if you enable IPv6 support */
#undef INET6
/* if unaligned access fails */
#undef LBL_ALIGN
/* define if you need to include missing/addrinfo.h */
#undef NEED_ADDRINFO_H
/* Define to 1 if netinet/ether.h declares `ether_ntohost' */
#undef NETINET_ETHER_H_DECLARES_ETHER_NTOHOST
@ -261,9 +256,24 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* define if the platform doesn't define PRId64 */
#undef PRId64
/* define if the platform doesn't define PRIo64 */
#undef PRIo64
/* define if the platform doesn't define PRIx64 */
#undef PRIu64
/* define if the platform doesn't define PRIu64 */
#undef PRIx64
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
@ -273,48 +283,102 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* define if you want to build the possibly-buggy SMB printer */
#undef TCPDUMP_DO_SMB
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* define if you have ether_ntohost() and it works */
#undef USE_ETHER_NTOHOST
/* Define if you enable support for libsmi */
#undef USE_LIBSMI
/* define if should chroot when dropping privileges */
#undef WITH_CHROOT
/* define if should drop privileges by default */
#undef WITH_USER
/* get BSD semantics on Irix */
#undef _BSD_SIGNALS
/* needed on HP-UX */
#undef _HPUX_SOURCE
/* define on AIX to get certain functions */
#undef _SUN
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT32_T
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT64_T
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT8_T
/* define if your compiler allows __attribute__((format)) without a warning */
#undef __ATTRIBUTE___FORMAT_OK
/* define if your compiler allows __attribute__((format)) to be applied to
function pointers */
#undef __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS
/* define if your compiler allows __attribute__((noreturn)) to be applied to
function pointers */
#undef __ATTRIBUTE___NORETURN_OK_FOR_FUNCTION_POINTERS
/* to handle Ultrix compilers that don't support const in prototypes */
#undef const
/* Define as token for inline if inlining supported */
#undef inline
/* Define to `short' if int16_t not defined. */
/* Define to the type of a signed integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
#undef int16_t
/* Define to `int' if int32_t not defined. */
/* Define to the type of a signed integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#undef int32_t
/* Define to `long long' if int64_t not defined. */
/* Define to the type of a signed integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
#undef int64_t
/* Define to `signed char' if int8_t not defined. */
/* Define to the type of a signed integer type of width exactly 8 bits if such
a type exists and the standard includes do not define it. */
#undef int8_t
/* Define to `unsigned short' if u_int16_t not defined. */
/* Define to `uint16_t' if u_int16_t not defined. */
#undef u_int16_t
/* Define to `unsigned int' if u_int32_t not defined. */
/* Define to `uint32_t' if u_int32_t not defined. */
#undef u_int32_t
/* Define to `unsigned long long' if u_int64_t not defined. */
/* Define to `uint64_t' if u_int64_t not defined. */
#undef u_int64_t
/* Define to `unsigned char' if u_int8_t not defined. */
/* Define to `uint8_t' if u_int8_t not defined. */
#undef u_int8_t
/* Define to the type of an unsigned integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
#undef uint16_t
/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#undef uint32_t
/* Define to the type of an unsigned integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
#undef uint64_t
/* Define to the type of an unsigned integer type of width exactly 8 bits if
such a type exists and the standard includes do not define it. */
#undef uint8_t

211
config.sub vendored
View File

@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
# Free Software Foundation, Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012 Free Software Foundation, Inc.
timestamp='2009-12-31'
timestamp='2012-04-18'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@ -21,9 +21,7 @@ timestamp='2009-12-31'
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@ -76,8 +74,8 @@ version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
Software Foundation, Inc.
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -124,13 +122,18 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
@ -157,8 +160,8 @@ case $os in
os=
basic_machine=$1
;;
-bluegene*)
os=-cnk
-bluegene*)
os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
@ -174,10 +177,10 @@ case $os in
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
;;
-hiux*)
os=-hiuxwe2
;;
@ -222,6 +225,12 @@ case $os in
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-lynx*)
os=-lynxos
;;
@ -246,17 +255,22 @@ case $basic_machine in
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
| be32 | be64 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep | metag \
@ -282,29 +296,39 @@ case $basic_machine in
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
| nios | nios2 \
| ns16k | ns32k \
| open8 \
| or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
| rx \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| spu \
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12 | picochip)
# Motorola 68HC11/12.
c54x)
basic_machine=tic54x-unknown
;;
c55x)
basic_machine=tic55x-unknown
;;
c6x)
basic_machine=tic6x-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
@ -314,6 +338,21 @@ case $basic_machine in
basic_machine=mt-unknown
;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xgate)
basic_machine=$basic_machine-unknown
os=-none
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
@ -328,21 +367,25 @@ case $basic_machine in
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
@ -368,25 +411,29 @@ case $basic_machine in
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
| romp-* | rs6000-* | rx-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | vax-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
@ -411,7 +458,7 @@ case $basic_machine in
basic_machine=a29k-amd
os=-udi
;;
abacus)
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
@ -481,11 +528,20 @@ case $basic_machine in
basic_machine=powerpc-ibm
os=-cnk
;;
c54x-*)
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c55x-*)
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c6x-*)
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
cegcc)
cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
@ -517,7 +573,7 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
cr16)
cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
@ -675,7 +731,6 @@ case $basic_machine in
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
@ -733,7 +788,7 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
microblaze)
microblaze)
basic_machine=microblaze-xilinx
;;
mingw32)
@ -772,10 +827,18 @@ case $basic_machine in
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
msys)
basic_machine=i386-pc
os=-msys
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
nacl)
basic_machine=le32-unknown
os=-nacl
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
@ -840,6 +903,12 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
neo-tandem)
basic_machine=neo-tandem
;;
nse-tandem)
basic_machine=nse-tandem
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@ -922,9 +991,10 @@ case $basic_machine in
;;
power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
ppc | ppcbe) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
@ -1018,6 +1088,9 @@ case $basic_machine in
basic_machine=i860-stratus
os=-sysv4
;;
strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
sun2)
basic_machine=m68000-sun
;;
@ -1074,20 +1147,8 @@ case $basic_machine in
basic_machine=t90-cray
os=-unicos
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tic55x | c55x*)
basic_machine=tic55x-unknown
os=-coff
;;
tic6x | c6x*)
basic_machine=tic6x-unknown
os=-coff
;;
tile*)
basic_machine=tile-unknown
basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
@ -1157,6 +1218,9 @@ case $basic_machine in
xps | xps100)
basic_machine=xps100-honeywell
;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;;
ymp)
basic_machine=ymp-cray
os=-unicos
@ -1254,11 +1318,11 @@ esac
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-auroraux)
os=-auroraux
-auroraux)
os=-auroraux
;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
@ -1294,8 +1358,9 @@ case $os in
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@ -1342,7 +1407,7 @@ case $os in
-opened*)
os=-openedition
;;
-os400*)
-os400*)
os=-os400
;;
-wince*)
@ -1391,7 +1456,7 @@ case $os in
-sinix*)
os=-sysv4
;;
-tpf*)
-tpf*)
os=-tpf
;;
-triton*)
@ -1436,8 +1501,8 @@ case $os in
-dicos*)
os=-dicos
;;
-nacl*)
;;
-nacl*)
;;
-none)
;;
*)
@ -1460,10 +1525,10 @@ else
# system, and we'll never get to this point.
case $basic_machine in
score-*)
score-*)
os=-elf
;;
spu-*)
spu-*)
os=-elf
;;
*-acorn)
@ -1475,8 +1540,17 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
c4x-* | tic4x-*)
os=-coff
;;
tic54x-*)
os=-coff
;;
tic55x-*)
os=-coff
;;
tic6x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
@ -1496,14 +1570,11 @@ case $basic_machine in
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
m68*-cisco)
os=-aout
;;
mep-*)
mep-*)
os=-elf
;;
mips*-cisco)
@ -1530,7 +1601,7 @@ case $basic_machine in
*-ibm)
os=-aix
;;
*-knuth)
*-knuth)
os=-mmixware
;;
*-wec)

2297
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,3 @@
dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.204 2008-11-18 07:39:20 guy Exp $ (LBL)
dnl
dnl Copyright (c) 1994, 1995, 1996, 1997
dnl The Regents of the University of California. All rights reserved.
dnl
@ -15,20 +13,25 @@ dnl
# config.sub.
#
AC_REVISION($Revision: 1.204 $)
AC_PREREQ(2.50)
AC_PREREQ(2.61)
AC_INIT(tcpdump.c)
AC_CANONICAL_HOST
AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
AC_LBL_C_INIT_BEFORE_CC(V_INCLS)
AC_PROG_CC
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
AC_LBL_C_INLINE
AC_C___ATTRIBUTE__
if test "$ac_cv___attribute__" = "yes"; then
AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER
AC_C___ATTRIBUTE___UNUSED
AC_C___ATTRIBUTE___NORETURN_FUNCTION_POINTER
AC_C___ATTRIBUTE___FORMAT
if test "$ac_cv___attribute___format" = "yes"; then
AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER
fi
fi
AC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.h)
AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
#include <sys/socket.h>
@ -86,28 +89,6 @@ darwin*)
esac
fi
;;
linux*)
AC_MSG_CHECKING(Linux kernel version)
if test "$cross_compiling" = yes; then
AC_CACHE_VAL(ac_cv_linux_vers,
ac_cv_linux_vers=unknown)
else
AC_CACHE_VAL(ac_cv_linux_vers,
ac_cv_linux_vers=`uname -r 2>&1 | \
sed -n -e '$s/.* //' -e '$s/\..*//p'`)
fi
AC_MSG_RESULT($ac_cv_linux_vers)
if test $ac_cv_linux_vers = unknown ; then
AC_MSG_ERROR(cannot determine linux version when cross-compiling)
fi
if test $ac_cv_linux_vers -lt 2 ; then
AC_MSG_ERROR(version 2 or higher required; see the INSTALL doc for more info)
fi
;;
*)
;;
esac
@ -117,18 +98,28 @@ AC_ARG_WITH(smi,
with_smi=yes)
if test "x$with_smi" != "xno" ; then
AC_CHECK_HEADERS(smi.h)
AC_CHECK_LIB(smi, smiInit)
if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
then
AC_MSG_CHECKING([whether to enable libsmi])
AC_TRY_RUN([ /* libsmi available check */
AC_CHECK_HEADER(smi.h,
[
#
# OK, we found smi.h. Do we have libsmi with smiInit?
#
AC_CHECK_LIB(smi, smiInit,
[
#
# OK, we have libsmi with smiInit. Can we use it?
#
AC_MSG_CHECKING([whether to enable libsmi])
savedlibs="$LIBS"
LIBS="-lsmi $LIBS"
AC_TRY_RUN(
[
/* libsmi available check */
#include <smi.h>
main()
{
int current, revision, age, n;
const int required = 2;
if (smiInit(""))
if (smiInit(""))
exit(1);
if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
exit(2);
@ -139,25 +130,35 @@ main()
exit(4);
exit(0);
}
],
[ AC_MSG_RESULT(yes)
AC_DEFINE(LIBSMI)
libsmi=yes],
dnl autoconf documentation says that $? contains the exit value.
dnl reality is that it does not. We leave this in just in case
dnl autoconf ever comes back to match the documentation.
[ case $? in
1) AC_MSG_RESULT(no - smiInit failed) ;;
2) AC_MSG_RESULT(no - header/library version mismatch) ;;
3) AC_MSG_RESULT(no - can't determine library version) ;;
4) AC_MSG_RESULT(no - too old) ;;
*) AC_MSG_RESULT(no) ;;
esac
libsmi=no],
[ AC_MSG_RESULT(not when cross-compiling)
libsmi=no]
)
fi
],
[
AC_MSG_RESULT(yes)
AC_DEFINE(USE_LIBSMI, 1,
[Define if you enable support for libsmi])
],
[
dnl autoconf documentation says that
dnl $? contains the exit value.
dnl reality is that it does not.
dnl We leave this in just in case
dnl autoconf ever comes back to
dnl match the documentation.
case $? in
1) AC_MSG_RESULT(no - smiInit failed) ;;
2) AC_MSG_RESULT(no - header/library version mismatch) ;;
3) AC_MSG_RESULT(no - can't determine library version) ;;
4) AC_MSG_RESULT(no - too old) ;;
*) AC_MSG_RESULT(no) ;;
esac
LIBS="$savedlibs"
],
[
AC_MSG_RESULT(not when cross-compiling)
LIBS="$savedlibs"
]
)
])
])
fi
AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
@ -168,7 +169,8 @@ AC_ARG_ENABLE(smb,
case "$enableval" in
yes) AC_MSG_RESULT(yes)
AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
AC_DEFINE(TCPDUMP_DO_SMB)
AC_DEFINE(TCPDUMP_DO_SMB, 1,
[define if you want to build the possibly-buggy SMB printer])
LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
;;
*) AC_MSG_RESULT(no)
@ -178,7 +180,8 @@ esac
AC_ARG_WITH(user, [ --with-user=USERNAME drop privileges by default to USERNAME])
AC_MSG_CHECKING([whether to drop root privileges by default])
if test ! -z "$with_user" ; then
AC_DEFINE_UNQUOTED(WITH_USER, "$withval")
AC_DEFINE_UNQUOTED(WITH_USER, "$withval",
[define if should drop privileges by default])
AC_MSG_RESULT(to \"$withval\")
else
AC_MSG_RESULT(no)
@ -187,12 +190,41 @@ fi
AC_ARG_WITH(chroot, [ --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY])
AC_MSG_CHECKING([whether to chroot])
if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval")
AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval",
[define if should chroot when dropping privileges])
AC_MSG_RESULT(to \"$withval\")
else
AC_MSG_RESULT(no)
fi
AC_ARG_WITH(sandbox-capsicum, [ --with-sandbox-capsicum ])
#
# Check whether various functions are available. If any are, set
# ac_lbl_capsicum_function_seen to yes; if any are not, set
# ac_lbl_capsicum_function_not_seen to yes.
#
# All of them must be available in order to enable capsicum sandboxing.
#
if test ! -z "$with_sandbox-capsicum" && test "$with_sandbox-capsicum" != "no" ; then
AC_CHECK_FUNCS(cap_enter cap_rights_init cap_rights_limit cap_ioctls_limit openat,
ac_lbl_capsicum_function_seen=yes,
ac_lbl_capsicum_function_not_seen=yes)
fi
AC_MSG_CHECKING([whether to sandbox using capsicum])
if test "x$ac_lbl_capsicum_function_seen" = "xyes" -a "x$ac_lbl_capsicum_function_not_seen" != "xyes"; then
AC_DEFINE(HAVE_CAPSICUM, 1, [capsicum support available])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
#
# We must check this before checking whether to enable IPv6, because,
# on some platforms (such as SunOS 5.x), the test program requires
# the extra networking libraries.
#
AC_LBL_LIBRARY_NET
AC_MSG_CHECKING([whether to enable ipv6])
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6 enable ipv6 (with ipv4) support
@ -200,7 +232,7 @@ AC_ARG_ENABLE(ipv6,
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
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 print-babel.c $LOCALSRC"
AC_DEFINE(INET6)
AC_DEFINE(INET6, 1, [Define if you enable IPv6 support])
ipv6=yes
;;
*)
@ -209,20 +241,27 @@ yes) AC_MSG_RESULT(yes)
;;
esac ],
AC_TRY_RUN([ /* AF_INET6 available check */
AC_COMPILE_IFELSE(
[
AC_LANG_SOURCE(
[[/* AF_INET6 available check */
#include <sys/types.h>
#include <sys/socket.h>
main()
#include <netinet/in.h>
#ifdef AF_INET6
void
foo(struct in6_addr *addr)
{
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
exit(1);
else
exit(0);
memset(addr, 0, sizeof (struct in6_addr));
}
],
#else
#error "AF_INET6 not defined"
#endif
]])
],
[ AC_MSG_RESULT(yes)
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 print-babel.c $LOCALSRC"
AC_DEFINE(INET6)
AC_DEFINE(INET6, 1, [Define if you enable IPv6 support])
ipv6=yes],
[ AC_MSG_RESULT(no)
ipv6=no],
@ -491,7 +530,8 @@ AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes,
td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no)])
if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA)
AC_DEFINE(HAVE_NETDNET_DNETDB_H_DNET_HTOA, 1,
[define if you have a dnet_htoa declaration in <netdnet/dnetdb.h>])
fi
dnl
@ -515,14 +555,7 @@ if test "$ac_cv_namereqd" = no; then
missing_includes=yes
fi
dnl
dnl Checks for sockaddr_storage structure
AC_STRUCT_SA_STORAGE(ac_cv_sa_storage)
if test "$ac_cv_sa_storage" = no; then
missing_includes=yes
fi
AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep getopt_long)
AC_CHECK_FUNCS(fork vfork strftime)
AC_CHECK_FUNCS(setlinebuf alarm)
@ -535,12 +568,14 @@ fi
AC_LBL_TYPE_SIGNAL
AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA))
AC_SEARCH_LIBS(dnet_htoa, dnet,
AC_DEFINE(HAVE_DNET_HTOA, 1, [define if you have the dnet_htoa function]))
AC_CHECK_LIB(rpc, main) dnl It's unclear why we might need -lrpc
dnl Some platforms may need -lnsl for getrpcbynumber.
AC_SEARCH_LIBS(getrpcbynumber, nsl, AC_DEFINE(HAVE_GETRPCBYNUMBER))
AC_SEARCH_LIBS(getrpcbynumber, nsl,
AC_DEFINE(HAVE_GETRPCBYNUMBER, 1, [define if you have getrpcbynumber()]))
dnl AC_CHECK_LIB(z, uncompress)
dnl AC_CHECK_HEADERS(zlib.h)
@ -619,7 +654,8 @@ AC_CHECK_FUNCS(ether_ntohost, [
[ac_cv_buggy_ether_ntohost=yes],
[ac_cv_buggy_ether_ntohost="not while cross-compiling"])])
if test "$ac_cv_buggy_ether_ntohost" = "no"; then
AC_DEFINE(USE_ETHER_NTOHOST)
AC_DEFINE(USE_ETHER_NTOHOST, 1,
[define if you have ether_ntohost() and it works])
fi
])
if test "$ac_cv_func_ether_ntohost" = yes -a \
@ -725,9 +761,14 @@ if test $ac_cv_func_pcap_create = "yes" ; then
# pcap_list_tstamp_types and pcap_free_tstamp_types as well.
#
AC_CHECK_FUNCS(pcap_set_tstamp_type)
#
# And do we have pcap_set_tstamp_precision? If so, we assume
# we also have pcap_open_offline_with_tstamp_precision.
#
AC_CHECK_FUNCS(pcap_set_tstamp_precision)
fi
AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version pcap_setdirection)
if test $ac_cv_func_pcap_findalldevs = "yes" ; then
dnl Check for Mac OS 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
@ -750,7 +791,7 @@ if test $ac_cv_func_pcap_lib_version = "no" ; then
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)
AC_DEFINE(HAVE_PCAP_VERSION, 1, [define if libpcap has pcap_version])
else
AC_MSG_RESULT(no)
fi
@ -766,7 +807,7 @@ AC_TRY_LINK([],
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)
AC_DEFINE(HAVE_PCAP_DEBUG, 1, [define if libpcap has pcap_debug])
else
AC_MSG_RESULT(no)
#
@ -783,7 +824,7 @@ else
ac_lbl_cv_yydebug_defined=no)
if test "$ac_lbl_cv_yydebug_defined" = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_YYDEBUG)
AC_DEFINE(HAVE_YYDEBUG, 1, [define if libpcap has yydebug])
else
AC_MSG_RESULT(no)
fi
@ -850,73 +891,56 @@ if test -f /dev/bpf0 ; then
V_GROUP=bpf
fi
AC_CHECK_HEADERS(sys/bitypes.h)
AC_CHECK_TYPE([int8_t], ,
[AC_DEFINE([int8_t], [signed char],
[Define to `signed char' if int8_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([u_int8_t], ,
[AC_DEFINE([u_int8_t], [unsigned char],
[Define to `unsigned char' if u_int8_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([int16_t], ,
[AC_DEFINE([int16_t], [short],
[Define to `short' if int16_t not defined.])]
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([u_int16_t], ,
[AC_DEFINE([u_int16_t], [unsigned short],
[Define to `unsigned short' if u_int16_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([int32_t], ,
[AC_DEFINE([int32_t], [int],
[Define to `int' if int32_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([u_int32_t], ,
[AC_DEFINE([u_int32_t], [unsigned int],
[Define to `unsigned int' if u_int32_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([int64_t], ,
[AC_DEFINE([int64_t], [long long],
[Define to `long long' if int64_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
AC_CHECK_TYPE([u_int64_t], ,
[AC_DEFINE([u_int64_t], [unsigned long long],
[Define to `unsigned long long' if u_int64_t not defined.])],
[AC_INCLUDES_DEFAULT
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif])
#
# Make sure we have definitions for all the C99 specified-width types
# (regardless of whether the environment is a C99 environment or not).
#
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
#
# We can't just check for <inttypes.h> - some systems have one that
# doesn't define all the PRI[doxu]64 macros.
# Define the old BSD specified-width types in terms of the C99 types;
# we may need them with libpcap include files.
#
AC_CHECK_TYPE([u_int8_t], ,
[AC_DEFINE([u_int8_t], [uint8_t],
[Define to `uint8_t' if u_int8_t not defined.])],
[AC_INCLUDES_DEFAULT
#include <sys/types.h>
])
AC_CHECK_TYPE([u_int16_t], ,
[AC_DEFINE([u_int16_t], [uint16_t],
[Define to `uint16_t' if u_int16_t not defined.])],
[AC_INCLUDES_DEFAULT
#include <sys/types.h>
])
AC_CHECK_TYPE([u_int32_t], ,
[AC_DEFINE([u_int32_t], [uint32_t],
[Define to `uint32_t' if u_int32_t not defined.])],
[AC_INCLUDES_DEFAULT
#include <sys/types.h>
])
AC_CHECK_TYPE([u_int64_t], ,
[AC_DEFINE([u_int64_t], [uint64_t],
[Define to `uint64_t' if u_int64_t not defined.])],
[AC_INCLUDES_DEFAULT
#include <sys/types.h>
])
#
# Check for <inttypes.h>
#
AC_CHECK_HEADERS(inttypes.h,
[
#
# OK, we have inttypes.h, but does it define those macros?
# OK, we have inttypes.h, but does it define all the PRI[doxu]64 macros?
# Some systems have an inttypes.h that doesn't define all of them.
#
AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
AC_COMPILE_IFELSE(
@ -926,16 +950,13 @@ AC_CHECK_HEADERS(inttypes.h,
#include <inttypes.h>
#include <stdio.h>
#include <sys/types.h>
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif
main()
{
printf("%" PRId64 "\n", (u_int64_t)1);
printf("%" PRIo64 "\n", (u_int64_t)1);
printf("%" PRIx64 "\n", (u_int64_t)1);
printf("%" PRIu64 "\n", (u_int64_t)1);
printf("%" PRId64 "\n", (uint64_t)1);
printf("%" PRIo64 "\n", (uint64_t)1);
printf("%" PRIx64 "\n", (uint64_t)1);
printf("%" PRIu64 "\n", (uint64_t)1);
}
]])
],
@ -980,11 +1001,13 @@ fi
#
savedcppflags="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $V_INCLS"
AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include <tcpdump-stdinc.h>])
AC_CHECK_HEADERS(pcap/usb.h,,,[#include <tcpdump-stdinc.h>])
AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include "tcpdump-stdinc.h"])
AC_CHECK_HEADERS(pcap/nflog.h,,,[#include "tcpdump-stdinc.h"])
AC_CHECK_HEADERS(pcap/usb.h,,,[#include "tcpdump-stdinc.h"])
CPPFLAGS="$savedcppflags"
AC_PROG_RANLIB
AC_CHECK_TOOL([AR], [ar])
AC_LBL_DEVEL(V_CCOPT)

44
cpack.c
View File

@ -27,6 +27,7 @@
* OF SUCH DAMAGE.
*/
#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@ -38,8 +39,8 @@
#include "cpack.h"
#include "extract.h"
u_int8_t *
cpack_next_boundary(u_int8_t *buf, u_int8_t *p, size_t alignment)
uint8_t *
cpack_next_boundary(uint8_t *buf, uint8_t *p, size_t alignment)
{
size_t misalignment = (size_t)(p - buf) % alignment;
@ -53,10 +54,10 @@ cpack_next_boundary(u_int8_t *buf, u_int8_t *p, size_t alignment)
* wordsize bytes remain in the buffer after the boundary. Otherwise,
* return a pointer to the boundary.
*/
u_int8_t *
uint8_t *
cpack_align_and_reserve(struct cpack_state *cs, size_t wordsize)
{
u_int8_t *next;
uint8_t *next;
/* Ensure alignment. */
next = cpack_next_boundary(cs->c_buf, cs->c_next, wordsize);
@ -68,8 +69,19 @@ cpack_align_and_reserve(struct cpack_state *cs, size_t wordsize)
return next;
}
/* Advance by N bytes without returning them. */
int
cpack_init(struct cpack_state *cs, u_int8_t *buf, size_t buflen)
cpack_advance(struct cpack_state *cs, const size_t toskip)
{
/* No space left? */
if (cs->c_next - cs->c_buf + toskip > cs->c_len)
return -1;
cs->c_next += toskip;
return 0;
}
int
cpack_init(struct cpack_state *cs, uint8_t *buf, size_t buflen)
{
memset(cs, 0, sizeof(*cs));
@ -82,55 +94,55 @@ cpack_init(struct cpack_state *cs, u_int8_t *buf, size_t buflen)
/* Unpack a 64-bit unsigned integer. */
int
cpack_uint64(struct cpack_state *cs, u_int64_t *u)
cpack_uint64(struct cpack_state *cs, uint64_t *u)
{
u_int8_t *next;
uint8_t *next;
if ((next = cpack_align_and_reserve(cs, sizeof(*u))) == NULL)
return -1;
*u = EXTRACT_LE_64BITS(next);
/* Move pointer past the u_int64_t. */
/* Move pointer past the uint64_t. */
cs->c_next = next + sizeof(*u);
return 0;
}
/* Unpack a 32-bit unsigned integer. */
int
cpack_uint32(struct cpack_state *cs, u_int32_t *u)
cpack_uint32(struct cpack_state *cs, uint32_t *u)
{
u_int8_t *next;
uint8_t *next;
if ((next = cpack_align_and_reserve(cs, sizeof(*u))) == NULL)
return -1;
*u = EXTRACT_LE_32BITS(next);
/* Move pointer past the u_int32_t. */
/* Move pointer past the uint32_t. */
cs->c_next = next + sizeof(*u);
return 0;
}
/* Unpack a 16-bit unsigned integer. */
int
cpack_uint16(struct cpack_state *cs, u_int16_t *u)
cpack_uint16(struct cpack_state *cs, uint16_t *u)
{
u_int8_t *next;
uint8_t *next;
if ((next = cpack_align_and_reserve(cs, sizeof(*u))) == NULL)
return -1;
*u = EXTRACT_LE_16BITS(next);
/* Move pointer past the u_int16_t. */
/* Move pointer past the uint16_t. */
cs->c_next = next + sizeof(*u);
return 0;
}
/* Unpack an 8-bit unsigned integer. */
int
cpack_uint8(struct cpack_state *cs, u_int8_t *u)
cpack_uint8(struct cpack_state *cs, uint8_t *u)
{
/* No space left? */
if ((size_t)(cs->c_next - cs->c_buf) >= cs->c_len)
@ -138,7 +150,7 @@ cpack_uint8(struct cpack_state *cs, u_int8_t *u)
*u = *cs->c_next;
/* Move pointer past the u_int8_t. */
/* Move pointer past the uint8_t. */
cs->c_next++;
return 0;
}

28
cpack.h
View File

@ -31,24 +31,26 @@
#define _CPACK_H
struct cpack_state {
u_int8_t *c_buf;
u_int8_t *c_next;
uint8_t *c_buf;
uint8_t *c_next;
size_t c_len;
};
int cpack_init(struct cpack_state *, u_int8_t *, size_t);
int cpack_init(struct cpack_state *, uint8_t *, size_t);
int cpack_uint8(struct cpack_state *, u_int8_t *);
int cpack_uint16(struct cpack_state *, u_int16_t *);
int cpack_uint32(struct cpack_state *, u_int32_t *);
int cpack_uint64(struct cpack_state *, u_int64_t *);
int cpack_uint8(struct cpack_state *, uint8_t *);
int cpack_uint16(struct cpack_state *, uint16_t *);
int cpack_uint32(struct cpack_state *, uint32_t *);
int cpack_uint64(struct cpack_state *, uint64_t *);
u_int8_t *cpack_next_boundary(u_int8_t *buf, u_int8_t *p, size_t alignment);
u_int8_t *cpack_align_and_reserve(struct cpack_state *cs, size_t wordsize);
uint8_t *cpack_next_boundary(uint8_t *buf, uint8_t *p, size_t alignment);
uint8_t *cpack_align_and_reserve(struct cpack_state *cs, size_t wordsize);
#define cpack_int8(__s, __p) cpack_uint8((__s), (u_int8_t*)(__p))
#define cpack_int16(__s, __p) cpack_uint16((__s), (u_int16_t*)(__p))
#define cpack_int32(__s, __p) cpack_uint32((__s), (u_int32_t*)(__p))
#define cpack_int64(__s, __p) cpack_uint64((__s), (u_int64_t*)(__p))
#define cpack_int8(__s, __p) cpack_uint8((__s), (uint8_t*)(__p))
#define cpack_int16(__s, __p) cpack_uint16((__s), (uint16_t*)(__p))
#define cpack_int32(__s, __p) cpack_uint32((__s), (uint32_t*)(__p))
#define cpack_int64(__s, __p) cpack_uint64((__s), (uint64_t*)(__p))
extern int cpack_advance(struct cpack_state *, const size_t);
#endif /* _CPACK_H */

139
dccp.h
View File

@ -1,139 +0,0 @@
/* @(#) $Header: /tcpdump/master/tcpdump/dccp.h,v 1.5 2006-11-02 09:05:23 hannes Exp $ (LBL) */
/*
* Copyright (C) Arnaldo Carvalho de Melo 2004
* Copyright (C) Ian McDonald 2005 <iam4@cs.waikato.ac.nz>
* Copyright (C) Yoshifumi Nishida 2005
*
* This software may be distributed either under the terms of the
* BSD-style license that accompanies tcpdump or the GNU GPL version 2
*/
#ifndef __DCCP_HDR__
#define __DCCP_HDR__
/**
* struct dccp_hdr - generic part of DCCP packet header
*
* @dccph_sport - Relevant port on the endpoint that sent this packet
* @dccph_dport - Relevant port on the other endpoint
* @dccph_doff - Data Offset from the start of the DCCP header, in 32-bit words
* @dccph_ccval - Used by the HC-Sender CCID
* @dccph_cscov - Parts of the packet that are covered by the Checksum field
* @dccph_checksum - Internet checksum, depends on dccph_cscov
* @dccph_x - 0 = 24 bit sequence number, 1 = 48
* @dccph_type - packet type, see DCCP_PKT_ prefixed macros
* @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x
*/
struct dccp_hdr {
u_int16_t dccph_sport,
dccph_dport;
u_int8_t dccph_doff;
u_int8_t dccph_ccval_cscov;
u_int16_t dccph_checksum;
union {
u_int8_t dccph_xtr;
u_int32_t dccph_seq;
} dccph_xtrs;
};
#define DCCPH_CCVAL(dh) (((dh)->dccph_ccval_cscov >> 4) & 0xF)
#define DCCPH_CSCOV(dh) (((dh)->dccph_ccval_cscov) & 0xF)
#define DCCPH_X(dh) ((dh)->dccph_xtrs.dccph_xtr & 1)
#define DCCPH_TYPE(dh) (((dh)->dccph_xtrs.dccph_xtr >> 1) & 0xF)
#define DCCPH_SEQ(dh) (((dh)->dccph_xtrs.dccph_seq) >> 8)
/**
* struct dccp_hdr_ext - the low bits of a 48 bit seq packet
*
* @dccph_seq_low - low 24 bits of a 48 bit seq packet
*/
struct dccp_hdr_ext {
u_int32_t dccph_seq_low;
};
/**
* struct dccp_hdr_request - Conection initiation request header
*
* @dccph_req_service - Service to which the client app wants to connect
*/
struct dccp_hdr_request {
u_int32_t dccph_req_service;
};
/**
* struct dccp_hdr_ack_bits - acknowledgment bits common to most packets
*
* @dccph_resp_ack_nr_high - 48 bit ack number high order bits, contains GSR
* @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR
*/
struct dccp_hdr_ack_bits {
u_int32_t dccph_ra;
u_int32_t dccph_ack_nr_low;
};
#define DCCPH_ACK(dh_ack) ((dh_ack)->dccph_ra >> 8)
/**
* struct dccp_hdr_response - Conection initiation response header
*
* @dccph_resp_ack_nr_high - 48 bit ack number high order bits, contains GSR
* @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR
* @dccph_resp_service - Echoes the Service Code on a received DCCP-Request
*/
struct dccp_hdr_response {
struct dccp_hdr_ack_bits dccph_resp_ack;
u_int32_t dccph_resp_service;
};
#if 0
static inline struct dccp_hdr_data *dccp_hdr_data(struct dccp_hdr *hdrg)
{
const int ext = DCCPH_X(hdrg) ? sizeof(struct dccp_hdr_ext) : 0;
return (struct dccp_hdr_data *)(((u_char *)hdrg) + sizeof(hdrg) + ext);
}
#endif
/**
* struct dccp_hdr_reset - Unconditionally shut down a connection
*
* @dccph_reset_service - Echoes the Service Code on a received DCCP-Request
*/
struct dccp_hdr_reset {
struct dccp_hdr_ack_bits dccph_reset_ack;
u_int8_t dccph_reset_code,
dccph_reset_data[3];
};
enum dccp_pkt_type {
DCCP_PKT_REQUEST = 0,
DCCP_PKT_RESPONSE,
DCCP_PKT_DATA,
DCCP_PKT_ACK,
DCCP_PKT_DATAACK,
DCCP_PKT_CLOSEREQ,
DCCP_PKT_CLOSE,
DCCP_PKT_RESET,
DCCP_PKT_SYNC,
DCCP_PKT_SYNCACK,
DCCP_PKT_INVALID
};
enum dccp_reset_codes {
DCCP_RESET_CODE_UNSPECIFIED = 0,
DCCP_RESET_CODE_CLOSED,
DCCP_RESET_CODE_ABORTED,
DCCP_RESET_CODE_NO_CONNECTION,
DCCP_RESET_CODE_PACKET_ERROR,
DCCP_RESET_CODE_OPTION_ERROR,
DCCP_RESET_CODE_MANDATORY_ERROR,
DCCP_RESET_CODE_CONNECTION_REFUSED,
DCCP_RESET_CODE_BAD_SERVICE_CODE,
DCCP_RESET_CODE_TOO_BUSY,
DCCP_RESET_CODE_BAD_INIT_COOKIE,
DCCP_RESET_CODE_AGGRESSION_PENALTY,
__DCCP_RESET_CODE_LAST
};
#endif /* __DCCP_HDR__ */

461
decnet.h
View File

@ -1,461 +0,0 @@
/*
* Copyright (c) 1992, 1994, 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/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 */
#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 longword[4]; /* 4 bytes field */
/*
* Definitions for DECNET Phase IV protocol headers
*/
union etheraddress {
u_int8_t dne_addr[6]; /* full ethernet address */
struct {
u_int8_t dne_hiord[4]; /* DECnet HIORD prefix */
u_int8_t dne_nodeaddr[2]; /* DECnet node address */
} dne_remote;
};
typedef union etheraddress etheraddr; /* Ethernet address */
#define HIORD 0x000400aa /* high 32-bits of address (swapped) */
#define AREAMASK 0176000 /* mask for area field */
#define AREASHIFT 10 /* bit-offset for area field */
#define NODEMASK 01777 /* mask for node address field */
#define DN_MAXADDL 20 /* max size of DECnet address */
struct dn_naddr {
u_int16_t a_len; /* length of address */
u_int8_t a_addr[DN_MAXADDL]; /* address as bytes */
};
/*
* Define long and short header formats.
*/
struct shorthdr
{
byte sh_flags; /* route flags */
word sh_dst; /* destination node address */
word sh_src; /* source node address */
byte sh_visits; /* visit count */
};
struct longhdr
{
byte lg_flags; /* route flags */
byte lg_darea; /* destination area (reserved) */
byte lg_dsarea; /* destination subarea (reserved) */
etheraddr lg_dst; /* destination id */
byte lg_sarea; /* source area (reserved) */
byte lg_ssarea; /* source subarea (reserved) */
etheraddr lg_src; /* source id */
byte lg_nextl2; /* next level 2 router (reserved) */
byte lg_visits; /* visit count */
byte lg_service; /* service class (reserved) */
byte lg_pt; /* protocol type (reserved) */
};
union routehdr
{
struct shorthdr rh_short; /* short route header */
struct longhdr rh_long; /* long route header */
};
/*
* Define the values of various fields in the protocol messages.
*
* 1. Data packet formats.
*/
#define RMF_MASK 7 /* mask for message type */
#define RMF_SHORT 2 /* short message format */
#define RMF_LONG 6 /* long message format */
#ifndef RMF_RQR
#define RMF_RQR 010 /* request return to sender */
#define RMF_RTS 020 /* returning to sender */
#define RMF_IE 040 /* intra-ethernet packet */
#endif /* RMR_RQR */
#define RMF_FVER 0100 /* future version flag */
#define RMF_PAD 0200 /* pad field */
#define RMF_PADMASK 0177 /* pad field mask */
#define VIS_MASK 077 /* visit field mask */
/*
* 2. Control packet formats.
*/
#define RMF_CTLMASK 017 /* mask for message type */
#define RMF_CTLMSG 01 /* control message indicator */
#define RMF_INIT 01 /* initialization message */
#define RMF_VER 03 /* verification message */
#define RMF_TEST 05 /* hello and test message */
#define RMF_L1ROUT 07 /* level 1 routing message */
#define RMF_L2ROUT 011 /* level 2 routing message */
#define RMF_RHELLO 013 /* router hello message */
#define RMF_EHELLO 015 /* endnode hello message */
#define TI_L2ROUT 01 /* level 2 router */
#define TI_L1ROUT 02 /* level 1 router */
#define TI_ENDNODE 03 /* endnode */
#define TI_VERIF 04 /* verification required */
#define TI_BLOCK 010 /* blocking requested */
#define VE_VERS 2 /* version number (2) */
#define VE_ECO 0 /* ECO number */
#define VE_UECO 0 /* user ECO number (0) */
#define P3_VERS 1 /* phase III version number (1) */
#define P3_ECO 3 /* ECO number (3) */
#define P3_UECO 0 /* user ECO number (0) */
#define II_L2ROUT 01 /* level 2 router */
#define II_L1ROUT 02 /* level 1 router */
#define II_ENDNODE 03 /* endnode */
#define II_VERIF 04 /* verification required */
#define II_NOMCAST 040 /* no multicast traffic accepted */
#define II_BLOCK 0100 /* blocking requested */
#define II_TYPEMASK 03 /* mask for node type */
#define TESTDATA 0252 /* test data bytes */
#define TESTLEN 1 /* length of transmitted test data */
/*
* Define control message formats.
*/
struct initmsgIII /* phase III initialization message */
{
byte inIII_flags; /* route flags */
word inIII_src; /* source node address */
byte inIII_info; /* routing layer information */
word inIII_blksize; /* maximum data link block size */
byte inIII_vers; /* version number */
byte inIII_eco; /* ECO number */
byte inIII_ueco; /* user ECO number */
byte inIII_rsvd; /* reserved image field */
};
struct initmsg /* initialization message */
{
byte in_flags; /* route flags */
word in_src; /* source node address */
byte in_info; /* routing layer information */
word in_blksize; /* maximum data link block size */
byte in_vers; /* version number */
byte in_eco; /* ECO number */
byte in_ueco; /* user ECO number */
word in_hello; /* hello timer */
byte in_rsvd; /* reserved image field */
};
struct verifmsg /* verification message */
{
byte ve_flags; /* route flags */
word ve_src; /* source node address */
byte ve_fcnval; /* function value image field */
};
struct testmsg /* hello and test message */
{
byte te_flags; /* route flags */
word te_src; /* source node address */
byte te_data; /* test data image field */
};
struct l1rout /* level 1 routing message */
{
byte r1_flags; /* route flags */
word r1_src; /* source node address */
byte r1_rsvd; /* reserved field */
};
struct l2rout /* level 2 routing message */
{
byte r2_flags; /* route flags */
word r2_src; /* source node address */
byte r2_rsvd; /* reserved field */
};
struct rhellomsg /* router hello message */
{
byte rh_flags; /* route flags */
byte rh_vers; /* version number */
byte rh_eco; /* ECO number */
byte rh_ueco; /* user ECO number */
etheraddr rh_src; /* source id */
byte rh_info; /* routing layer information */
word rh_blksize; /* maximum data link block size */
byte rh_priority; /* router's priority */
byte rh_area; /* reserved */
word rh_hello; /* hello timer */
byte rh_mpd; /* reserved */
};
struct ehellomsg /* endnode hello message */
{
byte eh_flags; /* route flags */
byte eh_vers; /* version number */
byte eh_eco; /* ECO number */
byte eh_ueco; /* user ECO number */
etheraddr eh_src; /* source id */
byte eh_info; /* routing layer information */
word eh_blksize; /* maximum data link block size */
byte eh_area; /* area (reserved) */
byte eh_seed[8]; /* verification seed */
etheraddr eh_router; /* designated router */
word eh_hello; /* hello timer */
byte eh_mpd; /* (reserved) */
byte eh_data; /* test data image field */
};
union controlmsg
{
struct initmsg cm_init; /* initialization message */
struct verifmsg cm_ver; /* verification message */
struct testmsg cm_test; /* hello and test message */
struct l1rout cm_l1rou; /* level 1 routing message */
struct l2rout cm_l2rout; /* level 2 routing message */
struct rhellomsg cm_rhello; /* router hello message */
struct ehellomsg cm_ehello; /* endnode hello message */
};
/* Macros for decoding routing-info fields */
#define RI_COST(x) ((x)&0777)
#define RI_HOPS(x) (((x)>>10)&037)
/*
* NSP protocol fields and values.
*/
#define NSP_TYPEMASK 014 /* mask to isolate type code */
#define NSP_SUBMASK 0160 /* mask to isolate subtype code */
#define NSP_SUBSHFT 4 /* shift to move subtype code */
#define MFT_DATA 0 /* data message */
#define MFT_ACK 04 /* acknowledgement message */
#define MFT_CTL 010 /* control message */
#define MFS_ILS 020 /* data or I/LS indicator */
#define MFS_BOM 040 /* beginning of message (data) */
#define MFS_MOM 0 /* middle of message (data) */
#define MFS_EOM 0100 /* end of message (data) */
#define MFS_INT 040 /* interrupt message */
#define MFS_DACK 0 /* data acknowledgement */
#define MFS_IACK 020 /* I/LS acknowledgement */
#define MFS_CACK 040 /* connect acknowledgement */
#define MFS_NOP 0 /* no operation */
#define MFS_CI 020 /* connect initiate */
#define MFS_CC 040 /* connect confirm */
#define MFS_DI 060 /* disconnect initiate */
#define MFS_DC 0100 /* disconnect confirm */
#define MFS_RCI 0140 /* retransmitted connect initiate */
#define SGQ_ACK 0100000 /* ack */
#define SGQ_NAK 0110000 /* negative ack */
#define SGQ_OACK 0120000 /* other channel ack */
#define SGQ_ONAK 0130000 /* other channel negative ack */
#define SGQ_MASK 07777 /* mask to isolate seq # */
#define SGQ_OTHER 020000 /* other channel qualifier */
#define SGQ_DELAY 010000 /* ack delay flag */
#define SGQ_EOM 0100000 /* pseudo flag for end-of-message */
#define LSM_MASK 03 /* mask for modifier field */
#define LSM_NOCHANGE 0 /* no change */
#define LSM_DONOTSEND 1 /* do not send data */
#define LSM_SEND 2 /* send data */
#define LSI_MASK 014 /* mask for interpretation field */
#define LSI_DATA 0 /* data segment or message count */
#define LSI_INTR 4 /* interrupt request count */
#define LSI_INTM 0377 /* funny marker for int. message */
#define COS_MASK 014 /* mask for flow control field */
#define COS_NONE 0 /* no flow control */
#define COS_SEGMENT 04 /* segment flow control */
#define COS_MESSAGE 010 /* message flow control */
#define COS_CRYPTSER 020 /* cryptographic services requested */
#define COS_DEFAULT 1 /* default value for field */
#define COI_MASK 3 /* mask for version field */
#define COI_32 0 /* version 3.2 */
#define COI_31 1 /* version 3.1 */
#define COI_40 2 /* version 4.0 */
#define COI_41 3 /* version 4.1 */
#define MNU_MASK 140 /* mask for session control version */
#define MNU_10 000 /* session V1.0 */
#define MNU_20 040 /* session V2.0 */
#define MNU_ACCESS 1 /* access control present */
#define MNU_USRDATA 2 /* user data field present */
#define MNU_INVKPROXY 4 /* invoke proxy field present */
#define MNU_UICPROXY 8 /* use uic-based proxy */
#define DC_NORESOURCES 1 /* no resource reason code */
#define DC_NOLINK 41 /* no link terminate reason code */
#define DC_COMPLETE 42 /* disconnect complete reason code */
#define DI_NOERROR 0 /* user disconnect */
#define DI_SHUT 3 /* node is shutting down */
#define DI_NOUSER 4 /* destination end user does not exist */
#define DI_INVDEST 5 /* invalid end user destination */
#define DI_REMRESRC 6 /* insufficient remote resources */
#define DI_TPA 8 /* third party abort */
#define DI_PROTOCOL 7 /* protocol error discovered */
#define DI_ABORT 9 /* user abort */
#define DI_LOCALRESRC 32 /* insufficient local resources */
#define DI_REMUSERRESRC 33 /* insufficient remote user resources */
#define DI_BADACCESS 34 /* bad access control information */
#define DI_BADACCNT 36 /* bad ACCOUNT information */
#define DI_CONNECTABORT 38 /* connect request cancelled */
#define DI_TIMEDOUT 38 /* remote node or user crashed */
#define DI_UNREACHABLE 39 /* local timers expired due to ... */
#define DI_BADIMAGE 43 /* bad image data in connect */
#define DI_SERVMISMATCH 54 /* cryptographic service mismatch */
#define UC_OBJREJECT 0 /* object rejected connect */
#define UC_USERDISCONNECT 0 /* user disconnect */
#define UC_RESOURCES 1 /* insufficient resources (local or remote) */
#define UC_NOSUCHNODE 2 /* unrecognized node name */
#define UC_REMOTESHUT 3 /* remote node shutting down */
#define UC_NOSUCHOBJ 4 /* unrecognized object */
#define UC_INVOBJFORMAT 5 /* invalid object name format */
#define UC_OBJTOOBUSY 6 /* object too busy */
#define UC_NETWORKABORT 8 /* network abort */
#define UC_USERABORT 9 /* user abort */
#define UC_INVNODEFORMAT 10 /* invalid node name format */
#define UC_LOCALSHUT 11 /* local node shutting down */
#define UC_ACCESSREJECT 34 /* invalid access control information */
#define UC_NORESPONSE 38 /* no response from object */
#define UC_UNREACHABLE 39 /* node unreachable */
/*
* NSP message formats.
*/
struct nsphdr /* general nsp header */
{
byte nh_flags; /* message flags */
word nh_dst; /* destination link address */
word nh_src; /* source link address */
};
struct seghdr /* data segment header */
{
byte sh_flags; /* message flags */
word sh_dst; /* destination link address */
word sh_src; /* source link address */
word sh_seq[3]; /* sequence numbers */
};
struct minseghdr /* minimum data segment header */
{
byte ms_flags; /* message flags */
word ms_dst; /* destination link address */
word ms_src; /* source link address */
word ms_seq; /* sequence number */
};
struct lsmsg /* link service message (after hdr) */
{
byte ls_lsflags; /* link service flags */
byte ls_fcval; /* flow control value */
};
struct ackmsg /* acknowledgement message */
{
byte ak_flags; /* message flags */
word ak_dst; /* destination link address */
word ak_src; /* source link address */
word ak_acknum[2]; /* acknowledgement numbers */
};
struct minackmsg /* minimum acknowledgement message */
{
byte mk_flags; /* message flags */
word mk_dst; /* destination link address */
word mk_src; /* source link address */
word mk_acknum; /* acknowledgement number */
};
struct ciackmsg /* connect acknowledgement message */
{
byte ck_flags; /* message flags */
word ck_dst; /* destination link address */
};
struct cimsg /* connect initiate message */
{
byte ci_flags; /* message flags */
word ci_dst; /* destination link address (0) */
word ci_src; /* source link address */
byte ci_services; /* requested services */
byte ci_info; /* information */
word ci_segsize; /* maximum segment size */
};
struct ccmsg /* connect confirm message */
{
byte cc_flags; /* message flags */
word cc_dst; /* destination link address */
word cc_src; /* source link address */
byte cc_services; /* requested services */
byte cc_info; /* information */
word cc_segsize; /* maximum segment size */
byte cc_optlen; /* optional data length */
};
struct cnmsg /* generic connect message */
{
byte cn_flags; /* message flags */
word cn_dst; /* destination link address */
word cn_src; /* source link address */
byte cn_services; /* requested services */
byte cn_info; /* information */
word cn_segsize; /* maximum segment size */
};
struct dimsg /* disconnect initiate message */
{
byte di_flags; /* message flags */
word di_dst; /* destination link address */
word di_src; /* source link address */
word di_reason; /* reason code */
byte di_optlen; /* optional data length */
};
struct dcmsg /* disconnect confirm message */
{
byte dc_flags; /* message flags */
word dc_dst; /* destination link address */
word dc_src; /* source link address */
word dc_reason; /* reason code */
};

View File

@ -1,41 +0,0 @@
/*
* Copyright (C) 1999 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.
*
* Extensively modified by Hannes Gredler (hannes@juniper.net) for more
* complete BGP support.
*/
#ifndef tcpdump_decode_prefix_h
#define tcpdump_decode_prefix_h
extern int decode_prefix4(const u_char *pptr, u_int itemlen, char *buf, u_int buflen);
#ifdef INET6
extern int decode_prefix6(const u_char *pd, u_int itemlen, char *buf, u_int buflen);
#endif
#endif

47
enc.h
View File

@ -1,47 +0,0 @@
/* @(#) $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;
};

68
esp.h
View File

@ -1,68 +0,0 @@
/* $NetBSD: esp.h,v 1.13 2000/09/26 08:37:38 itojun Exp $ */
/* $KAME: esp.h,v 1.15 2000/09/20 18:15:22 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 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.
*/
/*
* RFC1827/2406 Encapsulated Security Payload.
*/
#ifndef _NETINET6_ESP_H_
#define _NETINET6_ESP_H_
struct esp {
u_int32_t esp_spi; /* ESP */
/*variable size, 32bit bound*/ /* Initialization Vector */
/*variable size*/ /* Payload data */
/*variable size*/ /* padding */
/*8bit*/ /* pad size */
/*8bit*/ /* next header */
/*8bit*/ /* next header */
/*variable size, 32bit bound*/ /* Authentication data (new IPsec) */
};
struct newesp {
u_int32_t esp_spi; /* ESP */
u_int32_t esp_seq; /* Sequence number */
/*variable size*/ /* (IV and) Payload data */
/*variable size*/ /* padding */
/*8bit*/ /* pad size */
/*8bit*/ /* next header */
/*8bit*/ /* next header */
/*variable size, 32bit bound*/ /* Authentication data */
};
struct esptail {
u_int8_t esp_padlen; /* pad length */
u_int8_t esp_nxt; /* Next header */
/*variable size, 32bit bound*/ /* Authentication data (new IPsec)*/
};
#endif /*_NETINET6_ESP_H_*/

View File

@ -1,4 +1,3 @@
/* @(#) $Header: /tcpdump/master/tcpdump/ether.h,v 1.8 2002-12-11 07:13:51 guy Exp $ (LBL) */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
@ -45,9 +44,9 @@
* Structure of a DEC/Intel/Xerox or 802.3 Ethernet header.
*/
struct ether_header {
u_int8_t ether_dhost[ETHER_ADDR_LEN];
u_int8_t ether_shost[ETHER_ADDR_LEN];
u_int16_t ether_type;
uint8_t ether_dhost[ETHER_ADDR_LEN];
uint8_t ether_shost[ETHER_ADDR_LEN];
uint16_t ether_type;
};
/*

View File

@ -17,8 +17,6 @@
* 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/ethertype.h,v 1.30 2008-02-06 10:47:53 guy Exp $ (LBL)
*/
/*
@ -168,11 +166,14 @@
#ifndef ETHERTYPE_RRCP
#define ETHERTYPE_RRCP 0x8899
#endif
#ifndef ETHERTYPE_AOE
#define ETHERTYPE_AOE 0x88a2
#endif
#ifndef ETHERTYPE_LOOPBACK
#define ETHERTYPE_LOOPBACK 0x9000
#endif
#ifndef ETHERTYPE_VMAN
#define ETHERTYPE_VMAN 0x9100 /* Extreme VMAN Protocol */
#define ETHERTYPE_VMAN 0x9100 /* Extreme VMAN Protocol */
#endif
#ifndef ETHERTYPE_CFM_OLD
#define ETHERTYPE_CFM_OLD 0xabcd /* 802.1ag depreciated */
@ -180,8 +181,20 @@
#ifndef ETHERTYPE_CFM
#define ETHERTYPE_CFM 0x8902 /* 802.1ag */
#endif
#ifndef ETHERTYPE_IEEE1905_1
#define ETHERTYPE_IEEE1905_1 0x893a /* IEEE 1905.1 */
#endif
#ifndef ETHERTYPE_ISO
#define ETHERTYPE_ISO 0xfefe /* nonstandard - used in Cisco HDLC encapsulation */
#endif
#ifndef ETHERTYPE_CALM_FAST
#define ETHERTYPE_CALM_FAST 0x1111 /* ISO CALM FAST */
#endif
#ifndef ETHERTYPE_GEONET_OLD
#define ETHERTYPE_GEONET_OLD 0x0707 /* ETSI GeoNetworking (before Jan 2013) */
#endif
#ifndef ETHERTYPE_GEONET
#define ETHERTYPE_GEONET 0x8947 /* ETSI GeoNetworking (Official IEEE registration from Jan 2013) */
#endif
extern const struct tok ethertype_values[];

194
extract.h
View File

@ -17,8 +17,6 @@
* 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/extract.h,v 1.25 2006-01-30 16:20:07 hannes Exp $ (LBL)
*/
/*
@ -28,104 +26,168 @@
/*
* The processor doesn't natively handle unaligned loads.
*/
#ifdef HAVE___ATTRIBUTE__
#if defined(__GNUC__) && defined(HAVE___ATTRIBUTE__) && \
(defined(__alpha) || defined(__alpha__) || \
defined(__mips) || defined(__mips__))
/*
* We have __attribute__; we assume that means we have __attribute__((packed)).
* Declare packed structures containing a u_int16_t and a u_int32_t,
* This is a GCC-compatible compiler and we have __attribute__, which
* we assume that mean we have __attribute__((packed)), and this is
* MIPS or Alpha, which has instructions that can help when doing
* unaligned loads.
*
* Declare packed structures containing a uint16_t and a uint32_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.)
* We do this in case the compiler can generate code using those
* instructions to do an unaligned load and pass stuff to "ntohs()" or
* "ntohl()", which might be better than 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, such as DEC's MIPS machines and
* Alpha machines, where "ntohs()" and "ntohl()" might not be done
* inline.)
*
* We do this only for specific architectures because, for example,
* at least some versions of GCC, when compiling for 64-bit SPARC,
* generate code that assumes alignment if we do this.
*
* XXX - add other architectures and compilers as possible and
* appropriate.
*
* HP's C compiler, indicated by __HP_cc being defined, supports
* "#pragma unaligned N" in version A.05.50 and later, where "N"
* specifies a number of bytes at which the typedef on the next
* line is aligned, e.g.
*
* #pragma unalign 1
* typedef uint16_t unaligned_uint16_t;
*
* to define unaligned_uint16_t as a 16-bit unaligned data type.
* This could be presumably used, in sufficiently recent versions of
* the compiler, with macros similar to those below. This would be
* useful only if that compiler could generate better code for PA-RISC
* or Itanium than would be generated by a bunch of shifts-and-ORs.
*
* DEC C, indicated by __DECC being defined, has, at least on Alpha,
* an __unaligned qualifier that can be applied to pointers to get the
* compiler to generate code that does unaligned loads and stores when
* dereferencing the pointer in question.
*
* XXX - what if the native C compiler doesn't support
* __attribute__((packed))? How can we get it to generate unaligned
* accesses for *specific* items?
*/
typedef struct {
u_int16_t val;
} __attribute__((packed)) unaligned_u_int16_t;
uint16_t val;
} __attribute__((packed)) unaligned_uint16_t;
typedef struct {
u_int32_t val;
} __attribute__((packed)) unaligned_u_int32_t;
uint32_t val;
} __attribute__((packed)) unaligned_uint32_t;
static inline u_int16_t
static inline uint16_t
EXTRACT_16BITS(const void *p)
{
return ((u_int16_t)ntohs(((const unaligned_u_int16_t *)(p))->val));
return ((uint16_t)ntohs(((const unaligned_uint16_t *)(p))->val));
}
static inline u_int32_t
static inline uint32_t
EXTRACT_32BITS(const void *p)
{
return ((u_int32_t)ntohl(((const unaligned_u_int32_t *)(p))->val));
return ((uint32_t)ntohl(((const unaligned_uint32_t *)(p))->val));
}
static inline u_int64_t
static inline uint64_t
EXTRACT_64BITS(const void *p)
{
return ((u_int64_t)(((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 0)->val)) << 32 | \
((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 1)->val)) << 0));
return ((uint64_t)(((uint64_t)ntohl(((const unaligned_uint32_t *)(p) + 0)->val)) << 32 | \
((uint64_t)ntohl(((const unaligned_uint32_t *)(p) + 1)->val)) << 0));
}
#else /* HAVE___ATTRIBUTE__ */
#else /* have to do it a byte at a time */
/*
* We don't have __attribute__, so do unaligned loads of big-endian
* This isn't a GCC-compatible compiler, we don't have __attribute__,
* or we do but we don't know of any better way with this instruction
* set to do unaligned loads, so do unaligned loads of big-endian
* 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)))
((uint16_t)((uint16_t)*((const uint8_t *)(p) + 0) << 8 | \
(uint16_t)*((const uint8_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)))
((uint32_t)((uint32_t)*((const uint8_t *)(p) + 0) << 24 | \
(uint32_t)*((const uint8_t *)(p) + 1) << 16 | \
(uint32_t)*((const uint8_t *)(p) + 2) << 8 | \
(uint32_t)*((const uint8_t *)(p) + 3)))
#define EXTRACT_64BITS(p) \
((u_int64_t)((u_int64_t)*((const u_int8_t *)(p) + 0) << 56 | \
(u_int64_t)*((const u_int8_t *)(p) + 1) << 48 | \
(u_int64_t)*((const u_int8_t *)(p) + 2) << 40 | \
(u_int64_t)*((const u_int8_t *)(p) + 3) << 32 | \
(u_int64_t)*((const u_int8_t *)(p) + 4) << 24 | \
(u_int64_t)*((const u_int8_t *)(p) + 5) << 16 | \
(u_int64_t)*((const u_int8_t *)(p) + 6) << 8 | \
(u_int64_t)*((const u_int8_t *)(p) + 7)))
#endif /* HAVE___ATTRIBUTE__ */
((uint64_t)((uint64_t)*((const uint8_t *)(p) + 0) << 56 | \
(uint64_t)*((const uint8_t *)(p) + 1) << 48 | \
(uint64_t)*((const uint8_t *)(p) + 2) << 40 | \
(uint64_t)*((const uint8_t *)(p) + 3) << 32 | \
(uint64_t)*((const uint8_t *)(p) + 4) << 24 | \
(uint64_t)*((const uint8_t *)(p) + 5) << 16 | \
(uint64_t)*((const uint8_t *)(p) + 6) << 8 | \
(uint64_t)*((const uint8_t *)(p) + 7)))
#endif /* must special-case unaligned accesses */
#else /* LBL_ALIGN */
/*
* The processor natively handles unaligned loads, so we can just
* cast the pointer and fetch through it.
*/
static inline u_int16_t
static inline uint16_t
EXTRACT_16BITS(const void *p)
{
return ((u_int16_t)ntohs(*(const u_int16_t *)(p)));
return ((uint16_t)ntohs(*(const uint16_t *)(p)));
}
static inline u_int32_t
static inline uint32_t
EXTRACT_32BITS(const void *p)
{
return ((u_int32_t)ntohl(*(const u_int32_t *)(p)));
return ((uint32_t)ntohl(*(const uint32_t *)(p)));
}
static inline u_int64_t
static inline uint64_t
EXTRACT_64BITS(const void *p)
{
return ((u_int64_t)(((u_int64_t)ntohl(*((const u_int32_t *)(p) + 0))) << 32 | \
((u_int64_t)ntohl(*((const u_int32_t *)(p) + 1))) << 0));
return ((uint64_t)(((uint64_t)ntohl(*((const uint32_t *)(p) + 0))) << 32 | \
((uint64_t)ntohl(*((const uint32_t *)(p) + 1))) << 0));
}
#endif /* LBL_ALIGN */
#define EXTRACT_24BITS(p) \
((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) + 2)))
((uint32_t)((uint32_t)*((const uint8_t *)(p) + 0) << 16 | \
(uint32_t)*((const uint8_t *)(p) + 1) << 8 | \
(uint32_t)*((const uint8_t *)(p) + 2)))
#define EXTRACT_40BITS(p) \
((uint64_t)((uint64_t)*((const uint8_t *)(p) + 0) << 32 | \
(uint64_t)*((const uint8_t *)(p) + 1) << 24 | \
(uint64_t)*((const uint8_t *)(p) + 2) << 16 | \
(uint64_t)*((const uint8_t *)(p) + 3) << 8 | \
(uint64_t)*((const uint8_t *)(p) + 4)))
#define EXTRACT_48BITS(p) \
((uint64_t)((uint64_t)*((const uint8_t *)(p) + 0) << 40 | \
(uint64_t)*((const uint8_t *)(p) + 1) << 32 | \
(uint64_t)*((const uint8_t *)(p) + 2) << 24 | \
(uint64_t)*((const uint8_t *)(p) + 3) << 16 | \
(uint64_t)*((const uint8_t *)(p) + 4) << 8 | \
(uint64_t)*((const uint8_t *)(p) + 5)))
#define EXTRACT_56BITS(p) \
((uint64_t)((uint64_t)*((const uint8_t *)(p) + 0) << 48 | \
(uint64_t)*((const uint8_t *)(p) + 1) << 40 | \
(uint64_t)*((const uint8_t *)(p) + 2) << 32 | \
(uint64_t)*((const uint8_t *)(p) + 3) << 24 | \
(uint64_t)*((const uint8_t *)(p) + 4) << 16 | \
(uint64_t)*((const uint8_t *)(p) + 5) << 8 | \
(uint64_t)*((const uint8_t *)(p) + 6)))
/*
* Macros to extract possibly-unaligned little-endian integral values.
@ -133,23 +195,23 @@ EXTRACT_64BITS(const void *p)
*/
#define EXTRACT_LE_8BITS(p) (*(p))
#define EXTRACT_LE_16BITS(p) \
((u_int16_t)((u_int16_t)*((const u_int8_t *)(p) + 1) << 8 | \
(u_int16_t)*((const u_int8_t *)(p) + 0)))
((uint16_t)((uint16_t)*((const uint8_t *)(p) + 1) << 8 | \
(uint16_t)*((const uint8_t *)(p) + 0)))
#define EXTRACT_LE_32BITS(p) \
((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) + 1) << 8 | \
(u_int32_t)*((const u_int8_t *)(p) + 0)))
((uint32_t)((uint32_t)*((const uint8_t *)(p) + 3) << 24 | \
(uint32_t)*((const uint8_t *)(p) + 2) << 16 | \
(uint32_t)*((const uint8_t *)(p) + 1) << 8 | \
(uint32_t)*((const uint8_t *)(p) + 0)))
#define EXTRACT_LE_24BITS(p) \
((u_int32_t)((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) + 0)))
((uint32_t)((uint32_t)*((const uint8_t *)(p) + 2) << 16 | \
(uint32_t)*((const uint8_t *)(p) + 1) << 8 | \
(uint32_t)*((const uint8_t *)(p) + 0)))
#define EXTRACT_LE_64BITS(p) \
((u_int64_t)((u_int64_t)*((const u_int8_t *)(p) + 7) << 56 | \
(u_int64_t)*((const u_int8_t *)(p) + 6) << 48 | \
(u_int64_t)*((const u_int8_t *)(p) + 5) << 40 | \
(u_int64_t)*((const u_int8_t *)(p) + 4) << 32 | \
(u_int64_t)*((const u_int8_t *)(p) + 3) << 24 | \
(u_int64_t)*((const u_int8_t *)(p) + 2) << 16 | \
(u_int64_t)*((const u_int8_t *)(p) + 1) << 8 | \
(u_int64_t)*((const u_int8_t *)(p) + 0)))
((uint64_t)((uint64_t)*((const uint8_t *)(p) + 7) << 56 | \
(uint64_t)*((const uint8_t *)(p) + 6) << 48 | \
(uint64_t)*((const uint8_t *)(p) + 5) << 40 | \
(uint64_t)*((const uint8_t *)(p) + 4) << 32 | \
(uint64_t)*((const uint8_t *)(p) + 3) << 24 | \
(uint64_t)*((const uint8_t *)(p) + 2) << 16 | \
(uint64_t)*((const uint8_t *)(p) + 1) << 8 | \
(uint64_t)*((const uint8_t *)(p) + 0)))

76
fddi.h
View File

@ -1,76 +0,0 @@
/*
* 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/fddi.h,v 1.11 2002-12-11 07:13:51 guy Exp $ (LBL)
*/
/*
* Based on Ultrix if_fddi.h
*/
/*
* This stuff should come from a system header file, but there's no
* obviously portable way to do that and it's not really going
* to change from system to system (except for the padding business).
*/
struct fddi_header {
u_char fddi_fc; /* frame control */
u_char fddi_dhost[6];
u_char fddi_shost[6];
};
/*
* Length of an FDDI header; note that some compilers may pad
* "struct fddi_header" to a multiple of 4 bytes, for example, so
* "sizeof (struct fddi_header)" may not give the right
* answer.
*/
#define FDDI_HDRLEN 13
/* Useful values for fddi_fc (frame control) field */
/*
* FDDI Frame Control bits
*/
#define FDDIFC_C 0x80 /* Class bit */
#define FDDIFC_L 0x40 /* Address length bit */
#define FDDIFC_F 0x30 /* Frame format bits */
#define FDDIFC_Z 0x0f /* Control bits */
/*
* FDDI Frame Control values. (48-bit addressing only).
*/
#define FDDIFC_VOID 0x40 /* Void frame */
#define FDDIFC_NRT 0x80 /* Nonrestricted token */
#define FDDIFC_RT 0xc0 /* Restricted token */
#define FDDIFC_SMT_INFO 0x41 /* SMT Info */
#define FDDIFC_SMT_NSA 0x4F /* SMT Next station adrs */
#define FDDIFC_MAC_BEACON 0xc2 /* MAC Beacon frame */
#define FDDIFC_MAC_CLAIM 0xc3 /* MAC Claim frame */
#define FDDIFC_LLC_ASYNC 0x50 /* Async. LLC frame */
#define FDDIFC_LLC_SYNC 0xd0 /* Sync. LLC frame */
#define FDDIFC_IMP_ASYNC 0x60 /* Implementor Async. */
#define FDDIFC_IMP_SYNC 0xe0 /* Implementor Synch. */
#define FDDIFC_SMT 0x40 /* SMT frame */
#define FDDIFC_MAC 0xc0 /* MAC frame */
#define FDDIFC_CLFF 0xF0 /* Class/Length/Format bits */
#define FDDIFC_ZZZZ 0x0F /* Control bits */

679
forces.h
View File

@ -1,679 +0,0 @@
/*
* Copyright (c) 1982, 1986, 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.
*
* Copyright (c) 2009 Mojatatu Networks, Inc
*
*/
/*
* Per draft-ietf-forces-protocol-22
*/
#define ForCES_VERS 1
#define ForCES_HDRL 24
#define ForCES_ALNL 4U
#define TLV_HDRL 4
#define ILV_HDRL 8
#define TOM_RSVD 0x0
#define TOM_ASSNSETUP 0x1
#define TOM_ASSNTEARD 0x2
#define TOM_CONFIG 0x3
#define TOM_QUERY 0x4
#define TOM_EVENTNOT 0x5
#define TOM_PKTREDIR 0x6
#define TOM_HEARTBT 0x0F
#define TOM_ASSNSETREP 0x11
#define TOM_CONFIGREP 0x13
#define TOM_QUERYREP 0x14
/*
* tom_h Flags: resv1(8b):maxtlvs(4b):resv2(2b):mintlv(2b)
*/
#define ZERO_TTLV 0x01
#define ZERO_MORE_TTLV 0x02
#define ONE_MORE_TTLV 0x04
#define ZERO_TLV 0x00
#define ONE_TLV 0x10
#define TWO_TLV 0x20
#define MAX_TLV 0xF0
#define TTLV_T1 (ONE_MORE_TTLV|ONE_TLV)
#define TTLV_T2 (ONE_MORE_TTLV|MAX_TLV)
struct tom_h {
u_int32_t v;
u_int16_t flags;
u_int16_t op_msk;
const char *s;
int (*print) (register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
};
enum {
TOM_RSV_I,
TOM_ASS_I,
TOM_AST_I,
TOM_CFG_I,
TOM_QRY_I,
TOM_EVN_I,
TOM_RED_I,
TOM_HBT_I,
TOM_ASR_I,
TOM_CNR_I,
TOM_QRR_I,
_TOM_RSV_MAX
};
#define TOM_MAX_IND (_TOM_RSV_MAX - 1)
int lfbselect_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int redirect_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int asrtlv_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int asttlv_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int gentltlv_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int print_metailv(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int print_metatlv(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int print_reddata(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
static inline int tom_valid(u_int8_t tom)
{
if (tom > 0) {
if (tom >= 0x7 && tom <= 0xe)
return 0;
if (tom == 0x10)
return 0;
if (tom > 0x14)
return 0;
return 1;
} else
return 0;
}
static inline const char *ForCES_node(u_int32_t node)
{
if (node <= 0x3FFFFFFF)
return "FE";
if (node >= 0x40000000 && node <= 0x7FFFFFFF)
return "CE";
if (node >= 0xC0000000 && node <= 0xFFFFFFEF)
return "AllMulticast";
if (node == 0xFFFFFFFD)
return "AllCEsBroadcast";
if (node == 0xFFFFFFFE)
return "AllFEsBroadcast";
if (node == 0xFFFFFFFF)
return "AllBroadcast";
return "ForCESreserved";
}
static inline const char *ForCES_ACKp(u_int32_t flg)
{
if (flg == 0x0)
return "NoACK";
if (flg == 0x1)
return "SuccessACK";
if (flg == 0x2)
return "FailureACK";
if (flg == 0x3)
return "AlwaysACK";
return "ACKUnknown";
}
static inline const char *ForCES_EMp(u_int32_t flg)
{
if (flg == 0x0)
return "EMReserved";
if (flg == 0x1)
return "execute-all-or-none";
if (flg == 0x2)
return "execute-until-failure";
if (flg == 0x3)
return "continue-execute-on-failure";
return "EMUnknown";
}
static inline const char *ForCES_ATp(u_int32_t flg)
{
if (flg == 0x0)
return "Standalone";
if (flg == 0x1)
return "2PCtransaction";
return "ATUnknown";
}
static inline const char *ForCES_TPp(u_int32_t flg)
{
if (flg == 0x0)
return "StartofTransaction";
if (flg == 0x1)
return "MiddleofTransaction";
if (flg == 0x2)
return "EndofTransaction";
if (flg == 0x3)
return "abort";
return "TPUnknown";
}
/*
* Structure of forces header, naked of TLVs.
*/
struct forcesh {
u_int8_t fm_vrsvd; /* version and reserved */
#define ForCES_V(forcesh) ((forcesh)->fm_vrsvd >> 4)
u_int8_t fm_tom; /* type of message */
u_int16_t fm_len; /* total length * 4 bytes */
#define ForCES_BLN(forcesh) ((u_int32_t)(EXTRACT_16BITS(&(forcesh)->fm_len) << 2))
u_int32_t fm_sid; /* Source ID */
#define ForCES_SID(forcesh) EXTRACT_32BITS(&(forcesh)->fm_sid)
u_int32_t fm_did; /* Destination ID */
#define ForCES_DID(forcesh) EXTRACT_32BITS(&(forcesh)->fm_did)
u_int8_t fm_cor[8]; /* correlator */
u_int32_t fm_flags; /* flags */
#define ForCES_ACK(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0xC0000000) >> 30)
#define ForCES_PRI(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x38000000) >> 27)
#define ForCES_RS1(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x07000000) >> 24)
#define ForCES_EM(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x00C00000) >> 22)
#define ForCES_AT(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x00200000) >> 21)
#define ForCES_TP(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x00180000) >> 19)
#define ForCES_RS2(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x0007FFFF) >> 0)
};
#define ForCES_HLN_VALID(fhl,tlen) ((tlen) >= ForCES_HDRL && \
(fhl) >= ForCES_HDRL && \
(fhl) == (tlen))
#define F_LFB_RSVD 0x0
#define F_LFB_FEO 0x1
#define F_LFB_FEPO 0x2
const struct tok ForCES_LFBs[] = {
{F_LFB_RSVD, "Invalid TLV"},
{F_LFB_FEO, "FEObj LFB"},
{F_LFB_FEPO, "FEProtoObj LFB"},
{0, NULL}
};
int forces_type_print(register const u_char * pptr, const struct forcesh *fhdr,
register u_int mlen, const struct tom_h *tops);
enum {
F_OP_RSV,
F_OP_SET,
F_OP_SETPROP,
F_OP_SETRESP,
F_OP_SETPRESP,
F_OP_DEL,
F_OP_DELRESP,
F_OP_GET,
F_OP_GETPROP,
F_OP_GETRESP,
F_OP_GETPRESP,
F_OP_REPORT,
F_OP_COMMIT,
F_OP_RCOMMIT,
F_OP_RTRCOMP,
_F_OP_MAX
};
#define F_OP_MAX (_F_OP_MAX - 1)
enum {
B_OP_SET = 1 << (F_OP_SET - 1),
B_OP_SETPROP = 1 << (F_OP_SETPROP - 1),
B_OP_SETRESP = 1 << (F_OP_SETRESP - 1),
B_OP_SETPRESP = 1 << (F_OP_SETPRESP - 1),
B_OP_DEL = 1 << (F_OP_DEL - 1),
B_OP_DELRESP = 1 << (F_OP_DELRESP - 1),
B_OP_GET = 1 << (F_OP_GET - 1),
B_OP_GETPROP = 1 << (F_OP_GETPROP - 1),
B_OP_GETRESP = 1 << (F_OP_GETRESP - 1),
B_OP_GETPRESP = 1 << (F_OP_GETPRESP - 1),
B_OP_REPORT = 1 << (F_OP_REPORT - 1),
B_OP_COMMIT = 1 << (F_OP_COMMIT - 1),
B_OP_RCOMMIT = 1 << (F_OP_RCOMMIT - 1),
B_OP_RTRCOMP = 1 << (F_OP_RTRCOMP - 1),
};
struct optlv_h {
u_int16_t flags;
u_int16_t op_msk;
const char *s;
int (*print) (register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
};
int genoptlv_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int recpdoptlv_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int invoptlv_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
#define OP_MIN_SIZ 8
struct pathdata_h {
u_int16_t pflags;
u_int16_t pIDcnt;
};
#define B_FULLD 0x1
#define B_SPARD 0x2
#define B_RESTV 0x4
#define B_KEYIN 0x8
static const struct optlv_h OPTLV_msg[F_OP_MAX + 1] = {
/* F_OP_RSV */ {ZERO_TTLV, 0, "Invalid OPTLV", invoptlv_print},
/* F_OP_SET */ {TTLV_T2, B_FULLD | B_SPARD, " Set", recpdoptlv_print},
/* F_OP_SETPROP */
{TTLV_T2, B_FULLD | B_SPARD, " SetProp", recpdoptlv_print},
/* F_OP_SETRESP */ {TTLV_T2, B_RESTV, " SetResp", recpdoptlv_print},
/* F_OP_SETPRESP */ {TTLV_T2, B_RESTV, " SetPropResp", recpdoptlv_print},
/* F_OP_DEL */ {ZERO_TTLV, 0, " Del", recpdoptlv_print},
/* F_OP_DELRESP */ {TTLV_T2, B_RESTV, " DelResp", recpdoptlv_print},
/* F_OP_GET */ {ZERO_TTLV, 0, " Get", recpdoptlv_print},
/* F_OP_GETPROP */ {ZERO_TTLV, 0, " GetProp", recpdoptlv_print},
/* F_OP_GETRESP */
{TTLV_T2, B_FULLD | B_SPARD | B_RESTV, " GetResp", recpdoptlv_print},
/* F_OP_GETPRESP */
{TTLV_T2, B_FULLD | B_RESTV, " GetPropResp", recpdoptlv_print},
/* F_OP_REPORT */
{TTLV_T2, B_FULLD | B_SPARD, " Report", recpdoptlv_print},
/* F_OP_COMMIT */ {ZERO_TTLV, 0, " Commit", NULL},
/* F_OP_RCOMMIT */ {TTLV_T1, B_RESTV, " RCommit", genoptlv_print},
/* F_OP_RTRCOMP */ {ZERO_TTLV, 0, " RTRCOMP", NULL},
};
static inline const struct optlv_h *get_forces_optlv_h(u_int16_t opt)
{
if (opt > F_OP_MAX || opt <= F_OP_RSV)
return &OPTLV_msg[F_OP_RSV];
return &OPTLV_msg[opt];
}
#define IND_SIZE 256
#define IND_CHR ' '
#define IND_PREF '\n'
#define IND_SUF 0x0
char ind_buf[IND_SIZE];
static inline char *indent_pr(int indent, int nlpref)
{
int i = 0;
char *r = ind_buf;
if (indent > (IND_SIZE - 1))
indent = IND_SIZE - 1;
if (nlpref) {
r[i] = IND_PREF;
i++;
indent--;
}
while (--indent >= 0)
r[i++] = IND_CHR;
r[i] = IND_SUF;
return r;
}
static inline int op_valid(u_int16_t op, u_int16_t mask)
{
int opb = 1 << (op - 1);
if (op == 0)
return 0;
if (opb & mask)
return 1;
/* I guess we should allow vendor operations? */
if (op >= 0x8000)
return 1;
return 0;
}
#define F_TLV_RSVD 0x0000
#define F_TLV_REDR 0x0001
#define F_TLV_ASRS 0x0010
#define F_TLV_ASRT 0x0011
#define F_TLV_LFBS 0x1000
#define F_TLV_PDAT 0x0110
#define F_TLV_KEYI 0x0111
#define F_TLV_FULD 0x0112
#define F_TLV_SPAD 0x0113
#define F_TLV_REST 0x0114
#define F_TLV_METD 0x0115
#define F_TLV_REDD 0x0116
#define F_TLV_VNST 0x8000
static const struct tok ForCES_TLV[] = {
{F_TLV_RSVD, "Invalid TLV"},
{F_TLV_REDR, "REDIRECT TLV"},
{F_TLV_ASRS, "ASResult TLV"},
{F_TLV_ASRT, "ASTreason TLV"},
{F_TLV_LFBS, "LFBselect TLV"},
{F_TLV_PDAT, "PATH-DATA TLV"},
{F_TLV_KEYI, "KEYINFO TLV"},
{F_TLV_FULD, "FULLDATA TLV"},
{F_TLV_SPAD, "SPARSEDATA TLV"},
{F_TLV_REST, "RESULT TLV"},
{F_TLV_METD, "METADATA TLV"},
{F_TLV_REDD, "REDIRECTDATA TLV"},
{0, NULL}
};
#define TLV_HLN 4
static inline int ttlv_valid(u_int16_t ttlv)
{
if (ttlv > 0) {
if (ttlv == 1 || ttlv == 0x1000)
return 1;
if (ttlv >= 0x10 && ttlv <= 0x11)
return 1;
if (ttlv >= 0x110 && ttlv <= 0x116)
return 1;
if (ttlv >= 0x8000)
return 0; /* XXX: */
}
return 0;
}
struct forces_ilv {
u_int32_t type;
u_int32_t length;
};
struct forces_tlv {
u_int16_t type;
u_int16_t length;
};
int otlv_print(const struct forces_tlv *otlv, u_int16_t op_msk, int indent);
#define F_ALN_LEN(len) ( ((len)+ForCES_ALNL-1) & ~(ForCES_ALNL-1) )
#define GET_TOP_TLV(fhdr) ((struct forces_tlv *)((fhdr) + sizeof (struct forcesh)))
#define TLV_SET_LEN(len) (F_ALN_LEN(TLV_HDRL) + (len))
#define TLV_ALN_LEN(len) F_ALN_LEN(TLV_SET_LEN(len))
#define TLV_RDAT_LEN(tlv) ((int)(EXTRACT_16BITS(&(tlv)->length) - TLV_SET_LEN(0))
#define TLV_DATA(tlvp) ((void*)(((char*)(tlvp)) + TLV_SET_LEN(0)))
#define GO_NXT_TLV(tlv,rlen) ((rlen) -= F_ALN_LEN(EXTRACT_16BITS(&(tlv)->length)), \
(struct forces_tlv*)(((char*)(tlv)) \
+ F_ALN_LEN(EXTRACT_16BITS(&(tlv)->length))))
#define ILV_SET_LEN(len) (F_ALN_LEN(ILV_HDRL) + (len))
#define ILV_ALN_LEN(len) F_ALN_LEN(ILV_SET_LEN(len))
#define ILV_RDAT_LEN(ilv) ((int)(EXTRACT_32BITS(&(ilv)->length)) - ILV_SET_LEN(0))
#define ILV_DATA(ilvp) ((void*)(((char*)(ilvp)) + ILV_SET_LEN(0)))
#define GO_NXT_ILV(ilv,rlen) ((rlen) -= F_ALN_LEN(EXTRACT_32BITS(&(ilv)->length)), \
(struct forces_ilv *)(((char*)(ilv)) \
+ F_ALN_LEN(EXTRACT_32BITS(&(ilv)->length))))
#define INVALID_RLEN -1
#define INVALID_STLN -2
#define INVALID_LTLN -3
#define INVALID_ALEN -4
static const struct tok ForCES_TLV_err[] = {
{INVALID_RLEN, "Invalid total length"},
{INVALID_STLN, "xLV too short"},
{INVALID_LTLN, "xLV too long"},
{INVALID_ALEN, "data padding missing"},
{0, NULL}
};
static inline int tlv_valid(const struct forces_tlv *tlv, u_int rlen)
{
if (rlen < TLV_HDRL)
return INVALID_RLEN;
if (EXTRACT_16BITS(&tlv->length) < TLV_HDRL)
return INVALID_STLN;
if (EXTRACT_16BITS(&tlv->length) > rlen)
return INVALID_LTLN;
if (rlen < F_ALN_LEN(EXTRACT_16BITS(&tlv->length)))
return INVALID_ALEN;
return 0;
}
static inline int ilv_valid(const struct forces_ilv *ilv, u_int rlen)
{
if (rlen < ILV_HDRL)
return INVALID_RLEN;
if (EXTRACT_32BITS(&ilv->length) < ILV_HDRL)
return INVALID_STLN;
if (EXTRACT_32BITS(&ilv->length) > rlen)
return INVALID_LTLN;
if (rlen < F_ALN_LEN(EXTRACT_32BITS(&ilv->length)))
return INVALID_ALEN;
return 0;
}
struct forces_lfbsh {
u_int32_t class;
u_int32_t instance;
};
#define ASSNS_OPS (B_OP_REPORT)
#define CFG_OPS (B_OP_SET|B_OP_SETPROP|B_OP_DEL|B_OP_COMMIT|B_OP_RTRCOMP)
#define CFG_ROPS (B_OP_SETRESP|B_OP_SETPRESP|B_OP_DELRESP|B_OP_RCOMMIT)
#define CFG_QY (B_OP_GET|B_OP_GETPROP)
#define CFG_QYR (B_OP_GETRESP|B_OP_GETPRESP)
#define CFG_EVN (B_OP_REPORT)
static const struct tom_h ForCES_msg[TOM_MAX_IND + 1] = {
/* TOM_RSV_I */ {TOM_RSVD, ZERO_TTLV, 0, "Invalid message", NULL},
/* TOM_ASS_I */ {TOM_ASSNSETUP, ZERO_MORE_TTLV | TWO_TLV, ASSNS_OPS,
"Association Setup", lfbselect_print},
/* TOM_AST_I */
{TOM_ASSNTEARD, TTLV_T1, 0, "Association TearDown", asttlv_print},
/* TOM_CFG_I */ {TOM_CONFIG, TTLV_T2, CFG_OPS, "Config", lfbselect_print},
/* TOM_QRY_I */ {TOM_QUERY, TTLV_T2, CFG_QY, "Query", lfbselect_print},
/* TOM_EVN_I */ {TOM_EVENTNOT, TTLV_T1, CFG_EVN, "Event Notification",
lfbselect_print},
/* TOM_RED_I */
{TOM_PKTREDIR, TTLV_T2, 0, "Packet Redirect", redirect_print},
/* TOM_HBT_I */ {TOM_HEARTBT, ZERO_TTLV, 0, "HeartBeat", NULL},
/* TOM_ASR_I */
{TOM_ASSNSETREP, TTLV_T1, 0, "Association Response", asrtlv_print},
/* TOM_CNR_I */ {TOM_CONFIGREP, TTLV_T2, CFG_ROPS, "Config Response",
lfbselect_print},
/* TOM_QRR_I */
{TOM_QUERYREP, TTLV_T2, CFG_QYR, "Query Response", lfbselect_print},
};
static inline const struct tom_h *get_forces_tom(u_int8_t tom)
{
int i;
for (i = TOM_RSV_I; i <= TOM_MAX_IND; i++) {
const struct tom_h *th = &ForCES_msg[i];
if (th->v == tom)
return th;
}
return &ForCES_msg[TOM_RSV_I];
}
struct pdata_ops {
u_int32_t v;
u_int16_t flags;
u_int16_t op_msk;
const char *s;
int (*print) (register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
};
enum {
PD_RSV_I,
PD_SEL_I,
PD_FDT_I,
PD_SDT_I,
PD_RES_I,
PD_PDT_I,
_PD_RSV_MAX
};
#define PD_MAX_IND (_TOM_RSV_MAX - 1)
static inline int pd_valid(u_int16_t pd)
{
if (pd >= F_TLV_PDAT && pd <= F_TLV_REST)
return 1;
return 0;
}
static inline void chk_op_type(u_int16_t type, u_int16_t msk, u_int16_t omsk)
{
if (type != F_TLV_PDAT) {
if (msk & B_KEYIN) {
if (type != F_TLV_KEYI) {
printf
("Based on flags expected KEYINFO TLV!\n");
}
} else {
if (!(msk & omsk)) {
printf
("Illegal DATA encoding for type 0x%x programmed %x got %x \n",
type, omsk, msk);
}
}
}
}
int fdatatlv_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int sdatailv_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int sdatatlv_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int pdatatlv_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int pkeyitlv_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int pdatacnt_print(register const u_char * pptr, register u_int len,
u_int16_t IDcnt, u_int16_t op_msk, int indent);
int pdata_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
int prestlv_print(register const u_char * pptr, register u_int len,
u_int16_t op_msk, int indent);
#define F_SELKEY 1
struct res_val {
u_int8_t result;
u_int8_t resv1;
u_int16_t resv2;
};
static const struct pdata_ops ForCES_pdata[PD_MAX_IND + 1] = {
/* PD_RSV_I */ {0, 0, 0, "Invalid message", NULL},
/* PD_SEL_I */ {F_TLV_KEYI, 0, 0, "KEYINFO TLV", pkeyitlv_print},
/* PD_FDT_I */ {F_TLV_FULD, 0, B_FULLD, "FULLDATA TLV", fdatatlv_print},
/* PD_SDT_I */ {F_TLV_SPAD, 0, B_SPARD, "SPARSEDATA TLV", sdatatlv_print},
/* PD_RES_I */ {F_TLV_REST, 0, B_RESTV, "RESULT TLV", prestlv_print},
/* PD_PDT_I */
{F_TLV_PDAT, 0, 0, "Inner PATH-DATA TLV", recpdoptlv_print},
};
static inline const struct pdata_ops *get_forces_pd(u_int16_t pd)
{
int i;
for (i = PD_RSV_I + 1; i <= PD_MAX_IND; i++) {
const struct pdata_ops *pdo = &ForCES_pdata[i];
if (pdo->v == pd)
return pdo;
}
return &ForCES_pdata[TOM_RSV_I];
}
enum {
E_SUCCESS,
E_INVALID_HEADER,
E_LENGTH_MISMATCH,
E_VERSION_MISMATCH,
E_INVALID_DESTINATION_PID,
E_LFB_UNKNOWN,
E_LFB_NOT_FOUND,
E_LFB_INSTANCE_ID_NOT_FOUND,
E_INVALID_PATH,
E_COMPONENT_DOES_NOT_EXIST,
E_EXISTS,
E_NOT_FOUND,
E_READ_ONLY,
E_INVALID_ARRAY_CREATION,
E_VALUE_OUT_OF_RANGE,
E_CONTENTS_TOO_LONG,
E_INVALID_PARAMETERS,
E_INVALID_MESSAGE_TYPE,
E_INVALID_FLAGS,
E_INVALID_TLV,
E_EVENT_ERROR,
E_NOT_SUPPORTED,
E_MEMORY_ERROR,
E_INTERNAL_ERROR,
/* 0x18-0xFE are reserved .. */
E_UNSPECIFIED_ERROR = 0XFF
};
const struct tok ForCES_errs[] = {
{E_SUCCESS, "SUCCESS"},
{E_INVALID_HEADER, "INVALID HEADER"},
{E_LENGTH_MISMATCH, "LENGTH MISMATCH"},
{E_VERSION_MISMATCH, "VERSION MISMATCH"},
{E_INVALID_DESTINATION_PID, "INVALID DESTINATION PID"},
{E_LFB_UNKNOWN, "LFB UNKNOWN"},
{E_LFB_NOT_FOUND, "LFB NOT FOUND"},
{E_LFB_INSTANCE_ID_NOT_FOUND, "LFB INSTANCE ID NOT FOUND"},
{E_INVALID_PATH, "INVALID PATH"},
{E_COMPONENT_DOES_NOT_EXIST, "COMPONENT DOES NOT EXIST"},
{E_EXISTS, "EXISTS ALREADY"},
{E_NOT_FOUND, "NOT FOUND"},
{E_READ_ONLY, "READ ONLY"},
{E_INVALID_ARRAY_CREATION, "INVALID ARRAY CREATION"},
{E_VALUE_OUT_OF_RANGE, "VALUE OUT OF RANGE"},
{E_CONTENTS_TOO_LONG, "CONTENTS TOO LONG"},
{E_INVALID_PARAMETERS, "INVALID PARAMETERS"},
{E_INVALID_MESSAGE_TYPE, "INVALID MESSAGE TYPE"},
{E_INVALID_FLAGS, "INVALID FLAGS"},
{E_INVALID_TLV, "INVALID TLV"},
{E_EVENT_ERROR, "EVENT ERROR"},
{E_NOT_SUPPORTED, "NOT SUPPORTED"},
{E_MEMORY_ERROR, "MEMORY ERROR"},
{E_INTERNAL_ERROR, "INTERNAL ERROR"},
{E_UNSPECIFIED_ERROR, "UNSPECIFIED ERROR"},
{0, NULL}
};

66
getopt_long.h Normal file
View File

@ -0,0 +1,66 @@
/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */
/* $FreeBSD$ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Dieter Baron and Thomas Klausner.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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 _GETOPT_LONG_H_
#define _GETOPT_LONG_H_
/*
* GNU-like getopt_long()/getopt_long_only() with 4.4BSD optreset extension.
* getopt() is declared here too for GNU programs.
*/
#define no_argument 0
#define required_argument 1
#define optional_argument 2
struct option {
/* name of long option */
const char *name;
/*
* one of no_argument, required_argument, and optional_argument:
* whether option takes an argument
*/
int has_arg;
/* if not NULL, set *flag to val when option found */
int *flag;
/* if flag not NULL, value to set *flag to; else return value */
int val;
};
int getopt_long(int, char * const *, const char *,
const struct option *, int *);
int getopt_long_only(int, char * const *, const char *,
const struct option *, int *);
extern char *optarg; /* getopt(3) external variables */
extern int optind, opterr, optopt;
#endif /* !_GETOPT_LONG_H_ */

26
gmpls.c
View File

@ -1,4 +1,4 @@
/*
/*
* 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
@ -13,11 +13,7 @@
* Original code by Hannes Gredler (hannes@juniper.net)
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/gmpls.c,v 1.7 2006-04-14 07:11:59 hannes Exp $ (LBL)";
#endif
#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@ -141,8 +137,8 @@ const struct tok gmpls_payload_values[] = {
{ 0, NULL }
};
/*
* Link Type values used by LMP Service Discovery (specifically, the Client
/*
* Link Type values used by LMP Service Discovery (specifically, the Client
* Port Service Attributes Object). See UNI 1.0 section 9.4.2 for details.
*/
const struct tok lmp_sd_service_config_cpsa_link_type_values[] = {
@ -151,9 +147,9 @@ const struct tok lmp_sd_service_config_cpsa_link_type_values[] = {
{ 0, NULL}
};
/*
* Signal Type values for SDH links used by LMP Service Discovery (specifically,
* the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for
/*
* Signal Type values for SDH links used by LMP Service Discovery (specifically,
* the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for
* details.
*/
const struct tok lmp_sd_service_config_cpsa_signal_type_sdh_values[] = {
@ -168,9 +164,9 @@ const struct tok lmp_sd_service_config_cpsa_signal_type_sdh_values[] = {
{ 0, NULL}
};
/*
* Signal Type values for SONET links used by LMP Service Discovery (specifically,
* the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for
/*
* Signal Type values for SONET links used by LMP Service Discovery (specifically,
* the Client Port Service Attributes Object). See UNI 1.0 section 9.4.2 for
* details.
*/
const struct tok lmp_sd_service_config_cpsa_signal_type_sonet_values[] = {
@ -186,7 +182,7 @@ const struct tok lmp_sd_service_config_cpsa_signal_type_sonet_values[] = {
};
#define DIFFSERV_BC_MODEL_RDM 0 /* draft-ietf-tewg-diff-te-proto-07 */
#define DIFFSERV_BC_MODEL_MAM 1 /* draft-ietf-tewg-diff-te-proto-07 */
#define DIFFSERV_BC_MODEL_MAM 1 /* draft-ietf-tewg-diff-te-proto-07 */
#define DIFFSERV_BC_MODEL_EXTD_MAM 254 /* experimental */
const struct tok diffserv_te_bc_values[] = {

View File

@ -1,5 +1,4 @@
/* @(#) $Header: /tcpdump/master/tcpdump/gmpls.h,v 1.5 2006-04-14 07:11:59 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

View File

@ -19,11 +19,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/gmt2local.c,v 1.9 2003-11-16 09:36:09 guy Exp $ (LBL)";
#endif
#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

View File

@ -17,8 +17,6 @@
* 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/gmt2local.h,v 1.2 1999-10-07 23:47:10 mcr Exp $ (LBL)
*/
#ifndef gmt2local_h
#define gmt2local_h

473
icmp6.h
View File

@ -1,473 +0,0 @@
/* @(#) $Header: /tcpdump/master/tcpdump/icmp6.h,v 1.18 2007-08-29 02:31:44 mcr Exp $ (LBL) */
/* NetBSD: icmp6.h,v 1.13 2000/08/03 16:30:37 itojun Exp */
/* $KAME: icmp6.h,v 1.22 2000/08/03 15:25:16 jinmei Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 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.
*/
/*
* Copyright (c) 1982, 1986, 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.
*
* @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
*/
#ifndef _NETINET_ICMP6_H_
#define _NETINET_ICMP6_H_
struct icmp6_hdr {
u_int8_t icmp6_type; /* type field */
u_int8_t icmp6_code; /* code field */
u_int16_t icmp6_cksum; /* checksum field */
union {
u_int32_t icmp6_un_data32[1]; /* type-specific field */
u_int16_t icmp6_un_data16[2]; /* type-specific field */
u_int8_t icmp6_un_data8[4]; /* type-specific field */
} icmp6_dataun;
};
#define icmp6_data32 icmp6_dataun.icmp6_un_data32
#define icmp6_data16 icmp6_dataun.icmp6_un_data16
#define icmp6_data8 icmp6_dataun.icmp6_un_data8
#define icmp6_pptr icmp6_data32[0] /* parameter prob */
#define icmp6_mtu icmp6_data32[0] /* packet too big */
#define icmp6_id icmp6_data16[0] /* echo request/reply */
#define icmp6_seq icmp6_data16[1] /* echo request/reply */
#define icmp6_maxdelay icmp6_data16[0] /* mcast group membership */
#define ICMP6_DST_UNREACH 1 /* dest unreachable, codes: */
#define ICMP6_PACKET_TOO_BIG 2 /* packet too big */
#define ICMP6_TIME_EXCEEDED 3 /* time exceeded, code: */
#define ICMP6_PARAM_PROB 4 /* ip6 header bad */
#define ICMP6_ECHO_REQUEST 128 /* echo service */
#define ICMP6_ECHO_REPLY 129 /* echo reply */
#define ICMP6_MEMBERSHIP_QUERY 130 /* group membership query */
#define MLD6_LISTENER_QUERY 130 /* multicast listener query */
#define ICMP6_MEMBERSHIP_REPORT 131 /* group membership report */
#define MLD6_LISTENER_REPORT 131 /* multicast listener report */
#define ICMP6_MEMBERSHIP_REDUCTION 132 /* group membership termination */
#define MLD6_LISTENER_DONE 132 /* multicast listener done */
#define ND_ROUTER_SOLICIT 133 /* router solicitation */
#define ND_ROUTER_ADVERT 134 /* router advertisement */
#define ND_NEIGHBOR_SOLICIT 135 /* neighbor solicitation */
#define ND_NEIGHBOR_ADVERT 136 /* neighbor advertisement */
#define ND_REDIRECT 137 /* redirect */
#define ICMP6_ROUTER_RENUMBERING 138 /* router renumbering */
#define ICMP6_WRUREQUEST 139 /* who are you request */
#define ICMP6_WRUREPLY 140 /* who are you reply */
#define ICMP6_FQDN_QUERY 139 /* FQDN query */
#define ICMP6_FQDN_REPLY 140 /* FQDN reply */
#define ICMP6_NI_QUERY 139 /* node information request */
#define ICMP6_NI_REPLY 140 /* node information reply */
#define IND_SOLICIT 141 /* inverse neighbor solicitation */
#define IND_ADVERT 142 /* inverse neighbor advertisement */
#define ICMP6_V2_MEMBERSHIP_REPORT 143 /* v2 membership report */
#define MLDV2_LISTENER_REPORT 143 /* v2 multicast listener report */
#define ICMP6_HADISCOV_REQUEST 144
#define ICMP6_HADISCOV_REPLY 145
#define ICMP6_MOBILEPREFIX_SOLICIT 146
#define ICMP6_MOBILEPREFIX_ADVERT 147
#define MLD6_MTRACE_RESP 200 /* mtrace response(to sender) */
#define MLD6_MTRACE 201 /* mtrace messages */
#define ICMP6_MAXTYPE 201
#define ICMP6_DST_UNREACH_NOROUTE 0 /* no route to destination */
#define ICMP6_DST_UNREACH_ADMIN 1 /* administratively prohibited */
#define ICMP6_DST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor(obsolete) */
#define ICMP6_DST_UNREACH_BEYONDSCOPE 2 /* beyond scope of source address */
#define ICMP6_DST_UNREACH_ADDR 3 /* address unreachable */
#define ICMP6_DST_UNREACH_NOPORT 4 /* port unreachable */
#define ICMP6_TIME_EXCEED_TRANSIT 0 /* ttl==0 in transit */
#define ICMP6_TIME_EXCEED_REASSEMBLY 1 /* ttl==0 in reass */
#define ICMP6_PARAMPROB_HEADER 0 /* erroneous header field */
#define ICMP6_PARAMPROB_NEXTHEADER 1 /* unrecognized next header */
#define ICMP6_PARAMPROB_OPTION 2 /* unrecognized option */
#define ICMP6_INFOMSG_MASK 0x80 /* all informational messages */
#define ICMP6_NI_SUBJ_IPV6 0 /* Query Subject is an IPv6 address */
#define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */
#define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */
#define ICMP6_NI_SUCCESS 0 /* node information successful reply */
#define ICMP6_NI_REFUSED 1 /* node information request is refused */
#define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */
#define ICMP6_ROUTER_RENUMBERING_COMMAND 0 /* rr command */
#define ICMP6_ROUTER_RENUMBERING_RESULT 1 /* rr result */
#define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255 /* rr seq num reset */
/* Used in kernel only */
#define ND_REDIRECT_ONLINK 0 /* redirect to an on-link node */
#define ND_REDIRECT_ROUTER 1 /* redirect to a better router */
/*
* Multicast Listener Discovery
*/
struct mld6_hdr {
struct icmp6_hdr mld6_hdr;
struct in6_addr mld6_addr; /* multicast address */
};
#define mld6_type mld6_hdr.icmp6_type
#define mld6_code mld6_hdr.icmp6_code
#define mld6_cksum mld6_hdr.icmp6_cksum
#define mld6_maxdelay mld6_hdr.icmp6_data16[0]
#define mld6_reserved mld6_hdr.icmp6_data16[1]
#define MLD_MINLEN 24
#define MLDV2_MINLEN 28
/*
* Neighbor Discovery
*/
struct nd_router_solicit { /* router solicitation */
struct icmp6_hdr nd_rs_hdr;
/* could be followed by options */
};
#define nd_rs_type nd_rs_hdr.icmp6_type
#define nd_rs_code nd_rs_hdr.icmp6_code
#define nd_rs_cksum nd_rs_hdr.icmp6_cksum
#define nd_rs_reserved nd_rs_hdr.icmp6_data32[0]
struct nd_router_advert { /* router advertisement */
struct icmp6_hdr nd_ra_hdr;
u_int32_t nd_ra_reachable; /* reachable time */
u_int32_t nd_ra_retransmit; /* retransmit timer */
/* could be followed by options */
};
#define nd_ra_type nd_ra_hdr.icmp6_type
#define nd_ra_code nd_ra_hdr.icmp6_code
#define nd_ra_cksum nd_ra_hdr.icmp6_cksum
#define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0]
#define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1]
#define ND_RA_FLAG_MANAGED 0x80
#define ND_RA_FLAG_OTHER 0x40
#define ND_RA_FLAG_HOME_AGENT 0x20
/*
* Router preference values based on draft-draves-ipngwg-router-selection-01.
* These are non-standard definitions.
*/
#define ND_RA_FLAG_RTPREF_MASK 0x18 /* 00011000 */
#define ND_RA_FLAG_RTPREF_HIGH 0x08 /* 00001000 */
#define ND_RA_FLAG_RTPREF_MEDIUM 0x00 /* 00000000 */
#define ND_RA_FLAG_RTPREF_LOW 0x18 /* 00011000 */
#define ND_RA_FLAG_RTPREF_RSV 0x10 /* 00010000 */
#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]
struct nd_neighbor_solicit { /* neighbor solicitation */
struct icmp6_hdr nd_ns_hdr;
struct in6_addr nd_ns_target; /*target address */
/* could be followed by options */
};
#define nd_ns_type nd_ns_hdr.icmp6_type
#define nd_ns_code nd_ns_hdr.icmp6_code
#define nd_ns_cksum nd_ns_hdr.icmp6_cksum
#define nd_ns_reserved nd_ns_hdr.icmp6_data32[0]
struct nd_neighbor_advert { /* neighbor advertisement */
struct icmp6_hdr nd_na_hdr;
struct in6_addr nd_na_target; /* target address */
/* could be followed by options */
};
#define nd_na_type nd_na_hdr.icmp6_type
#define nd_na_code nd_na_hdr.icmp6_code
#define nd_na_cksum nd_na_hdr.icmp6_cksum
#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
#define ND_NA_FLAG_ROUTER 0x80000000
#define ND_NA_FLAG_SOLICITED 0x40000000
#define ND_NA_FLAG_OVERRIDE 0x20000000
struct nd_redirect { /* redirect */
struct icmp6_hdr nd_rd_hdr;
struct in6_addr nd_rd_target; /* target address */
struct in6_addr nd_rd_dst; /* destination address */
/* could be followed by options */
};
#define nd_rd_type nd_rd_hdr.icmp6_type
#define nd_rd_code nd_rd_hdr.icmp6_code
#define nd_rd_cksum nd_rd_hdr.icmp6_cksum
#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0]
struct nd_opt_hdr { /* Neighbor discovery option header */
u_int8_t nd_opt_type;
u_int8_t nd_opt_len;
/* followed by option specific data*/
};
#define ND_OPT_SOURCE_LINKADDR 1
#define ND_OPT_TARGET_LINKADDR 2
#define ND_OPT_PREFIX_INFORMATION 3
#define ND_OPT_REDIRECTED_HEADER 4
#define ND_OPT_MTU 5
#define ND_OPT_ADVINTERVAL 7
#define ND_OPT_HOMEAGENT_INFO 8
#define ND_OPT_ROUTE_INFO 9 /* draft-ietf-ipngwg-router-preference, not officially assigned yet */
#define ND_OPT_RDNSS 25
#define ND_OPT_DNSSL 31
struct nd_opt_prefix_info { /* prefix information */
u_int8_t nd_opt_pi_type;
u_int8_t nd_opt_pi_len;
u_int8_t nd_opt_pi_prefix_len;
u_int8_t nd_opt_pi_flags_reserved;
u_int8_t nd_opt_pi_valid_time[4];
u_int8_t nd_opt_pi_preferred_time[4];
u_int8_t nd_opt_pi_reserved2[4];
struct in6_addr nd_opt_pi_prefix;
};
#define ND_OPT_PI_FLAG_ONLINK 0x80
#define ND_OPT_PI_FLAG_AUTO 0x40
#define ND_OPT_PI_FLAG_ROUTER 0x20 /*2292bis*/
struct nd_opt_rd_hdr { /* redirected header */
u_int8_t nd_opt_rh_type;
u_int8_t nd_opt_rh_len;
u_int16_t nd_opt_rh_reserved1;
u_int32_t nd_opt_rh_reserved2;
/* followed by IP header and data */
};
struct nd_opt_mtu { /* MTU option */
u_int8_t nd_opt_mtu_type;
u_int8_t nd_opt_mtu_len;
u_int16_t nd_opt_mtu_reserved;
u_int32_t nd_opt_mtu_mtu;
};
struct nd_opt_rdnss { /* RDNSS RFC 6106 5.1 */
u_int8_t nd_opt_rdnss_type;
u_int8_t nd_opt_rdnss_len;
u_int16_t nd_opt_rdnss_reserved;
u_int32_t nd_opt_rdnss_lifetime;
struct in6_addr nd_opt_rdnss_addr[1]; /* variable-length */
};
struct nd_opt_dnssl { /* DNSSL RFC 6106 5.2 */
u_int8_t nd_opt_dnssl_type;
u_int8_t nd_opt_dnssl_len;
u_int16_t nd_opt_dnssl_reserved;
u_int32_t nd_opt_dnssl_lifetime;
/* followed by list of DNS search domains, variable-length */
};
struct nd_opt_advinterval { /* Advertisement interval option */
u_int8_t nd_opt_adv_type;
u_int8_t nd_opt_adv_len;
u_int16_t nd_opt_adv_reserved;
u_int32_t nd_opt_adv_interval;
};
struct nd_opt_homeagent_info { /* Home Agent info */
u_int8_t nd_opt_hai_type;
u_int8_t nd_opt_hai_len;
u_int16_t nd_opt_hai_reserved;
int16_t nd_opt_hai_preference;
u_int16_t nd_opt_hai_lifetime;
};
struct nd_opt_route_info { /* route info */
u_int8_t nd_opt_rti_type;
u_int8_t nd_opt_rti_len;
u_int8_t nd_opt_rti_prefixlen;
u_int8_t nd_opt_rti_flags;
u_int32_t nd_opt_rti_lifetime;
/* prefix follows */
};
/*
* icmp6 namelookup
*/
struct icmp6_namelookup {
struct icmp6_hdr icmp6_nl_hdr;
u_int8_t icmp6_nl_nonce[8];
int32_t icmp6_nl_ttl;
#if 0
u_int8_t icmp6_nl_len;
u_int8_t icmp6_nl_name[3];
#endif
/* could be followed by options */
};
/*
* icmp6 node information
*/
struct icmp6_nodeinfo {
struct icmp6_hdr icmp6_ni_hdr;
u_int8_t icmp6_ni_nonce[8];
/* could be followed by reply data */
};
#define ni_type icmp6_ni_hdr.icmp6_type
#define ni_code icmp6_ni_hdr.icmp6_code
#define ni_cksum icmp6_ni_hdr.icmp6_cksum
#define ni_qtype icmp6_ni_hdr.icmp6_data16[0]
#define ni_flags icmp6_ni_hdr.icmp6_data16[1]
#define NI_QTYPE_NOOP 0 /* NOOP */
#define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes */
#define NI_QTYPE_FQDN 2 /* FQDN (draft 04) */
#define NI_QTYPE_DNSNAME 2 /* DNS Name */
#define NI_QTYPE_NODEADDR 3 /* Node Addresses */
#define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */
/* network endian */
#define NI_SUPTYPE_FLAG_COMPRESS ((u_int16_t)htons(0x1))
#define NI_FQDN_FLAG_VALIDTTL ((u_int16_t)htons(0x1))
/* network endian */
#define NI_NODEADDR_FLAG_TRUNCATE ((u_int16_t)htons(0x1))
#define NI_NODEADDR_FLAG_ALL ((u_int16_t)htons(0x2))
#define NI_NODEADDR_FLAG_COMPAT ((u_int16_t)htons(0x4))
#define NI_NODEADDR_FLAG_LINKLOCAL ((u_int16_t)htons(0x8))
#define NI_NODEADDR_FLAG_SITELOCAL ((u_int16_t)htons(0x10))
#define NI_NODEADDR_FLAG_GLOBAL ((u_int16_t)htons(0x20))
#define NI_NODEADDR_FLAG_ANYCAST ((u_int16_t)htons(0x40)) /* just experimental. not in spec */
struct ni_reply_fqdn {
u_int32_t ni_fqdn_ttl; /* TTL */
u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */
u_int8_t ni_fqdn_name[3]; /* XXX: alignment */
};
/*
* Router Renumbering. as router-renum-08.txt
*/
struct icmp6_router_renum { /* router renumbering header */
struct icmp6_hdr rr_hdr;
u_int8_t rr_segnum;
u_int8_t rr_flags;
u_int16_t rr_maxdelay;
u_int32_t rr_reserved;
};
#define ICMP6_RR_FLAGS_TEST 0x80
#define ICMP6_RR_FLAGS_REQRESULT 0x40
#define ICMP6_RR_FLAGS_FORCEAPPLY 0x20
#define ICMP6_RR_FLAGS_SPECSITE 0x10
#define ICMP6_RR_FLAGS_PREVDONE 0x08
#define rr_type rr_hdr.icmp6_type
#define rr_code rr_hdr.icmp6_code
#define rr_cksum rr_hdr.icmp6_cksum
#define rr_seqnum rr_hdr.icmp6_data32[0]
struct rr_pco_match { /* match prefix part */
u_int8_t rpm_code;
u_int8_t rpm_len;
u_int8_t rpm_ordinal;
u_int8_t rpm_matchlen;
u_int8_t rpm_minlen;
u_int8_t rpm_maxlen;
u_int16_t rpm_reserved;
struct in6_addr rpm_prefix;
};
#define RPM_PCO_ADD 1
#define RPM_PCO_CHANGE 2
#define RPM_PCO_SETGLOBAL 3
#define RPM_PCO_MAX 4
struct rr_pco_use { /* use prefix part */
u_int8_t rpu_uselen;
u_int8_t rpu_keeplen;
u_int8_t rpu_ramask;
u_int8_t rpu_raflags;
u_int32_t rpu_vltime;
u_int32_t rpu_pltime;
u_int32_t rpu_flags;
struct in6_addr rpu_prefix;
};
#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80
#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40
/* network endian */
#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME ((u_int32_t)htonl(0x80000000))
#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME ((u_int32_t)htonl(0x40000000))
struct rr_result { /* router renumbering result message */
u_int16_t rrr_flags;
u_int8_t rrr_ordinal;
u_int8_t rrr_matchedlen;
u_int32_t rrr_ifid;
struct in6_addr rrr_prefix;
};
/* network endian */
#define ICMP6_RR_RESULT_FLAGS_OOB ((u_int16_t)htons(0x0002))
#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN ((u_int16_t)htons(0x0001))
#endif /* not _NETINET_ICMP6_H_ */

View File

@ -1,347 +0,0 @@
/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.12 2007-07-22 19:59:06 guy Exp $ (LBL) */
/*
* Copyright (c) 2001
* Fortress Technologies
* Charlie Lenahan ( clenahan@fortresstech.com )
*
* 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.
*/
/* 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_CTL_LEN 2
#define IEEE802_11_IV_LEN 3
#define IEEE802_11_KID_LEN 1
/* Frame check sequence length. */
#define IEEE802_11_FCS_LEN 4
/* Lengths of beacon components. */
#define IEEE802_11_TSTAMP_LEN 8
#define IEEE802_11_BCNINT_LEN 2
#define IEEE802_11_CAPINFO_LEN 2
#define IEEE802_11_LISTENINT_LEN 2
#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 0x7 */
#define ST_BEACON 0x8
#define ST_ATIM 0x9
#define ST_DISASSOC 0xA
#define ST_AUTH 0xB
#define ST_DEAUTH 0xC
#define ST_ACTION 0xD
/* RESERVED 0xE */
/* RESERVED 0xF */
#define CTRL_CONTROL_WRAPPER 0x7
#define CTRL_BAR 0x8
#define CTRL_BA 0x9
#define CTRL_PS_POLL 0xA
#define CTRL_RTS 0xB
#define CTRL_CTS 0xC
#define CTRL_ACK 0xD
#define CTRL_CF_END 0xE
#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
#define DATA_QOS_DATA 0x8
#define DATA_QOS_DATA_CF_ACK 0x9
#define DATA_QOS_DATA_CF_POLL 0xA
#define DATA_QOS_DATA_CF_ACK_POLL 0xB
#define DATA_QOS_NODATA 0xC
#define DATA_QOS_CF_POLL_NODATA 0xE
#define DATA_QOS_CF_ACK_POLL_NODATA 0xF
/*
* The subtype field of a data frame is, in effect, composed of 4 flag
* bits - CF-Ack, CF-Poll, Null (means the frame doesn't actually have
* any data), and QoS.
*/
#define DATA_FRAME_IS_CF_ACK(x) ((x) & 0x01)
#define DATA_FRAME_IS_CF_POLL(x) ((x) & 0x02)
#define DATA_FRAME_IS_NULL(x) ((x) & 0x04)
#define DATA_FRAME_IS_QOS(x) ((x) & 0x08)
/*
* Bits in the frame control field.
*/
#define FC_VERSION(fc) ((fc) & 0x3)
#define FC_TYPE(fc) (((fc) >> 2) & 0x3)
#define FC_SUBTYPE(fc) (((fc) >> 4) & 0xF)
#define FC_TO_DS(fc) ((fc) & 0x0100)
#define FC_FROM_DS(fc) ((fc) & 0x0200)
#define FC_MORE_FLAG(fc) ((fc) & 0x0400)
#define FC_RETRY(fc) ((fc) & 0x0800)
#define FC_POWER_MGMT(fc) ((fc) & 0x1000)
#define FC_MORE_DATA(fc) ((fc) & 0x2000)
#define FC_WEP(fc) ((fc) & 0x4000)
#define FC_ORDER(fc) ((fc) & 0x8000)
struct mgmt_header_t {
u_int16_t fc;
u_int16_t duration;
u_int8_t da[6];
u_int8_t sa[6];
u_int8_t bssid[6];
u_int16_t seq_ctrl;
};
#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_IBSS(cap) ((cap) & 0x0002)
#define CAPABILITY_CFP(cap) ((cap) & 0x0004)
#define CAPABILITY_CFP_REQ(cap) ((cap) & 0x0008)
#define CAPABILITY_PRIVACY(cap) ((cap) & 0x0010)
struct ssid_t {
u_int8_t element_id;
u_int8_t length;
u_char ssid[33]; /* 32 + 1 for null */
};
struct rates_t {
u_int8_t element_id;
u_int8_t length;
u_int8_t rate[16];
};
struct challenge_t {
u_int8_t element_id;
u_int8_t length;
u_int8_t text[254]; /* 1-253 + 1 for null */
};
struct fh_t {
u_int8_t element_id;
u_int8_t length;
u_int16_t dwell_time;
u_int8_t hop_set;
u_int8_t hop_pattern;
u_int8_t hop_index;
};
struct ds_t {
u_int8_t element_id;
u_int8_t length;
u_int8_t channel;
};
struct cf_t {
u_int8_t element_id;
u_int8_t length;
u_int8_t count;
u_int8_t period;
u_int16_t max_duration;
u_int16_t dur_remaing;
};
struct tim_t {
u_int8_t element_id;
u_int8_t length;
u_int8_t count;
u_int8_t period;
u_int8_t bitmap_control;
u_int8_t bitmap[251];
};
#define E_SSID 0
#define E_RATES 1
#define E_FH 2
#define E_DS 3
#define E_CF 4
#define E_TIM 5
#define E_IBSS 6
/* reserved 7 */
/* reserved 8 */
/* reserved 9 */
/* reserved 10 */
/* reserved 11 */
/* reserved 12 */
/* reserved 13 */
/* reserved 14 */
/* reserved 15 */
/* reserved 16 */
#define E_CHALLENGE 16
/* reserved 17 */
/* reserved 18 */
/* reserved 19 */
/* reserved 16 */
/* reserved 16 */
struct mgmt_body_t {
u_int8_t timestamp[IEEE802_11_TSTAMP_LEN];
u_int16_t beacon_interval;
u_int16_t listen_interval;
u_int16_t status_code;
u_int16_t aid;
u_char ap[IEEE802_11_AP_LEN];
u_int16_t reason_code;
u_int16_t auth_alg;
u_int16_t auth_trans_seq_num;
int challenge_present;
struct challenge_t challenge;
u_int16_t capability_info;
int ssid_present;
struct ssid_t ssid;
int rates_present;
struct rates_t rates;
int ds_present;
struct ds_t ds;
int cf_present;
struct cf_t cf;
int fh_present;
struct fh_t fh;
int tim_present;
struct tim_t tim;
};
struct ctrl_rts_t {
u_int16_t fc;
u_int16_t duration;
u_int8_t ra[6];
u_int8_t ta[6];
u_int8_t fcs[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 {
u_int16_t fc;
u_int16_t duration;
u_int8_t ra[6];
u_int8_t fcs[4];
};
#define CTRL_CTS_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+IEEE802_11_RA_LEN)
struct ctrl_ack_t {
u_int16_t fc;
u_int16_t duration;
u_int8_t ra[6];
u_int8_t fcs[4];
};
#define CTRL_ACK_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+IEEE802_11_RA_LEN)
struct ctrl_ps_poll_t {
u_int16_t fc;
u_int16_t aid;
u_int8_t bssid[6];
u_int8_t ta[6];
u_int8_t fcs[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 {
u_int16_t fc;
u_int16_t duration;
u_int8_t ra[6];
u_int8_t bssid[6];
u_int8_t fcs[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 {
u_int16_t fc;
u_int16_t duration;
u_int8_t ra[6];
u_int8_t bssid[6];
u_int8_t fcs[4];
};
#define CTRL_END_ACK_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\
IEEE802_11_RA_LEN+IEEE802_11_BSSID_LEN)
struct ctrl_ba_t {
u_int16_t fc;
u_int16_t duration;
u_int8_t ra[6];
u_int8_t fcs[4];
};
#define CTRL_BA_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+IEEE802_11_RA_LEN)
struct ctrl_bar_t {
u_int16_t fc;
u_int16_t dur;
u_int8_t ra[6];
u_int8_t ta[6];
u_int16_t ctl;
u_int16_t seq;
u_int8_t fcs[4];
};
#define CTRL_BAR_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\
IEEE802_11_RA_LEN+IEEE802_11_TA_LEN+\
IEEE802_11_CTL_LEN+IEEE802_11_SEQ_LEN)
struct meshcntl_t {
u_int8_t flags;
u_int8_t ttl;
u_int8_t seq[4];
u_int8_t addr4[6];
u_int8_t addr5[6];
u_int8_t addr6[6];
};
#define IV_IV(iv) ((iv) & 0xFFFFFF)
#define IV_PAD(iv) (((iv) >> 24) & 0x3F)
#define IV_KEYID(iv) (((iv) >> 30) & 0x03)

View File

@ -1,291 +0,0 @@
/* $FreeBSD: src/sys/net80211/ieee80211_radiotap.h,v 1.5 2005/01/22 20:12:05 sam Exp $ */
/* NetBSD: ieee802_11_radio.h,v 1.2 2006/02/26 03:04:03 dyoung Exp */
/* $Header: /tcpdump/master/tcpdump/ieee802_11_radio.h,v 1.3 2007-08-29 02:31:44 mcr Exp $ */
/*-
* Copyright (c) 2003, 2004 David Young. 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. The name of David Young may not be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``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 DAVID
* YOUNG 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 _NET_IF_IEEE80211RADIOTAP_H_
#define _NET_IF_IEEE80211RADIOTAP_H_
/* A generic radio capture format is desirable. It must be
* rigidly defined (e.g., units for fields should be given),
* and easily extensible.
*
* The following is an extensible radio capture format. It is
* based on a bitmap indicating which fields are present.
*
* I am trying to describe precisely what the application programmer
* should expect in the following, and for that reason I tell the
* units and origin of each measurement (where it applies), or else I
* use sufficiently weaselly language ("is a monotonically nondecreasing
* function of...") that I cannot set false expectations for lawyerly
* readers.
*/
/*
* The radio capture header precedes the 802.11 header.
*
* Note well: all radiotap fields are little-endian.
*/
struct ieee80211_radiotap_header {
u_int8_t it_version; /* Version 0. Only increases
* for drastic changes,
* introduction of compatible
* new fields does not count.
*/
u_int8_t it_pad;
u_int16_t it_len; /* length of the whole
* header in bytes, including
* it_version, it_pad,
* it_len, and data fields.
*/
u_int32_t it_present; /* A bitmap telling which
* fields are present. Set bit 31
* (0x80000000) to extend the
* bitmap by another 32 bits.
* Additional extensions are made
* by setting bit 31.
*/
};
/* Name Data type Units
* ---- --------- -----
*
* IEEE80211_RADIOTAP_TSFT u_int64_t microseconds
*
* Value in microseconds of the MAC's 64-bit 802.11 Time
* Synchronization Function timer when the first bit of the
* MPDU arrived at the MAC. For received frames, only.
*
* IEEE80211_RADIOTAP_CHANNEL 2 x u_int16_t MHz, bitmap
*
* Tx/Rx frequency in MHz, followed by flags (see below).
* Note that IEEE80211_RADIOTAP_XCHANNEL must be used to
* represent an HT channel as there is not enough room in
* the flags word.
*
* IEEE80211_RADIOTAP_FHSS u_int16_t see below
*
* For frequency-hopping radios, the hop set (first byte)
* and pattern (second byte).
*
* IEEE80211_RADIOTAP_RATE u_int8_t 500kb/s or index
*
* Tx/Rx data rate. If bit 0x80 is set then it represents an
* an MCS index and not an IEEE rate.
*
* IEEE80211_RADIOTAP_DBM_ANTSIGNAL int8_t decibels from
* one milliwatt (dBm)
*
* RF signal power at the antenna, decibel difference from
* one milliwatt.
*
* IEEE80211_RADIOTAP_DBM_ANTNOISE int8_t decibels from
* one milliwatt (dBm)
*
* RF noise power at the antenna, decibel difference from one
* milliwatt.
*
* IEEE80211_RADIOTAP_DB_ANTSIGNAL u_int8_t decibel (dB)
*
* RF signal power at the antenna, decibel difference from an
* arbitrary, fixed reference.
*
* IEEE80211_RADIOTAP_DB_ANTNOISE u_int8_t decibel (dB)
*
* RF noise power at the antenna, decibel difference from an
* arbitrary, fixed reference point.
*
* IEEE80211_RADIOTAP_LOCK_QUALITY u_int16_t unitless
*
* Quality of Barker code lock. Unitless. Monotonically
* nondecreasing with "better" lock strength. Called "Signal
* Quality" in datasheets. (Is there a standard way to measure
* this?)
*
* IEEE80211_RADIOTAP_TX_ATTENUATION u_int16_t unitless
*
* Transmit power expressed as unitless distance from max
* power set at factory calibration. 0 is max power.
* Monotonically nondecreasing with lower power levels.
*
* IEEE80211_RADIOTAP_DB_TX_ATTENUATION u_int16_t decibels (dB)
*
* Transmit power expressed as decibel distance from max power
* set at factory calibration. 0 is max power. Monotonically
* nondecreasing with lower power levels.
*
* IEEE80211_RADIOTAP_DBM_TX_POWER int8_t decibels from
* one milliwatt (dBm)
*
* Transmit power expressed as dBm (decibels from a 1 milliwatt
* reference). This is the absolute power level measured at
* the antenna port.
*
* IEEE80211_RADIOTAP_FLAGS u_int8_t bitmap
*
* Properties of transmitted and received frames. See flags
* defined below.
*
* IEEE80211_RADIOTAP_ANTENNA u_int8_t antenna index
*
* Unitless indication of the Rx/Tx antenna for this packet.
* The first antenna is antenna 0.
*
* IEEE80211_RADIOTAP_RX_FLAGS u_int16_t bitmap
*
* Properties of received frames. See flags defined below.
*
* IEEE80211_RADIOTAP_XCHANNEL u_int32_t bitmap
* u_int16_t MHz
* u_int8_t channel number
* u_int8_t .5 dBm
*
* Extended channel specification: flags (see below) followed by
* frequency in MHz, the corresponding IEEE channel number, and
* finally the maximum regulatory transmit power cap in .5 dBm
* units. This property supersedes IEEE80211_RADIOTAP_CHANNEL
* and only one of the two should be present.
*
* IEEE80211_RADIOTAP_MCS u_int8_t known
* u_int8_t flags
* u_int8_t mcs
*
* Bitset indicating which fields have known values, followed
* by bitset of flag values, followed by the MCS rate index as
* in IEEE 802.11n.
*
* IEEE80211_RADIOTAP_VENDOR_NAMESPACE
* u_int8_t OUI[3]
* u_int8_t subspace
* u_int16_t length
*
* The Vendor Namespace Field contains three sub-fields. The first
* sub-field is 3 bytes long. It contains the vendor's IEEE 802
* Organizationally Unique Identifier (OUI). The fourth byte is a
* vendor-specific "namespace selector."
*
*/
enum ieee80211_radiotap_type {
IEEE80211_RADIOTAP_TSFT = 0,
IEEE80211_RADIOTAP_FLAGS = 1,
IEEE80211_RADIOTAP_RATE = 2,
IEEE80211_RADIOTAP_CHANNEL = 3,
IEEE80211_RADIOTAP_FHSS = 4,
IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5,
IEEE80211_RADIOTAP_DBM_ANTNOISE = 6,
IEEE80211_RADIOTAP_LOCK_QUALITY = 7,
IEEE80211_RADIOTAP_TX_ATTENUATION = 8,
IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9,
IEEE80211_RADIOTAP_DBM_TX_POWER = 10,
IEEE80211_RADIOTAP_ANTENNA = 11,
IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12,
IEEE80211_RADIOTAP_DB_ANTNOISE = 13,
IEEE80211_RADIOTAP_RX_FLAGS = 14,
/* NB: gap for netbsd definitions */
IEEE80211_RADIOTAP_XCHANNEL = 18,
IEEE80211_RADIOTAP_MCS = 19,
IEEE80211_RADIOTAP_NAMESPACE = 29,
IEEE80211_RADIOTAP_VENDOR_NAMESPACE = 30,
IEEE80211_RADIOTAP_EXT = 31
};
/* channel attributes */
#define IEEE80211_CHAN_TURBO 0x00010 /* Turbo channel */
#define IEEE80211_CHAN_CCK 0x00020 /* CCK channel */
#define IEEE80211_CHAN_OFDM 0x00040 /* OFDM channel */
#define IEEE80211_CHAN_2GHZ 0x00080 /* 2 GHz spectrum channel. */
#define IEEE80211_CHAN_5GHZ 0x00100 /* 5 GHz spectrum channel */
#define IEEE80211_CHAN_PASSIVE 0x00200 /* Only passive scan allowed */
#define IEEE80211_CHAN_DYN 0x00400 /* Dynamic CCK-OFDM channel */
#define IEEE80211_CHAN_GFSK 0x00800 /* GFSK channel (FHSS PHY) */
#define IEEE80211_CHAN_GSM 0x01000 /* 900 MHz spectrum channel */
#define IEEE80211_CHAN_STURBO 0x02000 /* 11a static turbo channel only */
#define IEEE80211_CHAN_HALF 0x04000 /* Half rate channel */
#define IEEE80211_CHAN_QUARTER 0x08000 /* Quarter rate channel */
#define IEEE80211_CHAN_HT20 0x10000 /* HT 20 channel */
#define IEEE80211_CHAN_HT40U 0x20000 /* HT 40 channel w/ ext above */
#define IEEE80211_CHAN_HT40D 0x40000 /* HT 40 channel w/ ext below */
/* Useful combinations of channel characteristics, borrowed from Ethereal */
#define IEEE80211_CHAN_A \
(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM)
#define IEEE80211_CHAN_B \
(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK)
#define IEEE80211_CHAN_G \
(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN)
#define IEEE80211_CHAN_TA \
(IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
#define IEEE80211_CHAN_TG \
(IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN | IEEE80211_CHAN_TURBO)
/* For IEEE80211_RADIOTAP_FLAGS */
#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received
* during CFP
*/
#define IEEE80211_RADIOTAP_F_SHORTPRE 0x02 /* sent/received
* with short
* preamble
*/
#define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received
* with WEP encryption
*/
#define IEEE80211_RADIOTAP_F_FRAG 0x08 /* sent/received
* with fragmentation
*/
#define IEEE80211_RADIOTAP_F_FCS 0x10 /* frame includes FCS */
#define IEEE80211_RADIOTAP_F_DATAPAD 0x20 /* frame has padding between
* 802.11 header and payload
* (to 32-bit boundary)
*/
#define IEEE80211_RADIOTAP_F_BADFCS 0x40 /* does not pass FCS check */
/* For IEEE80211_RADIOTAP_RX_FLAGS */
#define IEEE80211_RADIOTAP_F_RX_BADFCS 0x0001 /* frame failed crc check */
#define IEEE80211_RADIOTAP_F_RX_PLCP_CRC 0x0002 /* frame failed PLCP CRC check */
/* For IEEE80211_RADIOTAP_MCS known */
#define IEEE80211_RADIOTAP_MCS_BANDWIDTH_KNOWN 0x01
#define IEEE80211_RADIOTAP_MCS_MCS_INDEX_KNOWN 0x02 /* MCS index field */
#define IEEE80211_RADIOTAP_MCS_GUARD_INTERVAL_KNOWN 0x04
#define IEEE80211_RADIOTAP_MCS_HT_FORMAT_KNOWN 0x08
#define IEEE80211_RADIOTAP_MCS_FEC_TYPE_KNOWN 0x10
/* For IEEE80211_RADIOTAP_MCS flags */
#define IEEE80211_RADIOTAP_MCS_BANDWIDTH_MASK 0x03
#define IEEE80211_RADIOTAP_MCS_BANDWIDTH_20 0
#define IEEE80211_RADIOTAP_MCS_BANDWIDTH_40 1
#define IEEE80211_RADIOTAP_MCS_BANDWIDTH_20L 2
#define IEEE80211_RADIOTAP_MCS_BANDWIDTH_20U 3
#define IEEE80211_RADIOTAP_MCS_SHORT_GI 0x04 /* short guard interval */
#define IEEE80211_RADIOTAP_MCS_HT_GREENFIELD 0x08
#define IEEE80211_RADIOTAP_MCS_FEC_LDPC 0x10
#endif /* _NET_IF_IEEE80211RADIOTAP_H_ */

33
igrp.h
View File

@ -1,33 +0,0 @@
/* @(#) $Header: /tcpdump/master/tcpdump/igrp.h,v 1.6 2002-12-11 07:13:52 guy Exp $ (LBL) */
/* Cisco IGRP definitions */
/* IGRP Header */
struct igrphdr {
u_int8_t ig_vop; /* protocol version number / opcode */
#define IGRP_V(x) (((x) & 0xf0) >> 4)
#define IGRP_OP(x) ((x) & 0x0f)
u_int8_t ig_ed; /* edition number */
u_int16_t ig_as; /* autonomous system number */
u_int16_t ig_ni; /* number of subnet in local net */
u_int16_t ig_ns; /* number of networks in AS */
u_int16_t ig_nx; /* number of networks ouside AS */
u_int16_t ig_sum; /* checksum of IGRP header & data */
};
#define IGRP_UPDATE 1
#define IGRP_REQUEST 2
/* IGRP routing entry */
struct igrprte {
u_int8_t igr_net[3]; /* 3 significant octets of IP address */
u_int8_t igr_dly[3]; /* delay in tens of microseconds */
u_int8_t igr_bw[3]; /* bandwidth in units of 1 kb/s */
u_int8_t igr_mtu[2]; /* MTU in octets */
u_int8_t igr_rel; /* percent packets successfully tx/rx */
u_int8_t igr_ld; /* percent of channel occupied */
u_int8_t igr_hct; /* hop count */
};
#define IGRP_RTE_SIZE 14 /* don't believe sizeof ! */

View File

@ -35,6 +35,7 @@
* @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
*/
#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
@ -53,27 +54,27 @@
#define ADDCARRY(x) {if ((x) > 65535) (x) -= 65535;}
#define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
u_int16_t
uint16_t
in_cksum(const struct cksum_vec *vec, int veclen)
{
register const u_int16_t *w;
register const uint16_t *w;
register int sum = 0;
register int mlen = 0;
int byte_swapped = 0;
union {
u_int8_t c[2];
u_int16_t s;
uint8_t c[2];
uint16_t s;
} s_util;
union {
u_int16_t s[2];
u_int32_t l;
uint16_t s[2];
uint32_t l;
} l_util;
for (; veclen != 0; vec++, veclen--) {
if (vec->len == 0)
continue;
w = (const u_int16_t *)(void *)vec->ptr;
w = (const uint16_t *)(void *)vec->ptr;
if (mlen == -1) {
/*
* The first byte of this chunk is the continuation
@ -83,9 +84,9 @@ in_cksum(const struct cksum_vec *vec, int veclen)
* s_util.c[0] is already saved when scanning previous
* chunk.
*/
s_util.c[1] = *(const u_int8_t *)w;
s_util.c[1] = *(const uint8_t *)w;
sum += s_util.s;
w = (const u_int16_t *)(void *)((const u_int8_t *)w + 1);
w = (const uint16_t *)(void *)((const uint8_t *)w + 1);
mlen = vec->len - 1;
} else
mlen = vec->len;
@ -95,8 +96,8 @@ in_cksum(const struct cksum_vec *vec, int veclen)
if ((1 & (unsigned long) w) && (mlen > 0)) {
REDUCE;
sum <<= 8;
s_util.c[0] = *(const u_int8_t *)w;
w = (const u_int16_t *)(void *)((const u_int8_t *)w + 1);
s_util.c[0] = *(const uint8_t *)w;
w = (const uint16_t *)(void *)((const uint8_t *)w + 1);
mlen--;
byte_swapped = 1;
}
@ -128,13 +129,13 @@ in_cksum(const struct cksum_vec *vec, int veclen)
sum <<= 8;
byte_swapped = 0;
if (mlen == -1) {
s_util.c[1] = *(const u_int8_t *)w;
s_util.c[1] = *(const uint8_t *)w;
sum += s_util.s;
mlen = 0;
} else
mlen = -1;
} else if (mlen == -1)
s_util.c[0] = *(const u_int8_t *)w;
s_util.c[0] = *(const uint8_t *)w;
}
if (mlen == -1) {
/* The last mbuf has odd # of bytes. Follow the
@ -153,10 +154,10 @@ in_cksum(const struct cksum_vec *vec, int veclen)
* that the checksum covers (including the checksum itself), compute
* what the checksum field *should* have been.
*/
u_int16_t
in_cksum_shouldbe(u_int16_t sum, u_int16_t computed_sum)
uint16_t
in_cksum_shouldbe(uint16_t sum, uint16_t computed_sum)
{
u_int32_t shouldbe;
uint32_t shouldbe;
/*
* The value that should have gone into the checksum field

View File

@ -115,7 +115,7 @@ fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
@ -124,7 +124,7 @@ if [ x"$dir_arg" != x ]; then
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
@ -134,7 +134,7 @@ else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
@ -201,17 +201,17 @@ else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
@ -242,7 +242,7 @@ else
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&

View File

@ -17,8 +17,6 @@
* 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/interface.h,v 1.285 2008-08-16 11:36:20 hannes Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
@ -38,13 +36,19 @@
#if !defined(HAVE_SNPRINTF)
int snprintf(char *, size_t, const char *, ...)
__attribute__((format(printf, 3, 4)));
#endif
#ifdef __ATTRIBUTE___FORMAT_OK
__attribute__((format(printf, 3, 4)))
#endif /* __ATTRIBUTE___FORMAT_OK */
;
#endif /* !defined(HAVE_SNPRINTF) */
#if !defined(HAVE_VSNPRINTF)
int vsnprintf(char *, size_t, const char *, va_list)
__attribute__((format(printf, 3, 0)));
#endif
#ifdef __ATTRIBUTE___FORMAT_OK
__attribute__((format(printf, 3, 0)))
#endif /* __ATTRIBUTE___FORMAT_OK */
;
#endif /* !defined(HAVE_VSNPRINTF) */
#ifndef HAVE_STRLCAT
extern size_t strlcat(char *, const char *, size_t);
@ -74,13 +78,9 @@ extern char *strsep(char **, const char *);
#define PT_RADIUS 11 /* RADIUS authentication Protocol */
#define PT_ZMTP1 12 /* ZeroMQ Message Transport Protocol 1.0 */
#define PT_VXLAN 13 /* Virtual eXtensible Local Area Network */
#ifndef min
#define min(a,b) ((a)>(b)?(b):(a))
#endif
#ifndef max
#define max(a,b) ((b)>(a)?(b):(a))
#endif
#define PT_PGM 14 /* [UDP-encapsulated] Pragmatic General Multicast */
#define PT_PGM_ZMTP1 15 /* ZMTP/1.0 inside PGM (native or UDP-encapsulated) */
#define PT_LMP 16 /* Link Management Protocol */
#define ESRC(ep) ((ep)->ether_shost)
#define EDST(ep) ((ep)->ether_dhost)
@ -93,10 +93,6 @@ extern char *strsep(char **, const char *);
#endif
#endif
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif
extern char *program_name; /* used to generate self-identifying messages */
extern int32_t thiszone; /* seconds offset from gmt to local time */
@ -121,228 +117,51 @@ extern int32_t thiszone; /* seconds offset from gmt to local time */
/* Bail if "var" was not captured */
#define TCHECK(var) TCHECK2(var, sizeof(var))
extern void ts_print(const struct timeval *);
extern void relts_print(int);
extern int fn_print(const u_char *, const u_char *);
extern int fn_printn(const u_char *, u_int, const u_char *);
extern int fn_printzp(const u_char *, u_int, const u_char *);
extern int mask2plen(u_int32_t);
extern int mask2plen(uint32_t);
extern const char *tok2strary_internal(const char **, int, const char *, int);
#define tok2strary(a,f,i) tok2strary_internal(a, sizeof(a)/sizeof(a[0]),f,i)
extern const char *dnaddr_string(u_short);
extern void error(const char *, ...)
__attribute__((noreturn, format (printf, 1, 2)));
extern void warning(const char *, ...) __attribute__ ((format (printf, 1, 2)));
__attribute__((noreturn))
#ifdef __ATTRIBUTE___FORMAT_OK
__attribute__((format (printf, 1, 2)))
#endif /* __ATTRIBUTE___FORMAT_OK */
;
extern void warning(const char *, ...)
#ifdef __ATTRIBUTE___FORMAT_OK
__attribute__((format (printf, 1, 2)))
#endif /* __ATTRIBUTE___FORMAT_OK */
;
extern char *read_infile(char *);
extern char *copy_argv(char **);
extern void safeputchar(int);
extern void safeputs(const char *, int);
extern const char *isonsap_string(const u_char *, register u_int);
extern const char *protoid_string(const u_char *);
extern const char *ipxsap_string(u_short);
extern const char *dnname_string(u_short);
extern const char *dnnum_string(u_short);
/* checksum routines */
extern void init_checksum(void);
extern u_int16_t verify_crc10_cksum(u_int16_t, const u_char *, int);
extern u_int16_t create_osi_cksum(const u_int8_t *, int, int);
extern uint16_t verify_crc10_cksum(uint16_t, const u_char *, int);
extern uint16_t create_osi_cksum(const uint8_t *, int, int);
/* The printer routines. */
#include <pcap.h>
extern int print_unknown_data(const u_char *, const char *,int);
extern void ascii_print(const u_char *, u_int);
extern void hex_and_ascii_print_with_offset(const char *, const u_char *,
u_int, u_int);
extern void hex_and_ascii_print(const char *, const u_char *, u_int);
extern void hex_print_with_offset(const char *, const u_char *, u_int, u_int);
extern void hex_print(const char *, const u_char *, u_int);
extern void telnet_print(const u_char *, u_int);
extern int llc_print(const u_char *, u_int, u_int, const u_char *,
const u_char *, u_short *);
extern int snap_print(const u_char *, u_int, u_int, u_int);
extern void aarp_print(const u_char *, u_int);
extern void aodv_print(const u_char *, u_int, int);
extern void atalk_print(const u_char *, u_int);
extern void atm_print(u_int, u_int, u_int, const u_char *, u_int, u_int);
extern u_int atm_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int sunatm_if_print(const struct pcap_pkthdr *, const u_char *);
extern int oam_print(const u_char *, u_int, u_int);
extern void bootp_print(const u_char *, u_int);
extern void bgp_print(const u_char *, int);
extern void beep_print(const u_char *, u_int);
extern void cnfp_print(const u_char *, const u_char *);
extern void decnet_print(const u_char *, u_int, u_int);
extern void default_print(const u_char *, u_int);
extern void dvmrp_print(const u_char *, u_int);
extern void egp_print(const u_char *, u_int);
extern u_int enc_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int pflog_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int arcnet_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int arcnet_linux_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int token_print(const u_char *, u_int, u_int);
extern u_int token_if_print(const struct pcap_pkthdr *, const u_char *);
extern void fddi_print(const u_char *, u_int, u_int);
extern u_int fddi_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int fr_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int mfr_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int fr_print(register const u_char *, u_int);
extern u_int mfr_print(register const u_char *, u_int);
extern char *q922_string(const u_char *);
extern u_int ieee802_11_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int ieee802_11_radio_if_print(const struct pcap_pkthdr *,
const u_char *);
extern u_int ap1394_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int ieee802_11_radio_avs_if_print(const struct pcap_pkthdr *,
const u_char *);
extern void gre_print(const u_char *, u_int);
extern void icmp_print(const u_char *, u_int, const u_char *, int);
extern void igmp_print(const u_char *, u_int);
extern void igrp_print(const u_char *, u_int, const u_char *);
extern void ipN_print(const u_char *, u_int);
extern u_int ipfc_if_print(const struct pcap_pkthdr *, const u_char *);
extern void ipx_print(const u_char *, u_int);
extern void isoclns_print(const u_char *, u_int, u_int);
extern void krb_print(const u_char *);
extern u_int llap_print(const u_char *, u_int);
extern u_int ltalk_if_print(const struct pcap_pkthdr *, const u_char *);
extern void msdp_print(const unsigned char *, u_int);
extern void nfsreply_print(const u_char *, u_int, const u_char *);
extern void nfsreq_print(const u_char *, u_int, const u_char *);
extern void ns_print(const u_char *, u_int, int);
extern const u_char * ns_nprint (register const u_char *, register const u_char *);
extern void ntp_print(const u_char *, u_int);
extern u_int null_if_print(const struct pcap_pkthdr *, const u_char *);
extern void ospf_print(const u_char *, u_int, const u_char *);
extern void olsr_print (const u_char *, u_int, int);
extern void pimv1_print(const u_char *, u_int);
extern void cisco_autorp_print(const u_char *, u_int);
extern void rsvp_print(const u_char *, u_int);
extern void ldp_print(const u_char *, u_int);
extern void lldp_print(const u_char *, u_int);
extern void rpki_rtr_print(const u_char *, u_int);
extern void lmp_print(const u_char *, u_int);
extern void lspping_print(const u_char *, u_int);
extern void lwapp_control_print(const u_char *, u_int, int);
extern void lwapp_data_print(const u_char *, u_int);
extern void eigrp_print(const u_char *, u_int);
extern void mobile_print(const u_char *, u_int);
extern void pim_print(const u_char *, u_int, u_int);
extern u_int pppoe_print(const u_char *, u_int);
extern u_int ppp_print(register const u_char *, u_int);
extern u_int ppp_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int ppp_hdlc_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int ppp_bsdos_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int pppoe_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int prism_if_print(const struct pcap_pkthdr *, const u_char *);
extern void q933_print(const u_char *, u_int);
extern int vjc_print(register const char *, u_short);
extern void vqp_print(register const u_char *, register u_int);
extern u_int raw_if_print(const struct pcap_pkthdr *, const u_char *);
extern void rip_print(const u_char *, u_int);
extern u_int sl_if_print(const struct pcap_pkthdr *, const u_char *);
extern void lane_print(const u_char *, u_int, u_int);
extern u_int lane_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int cip_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int sl_bsdos_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int chdlc_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int chdlc_print(register const u_char *, u_int);
extern u_int juniper_atm1_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_atm2_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_mfr_print(const struct pcap_pkthdr *, register const u_char *);
extern u_int juniper_mlfr_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_mlppp_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_pppoe_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_pppoe_atm_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_ggsn_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_es_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_monitor_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_services_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_ether_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_ppp_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_frelay_print(const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_chdlc_print(const struct pcap_pkthdr *, const u_char *);
extern u_int sll_if_print(const struct pcap_pkthdr *, const u_char *);
extern void snmp_print(const u_char *, u_int);
extern void sunrpcrequest_print(const u_char *, u_int, const u_char *);
extern u_int symantec_if_print(const struct pcap_pkthdr *, const u_char *);
extern void tcp_print(const u_char *, u_int, const u_char *, int);
extern void tftp_print(const u_char *, u_int);
extern void timed_print(const u_char *);
extern void udld_print(const u_char *, u_int);
extern void udp_print(const u_char *, u_int, const u_char *, int);
extern void vtp_print(const u_char *, u_int);
extern void wb_print(const void *, u_int);
extern int ah_print(register const u_char *);
extern int ipcomp_print(register const u_char *, int *);
extern void rx_print(register const u_char *, int, int, int, u_char *);
extern void netbeui_print(u_short, const u_char *, int);
extern void ipx_netbios_print(const u_char *, u_int);
extern void nbt_tcp_print(const u_char *, int);
extern void nbt_udp137_print(const u_char *, int);
extern void nbt_udp138_print(const u_char *, int);
extern void smb_tcp_print(const u_char *, int);
extern char *smb_errstr(int, int);
extern const char *nt_errstr(u_int32_t);
extern void print_data(const unsigned char *, int);
extern void l2tp_print(const u_char *, u_int);
extern void vrrp_print(const u_char *, u_int, int);
extern void carp_print(const u_char *, u_int, int);
extern void slow_print(const u_char *, u_int);
extern void sflow_print(const u_char *, u_int);
extern void mpcp_print(const u_char *, u_int);
extern void cfm_print(const u_char *, u_int);
extern void pgm_print(const u_char *, u_int, const u_char *);
extern void cdp_print(const u_char *, u_int, u_int);
extern void dtp_print(const u_char *, u_int);
extern void stp_print(const u_char *, u_int);
extern void radius_print(const u_char *, u_int);
extern void lwres_print(const u_char *, u_int);
extern void pptp_print(const u_char *);
extern void dccp_print(const u_char *, const u_char *, u_int);
extern void sctp_print(const u_char *, const u_char *, u_int);
extern void forces_print(const u_char *, u_int);
extern void mpls_print(const u_char *, u_int);
extern void mpls_lsp_ping_print(const u_char *, u_int);
extern void zephyr_print(const u_char *, int);
extern void zmtp1_print(const u_char *, u_int);
extern void hsrp_print(const u_char *, u_int);
extern void bfd_print(const u_char *, u_int, u_int);
extern void sip_print(const u_char *, u_int);
extern void syslog_print(const u_char *, u_int);
extern u_int bt_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int usb_linux_48_byte_print(const struct pcap_pkthdr *, const u_char *);
extern u_int usb_linux_64_byte_print(const struct pcap_pkthdr *, const u_char *);
extern const char *nt_errstr(uint32_t);
#ifdef INET6
extern void ip6_opt_print(const u_char *, int);
extern int hbhopt_print(const u_char *);
extern int dstopt_print(const u_char *);
extern int frag6_print(const u_char *, const u_char *);
extern int mobility_print(const u_char *, const u_char *);
extern void ripng_print(const u_char *, unsigned int);
extern int rt6_print(const u_char *, const u_char *);
extern void ospf6_print(const u_char *, u_int);
extern void dhcp6_print(const u_char *, u_int);
extern void babel_print(const u_char *, u_int);
extern int mask62plen(const u_char *);
#endif /*INET6*/
struct cksum_vec {
const u_int8_t *ptr;
const uint8_t *ptr;
int len;
};
extern u_int16_t in_cksum(const struct cksum_vec *, int);
extern u_int16_t in_cksum_shouldbe(u_int16_t, u_int16_t);
extern uint16_t in_cksum(const struct cksum_vec *, int);
extern uint16_t in_cksum_shouldbe(uint16_t, uint16_t);
#ifndef HAVE_BPF_DUMP
struct bpf_program;
@ -358,30 +177,30 @@ extern void bpf_dump(const struct bpf_program *, int);
#ifndef NETDISSECT_REWORKED
extern netdissect_options *gndo;
#define bflag gndo->ndo_bflag
#define eflag gndo->ndo_eflag
#define fflag gndo->ndo_fflag
#define bflag gndo->ndo_bflag
#define eflag gndo->ndo_eflag
#define fflag gndo->ndo_fflag
#define jflag gndo->ndo_jflag
#define Kflag gndo->ndo_Kflag
#define nflag gndo->ndo_nflag
#define Nflag gndo->ndo_Nflag
#define Oflag gndo->ndo_Oflag
#define pflag gndo->ndo_pflag
#define qflag gndo->ndo_qflag
#define Rflag gndo->ndo_Rflag
#define sflag gndo->ndo_sflag
#define Sflag gndo->ndo_Sflag
#define tflag gndo->ndo_tflag
#define Uflag gndo->ndo_Uflag
#define uflag gndo->ndo_uflag
#define vflag gndo->ndo_vflag
#define xflag gndo->ndo_xflag
#define Xflag gndo->ndo_Xflag
#define Cflag gndo->ndo_Cflag
#define Gflag gndo->ndo_Gflag
#define Aflag gndo->ndo_Aflag
#define Bflag gndo->ndo_Bflag
#define Iflag gndo->ndo_Iflag
#define Kflag gndo->ndo_Kflag
#define nflag gndo->ndo_nflag
#define Nflag gndo->ndo_Nflag
#define Oflag gndo->ndo_Oflag
#define pflag gndo->ndo_pflag
#define qflag gndo->ndo_qflag
#define Rflag gndo->ndo_Rflag
#define sflag gndo->ndo_sflag
#define Sflag gndo->ndo_Sflag
#define tflag gndo->ndo_tflag
#define Uflag gndo->ndo_Uflag
#define uflag gndo->ndo_uflag
#define vflag gndo->ndo_vflag
#define xflag gndo->ndo_xflag
#define Xflag gndo->ndo_Xflag
#define Cflag gndo->ndo_Cflag
#define Gflag gndo->ndo_Gflag
#define Aflag gndo->ndo_Aflag
#define Bflag gndo->ndo_Bflag
#define Iflag gndo->ndo_Iflag
#define suppress_default_print gndo->ndo_suppress_default_print
#define packettype gndo->ndo_packettype
#define sigsecret gndo->ndo_sigsecret
@ -389,9 +208,11 @@ extern netdissect_options *gndo;
#define WflagChars gndo->ndo_WflagChars
#define Cflag_count gndo->ndo_Cflag_count
#define Gflag_count gndo->ndo_Gflag_count
#define Gflag_time gndo->ndo_Gflag_time
#define Gflag_time gndo->ndo_Gflag_time
#define Hflag gndo->ndo_Hflag
#define snaplen gndo->ndo_snaplen
#define snapend gndo->ndo_snapend
extern void default_print(const u_char *, u_int);
#endif

36
ip.h
View File

@ -1,4 +1,3 @@
/* @(#) $Header: /tcpdump/master/tcpdump/ip.h,v 1.12 2007-09-14 01:29:28 guy Exp $ (LBL) */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
@ -34,6 +33,9 @@
* @(#)ip.h 8.2 (Berkeley) 6/1/94
*/
#ifndef TCPDUMP_IP_H
#define TCPDUMP_IP_H
/*
* Definitions for internet protocol version 4.
* Per RFC 791, September 1981.
@ -48,19 +50,19 @@
* against negative integers quite easily, and fail in subtle ways.
*/
struct ip {
u_int8_t ip_vhl; /* header length, version */
uint8_t ip_vhl; /* header length, version */
#define IP_V(ip) (((ip)->ip_vhl & 0xf0) >> 4)
#define IP_HL(ip) ((ip)->ip_vhl & 0x0f)
u_int8_t ip_tos; /* type of service */
u_int16_t ip_len; /* total length */
u_int16_t ip_id; /* identification */
u_int16_t ip_off; /* fragment offset field */
uint8_t ip_tos; /* type of service */
uint16_t ip_len; /* total length */
uint16_t ip_id; /* identification */
uint16_t ip_off; /* fragment offset field */
#define IP_DF 0x4000 /* dont fragment flag */
#define IP_MF 0x2000 /* more fragments flag */
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
u_int8_t ip_ttl; /* time to live */
u_int8_t ip_p; /* protocol */
u_int16_t ip_sum; /* checksum */
uint8_t ip_ttl; /* time to live */
uint8_t ip_p; /* protocol */
uint16_t ip_sum; /* checksum */
struct in_addr ip_src,ip_dst; /* source and dest address */
} UNALIGNED;
@ -121,17 +123,17 @@ struct ip {
* Time stamp option structure.
*/
struct ip_timestamp {
u_int8_t ipt_code; /* IPOPT_TS */
u_int8_t ipt_len; /* size of structure (variable) */
u_int8_t ipt_ptr; /* index of current entry */
u_int8_t ipt_oflwflg; /* flags, overflow counter */
uint8_t ipt_code; /* IPOPT_TS */
uint8_t ipt_len; /* size of structure (variable) */
uint8_t ipt_ptr; /* index of current entry */
uint8_t ipt_oflwflg; /* flags, overflow counter */
#define IPTS_OFLW(ip) (((ipt)->ipt_oflwflg & 0xf0) >> 4)
#define IPTS_FLG(ip) ((ipt)->ipt_oflwflg & 0x0f)
union ipt_timestamp {
u_int32_t ipt_time[1];
uint32_t ipt_time[1];
struct ipt_ta {
struct in_addr ipt_addr;
u_int32_t ipt_time;
uint32_t ipt_time;
} ipt_ta[1];
} ipt_timestamp;
} UNALIGNED;
@ -159,6 +161,4 @@ struct ip_timestamp {
#define IPTTLDEC 1 /* subtracted when forwarding */
#define IP_MSS 576 /* default maximum segment size */
/* in print-ip.c */
extern int nextproto4_cksum(const struct ip *, const u_int8_t *, u_int, u_int);
#endif /* TCPDUMP_IP_H */

73
ip6.h
View File

@ -1,4 +1,3 @@
/* @(#) $Header: /tcpdump/master/tcpdump/ip6.h,v 1.8 2007-08-29 02:31:44 mcr Exp $ (LBL) */
/* NetBSD: ip6.h,v 1.9 2000/07/13 05:34:21 itojun Exp */
/* $KAME: ip6.h,v 1.9 2000/07/02 21:01:32 itojun Exp $ */
@ -77,18 +76,19 @@
struct ip6_hdr {
union {
struct ip6_hdrctl {
u_int32_t ip6_un1_flow; /* 20 bits of flow-ID */
u_int16_t ip6_un1_plen; /* payload length */
u_int8_t ip6_un1_nxt; /* next header */
u_int8_t ip6_un1_hlim; /* hop limit */
uint32_t ip6_un1_flow; /* 20 bits of flow-ID */
uint16_t ip6_un1_plen; /* payload length */
uint8_t ip6_un1_nxt; /* next header */
uint8_t ip6_un1_hlim; /* hop limit */
} ip6_un1;
u_int8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */
uint8_t ip6_un2_vfc; /* 4 bits version, top 4 bits class */
} ip6_ctlun;
struct in6_addr ip6_src; /* source address */
struct in6_addr ip6_dst; /* destination address */
} UNALIGNED;
#define ip6_vfc ip6_ctlun.ip6_un2_vfc
#define IP6_VERSION(ip6_hdr) (((ip6_hdr)->ip6_vfc & 0xf0) >> 4)
#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
@ -96,8 +96,8 @@ struct ip6_hdr {
#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
/* in network endian */
#define IPV6_FLOWINFO_MASK ((u_int32_t)htonl(0x0fffffff)) /* flow info (28 bits) */
#define IPV6_FLOWLABEL_MASK ((u_int32_t)htonl(0x000fffff)) /* flow label (20 bits) */
#define IPV6_FLOWINFO_MASK ((uint32_t)htonl(0x0fffffff)) /* flow info (28 bits) */
#define IPV6_FLOWLABEL_MASK ((uint32_t)htonl(0x000fffff)) /* flow label (20 bits) */
#if 1
/* ECN bits proposed by Sally Floyd */
#define IP6TOS_CE 0x01 /* congestion experienced */
@ -109,29 +109,33 @@ struct ip6_hdr {
*/
struct ip6_ext {
u_int8_t ip6e_nxt;
u_int8_t ip6e_len;
uint8_t ip6e_nxt;
uint8_t ip6e_len;
} UNALIGNED;
/* Hop-by-Hop options header */
struct ip6_hbh {
u_int8_t ip6h_nxt; /* next header */
u_int8_t ip6h_len; /* length in units of 8 octets */
uint8_t ip6h_nxt; /* next header */
uint8_t ip6h_len; /* length in units of 8 octets */
/* followed by options */
} UNALIGNED;
/* Destination options header */
struct ip6_dest {
u_int8_t ip6d_nxt; /* next header */
u_int8_t ip6d_len; /* length in units of 8 octets */
uint8_t ip6d_nxt; /* next header */
uint8_t ip6d_len; /* length in units of 8 octets */
/* followed by options */
} UNALIGNED;
/* http://www.iana.org/assignments/ipv6-parameters/ipv6-parameters.xhtml */
/* Option types and related macros */
#define IP6OPT_PAD1 0x00 /* 00 0 00000 */
#define IP6OPT_PADN 0x01 /* 00 0 00001 */
#define IP6OPT_JUMBO 0xC2 /* 11 0 00010 = 194 */
#define IP6OPT_JUMBO_LEN 6
#define IP6OPT_RPL 0x63 /* 01 1 00011 */
#define IP6OPT_TUN_ENC_LIMIT 0x04 /* 00 0 00100 */
#define IP6OPT_ROUTER_ALERT 0x05 /* 00 0 00101 */
#define IP6OPT_RTALERT_LEN 4
@ -140,11 +144,16 @@ struct ip6_dest {
#define IP6OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */
#define IP6OPT_MINLEN 2
#define IP6OPT_BINDING_UPDATE 0xc6 /* 11 0 00110 */
#define IP6OPT_BINDING_ACK 0x07 /* 00 0 00111 */
#define IP6OPT_BINDING_REQ 0x08 /* 00 0 01000 */
#define IP6OPT_QUICK_START 0x26 /* 00 1 00110 */
#define IP6OPT_CALIPSO 0x07 /* 00 0 00111 */
#define IP6OPT_SMF_DPD 0x08 /* 00 0 01000 */
#define IP6OPT_HOME_ADDRESS 0xc9 /* 11 0 01001 */
#define IP6OPT_HOMEADDR_MINLEN 18
#define IP6OPT_EID 0x8a /* 10 0 01010 */
#define IP6OPT_ILNP_NOTICE 0x8b /* 10 0 01011 */
#define IP6OPT_LINE_ID 0x8c /* 10 0 01100 */
#define IP6OPT_MPL 0x6d /* 01 1 01101 */
#define IP6OPT_IP_DFF 0xee /* 11 1 01110 */
#define IP6OPT_TYPE(o) ((o) & 0xC0)
#define IP6OPT_TYPE_SKIP 0x00
@ -156,30 +165,30 @@ struct ip6_dest {
/* Routing header */
struct ip6_rthdr {
u_int8_t ip6r_nxt; /* next header */
u_int8_t ip6r_len; /* length in units of 8 octets */
u_int8_t ip6r_type; /* routing type */
u_int8_t ip6r_segleft; /* segments left */
uint8_t ip6r_nxt; /* next header */
uint8_t ip6r_len; /* length in units of 8 octets */
uint8_t ip6r_type; /* routing type */
uint8_t ip6r_segleft; /* segments left */
/* followed by routing type specific data */
} UNALIGNED;
/* Type 0 Routing header */
struct ip6_rthdr0 {
u_int8_t ip6r0_nxt; /* next header */
u_int8_t ip6r0_len; /* length in units of 8 octets */
u_int8_t ip6r0_type; /* always zero */
u_int8_t ip6r0_segleft; /* segments left */
u_int8_t ip6r0_reserved; /* reserved field */
u_int8_t ip6r0_slmap[3]; /* strict/loose bit map */
uint8_t ip6r0_nxt; /* next header */
uint8_t ip6r0_len; /* length in units of 8 octets */
uint8_t ip6r0_type; /* always zero */
uint8_t ip6r0_segleft; /* segments left */
uint8_t ip6r0_reserved; /* reserved field */
uint8_t ip6r0_slmap[3]; /* strict/loose bit map */
struct in6_addr ip6r0_addr[1]; /* up to 23 addresses */
} UNALIGNED;
/* Fragment header */
struct ip6_frag {
u_int8_t ip6f_nxt; /* next header */
u_int8_t ip6f_reserved; /* reserved field */
u_int16_t ip6f_offlg; /* offset, reserved, and flag */
u_int32_t ip6f_ident; /* identification */
uint8_t ip6f_nxt; /* next header */
uint8_t ip6f_reserved; /* reserved field */
uint16_t ip6f_offlg; /* offset, reserved, and flag */
uint32_t ip6f_ident; /* identification */
} UNALIGNED;
#define IP6F_OFF_MASK 0xfff8 /* mask out offset from ip6f_offlg */
@ -187,6 +196,6 @@ struct ip6_frag {
#define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
/* in print-ip6.c */
extern int nextproto6_cksum(const struct ip6_hdr *, const u_int8_t *, u_int, u_int);
extern int nextproto6_cksum(const struct ip6_hdr *, const uint8_t *, u_int, u_int, u_int);
#endif /* not _NETINET_IP6_H_ */

29
ipfc.h
View File

@ -1,29 +0,0 @@
/*
* 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

13
ipnet.h
View File

@ -1,13 +0,0 @@
typedef struct ipnet_hdr {
uint8_t iph_version;
uint8_t iph_family;
uint16_t iph_htype;
uint32_t iph_pktlen;
uint32_t iph_ifindex;
uint32_t iph_grifindex;
uint32_t iph_zsrc;
uint32_t iph_zdst;
} ipnet_hdr_t;
#define IPH_AF_INET 2 /* Matches Solaris's AF_INET */
#define IPH_AF_INET6 26 /* Matches Solaris's AF_INET6 */

View File

@ -1,4 +1,4 @@
/*
/*
* 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
@ -13,11 +13,7 @@
* Original code by Hannes Gredler (hannes@juniper.net)
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/ipproto.c,v 1.6 2005-09-20 06:01:22 guy Exp $ (LBL)";
#endif
#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

View File

@ -30,8 +30,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#) $Header: /tcpdump/master/tcpdump/ipproto.h,v 1.6 2005-09-20 06:01: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 $

View File

@ -1,151 +0,0 @@
/*
* Copyright (C) 1995, 1996, 1997, and 1998 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.
*/
/* YIPS @(#)$Id: ipsec_doi.h,v 1.7 2002-12-11 07:13:53 guy Exp $ */
/* refer to RFC 2407 */
#if !defined(_IPSEC_DOI_H_)
#define _IPSEC_DOI_H_
#define IPSEC_DOI 1
/* 4.2 IPSEC Situation Definition */
#define IPSECDOI_SIT_IDENTITY_ONLY 0x00000001
#define IPSECDOI_SIT_SECRECY 0x00000002
#define IPSECDOI_SIT_INTEGRITY 0x00000004
/* 4.4.1 IPSEC Security Protocol Identifiers */
/* 4.4.2 IPSEC ISAKMP Transform Values */
#define IPSECDOI_PROTO_ISAKMP 1
#define IPSECDOI_KEY_IKE 1
/* 4.4.1 IPSEC Security Protocol Identifiers */
#define IPSECDOI_PROTO_IPSEC_AH 2
/* 4.4.3 IPSEC AH Transform Values */
#define IPSECDOI_AH_MD5 2
#define IPSECDOI_AH_SHA 3
#define IPSECDOI_AH_DES 4
#define IPSECDOI_AH_SHA2_256 5
#define IPSECDOI_AH_SHA2_384 6
#define IPSECDOI_AH_SHA2_512 7
/* 4.4.1 IPSEC Security Protocol Identifiers */
#define IPSECDOI_PROTO_IPSEC_ESP 3
/* 4.4.4 IPSEC ESP Transform Identifiers */
#define IPSECDOI_ESP_DES_IV64 1
#define IPSECDOI_ESP_DES 2
#define IPSECDOI_ESP_3DES 3
#define IPSECDOI_ESP_RC5 4
#define IPSECDOI_ESP_IDEA 5
#define IPSECDOI_ESP_CAST 6
#define IPSECDOI_ESP_BLOWFISH 7
#define IPSECDOI_ESP_3IDEA 8
#define IPSECDOI_ESP_DES_IV32 9
#define IPSECDOI_ESP_RC4 10
#define IPSECDOI_ESP_NULL 11
#define IPSECDOI_ESP_RIJNDAEL 12
#define IPSECDOI_ESP_AES 12
/* 4.4.1 IPSEC Security Protocol Identifiers */
#define IPSECDOI_PROTO_IPCOMP 4
/* 4.4.5 IPSEC IPCOMP Transform Identifiers */
#define IPSECDOI_IPCOMP_OUI 1
#define IPSECDOI_IPCOMP_DEFLATE 2
#define IPSECDOI_IPCOMP_LZS 3
/* 4.5 IPSEC Security Association Attributes */
#define IPSECDOI_ATTR_SA_LTYPE 1 /* B */
#define IPSECDOI_ATTR_SA_LTYPE_DEFAULT 1
#define IPSECDOI_ATTR_SA_LTYPE_SEC 1
#define IPSECDOI_ATTR_SA_LTYPE_KB 2
#define IPSECDOI_ATTR_SA_LDUR 2 /* V */
#define IPSECDOI_ATTR_SA_LDUR_DEFAULT 28800 /* 8 hours */
#define IPSECDOI_ATTR_GRP_DESC 3 /* B */
#define IPSECDOI_ATTR_ENC_MODE 4 /* B */
/* default value: host dependent */
#define IPSECDOI_ATTR_ENC_MODE_TUNNEL 1
#define IPSECDOI_ATTR_ENC_MODE_TRNS 2
#define IPSECDOI_ATTR_AUTH 5 /* B */
/* 0 means not to use authentication. */
#define IPSECDOI_ATTR_AUTH_HMAC_MD5 1
#define IPSECDOI_ATTR_AUTH_HMAC_SHA1 2
#define IPSECDOI_ATTR_AUTH_DES_MAC 3
#define IPSECDOI_ATTR_AUTH_KPDK 4 /*RFC-1826(Key/Pad/Data/Key)*/
/*
* When negotiating ESP without authentication, the Auth
* Algorithm attribute MUST NOT be included in the proposal.
* When negotiating ESP without confidentiality, the Auth
* Algorithm attribute MUST be included in the proposal and
* the ESP transform ID must be ESP_NULL.
*/
#define IPSECDOI_ATTR_KEY_LENGTH 6 /* B */
#define IPSECDOI_ATTR_KEY_ROUNDS 7 /* B */
#define IPSECDOI_ATTR_COMP_DICT_SIZE 8 /* B */
#define IPSECDOI_ATTR_COMP_PRIVALG 9 /* V */
/* 4.6.1 Security Association Payload */
struct ipsecdoi_sa {
struct isakmp_gen h;
u_int32_t doi; /* Domain of Interpretation */
u_int32_t sit; /* Situation */
};
struct ipsecdoi_secrecy_h {
u_int16_t len;
u_int16_t reserved;
};
/* 4.6.2.1 Identification Type Values */
struct ipsecdoi_id {
struct isakmp_gen h;
u_int8_t type; /* ID Type */
u_int8_t proto_id; /* Protocol ID */
u_int16_t port; /* Port */
/* Identification Data */
};
#define IPSECDOI_ID_IPV4_ADDR 1
#define IPSECDOI_ID_FQDN 2
#define IPSECDOI_ID_USER_FQDN 3
#define IPSECDOI_ID_IPV4_ADDR_SUBNET 4
#define IPSECDOI_ID_IPV6_ADDR 5
#define IPSECDOI_ID_IPV6_ADDR_SUBNET 6
#define IPSECDOI_ID_IPV4_ADDR_RANGE 7
#define IPSECDOI_ID_IPV6_ADDR_RANGE 8
#define IPSECDOI_ID_DER_ASN1_DN 9
#define IPSECDOI_ID_DER_ASN1_GN 10
#define IPSECDOI_ID_KEY_ID 11
/* 4.6.3 IPSEC DOI Notify Message Types */
/* Notify Messages - Status Types */
#define IPSECDOI_NTYPE_RESPONDER_LIFETIME 24576
#define IPSECDOI_NTYPE_REPLAY_STATUS 24577
#define IPSECDOI_NTYPE_INITIAL_CONTACT 24578
#endif /* !defined(_IPSEC_DOI_H_) */

31
ipx.h
View File

@ -1,31 +0,0 @@
/*
* IPX protocol formats
*
* @(#) $Header: /tcpdump/master/tcpdump/ipx.h,v 1.8 2002-12-11 07:13:54 guy Exp $
*/
/* well-known sockets */
#define IPX_SKT_NCP 0x0451
#define IPX_SKT_SAP 0x0452
#define IPX_SKT_RIP 0x0453
#define IPX_SKT_NETBIOS 0x0455
#define IPX_SKT_DIAGNOSTICS 0x0456
#define IPX_SKT_NWLINK_DGM 0x0553 /* NWLink datagram, may contain SMB */
#define IPX_SKT_EIGRP 0x85be /* Cisco EIGRP over IPX */
/* IPX transport header */
struct ipxHdr {
u_int16_t cksum; /* Checksum */
u_int16_t length; /* Length, in bytes, including header */
u_int8_t tCtl; /* Transport Control (i.e. hop count) */
u_int8_t pType; /* Packet Type (i.e. level 2 protocol) */
u_int16_t dstNet[2]; /* destination net */
u_int8_t dstNode[6]; /* destination node */
u_int16_t dstSkt; /* destination socket */
u_int16_t srcNet[2]; /* source net */
u_int8_t srcNode[6]; /* source node */
u_int16_t srcSkt; /* source socket */
};
#define ipxSize 30

501
isakmp.h
View File

@ -1,501 +0,0 @@
/*
* Copyright (C) 1995, 1996, 1997, and 1998 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.
*/
/* YIPS @(#)$Id: isakmp.h,v 1.12 2007-11-24 18:13:33 mcr Exp $ */
/* refer to RFC 2408 */
/* must include <netinet/in.h> */
#if !defined(_ISAKMP_H_)
#define _ISAKMP_H_
typedef u_char cookie_t[8];
typedef u_char msgid_t[4];
typedef struct { /* i_cookie + r_cookie */
cookie_t i_ck;
cookie_t r_ck;
} isakmp_index;
#define INITIATOR 1
#define RESPONDER 2
#define PORT_ISAKMP 500
#define GENERATE 1
#define VALIDATE 0
/* Phase of oakley definition */
/*
0000 0000 0000 0000
| |||| ||||
| |||| ++++--> negosiation number in phase
| ++++-------> phase number
+---------------> expire ?
*/
#define ISAKMP_PH1 0x0010
#define ISAKMP_PH2 0x0020
#define ISAKMP_EXPIRED 0x0100
#define ISAKMP_NGP_0 0x0000
#define ISAKMP_NGP_1 0x0001
#define ISAKMP_NGP_2 0x0002
#define ISAKMP_NGP_3 0x0003
#define ISAKMP_NGP_4 0x0004
#define ISAKMP_PH1_N (ISAKMP_PH1 | ISAKMP_NGP_0) /* i.e. spawn */
#define ISAKMP_PH1_1 (ISAKMP_PH1 | ISAKMP_NGP_1)
#define ISAKMP_PH1_2 (ISAKMP_PH1 | ISAKMP_NGP_2)
#define ISAKMP_PH1_3 (ISAKMP_PH1 | ISAKMP_NGP_3)
#define ISAKMP_PH2_N (ISAKMP_PH2 | ISAKMP_NGP_0)
#define ISAKMP_PH2_1 (ISAKMP_PH2 | ISAKMP_NGP_1)
#define ISAKMP_PH2_2 (ISAKMP_PH2 | ISAKMP_NGP_2)
#define ISAKMP_PH2_3 (ISAKMP_PH2 | ISAKMP_NGP_3)
#define ISAKMP_TIMER_DEFAULT 10 /* seconds */
#define ISAKMP_TRY_DEFAULT 3 /* times */
/* 3.1 ISAKMP Header Format (IKEv1 and IKEv2)
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Initiator !
! Cookie !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Responder !
! Cookie !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Next Payload ! MjVer ! MnVer ! Exchange Type ! Flags !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Message ID !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct isakmp {
cookie_t i_ck; /* Initiator Cookie */
cookie_t r_ck; /* Responder Cookie */
u_int8_t np; /* Next Payload Type */
u_int8_t vers;
#define ISAKMP_VERS_MAJOR 0xf0
#define ISAKMP_VERS_MAJOR_SHIFT 4
#define ISAKMP_VERS_MINOR 0x0f
#define ISAKMP_VERS_MINOR_SHIFT 0
u_int8_t etype; /* Exchange Type */
u_int8_t flags; /* Flags */
msgid_t msgid;
u_int32_t len; /* Length */
};
/* Next Payload Type */
#define ISAKMP_NPTYPE_NONE 0 /* NONE*/
#define ISAKMP_NPTYPE_SA 1 /* Security Association */
#define ISAKMP_NPTYPE_P 2 /* Proposal */
#define ISAKMP_NPTYPE_T 3 /* Transform */
#define ISAKMP_NPTYPE_KE 4 /* Key Exchange */
#define ISAKMP_NPTYPE_ID 5 /* Identification */
#define ISAKMP_NPTYPE_CERT 6 /* Certificate */
#define ISAKMP_NPTYPE_CR 7 /* Certificate Request */
#define ISAKMP_NPTYPE_HASH 8 /* Hash */
#define ISAKMP_NPTYPE_SIG 9 /* Signature */
#define ISAKMP_NPTYPE_NONCE 10 /* Nonce */
#define ISAKMP_NPTYPE_N 11 /* Notification */
#define ISAKMP_NPTYPE_D 12 /* Delete */
#define ISAKMP_NPTYPE_VID 13 /* Vendor ID */
#define ISAKMP_NPTYPE_v2E 46 /* v2 Encrypted payload */
#define IKEv1_MAJOR_VERSION 1
#define IKEv1_MINOR_VERSION 0
#define IKEv2_MAJOR_VERSION 2
#define IKEv2_MINOR_VERSION 0
/* Exchange Type */
#define ISAKMP_ETYPE_NONE 0 /* NONE */
#define ISAKMP_ETYPE_BASE 1 /* Base */
#define ISAKMP_ETYPE_IDENT 2 /* Identity Proteciton */
#define ISAKMP_ETYPE_AUTH 3 /* Authentication Only */
#define ISAKMP_ETYPE_AGG 4 /* Aggressive */
#define ISAKMP_ETYPE_INF 5 /* Informational */
/* Flags */
#define ISAKMP_FLAG_E 0x01 /* Encryption Bit */
#define ISAKMP_FLAG_C 0x02 /* Commit Bit */
#define ISAKMP_FLAG_extra 0x04
/* IKEv2 */
#define ISAKMP_FLAG_I (1 << 3) /* (I)nitiator */
#define ISAKMP_FLAG_V (1 << 4) /* (V)ersion */
#define ISAKMP_FLAG_R (1 << 5) /* (R)esponse */
/* 3.2 Payload Generic Header
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Next Payload ! RESERVED ! Payload Length !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct isakmp_gen {
u_int8_t np; /* Next Payload */
u_int8_t critical; /* bit 7 - critical, rest is RESERVED */
u_int16_t len; /* Payload Length */
};
/* 3.3 Data Attributes
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!A! Attribute Type ! AF=0 Attribute Length !
!F! ! AF=1 Attribute Value !
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
. AF=0 Attribute Value .
. AF=1 Not Transmitted .
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct isakmp_data {
u_int16_t type; /* defined by DOI-spec, and Attribute Format */
u_int16_t lorv; /* if f equal 1, Attribute Length */
/* if f equal 0, Attribute Value */
/* if f equal 1, Attribute Value */
};
#define ISAKMP_GEN_TLV 0x0000
#define ISAKMP_GEN_TV 0x8000
/* mask for type of attribute format */
#define ISAKMP_GEN_MASK 0x8000
/* 3.4 Security Association Payload */
/* MAY NOT be used, because of being defined in ipsec-doi. */
/*
If the current payload is the last in the message,
then the value of the next payload field will be 0.
This field MUST NOT contain the
values for the Proposal or Transform payloads as they are considered
part of the security association negotiation. For example, this
field would contain the value "10" (Nonce payload) in the first
message of a Base Exchange (see Section 4.4) and the value "0" in the
first message of an Identity Protect Exchange (see Section 4.5).
*/
struct ikev1_pl_sa {
struct isakmp_gen h;
u_int32_t doi; /* Domain of Interpretation */
u_int32_t sit; /* Situation */
};
/* 3.5 Proposal Payload */
/*
The value of the next payload field MUST only contain the value "2"
or "0". If there are additional Proposal payloads in the message,
then this field will be 2. If the current Proposal payload is the
last within the security association proposal, then this field will
be 0.
*/
struct ikev1_pl_p {
struct isakmp_gen h;
u_int8_t p_no; /* Proposal # */
u_int8_t prot_id; /* Protocol */
u_int8_t spi_size; /* SPI Size */
u_int8_t num_t; /* Number of Transforms */
/* SPI */
};
/* 3.6 Transform Payload */
/*
The value of the next payload field MUST only contain the value "3"
or "0". If there are additional Transform payloads in the proposal,
then this field will be 3. If the current Transform payload is the
last within the proposal, then this field will be 0.
*/
struct ikev1_pl_t {
struct isakmp_gen h;
u_int8_t t_no; /* Transform # */
u_int8_t t_id; /* Transform-Id */
u_int16_t reserved; /* RESERVED2 */
/* SA Attributes */
};
/* 3.7 Key Exchange Payload */
struct ikev1_pl_ke {
struct isakmp_gen h;
/* Key Exchange Data */
};
/* 3.8 Identification Payload */
/* MUST NOT to be used, because of being defined in ipsec-doi. */
struct ikev1_pl_id {
struct isakmp_gen h;
union {
u_int8_t id_type; /* ID Type */
u_int32_t doi_data; /* DOI Specific ID Data */
} d;
/* Identification Data */
};
/* 3.9 Certificate Payload */
struct ikev1_pl_cert {
struct isakmp_gen h;
u_int8_t encode; /* Cert Encoding */
char cert; /* Certificate Data */
/*
This field indicates the type of
certificate or certificate-related information contained in the
Certificate Data field.
*/
};
/* Certificate Type */
#define ISAKMP_CERT_NONE 0
#define ISAKMP_CERT_PKCS 1
#define ISAKMP_CERT_PGP 2
#define ISAKMP_CERT_DNS 3
#define ISAKMP_CERT_SIGN 4
#define ISAKMP_CERT_KE 5
#define ISAKMP_CERT_KT 6
#define ISAKMP_CERT_CRL 7
#define ISAKMP_CERT_ARL 8
#define ISAKMP_CERT_SPKI 9
/* 3.10 Certificate Request Payload */
struct ikev1_pl_cr {
struct isakmp_gen h;
u_int8_t num_cert; /* # Cert. Types */
/*
Certificate Types (variable length)
-- Contains a list of the types of certificates requested,
sorted in order of preference. Each individual certificate
type is 1 octet. This field is NOT requiredo
*/
/* # Certificate Authorities (1 octet) */
/* Certificate Authorities (variable length) */
};
/* 3.11 Hash Payload */
/* may not be used, because of having only data. */
struct ikev1_pl_hash {
struct isakmp_gen h;
/* Hash Data */
};
/* 3.12 Signature Payload */
/* may not be used, because of having only data. */
struct ikev1_pl_sig {
struct isakmp_gen h;
/* Signature Data */
};
/* 3.13 Nonce Payload */
/* may not be used, because of having only data. */
struct ikev1_pl_nonce {
struct isakmp_gen h;
/* Nonce Data */
};
/* 3.14 Notification Payload */
struct ikev1_pl_n {
struct isakmp_gen h;
u_int32_t doi; /* Domain of Interpretation */
u_int8_t prot_id; /* Protocol-ID */
u_int8_t spi_size; /* SPI Size */
u_int16_t type; /* Notify Message Type */
/* SPI */
/* Notification Data */
};
/* 3.14.1 Notify Message Types */
/* NOTIFY MESSAGES - ERROR TYPES */
#define ISAKMP_NTYPE_INVALID_PAYLOAD_TYPE 1
#define ISAKMP_NTYPE_DOI_NOT_SUPPORTED 2
#define ISAKMP_NTYPE_SITUATION_NOT_SUPPORTED 3
#define ISAKMP_NTYPE_INVALID_COOKIE 4
#define ISAKMP_NTYPE_INVALID_MAJOR_VERSION 5
#define ISAKMP_NTYPE_INVALID_MINOR_VERSION 6
#define ISAKMP_NTYPE_INVALID_EXCHANGE_TYPE 7
#define ISAKMP_NTYPE_INVALID_FLAGS 8
#define ISAKMP_NTYPE_INVALID_MESSAGE_ID 9
#define ISAKMP_NTYPE_INVALID_PROTOCOL_ID 10
#define ISAKMP_NTYPE_INVALID_SPI 11
#define ISAKMP_NTYPE_INVALID_TRANSFORM_ID 12
#define ISAKMP_NTYPE_ATTRIBUTES_NOT_SUPPORTED 13
#define ISAKMP_NTYPE_NO_PROPOSAL_CHOSEN 14
#define ISAKMP_NTYPE_BAD_PROPOSAL_SYNTAX 15
#define ISAKMP_NTYPE_PAYLOAD_MALFORMED 16
#define ISAKMP_NTYPE_INVALID_KEY_INFORMATION 17
#define ISAKMP_NTYPE_INVALID_ID_INFORMATION 18
#define ISAKMP_NTYPE_INVALID_CERT_ENCODING 19
#define ISAKMP_NTYPE_INVALID_CERTIFICATE 20
#define ISAKMP_NTYPE_BAD_CERT_REQUEST_SYNTAX 21
#define ISAKMP_NTYPE_INVALID_CERT_AUTHORITY 22
#define ISAKMP_NTYPE_INVALID_HASH_INFORMATION 23
#define ISAKMP_NTYPE_AUTHENTICATION_FAILED 24
#define ISAKMP_NTYPE_INVALID_SIGNATURE 25
#define ISAKMP_NTYPE_ADDRESS_NOTIFICATION 26
/* NOTIFY MESSAGES - STATUS TYPES */
#define ISAKMP_NTYPE_CONNECTED 16384
/* using only to log */
#define ISAKMP_LOG_RETRY_LIMIT_REACHED 65530
/* 3.15 Delete Payload */
struct ikev1_pl_d {
struct isakmp_gen h;
u_int32_t doi; /* Domain of Interpretation */
u_int8_t prot_id; /* Protocol-Id */
u_int8_t spi_size; /* SPI Size */
u_int16_t num_spi; /* # of SPIs */
/* SPI(es) */
};
struct ikev1_ph1tab {
struct ikev1_ph1 *head;
struct ikev1_ph1 *tail;
int len;
};
struct isakmp_ph2tab {
struct ikev1_ph2 *head;
struct ikev1_ph2 *tail;
int len;
};
#define EXCHANGE_PROXY 1
#define EXCHANGE_MYSELF 0
#define PFS_NEED 1
#define PFS_NONEED 0
/* IKEv2 (RFC4306) */
/* 3.3 Security Association Payload -- generic header */
/* 3.3.1. Proposal Substructure */
struct ikev2_p {
struct isakmp_gen h;
u_int8_t p_no; /* Proposal # */
u_int8_t prot_id; /* Protocol */
u_int8_t spi_size; /* SPI Size */
u_int8_t num_t; /* Number of Transforms */
};
/* 3.3.2. Transform Substructure */
struct ikev2_t {
struct isakmp_gen h;
u_int8_t t_type; /* Transform Type (ENCR,PRF,INTEG,etc.*/
u_int8_t res2; /* reserved byte */
u_int16_t t_id; /* Transform ID */
};
enum ikev2_t_type {
IV2_T_ENCR = 1,
IV2_T_PRF = 2,
IV2_T_INTEG= 3,
IV2_T_DH = 4,
IV2_T_ESN = 5,
};
/* 3.4. Key Exchange Payload */
struct ikev2_ke {
struct isakmp_gen h;
u_int16_t ke_group;
u_int16_t ke_res1;
/* KE data */
};
/* 3.5. Identification Payloads */
enum ikev2_id_type {
ID_IPV4_ADDR=1,
ID_FQDN=2,
ID_RFC822_ADDR=3,
ID_IPV6_ADDR=5,
ID_DER_ASN1_DN=9,
ID_DER_ASN1_GN=10,
ID_KEY_ID=11,
};
struct ikev2_id {
struct isakmp_gen h;
u_int8_t type; /* ID type */
u_int8_t res1;
u_int16_t res2;
/* SPI */
/* Notification Data */
};
/* 3.10 Notification Payload */
struct ikev2_n {
struct isakmp_gen h;
u_int8_t prot_id; /* Protocol-ID */
u_int8_t spi_size; /* SPI Size */
u_int16_t type; /* Notify Message Type */
};
enum ikev2_n_type {
IV2_NOTIFY_UNSUPPORTED_CRITICAL_PAYLOAD = 1,
IV2_NOTIFY_INVALID_IKE_SPI = 4,
IV2_NOTIFY_INVALID_MAJOR_VERSION = 5,
IV2_NOTIFY_INVALID_SYNTAX = 7,
IV2_NOTIFY_INVALID_MESSAGE_ID = 9,
IV2_NOTIFY_INVALID_SPI =11,
IV2_NOTIFY_NO_PROPOSAL_CHOSEN =14,
IV2_NOTIFY_INVALID_KE_PAYLOAD =17,
IV2_NOTIFY_AUTHENTICATION_FAILED =24,
IV2_NOTIFY_SINGLE_PAIR_REQUIRED =34,
IV2_NOTIFY_NO_ADDITIONAL_SAS =35,
IV2_NOTIFY_INTERNAL_ADDRESS_FAILURE =36,
IV2_NOTIFY_FAILED_CP_REQUIRED =37,
IV2_NOTIFY_INVALID_SELECTORS =39,
IV2_NOTIFY_INITIAL_CONTACT =16384,
IV2_NOTIFY_SET_WINDOW_SIZE =16385,
IV2_NOTIFY_ADDITIONAL_TS_POSSIBLE =16386,
IV2_NOTIFY_IPCOMP_SUPPORTED =16387,
IV2_NOTIFY_NAT_DETECTION_SOURCE_IP =16388,
IV2_NOTIFY_NAT_DETECTION_DESTINATION_IP =16389,
IV2_NOTIFY_COOKIE =16390,
IV2_NOTIFY_USE_TRANSPORT_MODE =16391,
IV2_NOTIFY_HTTP_CERT_LOOKUP_SUPPORTED =16392,
IV2_NOTIFY_REKEY_SA =16393,
IV2_NOTIFY_ESP_TFC_PADDING_NOT_SUPPORTED =16394,
IV2_NOTIFY_NON_FIRST_FRAGMENTS_ALSO =16395
};
struct notify_messages {
u_int16_t type;
char *msg;
};
/* 3.8 Notification Payload */
struct ikev2_auth {
struct isakmp_gen h;
u_int8_t auth_method; /* Protocol-ID */
u_int8_t reserved[3];
/* authentication data */
};
enum ikev2_auth_type {
IV2_RSA_SIG = 1,
IV2_SHARED = 2,
IV2_DSS_SIG = 3,
};
#endif /* !defined(_ISAKMP_H_) */

62
l2tp.h
View File

@ -1,62 +0,0 @@
/* @(#) $Header: /tcpdump/master/tcpdump/l2tp.h,v 1.5 2001-11-05 10:03:27 guy Exp $ (LBL) */
/*
* Copyright (c) 1991, 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.
*
* L2TP support contributed by Motonori Shindo (mshindo@mshindo.net)
*/
#define L2TP_FLAG_TYPE 0x8000 /* Type (0=Data, 1=Control) */
#define L2TP_FLAG_LENGTH 0x4000 /* Length */
#define L2TP_FLAG_SEQUENCE 0x0800 /* Sequence */
#define L2TP_FLAG_OFFSET 0x0200 /* Offset */
#define L2TP_FLAG_PRIORITY 0x0100 /* Priority */
#define L2TP_VERSION_MASK 0x000f /* Version Mask */
#define L2TP_VERSION_L2F 0x0001 /* L2F */
#define L2TP_VERSION_L2TP 0x0002 /* L2TP */
#define L2TP_AVP_HDR_FLAG_MANDATORY 0x8000 /* Mandatory Flag */
#define L2TP_AVP_HDR_FLAG_HIDDEN 0x4000 /* Hidden Flag */
#define L2TP_AVP_HDR_LEN_MASK 0x03ff /* Length Mask */
#define L2TP_FRAMING_CAP_SYNC_MASK 0x00000001 /* Synchronous */
#define L2TP_FRAMING_CAP_ASYNC_MASK 0x00000002 /* Asynchronous */
#define L2TP_FRAMING_TYPE_SYNC_MASK 0x00000001 /* Synchronous */
#define L2TP_FRAMING_TYPE_ASYNC_MASK 0x00000002 /* Asynchronous */
#define L2TP_BEARER_CAP_DIGITAL_MASK 0x00000001 /* Digital */
#define L2TP_BEARER_CAP_ANALOG_MASK 0x00000002 /* Analog */
#define L2TP_BEARER_TYPE_DIGITAL_MASK 0x00000001 /* Digital */
#define L2TP_BEARER_TYPE_ANALOG_MASK 0x00000002 /* Analog */
/* Authen Type */
#define L2TP_AUTHEN_TYPE_RESERVED 0x0000 /* Reserved */
#define L2TP_AUTHEN_TYPE_TEXTUAL 0x0001 /* Textual username/password exchange */
#define L2TP_AUTHEN_TYPE_CHAP 0x0002 /* PPP CHAP */
#define L2TP_AUTHEN_TYPE_PAP 0x0003 /* PPP PAP */
#define L2TP_AUTHEN_TYPE_NO_AUTH 0x0004 /* No Authentication */
#define L2TP_AUTHEN_TYPE_MSCHAPv1 0x0005 /* MSCHAPv1 */
#define L2TP_PROXY_AUTH_ID_MASK 0x00ff

30
l2vpn.c
View File

@ -1,4 +1,4 @@
/*
/*
* 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
@ -13,11 +13,7 @@
* Original code by Hannes Gredler (hannes@juniper.net)
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/l2vpn.c,v 1.1 2004-06-15 09:42:40 hannes Exp $ (LBL)";
#endif
#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@ -31,16 +27,16 @@ const struct tok l2vpn_encaps_values[] = {
{ 0x00, "Reserved"},
{ 0x01, "Frame Relay"},
{ 0x02, "ATM AAL5 VCC transport"},
{ 0x03, "ATM transparent cell transport"},
{ 0x04, "Ethernet VLAN"},
{ 0x05, "Ethernet"},
{ 0x06, "Cisco-HDLC"},
{ 0x07, "PPP"},
{ 0x08, "SONET/SDH Circuit Emulation Service over MPLS"},
{ 0x09, "ATM n-to-one VCC cell transport"},
{ 0x0a, "ATM n-to-one VPC cell transport"},
{ 0x0b, "IP Layer2 Transport"},
{ 0x0c, "ATM one-to-one VCC Cell Mode"},
{ 0x03, "ATM transparent cell transport"},
{ 0x04, "Ethernet VLAN"},
{ 0x05, "Ethernet"},
{ 0x06, "Cisco-HDLC"},
{ 0x07, "PPP"},
{ 0x08, "SONET/SDH Circuit Emulation Service over MPLS"},
{ 0x09, "ATM n-to-one VCC cell transport"},
{ 0x0a, "ATM n-to-one VPC cell transport"},
{ 0x0b, "IP Layer2 Transport"},
{ 0x0c, "ATM one-to-one VCC Cell Mode"},
{ 0x0d, "ATM one-to-one VPC Cell Mode"},
{ 0x0e, "ATM AAL5 PDU VCC transport"},
{ 0x0f, "Frame-Relay Port mode"},
@ -53,6 +49,6 @@ const struct tok l2vpn_encaps_values[] = {
{ 0x16, "TDMoIP basic mode"},
{ 0x17, "CESoPSN TDM with CAS"},
{ 0x18, "TDMoIP TDM with CAS"},
{ 0x40, "IP-interworking"},
{ 0x40, "IP-interworking"},
{ 0, NULL}
};

View File

@ -1,5 +1,4 @@
/* @(#) $Header: /tcpdump/master/tcpdump/l2vpn.h,v 1.1 2004-06-15 09:42:41 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

41
lane.h
View File

@ -1,41 +0,0 @@
/*
* Marko Kiiskila carnil@cs.tut.fi
*
* Tampere University of Technology - Telecommunications Laboratory
*
* Permission to use, copy, modify and distribute this
* software and its documentation is hereby granted,
* provided that both the copyright notice and this
* permission notice appear in all copies of the software,
* derivative works or modified versions, and any portions
* thereof, that both notices appear in supporting
* documentation, and that the use of this software is
* acknowledged in any publications resulting from using
* the software.
*
* TUT ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION AND DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS
* SOFTWARE.
*
*/
/* $Id: lane.h,v 1.7 2002-12-11 07:13:54 guy Exp $ */
#ifndef ETHER_ADDR_LEN
#define ETHER_ADDR_LEN 6
#endif
struct lecdatahdr_8023 {
u_int16_t le_header;
u_int8_t h_dest[ETHER_ADDR_LEN];
u_int8_t h_source[ETHER_ADDR_LEN];
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;
};

View File

@ -17,8 +17,6 @@
* 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/lbl/os-osf4.h,v 1.1 2002-12-11 05:03:13 guy Exp $ (LBL)
*/
/* Prototypes missing in Digital UNIX 4.x */

View File

@ -17,8 +17,6 @@
* 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/lbl/os-solaris2.h,v 1.19 2000-10-11 04:02:15 guy Exp $ (LBL)
*/
/* Prototypes missing in SunOS 5 */

View File

@ -17,8 +17,6 @@
* 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/lbl/os-sunos4.h,v 1.32 1999-10-07 23:47:13 mcr Exp $ (LBL)
*/
/* Prototypes missing in SunOS 4 */

View File

@ -17,8 +17,6 @@
* 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/lbl/os-ultrix4.h,v 1.19 1999-10-07 23:47:13 mcr Exp $ (LBL)
*/
/* Prototypes missing in Ultrix 4 */

3
llc.h
View File

@ -17,8 +17,6 @@
* 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/llc.h,v 1.23 2007-04-13 09:43:11 hannes Exp $ (LBL)
*/
/*
@ -106,6 +104,7 @@
#define PID_CISCO_DTP 0x2004 /* Cisco Dynamic Trunk Protocol */
#define PID_CISCO_UDLD 0x0111 /* Unidirectional Link Detection */
#define PID_CISCO_PVST 0x010b /* Per VLAN Spanning Tree+ and RPVST+ */
#define PID_CISCO_VLANBRIDGE 0x010c /* "VLAN Bridge", according to Wireshark */
/*
* PIDs for use with OUI_RFC2684.

View File

@ -19,11 +19,6 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/machdep.c,v 1.13 2003-12-15 03:53:21 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@ -46,7 +41,10 @@ static const char rcsid[] _U_ =
#if !defined(HAVE_SNPRINTF)
int snprintf(char *, size_t, const char *, ...)
__attribute__((format(printf, 3, 4)));
#ifdef __ATTRIBUTE___FORMAT_OK
__attribute__((format(printf, 3, 4)))
#endif /* __ATTRIBUTE___FORMAT_OK */
;
#endif /* !defined(HAVE_SNPRINTF) */
#endif /* __osf__ */

View File

@ -17,8 +17,6 @@
* 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/machdep.h,v 1.2 2000-01-17 06:24:24 itojun Exp $ (LBL)
*/
#ifndef tcpdump_machdep_h
#define tcpdump_machdep_h

View File

@ -26,8 +26,6 @@
# 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.
#
# @(#) $Id: makemib,v 1.3 2001-09-17 22:16:52 fenner Exp $ (jlv)
#
# This script will read either ASN.1-style MIB files or the ".defs" files
@ -39,7 +37,7 @@
# This script needs to be run by "gawk" (GNU awk). "nawk" will work, but
# dump will get a recursion error if you process LARGE mibs. While it would
# by farily easy to rewrite this not to use recursion (and also easy to
# eliminate use of gsub and functions to use classic "awk"), you have to
# eliminate use of gsub and functions to use classic "awk"), you have to
# order the structure declarations in defined-first order for the compiler
# not to barf; too bad tsort doesn't take arguments.
#
@ -49,7 +47,7 @@ cat << EOF
* This file was generated by tcpdump/makemib on `date`
* You probably don't want to edit this by hand!
*
* struct mib somename = { desc, oid-octet, type, child-pointer, next-pointer
* struct mib somename = { desc, oid-octet, type, child-pointer, next-pointer
};
*/
@ -159,7 +157,7 @@ $2$3 == "::={" {
}
#
#
# End of the road - output the data.
#

View File

@ -27,8 +27,6 @@
* SUCH DAMAGE.
*/
/* $Id: addrinfo.h,v 1.4 2002-06-11 17:13:36 itojun Exp $ */
#ifndef HAVE_ADDRINFO
/*

View File

@ -31,11 +31,6 @@
* SUCH DAMAGE.
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/missing/datalinks.c,v 1.3 2003-11-16 09:36:47 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

View File

@ -31,11 +31,6 @@
* SUCH DAMAGE.
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/missing/dlnames.c,v 1.5 2003-11-18 23:09:43 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

View File

@ -41,11 +41,6 @@
#include <config.h>
#endif
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/missing/getnameinfo.c,v 1.11 2003-11-16 09:36:49 guy Exp $";
#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
@ -112,7 +107,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
u_short port;
int family, i;
char *addr, *p;
u_int32_t v4a;
uint32_t v4a;
int h_error;
char numserv[512];
char numaddr[512];
@ -168,7 +163,7 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
switch (sa->sa_family) {
case AF_INET:
v4a = (u_int32_t)
v4a = (uint32_t)
ntohl(((struct sockaddr_in *)sa)->sin_addr.s_addr);
if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a))
flags |= NI_NUMERICHOST;

612
missing/getopt_long.c Normal file
View File

@ -0,0 +1,612 @@
/* $OpenBSD: getopt_long.c,v 1.22 2006/10/04 21:29:04 jmc Exp $ */
/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
/*
* Copyright (c) 2002 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Sponsored in part by the Defense Advanced Research Projects
* Agency (DARPA) and Air Force Research Laboratory, Air Force
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Dieter Baron and Thomas Klausner.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
#include <errno.h>
#include "getopt_long.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#define GNU_COMPATIBLE /* Be more compatible, configure's use us! */
#define PRINT_ERROR ((opterr) && (*options != ':'))
#define FLAG_PERMUTE 0x01 /* permute non-options to the end of argv */
#define FLAG_ALLARGS 0x02 /* treat non-options as args to option "-1" */
#define FLAG_LONGONLY 0x04 /* operate as getopt_long_only */
/* return values */
#define BADCH (int)'?'
#define BADARG ((*options == ':') ? (int)':' : (int)'?')
#define INORDER (int)1
#define EMSG ""
#ifdef GNU_COMPATIBLE
#define NO_PREFIX (-1)
#define D_PREFIX 0
#define DD_PREFIX 1
#define W_PREFIX 2
#endif
char *optarg;
int optind, opterr = 1, optopt;
static int getopt_internal(int, char * const *, const char *,
const struct option *, int *, int);
static int parse_long_options(char * const *, const char *,
const struct option *, int *, int, int);
static int gcd(int, int);
static void permute_args(int, int, int, char * const *);
static const char *place = EMSG; /* option letter processing */
static int nonopt_start = -1; /* first non option argument (for permute) */
static int nonopt_end = -1; /* first option after non options (for permute) */
/* Error messages */
static const char recargchar[] = "option requires an argument -- %c";
static const char illoptchar[] = "illegal option -- %c"; /* From P1003.2 */
#ifdef GNU_COMPATIBLE
static int dash_prefix = NO_PREFIX;
static const char gnuoptchar[] = "invalid option -- %c";
static const char recargstring[] = "option `%s%s' requires an argument";
static const char ambig[] = "option `%s%.*s' is ambiguous";
static const char noarg[] = "option `%s%.*s' doesn't allow an argument";
static const char illoptstring[] = "unrecognized option `%s%s'";
#else
static const char recargstring[] = "option requires an argument -- %s";
static const char ambig[] = "ambiguous option -- %.*s";
static const char noarg[] = "option doesn't take an argument -- %.*s";
static const char illoptstring[] = "unknown option -- %s";
#endif
/*
* Compute the greatest common divisor of a and b.
*/
static int
gcd(int a, int b)
{
int c;
c = a % b;
while (c != 0) {
a = b;
b = c;
c = a % b;
}
return (b);
}
/*
* Exchange the block from nonopt_start to nonopt_end with the block
* from nonopt_end to opt_end (keeping the same order of arguments
* in each block).
*/
static void
permute_args(int panonopt_start, int panonopt_end, int opt_end,
char * const *nargv)
{
int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos;
char *swap;
/*
* compute lengths of blocks and number and size of cycles
*/
nnonopts = panonopt_end - panonopt_start;
nopts = opt_end - panonopt_end;
ncycle = gcd(nnonopts, nopts);
cyclelen = (opt_end - panonopt_start) / ncycle;
for (i = 0; i < ncycle; i++) {
cstart = panonopt_end+i;
pos = cstart;
for (j = 0; j < cyclelen; j++) {
if (pos >= panonopt_end)
pos -= nnonopts;
else
pos += nopts;
swap = nargv[pos];
/* LINTED const cast */
((char **) nargv)[pos] = nargv[cstart];
/* LINTED const cast */
((char **)nargv)[cstart] = swap;
}
}
}
static void
warnx(const char *fmt, ...)
{
extern char *program_name;
va_list ap;
va_start(ap, fmt);
fprintf(stderr, "%s: ", program_name);
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
va_end(ap);
}
/*
* parse_long_options --
* Parse long options in argc/argv argument vector.
* Returns -1 if short_too is set and the option does not match long_options.
*/
static int
parse_long_options(char * const *nargv, const char *options,
const struct option *long_options, int *idx, int short_too, int flags)
{
const char *current_argv, *has_equal;
#ifdef GNU_COMPATIBLE
const char *current_dash;
#endif
size_t current_argv_len;
int i, match, exact_match, second_partial_match;
current_argv = place;
#ifdef GNU_COMPATIBLE
switch (dash_prefix) {
case D_PREFIX:
current_dash = "-";
break;
case DD_PREFIX:
current_dash = "--";
break;
case W_PREFIX:
current_dash = "-W ";
break;
default:
current_dash = "";
break;
}
#endif
match = -1;
exact_match = 0;
second_partial_match = 0;
optind++;
if ((has_equal = strchr(current_argv, '=')) != NULL) {
/* argument found (--option=arg) */
current_argv_len = has_equal - current_argv;
has_equal++;
} else
current_argv_len = strlen(current_argv);
for (i = 0; long_options[i].name; i++) {
/* find matching long option */
if (strncmp(current_argv, long_options[i].name,
current_argv_len))
continue;
if (strlen(long_options[i].name) == current_argv_len) {
/* exact match */
match = i;
exact_match = 1;
break;
}
/*
* If this is a known short option, don't allow
* a partial match of a single character.
*/
if (short_too && current_argv_len == 1)
continue;
if (match == -1) /* first partial match */
match = i;
else if ((flags & FLAG_LONGONLY) ||
long_options[i].has_arg !=
long_options[match].has_arg ||
long_options[i].flag != long_options[match].flag ||
long_options[i].val != long_options[match].val)
second_partial_match = 1;
}
if (!exact_match && second_partial_match) {
/* ambiguous abbreviation */
if (PRINT_ERROR)
warnx(ambig,
#ifdef GNU_COMPATIBLE
current_dash,
#endif
(int)current_argv_len,
current_argv);
optopt = 0;
return (BADCH);
}
if (match != -1) { /* option found */
if (long_options[match].has_arg == no_argument
&& has_equal) {
if (PRINT_ERROR)
warnx(noarg,
#ifdef GNU_COMPATIBLE
current_dash,
#endif
(int)current_argv_len,
current_argv);
/*
* XXX: GNU sets optopt to val regardless of flag
*/
if (long_options[match].flag == NULL)
optopt = long_options[match].val;
else
optopt = 0;
#ifdef GNU_COMPATIBLE
return (BADCH);
#else
return (BADARG);
#endif
}
if (long_options[match].has_arg == required_argument ||
long_options[match].has_arg == optional_argument) {
if (has_equal)
optarg = (char *)has_equal;
else if (long_options[match].has_arg ==
required_argument) {
/*
* optional argument doesn't use next nargv
*/
optarg = nargv[optind++];
}
}
if ((long_options[match].has_arg == required_argument)
&& (optarg == NULL)) {
/*
* Missing argument; leading ':' indicates no error
* should be generated.
*/
if (PRINT_ERROR)
warnx(recargstring,
#ifdef GNU_COMPATIBLE
current_dash,
#endif
current_argv);
/*
* XXX: GNU sets optopt to val regardless of flag
*/
if (long_options[match].flag == NULL)
optopt = long_options[match].val;
else
optopt = 0;
--optind;
return (BADARG);
}
} else { /* unknown option */
if (short_too) {
--optind;
return (-1);
}
if (PRINT_ERROR)
warnx(illoptstring,
#ifdef GNU_COMPATIBLE
current_dash,
#endif
current_argv);
optopt = 0;
return (BADCH);
}
if (idx)
*idx = match;
if (long_options[match].flag) {
*long_options[match].flag = long_options[match].val;
return (0);
} else
return (long_options[match].val);
}
/*
* getopt_internal --
* Parse argc/argv argument vector. Called by user level routines.
*/
static int
getopt_internal(int nargc, char * const *nargv, const char *options,
const struct option *long_options, int *idx, int flags)
{
char *oli; /* option letter list index */
int optchar, short_too;
int posixly_correct; /* no static, can be changed on the fly */
if (options == NULL)
return (-1);
/*
* Disable GNU extensions if POSIXLY_CORRECT is set or options
* string begins with a '+'.
*/
posixly_correct = (getenv("POSIXLY_CORRECT") != NULL);
#ifdef GNU_COMPATIBLE
if (*options == '-')
flags |= FLAG_ALLARGS;
else if (posixly_correct || *options == '+')
flags &= ~FLAG_PERMUTE;
#else
if (posixly_correct || *options == '+')
flags &= ~FLAG_PERMUTE;
else if (*options == '-')
flags |= FLAG_ALLARGS;
#endif
if (*options == '+' || *options == '-')
options++;
/*
* XXX Some GNU programs (like cvs) set optind to 0 instead of
* XXX using optreset. Work around this braindamage.
*/
if (optind == 0)
optind = 1;
optarg = NULL;
start:
if (!*place) { /* update scanning pointer */
if (optind >= nargc) { /* end of argument vector */
place = EMSG;
if (nonopt_end != -1) {
/* do permutation, if we have to */
permute_args(nonopt_start, nonopt_end,
optind, nargv);
optind -= nonopt_end - nonopt_start;
}
else if (nonopt_start != -1) {
/*
* If we skipped non-options, set optind
* to the first of them.
*/
optind = nonopt_start;
}
nonopt_start = nonopt_end = -1;
return (-1);
}
if (*(place = nargv[optind]) != '-' ||
#ifdef GNU_COMPATIBLE
place[1] == '\0') {
#else
(place[1] == '\0' && strchr(options, '-') == NULL)) {
#endif
place = EMSG; /* found non-option */
if (flags & FLAG_ALLARGS) {
/*
* GNU extension:
* return non-option as argument to option 1
*/
optarg = nargv[optind++];
return (INORDER);
}
if (!(flags & FLAG_PERMUTE)) {
/*
* If no permutation wanted, stop parsing
* at first non-option.
*/
return (-1);
}
/* do permutation */
if (nonopt_start == -1)
nonopt_start = optind;
else if (nonopt_end != -1) {
permute_args(nonopt_start, nonopt_end,
optind, nargv);
nonopt_start = optind -
(nonopt_end - nonopt_start);
nonopt_end = -1;
}
optind++;
/* process next argument */
goto start;
}
if (nonopt_start != -1 && nonopt_end == -1)
nonopt_end = optind;
/*
* If we have "-" do nothing, if "--" we are done.
*/
if (place[1] != '\0' && *++place == '-' && place[1] == '\0') {
optind++;
place = EMSG;
/*
* We found an option (--), so if we skipped
* non-options, we have to permute.
*/
if (nonopt_end != -1) {
permute_args(nonopt_start, nonopt_end,
optind, nargv);
optind -= nonopt_end - nonopt_start;
}
nonopt_start = nonopt_end = -1;
return (-1);
}
}
/*
* Check long options if:
* 1) we were passed some
* 2) the arg is not just "-"
* 3) either the arg starts with -- we are getopt_long_only()
*/
if (long_options != NULL && place != nargv[optind] &&
(*place == '-' || (flags & FLAG_LONGONLY))) {
short_too = 0;
#ifdef GNU_COMPATIBLE
dash_prefix = D_PREFIX;
#endif
if (*place == '-') {
place++; /* --foo long option */
#ifdef GNU_COMPATIBLE
dash_prefix = DD_PREFIX;
#endif
} else if (*place != ':' && strchr(options, *place) != NULL)
short_too = 1; /* could be short option too */
optchar = parse_long_options(nargv, options, long_options,
idx, short_too, flags);
if (optchar != -1) {
place = EMSG;
return (optchar);
}
}
if ((optchar = (int)*place++) == (int)':' ||
(optchar == (int)'-' && *place != '\0') ||
(oli = strchr(options, optchar)) == NULL) {
/*
* If the user specified "-" and '-' isn't listed in
* options, return -1 (non-option) as per POSIX.
* Otherwise, it is an unknown option character (or ':').
*/
if (optchar == (int)'-' && *place == '\0')
return (-1);
if (!*place)
++optind;
#ifdef GNU_COMPATIBLE
if (PRINT_ERROR)
warnx(posixly_correct ? illoptchar : gnuoptchar,
optchar);
#else
if (PRINT_ERROR)
warnx(illoptchar, optchar);
#endif
optopt = optchar;
return (BADCH);
}
if (long_options != NULL && optchar == 'W' && oli[1] == ';') {
/* -W long-option */
if (*place) /* no space */
/* NOTHING */;
else if (++optind >= nargc) { /* no arg */
place = EMSG;
if (PRINT_ERROR)
warnx(recargchar, optchar);
optopt = optchar;
return (BADARG);
} else /* white space */
place = nargv[optind];
#ifdef GNU_COMPATIBLE
dash_prefix = W_PREFIX;
#endif
optchar = parse_long_options(nargv, options, long_options,
idx, 0, flags);
place = EMSG;
return (optchar);
}
if (*++oli != ':') { /* doesn't take argument */
if (!*place)
++optind;
} else { /* takes (optional) argument */
optarg = NULL;
if (*place) /* no white space */
optarg = (char *)place;
else if (oli[1] != ':') { /* arg not optional */
if (++optind >= nargc) { /* no arg */
place = EMSG;
if (PRINT_ERROR)
warnx(recargchar, optchar);
optopt = optchar;
return (BADARG);
} else
optarg = nargv[optind];
}
place = EMSG;
++optind;
}
/* dump back option letter */
return (optchar);
}
#ifdef REPLACE_GETOPT
/*
* getopt --
* Parse argc/argv argument vector.
*
* [eventually this will replace the BSD getopt]
*/
int
getopt(int nargc, char * const *nargv, const char *options)
{
/*
* We don't pass FLAG_PERMUTE to getopt_internal() since
* the BSD getopt(3) (unlike GNU) has never done this.
*
* Furthermore, since many privileged programs call getopt()
* before dropping privileges it makes sense to keep things
* as simple (and bug-free) as possible.
*/
return (getopt_internal(nargc, nargv, options, NULL, NULL, 0));
}
#endif /* REPLACE_GETOPT */
/*
* getopt_long --
* Parse argc/argv argument vector.
*/
int
getopt_long(int nargc, char * const *nargv, const char *options,
const struct option *long_options, int *idx)
{
return (getopt_internal(nargc, nargv, options, long_options, idx,
FLAG_PERMUTE));
}
/*
* getopt_long_only --
* Parse argc/argv argument vector.
*/
int
getopt_long_only(int nargc, char * const *nargv, const char *options,
const struct option *long_options, int *idx)
{
return (getopt_internal(nargc, nargv, options, long_options, idx,
FLAG_PERMUTE|FLAG_LONGONLY));
}

View File

@ -36,13 +36,6 @@
* SUCH DAMAGE.
*/
/* $Id: inet_aton.c,v 1.6 2003-11-16 09:36:49 guy Exp $ */
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/missing/inet_aton.c,v 1.6 2003-11-16 09:36:49 guy Exp $";
#endif
#include <tcpdump-stdinc.h>
/* Minimal implementation of inet_aton.

View File

@ -36,17 +36,13 @@
* SUCH DAMAGE.
*/
/* $Id: inet_ntop.c,v 1.8 2005-02-09 02:25:46 guy Exp $ */
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/missing/inet_ntop.c,v 1.8 2005-02-09 02:25:46 guy Exp $";
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include <stdio.h>
#include <errno.h>
/*
*
@ -126,7 +122,9 @@ inet_ntop_v6 (const u_char *src, char *dst, size_t size)
for (i = 0; i < IN6ADDRSZ; i++)
words[i/2] |= (src[i] << ((1 - (i % 2)) << 3));
best.len = 0;
best.base = -1;
cur.len = 0;
cur.base = -1;
for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++)
{
@ -180,7 +178,7 @@ inet_ntop_v6 (const u_char *src, char *dst, size_t size)
tp += strlen(tp);
break;
}
tp += sprintf (tp, "%lX", words[i]);
tp += sprintf (tp, "%lx", words[i]);
}
/* Was it a trailing run of 0x00's?
@ -197,7 +195,6 @@ inet_ntop_v6 (const u_char *src, char *dst, size_t size)
return (NULL);
}
return strcpy (dst, tmp);
return (NULL);
}
#endif /* INET6 */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999 Kungliga Tekniska Högskolan
* Copyright (c) 1999 Kungliga Tekniska H<EFBFBD>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@ -17,7 +17,7 @@
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the Kungliga Tekniska
* Högskolan and its contributors.
* H<EFBFBD>gskolan and its contributors.
*
* 4. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
@ -36,17 +36,8 @@
* SUCH DAMAGE.
*/
/* $Id: inet_pton.c,v 1.6 2003-11-16 09:36:51 guy Exp $ */
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/missing/inet_pton.c,v 1.6 2003-11-16 09:36:51 guy Exp $";
#endif
#include <tcpdump-stdinc.h>
#include <errno.h>
int
inet_pton(int af, const char *src, void *dst)
{

View File

@ -31,17 +31,10 @@
* SUCH DAMAGE.
*/
/* $Id: snprintf.c,v 1.8 2003-11-16 09:36:51 guy Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/missing/snprintf.c,v 1.8 2003-11-16 09:36:51 guy Exp $";
#endif
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>

View File

@ -1,38 +0,0 @@
/*
* Copyright (C) 1999 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.
*/
struct sockaddr_storage {
#ifdef HAVE_SOCKADDR_SA_LEN
u_int8_t ss_len;
u_int8_t ss_family;
u_int8_t fill[126];
#else
u_int8_t ss_family;
u_int8_t fill[127];
#endif /* HAVE_SOCKADDR_SA_LEN */
};

View File

@ -31,11 +31,6 @@
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] =
"@(#) $Header: /tcpdump/master/tcpdump/missing/strdup.c,v 1.1 2001-01-20 07:26:08 guy Exp $ (LBL)";
#endif /* LIBC_SCCS and not lint */
#include <stddef.h>
#include <stdlib.h>
#include <string.h>

View File

@ -28,11 +28,6 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/missing/strlcat.c,v 1.5 2003-11-16 09:36:51 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@ -41,6 +36,8 @@ static const char rcsid[] _U_ =
#include <string.h>
#include "interface.h"
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters

View File

@ -28,11 +28,6 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/missing/strlcpy.c,v 1.5 2003-11-16 09:36:52 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@ -41,6 +36,8 @@ static const char rcsid[] _U_ =
#include <string.h>
#include "interface.h"
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).

View File

@ -31,11 +31,6 @@
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] =
"@(#) $Header: /tcpdump/master/tcpdump/missing/strsep.c,v 1.3 2003-03-25 08:33:48 guy Exp $ (LBL)";
#endif /* LIBC_SCCS and not lint */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

10
mkdep
View File

@ -18,6 +18,7 @@ export PATH
MAKE=Makefile # default makefile name is "Makefile"
CC=cc # default C compiler is "cc"
DEPENDENCY_CFLAG=-M # default dependency-generation flag is -M
while :
do case "$1" in
@ -31,6 +32,11 @@ while :
MAKE=$2
shift; shift ;;
# -m allows you to specify the dependency-generation flag
-m)
DEPENDENCY_CFLAG=$2
shift; shift ;;
# the -p flag produces "program: program.c" style dependencies
# so .o's don't get produced
-p)
@ -42,7 +48,7 @@ while :
done
if [ $# = 0 ] ; then
echo 'usage: mkdep [-p] [-c cc] [-f makefile] [flags] file ...'
echo 'usage: mkdep [-p] [-c cc] [-f makefile] [-m dependency-cflag] [flags] file ...'
exit 1
fi
@ -74,7 +80,7 @@ _EOF_
# sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' -e 's/\.c/.o/' |
# XXX this doesn't work with things like "-DDECLWAITSTATUS=union\ wait"
$CC -M $* |
$CC $DEPENDENCY_CFLAG $* |
sed "
s; \./; ;g
$SED" |

2
mpls.h
View File

@ -1,4 +1,4 @@
/* @(#) $Header: /tcpdump/master/tcpdump/mpls.h,v 1.1 2004-06-14 14:47:58 hannes Exp $ (LBL)
/*
* Copyright (C) 2001 WIDE Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -1,4 +1,3 @@
/* @(#) $Header: /tcpdump/master/tcpdump/nameser.h,v 1.16 2006-11-10 03:18:21 guy Exp $ (LBL) */
/*
* Copyright (c) 1983, 1989, 1993
* The Regents of the University of California. All rights reserved.
@ -225,13 +224,13 @@
* Structure for query header.
*/
typedef struct {
u_int16_t id; /* query identification number */
u_int8_t flags1; /* first byte of flags */
u_int8_t flags2; /* second byte of flags */
u_int16_t qdcount; /* number of question entries */
u_int16_t ancount; /* number of answer entries */
u_int16_t nscount; /* number of authority entries */
u_int16_t arcount; /* number of resource entries */
uint16_t id; /* query identification number */
uint8_t flags1; /* first byte of flags */
uint8_t flags2; /* second byte of flags */
uint16_t qdcount; /* number of question entries */
uint16_t ancount; /* number of answer entries */
uint16_t nscount; /* number of authority entries */
uint16_t arcount; /* number of resource entries */
} HEADER;
/*
@ -262,36 +261,36 @@ struct rrec {
int16_t r_zone; /* zone number */
int16_t r_class; /* class number */
int16_t r_type; /* type number */
u_int32_t r_ttl; /* time to live */
uint32_t r_ttl; /* time to live */
int r_size; /* size of data area */
char *r_data; /* pointer to data */
};
/*
* Inline versions of get/put short/long. Pointer is advanced.
* We also assume that a "u_int16_t" holds 2 "chars"
* and that a "u_int32_t" holds 4 "chars".
* We also assume that a "uint16_t" holds 2 "chars"
* and that a "uint32_t" holds 4 "chars".
*
* These macros demonstrate the property of C whereby it can be
* portable or it can be elegant but never both.
*/
#define GETSHORT(s, cp) { \
register u_char *t_cp = (u_char *)(cp); \
(s) = ((u_int16_t)t_cp[0] << 8) | (u_int16_t)t_cp[1]; \
(s) = ((uint16_t)t_cp[0] << 8) | (uint16_t)t_cp[1]; \
(cp) += 2; \
}
#define GETLONG(l, cp) { \
register u_char *t_cp = (u_char *)(cp); \
(l) = (((u_int32_t)t_cp[0]) << 24) \
| (((u_int32_t)t_cp[1]) << 16) \
| (((u_int32_t)t_cp[2]) << 8) \
| (((u_int32_t)t_cp[3])); \
(l) = (((uint32_t)t_cp[0]) << 24) \
| (((uint32_t)t_cp[1]) << 16) \
| (((uint32_t)t_cp[2]) << 8) \
| (((uint32_t)t_cp[3])); \
(cp) += 4; \
}
#define PUTSHORT(s, cp) { \
register u_int16_t t_s = (u_int16_t)(s); \
register uint16_t t_s = (uint16_t)(s); \
register u_char *t_cp = (u_char *)(cp); \
*t_cp++ = t_s >> 8; \
*t_cp = t_s; \
@ -303,7 +302,7 @@ struct rrec {
* were depending on this "feature", you will lose.
*/
#define PUTLONG(l, cp) { \
register u_int32_t t_l = (u_int32_t)(l); \
register uint32_t t_l = (uint32_t)(l); \
register u_char *t_cp = (u_char *)(cp); \
*t_cp++ = t_l >> 24; \
*t_cp++ = t_l >> 16; \

View File

@ -1,16 +0,0 @@
/*
* NETBIOS protocol formats
*
* @(#) $Header: /tcpdump/master/tcpdump/netbios.h,v 1.3 2002-12-11 07:13:55 guy Exp $
*/
struct p8022Hdr {
u_char dsap;
u_char ssap;
u_char flags;
};
#define p8022Size 3 /* min 802.2 header size */
#define UI 0x03 /* 802.2 flags */

View File

@ -20,8 +20,6 @@
* 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/netdissect.h,v 1.27 2008-08-16 11:36:20 hannes Exp $ (LBL)
*/
#ifndef netdissect_h
@ -40,15 +38,23 @@
#include <stdarg.h>
#include "ip.h" /* struct ip for nextproto4_cksum() */
#if !defined(HAVE_SNPRINTF)
int snprintf (char *str, size_t sz, const char *format, ...)
__attribute__ ((format (printf, 3, 4)));
#endif
#ifdef __ATTRIBUTE___FORMAT_OK
__attribute__((format (printf, 3, 4)))
#endif /* __ATTRIBUTE___FORMAT_OK */
;
#endif /* !defined(HAVE_SNPRINTF) */
#if !defined(HAVE_VSNPRINTF)
int vsnprintf (char *str, size_t sz, const char *format, va_list ap)
__attribute__((format (printf, 3, 0)));
#endif
#ifdef __ATTRIBUTE___FORMAT_OK
__attribute__((format (printf, 3, 0)))
#endif /* __ATTRIBUTE___FORMAT_OK */
;
#endif /* !defined(HAVE_SNPRINTF) */
#ifndef HAVE_STRLCAT
extern size_t strlcat (char *, const char *, size_t);
@ -66,12 +72,12 @@ extern char *strsep(char **, const char *);
#endif
struct tok {
int v; /* value */
u_int v; /* value */
const char *s; /* string */
};
#define TOKBUFSIZE 128
extern const char *tok2strbuf(const struct tok *, const char *, int,
extern const char *tok2strbuf(const struct tok *, const char *, u_int,
char *buf, size_t bufsize);
/* tok2str is deprecated */
@ -118,7 +124,9 @@ struct netdissect_options {
int ndo_Wflag; /* recycle output files after this number of files */
int ndo_WflagChars;
int ndo_Hflag; /* dissect 802.11s draft mesh standard */
int ndo_packet_number; /* print a packet number in the beginning of line */
int ndo_suppress_default_print; /* don't use default_print() for unknown packet types */
int ndo_tstamp_precision; /* requested time stamp precision */
const char *ndo_dltname;
char *ndo_espsecret;
@ -158,9 +166,12 @@ struct netdissect_options {
;
void (*ndo_error)(netdissect_options *,
const char *fmt, ...)
#ifdef __ATTRIBUTE___NORETURN_OK_FOR_FUNCTION_POINTERS
__attribute__ ((noreturn))
#endif /* __ATTRIBUTE___NORETURN_OK_FOR_FUNCTION_POINTERS */
#ifdef __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS
__attribute__ ((noreturn, format (printf, 2, 3)))
#endif
__attribute__ ((format (printf, 2, 3)))
#endif /* __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS */
;
void (*ndo_warning)(netdissect_options *,
const char *fmt, ...)
@ -183,6 +194,9 @@ struct netdissect_options {
#define PT_RADIUS 11 /* RADIUS authentication Protocol */
#define PT_ZMTP1 12 /* ZeroMQ Message Transport Protocol 1.0 */
#define PT_VXLAN 13 /* Virtual eXtensible Local Area Network */
#define PT_PGM 14 /* [UDP-encapsulated] Pragmatic General Multicast */
#define PT_PGM_ZMTP1 15 /* ZMTP/1.0 inside PGM (native or UDP-encapsulated) */
#define PT_LMP 16 /* Link Management Protocol */
#ifndef min
#define min(a,b) ((a)>(b)?(b):(a))
@ -195,12 +209,26 @@ struct netdissect_options {
* Maximum snapshot length. This should be enough to capture the full
* packet on most network interfaces.
*
* XXX - could it be larger? If so, should it? Some applications might
* use the snapshot length in a savefile header to control the size of
* the buffer they allocate, so a size of, say, 2^31-1 might not work
* well.
*
* Somewhat arbitrary, but chosen to be:
*
* 1) big enough for maximum-size Linux loopback packets (65549)
* and some USB packets captured with USBPcap:
*
* http://desowin.org/usbpcap/
*
* (> 131072, < 262144)
*
* and
*
* 2) small enough not to cause attempts to allocate huge amounts of
* memory; some applications might use the snapshot length in a
* savefile header to control the size of the buffer they allocate,
* so a size of, say, 2^31-1 might not work well.
*
* XXX - does it need to be bigger still?
*/
#define MAXIMUM_SNAPLEN 65535
#define MAXIMUM_SNAPLEN 262144
/*
* The default snapshot length is the maximum.
@ -240,32 +268,62 @@ struct netdissect_options {
#define ND_PRINT(STUFF) (*ndo->ndo_printf)STUFF
#define ND_DEFAULTPRINT(ap, length) (*ndo->ndo_default_print)(ndo, ap, length)
#if 0
extern void ts_print(netdissect_options *ipdo,
const struct timeval *);
extern void relts_print(int);
#endif
extern void ts_print(netdissect_options *, const struct timeval *);
extern void relts_print(netdissect_options *, int);
extern int fn_print(const u_char *, const u_char *);
extern int fn_printn(const u_char *, u_int, const u_char *);
extern int fn_print(netdissect_options *, const u_char *, const u_char *);
extern int fn_printn(netdissect_options *, const u_char *, u_int, const u_char *);
extern int fn_printzp(netdissect_options *, const u_char *, u_int, const u_char *);
extern const char *tok2str(const struct tok *, const char *, int);
extern void wrapup(int);
#if 0
extern char *read_infile(netdissect_options *, char *);
extern char *copy_argv(netdissect_options *, char **);
#endif
extern void safeputchar(int);
extern void safeputs(const char *, int);
/*
* Locale-independent macros for testing character properties and
* stripping the 8th bit from characters. Assumed to be handed
* a value between 0 and 255, i.e. don't hand them a char, as
* those might be in the range -128 to 127.
*/
#define ND_ISASCII(c) (!((c) & 0x80)) /* value is an ASCII code point */
#define ND_ISPRINT(c) ((c) >= 0x20 && (c) <= 0x7E)
#define ND_ISGRAPH(c) ((c) > 0x20 && (c) <= 0x7E)
#define ND_TOASCII(c) ((c) & 0x7F)
extern void safeputchar(netdissect_options *, const u_char);
extern void safeputs(netdissect_options *, const u_char *, const u_int);
#ifdef LBL_ALIGN
/*
* The processor doesn't natively handle unaligned loads,
* and the compiler might "helpfully" optimize memcpy()
* and memcmp(), when handed pointers that would normally
* be properly aligned, into sequences that assume proper
* alignment.
*
* Do copies and compares of possibly-unaligned data by
* calling routines that wrap memcpy() and memcmp(), to
* prevent that optimization.
*/
extern void unaligned_memcpy(void *, const void *, size_t);
extern int unaligned_memcmp(const void *, const void *, size_t);
#define UNALIGNED_MEMCPY(p, q, l) unaligned_memcpy((p), (q), (l))
#define UNALIGNED_MEMCMP(p, q, l) unaligned_memcmp((p), (q), (l))
#else
/*
* The procesor natively handles unaligned loads, so just use memcpy()
* and memcmp(), to enable those optimizations.
*/
#define UNALIGNED_MEMCPY(p, q, l) memcpy((p), (q), (l))
#define UNALIGNED_MEMCMP(p, q, l) memcmp((p), (q), (l))
#endif
#define PLURAL_SUFFIX(n) \
(((n) != 1) ? "s" : "")
#if 0
extern const char *isonsap_string(netdissect_options *, const u_char *);
extern const char *protoid_string(netdissect_options *, const u_char *);
extern const char *dnname_string(netdissect_options *, u_short);
extern const char *dnnum_string(netdissect_options *, u_short);
#endif
@ -283,11 +341,11 @@ extern if_printer lookup_printer(int);
extern void eap_print(netdissect_options *,const u_char *, u_int);
extern int esp_print(netdissect_options *,
register const u_char *bp, int len, register const u_char *bp2,
const u_char *bp, const int length, const u_char *bp2,
int *nhdr, int *padlen);
extern void arp_print(netdissect_options *,const u_char *, u_int, u_int);
extern void tipc_print(netdissect_options *, const u_char *, u_int, u_int);
extern void msnlb_print(netdissect_options *, const u_char *, u_int);
extern void msnlb_print(netdissect_options *, const u_char *);
extern void icmp6_print(netdissect_options *ndo, const u_char *,
u_int, const u_char *, int);
extern void isakmp_print(netdissect_options *,const u_char *,
@ -299,6 +357,8 @@ extern void ip_print_inner(netdissect_options *ndo,
const u_char *bp, u_int length, u_int nh,
const u_char *bp2);
extern void rrcp_print(netdissect_options *,const u_char *, u_int);
extern void loopback_print(netdissect_options *, const u_char *, const u_int);
extern void carp_print(netdissect_options *, const u_char *, u_int, int);
extern void ether_print(netdissect_options *,
const u_char *, u_int, u_int,
@ -316,193 +376,214 @@ extern u_int netanalyzer_transparent_if_print(netdissect_options *,
extern int ethertype_print(netdissect_options *,u_short, const u_char *,
u_int, u_int);
extern int print_unknown_data(netdissect_options *,const u_char *, const char *,int);
extern void ascii_print(netdissect_options *, const u_char *, u_int);
extern void hex_print_with_offset(netdissect_options *, const char *ident, const u_char *cp,
u_int, u_int);
extern void hex_print(netdissect_options *,const char *ident, const u_char *cp,u_int);
extern void hex_and_ascii_print_with_offset(netdissect_options *, const char *, const u_char *, u_int, u_int);
extern void hex_and_ascii_print(netdissect_options *, const char *, const u_char *, u_int);
extern int ah_print(netdissect_options *, register const u_char *);
extern void beep_print(netdissect_options *, const u_char *, u_int);
extern void dtp_print(netdissect_options *, const u_char *, u_int);
extern u_int cip_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern int ipcomp_print(netdissect_options *, register const u_char *, int *);
extern u_int ipfc_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void udld_print(netdissect_options *, const u_char *, u_int);
extern void hsrp_print(netdissect_options *, const u_char *, u_int);
extern void igrp_print(netdissect_options *, const u_char *, u_int);
extern void msdp_print(netdissect_options *, const u_char *, u_int);
extern u_int null_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void mobile_print(netdissect_options *, const u_char *, u_int);
extern u_int ap1394_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int bt_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void lane_print(netdissect_options *, const u_char *, u_int, u_int);
extern u_int lane_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void otv_print(netdissect_options *, const u_char *, u_int);
extern void ahcp_print(netdissect_options *, const u_char *, const u_int);
extern void vxlan_print(netdissect_options *, const u_char *, u_int);
extern u_int arcnet_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int arcnet_linux_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void bfd_print(netdissect_options *, const u_char *, u_int, u_int);
extern void gre_print(netdissect_options *, const u_char *, u_int);
extern int vjc_print(netdissect_options *, register const char *, u_short);
extern void ipN_print(netdissect_options *, const u_char *, u_int);
extern u_int raw_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int usb_linux_48_byte_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int usb_linux_64_byte_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int symantec_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int chdlc_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int chdlc_print(netdissect_options *, register const u_char *, u_int);
extern void zmtp1_print(netdissect_options *, const u_char *, u_int);
extern void zmtp1_print_datagram(netdissect_options *, const u_char *, const u_int);
extern void ipx_print(netdissect_options *, const u_char *, u_int);
extern void mpls_print(netdissect_options *, const u_char *, u_int);
extern u_int pppoe_print(netdissect_options *, const u_char *, u_int);
extern u_int pppoe_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void sunrpcrequest_print(netdissect_options *, const u_char *, u_int, const u_char *);
extern u_int pflog_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int token_print(netdissect_options *, const u_char *, u_int, u_int);
extern u_int token_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void vqp_print(netdissect_options *, register const u_char *, register u_int);
extern void zephyr_print(netdissect_options *, const u_char *, int);
extern void fddi_print(netdissect_options *, const u_char *, u_int, u_int);
extern u_int fddi_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void mpcp_print(netdissect_options *, const u_char *, u_int);
extern void rpki_rtr_print(netdissect_options *, const u_char *, u_int);
extern u_int sll_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void dccp_print(netdissect_options *, const u_char *, const u_char *, u_int);
extern int llc_print(netdissect_options *, const u_char *, u_int, u_int, const u_char *, const u_char *, u_short *);
extern int snap_print(netdissect_options *, const u_char *, u_int, u_int, u_int);
extern void eigrp_print(netdissect_options *, const u_char *, u_int);
extern void stp_print(netdissect_options *, const u_char *, u_int);
extern void l2tp_print(netdissect_options *, const u_char *, u_int);
extern void udp_print(netdissect_options *, const u_char *, u_int, const u_char *, int);
extern void icmp_print(netdissect_options *, const u_char *, u_int, const u_char *, int);
extern void openflow_print(netdissect_options *, const u_char *, const u_int);
extern void telnet_print(netdissect_options *, const u_char *, u_int);
extern void slow_print(netdissect_options *, const u_char *, u_int);
extern void radius_print(netdissect_options *, const u_char *, u_int);
extern void lmp_print(netdissect_options *, const u_char *, u_int);
extern u_int fr_print(netdissect_options *, register const u_char *, u_int);
extern u_int mfr_print(netdissect_options *, register const u_char *, u_int);
extern u_int fr_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int mfr_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void q933_print(netdissect_options *, const u_char *, u_int);
extern void igmp_print(netdissect_options *, const u_char *, u_int);
extern void rip_print(netdissect_options *, const u_char *, u_int);
extern void lwapp_control_print(netdissect_options *, const u_char *, u_int, int);
extern void lwapp_data_print(netdissect_options *, const u_char *, u_int);
extern void pgm_print(netdissect_options *, const u_char *, u_int, const u_char *);
extern void pptp_print(netdissect_options *, const u_char *);
extern void ldp_print(netdissect_options *, const u_char *, u_int);
extern void wb_print(netdissect_options *, const void *, u_int);
extern int oam_print(netdissect_options *, const u_char *, u_int, u_int);
extern void atm_print(netdissect_options *, u_int, u_int, u_int, const u_char *, u_int, u_int);
extern u_int sunatm_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int atm_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void vtp_print(netdissect_options *, const u_char *, u_int);
extern int mptcp_print(netdissect_options *, const u_char *, u_int, u_char);
extern void ntp_print(netdissect_options *, const u_char *, u_int);
extern void cnfp_print(netdissect_options *, const u_char *, const u_char *);
extern void dvmrp_print(netdissect_options *, const u_char *, u_int);
extern void egp_print(netdissect_options *, const u_char *, u_int);
extern u_int enc_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int sl_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int sl_bsdos_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void tftp_print(netdissect_options *, const u_char *, u_int);
extern void vrrp_print(netdissect_options *, const u_char *, u_int, const u_char *, int);
extern void pimv1_print(netdissect_options *, const u_char *, u_int);
extern void cisco_autorp_print(netdissect_options *, const u_char *, u_int);
extern void pim_print(netdissect_options *, const u_char *, u_int, u_int);
extern const u_char * ns_nprint (netdissect_options *, register const u_char *, register const u_char *);
extern void ns_print(netdissect_options *, const u_char *, u_int, int);
extern void bootp_print(netdissect_options *, const u_char *, u_int);
extern void sflow_print(netdissect_options *, const u_char *, u_int);
extern void aodv_print(netdissect_options *, const u_char *, u_int, int);
extern void sctp_print(netdissect_options *, const u_char *, const u_char *, u_int);
extern char *bgp_vpn_rd_print (netdissect_options *, const u_char *);
extern void bgp_print(netdissect_options *, const u_char *, int);
extern void olsr_print(netdissect_options *, const u_char *, u_int, int);
extern void forces_print(netdissect_options *, const u_char *, u_int);
extern void lspping_print(netdissect_options *, const u_char *, u_int);
extern void isoclns_print(netdissect_options *, const u_char *, u_int, u_int);
extern void krb_print(netdissect_options *, const u_char *);
extern void cdp_print(netdissect_options *, const u_char *, u_int, u_int);
extern void atalk_print(netdissect_options *, const u_char *, u_int);
extern u_int ltalk_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int llap_print(netdissect_options *, const u_char *, u_int);
extern void aarp_print(netdissect_options *, const u_char *, u_int);
extern u_int juniper_atm1_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_atm2_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_mfr_print(netdissect_options *, const struct pcap_pkthdr *, register const u_char *);
extern u_int juniper_mlfr_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_mlppp_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_pppoe_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_pppoe_atm_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_ggsn_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_es_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_monitor_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_services_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_ether_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_ppp_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_frelay_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int juniper_chdlc_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void snmp_print(netdissect_options *, const u_char *, u_int);
extern void rx_print(netdissect_options *, register const u_char *, int, int, int, u_char *);
extern void nfsreply_print(netdissect_options *, const u_char *, u_int, const u_char *);
extern void nfsreply_print_noaddr(netdissect_options *, const u_char *, u_int, const u_char *);
extern void nfsreq_print_noaddr(netdissect_options *, const u_char *, u_int, const u_char *);
extern void sip_print(netdissect_options *, const u_char *, u_int);
extern void syslog_print(netdissect_options *, const u_char *, u_int);
extern void lwres_print(netdissect_options *, const u_char *, u_int);
extern void cfm_print(netdissect_options *, const u_char *, u_int);
extern void nbt_tcp_print(netdissect_options *, const u_char *, int);
extern void nbt_udp137_print(netdissect_options *, const u_char *, int);
extern void nbt_udp138_print(netdissect_options *, const u_char *, int);
extern void smb_tcp_print(netdissect_options *, const u_char *, int);
extern void netbeui_print(netdissect_options *, u_short, const u_char *, int);
extern void ipx_netbios_print(netdissect_options *, const u_char *, u_int);
extern void print_data(netdissect_options *, const unsigned char *, int);
extern void decnet_print(netdissect_options *, const u_char *, u_int, u_int);
extern void tcp_print(netdissect_options *, const u_char *, u_int, const u_char *, int);
extern void ospf_print(netdissect_options *, const u_char *, u_int, const u_char *);
extern int ospf_print_te_lsa(netdissect_options *, const uint8_t *, u_int);
extern int ospf_print_grace_lsa(netdissect_options *, const uint8_t *, u_int);
extern u_int ppp_print(netdissect_options *, register const u_char *, u_int);
extern u_int ppp_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int ppp_hdlc_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int ppp_bsdos_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern void lldp_print(netdissect_options *, const u_char *, u_int);
extern void rsvp_print(netdissect_options *, const u_char *, u_int);
extern void timed_print(netdissect_options *, const u_char *);
extern void m3ua_print(netdissect_options *, const u_char *, const u_int);
extern void aoe_print(netdissect_options *, const u_char *, const u_int);
/* stuff that has not yet been rototiled */
#if 0
extern void ascii_print(netdissect_options *,u_int);
extern void hex_and_ascii_print_with_offset(netdissect_options *,const char *,
u_int, u_int);
extern void hex_and_ascii_print(netdissect_options *,const char *, u_int);
extern void hex_print_with_offset(netdissect_options *,const char *,
u_int, u_int);
extern void hex_print(netdissect_options *,const char *, u_int);
extern void telnet_print(netdissect_options *,const u_char *, u_int);
extern int llc_print(netdissect_options *,
const u_char *, u_int, u_int, const u_char *,
const u_char *, u_short *);
extern void aarp_print(netdissect_options *,const u_char *, u_int);
extern void atalk_print(netdissect_options *,const u_char *, u_int);
extern void atm_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
extern void bootp_print(netdissect_options *,const u_char *,
u_int, u_short, u_short);
extern void bgp_print(netdissect_options *,const u_char *, int);
extern void bxxp_print(netdissect_options *,const u_char *, u_int);
extern void chdlc_if_print(u_char *user, const struct pcap_pkthdr *h,
register const u_char *p);
extern void chdlc_print(netdissect_options *ndo,
register const u_char *p, u_int length, u_int caplen);
extern void cisco_autorp_print(netdissect_options *,
const u_char *, u_int);
extern void cnfp_print(netdissect_options *,const u_char *cp,
u_int len, const u_char *bp);
extern void decnet_print(netdissect_options *,const u_char *,
u_int, u_int);
extern void default_print(netdissect_options *,const u_char *, u_int);
extern void dvmrp_print(netdissect_options *,const u_char *, u_int);
extern void egp_print(netdissect_options *,const u_char *, u_int,
const u_char *);
extern void arcnet_if_print(u_char*,const struct pcap_pkthdr *,const u_char *);
extern void token_if_print(u_char *,const struct pcap_pkthdr *,const u_char *);
extern void fddi_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
extern void gre_print(netdissect_options *,const u_char *, u_int);
extern void icmp_print(netdissect_options *,const u_char *, u_int,
const u_char *);
extern void hsrp_print(netdissect_options *ndo,
register const u_char *bp, register u_int len);
extern void ieee802_11_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
extern void igmp_print(netdissect_options *,
register const u_char *, u_int);
extern void igrp_print(netdissect_options *,const u_char *, u_int,
const u_char *);
extern int nextproto4_cksum(const struct ip *, const u_int8_t *, u_int, u_int);
extern void ipN_print(netdissect_options *,const u_char *, u_int);
extern void ipx_print(netdissect_options *,const u_char *, u_int);
extern void isoclns_print(netdissect_options *,const u_char *,
u_int, u_int, const u_char *, const u_char *);
extern void krb_print(netdissect_options *,const u_char *, u_int);
extern void llap_print(netdissect_options *,const u_char *, u_int);
extern const char *linkaddr_string(netdissect_options *ndo,
const u_char *ep, const unsigned int len);
extern void ltalk_if_print(netdissect_options *ndo,
u_char *user, const struct pcap_pkthdr *h,
const u_char *p);
extern void mpls_print(netdissect_options *ndo,
const u_char *bp, u_int length);
extern void msdp_print(netdissect_options *ndo,
const unsigned char *sp, u_int length);
extern void nfsreply_print(netdissect_options *,const u_char *,
u_int, const u_char *);
extern void nfsreq_print(netdissect_options *,const u_char *,
u_int, const u_char *);
extern void ns_print(netdissect_options *,const u_char *, u_int);
extern void ntp_print(netdissect_options *,const u_char *, u_int);
extern void null_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
extern void ospf_print(netdissect_options *,const u_char *,
u_int, const u_char *);
extern void pimv1_print(netdissect_options *,const u_char *, u_int);
extern void mobile_print(netdissect_options *,const u_char *, u_int);
extern void pim_print(netdissect_options *,const u_char *, u_int, u_int);
extern void pppoe_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
extern void pppoe_print(netdissect_options *,const u_char *, u_int);
extern void ppp_print(netdissect_options *,
register const u_char *, u_int);
extern void ppp_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
extern void ppp_hdlc_if_print(u_char *,
const struct pcap_pkthdr *, const u_char *);
extern void ppp_bsdos_if_print(u_char *,
const struct pcap_pkthdr *, const u_char *);
extern int vjc_print(netdissect_options *,register const char *,
register u_int, u_short);
extern void raw_if_print(u_char *,
const struct pcap_pkthdr *, const u_char *);
extern void rip_print(netdissect_options *,const u_char *, u_int);
extern void rpki_rtr_print(netdissect_options *,const u_char *, u_int);
extern void sctp_print(netdissect_options *ndo,
const u_char *bp, const u_char *bp2,
u_int sctpPacketLength);
extern void sl_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
extern void lane_if_print(u_char *,const struct pcap_pkthdr *,const u_char *);
extern void cip_if_print(u_char *,const struct pcap_pkthdr *,const u_char *);
extern void sl_bsdos_if_print(u_char *,
const struct pcap_pkthdr *, const u_char *);
extern void sll_if_print(u_char *,
const struct pcap_pkthdr *, const u_char *);
extern void snmp_print(netdissect_options *,const u_char *, u_int);
extern void sunrpcrequest_print(netdissect_options *,const u_char *,
u_int, const u_char *);
extern void tcp_print(netdissect_options *,const u_char *, u_int,
const u_char *, int);
extern void tftp_print(netdissect_options *,const u_char *, u_int);
extern void timed_print(netdissect_options *,const u_char *, u_int);
extern void udp_print(netdissect_options *,const u_char *, u_int,
const u_char *, int);
extern void wb_print(netdissect_options *,const void *, u_int);
extern int ah_print(netdissect_options *,register const u_char *,
register const u_char *);
extern void esp_print_decodesecret(netdissect_options *ndo);
extern int ipcomp_print(netdissect_options *,register const u_char *,
register const u_char *, int *);
extern void rx_print(netdissect_options *,register const u_char *,
int, int, int, u_char *);
extern void netbeui_print(netdissect_options *,u_short,
const u_char *, int);
extern void ipx_netbios_print(netdissect_options *,const u_char *, u_int);
extern void nbt_tcp_print(netdissect_options *,const u_char *, int);
extern void nbt_udp137_print(netdissect_options *,
const u_char *data, int);
extern void nbt_udp138_print(netdissect_options *,
const u_char *data, int);
extern char *smb_errstr(netdissect_options *,int, int);
extern const char *nt_errstr(netdissect_options *, u_int32_t);
extern void print_data(netdissect_options *,const unsigned char *, int);
extern void l2tp_print(netdissect_options *,const u_char *, u_int);
extern void lcp_print(netdissect_options *,const u_char *, u_int);
extern void vrrp_print(netdissect_options *,const u_char *bp,
u_int len, int ttl);
extern void carp_print(netdissect_options *,const u_char *bp,
u_int len, int ttl);
extern void cdp_print(netdissect_options *,const u_char *,
u_int, u_int, const u_char *, const u_char *);
extern void stp_print(netdissect_options *,const u_char *p, u_int length);
extern void radius_print(netdissect_options *,const u_char *, u_int);
extern void lwres_print(netdissect_options *,const u_char *, u_int);
extern void pptp_print(netdissect_options *,const u_char *, u_int);
extern const char *nt_errstr(netdissect_options *, uint32_t);
#endif
extern u_int ipnet_if_print(netdissect_options *,const struct pcap_pkthdr *, const u_char *);
extern u_int ppi_if_print(netdissect_options *,const struct pcap_pkthdr *, const u_char *);
extern u_int nflog_if_print(netdissect_options *,const struct pcap_pkthdr *, const u_char *);
extern u_int ieee802_15_4_if_print(netdissect_options *,const struct pcap_pkthdr *, const u_char *);
extern u_int pktap_if_print(netdissect_options *,const struct pcap_pkthdr *, const u_char *);
extern u_int ieee802_11_radio_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int ieee802_11_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int ieee802_11_radio_avs_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
extern u_int prism_if_print(netdissect_options *, const struct pcap_pkthdr *, const u_char *);
#ifdef INET6
extern void ip6_print(netdissect_options *,const u_char *, u_int);
#if 0
extern void ip6_opt_print(netdissect_options *,const u_char *, int);
extern int nextproto6_cksum(const struct ip6_hdr *, const u_int8_t *, u_int, u_int);
extern int hbhopt_print(netdissect_options *,const u_char *);
extern int dstopt_print(netdissect_options *,const u_char *);
extern int frag6_print(netdissect_options *,const u_char *,
const u_char *);
extern void icmp6_print(netdissect_options *,const u_char *,
const u_char *);
extern void ripng_print(netdissect_options *,const u_char *, int);
extern int rt6_print(netdissect_options *,const u_char *, const u_char *);
extern void ospf6_print(netdissect_options *,const u_char *, u_int);
extern void dhcp6_print(netdissect_options *,const u_char *,
u_int, u_int16_t, u_int16_t);
extern void zephyr_print(netdissect_options * ndo,
const u_char *cp, int length);
#endif /* 0 */
extern int frag6_print(netdissect_options *, const u_char *, const u_char *);
extern int rt6_print(netdissect_options *, const u_char *, const u_char *);
extern int hbhopt_print(netdissect_options *, const u_char *);
extern int dstopt_print(netdissect_options *, const u_char *);
extern void ripng_print(netdissect_options *, const u_char *, unsigned int);
extern int mobility_print(netdissect_options *, const u_char *, const u_char *);
extern void dhcp6_print(netdissect_options *, const u_char *, u_int);
extern void ospf6_print(netdissect_options *, const u_char *, u_int);
extern void babel_print(netdissect_options *, const u_char *, u_int);
#endif /*INET6*/
#if 0
struct cksum_vec {
const u_int8_t *ptr;
const uint8_t *ptr;
int len;
};
extern u_int16_t in_cksum(const struct cksum_vec *, int);
extern u_int16_t in_cksum_shouldbe(u_int16_t, u_int16_t);
extern uint16_t in_cksum(const struct cksum_vec *, int);
extern uint16_t in_cksum_shouldbe(uint16_t, uint16_t);
#endif
extern int nextproto4_cksum(netdissect_options *ndo, const struct ip *, const uint8_t *, u_int, u_int, u_int);
extern int decode_prefix4(netdissect_options *ndo, const u_char *, u_int, char *, u_int);
#ifdef INET6
extern int decode_prefix6(netdissect_options *ndo, const u_char *, u_int, char *, u_int);
#endif
extern void esp_print_decodesecret(netdissect_options *ndo);
@ -512,4 +593,7 @@ extern int esp_print_decrypt_buffer_by_ikev2(netdissect_options *ndo,
u_char *buf, u_char *end);
extern void geonet_print(netdissect_options *ndo,const u_char *eth_hdr,const u_char *geo_pck, u_int len);
extern void calm_fast_print(netdissect_options *ndo,const u_char *eth_hdr,const u_char *calm_pck, u_int len);
#endif /* netdissect_h */

111
nfs.h
View File

@ -1,4 +1,3 @@
/* @(#) $Header: /tcpdump/master/tcpdump/nfs.h,v 1.9 2007-11-18 03:24:38 guy Exp $ (LBL) */
/* NetBSD: nfs.h,v 1.1 1996/05/23 22:49:53 fvdl Exp */
/*
@ -239,11 +238,11 @@
txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \
MAKEIMODE((t), (m)))
#define vtonfsv3_mode(m) txdr_unsigned((m) & 07777)
#define nfstov_mode(a) (fxdr_unsigned(u_int16_t, (a))&07777)
#define nfstov_mode(a) (fxdr_unsigned(uint16_t, (a))&07777)
#define vtonfsv2_type(a) txdr_unsigned(nfsv2_type[((int32_t)(a))])
#define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((int32_t)(a))])
#define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(u_int32_t,(a))&0x7]
#define nfsv3tov_type(a) nv3tov_type[fxdr_unsigned(u_int32_t,(a))&0x7]
#define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(uint32_t,(a))&0x7]
#define nfsv3tov_type(a) nv3tov_type[fxdr_unsigned(uint32_t,(a))&0x7]
/* File types */
typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5,
@ -267,14 +266,14 @@ union nfsfh {
typedef union nfsfh nfsfh_t;
struct nfsv2_time {
u_int32_t nfsv2_sec;
u_int32_t nfsv2_usec;
uint32_t nfsv2_sec;
uint32_t nfsv2_usec;
};
typedef struct nfsv2_time nfstime2;
struct nfsv3_time {
u_int32_t nfsv3_sec;
u_int32_t nfsv3_nsec;
uint32_t nfsv3_sec;
uint32_t nfsv3_nsec;
};
typedef struct nfsv3_time nfstime3;
@ -283,7 +282,7 @@ typedef struct nfsv3_time nfstime3;
* protocol and to facilitate xdr conversion.
*/
struct nfs_uquad {
u_int32_t nfsuquad[2];
uint32_t nfsuquad[2];
};
typedef struct nfs_uquad nfsuint64;
@ -291,8 +290,8 @@ typedef struct nfs_uquad nfsuint64;
* NFS Version 3 special file number.
*/
struct nfsv3_spec {
u_int32_t specdata1;
u_int32_t specdata2;
uint32_t specdata1;
uint32_t specdata2;
};
typedef struct nfsv3_spec nfsv3spec;
@ -306,19 +305,19 @@ typedef struct nfsv3_spec nfsv3spec;
* NFSX_FATTR(v3) macro.
*/
struct nfs_fattr {
u_int32_t fa_type;
u_int32_t fa_mode;
u_int32_t fa_nlink;
u_int32_t fa_uid;
u_int32_t fa_gid;
uint32_t fa_type;
uint32_t fa_mode;
uint32_t fa_nlink;
uint32_t fa_uid;
uint32_t fa_gid;
union {
struct {
u_int32_t nfsv2fa_size;
u_int32_t nfsv2fa_blocksize;
u_int32_t nfsv2fa_rdev;
u_int32_t nfsv2fa_blocks;
u_int32_t nfsv2fa_fsid;
u_int32_t nfsv2fa_fileid;
uint32_t nfsv2fa_size;
uint32_t nfsv2fa_blocksize;
uint32_t nfsv2fa_rdev;
uint32_t nfsv2fa_blocks;
uint32_t nfsv2fa_fsid;
uint32_t nfsv2fa_fileid;
nfstime2 nfsv2fa_atime;
nfstime2 nfsv2fa_mtime;
nfstime2 nfsv2fa_ctime;
@ -356,10 +355,10 @@ struct nfs_fattr {
#define fa3_ctime fa_un.fa_nfsv3.nfsv3fa_ctime
struct nfsv2_sattr {
u_int32_t sa_mode;
u_int32_t sa_uid;
u_int32_t sa_gid;
u_int32_t sa_size;
uint32_t sa_mode;
uint32_t sa_uid;
uint32_t sa_gid;
uint32_t sa_size;
nfstime2 sa_atime;
nfstime2 sa_mtime;
};
@ -368,28 +367,28 @@ struct nfsv2_sattr {
* NFS Version 3 sattr structure for the new node creation case.
*/
struct nfsv3_sattr {
u_int32_t sa_modeset;
u_int32_t sa_mode;
u_int32_t sa_uidset;
u_int32_t sa_uid;
u_int32_t sa_gidset;
u_int32_t sa_gid;
u_int32_t sa_sizeset;
u_int32_t sa_size;
u_int32_t sa_atimetype;
uint32_t sa_modeset;
uint32_t sa_mode;
uint32_t sa_uidset;
uint32_t sa_uid;
uint32_t sa_gidset;
uint32_t sa_gid;
uint32_t sa_sizeset;
uint32_t sa_size;
uint32_t sa_atimetype;
nfstime3 sa_atime;
u_int32_t sa_mtimetype;
uint32_t sa_mtimetype;
nfstime3 sa_mtime;
};
struct nfs_statfs {
union {
struct {
u_int32_t nfsv2sf_tsize;
u_int32_t nfsv2sf_bsize;
u_int32_t nfsv2sf_blocks;
u_int32_t nfsv2sf_bfree;
u_int32_t nfsv2sf_bavail;
uint32_t nfsv2sf_tsize;
uint32_t nfsv2sf_bsize;
uint32_t nfsv2sf_blocks;
uint32_t nfsv2sf_bfree;
uint32_t nfsv2sf_bavail;
} sf_nfsv2;
struct {
nfsuint64 nfsv3sf_tbytes;
@ -398,7 +397,7 @@ struct nfs_statfs {
nfsuint64 nfsv3sf_tfiles;
nfsuint64 nfsv3sf_ffiles;
nfsuint64 nfsv3sf_afiles;
u_int32_t nfsv3sf_invarsec;
uint32_t nfsv3sf_invarsec;
} sf_nfsv3;
} sf_un;
};
@ -417,23 +416,23 @@ struct nfs_statfs {
#define sf_invarsec sf_un.sf_nfsv3.nfsv3sf_invarsec
struct nfsv3_fsinfo {
u_int32_t fs_rtmax;
u_int32_t fs_rtpref;
u_int32_t fs_rtmult;
u_int32_t fs_wtmax;
u_int32_t fs_wtpref;
u_int32_t fs_wtmult;
u_int32_t fs_dtpref;
uint32_t fs_rtmax;
uint32_t fs_rtpref;
uint32_t fs_rtmult;
uint32_t fs_wtmax;
uint32_t fs_wtpref;
uint32_t fs_wtmult;
uint32_t fs_dtpref;
nfsuint64 fs_maxfilesize;
nfstime3 fs_timedelta;
u_int32_t fs_properties;
uint32_t fs_properties;
};
struct nfsv3_pathconf {
u_int32_t pc_linkmax;
u_int32_t pc_namemax;
u_int32_t pc_notrunc;
u_int32_t pc_chownrestricted;
u_int32_t pc_caseinsensitive;
u_int32_t pc_casepreserving;
uint32_t pc_linkmax;
uint32_t pc_namemax;
uint32_t pc_notrunc;
uint32_t pc_chownrestricted;
uint32_t pc_caseinsensitive;
uint32_t pc_casepreserving;
};

10
nfsfh.h
View File

@ -1,5 +1,3 @@
/* @(#) $Header: /tcpdump/master/tcpdump/nfsfh.h,v 1.13 2002-04-24 06:27:05 guy Exp $ (LBL) */
/*
* Copyright (c) 1993, 1994 Jeffrey C. Mogul, Digital Equipment Corporation,
* Western Research Laboratory. All rights reserved.
@ -46,8 +44,8 @@
* that we might be spying upon use different external representations.
*/
typedef struct {
u_int32_t Minor; /* upper case to avoid clashing with macro names */
u_int32_t Major;
uint32_t Minor; /* upper case to avoid clashing with macro names */
uint32_t Major;
} my_devt;
#define dev_eq(a,b) ((a.Minor == b.Minor) && (a.Major == b.Major))
@ -59,10 +57,10 @@ typedef struct {
typedef struct {
my_devt Fsid_dev; /* XXX avoid name conflict with AIX */
char Opaque_Handle[2 * 32 + 1];
u_int32_t fsid_code;
uint32_t fsid_code;
} my_fsid;
#define fsid_eq(a,b) ((a.fsid_code == b.fsid_code) &&\
dev_eq(a.Fsid_dev, b.Fsid_dev))
extern void Parse_fh(const unsigned char *, int, my_fsid *, ino_t *, const char **, const char **, int);
extern void Parse_fh(const unsigned char *, int, my_fsid *, uint32_t *, const char **, const char **, int);

View File

@ -1,4 +1,4 @@
/*
/*
* 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
@ -13,11 +13,7 @@
* Original code by Hannes Gredler (hannes@juniper.net)
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/nlpid.c,v 1.4 2004-10-19 15:27:55 hannes Exp $ (LBL)";
#endif
#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

View File

@ -1,5 +1,4 @@
/* @(#) $Header: /tcpdump/master/tcpdump/nlpid.h,v 1.4 2004-10-19 15:27:55 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

127
ntp.h
View File

@ -1,127 +0,0 @@
/* $Header: /tcpdump/master/tcpdump/ntp.h,v 1.8 2004-01-28 14:34:50 hannes Exp $ */
/*
* Based on ntp.h from the U of MD implementation
* This file is based on Version 2 of the NTP spec (RFC1119).
*/
/*
* Definitions for the masses
*/
#define JAN_1970 2208988800U /* 1970 - 1900 in seconds */
/*
* Structure definitions for NTP fixed point values
*
* 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
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Integer Part |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Fraction Part |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
* 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
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Integer Part | Fraction Part |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct l_fixedpt {
u_int32_t int_part;
u_int32_t fraction;
};
struct s_fixedpt {
u_int16_t int_part;
u_int16_t fraction;
};
/* rfc2030
* 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
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |LI | VN |Mode | Stratum | Poll | Precision |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Root Delay |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Root Dispersion |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Reference Identifier |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | |
* | Reference Timestamp (64) |
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | |
* | Originate Timestamp (64) |
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | |
* | Receive Timestamp (64) |
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | |
* | Transmit Timestamp (64) |
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Key Identifier (optional) (32) |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | |
* | |
* | Message Digest (optional) (128) |
* | |
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
struct ntpdata {
u_char status; /* status of local clock and leap info */
u_char stratum; /* Stratum level */
u_char ppoll; /* poll value */
int precision:8;
struct s_fixedpt root_delay;
struct s_fixedpt root_dispersion;
u_int32_t refid;
struct l_fixedpt ref_timestamp;
struct l_fixedpt org_timestamp;
struct l_fixedpt rec_timestamp;
struct l_fixedpt xmt_timestamp;
u_int32_t key_id;
u_int8_t message_digest[16];
};
/*
* Leap Second Codes (high order two bits)
*/
#define NO_WARNING 0x00 /* no warning */
#define PLUS_SEC 0x40 /* add a second (61 seconds) */
#define MINUS_SEC 0x80 /* minus a second (59 seconds) */
#define ALARM 0xc0 /* alarm condition (clock unsynchronized) */
/*
* Clock Status Bits that Encode Version
*/
#define NTPVERSION_1 0x08
#define VERSIONMASK 0x38
#define LEAPMASK 0xc0
#define MODEMASK 0x07
/*
* Code values
*/
#define MODE_UNSPEC 0 /* unspecified */
#define MODE_SYM_ACT 1 /* symmetric active */
#define MODE_SYM_PAS 2 /* symmetric passive */
#define MODE_CLIENT 3 /* client */
#define MODE_SERVER 4 /* server */
#define MODE_BROADCAST 5 /* broadcast */
#define MODE_RES1 6 /* reserved */
#define MODE_RES2 7 /* reserved */
/*
* Stratum Definitions
*/
#define UNSPECIFIED 0
#define PRIM_REF 1 /* radio clock */
#define INFO_QUERY 62 /* **** THIS implementation dependent **** */
#define INFO_REPLY 63 /* **** THIS implementation dependent **** */

126
oakley.h
View File

@ -1,126 +0,0 @@
/*
* Copyright (C) 1995, 1996, 1997, and 1998 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.
*/
/* YIPS @(#)$Id: oakley.h,v 1.4 2002-12-11 07:13:56 guy Exp $ */
/* refer to RFC 2409 */
#if !defined(_ISAKMP_OAKLEY_H_)
#define _ISAKMP_OAKLEY_H_
/* Attribute Classes */
#define OAKLEY_ATTR_ENC_ALG 1 /* B */
#define OAKLEY_ATTR_ENC_ALG_DES 1
#define OAKLEY_ATTR_ENC_ALG_IDEA 2
#define OAKLEY_ATTR_ENC_ALG_BL 3
#define OAKLEY_ATTR_ENC_ALG_RC5 4
#define OAKLEY_ATTR_ENC_ALG_3DES 5
#define OAKLEY_ATTR_ENC_ALG_CAST 6
#define OAKLEY_ATTR_HASH_ALG 2 /* B */
#define OAKLEY_ATTR_HASH_ALG_MD5 1
#define OAKLEY_ATTR_HASH_ALG_SHA 2
#define OAKLEY_ATTR_HASH_ALG_TIGER 3
#define OAKLEY_ATTR_AUTH_METHOD 3 /* B */
#define OAKLEY_ATTR_AUTH_METHOD_PSKEY 1
#define OAKLEY_ATTR_AUTH_METHOD_DSS 2
#define OAKLEY_ATTR_AUTH_METHOD_RSA 3
#define OAKLEY_ATTR_AUTH_METHOD_RSAENC 4
#define OAKLEY_ATTR_AUTH_METHOD_RSAREV 5
#define OAKLEY_ATTR_GRP_DESC 4 /* B */
#define OAKLEY_ATTR_GRP_DESC_MODP768 1
#define OAKLEY_ATTR_GRP_DESC_MODP1024 2
#define OAKLEY_ATTR_GRP_DESC_EC2N155 3
#define OAKLEY_ATTR_GRP_DESC_EC2N185 4
#define OAKLEY_ATTR_GRP_TYPE 5 /* B */
#define OAKLEY_ATTR_GRP_TYPE_MODP 1
#define OAKLEY_ATTR_GRP_TYPE_ECP 2
#define OAKLEY_ATTR_GRP_TYPE_EC2N 3
#define OAKLEY_ATTR_GRP_PI 6 /* V */
#define OAKLEY_ATTR_GRP_GEN_ONE 7 /* V */
#define OAKLEY_ATTR_GRP_GEN_TWO 8 /* V */
#define OAKLEY_ATTR_GRP_CURVE_A 9 /* V */
#define OAKLEY_ATTR_GRP_CURVE_B 10 /* V */
#define OAKLEY_ATTR_SA_LTYPE 11 /* B */
#define OAKLEY_ATTR_SA_LTYPE_DEFAULT 1
#define OAKLEY_ATTR_SA_LTYPE_SEC 1
#define OAKLEY_ATTR_SA_LTYPE_KB 2
#define OAKLEY_ATTR_SA_LDUR 12 /* V */
#define OAKLEY_ATTR_SA_LDUR_DEFAULT 28800 /* 8 hours */
#define OAKLEY_ATTR_PRF 13 /* B */
#define OAKLEY_ATTR_KEY_LEN 14 /* B */
#define OAKLEY_ATTR_FIELD_SIZE 15 /* B */
#define OAKLEY_ATTR_GRP_ORDER 16 /* V */
#define OAKLEY_ID_IPV4_ADDR 0
#define OAKLEY_ID_IPV4_ADDR_SUBNET 1
#define OAKLEY_ID_IPV6_ADDR 2
#define OAKLEY_ID_IPV6_ADDR_SUBNET 3
/* Additional Exchange Type */
#define ISAKMP_ETYPE_QUICK 32
#define ISAKMP_ETYPE_NEWGRP 33
/* The use for checking proposal payload. This is not exchange type. */
#define OAKLEY_MAIN_MODE 0
#define OAKLEY_QUICK_MODE 1
#define OAKLEY_PRIME_MODP768 "\
FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 \
29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD \
EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 \
E485B576 625E7EC6 F44C42E9 A63A3620 FFFFFFFF FFFFFFFF"
#define OAKLEY_PRIME_MODP1024 "\
FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 \
29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD \
EF9519B3 CD3A431B 302B0A6D F25F1437 4FE1356D 6D51C245 \
E485B576 625E7EC6 F44C42E9 A637ED6B 0BFF5CB6 F406B7ED \
EE386BFB 5A899FA5 AE9F2411 7C4B1FE6 49286651 ECE65381 \
FFFFFFFF FFFFFFFF"
#define DEFAULTSECRETSIZE ( 128 / 8 ) /* 128 bits */
#define DEFAULTNONCESIZE ( 128 / 8 ) /* 128 bits */
#define MAXPADLWORD 20
#if 0
/* isakmp sa structure */
struct oakley_sa {
u_int8_t proto_id; /* OAKLEY */
vchar_t *spi; /* spi */
u_int8_t dhgrp; /* DH; group */
u_int8_t auth_t; /* method of authentication */
u_int8_t prf_t; /* type of prf */
u_int8_t hash_t; /* type of hash */
u_int8_t enc_t; /* type of cipher */
u_int8_t life_t; /* type of duration of lifetime */
u_int32_t ldur; /* life duration */
};
#endif
#endif /* !defined(_ISAKMP_OAKLEY_H_) */

40
openflow.h Normal file
View File

@ -0,0 +1,40 @@
/*
* Copyright (c) 2013 The TCPDUMP 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.
*
* 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 HOLDER 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.
*/
/* OpenFlow: protocol between controller and datapath. */
/* for netdissect_options */
#include "netdissect.h"
#define OF_HEADER_LEN 8
/*
* Routines to print packets for various versions of OpenFlow.
*/
extern const u_char *of10_header_body_print(netdissect_options *ndo,
const u_char *, const u_char *,
const uint8_t, const uint16_t, const uint32_t);

Some files were not shown because too many files have changed in this diff Show More