Ported tcpdump 3.9.5, and libpcap 0.9.5 to Haiku to test our link level packet

monitor. Their build system and file hierarchy is pretty poor (as well as the
internals of libpcap), but the app itself seems to work well :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19556 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-12-18 19:22:32 +00:00
parent c0d50aaedb
commit cf6b262822
471 changed files with 173829 additions and 0 deletions

View File

@ -7,6 +7,7 @@ SubInclude HAIKU_TOP src bin network ifconfig ;
#SubInclude HAIKU_TOP src bin network ppp_up ;
SubInclude HAIKU_TOP src bin network ping ;
SubInclude HAIKU_TOP src bin network route ;
SubInclude HAIKU_TOP src bin network tcpdump ;
SubInclude HAIKU_TOP src bin network telnet ;
SubInclude HAIKU_TOP src bin network telnetd ;
SubInclude HAIKU_TOP src bin network traceroute ;

View File

@ -0,0 +1,12 @@
version.c
Makefile
Makefile-devel.in
config.status
config.log
config.cache
config.h
.devel
stamp-h
stamp-h.in
tcpdump
autom4te.cache

View File

@ -0,0 +1,819 @@
$Header: /tcpdump/master/tcpdump/CHANGES,v 1.87.2.12 2006/09/19 18:24:44 ken Exp $
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
Add support for Frame-Relay ARP
Fixes for compiling under MSVC++
Add support for parsing Juniper .pcap files
Add support for FRF.16 Multilink Frame-Relay (DLT_MFR)
Rework the OSPFv3 printer
Fix printing for 4.4BSD/NetBSD NFS Filehandles
Add support for Cisco style NLPID encapsulation
Add cisco prop. eigrp related, extended communities
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
the options output a bit.
Add additional modp groups to ISAKMP printer
Add support for Address-Withdraw and Label-Withdraw Msgs
Add support for the BFD Discriminator TLV
Fixes for 64bit compiling
Add support for PIMv2 checksum verification
Add support for further dissection of the IPCP Compression Option
Add support for Cisco's proposed VQP protocol
Add basic support for keyed authentication TCP option
Lots of minor cosmetic changes to output printers
Mon. September 19, 2005. ken@xelerance.com. Summary for 3.9.4 tcpdump release
Decoder support for more Juniper link-layer types
Fix a potential buffer overflow (although it can't occur in
practice).
Fix the handling of unknown management frame types in the 802.11
printer.
Add FRF.16 support, fix various Frame Relay bugs.
Add support for RSVP integrity objects, update fast-reroute
object printer to latest spec.
Clean up documentation of vlan filter expression, document mpls
filter expression.
Document new pppoed and pppoes filter expressions.
Update diffserver-TE codepoints as per RFC 4124.
Spelling fixes in ICMPv6.
Don't require any fields other than flags to be present in IS-IS
restart signaling TLVs, and only print the system ID in
those TLVs as system IDs, not as node IDs.
Support for DCCP.
Tue. July 5, 2005. ken@xelerance.com. Summary for 3.9.3 tcpdump release
Option to chroot() when dropping privs
Fixes for compiling on nearly every platform,
including improved 64bit support
Many new testcases
Support for sending packets
Many compliation fixes on most platforms
Fixes for recent version of GCC to eliminate warnings
Improved Unicode support
Decoders & DLT Changes, Updates and New:
AES ESP support
Juniper ATM, FRF.15, FRF.16, PPPoE,
ML-FR, ML-PIC, ML-PPP, PL-PPP, LS-PIC
GGSN,ES,MONITOR,SERVICES
L2VPN
Axent Raptor/Symantec Firewall
TCP-MD5 (RFC 2385)
ESP-in-UDP (RFC 3948)
ATM OAM
LMP, LMP Service Discovery
IP over FC
IP over IEEE 1394
BACnet MS/TP
SS7
LDP over TCP
LACP, MARKER as per 802.3ad
PGM (RFC 3208)
LSP-PING
G.7041/Y.1303 Generic Framing Procedure
EIGRP-IP, EIGRP-IPX
ICMP6
Radio - via radiotap
DHCPv6
HDLC over PPP
Tue. March 30, 2004. mcr@sandelman.ottawa.on.ca. Summary for 3.8.3 release
No changes from 3.8.2. Version bumped only to maintain consistency
with libpcap 0.8.3.
Mon. March 29, 2004. mcr@sandelman.ottawa.on.ca. Summary for 3.8.2 release
Fixes for print-isakmp.c CVE: CAN-2004-0183, CAN-2004-0184
http://www.rapid7.com/advisories/R7-0017.html
IP-over-IEEE1394 printing.
some MINGW32 changes.
updates for autoconf 2.5
fixes for print-aodv.c - check for too short packets
formatting changes to print-ascii for hex output.
check for too short packets: print-bgp.c, print-bootp.c, print-cdp.c,
print-chdlc.c, print-domain.c, print-icmp.c, print-icmp6.c,
print-ip.c, print-lwres.c, print-ospf.c, print-pim.c,
print-ppp.c,print-pppoe.c, print-rsvp.c, print-wb.c
print-ether.c - better handling of unknown types.
print-isoclns.c - additional decoding of types.
print-llc.c - strings for LLC names added.
print-pfloc.c - various enhancements
print-radius.c - better decoding to strings.
Wed. November 12, 2003. mcr@sandelman.ottawa.on.ca. Summary for 3.8 release
changed syntax of -E argument so that multiple SAs can be decrypted
fixes for Digital Unix headers and Documentation
__attribute__ fixes
CDP changes from Terry Kennedy <terry@tmk.com>.
IPv6 mobility updates from Kazushi Sugyo <sugyo@pb.jp.nec.com>
Fixes for ASN.1 decoder for 2.100.3 forms.
Added a count of packets received and processed to clarify numbers.
Incorporated WinDUMP patches for Win32 builds.
PPPoE payload length headers.
Fixes for HP C compiler builds.
Use new pcap_breakloop() and pcap_findalldevs() if we can.
BGP output split into multiple lines.
Fixes to 802.11 decoding.
Fixes to PIM decoder.
SuperH is a CPU that can't handle unaligned access. Many fixes for
unaligned access work.
Fixes to Frame-Relay decoder for Q.933/922 frames.
Clarified when Solaris can do captures as non-root.
Added tests/ subdir for examples/regression tests.
New -U flag. -flush stdout after every packet
New -A flag -print ascii only
support for decoding IS-IS inside Cisco HDLC Frames
more verbosity for tftp decoder
mDNS decoder
new BFD decoder
cross compilation patches
RFC 3561 AODV support.
UDP/TCP pseudo-checksum properly for source-route options.
sanitized all files to modified BSD license
Add support for RFC 2625 IP-over-Fibre Channel.
fixes for DECnet support.
Support RFC 2684 bridging of Ethernet, 802.5 Token Ring, and FDDI.
RFC 2684 encapsulation of BPDUs.
Tuesday, February 25, 2003. fenner@research.att.com. 3.7.2 release
Fixed infinite loop when parsing malformed isakmp packets.
(reported by iDefense; already fixed in CVS)
Fixed infinite loop when parsing malformed BGP packets.
Fixed buffer overflow with certain malformed NFS packets.
Pretty-print unprintable network names in 802.11 printer.
Handle truncated nbp (appletalk) packets.
Updated DHCPv6 printer to match draft-ietf-dhc-dhcpv6-22.txt
Print IP protocol name even if we don't have a printer for it.
Print IP protocol name or number for fragments.
Print the whole MPLS label stack, not just the top label.
Print request header and file handle for NFS v3 FSINFO and PATHCONF
requests.
Fix NFS packet truncation checks.
Handle "old" DR-Priority and Bidir-Capable PIM HELLO options.
Handle unknown RADIUS attributes properly.
Fix an ASN.1 parsing error that would cause e.g. the OID
2.100.3 to be misrepresented as 4.20.3 .
Monday, January 21, 2002. mcr@sandelman.ottawa.on.ca. Summary for 3.7 release
see http://www.tcpdump.org/cvs-log/2002-01-21.10:16:48.html for commit log.
keyword "ipx" added.
Better OSI/802.2 support on Linux.
IEEE 802.11 support, from clenahan@fortresstech.com, achirica@ttd.net.
LLC SAP support for FDDI/token ring/RFC-1483 style ATM
BXXP protocol was replaced by the BEEP protocol;
improvements to SNAP demux.
Changes to "any" interface documentation.
Documentation on pcap_stats() counters.
Fix a memory leak found by Miklos Szeredi - pcap_ether_aton().
Added MPLS encapsulation decoding per RFC3032.
DNS dissector handles TKEY, TSIG and IXFR.
adaptive SLIP interface patch from Igor Khristophorov <igor@atdot.org>
SMB printing has much improved bounds checks
OUI 0x0000f8 decoded as encapsulated ethernet for Cisco-custom bridging
Zephyr support, from Nickolai Zeldovich <kolya@MIT.EDU>.
Solaris - devices with digits in them. Stefan Hudson <hudson@mbay.net>
IPX socket 0x85be is for Cisco EIGRP over IPX.
Improvements to fragmented ESP handling.
SCTP support from Armando L. Caro Jr. <acaro@mail.eecis.udel.edu>
Linux ARPHDR_ATM support fixed.
Added a "netbeui" keyword, which selects NetBEUI packets.
IPv6 ND improvements, MobileIP dissector, 2292bis-02 for RA option.
Handle ARPHDR_HDLC from Marcus Felipe Pereira <marcus@task.com.br>.
Handle IPX socket 0x553 -> NetBIOS-over-IPX socket, "nwlink-dgm"
Better Linux libc5 compat.
BIND9 lwres dissector added.
MIPS and SPARC get strict alignment macros (affects print-bgp.c)
Apple LocalTalk LINKTYPE_ reserved.
New time stamp formats documented.
DHCP6 updated to draft-22.txt spec.
ICMP types/codes now accept symbolic names.
Add SIGINFO handler from LBL
encrypted CIPE tunnels in IRIX, from Franz Schaefer <schaefer@mond.at>.
now we are -Wstrict-prototype clean.
NetBSD DLT_PPP_ETHER; adapted from Martin Husemann <martin@netbsd.org>.
PPPoE dissector cleaned up.
Support for LocalTalk hardware, from Uns Lider <unslider@miranda.org>.
In dissector, now the caller prints the IP addresses rather than proto.
cjclark@alum.mit.edu: print the IP proto for non-initial fragments.
LLC frames with a DSAP and LSAP of 0xe0 are IPX frames.
Linux cooked frames with a type value of LINUX_SLL_P_802_3 are IPX.
captures on the "any" device won't be done in promiscuous mode
Token Ring support on DLPI - Onno van der Linden <onno@simplex.nl>
ARCNet support, from NetBSD.
HSRP dissector, from Julian Cowley <julian@lava.net>.
Handle (GRE-encapsulated) PPTP
added -C option to rotate save file every optarg * 1,000,000 bytes.
support for "vrrp" name - NetBSD, by Klaus Klein <kleink@netbsd.org>.
PPTP support, from Motonori Shindo <mshindo@mshindo.net>.
IS-IS over PPP support, from Hannes Gredler <hannes@juniper.net>.
CNFP support for IPv6,format. Harry Raaymakers <harryr@connect.com.au>.
ESP printing updated to RFC2406.
HP-UX can now handle large number of PPAs.
MSDP printer added.
L2TP dissector improvements from Motonori Shindo.
Tuesday January 9, 2001. mcr@sandelman.ottawa.on.ca. Summary for 3.6 release
Cleaned up documentation.
Promisc mode fixes for Linux
IPsec changes/cleanups.
Alignment fixes for picky architectures
Removed dependency on native headers for packet dissectors.
Removed Linux specific headers that were shipped
libpcap changes provide for exchanging capture files between
systems. Save files now have well known PACKET_ values instead of
depending upon system dependant mappings of DLT_* types.
Support for computing/checking IP and UDP/TCP checksums.
Updated autoconf stock files.
IPv6 improvements: dhcp (draft-15), mobile-ip6, ppp, ospf6,
Added dissector support for: ISOCLNS, Token Ring, IGMPv3, bxxp,
timed, vrrp, radius, chdlc, cnfp, cdp, IEEE802.1d, raw-AppleTalk
Added filtering support for: VLANs, ESIS, ISIS
Improvements to: print-telnet, IPTalk, bootp/dhcp, ECN, PPP,
L2TP, PPPoE
HP-UX 11.0 -- find the right dlpi device.
Solaris 8 - IPv6 works
Linux - Added support for an "any" device to capture on all interfaces
Security fixes: buffer overrun audit done. Strcpy replaced with
strlcpy, sprintf replaced with snprintf.
Look for lex problems, and warn about them.
v3.5 Fri Jan 28 18:00:00 PST 2000
Bill Fenner <fenner@research.att.com>
- switch to config.h for autoconf
- unify RCSID strings
- Updated PIMv1, PIMv2, DVMRP, IGMP parsers, add Cisco Auto-RP parser
- Really fix the RIP printer
- Fix MAC address -> name translation.
- some -Wall -Wformat fixes
- update makemib to parse much of SMIv2
- Print TCP sequence # with -vv even if you normally wouldn't
- Print as much of IP/TCP/UDP headers as possible even if truncated.
itojun@iijlab.net
- -X will make a ascii dump. from netbsd.
- telnet command sequence decoder (ff xx xx). from netbsd.
- print-bgp.c: improve options printing. ugly code exists for
unaligned option parsing (need some fix).
- const poisoning in SMB decoder.
- -Wall -Werror clean checks.
- bring in KAME IPv6/IPsec decoding code.
Assar Westerlund <assar@sics.se>
- SNMPv2 and SNMPv3 printer
- If compiled with libsmi, tcpdump can load MIBs on the fly to decode
SNMP packets.
- Incorporate NFS parsing code from NetBSD. Adds support for nfsv3.
- portability fixes
- permit building in different directories.
Ken Hornstein <kenh@cmf.nrl.navy.mil>
- bring in code at
/afs/transarc.com/public/afs-contrib/tools/tcpdump for parsing
AFS3 packets
Andrew Tridgell <tridge@linuxcare.com>
- SMB printing code
Love <lha@stacken.kth.se>
- print-rx.c: add code for printing MakeDir and StoreStatus. Also
change date format to the right one.
Michael C. Richardson <mcr@sandelman.ottawa.on.ca>
- Created tcpdump.org repository
v3.4 Sat Jul 25 12:40:55 PDT 1998
- Hardwire Linux slip support since it's too hard to detect.
- Redo configuration of "network" libraries (-lsocket and -lnsl) to
deal with IRIX. Thanks to John Hawkinson (jhawk@mit.edu)
- Added -a which tries to translate network and broadcast addresses to
names. Suggested by Rob van Nieuwkerk (robn@verdi.et.tudelft.nl)
- Added a configure option to disable gcc.
- Added a "raw" packet printer.
- Not having an interface address is no longer fatal. Requested by John
Hawkinson.
- Rework signal setup to accommodate Linux.
- OSPF truncation check fix. Also display the type of OSPF packets
using MD5 authentication. Thanks to Brian Wellington
(bwelling@tis.com)
- Fix truncation check bugs in the Kerberos printer. Reported by Ezra
Peisach (epeisach@mit.edu)
- Don't catch SIGHUP when invoked with nohup(1). Thanks to Dave Plonka
(plonka@mfa.com)
- Specify full install target as a way of detecting if install
directory does not exist. Thanks to Dave Plonka.
- Bit-swap FDDI addresses for BSD/OS too. Thanks to Paul Vixie
(paul@vix.com)
- Fix off-by-one bug when testing size of ethernet packets. Thanks to
Marty Leisner (leisner@sdsp.mc.xerox.com)
- Add a local autoconf macro to check for routines in libraries; the
autoconf version is broken (it only puts the library name in the
cache variable name). Thanks to John Hawkinson.
- Add a local autoconf macro to check for types; the autoconf version
is broken (it uses grep instead of actually compiling a code fragment).
- Modified to support the new BSD/OS 2.1 PPP and SLIP link layer header
formats.
- Extend OSF ip header workaround to versions 1 and 2.
- Fix some signed problems in the nfs printer. As reported by David
Sacerdote (davids@silence.secnet.com)
- Detect group wheel and use it as the default since BSD/OS' install
can't hack numeric groups. Reported by David Sacerdote.
- AIX needs special loader options. Thanks to Jonathan I. Kamens
(jik@cam.ov.com)
- Fixed the nfs printer to print port numbers in decimal. Thanks to
Kent Vander Velden (graphix@iastate.edu)
- Find installed libpcap in /usr/local/lib when not using gcc.
- Disallow network masks with non-network bits set.
- Attempt to detect "egcs" versions of gcc.
- Add missing closing double quotes when displaying bootp strings.
Reported by Viet-Trung Luu (vluu@picard.math.uwaterloo.ca)
v3.3 Sat Nov 30 20:56:27 PST 1996
- Added Linux support.
- GRE encapsulated packet printer thanks to John Hawkinson
(jhawk@mit.edu)
- Rewrite gmt2local() to avoid problematic os dependencies.
- Suppress nfs truncation message on errors.
- Add missing m4 quoting in AC_LBL_UNALIGNED_ACCESS autoconf macro.
Reported by Joachim Ott (ott@ardala.han.de)
- Enable "ip_hl vs. ip_vhl" workaround for OSF4 too.
- Print arp hardware type in host order. Thanks to Onno van der Linden
(onno@simplex.nl)
- Avoid solaris compiler warnings. Thanks to Bruce Barnett
(barnett@grymoire.crd.ge.com)
- Fix rip printer to not print one more route than is actually in the
packet. Thanks to Jean-Luc Richier (Jean-Luc.Richier@imag.fr) and
Bill Fenner (fenner@parc.xerox.com)
- Use autoconf endian detection since BYTE_ORDER isn't defined on all systems.
- Fix dvmrp printer truncation checks and add a dvmrp probe printer.
Thanks to Danny J. Mitzel (mitzel@ipsilon.com)
- Rewrite ospf printer to improve truncation checks.
- Don't parse tcp options past the EOL. As noted by David Sacerdote
(davids@secnet.com). Also, check tcp options to make sure they ar
actually in the tcp header (in addition to the normal truncation
checks). Fix the SACK code to print the N blocks (instead of the
first block N times).
- Don't say really small UDP packets are truncated just because they
aren't big enough to be a RPC. As noted by David Sacerdote.
v3.2.1 Sun Jul 14 03:02:26 PDT 1996
- Added rfc1716 icmp codes as suggested by Martin Fredriksson
(martin@msp.se)
- Print mtu for icmp unreach need frag packets. Thanks to John
Hawkinson (jhawk@mit.edu)
- Decode icmp router discovery messages. Thanks to Jeffrey Honig
(jch@bsdi.com)
- Added a printer entry for DLT_IEEE802 as suggested by Tak Kushida
(kushida@trl.ibm.co.jp)
- Check igmp checksum if possible. Thanks to John Hawkinson.
- Made changes for SINIX. Thanks to Andrej Borsenkow
(borsenkow.msk@sni.de)
- Use autoconf's idea of the top level directory in install targets.
Thanks to John Hawkinson.
- Avoid infinite loop in tcp options printing code. Thanks to Jeffrey
Mogul (mogul@pa.dec.com)
- Avoid using -lsocket in IRIX 5.2 and earlier since it breaks snoop.
Thanks to John Hawkinson.
- Added some more packet truncation checks.
- On systems that have it, use sigset() instead of signal() since
signal() has different semantics on these systems.
- Fixed some more alignment problems on the alpha.
- Add code to massage unprintable characters in the domain and ipx
printers. Thanks to John Hawkinson.
- Added explicit netmask support. Thanks to Steve Nuchia
(steve@research.oknet.com)
- Add "sca" keyword (for DEC cluster services) as suggested by Terry
Kennedy (terry@spcvxa.spc.edu)
- Add "atalk" keyword as suggested by John Hawkinson.
- Added an igrp printer. Thanks to Francis Dupont
(francis.dupont@inria.fr)
- Print IPX net numbers in hex a la Novell Netware. Thanks to Terry
Kennedy (terry@spcvxa.spc.edu)
- Fixed snmp extended tag field parsing bug. Thanks to Pascal Hennequin
(pascal.hennequin@hugo.int-evry.fr)
- Added some ETHERTYPEs missing on some systems.
- Added truncated packet macros and various checks.
- Fixed endian problems with the DECnet printer.
- Use $CC when checking gcc version. Thanks to Carl Lindberg
(carl_lindberg@blacksmith.com)
- Fixes for AIX (although this system is not yet supported). Thanks to
John Hawkinson.
- Fix bugs in the autoconf misaligned accesses code fragment.
- Include sys/param.h to get BYTE_ORDER in a few places. Thanks to
Pavlin Ivanov Radoslavov (pavlin@cs.titech.ac.jp)
v3.2 Sun Jun 23 02:28:10 PDT 1996
- Print new icmp unreachable codes as suggested by Martin Fredriksson
(martin@msp.se). Also print code value when unknown for icmp redirect
and time exceeded.
- Fix an alignment endian bug in getname(). Thanks to John Hawkinson.
- Define "new" domain record types if not found in arpa/nameserv.h.
Resulted from a suggestion from John Hawkinson (jhawk@mit.edu). Also
fixed an endian bug when printing mx record and added some new record
types.
- Added RIP V2 support. Thanks to Jeffrey Honig (jch@bsdi.com)
- Added T/TCP options printing. As suggested by Richard Stevens
(rstevens@noao.edu)
- Use autoconf to detect architectures that can't handle misaligned
accesses.
v3.1 Thu Jun 13 20:59:32 PDT 1996
- Changed u_int32/int32 to u_int32_t/int32_t to be consistent with bsd
and bind (as suggested by Charles Hannum).
- Port to GNU autoconf.
- Add support for printing DVMRP and PIM traffic thanks to
Havard Eidnes (Havard.Eidnes@runit.sintef.no).
- Fix AppleTalk, IPX and DECnet byte order problems due to wrong endian
define being referenced. Reported by Terry Kennedy.
- Minor fixes to the man page thanks to Mark Andrews.
- Endian fixes to RTP and vat packet dumpers, thanks to Bruce Mah
(bmah@cs.berkeley.edu).
- Added support for new dns types, thanks to Rainer Orth.
- Fixed tftp_print() to print the block number for ACKs.
- Document -dd and -ddd. Resulted from a bug report from Charlie Slater
(cslater@imatek.com).
- Check return status from malloc/calloc/etc.
- Check return status from pcap_loop() so we can print an error and
exit with a bad status if there were problems.
- Bail if ip option length is <= 0. Resulted from a bug report from
Darren Reed (darrenr@vitruvius.arbld.unimelb.edu.au).
- Print out a little more information for sun rpc packets.
- Add suport for Kerberos 4 thanks to John Hawkinson (jhawk@mit.edu).
- Fixed the Fix EXTRACT_SHORT() and EXTRACT_LONG() macros (which were
wrong on little endian machines).
- Fixed alignment bug in ipx_decode(). Thanks to Matt Crawford
(crawdad@fnal.gov).
- Fix ntp_print() to not print garbage when the stratum is
"unspecified." Thanks to Deus Ex Machina (root@belle.bork.com).
- Rewrote tcp options printer code to check for truncation. Added
selective acknowledgment case.
- Fixed an endian bug in the ospf printer. Thanks to Jeffrey C Honig
(jch@bsdi.com)
- Fix rip printer to handle 4.4 BSD sockaddr struct which only uses one
octet for the sa_family member. Thanks to Yoshitaka Tokugawa
(toku@dit.co.jp)
- Don't checksum ip header if we don't have all of it. Thanks to John
Hawkinson (jhawk@mit.edu).
- Print out hostnames if possible in egp printer. Thanks to Jeffrey
Honig (jhc@bsdi.com)
v3.1a1 Wed May 3 19:21:11 PDT 1995
- Include time.h when SVR4 is defined to avoid problems under Solaris
2.3.
- Fix etheraddr_string() in the ETHER_SERVICE to return the saved
strings, not the local buffer. Thanks to Stefan Petri
(petri@ibr.cs.tu-bs.de).
- Detect when pcap raises the snaplen (e.g. with snit). Print a warning
that the selected value was not used. Thanks to Pascal Hennequin
(Pascal.Hennequin@hugo.int-evry.fr).
- Add a truncated packet test to print-nfs.c. Thanks to Pascal Hennequin.
- BYTEORDER -> BYTE_ORDER Thanks to Terry Kennedy (terry@spcvxa.spc.edu).
v3.0.3 Sun Oct 1 18:35:00 GMT 1995
- Although there never was a 3.0.3 release, the linux boys cleverly
"released" one in late 1995.
v3.0.2 Thu Apr 20 21:28:16 PDT 1995
- Change configuration to not use gcc v2 flags with gcc v1.
- Redo gmt2local() so that it works under BSDI (which seems to return
an empty timezone struct from gettimeofday()). Based on report from
Terry Kennedy (terry@spcvxa.spc.edu).
- Change configure to recognize IP[0-9]* as "mips" SGI hardware. Based
on report from Mark Andrews (mandrews@alias.com).
- Don't pass cc flags to gcc. Resulted from a bug report from Rainer
Orth (ro@techfak.uni-bielefeld.de).
- Fixed printout of connection id for uncompressed tcp slip packets.
Resulted from a bug report from Richard Stevens (rstevens@noao.edu).
- Hack around deficiency in Ultrix's make.
- Add ETHERTYPE_TRAIL define which is missing from irix5.
v3.0.1 Wed Aug 31 22:42:26 PDT 1994
- Fix problems with gcc2 vs. malloc() and read() prototypes under SunOS 4.
v3.0 Mon Jun 20 19:23:27 PDT 1994
- Added support for printing tcp option timestamps thanks to
Mark Andrews (mandrews@alias.com).
- Reorganize protocol dumpers to take const pointers to packets so they
never change the contents (i.e., they used to do endian conversions
in place). Previously, whenever more than one pass was taken over
the packet, the packet contents would be dumped incorrectly (i.e.,
the output form -x would be wrong on little endian machines because
the protocol dumpers would modify the data). Thanks to Charles Hannum
(mycroft@gnu.ai.mit.edu) for reporting this problem.
- Added support for decnet protocol dumping thanks to Jeff Mogul
(mogul@pa.dec.com).
- Fix bug that caused length of packet to be incorrectly printed
(off by ether header size) for unknown ethernet types thanks
to Greg Miller (gmiller@kayak.mitre.org).
- Added support for IPX protocol dumping thanks to Brad Parker
(brad@fcr.com).
- Added check to verify IP header checksum under -v thanks to
Brad Parker (brad@fcr.com).
- Move packet capture code to new libpcap library (which is
packaged separately).
- Prototype everything and assume an ansi compiler.
- print-arp.c: Print hardware ethernet addresses if they're not
what we expect.
- print-bootp.c: Decode the cmu vendor field. Add RFC1497 tags.
Many helpful suggestions from Gordon Ross (gwr@jericho.mc.com).
- print-fddi.c: Improvements. Thanks to Jeffrey Mogul
(mogul@pa.dec.com).
- print-icmp.c: Byte swap netmask before printing. Thanks to
Richard Stevens (rstevens@noao.edu). Print icmp type when unknown.
- print-ip.c: Print the inner ip datagram of ip-in-ip encapsulated packets.
By default, only the inner packet is dumped, appended with the token
"(encap)". Under -v, both the inner and output packets are dumped
(on the same line). Note that the filter applies to the original packet,
not the encapsulated packet. So if you run tcpdump on a net with an
IP Multicast tunnel, you cannot filter out the datagrams using the
conventional syntax. (You can filter away all the ip-in-ip traffic
with "not ip proto 4".)
- print-nfs.c: Keep pending rpc's in circular table. Add generic
nfs header and remove os dependences. Thanks to Jeffrey Mogul.
- print-ospf.c: Improvements. Thanks to Jeffrey Mogul.
- tcpdump.c: Add -T flag allows interpretation of "vat", "wb", "rpc"
(sunrpc) and rtp packets. Added "inbound" and "outbound" keywords
Add && and || operators
v2.2.1 Tue Jun 6 17:57:22 PDT 1992
- Fix bug with -c flag.
v2.2 Fri May 22 17:19:41 PDT 1992
- savefile.c: Remove hack that shouldn't have been exported. Add
truncate checks.
- Added the 'icmp' keyword. For example, 'icmp[0] != 8 and icmp[0] != 0'
matches non-echo/reply ICMP packets.
- Many improvements to filter code optimizer.
- Added 'multicast' keyword and extended the 'broadcast' keyword can now be
so that protocol qualifications are allowed. For example, "ip broadcast"
and "ether multicast" are valid filters.
- Added support for monitoring the loopback interface (i.e. 'tcpdump -i lo').
Jeffrey Honig (jch@MITCHELL.CIT.CORNELL.EDU) contributed the kernel
patches to netinet/if_loop.c.
- Added support for the Ungermann-Bass Ethernet on IBM/PC-RTs running AOS.
Contact Jeffrey Honig (jch@MITCHELL.CIT.CORNELL.EDU) for the diffs.
- Added EGP and OSPF printers, thanks to Jeffrey Honig.
v2.1 Tue Jan 28 11:00:14 PST 1992
- Internal release (never publically exported).
v2.0.1 Sun Jan 26 21:10:10 PDT
- Various byte ordering fixes.
- Add truncation checks.
- inet.c: Support BSD style SIOCGIFCONF.
- nametoaddr.c: Handle multi addresses for single host.
- optimize.c: Rewritten.
- pcap-bpf.c: don't choke when we get ptraced. only set promiscuous
for broadcast nets.
- print-atal.c: Fix an alignment bug (thanks to
stanonik@nprdc.navy.mil) Add missing printf() argument.
- print-bootp.c: First attempt at decoding the vendor buffer.
- print-domain.c: Fix truncation checks.
- print-icmp.c: Calculate length of packets from the ip header.
- print-ip.c: Print frag id in decimal (so it's easier to match up
with non-frags). Add support for ospf, egp and igmp.
- print-nfs.c: Lots of changes.
- print-ntp.c: Make some verbose output depend on -v.
- print-snmp.c: New version from John LoVerso.
- print-tcp.c: Print rfc1072 tcp options.
- tcpdump.c: Print "0x" prefix for %x formats. Always print 6 digits
(microseconds) worth of precision. Fix uid bugs.
- A packet dumper has been added (thanks to Jeff Mogul of DECWRL).
With this option, you can create an architecture independent binary
trace file in real time, without the overhead of the packet printer.
At a later time, the packets can be filtered (again) and printed.
- BSD is supported. You must have BPF in your kernel.
Since the filtering is now done in the kernel, fewer packets are
dropped. In fact, with BPF and the packet dumper option, a measly
Sun 3/50 can keep up with a busy network.
- Compressed SLIP packets can now be dumped, provided you use our
SLIP software and BPF. These packets are dumped as any other IP
packet; the compressed headers are dumped with the '-e' option.
- Machines with little-endian byte ordering are supported (thanks to
Jeff Mogul).
- Ultrix 4.0 is supported (also thanks to Jeff Mogul).
- IBM RT and Stanford Enetfilter support has been added by
Rayan Zachariassen <rayan@canet.ca>. Tcpdump has been tested under
both the vanilla Enetfilter interface, and the extended interface
(#ifdef'd by IBMRTPC) present in the MERIT version of the Enetfilter.
- TFTP packets are now printed (requests only).
- BOOTP packets are now printed.
- SNMP packets are now printed. (thanks to John LoVerso of Xylogics).
- Sparc architectures, including the Sparcstation-1, are now
supported thanks to Steve McCanne and Craig Leres.
- SunOS 4 is now supported thanks to Micky Liu of Columbia
University (micky@cunixc.cc.columbia.edu).
- IP options are now printed.
- RIP packets are now printed.
- There's a -v flag that prints out more information than the
default (e.g., it will enable printing of IP ttl, tos and id)
and -q flag that prints out less (e.g., it will disable
interpretation of AppleTalk-in-UDP).
- The grammar has undergone substantial changes (if you have an
earlier version of tcpdump, you should re-read the manual
entry).
The most useful change is the addition of an expression
syntax that lets you filter on arbitrary fields or values in the
packet. E.g., "ip[0] > 0x45" would print only packets with IP
options, "tcp[13] & 3 != 0" would print only TCP SYN and FIN
packets.
The most painful change is that concatenation no longer means
"and" -- e.g., you have to say "host foo and port bar" instead
of "host foo port bar". The up side to this down is that
repeated qualifiers can be omitted, making most filter
expressions shorter. E.g., you can now say "ip host foo and
(bar or baz)" to look at ip traffic between hosts foo and bar or
between hosts foo and baz. [The old way of saying this was "ip
host foo and (ip host bar or ip host baz)".]
v2.0 Sun Jan 13 12:20:40 PST 1991
- Initial public release.

View File

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

View File

@ -0,0 +1,248 @@
CHANGES
CREDITS
FILES
INSTALL
LICENSE
Makefile.in
README
Readme.Win32
VERSION
acconfig.h
aclocal.m4
addrtoname.c
addrtoname.h
ah.h
aodv.h
appletalk.h
arcnet.h
atime.awk
atm.h
atmuni31.h
bootp.h
bpf_dump.c
bgp.h
chdlc.h
config.guess
config.h.in
config.sub
configure
configure.in
cpack.c
cpack.h
dccp.h
decnet.h
decode_prefix.h
enc.h
esp.h
ether.h
ethertype.h
extract.h
fddi.h
gmpls.c
gmpls.h
gmt2local.c
gmt2local.h
icmp6.h
ieee802_11.h
ieee802_11_radio.h
igrp.h
install-sh
interface.h
ip.h
ip6.h
ipfc.h
ipproto.c
ipproto.h
ipsec_doi.h
ipx.h
isakmp.h
l2tp.h
l2vpn.c
l2vpn.h
lane.h
lbl/os-osf4.h
lbl/os-solaris2.h
lbl/os-sunos4.h
lbl/os-ultrix4.h
llc.h
machdep.c
machdep.h
makemib
mib.h
missing/addrinfo.h
missing/addrsize.h
missing/bittypes.h
missing/dlnames.c
missing/datalinks.c
missing/getaddrinfo.c
missing/getnameinfo.c
missing/inet_aton.c
missing/inet_ntop.c
missing/inet_pton.c
missing/resolv6.h
missing/resolv_ext.h
missing/snprintf.c
missing/sockstorage.h
missing/strdup.c
missing/strlcat.c
missing/strlcpy.c
missing/strsep.c
mkdep
mpls.h
nameser.h
netbios.h
netdissect.h
nfs.h
nfsfh.h
nlpid.c
nlpid.h
ntp.h
oakley.h
ospf.h
ospf6.h
oui.c
oui.h
packetdat.awk
parsenfsfh.c
pcap_dump_ftell.c
pcap-missing.h
pf.h
pmap_prot.h
ppp.h
print-802_11.c
print-ah.c
print-aodv.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-cdp.c
print-chdlc.c
print-cip.c
print-cnfp.c
print-dccp.c
print-decnet.c
print-dhcp6.c
print-domain.c
print-dvmrp.c
print-eap.c
print-egp.c
print-enc.c
print-esp.c
print-eigrp.c
print-ether.c
print-fddi.c
print-fr.c
print-frag6.c
print-gre.c
print-hsrp.c
print-icmp.c
print-icmp6.c
print-igmp.c
print-igrp.c
print-ip.c
print-ip6.c
print-ip6opts.c
print-ipcomp.c
print-ipfc.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-lmp.c
print-lspping.c
print-lwres.c
print-mobile.c
print-mobility.c
print-mpls.c
print-msdp.c
print-netbios.c
print-nfs.c
print-ntp.c
print-null.c
print-ospf.c
print-ospf6.c
print-pflog.c
print-pgm.c
print-pim.c
print-ppp.c
print-pppoe.c
print-pptp.c
print-radius.c
print-raw.c
print-rip.c
print-ripng.c
print-rsvp.c
print-rt6.c
print-rx.c
print-sctp.c
print-sip.c
print-sl.c
print-sll.c
print-slow.c
print-smb.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-token.c
print-udp.c
print-vjc.c
print-vrrp.c
print-wb.c
print-zephyr.c
route6d.h
rpc_auth.h
rpc_msg.h
rx.h
sctpConstants.h
sctpHeader.h
send-ack.awk
setsignal.c
setsignal.h
slcompress.h
slip.h
sll.h
smb.h
smbutil.c
stime.awk
strcasecmp.c
tcp.h
tcpdump.1
tcpdump.c
tcpdump-stdinc.h
telnet.h
timed.h
token.h
udp.h
util.c
vfprintf.c
win32/Include/Arpa/tftp.h
win32/Include/errno.h
win32/Include/getopt.h
win32/Include/inetprivate.h
win32/Include/telnet.h
win32/Include/w32_fzs.h
win32/Include/Netinet/in_systm.h
win32/Include/Netinet/ip.h
win32/Src/getopt.c
win32/prj/GNUmakefile
win32/prj/WinDump.dsp
win32/prj/WinDump.dsw

View File

@ -0,0 +1,251 @@
@(#) $Header: /tcpdump/master/tcpdump/INSTALL,v 1.63.2.4 2005/09/20 06:05:35 guy Exp $ (LBL)
If you have not built libpcap, do so first. 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/
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
directory), run ./configure (a shell script). "configure" will
determine your system attributes and generate an appropriate Makefile
from Makefile.in. Now build tcpdump by running "make".
If everything builds ok, su and type "make install". This will install
tcpdump and the manual entry. By default, tcpdump is installed with
group execute permissions. The group used depends on your os. In
addition, BPF packet access is controlled by permissions to
/dev/bpf0. In any case, DO NOT give untrusted users the capability of
running tcpdump. Tcpdump can capture any traffic on your net,
including passwords.
Note that most systems ship tcpdump, but usually an older version.
Remember to remove or rename the installed binary when upgrading.
If you use Linux, this version of libpcap is known to compile and run
with 2.0.25 and more modern, and 2.2 and later, kernels. It is
guaranteed not to work with 1.X kernels.
If your system is not one which we have tested tcpdump on, you may have
to modify the configure script and Makefile.in. Please send us patches
for any modifications you need to make.
Please see "PLATFORMS" for notes about tested platforms.
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 - 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
chdlc.h - Cisco HDLC definitions
cpack.c - functions to extract packed data
cpack.h - declarations of functions to extract packed data
config.guess - autoconf support
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
machdep.h - machine dependent definitions
makemib - mib to header script
mib.h - mib definitions
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
pf.h - OpenBSD PF definitions
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
print-ah.c - IPSEC Authentication Header printer routines
print-aodv.c - AODV printer routines
print-arcnet.c - ARCNET printer routines
print-arp.c - Address Resolution Protocol printer routines
print-ascii.c - ASCII packet dump routines
print-atalk.c - AppleTalk printer routines
print-atm.c - ATM printer routines
print-bgp.c - Border Gateway Protocol printer routines
print-bootp.c - BOOTP and IPv4 DHCP printer routines
print-beep.c - BEEP printer routines
print-cdp.c - Cisco Discovery Protocol printer routines
print-chdlc.c - Cisco HDLC printer routines
print-cip.c - Classical-IP over ATM routines
print-cnfp.c - Cisco NetFlow printer routines
print-dccp.c - DCCP printer routines
print-decnet.c - DECnet printer routines
print-dhcp6.c - IPv6 DHCP printer routines
print-domain.c - Domain Name System printer routines
print-dvmrp.c - Distance Vector Multicast Routing Protocol printer routines
print-eap.c - EAP printer routines
print-enc.c - OpenBSD IPsec encapsulation BPF layer printer routines
print-egp.c - External Gateway Protocol printer routines
print-esp.c - IPSEC Encapsulating Security Payload printer routines
print-ether.c - Ethernet printer routines
print-fddi.c - Fiber Distributed Data Interface printer routines
print-fr.c - Frame Relay printer routines
print-frag6.c - IPv6 fragmentation header printer routines
print-gre.c - Generic Routing Encapsulation printer routines
print-hsrp.c - Cisco Hot Standby Router Protocol printer routines
print-icmp.c - Internet Control Message Protocol printer routines
print-icmp6.c - IPv6 Internet Control Message Protocol printer routines
print-igmp.c - Internet Group Management Protocol printer routines
print-igrp.c - Interior Gateway Routing Protocol printer routines
print-ip.c - IP printer routines
print-ip6.c - IPv6 printer routines
print-ip6opts.c - IPv6 header option printer routines
print-ipcomp.c - IP Payload Compression Protocol printer routines
print-ipx.c - IPX printer routines
print-isakmp.c - Internet Security Association and Key Management Protocol
print-isoclns.c - ISO CLNS, ESIS, and ISIS printer routines
print-krb.c - Kerberos printer routines
print-l2tp.c - Layer Two Tunneling Protocol printer routines
print-lane.c - ATM LANE printer routines
print-llc.c - IEEE 802.2 LLC printer routines
print-lspping.c - LSPPING printer routines
print-lwres.c - Lightweight Resolver protocol printer routines
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
print-ospf.c - Open Shortest Path First printer routines
print-ospf6.c - IPv6 Open Shortest Path First printer routines
print-pflog.c - OpenBSD packet filter log file printer routines
print-pgm.c - Pragmatic General Multicast printer routines
print-pim.c - Protocol Independent Multicast printer routines
print-ppp.c - Point to Point Protocol printer routines
print-pppoe.c - PPP-over-Ethernet printer routines
print-pptp.c - Point-to-Point Tunnelling Protocol printer routines
print-radius.c - Radius protocol printer routines
print-raw.c - Raw IP printer routines
print-rip.c - Routing Information Protocol printer routines
print-ripng.c - IPv6 Routing Information Protocol printer routines
print-rsvp.c - Resource reSerVation Protocol (RSVP) printer routines
print-rt6.c - IPv6 routing header printer routines
print-rx.c - AFS RX printer routines
print-sctp.c - Stream Control Transmission Protocol printer routines
print-sip.c - SIP printer routines
print-sl.c - Compressed Serial Line Internet Protocol printer routines
print-sll.c - Linux "cooked" capture printer routines
print-slow.c - IEEE "slow protocol" (802.3ad) printer routines
print-smb.c - SMB/CIFS printer routines
print-snmp.c - Simple Network Management Protocol printer routines
print-stp.c - IEEE 802.1d spanning tree protocol printer routines
print-sunatm.c - SunATM DLPI capture printer routines
print-sunrpc.c - Sun Remote Procedure Call printer routines
print-symantec.c - Symantec Enterprise Firewall printer routines
print-tcp.c - TCP printer routines
print-telnet.c - Telnet option printer routines
print-tftp.c - Trivial File Transfer Protocol printer routines
print-timed.c - BSD time daemon protocol printer routines
print-token.c - Token Ring printer routines
print-udp.c - UDP printer routines
print-vjc.c - PPP Van 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
strcasecmp.c - missing routine
tcp.h - TCP definitions
tcpdump.1 - manual entry
tcpdump.c - main program
telnet.h - Telnet definitions
timed.h - BSD time daemon protocol definitions
token.h - Token Ring definitions
udp.h - UDP definitions
util.c - utility routines
vfprintf.c - emulation routine
win32 - headers and routines for building on Win32 systems

View File

@ -0,0 +1,130 @@
SubDir HAIKU_TOP src bin network tcpdump ;
UseHeaders [ FDirName $(HAIKU_TOP) headers compatibility bsd ] : true ;
UseHeaders [ FDirName $(SUBDIR) ] : true ;
UseHeaders [ FDirName $(SUBDIR) libpcap ] : true ;
local defines = [ FDefines HAVE_CONFIG_H=1 _U_=\"__attribute__((unused))\" ] ;
SubDirCcFlags $(defines) ;
SubDirC++Flags $(defines) ;
BinCommand tcpdump :
addrtoname.c
cpack.c
gmpls.c
oui.c
gmt2local.c
ipproto.c
nlpid.c
l2vpn.c
machdep.c
parsenfsfh.c
print-802_11.c
print-ah.c
print-aodv.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-cdp.c
print-chdlc.c
print-cip.c
print-cnfp.c
print-dccp.c
print-decnet.c
#print-dhcp6.c
print-domain.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-fr.c
#print-frag6.c
print-gre.c
print-hsrp.c
print-icmp.c
#print-icmp6.c
print-igmp.c
print-igrp.c
print-ip.c
#print-ip6.c
#print-ip6opts.c
print-ipcomp.c
print-ipfc.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-lmp.c
print-lspping.c
print-lwres.c
print-mobile.c
print-mobility.c
print-mpls.c
print-msdp.c
print-netbios.c
print-nfs.c
print-ntp.c
print-null.c
print-ospf.c
#print-ospf6.c
print-pflog.c
print-pgm.c
print-pim.c
print-ppp.c
print-pppoe.c
print-pptp.c
print-radius.c
print-raw.c
print-rip.c
print-ripng.c
print-rsvp.c
#print-rt6.c
print-rx.c
print-sctp.c
print-sip.c
print-sl.c
print-sll.c
print-slow.c
print-smb.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-token.c
print-udp.c
print-vjc.c
print-vrrp.c
print-wb.c
print-zephyr.c
setsignal.c
smbutil.c
tcpdump.c
util.c
version.c
: libpcap.a $(NETWORK_LIBS)
;
SubInclude HAIKU_TOP src bin network tcpdump libpcap ;

View File

@ -0,0 +1,19 @@
License: BSD
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 names of the authors may not be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

View File

@ -0,0 +1,201 @@
# Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
# The Regents of the University of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that: (1) source code distributions
# retain the above copyright notice and this paragraph in its entirety, (2)
# distributions including binary code include the above copyright notice and
# this paragraph in its entirety in the documentation or other materials
# provided with the distribution, and (3) all advertising materials mentioning
# features or use of this software display the following acknowledgement:
# ``This product includes software developed by the University of California,
# Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
# the University nor the names of its contributors may be used to endorse
# or promote products derived from this software without specific prior
# written permission.
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.293.2.3 2005/09/20 06:05:36 guy Exp $ (LBL)
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
#
# Top level hierarchy
prefix = /usr/local
exec_prefix = ${prefix}
# Pathname of directory to install the binary
sbindir = ${exec_prefix}/sbin
# Pathname of directory to install the man page
mandir = ${prefix}/man
# VPATH
srcdir = .
#
# You shouldn't need to edit anything below here.
#
CC = gcc
PROG = tcpdump
CCOPT = -O2
INCLS = -I. -I$(srcdir)/missing
DEFS = -DHAVE_CONFIG_H -I$(srcdir)/missing -D_U_="__attribute__((unused))"
# Standard CFLAGS
CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
# Standard LDFLAGS
LDFLAGS =
# Standard LIBS
LIBS = -lpcap -lsocket
INSTALL = /bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
# 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.
.c.o:
@rm -f $@
$(CC) $(CFLAGS) -c $(srcdir)/$*.c
CSRC = addrtoname.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \
nlpid.c l2vpn.c machdep.c parsenfsfh.c \
print-802_11.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-cdp.c \
print-chdlc.c print-cip.c print-cnfp.c print-dccp.c print-decnet.c \
print-domain.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-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-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-lmp.c print-lspping.c \
print-lwres.c print-mobile.c print-mpls.c print-msdp.c \
print-nfs.c print-ntp.c print-null.c print-ospf.c \
print-pflog.c print-pgm.c print-pim.c print-ppp.c print-pppoe.c \
print-pptp.c print-radius.c print-raw.c print-rip.c \
print-rsvp.c print-rx.c print-sctp.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-token.c print-udp.c print-vjc.c print-vrrp.c \
print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c
LOCALSRC = print-smb.c smbutil.c
GENSRC = version.c
LIBOBJS = strsep$U.o datalinks$U.o dlnames$U.o pcap_dump_ftell$U.o inet_ntop$U.o inet_pton$U.o inet_aton$U.o bpf_dump$U.o
SRC = $(CSRC) $(GENSRC) $(LOCALSRC)
# 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)
HDR = addrtoname.h appletalk.h bootp.h cpack.h dccp.h decnet.h \
ethertype.h extract.h fddi.h gmt2local.h igrp.h interface.h \
ipx.h llc.h machdep.h mib.h nfsfh.h nfsv2.h ntp.h ospf.h \
setsignal.h \
gnuc.h ipsec_doi.h isakmp.h l2tp.h nameser.h \
netbios.h oakley.h ospf6.h pf.h ppp.h route6d.h
TAGHDR = \
/usr/include/arpa/tftp.h \
/usr/include/net/if_arp.h \
/usr/include/net/slip.h \
/usr/include/netinet/if_ether.h \
/usr/include/netinet/in.h \
/usr/include/netinet/ip_icmp.h \
/usr/include/netinet/tcp.h \
/usr/include/netinet/udp.h \
/usr/include/protocols/routed.h
TAGFILES = $(SRC) $(HDR) $(TAGHDR)
CLEANFILES = $(PROG) $(OBJ) $(GENSRC)
all: $(PROG)
$(PROG): $(OBJ)
@rm -f $@
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
datalinks.o: $(srcdir)/missing/datalinks.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
dlnames.o: $(srcdir)/missing/dlnames.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
getnameinfo.o: $(srcdir)/missing/getnameinfo.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c
getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/getaddrinfo.c
inet_pton.o: $(srcdir)/missing/inet_pton.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c
inet_ntop.o: $(srcdir)/missing/inet_ntop.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/inet_ntop.c
inet_aton.o: $(srcdir)/missing/inet_aton.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c
snprintf.o: $(srcdir)/missing/snprintf.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
strlcat.o: $(srcdir)/missing/strlcat.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
strlcpy.o: $(srcdir)/missing/strlcpy.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
strsep.o: $(srcdir)/missing/strsep.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
version.o: version.c
$(CC) $(CFLAGS) -c version.c
version.c: $(srcdir)/VERSION
@rm -f $@
sed -e 's/.*/char version[] = "&";/' $(srcdir)/VERSION > $@
install:
[ -d $(DESTDIR)$(sbindir) ] || \
(mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir))
$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
[ -d $(DESTDIR)$(mandir)/man1 ] || \
(mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
$(INSTALL_DATA) $(srcdir)/$(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
uninstall:
rm -f $(DESTDIR)$(sbindir)/$(PROG)
rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
lint: $(GENSRC)
lint -hbxn $(SRC) | \
grep -v 'struct/union .* never defined' | \
grep -v 'possible pointer alignment problem'
clean:
rm -f $(CLEANFILES)
distclean:
rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
config.h gnuc.h os-proto.h stamp-h stamp-h.in
tags: $(TAGFILES)
ctags -wtd $(TAGFILES)
tar:
@cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
list="" ; tar="tar chf" ; \
for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
echo \
"rm -f ../$$name; ln -s $$dir ../$$name" ; \
rm -f ../$$name; ln -s $$dir ../$$name ; \
echo \
"(cd .. ; $$tar - [lots of files]) | compress > /tmp/$$name.tar.Z" ; \
(cd .. ; $$tar - $$list) | compress > /tmp/$$name.tar.Z ; \
echo \
"rm -f ../$$name" ; \
rm -f ../$$name
depend: $(GENSRC)
${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)

View File

@ -0,0 +1,22 @@
#
# Auto-regenerate configure script or Makefile when things change.
# From autoconf.info . Works best with GNU Make.
#
${srcdir}/configure: configure.in
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
cd ${srcdir} && autoheader
echo timestamp > ${srcdir}/stamp-h.in
config.h: stamp-h
stamp-h: ${srcdir}/config.h.in config.status
./config.status
Makefile: Makefile.in config.status
./config.status
config.status: ${srcdir}/configure
./config.status --recheck

View File

@ -0,0 +1,201 @@
# Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
# The Regents of the University of California. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that: (1) source code distributions
# retain the above copyright notice and this paragraph in its entirety, (2)
# distributions including binary code include the above copyright notice and
# this paragraph in its entirety in the documentation or other materials
# provided with the distribution, and (3) all advertising materials mentioning
# features or use of this software display the following acknowledgement:
# ``This product includes software developed by the University of California,
# Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
# the University nor the names of its contributors may be used to endorse
# or promote products derived from this software without specific prior
# written permission.
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.293.2.3 2005/09/20 06:05:36 guy Exp $ (LBL)
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
#
# Top level hierarchy
prefix = @prefix@
exec_prefix = @exec_prefix@
# Pathname of directory to install the binary
sbindir = @sbindir@
# Pathname of directory to install the man page
mandir = @mandir@
# VPATH
srcdir = @srcdir@
VPATH = @srcdir@
#
# You shouldn't need to edit anything below here.
#
CC = @CC@
PROG = tcpdump
CCOPT = @V_CCOPT@
INCLS = -I. @V_INCLS@
DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@
# Standard CFLAGS
CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
# Standard LDFLAGS
LDFLAGS = @LDFLAGS@
# Standard LIBS
LIBS = @LIBS@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
# 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.
.c.o:
@rm -f $@
$(CC) $(CFLAGS) -c $(srcdir)/$*.c
CSRC = addrtoname.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \
nlpid.c l2vpn.c machdep.c parsenfsfh.c \
print-802_11.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-cdp.c \
print-chdlc.c print-cip.c print-cnfp.c print-dccp.c print-decnet.c \
print-domain.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-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-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-lmp.c print-lspping.c \
print-lwres.c print-mobile.c print-mpls.c print-msdp.c \
print-nfs.c print-ntp.c print-null.c print-ospf.c \
print-pflog.c print-pgm.c print-pim.c print-ppp.c print-pppoe.c \
print-pptp.c print-radius.c print-raw.c print-rip.c \
print-rsvp.c print-rx.c print-sctp.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-token.c print-udp.c print-vjc.c print-vrrp.c \
print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c
LOCALSRC = @LOCALSRC@
GENSRC = version.c
LIBOBJS = @LIBOBJS@
SRC = $(CSRC) $(GENSRC) $(LOCALSRC)
# 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)
HDR = addrtoname.h appletalk.h bootp.h cpack.h dccp.h decnet.h \
ethertype.h extract.h fddi.h gmt2local.h igrp.h interface.h \
ipx.h llc.h machdep.h mib.h nfsfh.h nfsv2.h ntp.h ospf.h \
setsignal.h \
gnuc.h ipsec_doi.h isakmp.h l2tp.h nameser.h \
netbios.h oakley.h ospf6.h pf.h ppp.h route6d.h
TAGHDR = \
/usr/include/arpa/tftp.h \
/usr/include/net/if_arp.h \
/usr/include/net/slip.h \
/usr/include/netinet/if_ether.h \
/usr/include/netinet/in.h \
/usr/include/netinet/ip_icmp.h \
/usr/include/netinet/tcp.h \
/usr/include/netinet/udp.h \
/usr/include/protocols/routed.h
TAGFILES = $(SRC) $(HDR) $(TAGHDR)
CLEANFILES = $(PROG) $(OBJ) $(GENSRC)
all: $(PROG)
$(PROG): $(OBJ) @V_PCAPDEP@
@rm -f $@
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
datalinks.o: $(srcdir)/missing/datalinks.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
dlnames.o: $(srcdir)/missing/dlnames.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
getnameinfo.o: $(srcdir)/missing/getnameinfo.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c
getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/getaddrinfo.c
inet_pton.o: $(srcdir)/missing/inet_pton.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c
inet_ntop.o: $(srcdir)/missing/inet_ntop.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/inet_ntop.c
inet_aton.o: $(srcdir)/missing/inet_aton.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c
snprintf.o: $(srcdir)/missing/snprintf.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
strlcat.o: $(srcdir)/missing/strlcat.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
strlcpy.o: $(srcdir)/missing/strlcpy.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
strsep.o: $(srcdir)/missing/strsep.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
version.o: version.c
$(CC) $(CFLAGS) -c version.c
version.c: $(srcdir)/VERSION
@rm -f $@
sed -e 's/.*/char version[] = "&";/' $(srcdir)/VERSION > $@
install:
[ -d $(DESTDIR)$(sbindir) ] || \
(mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir))
$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
[ -d $(DESTDIR)$(mandir)/man1 ] || \
(mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
$(INSTALL_DATA) $(srcdir)/$(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
uninstall:
rm -f $(DESTDIR)$(sbindir)/$(PROG)
rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
lint: $(GENSRC)
lint -hbxn $(SRC) | \
grep -v 'struct/union .* never defined' | \
grep -v 'possible pointer alignment problem'
clean:
rm -f $(CLEANFILES)
distclean:
rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
config.h gnuc.h os-proto.h stamp-h stamp-h.in
tags: $(TAGFILES)
ctags -wtd $(TAGFILES)
tar:
@cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
list="" ; tar="tar chf" ; \
for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
echo \
"rm -f ../$$name; ln -s $$dir ../$$name" ; \
rm -f ../$$name; ln -s $$dir ../$$name ; \
echo \
"(cd .. ; $$tar - [lots of files]) | compress > /tmp/$$name.tar.Z" ; \
(cd .. ; $$tar - $$list) | compress > /tmp/$$name.tar.Z ; \
echo \
"rm -f ../$$name" ; \
rm -f ../$$name
depend: $(GENSRC)
${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)

View File

@ -0,0 +1,9 @@
== Tested platforms ==
NetBSD 1.5/i386 (mcr - 2002/1/1)
Debian Linux (woody/i386) (mcr - 2002/1/1)
---
RedHat Linux 6.1/i386 (assar)
FreeBSD 2.2.8/i386 (itojun)

View File

@ -0,0 +1,234 @@
@(#) $Header: /tcpdump/master/tcpdump/README,v 1.65 2004/10/12 02:01:59 guy Exp $ (LBL)
TCPDUMP 3.9
Now maintained by "The Tcpdump Group"
See www.tcpdump.org
Please send inquiries/comments/reports to tcpdump-workers@tcpdump.org
Anonymous CVS is available via:
cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master login
(password "anoncvs")
cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout tcpdump
Version 3.9 of TCPDUMP can be retrived with the CVS tag "tcpdump_3_9rel1":
cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_3_9rel1 tcpdump
Please send patches against the master copy to patches@tcpdump.org.
formerly from Lawrence Berkeley National Laboratory
Network Research Group <tcpdump@ee.lbl.gov>
ftp://ftp.ee.lbl.gov/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
development is performed at tcpdump.org, http://www.tcpdump.org/
Tcpdump uses libpcap, a system-independent interface for user-level
packet capture. Before building tcpdump, you must first retrieve and
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
file.
The program is loosely based on SMI's "etherfind" although none of the
etherfind code remains. It was originally written by Van Jacobson as
part of an ongoing research project to investigate and improve tcp and
internet gateway performance. The parts of the program originally
taken from Sun's etherfind were later re-written by Steven McCanne of
LBL. To insure that there would be no vestige of proprietary code in
tcpdump, Steve wrote these pieces from the specification given by the
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.
Richard Stevens gives an excellent treatment of the Internet protocols
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/
Another tool that tcpdump users might find useful is tcpslice:
ftp://ftp.ee.lbl.gov/tcpslice.tar.Z
It is a program that can be used to extract portions of tcpdump binary
trace files. See the above distribution for further details and
documentation.
Problems, bugs, questions, desirable enhancements, etc. should be sent
to the address "tcpdump-workers@tcpdump.org". Bugs, support requests,
and feature requests may also be submitted on the SourceForge site for
tcpdump at
http://sourceforge.net/projects/tcpdump/
Source code contributions, etc. should be sent to the email address
"patches@tcpdump.org", or submitted as patches on the SourceForge site
for tcpdump.
Current versions can be found at www.tcpdump.org, or the SourceForge
site for tcpdump.
- The TCPdump team
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:
send-ack.awk
Simplifies the tcpdump trace for an ftp (or other unidirectional
tcp transfer). Since we assume that one host only sends and
the other only acks, all address information is left off and
we just note if the packet is a "send" or an "ack".
There is one output line per line of the original trace.
Field 1 is the packet time in decimal seconds, relative
to the start of the conversation. Field 2 is delta-time
from last packet. Field 3 is packet type/direction.
"Send" means data going from sender to receiver, "ack"
means an ack going from the receiver to the sender. A
preceding "*" indicates that the data is a retransmission.
A preceding "-" indicates a hole in the sequence space
(i.e., missing packet(s)), a "#" means an odd-size (not max
seg size) packet. Field 4 has the packet flags
(same format as raw trace). Field 5 is the sequence
number (start seq. num for sender, next expected seq number
for acks). The number in parens following an ack is
the delta-time from the first send of the packet to the
ack. A number in parens following a send is the
delta-time from the first send of the packet to the
current send (on duplicate packets only). Duplicate
sends or acks have a number in square brackets showing
the number of duplicates so far.
Here is a short sample from near the start of an ftp:
3.00 0.20 send . 512
3.20 0.20 ack . 1024 (0.20)
3.20 0.00 send P 1024
3.40 0.20 ack . 1536 (0.20)
3.80 0.40 * send . 0 (3.80) [2]
3.82 0.02 * ack . 1536 (0.62) [2]
Three seconds into the conversation, bytes 512 through 1023
were sent. 200ms later they were acked. Shortly thereafter
bytes 1024-1535 were sent and again acked after 200ms.
Then, for no apparent reason, 0-511 is retransmitted, 3.8
seconds after its initial send (the round trip time for this
ftp was 1sec, +-500ms). Since the receiver is expecting
1536, 1536 is re-acked when 0 arrives.
packetdat.awk
Computes chunk summary data for an ftp (or similar
unidirectional tcp transfer). [A "chunk" refers to
a chunk of the sequence space -- essentially the packet
sequence number divided by the max segment size.]
A summary line is printed showing the number of chunks,
the number of packets it took to send that many chunks
(if there are no lost or duplicated packets, the number
of packets should equal the number of chunks) and the
number of acks.
Following the summary line is one line of information
per chunk. The line contains eight fields:
1 - the chunk number
2 - the start sequence number for this chunk
3 - time of first send
4 - time of last send
5 - time of first ack
6 - time of last ack
7 - number of times chunk was sent
8 - number of times chunk was acked
(all times are in decimal seconds, relative to the start
of the conversation.)
As an example, here is the first part of the output for
an ftp trace:
# 134 chunks. 536 packets sent. 508 acks.
1 1 0.00 5.80 0.20 0.20 4 1
2 513 0.28 6.20 0.40 0.40 4 1
3 1025 1.16 6.32 1.20 1.20 4 1
4 1561 1.86 15.00 2.00 2.00 6 1
5 2049 2.16 15.44 2.20 2.20 5 1
6 2585 2.64 16.44 2.80 2.80 5 1
7 3073 3.00 16.66 3.20 3.20 4 1
8 3609 3.20 17.24 3.40 5.82 4 11
9 4097 6.02 6.58 6.20 6.80 2 5
This says that 134 chunks were transferred (about 70K
since the average packet size was 512 bytes). It took
536 packets to transfer the data (i.e., on the average
each chunk was transmitted four times). Looking at,
say, chunk 4, we see it represents the 512 bytes of
sequence space from 1561 to 2048. It was first sent
1.86 seconds into the conversation. It was last
sent 15 seconds into the conversation and was sent
a total of 6 times (i.e., it was retransmitted every
2 seconds on the average). It was acked once, 140ms
after it first arrived.
stime.awk
atime.awk
Output one line per send or ack, respectively, in the form
<time> <seq. number>
where <time> is the time in seconds since the start of the
transfer and <seq. number> is the sequence number being sent
or acked. I typically plot this data looking for suspicious
patterns.
The problem I was looking at was the bulk-data-transfer
throughput of medium delay network paths (1-6 sec. round trip
time) under typical DARPA Internet conditions. The trace of the
ftp transfer of a large file was used as the raw data source.
The method was:
- On a local host (but not the Sun running tcpdump), connect to
the remote ftp.
- On the monitor Sun, start the trace going. E.g.,
tcpdump host local-host and remote-host and port ftp-data >tracefile
- On local, do either a get or put of a large file (~500KB),
preferably to the null device (to minimize effects like
closing the receive window while waiting for a disk write).
- When transfer is finished, stop tcpdump. Use awk to make up
two files of summary data (maxsize is the maximum packet size,
tracedata is the file of tcpdump tracedata):
awk -f send-ack.awk packetsize=avgsize tracedata >sa
awk -f packetdat.awk packetsize=avgsize tracedata >pd
- While the summary data files are printing, take a look at
how the transfer behaved:
awk -f stime.awk tracedata | xgraph
(90% of what you learn seems to happen in this step).
- Do all of the above steps several times, both directions,
at different times of day, with different protocol
implementations on the other end.
- Using one of the Unix data analysis packages (in my case,
S and Gary Perlman's Unix|Stat), spend a few months staring
at the data.
- Change something in the local protocol implementation and
redo the steps above.
- 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

@ -0,0 +1,24 @@
To build tcpdump under Windows, you need:
- version 6 (or higher) of Microsoft Visual Studio or the Cygnus gnu
C compiler.
- The November 2001 (or later) edition of Microsoft Platform
Software Development Kit (SDK), that contains some necessary includes
for IPv6 support. You can download it from http://www.microsoft.com/sdk
- the WinPcap source code, that includes libpcap for win32. Download it
from http://winpcap.polito.it or download libpcap sources from
http://www.tcpdump.org and follow the instructions in the README.Win32
file.
First, extract tcpdump and WinPcap in the same folder, and build WinPcap.
The Visual Studio project and the cygwin makefile are in the Win32\prj
folder.
From Visual Studio, open windump.dsw and build the program. The release
version of the WinDump.exe executable file will be created in the
windump\win32\prj\release directory . The debug version will be generated
in windump\win32\prj\debug.
From cygnus, go to windump\win32\prj\ and type "make". WinDump.exe will be
created in the same directory.

View File

@ -0,0 +1,6 @@
1. update credits
2. review "FILES"
3. search for version info
4. get PLATFORMS filled in
5. update CHANGES file
6. do same for libpcap

View File

@ -0,0 +1 @@
3.9.5

View File

@ -0,0 +1,136 @@
/* "generated automatically" means DO NOT MAKE CHANGES TO config.h.in --
* make them to acconfig.h and rerun autoheader */
@TOP@
/* Define if you have SSLeay 0.9.0b with the buggy cast128. */
#undef HAVE_BUGGY_CAST128
/* Define if you enable IPv6 support */
#undef INET6
/* Define if you enable support for the libsmi. */
#undef LIBSMI
/* Define if you have the <smi.h> header file. */
#undef HAVE_SMI_H
/* define if you have struct __res_state_ext */
#undef HAVE_RES_STATE_EXT
/* define if your struct __res_state has the nsort member */
#undef HAVE_NEW_RES_STATE
/*
* define if struct ether_header.ether_dhost is a struct with ether_addr_octet
*/
#undef ETHER_HEADER_HAS_EA
/* define if struct ether_arp contains arp_xsha */
#undef ETHER_ARP_HAS_X
/* define if you have the addrinfo function. */
#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 IN6ADDRSZ is defined (XXX not used!) */
#undef HAVE_IN6ADDRSZ
/* define if INADDRSZ is defined (XXX not used!) */
#undef HAVE_INADDRSZ
/* define if this is a development version, to use additional prototypes. */
#undef HAVE_OS_PROTO_H
/* define if <unistd.h> defines __P() */
#undef HAVE_PORTABLE_PROTOTYPE
/* define if RES_USE_INET6 is defined */
#undef HAVE_RES_USE_INET6
/* define if struct sockaddr has the sa_len member */
#undef HAVE_SOCKADDR_SA_LEN
/* 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
/* define if unaligned memory accesses fail */
#undef LBL_ALIGN
/* The successful return value from signal (?)XXX */
#undef RETSIGVAL
/* Define this on IRIX */
#undef _BSD_SIGNALS
/* For HP/UX ANSI compiler? */
#undef _HPUX_SOURCE
/* AIX hack. */
#undef _SUN
/* 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
/* Long story short: aclocal.m4 depends on autoconf 2.13
* implementation details wrt "const"; newer versions
* have different implementation details so for now we
* put "const" here. This may cause duplicate definitions
* in config.h but that should be OK since they're the same.
*/
#undef const
/* 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

1256
src/bin/network/tcpdump/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 1990, 1992, 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code distributions
* retain the above copyright notice and this paragraph in its entirety, (2)
* distributions including binary code include the above copyright notice and
* this paragraph in its entirety in the documentation or other materials
* provided with the distribution, and (3) all advertising materials mentioning
* features or use of this software display the following acknowledgement:
* ``This product includes software developed by the University of California,
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
* the University nor the names of its contributors may be used to endorse
* or promote products derived from this software without specific prior
* written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* @(#) $Header: /tcpdump/master/tcpdump/addrtoname.h,v 1.18 2001/09/17 21:57:51 fenner Exp $ (LBL)
*/
/* Name to address translation routines. */
extern const char *linkaddr_string(const u_char *, const unsigned int);
extern const char *etheraddr_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 *);
#ifdef INET6
extern const char *getname6(const u_char *);
#endif
extern const char *intoa(u_int32_t);
extern void init_addrtoname(u_int32_t, u_int32_t);
extern struct hnamemem *newhnamemem(void);
#ifdef INET6
extern struct h6namemem *newh6namemem(void);
#endif
#define ipaddr_string(p) getname((const u_char *)(p))
#ifdef INET6
#define ip6addr_string(p) getname6((const u_char *)(p))
#endif

View File

@ -0,0 +1,57 @@
/* $NetBSD: ah.h,v 1.12 2000/07/23 05:23:04 itojun Exp $ */
/* $KAME: ah.h,v 1.12 2000/07/20 17:41:01 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.
*/
/*
* RFC1826/2402 authentication header.
*/
#ifndef _NETINET6_AH_H_
#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 */
/* 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 */
/* variable size, 32bit bound*/ /* Authentication data */
};
#endif /*_NETINET6_AH_H_*/

View File

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

@ -0,0 +1,168 @@
/*
* Copyright (c) 1988, 1989, 1990, 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.
*
* 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;
};
#define lapShortDDP 1 /* short DDP type */
#define lapDDP 2 /* DDP type */
#define lapKLAP 'K' /* Kinetics KLAP type */
/* 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;
};
struct atShortDDP {
u_int16_t length;
u_int8_t dstSkt;
u_int8_t srcSkt;
u_int8_t type;
};
#define ddpMaxWKS 0x7F
#define ddpMaxData 586
#define ddpLengthMask 0x3FF
#define ddpHopShift 10
#define ddpSize 13 /* size of DDP header (avoid struct padding) */
#define ddpSSize 5
#define ddpWKS 128 /* boundary of DDP well known sockets */
#define ddpRTMP 1 /* RTMP type */
#define ddpRTMPrequest 5 /* RTMP request type */
#define ddpNBP 2 /* NBP type */
#define ddpATP 3 /* ATP type */
#define ddpECHO 4 /* ECHO type */
#define ddpIP 22 /* IP type */
#define ddpARP 23 /* ARP type */
#define ddpEIGRP 88 /* EIGRP over Appletalk */
#define ddpKLAP 0x4b /* Kinetics KLAP type */
/* AppleTalk Transaction Protocol */
struct atATP {
u_int8_t control;
u_int8_t bitmap;
u_int16_t transID;
int32_t userData;
};
#define atpReqCode 0x40
#define atpRspCode 0x80
#define atpRelCode 0xC0
#define atpXO 0x20
#define atpEOM 0x10
#define atpSTS 0x08
#define atpFlagMask 0x3F
#define atpControlMask 0xF8
#define atpMaxNum 8
#define atpMaxData 578
/* AppleTalk Echo Protocol */
struct atEcho {
u_int8_t echoFunction;
u_int8_t *echoData;
};
#define echoSkt 4 /* the echoer socket */
#define echoSize 1 /* size of echo header */
#define echoRequest 1 /* echo request */
#define echoReply 2 /* echo request */
/* Name Binding Protocol */
struct atNBP {
u_int8_t control;
u_int8_t id;
};
struct atNBPtuple {
u_int16_t net;
u_int8_t node;
u_int8_t skt;
u_int8_t enumerator;
};
#define nbpBrRq 0x10
#define nbpLkUp 0x20
#define nbpLkUpReply 0x30
#define nbpNIS 2
#define nbpTupleMax 15
#define nbpHeaderSize 2
#define nbpTupleSize 5
#define nbpSkt 2 /* NIS */
/* Routing Table Maint. Protocol */
#define rtmpSkt 1 /* number of RTMP socket */
#define rtmpSize 4 /* minimum size */
#define rtmpTupleSize 3
/* Zone Information Protocol */
struct zipHeader {
u_int8_t command;
u_int8_t netcount;
};
#define zipHeaderSize 2
#define zipQuery 1
#define zipReply 2
#define zipTakedown 3
#define zipBringup 4
#define ddpZIP 6
#define zipSkt 6
#define GetMyZone 7
#define GetZoneList 8
/*
* UDP port range used for ddp-in-udp encapsulation is 16512-16639
* for client sockets (128-255) and 200-327 for server sockets
* (0-127). We also try to recognize the pre-April 88 server
* socket range of 768-895.
*/
#define atalk_port(p) \
(((unsigned)((p) - 16512) < 128) || \
((unsigned)((p) - 200) < 128) || \
((unsigned)((p) - 768) < 128))

View File

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

View File

@ -0,0 +1,18 @@
$6 ~ /^ack/ && $5 !~ /[SFR]/ {
# given a tcpdump ftp trace, output one line for each ack
# in the form
# <ack time> <seq no>
# where <ack time> is the time packet was acked (in seconds with
# zero at time of first packet) and <seq no> is the tcp sequence
# number of the ack divided by 1024 (i.e., Kbytes acked).
#
# convert time to seconds
n = split ($1,t,":")
tim = t[1]*3600 + t[2]*60 + t[3]
if (! tzero) {
tzero = tim
OFS = "\t"
}
# get packet sequence number
printf "%7.2f\t%g\n", tim-tzero, $7/1024
}

View File

@ -0,0 +1,32 @@
/*
* Copyright (c) 2002 Guy Harris.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code
* distributions retain the above copyright notice and this paragraph
* in its entirety, and (2) distributions including binary code include
* the above copyright notice and this paragraph in its entirety in
* the documentation or other materials provided with the distribution.
* The name of Guy Harris may not be used to endorse or promote products
* derived from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* @(#) $Header: /tcpdump/master/tcpdump/atm.h,v 1.1.4.1 2005/06/20 07:45:05 hannes Exp $
*/
/*
* Traffic types for ATM.
*/
#define ATM_UNKNOWN 0 /* Unknown */
#define ATM_LANE 1 /* LANE */
#define ATM_LLC 2 /* LLC encapsulation */
/*
* some OAM cell captures (most notably Juniper's)
* do not deliver a heading HEC byte
*/
#define ATM_OAM_NOHEC 0
#define ATM_OAM_HEC 1

View File

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

View File

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

View File

@ -0,0 +1,220 @@
/* @(#) $Header: /tcpdump/master/tcpdump/bootp.h,v 1.15 2003/07/01 19:16:06 guy Exp $ (LBL) */
/*
* Bootstrap Protocol (BOOTP). RFC951 and RFC1048.
*
* This file specifies the "implementation-independent" BOOTP protocol
* information which is common to both client and server.
*
* Copyright 1988 by Carnegie Mellon.
*
* Permission to use, copy, modify, and distribute this program for any
* purpose and without fee is hereby granted, provided that this copyright
* and permission notice appear on all copies and supporting documentation,
* the name of Carnegie Mellon not be used in advertising or publicity
* pertaining to distribution of the program without specific prior
* permission, and notice be given in supporting documentation that copying
* and distribution is by permission of Carnegie Mellon and Stanford
* University. Carnegie Mellon makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*/
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[] 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 */
};
/*
* UDP port numbers, server and client.
*/
#define IPPORT_BOOTPS 67
#define IPPORT_BOOTPC 68
#define BOOTPREPLY 2
#define BOOTPREQUEST 1
/*
* Vendor magic cookie (v_magic) for CMU
*/
#define VM_CMU "CMU"
/*
* Vendor magic cookie (v_magic) for RFC1048
*/
#define VM_RFC1048 { 99, 130, 83, 99 }
/*
* RFC1048 tag values used to specify what information is being supplied in
* 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)
/* 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)
/* 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)
/* 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)
/* 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)
/* RFC 2242 */
#define TAG_NDS_IPDOMAIN ((u_int8_t) 62)
#define TAG_NDS_IPINFO ((u_int8_t) 63)
/* RFC 2485 */
#define TAG_OPEN_GROUP_UAP ((u_int8_t) 98)
/* RFC 2563 */
#define TAG_DISABLE_AUTOCONF ((u_int8_t) 116)
/* RFC 2610 */
#define TAG_SLP_DA ((u_int8_t) 78)
#define TAG_SLP_SCOPE ((u_int8_t) 79)
/* RFC 2937 */
#define TAG_NS_SEARCH ((u_int8_t) 117)
/* RFC 3011 */
#define TAG_IP4_SUBNET_SELECT ((u_int8_t) 118)
/* 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)
/* DHCP Message types (values for TAG_DHCP_MESSAGE option) */
#define DHCPDISCOVER 1
#define DHCPOFFER 2
#define DHCPREQUEST 3
#define DHCPDECLINE 4
#define DHCPACK 5
#define DHCPNAK 6
#define DHCPRELEASE 7
#define DHCPINFORM 8
/*
* "vendor" data permitted for CMU bootp clients.
*/
struct cmu_vend {
u_int8_t v_magic[4]; /* magic number */
u_int32_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 */
};
/* v_flags values */
#define VF_SMASK 1 /* Subnet mask field contains valid data */

View File

@ -0,0 +1,66 @@
/*
* 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.
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/bpf_dump.c,v 1.16 2003/11/16 09:36:08 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include <pcap.h>
#include <stdio.h>
#include "interface.h"
void
bpf_dump(struct bpf_program *p, int option)
{
struct bpf_insn *insn;
int i;
int n = p->bf_len;
insn = p->bf_insns;
if (option > 2) {
printf("%d\n", n);
for (i = 0; i < n; ++insn, ++i) {
printf("%u %u %u %u\n", insn->code,
insn->jt, insn->jf, insn->k);
}
return ;
}
if (option > 1) {
for (i = 0; i < n; ++insn, ++i)
printf("{ 0x%x, %d, %d, 0x%08x },\n",
insn->code, insn->jt, insn->jf, insn->k);
return;
}
for (i = 0; i < n; ++insn, ++i) {
#ifdef BDEBUG
extern int bids[];
printf(bids[i] > 0 ? "[%02d]" : " -- ", bids[i] - 1);
#endif
puts(bpf_image(insn, i));
}
}

View File

@ -0,0 +1,27 @@
/* @(#) $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.
*
* 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.
*/
#define CHDLC_HDRLEN 4
#define CHDLC_UNICAST 0x0f
#define CHDLC_BCAST 0x8f
#define CHDLC_TYPE_SLARP 0x8035
#define CHDLC_TYPE_CDP 0x2000

1429
src/bin/network/tcpdump/config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,348 @@
/* config.h. Generated by configure. */
/* 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 have SSLeay 0.9.0b with the buggy cast128. */
/* #undef HAVE_BUGGY_CAST128 */
/* Define if you enable IPv6 support */
/* #undef INET6 */
/* Define if you enable support for the libsmi. */
/* #undef LIBSMI */
/* Define if you have the <smi.h> header file. */
/* #undef HAVE_SMI_H */
/* define if you have struct __res_state_ext */
/* #undef HAVE_RES_STATE_EXT */
/* define if your struct __res_state has the nsort member */
/* #undef HAVE_NEW_RES_STATE */
/*
* define if struct ether_header.ether_dhost is a struct with ether_addr_octet
*/
/* #undef ETHER_HEADER_HAS_EA */
/* define if struct ether_arp contains arp_xsha */
/* #undef ETHER_ARP_HAS_X */
/* define if you have the addrinfo function. */
#define HAVE_ADDRINFO 1
/* define if you need to include missing/addrinfoh.h. */
/* #undef NEED_ADDRINFO_H */
/* define ifyou have the h_errno variable. */
#define HAVE_H_ERRNO 1
/* define if IN6ADDRSZ is defined (XXX not used!) */
#define HAVE_IN6ADDRSZ 1
/* define if INADDRSZ is defined (XXX not used!) */
#define HAVE_INADDRSZ 1
/* define if this is a development version, to use additional prototypes. */
/* #undef HAVE_OS_PROTO_H */
/* define if <unistd.h> defines __P() */
/* #undef HAVE_PORTABLE_PROTOTYPE */
/* define if RES_USE_INET6 is defined */
/* #undef HAVE_RES_USE_INET6 */
/* define if struct sockaddr has the sa_len member */
#define HAVE_SOCKADDR_SA_LEN 1
/* 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 */
#define HAVE_PCAP_VERSION 1
/* 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 */
/* define if unaligned memory accesses fail */
/* #undef LBL_ALIGN */
/* The successful return value from signal (?)XXX */
#define RETSIGVAL
/* Define this on IRIX */
/* #undef _BSD_SIGNALS */
/* For HP/UX ANSI compiler? */
/* #undef _HPUX_SOURCE */
/* AIX hack. */
/* #undef _SUN */
/* Workaround for missing 64-bit formats */
#define PRId64 "lld"
#define PRIo64 "llo"
#define PRIx64 "llx"
#define PRIu64 "llu"
/* Whether or not to include the possibly-buggy SMB printer */
#define TCPDUMP_DO_SMB 1
/* Long story short: aclocal.m4 depends on autoconf 2.13
* implementation details wrt "const"; newer versions
* have different implementation details so for now we
* put "const" here. This may cause duplicate definitions
* in config.h but that should be OK since they're the same.
*/
/* #undef const */
/* 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. */
#define HAVE_ALARM 1
/* Define to 1 if you have the `bpf_dump' function. */
/* #undef HAVE_BPF_DUMP */
/* Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
don't. */
/* #undef HAVE_DECL_ETHER_NTOHOST */
/* Define to 1 if you have the `ether_ntohost' function. */
/* #undef HAVE_ETHER_NTOHOST */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `getaddrinfo' function. */
/* #undef HAVE_GETADDRINFO */
/* Define to 1 if you have the `getnameinfo' function. */
/* #undef HAVE_GETNAMEINFO */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `crypto' library (-lcrypto). */
/* #undef HAVE_LIBCRYPTO */
/* 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. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <netdnet/dnetdb.h> header file. */
/* #undef HAVE_NETDNET_DNETDB_H */
/* Define to 1 if you have the <netinet/ether.h> header file. */
/* #undef HAVE_NETINET_ETHER_H */
/* Define to 1 if you have the <netinet/if_ether.h> header file. */
/* #undef HAVE_NETINET_IF_ETHER_H */
/* Define to 1 if you have the <openssl/evp.h> header file. */
/* #undef HAVE_OPENSSL_EVP_H */
/* Define to 1 if you have the `pcap_breakloop' function. */
/* #undef HAVE_PCAP_BREAKLOOP */
/* Define to 1 if you have the `pcap_dump_flush' function. */
/* #undef HAVE_PCAP_DUMP_FLUSH */
/* Define to 1 if you have the `pcap_findalldevs' function. */
/* #undef HAVE_PCAP_FINDALLDEVS */
/* Define to 1 if the system has the type `pcap_if_t'. */
/* #undef HAVE_PCAP_IF_T */
/* Define to 1 if you have the `pcap_lib_version' function. */
/* #undef HAVE_PCAP_LIB_VERSION */
/* Define to 1 if you have the `pfopen' function. */
/* #undef HAVE_PFOPEN */
/* Define to 1 if you have the <rpc/rpcent.h> header file. */
/* #undef HAVE_RPC_RPCENT_H */
/* Define to 1 if you have the `setlinebuf' function. */
#define HAVE_SETLINEBUF 1
/* Define to 1 if you have the `sigaction' function. */
#define HAVE_SIGACTION 1
/* 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. */
#define HAVE_SNPRINTF 1
/* Define to 1 if you have the <stdint.h> header file. */
/* #undef HAVE_STDINT_H */
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strcasecmp' function. */
#define HAVE_STRCASECMP 1
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strftime' function. */
#define HAVE_STRFTIME 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strlcat' function. */
#define HAVE_STRLCAT 1
/* Define to 1 if you have the `strlcpy' function. */
#define HAVE_STRLCPY 1
/* Define to 1 if you have the `strsep' function. */
/* #undef HAVE_STRSEP */
/* 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 1 */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vfprintf' function. */
#define HAVE_VFPRINTF 1
/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1
/* define if your compiler has __attribute__ */
#define HAVE___ATTRIBUTE__ 1
/* Define to 1 if netinet/ether.h declares `ether_ntohost' */
/* #undef NETINET_ETHER_H_DECLARES_ETHER_NTOHOST */
/* Define to 1 if netinet/if_ether.h declares `ether_ntohost' */
/* #undef NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST */
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* The size of a `char', as computed by sizeof. */
#define SIZEOF_CHAR 1
/* The size of a `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of a `long', as computed by sizeof. */
#define SIZEOF_LONG 4
/* The size of a `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8
/* The size of a `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define as token for inline if inlining supported */
#define inline inline
/* Define to `short' if int16_t not defined. */
/* #undef int16_t */
/* Define to `int' if int32_t not defined. */
/* #undef int32_t */
/* Define to `long long' if int64_t not defined. */
/* #undef int64_t */
/* Define to `signed char' if int8_t not defined. */
/* #undef int8_t */
/* Define to `unsigned short' if u_int16_t not defined. */
/* #undef u_int16_t */
/* Define to `unsigned int' if u_int32_t not defined. */
/* #undef u_int32_t */
/* Define to `unsigned long long' if u_int64_t not defined. */
/* #undef u_int64_t */
/* Define to `unsigned char' if u_int8_t not defined. */
/* #undef u_int8_t */

View File

@ -0,0 +1,347 @@
/* 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 have SSLeay 0.9.0b with the buggy cast128. */
#undef HAVE_BUGGY_CAST128
/* Define if you enable IPv6 support */
#undef INET6
/* Define if you enable support for the libsmi. */
#undef LIBSMI
/* Define if you have the <smi.h> header file. */
#undef HAVE_SMI_H
/* define if you have struct __res_state_ext */
#undef HAVE_RES_STATE_EXT
/* define if your struct __res_state has the nsort member */
#undef HAVE_NEW_RES_STATE
/*
* define if struct ether_header.ether_dhost is a struct with ether_addr_octet
*/
#undef ETHER_HEADER_HAS_EA
/* define if struct ether_arp contains arp_xsha */
#undef ETHER_ARP_HAS_X
/* define if you have the addrinfo function. */
#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 IN6ADDRSZ is defined (XXX not used!) */
#undef HAVE_IN6ADDRSZ
/* define if INADDRSZ is defined (XXX not used!) */
#undef HAVE_INADDRSZ
/* define if this is a development version, to use additional prototypes. */
#undef HAVE_OS_PROTO_H
/* define if <unistd.h> defines __P() */
#undef HAVE_PORTABLE_PROTOTYPE
/* define if RES_USE_INET6 is defined */
#undef HAVE_RES_USE_INET6
/* define if struct sockaddr has the sa_len member */
#undef HAVE_SOCKADDR_SA_LEN
/* 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
/* define if unaligned memory accesses fail */
#undef LBL_ALIGN
/* The successful return value from signal (?)XXX */
#undef RETSIGVAL
/* Define this on IRIX */
#undef _BSD_SIGNALS
/* For HP/UX ANSI compiler? */
#undef _HPUX_SOURCE
/* AIX hack. */
#undef _SUN
/* 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
/* Long story short: aclocal.m4 depends on autoconf 2.13
* implementation details wrt "const"; newer versions
* have different implementation details so for now we
* put "const" here. This may cause duplicate definitions
* in config.h but that should be OK since they're the same.
*/
#undef const
/* 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
/* Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
don't. */
#undef HAVE_DECL_ETHER_NTOHOST
/* Define to 1 if you have the `ether_ntohost' function. */
#undef HAVE_ETHER_NTOHOST
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `getaddrinfo' function. */
#undef HAVE_GETADDRINFO
/* Define to 1 if you have the `getnameinfo' function. */
#undef HAVE_GETNAMEINFO
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `crypto' library (-lcrypto). */
#undef HAVE_LIBCRYPTO
/* 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 to 1 if you have the <netinet/ether.h> header file. */
#undef HAVE_NETINET_ETHER_H
/* Define to 1 if you have the <netinet/if_ether.h> header file. */
#undef HAVE_NETINET_IF_ETHER_H
/* Define to 1 if you have the <openssl/evp.h> header file. */
#undef HAVE_OPENSSL_EVP_H
/* Define to 1 if you have the `pcap_breakloop' function. */
#undef HAVE_PCAP_BREAKLOOP
/* Define to 1 if you have the `pcap_dump_flush' function. */
#undef HAVE_PCAP_DUMP_FLUSH
/* Define to 1 if you have the `pcap_findalldevs' function. */
#undef HAVE_PCAP_FINDALLDEVS
/* Define to 1 if the system has the type `pcap_if_t'. */
#undef HAVE_PCAP_IF_T
/* Define to 1 if you have the `pcap_lib_version' function. */
#undef HAVE_PCAP_LIB_VERSION
/* Define to 1 if you have the `pfopen' function. */
#undef HAVE_PFOPEN
/* Define to 1 if you have the <rpc/rpcent.h> header file. */
#undef HAVE_RPC_RPCENT_H
/* Define to 1 if you have the `setlinebuf' function. */
#undef HAVE_SETLINEBUF
/* Define to 1 if you have the `sigaction' function. */
#undef HAVE_SIGACTION
/* Define to 1 if you have the `sigset' function. */
#undef HAVE_SIGSET
/* Define to 1 if you have the <smi.h> header file. */
#undef HAVE_SMI_H
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strlcat' function. */
#undef HAVE_STRLCAT
/* Define to 1 if you have the `strlcpy' function. */
#undef HAVE_STRLCPY
/* Define to 1 if you have the `strsep' function. */
#undef HAVE_STRSEP
/* Define to 1 if 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
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vfprintf' function. */
#undef HAVE_VFPRINTF
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* define if your compiler has __attribute__ */
#undef HAVE___ATTRIBUTE__
/* Define to 1 if netinet/ether.h declares `ether_ntohost' */
#undef NETINET_ETHER_H_DECLARES_ETHER_NTOHOST
/* Define to 1 if netinet/if_ether.h declares `ether_ntohost' */
#undef NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* The size of a `char', as computed by sizeof. */
#undef SIZEOF_CHAR
/* The size of a `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of a `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of a `long long', as computed by sizeof. */
#undef SIZEOF_LONG_LONG
/* The size of a `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define as token for inline if inlining supported */
#undef inline
/* Define to `short' if int16_t not defined. */
#undef int16_t
/* Define to `int' if int32_t not defined. */
#undef int32_t
/* Define to `long long' if int64_t not defined. */
#undef int64_t
/* Define to `signed char' if int8_t not defined. */
#undef int8_t
/* Define to `unsigned short' if u_int16_t not defined. */
#undef u_int16_t
/* Define to `unsigned int' if u_int32_t not defined. */
#undef u_int32_t
/* Define to `unsigned long long' if u_int64_t not defined. */
#undef u_int64_t
/* Define to `unsigned char' if u_int8_t not defined. */
#undef u_int8_t

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1531
src/bin/network/tcpdump/config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

14437
src/bin/network/tcpdump/configure vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,989 @@
dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.188.2.7 2005/09/21 16:50:01 guy Exp $ (LBL)
dnl
dnl Copyright (c) 1994, 1995, 1996, 1997
dnl The Regents of the University of California. All rights reserved.
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_REVISION($Revision: 1.188.2.7 $)
AC_PREREQ(2.50)
AC_INIT(tcpdump.c)
AC_CANONICAL_HOST
AC_LBL_C_INIT(V_CCOPT, V_INCLS)
AC_LBL_C_INLINE
AC_C___ATTRIBUTE__
AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netdnet/dnetdb.h)
AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
#include <sys/socket.h>])
if test "$ac_cv_header_netinet_if_ether_h" != yes; then
#
# The simple test didn't work.
# Do we need to include <net/if.h> first?
# Unset ac_cv_header_netinet_if_ether_h so we don't
# treat the previous failure as a cached value and
# suppress the next test.
#
AC_MSG_NOTICE([Rechecking with some additional includes])
unset ac_cv_header_netinet_if_ether_h
AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
struct mbuf;
struct rtentry;
#include <net/if.h>])
fi
AC_HEADER_TIME
case "$host_os" in
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
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 */
#include <smi.h>
main()
{
int current, revision, age, n;
const int required = 2;
if (smiInit(""))
exit(1);
if (strcmp(SMI_LIBRARY_VERSION, smi_library_version))
exit(2);
n = sscanf(smi_library_version, "%d:%d:%d", &current, &revision, &age);
if (n != 3)
exit(3);
if (required < current - age || required > current)
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_CHECKING([whether to enable the possibly-buggy SMB printer])
AC_ARG_ENABLE(smb,
[ --enable-smb enable possibly-buggy SMB printer [default=yes]
--disable-smb disable possibly-buggy SMB printer],,
enableval=yes)
case "$enableval" in
yes) AC_MSG_RESULT(yes)
AC_WARN([The SMB printer may have exploitable buffer overflows!!!])
AC_DEFINE(TCPDUMP_DO_SMB)
LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
;;
*) AC_MSG_RESULT(no)
;;
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_MSG_RESULT(to \"$withval\")
else
AC_MSG_RESULT(no)
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" ; then
AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval")
AC_MSG_RESULT(to \"$withval\")
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING([whether to enable ipv6])
AC_ARG_ENABLE(ipv6,
[ --enable-ipv6 enable ipv6 (with ipv4) support
--disable-ipv6 disable ipv6 support],
[ 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 $LOCALSRC"
AC_DEFINE(INET6)
ipv6=yes
;;
*)
AC_MSG_RESULT(no)
ipv6=no
;;
esac ],
AC_TRY_RUN([ /* AF_INET6 available check */
#include <sys/types.h>
#include <sys/socket.h>
main()
{
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
exit(1);
else
exit(0);
}
],
[ 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 $LOCALSRC"
AC_DEFINE(INET6)
ipv6=yes],
[ AC_MSG_RESULT(no)
ipv6=no],
[ AC_MSG_RESULT(no)
ipv6=no]
))
ipv6type=unknown
ipv6lib=none
ipv6trylibc=no
if test "$ipv6" = "yes"; then
AC_MSG_CHECKING([ipv6 stack type])
for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
case $i in
inria)
dnl http://www.kame.net/
AC_EGREP_CPP(yes,
[#include <netinet/in.h>
#ifdef IPV6_INRIA_VERSION
yes
#endif],
[ipv6type=$i;
CFLAGS="-DINET6 $CFLAGS"])
;;
kame)
dnl http://www.kame.net/
AC_EGREP_CPP(yes,
[#include <netinet/in.h>
#ifdef __KAME__
yes
#endif],
[ipv6type=$i;
ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib;
ipv6trylibc=yes;
CFLAGS="-DINET6 $CFLAGS"])
;;
linux-glibc)
dnl http://www.v6.linux.or.jp/
AC_EGREP_CPP(yes,
[#include <features.h>
#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
yes
#endif],
[ipv6type=$i;
CFLAGS="-DINET6 $CFLAGS"])
;;
linux-libinet6)
dnl http://www.v6.linux.or.jp/
dnl
dnl This also matches Solaris 8 and Tru64 UNIX 5.1,
dnl and possibly other versions of those OSes
dnl
if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
ipv6type=$i
ipv6lib=inet6
ipv6libdir=/usr/inet6/lib
ipv6trylibc=yes;
CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
fi
;;
toshiba)
AC_EGREP_CPP(yes,
[#include <sys/param.h>
#ifdef _TOSHIBA_INET6
yes
#endif],
[ipv6type=$i;
ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib;
CFLAGS="-DINET6 $CFLAGS"])
;;
v6d)
AC_EGREP_CPP(yes,
[#include </usr/local/v6/include/sys/v6config.h>
#ifdef __V6D__
yes
#endif],
[ipv6type=$i;
ipv6lib=v6;
ipv6libdir=/usr/local/v6/lib;
CFLAGS="-I/usr/local/v6/include $CFLAGS"])
;;
zeta)
AC_EGREP_CPP(yes,
[#include <sys/param.h>
#ifdef _ZETA_MINAMI_INET6
yes
#endif],
[ipv6type=$i;
ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib;
CFLAGS="-DINET6 $CFLAGS"])
;;
esac
if test "$ipv6type" != "unknown"; then
break
fi
done
AC_MSG_RESULT($ipv6type)
fi
if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
echo "You have $ipv6lib library, using it"
else
if test "$ipv6trylibc" = "yes"; then
echo "You do not have $ipv6lib library, using libc"
else
echo 'Fatal: no $ipv6lib library found. cannot continue.'
echo "You need to fetch lib$ipv6lib.a from appropriate"
echo 'ipv6 kit and compile beforehand.'
exit 1
fi
fi
fi
if test "$ipv6" = "yes"; then
#
# XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()"
# function in libc; there are "ngetaddrinfo()" and
# "ogetaddrinfo()" functions, and <netdb.h> #defines
# "getaddrinfo" to be either "ngetaddrinfo" or
# "ogetaddrinfo", depending on whether _SOCKADDR_LEN
# or _XOPEN_SOURCE_EXTENDED are defined or not.
#
# So this test doesn't work on Tru64 5.1, and possibly
# on other 5.x releases. This causes the configure
# script to become confused, and results in libpcap
# being unbuildable.
#
AC_SEARCH_LIBS(getaddrinfo, socket, [dnl
AC_MSG_CHECKING(getaddrinfo bug)
AC_CACHE_VAL(td_cv_buggygetaddrinfo, [AC_TRY_RUN([
#include <sys/types.h>
#include <netdb.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
main()
{
int passive, gaierr, inet4 = 0, inet6 = 0;
struct addrinfo hints, *ai, *aitop;
char straddr[INET6_ADDRSTRLEN], strport[16];
for (passive = 0; passive <= 1; passive++) {
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_flags = passive ? AI_PASSIVE : 0;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
(void)gai_strerror(gaierr);
goto bad;
}
for (ai = aitop; ai; ai = ai->ai_next) {
if (ai->ai_addr == NULL ||
ai->ai_addrlen == 0 ||
getnameinfo(ai->ai_addr, ai->ai_addrlen,
straddr, sizeof(straddr), strport, sizeof(strport),
NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
goto bad;
}
switch (ai->ai_family) {
case AF_INET:
if (strcmp(strport, "54321") != 0) {
goto bad;
}
if (passive) {
if (strcmp(straddr, "0.0.0.0") != 0) {
goto bad;
}
} else {
if (strcmp(straddr, "127.0.0.1") != 0) {
goto bad;
}
}
inet4++;
break;
case AF_INET6:
if (strcmp(strport, "54321") != 0) {
goto bad;
}
if (passive) {
if (strcmp(straddr, "::") != 0) {
goto bad;
}
} else {
if (strcmp(straddr, "::1") != 0) {
goto bad;
}
}
inet6++;
break;
case AF_UNSPEC:
goto bad;
break;
#ifdef AF_UNIX
case AF_UNIX:
#else
#ifdef AF_LOCAL
case AF_LOCAL:
#endif
#endif
default:
/* another family support? */
break;
}
}
}
/* supported family should be 2, unsupported family should be 0 */
if (!(inet4 == 0 || inet4 == 2))
goto bad;
if (!(inet6 == 0 || inet6 == 2))
goto bad;
if (aitop)
freeaddrinfo(aitop);
exit(0);
bad:
if (aitop)
freeaddrinfo(aitop);
exit(1);
}
],
td_cv_buggygetaddrinfo=no,
td_cv_buggygetaddrinfo=yes,
td_cv_buggygetaddrinfo=yes)])
if test "$td_cv_buggygetaddrinfo" = no; then
AC_MSG_RESULT(good)
else
AC_MSG_RESULT(buggy)
fi
if test "$td_cv_buggygetaddrinfo" = "yes"; then
#
# XXX - it doesn't appear that "ipv6type" can ever be
# set to "linux". Should this be testing for
# "linux-glibc", or for that *or* "linux-libinet6"?
# If the latter, note that "linux-libinet6" is also
# the type given to some non-Linux OSes.
#
if test "$ipv6type" != "linux"; then
echo 'Fatal: You must get working getaddrinfo() function.'
echo ' or you can specify "--disable-ipv6"'.
exit 1
else
echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
echo ' Better upgrade your system library to newest version'
echo ' of GNU C library (aka glibc).'
fi
fi
])
AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
fi
AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
[td_cv_decl_netdnet_dnetdb_h_dnet_htoa],
[AC_EGREP_HEADER(dnet_htoa, 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)
fi
dnl
dnl check sizeof basic types.
dnl They're very likely to be wrong for cross-compiling.
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(long long, 8)
dnl
dnl Checks for u_intXX_t
dnl AC_CHECK_BITTYPES(ac_cv_bittypes)
dnl if test "$ac_cv_bittypes" = no; then
dnl missing_includes=yes
dnl fi
dnl
dnl Checks for addrinfo structure
AC_STRUCT_ADDRINFO(ac_cv_addrinfo)
if test "$ac_cv_addrinfo" = no; then
missing_includes=yes
fi
dnl
dnl Checks for NI_MAXSERV
AC_NI_MAXSERV(ac_cv_maxserv)
if test "$ac_cv_maxserv" = no; then
missing_includes=yes
fi
dnl
dnl Checks for NI_NAMEREQD
AC_NI_NAMEREQD(ac_cv_namereqd)
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
dnl
dnl Checks for IN[6]ADDRSZ
AC_CHECK_ADDRSZ(ac_cv_addrsz)
if test "$ac_cv_addrsz" = no; then
missing_includes=yes
fi
dnl
dnl Checks for RES_USE_INET6
AC_CHECK_RES_USE_INET6(ac_cv_res_inet6)
if test "$ac_cv_res_inet6" = no; then
missing_includes=yes
fi
dnl
dnl Checks for res_state_ext structure
AC_STRUCT_RES_STATE_EXT(ac_cv_res_state_ext)
if test "$ac_cv_res_state_ext" = no; then
missing_includes=yes
fi
dnl
dnl Checks if res_state structure has nsort member.
AC_STRUCT_RES_STATE(ac_cv_res_state)
AC_REPLACE_FUNCS(vfprintf strcasecmp strlcat strlcpy strdup strsep)
AC_CHECK_FUNCS(strftime)
AC_CHECK_FUNCS(setlinebuf alarm)
needsnprintf=no
AC_CHECK_FUNCS(vsnprintf snprintf,,
[needsnprintf=yes])
if test $needsnprintf = yes; then
AC_LIBOBJ(snprintf)
fi
AC_LBL_TYPE_SIGNAL
AC_SEARCH_LIBS(dnet_htoa, dnet, AC_DEFINE(HAVE_DNET_HTOA))
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))
dnl AC_CHECK_LIB(z, uncompress)
dnl AC_CHECK_HEADERS(zlib.h)
AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
#
# Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
# libraries (e.g., "-lsocket -lnsl" on Solaris).
#
# We don't use AC_REPLACE_FUNCS because that uses AC_CHECK_FUNCS which
# use AC_CHECK_FUNC which doesn't let us specify the right #includes
# to make this work on BSD/OS 4.x. BSD/OS 4.x ships with the BIND8
# resolver, and the way it defines inet_{ntop,pton} is rather strange;
# it does not ship with a libc symbol "inet_ntop()", it ships with
# "_inet_ntop()", and has a #define macro in one of the system headers
# to rename it.
#
dnl AC_TRY_COMPILE(inet_ntop inet_pton inet_aton)
AC_MSG_CHECKING(for inet_ntop)
AC_TRY_LINK([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>], [char src[4], dst[128];
inet_ntop(AF_INET, src, dst, sizeof(dst));],
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
AC_LIBOBJ(inet_ntop)])
AC_MSG_CHECKING(for inet_pton)
AC_TRY_LINK([#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>], [char src[128], dst[4];
inet_pton(AF_INET, src, dst);],
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
AC_LIBOBJ(inet_pton)])
AC_MSG_CHECKING(for inet_aton)
AC_TRY_LINK([#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>], [char src[128];
struct in_addr dst;
inet_aton(src, &dst);],
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
AC_LIBOBJ(inet_aton)])
#
# Check for these after AC_LBL_LIBPCAP, for the same reason.
#
# You are in a twisty little maze of UN*Xes, all different.
# Some might not have ether_ntohost().
# Some might have it, but not declare it in any header file.
# Some might have it, but declare it in <netinet/if_ether.h>.
# Some might have it, but declare it in <netinet/ether.h>
# (And some might have it but document it as something declared in
# <netinet/ethernet.h>, although <netinet/if_ether.h> appears to work.)
#
# Before you is a C compiler.
#
AC_CHECK_FUNCS(ether_ntohost, [
AC_CACHE_CHECK(for buggy ether_ntohost, ac_cv_buggy_ether_ntohost, [
AC_TRY_RUN([
#include <netdb.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
int
main(int argc, char **argv)
{
u_char ea[6] = { 0xff, 0xff, 0xff, 0xff, 0xff };
char name[MAXHOSTNAMELEN];
ether_ntohost(name, (struct ether_addr *)ea);
exit(0);
}
], [ac_cv_buggy_ether_ntohost=no],
[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)
fi
])
if test "$ac_cv_func_ether_ntohost" = yes -a \
"$ac_cv_buggy_ether_ntohost" = "no"; then
#
# OK, we have ether_ntohost(). Do we have <netinet/if_ether.h>?
#
if test "$ac_cv_header_netinet_if_ether_h" = yes; then
#
# Yes. Does it declare ether_ntohost()?
#
AC_CHECK_DECL(ether_ntohost,
[
AC_DEFINE(NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST,,
[Define to 1 if netinet/if_ether.h declares `ether_ntohost'])
],,
[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
struct mbuf;
struct rtentry;
#include <net/if.h>
#include <netinet/if_ether.h>
])
fi
#
# Did that succeed?
#
if test "$ac_cv_have_decl_ether_ntohost" != yes; then
#
# No, how about <netinet/ether.h>, as on Linux?
#
AC_CHECK_HEADERS(netinet/ether.h)
if test "$ac_cv_header_netinet_ether_h" = yes; then
#
# We have it - does it declare ether_ntohost()?
# Unset ac_cv_have_decl_ether_ntohost so we don't
# treat the previous failure as a cached value and
# suppress the next test.
#
unset ac_cv_have_decl_ether_ntohost
AC_CHECK_DECL(ether_ntohost,
[
AC_DEFINE(NETINET_ETHER_H_DECLARES_ETHER_NTOHOST,,
[Define to 1 if netinet/ether.h declares `ether_ntohost'])
],,
[
#include <netinet/ether.h>
])
fi
fi
#
# Is ether_ntohost() declared?
#
if test "$ac_cv_have_decl_ether_ntohost" != yes; then
#
# No, we'll have to declare it ourselves.
# Do we have "struct ether_addr"?
#
AC_CHECK_TYPES(struct ether_addr,,,
[
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
struct mbuf;
struct rtentry;
#include <net/if.h>
#include <netinet/if_ether.h>
])
AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 0,
[Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
don't.])
else
AC_DEFINE(HAVE_DECL_ETHER_NTOHOST, 1,
[Define to 1 if you have the declaration of `ether_ntohost', and to 0 if you
don't.])
fi
fi
dnl portability macros for getaddrinfo/getnameinfo
dnl
dnl Check for sa_len
AC_CHECK_SA_LEN(ac_cv_sockaddr_has_sa_len)
if test "$ac_cv_sockaddr_has_sa_len" = no; then
missing_includes=yes
fi
AC_CHECK_FUNCS(pcap_findalldevs pcap_dump_flush pcap_lib_version)
if test $ac_cv_func_pcap_findalldevs = "yes" ; then
dnl Check for 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
dnl have pcap_if_t.
savedcflags="$CFLAGS"
CFLAGS="$CFLAGS $V_INCLS"
AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
CFLAGS="$savedcflags"
fi
if test $ac_cv_func_pcap_lib_version = "no" ; then
AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
AC_TRY_LINK([],
[
extern char pcap_version[];
return (int)pcap_version;
],
ac_lbl_cv_pcap_version_defined=yes,
ac_lbl_cv_pcap_version_defined=no)
if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PCAP_VERSION)
else
AC_MSG_RESULT(no)
fi
fi
AC_MSG_CHECKING(whether pcap_debug is defined by libpcap)
AC_TRY_LINK([],
[
extern int pcap_debug;
return pcap_debug;
],
ac_lbl_cv_pcap_debug_defined=yes,
ac_lbl_cv_pcap_debug_defined=no)
if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PCAP_DEBUG)
else
AC_MSG_RESULT(no)
#
# OK, what about "yydebug"?
#
AC_MSG_CHECKING(whether yydebug is defined by libpcap)
AC_TRY_LINK([],
[
extern int yydebug;
return yydebug;
],
ac_lbl_cv_yydebug_defined=yes,
ac_lbl_cv_yydebug_defined=no)
if test "$ac_lbl_cv_yydebug_defined" = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_YYDEBUG)
else
AC_MSG_RESULT(no)
fi
fi
AC_REPLACE_FUNCS(bpf_dump) dnl moved to libpcap in 0.6
V_GROUP=0
if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
V_GROUP=wheel
fi
case "$host_os" in
aix*)
dnl Workaround to enable certain features
AC_DEFINE(_SUN)
;;
irix*)
V_GROUP=sys
;;
osf*)
V_GROUP=system
;;
solaris*)
V_GROUP=sys
;;
esac
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_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_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_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_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])
#
# We can't just check for <inttypes.h> - some systems have one that
# doesn't define all the PRI[doxu]64 macros.
#
AC_CHECK_HEADERS(inttypes.h,
[
#
# OK, we have inttypes.h, but does it define those macros?
#
AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
AC_COMPILE_IFELSE(
[
AC_LANG_SOURCE(
[[
#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);
}
]])
],
[
AC_MSG_RESULT(yes)
ac_lbl_inttypes_h_defines_formats=yes
],
[
AC_MSG_RESULT(no)
ac_lbl_inttypes_h_defines_formats=no
])
],
[
#
# We don't have inttypes.h, so it obviously can't define those
# macros.
#
ac_lbl_inttypes_h_defines_formats=no
])
if test "$ac_lbl_inttypes_h_defines_formats" = no; then
AC_LBL_CHECK_64BIT_FORMAT(l,
[
AC_LBL_CHECK_64BIT_FORMAT(ll,
[
AC_LBL_CHECK_64BIT_FORMAT(L,
[
AC_LBL_CHECK_64BIT_FORMAT(q,
[
AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
])
])
])
])
fi
AC_LBL_DEVEL(V_CCOPT)
AC_LBL_SOCKADDR_SA_LEN
AC_LBL_UNALIGNED_ACCESS
AC_VAR_H_ERRNO
AC_ARG_WITH(crypto, [ --without-crypto disable crypto support],
[], [
AC_MSG_CHECKING(for SSLeay)
ac_cv_ssleay_path=no
incdir=no
#
# If Xprefix is set in the environment, use that value.
# XXX - this should arguably be done by having --with-crypto take an
# optional argument, and have that argument be used to set Xprefix
# if present.
#
if test -z "$Xprefix"; then
Xprefix=`eval echo $prefix`
fi
for dir in $Xprefix /usr/${host_alias} /usr /usr/local /usr/local/ssl /usr/pkg; do
#
# XXX - is there a better way to check if a given library is
# in a given directory than checking each of the possible
# shared library suffixes?
#
# Are there any other suffixes we need to look for? Do we have to
# worry about ".so.{version}"?
#
# Or should we just look for "libcrypto.*"?
#
if test -d $dir/lib -a \( -f $dir/lib/libcrypto.a -o \
-f $dir/lib/libcrypto.so -o \
-f $dir/lib/libcrypto.sl -o \
-f $dir/lib/libcrypto.dylib \); then
ac_cv_ssleay_path=$dir
fi
if test -d $dir/include/openssl -a -f $dir/include/openssl/des.h; then
incdir="-I$dir/include"
fi
if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
break;
else
ac_cv_ssleay_path=no
incdir=no
fi
done
AC_MSG_RESULT($ac_cv_ssleay_path)
if test "$ac_cv_ssleay_path" != no; then
V_INCLS="$V_INCLS $incdir"
LDFLAGS="-L$dir/lib $LDFLAGS"
if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
LIBS="$LIBS -lRSAglue"
fi
if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
LIBS="$LIBS -lrsaref"
fi
AC_CHECK_LIB(crypto, DES_cbc_encrypt)
CPPFLAGS="$CPPFLAGS $V_INCLS"
AC_CHECK_HEADERS(openssl/evp.h)
fi
])
dnl
dnl set additional include path if necessary
if test "$missing_includes" = "yes"; then
CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
V_INCLS="$V_INCLS -I\$(srcdir)/missing"
fi
AC_SUBST(V_CCOPT)
AC_SUBST(V_DEFS)
AC_SUBST(V_GROUP)
AC_SUBST(V_INCLS)
AC_SUBST(V_PCAPDEP)
AC_SUBST(LOCALSRC)
AC_PROG_INSTALL
AC_CONFIG_HEADER(config.h)
AC_OUTPUT_COMMANDS([if test -f .devel; then
echo timestamp > stamp-h
cat Makefile-devel-adds >> Makefile
make depend
fi])
AC_OUTPUT(Makefile)
exit 0

View File

@ -0,0 +1,144 @@
/*-
* 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <tcpdump-stdinc.h>
#include "cpack.h"
#include "extract.h"
static u_int8_t *
cpack_next_boundary(u_int8_t *buf, u_int8_t *p, size_t alignment)
{
size_t misalignment = (size_t)(p - buf) % alignment;
if (misalignment == 0)
return p;
return p + (alignment - misalignment);
}
/* Advance to the next wordsize boundary. Return NULL if fewer than
* wordsize bytes remain in the buffer after the boundary. Otherwise,
* return a pointer to the boundary.
*/
static u_int8_t *
cpack_align_and_reserve(struct cpack_state *cs, size_t wordsize)
{
u_int8_t *next;
/* Ensure alignment. */
next = cpack_next_boundary(cs->c_buf, cs->c_next, wordsize);
/* Too little space for wordsize bytes? */
if (next - cs->c_buf + wordsize > cs->c_len)
return NULL;
return next;
}
int
cpack_init(struct cpack_state *cs, u_int8_t *buf, size_t buflen)
{
memset(cs, 0, sizeof(*cs));
cs->c_buf = buf;
cs->c_len = buflen;
cs->c_next = cs->c_buf;
return 0;
}
/* Unpack a 64-bit unsigned integer. */
int
cpack_uint64(struct cpack_state *cs, u_int64_t *u)
{
u_int8_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. */
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)
{
u_int8_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. */
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)
{
u_int8_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. */
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)
{
/* No space left? */
if ((size_t)(cs->c_next - cs->c_buf) >= cs->c_len)
return -1;
*u = *cs->c_next;
/* Move pointer past the u_int8_t. */
cs->c_next++;
return 0;
}

View File

@ -0,0 +1,51 @@
/*-
* 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 _CPACK_H
#define _CPACK_H
struct cpack_state {
u_int8_t *c_buf;
u_int8_t *c_next;
size_t c_len;
};
int cpack_init(struct cpack_state *, u_int8_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 *);
#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))
#endif /* _CPACK_H */

View File

@ -0,0 +1,139 @@
/* @(#) $Header: /tcpdump/master/tcpdump/dccp.h,v 1.1.2.4 2006/05/12 01:46:17 guy 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) & 0x0F)
#define DCCPH_CSCOV(dh) (((dh)->dccph_ccval_cscov >> 4) & 0x0F)
#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__ */

View File

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

@ -0,0 +1,41 @@
/*
* 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, char *buf, u_int buflen);
#ifdef INET6
extern int decode_prefix6(const u_char *pd, char *buf, u_int buflen);
#endif
#endif

View File

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

View File

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

@ -0,0 +1,59 @@
/* @(#) $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.
*
* 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.
*
* @(#)if_ether.h 8.3 (Berkeley) 5/2/95
*/
#define ETHERMTU 1500
/*
* The number of bytes in an ethernet (MAC) address.
*/
#define ETHER_ADDR_LEN 6
/*
* 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;
};
/*
* Length of a DEC/Intel/Xerox or 802.3 Ethernet header; note that some
* compilers may pad "struct ether_header" to a multiple of 4 bytes,
* for example, so "sizeof (struct ether_header)" may not give the right
* answer.
*/
#define ETHER_HDRLEN 14

View File

@ -0,0 +1,143 @@
/*
* Copyright (c) 1993, 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/ethertype.h,v 1.24.2.1 2005/07/10 14:51:10 hannes Exp $ (LBL)
*/
/*
* Ethernet types.
*
* We wrap the declarations with #ifdef, so that if a file includes
* <netinet/if_ether.h>, which may declare some of these, we don't
* get a bunch of complaints from the C compiler about redefinitions
* of these values.
*
* We declare all of them here so that no file has to include
* <netinet/if_ether.h> if all it needs are ETHERTYPE_ values.
*/
#ifndef ETHERTYPE_LEN
#define ETHERTYPE_LEN 2
#endif
#ifndef ETHERTYPE_GRE_ISO
#define ETHERTYPE_GRE_ISO 0x00FE /* not really an ethertype only used in GRE */
#endif
#ifndef ETHERTYPE_PUP
#define ETHERTYPE_PUP 0x0200 /* PUP protocol */
#endif
#ifndef ETHERTYPE_IP
#define ETHERTYPE_IP 0x0800 /* IP protocol */
#endif
#ifndef ETHERTYPE_ARP
#define ETHERTYPE_ARP 0x0806 /* Addr. resolution protocol */
#endif
#ifndef ETHERTYPE_REVARP
#define ETHERTYPE_REVARP 0x8035 /* reverse Addr. resolution protocol */
#endif
#ifndef ETHERTYPE_NS
#define ETHERTYPE_NS 0x0600
#endif
#ifndef ETHERTYPE_SPRITE
#define ETHERTYPE_SPRITE 0x0500
#endif
#ifndef ETHERTYPE_TRAIL
#define ETHERTYPE_TRAIL 0x1000
#endif
#ifndef ETHERTYPE_MOPDL
#define ETHERTYPE_MOPDL 0x6001
#endif
#ifndef ETHERTYPE_MOPRC
#define ETHERTYPE_MOPRC 0x6002
#endif
#ifndef ETHERTYPE_DN
#define ETHERTYPE_DN 0x6003
#endif
#ifndef ETHERTYPE_LAT
#define ETHERTYPE_LAT 0x6004
#endif
#ifndef ETHERTYPE_SCA
#define ETHERTYPE_SCA 0x6007
#endif
#ifndef ETHERTYPE_LANBRIDGE
#define ETHERTYPE_LANBRIDGE 0x8038
#endif
#ifndef ETHERTYPE_DECDNS
#define ETHERTYPE_DECDNS 0x803c
#endif
#ifndef ETHERTYPE_DECDTS
#define ETHERTYPE_DECDTS 0x803e
#endif
#ifndef ETHERTYPE_VEXP
#define ETHERTYPE_VEXP 0x805b
#endif
#ifndef ETHERTYPE_VPROD
#define ETHERTYPE_VPROD 0x805c
#endif
#ifndef ETHERTYPE_ATALK
#define ETHERTYPE_ATALK 0x809b
#endif
#ifndef ETHERTYPE_AARP
#define ETHERTYPE_AARP 0x80f3
#endif
#ifndef ETHERTYPE_8021Q
#define ETHERTYPE_8021Q 0x8100
#endif
#ifndef ETHERTYPE_IPX
#define ETHERTYPE_IPX 0x8137
#endif
#ifndef ETHERTYPE_IPV6
#define ETHERTYPE_IPV6 0x86dd
#endif
#ifndef ETHERTYPE_PPP
#define ETHERTYPE_PPP 0x880b
#endif
#ifndef ETHERTYPE_SLOW
#define ETHERTYPE_SLOW 0x8809
#endif
#ifndef ETHERTYPE_MPLS
#define ETHERTYPE_MPLS 0x8847
#endif
#ifndef ETHERTYPE_MPLS_MULTI
#define ETHERTYPE_MPLS_MULTI 0x8848
#endif
#ifndef ETHERTYPE_PPPOED
#define ETHERTYPE_PPPOED 0x8863
#endif
#ifndef ETHERTYPE_PPPOES
#define ETHERTYPE_PPPOES 0x8864
#endif
#ifndef ETHERTYPE_JUMBO
#define ETHERTYPE_JUMBO 0x8870
#endif
#ifndef ETHERTYPE_EAPOL
#define ETHERTYPE_EAPOL 0x888e
#endif
#ifndef ETHERTYPE_LOOPBACK
#define ETHERTYPE_LOOPBACK 0x9000
#endif
#ifndef ETHERTYPE_VMAN
#define ETHERTYPE_VMAN 0x9100 /* Extreme VMAN Protocol */
#endif
#ifndef ETHERTYPE_ISO
#define ETHERTYPE_ISO 0xfefe /* nonstandard - used in Cisco HDLC encapsulation */
#endif
extern const struct tok ethertype_values[];

View File

@ -0,0 +1,126 @@
/*
* 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/extract.h,v 1.24 2005/01/15 02:06:50 guy Exp $ (LBL)
*/
/*
* Macros to extract possibly-unaligned big-endian integral values.
*/
#ifdef LBL_ALIGN
/*
* The processor doesn't natively handle unaligned loads.
*/
#ifdef HAVE___ATTRIBUTE__
/*
* We have __attribute__; we assume that means we have __attribute__((packed)).
* Declare packed structures containing a u_int16_t and a u_int32_t,
* cast the pointer to point to one of those, and fetch through it;
* the GCC manual doesn't appear to explicitly say that
* __attribute__((packed)) causes the compiler to generate unaligned-safe
* code, but it apppears to do so.
*
* We do this in case the compiler can generate, for this instruction set,
* better code to do an unaligned load and pass stuff to "ntohs()" or
* "ntohl()" than the code to fetch the bytes one at a time and
* assemble them. (That might not be the case on a little-endian platform,
* where "ntohs()" and "ntohl()" might not be done inline.)
*/
typedef struct {
u_int16_t val;
} __attribute__((packed)) unaligned_u_int16_t;
typedef struct {
u_int32_t val;
} __attribute__((packed)) unaligned_u_int32_t;
#define EXTRACT_16BITS(p) \
((u_int16_t)ntohs(((const unaligned_u_int16_t *)(p))->val))
#define EXTRACT_32BITS(p) \
((u_int32_t)ntohl(((const unaligned_u_int32_t *)(p))->val))
#define EXTRACT_64BITS(p) \
((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))
#else /* HAVE___ATTRIBUTE__ */
/*
* We don't have __attribute__, 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)))
#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)))
#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__ */
#else /* LBL_ALIGN */
/*
* The processor natively handles unaligned loads, so we can just
* cast the pointer and fetch through it.
*/
#define EXTRACT_16BITS(p) \
((u_int16_t)ntohs(*(const u_int16_t *)(p)))
#define EXTRACT_32BITS(p) \
((u_int32_t)ntohl(*(const u_int32_t *)(p)))
#define EXTRACT_64BITS(p) \
((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))
#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)))
/*
* Macros to extract possibly-unaligned little-endian integral values.
* XXX - do loads on little-endian machines that support unaligned loads?
*/
#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)))
#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)))
#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)))

View File

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

View File

@ -0,0 +1,189 @@
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code
* distributions retain the above copyright notice and this paragraph
* in its entirety, and (2) distributions including binary code include
* the above copyright notice and this paragraph in its entirety in
* the documentation or other materials provided with the distribution.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND
* WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
* LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE.
*
* Original code by Hannes Gredler (hannes@juniper.net)
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/gmpls.c,v 1.5.2.1 2005/05/19 06:44:02 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include "interface.h"
/* rfc3471 */
struct tok gmpls_link_prot_values[] = {
{ 0x01, "Extra Traffic"},
{ 0x02, "Unprotected"},
{ 0x04, "Shared"},
{ 0x08, "Dedicated 1:1"},
{ 0x10, "Dedicated 1+1"},
{ 0x20, "Enhanced"},
{ 0x40, "Reserved"},
{ 0x80, "Reserved"},
{ 0, NULL }
};
/* rfc3471 */
struct tok gmpls_switch_cap_values[] = {
{ 1, "Packet-Switch Capable-1"},
{ 2, "Packet-Switch Capable-2"},
{ 3, "Packet-Switch Capable-3"},
{ 4, "Packet-Switch Capable-4"},
{ 51, "Layer-2 Switch Capable"},
{ 100, "Time-Division-Multiplex"},
{ 150, "Lambda-Switch Capable"},
{ 200, "Fiber-Switch Capable"},
{ 0, NULL }
};
/* rfc3471 */
struct tok gmpls_encoding_values[] = {
{ 1, "Packet"},
{ 2, "Ethernet V2/DIX"},
{ 3, "ANSI/ETSI PDH"},
{ 4, "Reserved"},
{ 5, "SDH ITU-T G.707/SONET ANSI T1.105"},
{ 6, "Reserved"},
{ 7, "Digital Wrapper"},
{ 8, "Lambda (photonic)"},
{ 9, "Fiber"},
{ 10, "Reserved"},
{ 11, "FiberChannel"},
{ 0, NULL }
};
/* rfc3471 */
struct tok gmpls_payload_values[] = {
{ 0, "Unknown"},
{ 1, "Reserved"},
{ 2, "Reserved"},
{ 3, "Reserved"},
{ 4, "Reserved"},
{ 5, "Asynchronous mapping of E4"},
{ 6, "Asynchronous mapping of DS3/T3"},
{ 7, "Asynchronous mapping of E3"},
{ 8, "Bit synchronous mapping of E3"},
{ 9, "Byte synchronous mapping of E3"},
{ 10, "Asynchronous mapping of DS2/T2"},
{ 11, "Bit synchronous mapping of DS2/T2"},
{ 12, "Reserved"},
{ 13, "Asynchronous mapping of E1"},
{ 14, "Byte synchronous mapping of E1"},
{ 15, "Byte synchronous mapping of 31 * DS0"},
{ 16, "Asynchronous mapping of DS1/T1"},
{ 17, "Bit synchronous mapping of DS1/T1"},
{ 18, "Byte synchronous mapping of DS1/T1"},
{ 19, "VC-11 in VC-12"},
{ 20, "Reserved"},
{ 21, "Reserved"},
{ 22, "DS1 SF Asynchronous"},
{ 23, "DS1 ESF Asynchronous"},
{ 24, "DS3 M23 Asynchronous"},
{ 25, "DS3 C-Bit Parity Asynchronous"},
{ 26, "VT/LOVC"},
{ 27, "STS SPE/HOVC"},
{ 28, "POS - No Scrambling, 16 bit CRC"},
{ 29, "POS - No Scrambling, 32 bit CRC"},
{ 30, "POS - Scrambling, 16 bit CRC"},
{ 31, "POS - Scrambling, 32 bit CRC"},
{ 32, "ATM mapping"},
{ 33, "Ethernet PHY"},
{ 34, "SONET/SDH"},
{ 35, "Reserved (SONET deprecated)"},
{ 36, "Digital Wrapper"},
{ 37, "Lambda"},
{ 38, "ANSI/ETSI PDH"},
{ 39, "Reserved"},
{ 40, "Link Access Protocol SDH (X.85 and X.86)"},
{ 41, "FDDI"},
{ 42, "DQDB (ETSI ETS 300 216)"},
{ 43, "FiberChannel-3 (Services)"},
{ 44, "HDLC"},
{ 45, "Ethernet V2/DIX (only)"},
{ 46, "Ethernet 802.3 (only)"},
/* draft-ietf-ccamp-gmpls-g709-04.txt */
{ 47, "G.709 ODUj"},
{ 48, "G.709 OTUk(v)"},
{ 49, "CBR/CBRa"},
{ 50, "CBRb"},
{ 51, "BSOT"},
{ 52, "BSNT"},
{ 53, "IP/PPP (GFP)"},
{ 54, "Ethernet MAC (framed GFP)"},
{ 55, "Ethernet PHY (transparent GFP)"},
{ 56, "ESCON"},
{ 57, "FICON"},
{ 58, "Fiber Channel"},
{ 0, NULL }
};
/*
* 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.
*/
struct tok lmp_sd_service_config_cpsa_link_type_values[] = {
{ 5, "SDH ITU-T G.707"},
{ 6, "SONET ANSI T1.105"},
{ 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
* details.
*/
struct tok lmp_sd_service_config_cpsa_signal_type_sdh_values[] = {
{ 5, "VC-3"},
{ 6, "VC-4"},
{ 7, "STM-0"},
{ 8, "STM-1"},
{ 9, "STM-4"},
{ 10, "STM-16"},
{ 11, "STM-64"},
{ 12, "STM-256"},
{ 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
* details.
*/
struct tok lmp_sd_service_config_cpsa_signal_type_sonet_values[] = {
{ 5, "STS-1 SPE"},
{ 6, "STS-3c SPE"},
{ 7, "STS-1"},
{ 8, "STM-3"},
{ 9, "STM-12"},
{ 10, "STM-48"},
{ 11, "STM-192"},
{ 12, "STM-768"},
{ 0, NULL}
};
#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_EXTD_MAM 254 /* experimental */
struct tok diffserv_te_bc_values[] = {
{ DIFFSERV_BC_MODEL_RDM, "Russian dolls"},
{ DIFFSERV_BC_MODEL_MAM, "Maximum allocation"},
{ DIFFSERV_BC_MODEL_EXTD_MAM, "Maximum allocation with E-LSP support"},
{ 0, NULL }
};

View File

@ -0,0 +1,24 @@
/* @(#) $Header: /tcpdump/master/tcpdump/gmpls.h,v 1.3.2.1 2005/05/19 06:44:03 guy Exp $ (LBL) */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code
* distributions retain the above copyright notice and this paragraph
* in its entirety, and (2) distributions including binary code include
* the above copyright notice and this paragraph in its entirety in
* the documentation or other materials provided with the distribution.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND
* WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
* LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE.
*
* Original code by Hannes Gredler (hannes@juniper.net)
*/
extern struct tok gmpls_link_prot_values[];
extern struct tok gmpls_switch_cap_values[];
extern struct tok gmpls_encoding_values[];
extern struct tok gmpls_payload_values[];
extern struct tok diffserv_te_bc_values[];
extern struct tok lmp_sd_service_config_cpsa_link_type_values[];
extern struct tok lmp_sd_service_config_cpsa_signal_type_sdh_values[];
extern struct tok lmp_sd_service_config_cpsa_signal_type_sonet_values[];

View File

@ -0,0 +1,71 @@
/*
* Copyright (c) 1997
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code distributions
* retain the above copyright notice and this paragraph in its entirety, (2)
* distributions including binary code include the above copyright notice and
* this paragraph in its entirety in the documentation or other materials
* provided with the distribution, and (3) all advertising materials mentioning
* features or use of this software display the following acknowledgement:
* ``This product includes software developed by the University of California,
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
* the University nor the names of its contributors may be used to endorse
* or promote products derived from this software without specific prior
* written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/gmt2local.c,v 1.9 2003/11/16 09:36:09 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include <stdio.h>
#ifdef HAVE_OS_PROTO_H
#include "os-proto.h"
#endif
#include "gmt2local.h"
/*
* Returns the difference between gmt and local time in seconds.
* Use gmtime() and localtime() to keep things simple.
*/
int32_t
gmt2local(time_t t)
{
register int dt, dir;
register struct tm *gmt, *loc;
struct tm sgmt;
if (t == 0)
t = time(NULL);
gmt = &sgmt;
*gmt = *gmtime(&t);
loc = localtime(&t);
dt = (loc->tm_hour - gmt->tm_hour) * 60 * 60 +
(loc->tm_min - gmt->tm_min) * 60;
/*
* If the year or julian day is different, we span 00:00 GMT
* and must add or subtract a day. Check the year first to
* avoid problems when the julian day wraps.
*/
dir = loc->tm_year - gmt->tm_year;
if (dir == 0)
dir = loc->tm_yday - gmt->tm_yday;
dt += dir * 24 * 60 * 60;
return (dt);
}

View File

@ -0,0 +1,27 @@
/*
* Copyright (c) 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.
*
* @(#) $Header: /tcpdump/master/tcpdump/gmt2local.h,v 1.2.1.1 1999/10/07 23:47:10 mcr Exp $ (LBL)
*/
#ifndef gmt2local_h
#define gmt2local_h
int32_t gmt2local(time_t);
#endif

View File

@ -0,0 +1,456 @@
/* @(#) $Header: /tcpdump/master/tcpdump/icmp6.h,v 1.16.2.1 2005/09/05 09:29:28 guy 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 */
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_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

@ -0,0 +1,299 @@
/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.9.4.2 2005/11/13 12:07:44 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_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
/* RESERVED 0xD */
/* RESERVED 0xE */
/* RESERVED 0xF */
#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
/*
* 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)
typedef enum {
NOT_PRESENT,
PRESENT,
TRUNCATED
} elem_status_t;
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;
elem_status_t challenge_status;
struct challenge_t challenge;
u_int16_t capability_info;
elem_status_t ssid_status;
struct ssid_t ssid;
elem_status_t rates_status;
struct rates_t rates;
elem_status_t ds_status;
struct ds_t ds;
elem_status_t cf_status;
struct cf_t cf;
elem_status_t fh_status;
struct fh_t fh;
elem_status_t tim_status;
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)
#define IV_IV(iv) ((iv) & 0xFFFFFF)
#define IV_PAD(iv) (((iv) >> 24) & 0x3F)
#define IV_KEYID(iv) (((iv) >> 30) & 0x03)

View File

@ -0,0 +1,213 @@
/* $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.1.2.1 2006/06/13 22:24:45 guy 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. There is one for
* Linux, but it is neither rigidly defined (there were not even
* units given for some fields) nor easily extensible.
*
* I suggest the following 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.
*/
#if defined(__KERNEL__) || defined(_KERNEL)
#ifndef DLT_IEEE802_11_RADIO
#define DLT_IEEE802_11_RADIO 127 /* 802.11 plus WLAN header */
#endif
#endif /* defined(__KERNEL__) || defined(_KERNEL) */
/* The radio capture header precedes the 802.11 header. */
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.
*/
} __attribute__((__packed__));
/* 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).
*
* 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
*
* Tx/Rx data 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_FCS u_int32_t data
*
* FCS from frame in network byte order.
*/
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_EXT = 31
};
#ifndef _KERNEL
/* Channel flags. */
#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */
#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */
#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */
#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */
#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */
#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */
#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */
#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */
#endif /* !_KERNEL */
/* 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 */
#endif /* _NET_IF_IEEE80211RADIOTAP_H_ */

View File

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

@ -0,0 +1,250 @@
#! /bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

View File

@ -0,0 +1,366 @@
/*
* Copyright (c) 1988-2002
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code distributions
* retain the above copyright notice and this paragraph in its entirety, (2)
* distributions including binary code include the above copyright notice and
* this paragraph in its entirety in the documentation or other materials
* provided with the distribution, and (3) all advertising materials mentioning
* features or use of this software display the following acknowledgement:
* ``This product includes software developed by the University of California,
* Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
* the University nor the names of its contributors may be used to endorse
* or promote products derived from this software without specific prior
* written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.244.2.20 2006/02/08 01:40:09 hannes Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
#define tcpdump_interface_h
#ifdef HAVE_OS_PROTO_H
#include "os-proto.h"
#endif
#ifndef HAVE___ATTRIBUTE__
#define __attribute__(x)
#endif
/* snprintf et al */
#include <stdarg.h>
#if HAVE_STDINT_H
#include <stdint.h>
#endif
#if !defined(HAVE_SNPRINTF)
int snprintf(char *, size_t, const char *, ...)
__attribute__((format(printf, 3, 4)));
#endif
#if !defined(HAVE_VSNPRINTF)
int vsnprintf(char *, size_t, const char *, va_list)
__attribute__((format(printf, 3, 0)));
#endif
#ifndef HAVE_STRLCAT
extern size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRLCPY
extern size_t strlcpy(char *, const char *, size_t);
#endif
#ifndef HAVE_STRDUP
extern char *strdup(const char *);
#endif
#ifndef HAVE_STRSEP
extern char *strsep(char **, const char *);
#endif
#define PT_VAT 1 /* Visual Audio Tool */
#define PT_WB 2 /* distributed White Board */
#define PT_RPC 3 /* Remote Procedure Call */
#define PT_RTP 4 /* Real-Time Applications protocol */
#define PT_RTCP 5 /* Real-Time Applications control protocol */
#define PT_SNMP 6 /* Simple Network Management Protocol */
#define PT_CNFP 7 /* Cisco NetFlow protocol */
#define PT_TFTP 8 /* trivial file transfer protocol */
#define PT_AODV 9 /* Ad-hoc On-demand Distance Vector Protocol */
#ifndef min
#define min(a,b) ((a)>(b)?(b):(a))
#endif
#ifndef max
#define max(a,b) ((b)>(a)?(b):(a))
#endif
/*
* The default snapshot length. This value allows most printers to print
* useful information while keeping the amount of unwanted data down.
*/
#ifndef INET6
#define DEFAULT_SNAPLEN 68 /* ether + IPv4 + TCP + 14 */
#else
#define DEFAULT_SNAPLEN 96 /* ether + IPv6 + TCP + 22 */
#endif
#ifndef BIG_ENDIAN
#define BIG_ENDIAN 4321
#define LITTLE_ENDIAN 1234
#endif
#define ESRC(ep) ((ep)->ether_shost)
#define EDST(ep) ((ep)->ether_dhost)
#ifndef NTOHL
#define NTOHL(x) (x) = ntohl(x)
#define NTOHS(x) (x) = ntohs(x)
#define HTONL(x) (x) = htonl(x)
#define HTONS(x) (x) = htons(x)
#endif
#endif
extern char *program_name; /* used to generate self-identifying messages */
extern int32_t thiszone; /* seconds offset from gmt to local time */
/*
* True if "l" bytes of "var" were captured.
*
* The "snapend - (l) <= snapend" checks to make sure "l" isn't so large
* that "snapend - (l)" underflows.
*
* The check is for <= rather than < because "l" might be 0.
*/
#define TTEST2(var, l) (snapend - (l) <= snapend && \
(const u_char *)&(var) <= snapend - (l))
/* True if "var" was captured */
#define TTEST(var) TTEST2(var, sizeof(var))
/* Bail if "l" bytes of "var" were not captured */
#define TCHECK2(var, l) if (!TTEST2(var, l)) goto trunc
/* 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 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)));
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);
/* 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 ether_encap_print(u_short, const u_char *, u_int, u_int, u_short *);
extern int llc_print(const u_char *, u_int, u_int, const u_char *,
const u_char *, u_short *);
extern int snap_print(const u_char *, u_int, u_int, u_short *, 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 void ether_print(const u_char *, u_int, u_int);
extern u_int ether_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 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 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 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 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 lmp_print(const u_char *, u_int);
extern void lspping_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);
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 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 udp_print(const u_char *, u_int, const u_char *, int);
extern void wb_print(const void *, u_int);
extern int ah_print(register const u_char *);
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 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 slow_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 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 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 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);
#ifdef INET6
extern void ip6_print(const u_char *, u_int);
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 icmp6_print(const u_char *, u_int, const u_char *, int);
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);
#endif /*INET6*/
extern u_short in_cksum(const u_short *, register u_int, int);
extern u_int16_t in_cksum_shouldbe(u_int16_t, u_int16_t);
#ifndef HAVE_BPF_DUMP
struct bpf_program;
extern void bpf_dump(struct bpf_program *, int);
#endif
#include "netdissect.h"
/* forward compatibility */
extern netdissect_options *gndo;
#define eflag gndo->ndo_eflag
#define fflag gndo->ndo_fflag
#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 Aflag gndo->ndo_Aflag
#define suppress_default_print gndo->ndo_suppress_default_print
#define packettype gndo->ndo_packettype
#define tcpmd5secret gndo->ndo_tcpmd5secret
#define Wflag gndo->ndo_Wflag
#define WflagChars gndo->ndo_WflagChars
#define Cflag_count gndo->ndo_Cflag_count
#define snaplen gndo->ndo_snaplen
#define snapend gndo->ndo_snapend

View File

@ -0,0 +1,163 @@
/* @(#) $Header: /tcpdump/master/tcpdump/ip.h,v 1.11 2004/09/27 21:13:10 hannes Exp $ (LBL) */
/*
* 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.h 8.2 (Berkeley) 6/1/94
*/
/*
* Definitions for internet protocol version 4.
* Per RFC 791, September 1981.
*/
#define IPVERSION 4
/*
* Structure of an internet header, naked of options.
*
* We declare ip_len and ip_off to be short, rather than u_short
* pragmatically since otherwise unsigned comparisons can result
* against negative integers quite easily, and fail in subtle ways.
*/
struct ip {
u_int8_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 */
#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 */
struct in_addr ip_src,ip_dst; /* source and dest address */
};
#define IP_MAXPACKET 65535 /* maximum packet size */
/*
* Definitions for IP type of service (ip_tos)
*/
#define IPTOS_LOWDELAY 0x10
#define IPTOS_THROUGHPUT 0x08
#define IPTOS_RELIABILITY 0x04
/*
* Definitions for IP precedence (also in ip_tos) (hopefully unused)
*/
#define IPTOS_PREC_NETCONTROL 0xe0
#define IPTOS_PREC_INTERNETCONTROL 0xc0
#define IPTOS_PREC_CRITIC_ECP 0xa0
#define IPTOS_PREC_FLASHOVERRIDE 0x80
#define IPTOS_PREC_FLASH 0x60
#define IPTOS_PREC_IMMEDIATE 0x40
#define IPTOS_PREC_PRIORITY 0x20
#define IPTOS_PREC_ROUTINE 0x00
/*
* Definitions for options.
*/
#define IPOPT_COPIED(o) ((o)&0x80)
#define IPOPT_CLASS(o) ((o)&0x60)
#define IPOPT_NUMBER(o) ((o)&0x1f)
#define IPOPT_CONTROL 0x00
#define IPOPT_RESERVED1 0x20
#define IPOPT_DEBMEAS 0x40
#define IPOPT_RESERVED2 0x60
#define IPOPT_EOL 0 /* end of option list */
#define IPOPT_NOP 1 /* no operation */
#define IPOPT_RR 7 /* record packet route */
#define IPOPT_TS 68 /* timestamp */
#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
#define IPOPT_LSRR 131 /* loose source route */
#define IPOPT_SATID 136 /* satnet id */
#define IPOPT_SSRR 137 /* strict source route */
#define IPOPT_RA 148 /* router-alert, rfc2113 */
/*
* Offsets to fields in options other than EOL and NOP.
*/
#define IPOPT_OPTVAL 0 /* option ID */
#define IPOPT_OLEN 1 /* option length */
#define IPOPT_OFFSET 2 /* offset within option */
#define IPOPT_MINOFF 4 /* min value of above */
/*
* 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 */
#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];
struct ipt_ta {
struct in_addr ipt_addr;
u_int32_t ipt_time;
} ipt_ta[1];
} ipt_timestamp;
};
/* flag bits for ipt_flg */
#define IPOPT_TS_TSONLY 0 /* timestamps only */
#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
#define IPOPT_TS_PRESPEC 3 /* specified modules only */
/* bits for security (not byte swapped) */
#define IPOPT_SECUR_UNCLASS 0x0000
#define IPOPT_SECUR_CONFID 0xf135
#define IPOPT_SECUR_EFTO 0x789a
#define IPOPT_SECUR_MMMM 0xbc4d
#define IPOPT_SECUR_RESTR 0xaf13
#define IPOPT_SECUR_SECRET 0xd788
#define IPOPT_SECUR_TOPSECRET 0x6bc5
/*
* Internet implementation parameters.
*/
#define MAXTTL 255 /* maximum time to live (seconds) */
#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
#define IPFRAGTTL 60 /* time to live for frags, slowhz */
#define IPTTLDEC 1 /* subtracted when forwarding */
#define IP_MSS 576 /* default maximum segment size */
/* in print-ip.c */
extern u_int32_t ip_finddst(const struct ip *);

View File

@ -0,0 +1,191 @@
/* @(#) $Header: /tcpdump/master/tcpdump/ip6.h,v 1.6.4.1 2005/04/20 10:04:37 guy 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 $ */
/*
* 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.h 8.1 (Berkeley) 6/10/93
*/
#ifndef _NETINET_IP6_H_
#define _NETINET_IP6_H_
/*
* Definition for internet protocol version 6.
* RFC 2460
*/
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 */
} ip6_un1;
u_int8_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 */
};
#define ip6_vfc ip6_ctlun.ip6_un2_vfc
#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
#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
#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) */
#if 1
/* ECN bits proposed by Sally Floyd */
#define IP6TOS_CE 0x01 /* congestion experienced */
#define IP6TOS_ECT 0x02 /* ECN-capable transport */
#endif
/*
* Extension Headers
*/
struct ip6_ext {
u_char ip6e_nxt;
u_char ip6e_len;
};
/* Hop-by-Hop options header */
/* XXX should we pad it to force alignment on an 8-byte boundary? */
struct ip6_hbh {
u_int8_t ip6h_nxt; /* next header */
u_int8_t ip6h_len; /* length in units of 8 octets */
/* followed by options */
};
/* Destination options header */
/* XXX should we pad it to force alignment on an 8-byte boundary? */
struct ip6_dest {
u_int8_t ip6d_nxt; /* next header */
u_int8_t ip6d_len; /* length in units of 8 octets */
/* followed by options */
};
/* 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_ROUTER_ALERT 0x05 /* 00 0 00101 */
#define IP6OPT_RTALERT_LEN 4
#define IP6OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */
#define IP6OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */
#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_HOME_ADDRESS 0xc9 /* 11 0 01001 */
#define IP6OPT_EID 0x8a /* 10 0 01010 */
#define IP6OPT_TYPE(o) ((o) & 0xC0)
#define IP6OPT_TYPE_SKIP 0x00
#define IP6OPT_TYPE_DISCARD 0x40
#define IP6OPT_TYPE_FORCEICMP 0x80
#define IP6OPT_TYPE_ICMP 0xC0
#define IP6OPT_MUTABLE 0x20
/* 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 */
/* followed by routing type specific data */
};
/* 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 */
struct in6_addr ip6r0_addr[1]; /* up to 23 addresses */
};
/* 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 */
};
#define IP6F_OFF_MASK 0xfff8 /* mask out offset from ip6f_offlg */
#define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */
#define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */
#endif /* not _NETINET_IP6_H_ */

View File

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

View File

@ -0,0 +1,60 @@
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code
* distributions retain the above copyright notice and this paragraph
* in its entirety, and (2) distributions including binary code include
* the above copyright notice and this paragraph in its entirety in
* the documentation or other materials provided with the distribution.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND
* WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
* LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE.
*
* Original code by Hannes Gredler (hannes@juniper.net)
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/ipproto.c,v 1.3.2.3 2005/09/20 06:05:37 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include "interface.h"
#include "ipproto.h"
struct tok ipproto_values[] = {
{ IPPROTO_HOPOPTS, "Options" },
{ IPPROTO_ICMP, "ICMP" },
{ IPPROTO_IGMP, "IGMP" },
{ IPPROTO_IPV4, "IPIP" },
{ IPPROTO_TCP, "TCP" },
{ IPPROTO_EGP, "EGP" },
{ IPPROTO_PIGP, "IGRP" },
{ IPPROTO_UDP, "UDP" },
{ IPPROTO_DCCP, "DCCP" },
{ IPPROTO_IPV6, "IPv6" },
{ IPPROTO_ROUTING, "Routing" },
{ IPPROTO_FRAGMENT, "Fragment" },
{ IPPROTO_RSVP, "RSVP" },
{ IPPROTO_GRE, "GRE" },
{ IPPROTO_ESP, "ESP" },
{ IPPROTO_AH, "AH" },
{ IPPROTO_MOBILE, "Mobile IP" },
{ IPPROTO_ICMPV6, "ICMPv6" },
{ IPPROTO_MOBILITY_OLD, "Mobile IP (old)" },
{ IPPROTO_EIGRP, "EIGRP" },
{ IPPROTO_OSPF, "OSPF" },
{ IPPROTO_PIM, "PIM" },
{ IPPROTO_IPCOMP, "Compressed IP" },
{ IPPROTO_VRRP, "VRRP" },
{ IPPROTO_PGM, "PGM" },
{ IPPROTO_SCTP, "SCTP" },
{ IPPROTO_MOBILITY, "Mobility" },
{ 0, NULL }
};

View File

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

View File

@ -0,0 +1,151 @@
/*
* 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_) */

View File

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

View File

@ -0,0 +1,378 @@
/*
* 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.10 2002/12/11 07:13:54 guy 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
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_MAJOR_VERSION 1
#define ISAKMP_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 */
/* 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 reserved; /* RESERVED, unused, must set to 0 */
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 isakmp_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 isakmp_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 isakmp_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 isakmp_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 isakmp_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 isakmp_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 isakmp_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 isakmp_pl_hash {
struct isakmp_gen h;
/* Hash Data */
};
/* 3.12 Signature Payload */
/* may not be used, because of having only data. */
struct isakmp_pl_sig {
struct isakmp_gen h;
/* Signature Data */
};
/* 3.13 Nonce Payload */
/* may not be used, because of having only data. */
struct isakmp_pl_nonce {
struct isakmp_gen h;
/* Nonce Data */
};
/* 3.14 Notification Payload */
struct isakmp_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 isakmp_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 isakmp_ph1tab {
struct isakmp_ph1 *head;
struct isakmp_ph1 *tail;
int len;
};
struct isakmp_ph2tab {
struct isakmp_ph2 *head;
struct isakmp_ph2 *tail;
int len;
};
#define EXCHANGE_PROXY 1
#define EXCHANGE_MYSELF 0
#define PFS_NEED 1
#define PFS_NONEED 0
#endif /* !defined(_ISAKMP_H_) */

View File

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

58
src/bin/network/tcpdump/l2vpn.c Executable file
View File

@ -0,0 +1,58 @@
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code
* distributions retain the above copyright notice and this paragraph
* in its entirety, and (2) distributions including binary code include
* the above copyright notice and this paragraph in its entirety in
* the documentation or other materials provided with the distribution.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND
* WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
* LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE.
*
* Original code by Hannes Gredler (hannes@juniper.net)
*/
#ifndef lint
static const char rcsid[] _U_ =
"@(#) $Header: /tcpdump/master/tcpdump/l2vpn.c,v 1.1 2004/06/15 09:42:40 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <tcpdump-stdinc.h>
#include "interface.h"
#include "l2vpn.h"
/* draft-ietf-pwe3-iana-allocation-04 */
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"},
{ 0x0d, "ATM one-to-one VPC Cell Mode"},
{ 0x0e, "ATM AAL5 PDU VCC transport"},
{ 0x0f, "Frame-Relay Port mode"},
{ 0x10, "SONET/SDH Circuit Emulation over Packet"},
{ 0x11, "Structure-agnostic E1 over Packet"},
{ 0x12, "Structure-agnostic T1 (DS1) over Packet"},
{ 0x13, "Structure-agnostic E3 over Packet"},
{ 0x14, "Structure-agnostic T3 (DS3) over Packet"},
{ 0x15, "CESoPSN basic mode"},
{ 0x16, "TDMoIP basic mode"},
{ 0x17, "CESoPSN TDM with CAS"},
{ 0x18, "TDMoIP TDM with CAS"},
{ 0x40, "IP-interworking"},
{ 0, NULL}
};

17
src/bin/network/tcpdump/l2vpn.h Executable file
View File

@ -0,0 +1,17 @@
/* @(#) $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
* in its entirety, and (2) distributions including binary code include
* the above copyright notice and this paragraph in its entirety in
* the documentation or other materials provided with the distribution.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND
* WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT
* LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE.
*
* Original code by Hannes Gredler (hannes@juniper.net)
*/
extern struct tok l2vpn_encaps_values[];

View File

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

@ -0,0 +1,26 @@
/*
* Copyright (c) 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.
*
* @(#) $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 */
int snprintf(char *, size_t, const char *, ...);
int vsnprintf(char *, size_t, const char *, va_list);

View File

@ -0,0 +1,30 @@
/*
* Copyright (c) 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.
*
* @(#) $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 */
#if defined(_STDIO_H) && defined(HAVE_SETLINEBUF)
int setlinebuf(FILE *);
#endif
char *strerror(int);
int snprintf(char *, size_t, const char *, ...);
int strcasecmp(const char *, const char *);

View File

@ -0,0 +1,215 @@
/*
* Copyright (c) 1989, 1990, 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/lbl/os-sunos4.h,v 1.32.1.1 1999/10/07 23:47:13 mcr Exp $ (LBL)
*/
/* Prototypes missing in SunOS 4 */
#ifdef FILE
int _filbuf(FILE *);
int _flsbuf(u_char, FILE *);
int fclose(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fprintf(FILE *, const char *, ...);
int fputc(int, FILE *);
int fputs(const char *, FILE *);
u_int fread(void *, u_int, u_int, FILE *);
int fseek(FILE *, long, int);
u_int fwrite(const void *, u_int, u_int, FILE *);
int pclose(FILE *);
void rewind(FILE *);
void setbuf(FILE *, char *);
int setlinebuf(FILE *);
int ungetc(int, FILE *);
int vfprintf(FILE *, const char *, ...);
int vprintf(const char *, ...);
#endif
#if __GNUC__ <= 1
int read(int, char *, u_int);
int write(int, char *, u_int);
#endif
long a64l(const char *);
#ifdef __STDC__
struct sockaddr;
#endif
int accept(int, struct sockaddr *, int *);
int bind(int, struct sockaddr *, int);
int bcmp(const void *, const void *, u_int);
void bcopy(const void *, void *, u_int);
void bzero(void *, int);
int chroot(const char *);
int close(int);
void closelog(void);
int connect(int, struct sockaddr *, int);
char *crypt(const char *, const char *);
int daemon(int, int);
int fchmod(int, int);
int fchown(int, int, int);
void endgrent(void);
void endpwent(void);
void endservent(void);
#ifdef __STDC__
struct ether_addr;
#endif
struct ether_addr *ether_aton(const char *);
int flock(int, int);
#ifdef __STDC__
struct stat;
#endif
int fstat(int, struct stat *);
#ifdef __STDC__
struct statfs;
#endif
int fstatfs(int, struct statfs *);
int fsync(int);
#ifdef __STDC__
struct timeb;
#endif
int ftime(struct timeb *);
int ftruncate(int, off_t);
int getdtablesize(void);
long gethostid(void);
int gethostname(char *, int);
int getopt(int, char * const *, const char *);
int getpagesize(void);
char *getpass(char *);
int getpeername(int, struct sockaddr *, int *);
int getpriority(int, int);
#ifdef __STDC__
struct rlimit;
#endif
int getrlimit(int, struct rlimit *);
int getsockname(int, struct sockaddr *, int *);
int getsockopt(int, int, int, char *, int *);
#ifdef __STDC__
struct timeval;
struct timezone;
#endif
int gettimeofday(struct timeval *, struct timezone *);
char *getusershell(void);
char *getwd(char *);
int initgroups(const char *, int);
int ioctl(int, int, caddr_t);
int iruserok(u_long, int, char *, char *);
int isatty(int);
int killpg(int, int);
int listen(int, int);
#ifdef __STDC__
struct utmp;
#endif
void login(struct utmp *);
int logout(const char *);
off_t lseek(int, off_t, int);
int lstat(const char *, struct stat *);
int mkstemp(char *);
char *mktemp(char *);
int munmap(caddr_t, int);
void openlog(const char *, int, int);
void perror(const char *);
int printf(const char *, ...);
int puts(const char *);
long random(void);
int readlink(const char *, char *, int);
#ifdef __STDC__
struct iovec;
#endif
int readv(int, struct iovec *, int);
int recv(int, char *, u_int, int);
int recvfrom(int, char *, u_int, int, struct sockaddr *, int *);
int rename(const char *, const char *);
int rcmd(char **, u_short, char *, char *, char *, int *);
int rresvport(int *);
int send(int, char *, u_int, int);
int sendto(int, char *, u_int, int, struct sockaddr *, int);
int setenv(const char *, const char *, int);
int seteuid(int);
int setpriority(int, int, int);
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
int setpgrp(int, int);
void setpwent(void);
int setrlimit(int, struct rlimit *);
void setservent(int);
int setsockopt(int, int, int, char *, int);
int shutdown(int, int);
int sigblock(int);
void (*signal (int, void (*) (int))) (int);
int sigpause(int);
int sigsetmask(int);
#ifdef __STDC__
struct sigvec;
#endif
int sigvec(int, struct sigvec *, struct sigvec*);
int snprintf(char *, size_t, const char *, ...);
int socket(int, int, int);
int socketpair(int, int, int, int *);
int symlink(const char *, const char *);
void srandom(int);
int sscanf(char *, const char *, ...);
int stat(const char *, struct stat *);
int statfs(char *, struct statfs *);
char *strerror(int);
int strcasecmp(const char *, const char *);
#ifdef __STDC__
struct tm;
#endif
int strftime(char *, int, char *, struct tm *);
int strncasecmp(const char *, const char *, int);
long strtol(const char *, char **, int);
void sync(void);
void syslog(int, const char *, ...);
int system(const char *);
long tell(int);
time_t time(time_t *);
char *timezone(int, int);
int tolower(int);
int toupper(int);
int truncate(char *, off_t);
void unsetenv(const char *);
int vfork(void);
int vsprintf(char *, const char *, ...);
int writev(int, struct iovec *, int);
#ifdef __STDC__
struct rusage;
#endif
int utimes(const char *, struct timeval *);
#if __GNUC__ <= 1
int wait(int *);
pid_t wait3(int *, int, struct rusage *);
#endif
/* Ugly signal hacking */
#ifdef SIG_ERR
#undef SIG_ERR
#define SIG_ERR (void (*)(int))-1
#undef SIG_DFL
#define SIG_DFL (void (*)(int))0
#undef SIG_IGN
#define SIG_IGN (void (*)(int))1
#ifdef KERNEL
#undef SIG_CATCH
#define SIG_CATCH (void (*)(int))2
#endif
#undef SIG_HOLD
#define SIG_HOLD (void (*)(int))3
#endif

View File

@ -0,0 +1,39 @@
/*
* Copyright (c) 1990, 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/lbl/os-ultrix4.h,v 1.19.1.1 1999/10/07 23:47:13 mcr Exp $ (LBL)
*/
/* Prototypes missing in Ultrix 4 */
int bcmp(const char *, const char *, u_int);
void bcopy(const void *, void *, u_int);
void bzero(void *, u_int);
void endservent(void);
int getopt(int, char * const *, const char *);
#ifdef __STDC__
struct timeval;
struct timezone;
#endif
int gettimeofday(struct timeval *, struct timezone *);
int ioctl(int, int, caddr_t);
int pfopen(char *, int);
int setlinebuf(FILE *);
int socket(int, int, int);
int strcasecmp(const char *, const char *);

View File

@ -0,0 +1,13 @@
config.log
config.cache
config.status
config.h
.devel
stamp-h
stamp-h.in
Makefile
scanner.c
grammar.c
tokdefs.h
version.c
version.h

View File

@ -0,0 +1,431 @@
@(#) $Header: /tcpdump/master/libpcap/CHANGES,v 1.59.2.9 2006/09/19 17:49:59 ken Exp $ (LBL)
Tue. September 19, 2006. ken@xelerance.com. Summary for 0.9.5 libpcap release
Support for LAPD frames with vISDN
Support for ERF on channelized T1/E1 cards via DAG API
Fix capitalization that caused issues crossc compiling on Linux
Better failure detection on PacketGetAdapterNames()
Fixes for MPLS packet generation (link layer)
OP_PACKET now matches the beginning of the packet, instead of
beginning+link-layer
Add DLT/LINKTYPE for carrying FRF.16 Multi-link Frame Relay
Fix allocation of buffer for list of link-layer types
Added a new DLT and LINKTYPE value for ARINC 653 Interpartition Communcation Messages
Fixed a typo in a DLT value: it should start with DLT_ and not LINKTYPE_
Redefined DLT_CAN20B and LINKTYPE_CAN20B as #190 (as this is the right value for CAN).
Added definition for DLT_A429 and LINKTYPE_A429 as #184.
Added a new DLT and LINKTYPE value for CAN v2.0B frames.
Add support for DLT_JUNIPER_VP.
Don't double-count received packets on Linux systems that
support the PACKET_STATISTICS getsockopt() argument on
PF_PACKET sockets.
Add support for DLT_IEEE802_11 and DLT_IEEE802_11_RADIO link
layers in Windows
Add support to build libpcap.lib and wpcap.dll under Cygnus and
MingW32.
Mon. September 5, 2005. ken@xelerance.com. Summary for 0.9.4 libpcap release
Support for radiotap on Linux (Mike Kershaw)
Fixes for HP-UX
Support for additional Juniper link-layer types
Fixes for filters on MPLS-encapsulated packets
"vlan" filter fixed
"pppoed" and "pppoes" filters added; the latter modifies later
parts of the filter expression to look at the PPP headers and
headers in the PPP payload
Tue. July 5, 2005. ken@xelerance.com. Summary for 0.9.3 libpcap release
Fixes for compiling on nearly every platform,
including improved 64bit support
MSDOS Support
Add support for sending packets
OpenBSD pf format support
IrDA capture (Linux only)
Tue. March 30, 2004. mcr@sandelman.ottawa.on.ca. Summary for 3.8.3 release
Fixed minor problem in gencode.c that would appear on 64-bit
platforms.
Version number is now sane.
Mon. March 29, 2004. mcr@sandelman.ottawa.on.ca. Summary for 3.8.2 release
updates for autoconf 2.5
fixes for ppp interfaces for freebsd 4.1
pcap gencode can generate code for 802.11, IEEE1394, and pflog.
Wed. November 12, 2003. mcr@sandelman.ottawa.on.ca. Summary for 0.8 release
added pcap_findalldevs()
Win32 patches from NetGroup, Politecnico di Torino (Italy)
OpenBSD pf, DLT_PFLOG added
Many changes to ATM support.
lookup pcap_lookupnet()
Added DLT_ARCNET_LINUX, DLT_ENC, DLT_IEEE802_11_RADIO, DLT_SUNATM,
DLT_IP_OVER_FC, DLT_FRELAY, others.
Sigh. More AIX wonderfulness.
Document updates.
Changes to API: pcap_next_ex(), pcap_breakloop(), pcap_dump_flush(),
pcap_list_datalinks(), pcap_set_datalink(),
pcap_lib_version(), pcap_datalink_val_to_name(),
pcap_datalink_name_to_val(), new error returns.
Tuesday, February 25, 2003. fenner@research.att.com. 0.7.2 release
Support link types that use 802.2 always, never, and sometimes.
Don't decrease the size of the BPF buffer from the default.
Support frame relay.
Handle 32-bit timestamps in DLPI, and pass the right buffer size.
Handle Linux systems with modern kernel but without
SOL_PACKET in the userland headers.
Linux support for ARPHRD_RAWHDLC.
Handle 32-bit timestamps in snoop.
Support eg (Octane/O2xxx/O3xxx Gigabit) devices.
Add new reserved DLT types.
Monday October 23, 2001. mcr@sandelman.ottawa.on.ca. Summary for 0.7 release
Added pcap_findalldevs() call to get list of interfaces in a MI way.
pcap_stats() has been documented as to what its counters mean on
each platform.
Tuesday January 9, 2001. guy@alum.mit.edu. Summary for 0.6 release
New Linux libpcap implementation, which, in 2.2 and later
kernels, uses PF_PACKET sockets and supports kernel packet
filtering (if compiled into the kernel), and supports the "any"
device for capturing on all interfaces. Cleans up promiscuous
mode better on pre-2.2 kernels, and has various other fixes
(handles 2.4 ARPHRD_IEEE802_TR, handles ISDN devices better,
doesn't show duplicate packets on loopback interface, etc.).
Fixed HP-UX libpcap implementation to correctly get the PPA for
an interface, to allow interfaces to be opened by interface name.
libpcap savefiles have system-independent link-layer type values
in the header, rather than sometimes platform-dependent DLT_
values, to make it easier to exchange capture files between
different OSes.
Non-standard capture files produced by some Linux tcpdumps, e.g.
the one from Red Hat Linux 6.2 and later, can now be read.
Updated autoconf stock files.
Filter expressions can filter on VLAN IDs and various OSI
protocols, and work on Token Ring (with non-source-routed
packets).
"pcap_open_dead()" added to allow compiling filter expressions
to pcap code without opening a capture device or capture file.
Header files fixed to allow use in C++ programs.
Removed dependancy on native headers for packet layout.
Removed Linux specific headers that were shipped.
Security fixes: Strcpy replaced with strlcpy, sprintf replaced
with snprintf.
Fixed bug that could cause subsequent "pcap_compile()"s to fail
erroneously after one compile failed.
Assorted other bug fixes.
README.aix and README.linux files added to describe
platform-specific issues.
"getifaddrs()" rather than SIOCGIFCONF used, if available.
v0.5 Sat Jun 10 11:09:15 PDT 2000
itojun@iijlab.net
- Brought in KAME IPv6/IPsec bpf compiler.
- Fixes for NetBSD.
- Support added for OpenBSD DLT_LOOP and BSD/OS DLT_C_HDLC (Cisco HDLC),
and changes to work around different BSDs having different DLT_ types
with the same numeric value.
Assar Westerlund <assar@sics.se>
- Building outside the source code tree fixed.
- Changed to write out time stamps with 32-bit seconds and microseconds
fields, regardless of whether those fields are 32 bits or 64 bits in
the OS's native "struct timeval".
- Changed "pcap_lookupdev()" to dynamically grow the buffer into which
the list of interfaces is read as necessary in order to hold the
entire list.
Greg Troxel <gdt@ir.bbn.com>
- Added a new "pcap_compile_nopcap()", which lets you compile a filter
expression into a BPF program without having an open live capture or
capture file.
v0.4 Sat Jul 25 12:40:09 PDT 1998
- Fix endian problem with DLT_NULL devices. From FreeBSD via Bill
Fenner (fenner@parc.xerox.com)
- Fix alignment problem with FDDI under DLPI. This was causing core
dumps under Solaris.
- Added configure options to disable flex and bison. Resulted from a
bug report by barnett@grymoire.crd.ge.com (Bruce Barnett). Also added
options to disable gcc and to force a particular packet capture type.
- Added support for Fore ATM interfaces (qaa and fa) under IRIX. Thanks
to John Hawkinson (jhawk@mit.edu)
- Change Linux PPP and SLIP to use DLT_RAW since the kernel does not
supply any "link layer" data.
- Change Linux to use SIOCGIFHWADDR ioctl to determine link layer type.
Thanks to Thomas Sailer (sailer@ife.ee.ethz.ch)
- Change IRIX PPP to use DLT_RAW since the kernel does not supply any
"link layer" data.
- Modified to support the new BSD/OS 2.1 PPP and SLIP link layer header
formats.
- Added some new SGI snoop interface types. Thanks to Steve Alexander
(sca@refugee.engr.sgi.com)
- Fixes for HP-UX 10.20 (which is similar to HP-UX 9). Thanks to
Richard Allen (ra@hp.is) and Steinar Haug (sthaug@nethelp.no)
- Fddi supports broadcast as reported by Jeff Macdonald
(jeff@iacnet.com). Also correct ieee802 and arcnet.
- Determine Linux pcap buffer size at run time or else it might not be
big enough for some interface types (e.g. FDDI). Thanks to Jes
Sorensen (Jes.Sorensen@cern.ch)
- Fix some linux alignment problems.
- Document promisc argument to pcap_open_live(). Reported by Ian Marsh
(ianm@sics.se)
- Support Metricom radio packets under Linux. Thanks to Kevin Lai
(laik@gunpowder.stanford.edu)
- Bind to interface name under Linux to avoid packets from multiple
interfaces on multi-homed hosts. Thanks to Kevin Lai
(laik@gunpowder.stanford.edu)
- Change L_SET to SEEK_SET for HP-UX. Thanks to Roland Roberts
(rroberts@muller.com)
- Fixed an uninitialized memory reference found by Kent Vander Velden
(graphix@iastate.edu)
- Fixed lex pattern for IDs to allow leading digits. As reported by
Theo de Raadt (deraadt@cvs.openbsd.org)
- Fixed Linux include file problems when using GNU libc.
- Ifdef ARPHRD_FDDI since not all versions of the Linux kernel have it.
Reported reported by Eric Jacksch (jacksch@tenebris.ca)
- Fixed bug in pcap_dispatch() that kept it from returning on packet
timeouts.
- Changed ISLOOPBACK() macro when IFF_LOOPBACK isn't available to check
for "lo" followed by an eos or digit (newer versions of Linux
apparently call the loopback "lo" instead of "lo0").
- Fixed Linux networking include files to use ints instead of longs to
avoid problems with 64 bit longs on the alpha. Thanks to Cristian
Gafton (gafton@redhat.com)
v0.3 Sat Nov 30 20:56:27 PST 1996
- Added Linux support.
- Fixed savefile bugs.
- Solaris x86 fix from Tim Rylance (t.rylance@elsevier.nl)
- Add support for bpf kernel port filters.
- Remove duplicate atalk protocol table entry. Thanks to Christian
Hopps (chopps@water.emich.edu)
- Fixed pcap_lookupdev() to ignore nonexistent devices. This was
reported to happen under BSD/OS by David Vincenzetti
(vince@cryptonet.it)
- Avoid solaris compiler warnings. Thanks to Bruce Barnett
(barnett@grymoire.crd.ge.com)
v0.2.1 Sun Jul 14 03:02:26 PDT 1996
- Fixes for HP-UX 10. Thanks in part to to Thomas Wolfram
(wolf@prz.tu-berlin.de) and Rick Jones (raj@hpisrdq.cup.hp.com)
- Added support for SINIX. Thanks to Andrej Borsenkow
(borsenkow.msk@sni.de)
- Fixes for AIX (although this system is not yet supported). Thanks to
John Hawkinson (jhawk@mit.edu)
- Use autoconf's idea of the top level directory in install targets.
Thanks to John Hawkinson.
- Add missing autoconf packet capture result message. Thanks to Bill
Fenner (fenner@parc.xerox.com)
- Fixed padding problems in the pf module.
- Fixed some more alignment problems on the alpha.
- Added explicit netmask support. Thanks to Steve Nuchia
(steve@research.oknet.com)
- Fixed to handle raw ip addresses such as 0.0.0.1 without "left
justifing"
- Add "sca" keyword (for DEC cluster services) as suggested by Terry
Kennedy (terry@spcvxa.spc.edu)
- Add "atalk" keyword as suggested by John Hawkinson.
- Add "igrp" keyword.
- Fixed HID definition in grammar.y to be a string, not a value.
- Use $CC when checking gcc version. Thanks to Carl Lindberg
(carl_lindberg@blacksmith.com)
- Removed obsolete reference to pcap_immediate() from the man page.
Michael Stolarchuk (mts@terminator.rs.itd.umich.edu)
- DLT_NULL has a 4 byte family header. Thanks to Jeffrey Honig
(jch@bsdi.com)
v0.2 Sun Jun 23 02:28:42 PDT 1996
- Add support for HP-UX. Resulted from code contributed by Tom Murray
(tmurray@hpindck.cup.hp.com) and Philippe-Andri Prindeville
(philipp@res.enst.fr)
- Update INSTALL with a reminder to install include files. Thanks to
Mark Andrews (mandrews@aw.sgi.com)
- Fix bpf compiler alignment bug on the alpha.
- Use autoconf to detect architectures that can't handle misaligned
accesses.
- Added loopback support for snoop. Resulted from report Steve
Alexander (sca@engr.sgi.com)
v0.1 Fri Apr 28 18:11:03 PDT 1995
- Fixed compiler and optimizer bugs. The BPF filter engine uses unsigned
comparison operators, while the code generator and optimizer assumed
signed semantics in several places. Thanks to Charlie Slater
(cslater@imatek.com) for pointing this out.
- Removed FDDI ifdef's, they aren't really needed. Resulted from report
by Gary Veum (veum@boa.gsfc.nasa.gov).
- Add pcap-null.c which allows offline use of libpcap on systems that
don't support live package capture. This feature resulting from a
request from Jan van Oorschot (j.p.m.voorschot@et.tudelft.nl).
- Make bpf_compile() reentrant. Fix thanks to Pascal Hennequin
(Pascal.Hennequin@hugo.int-evry.fr).
- Port to GNU autoconf.
- Fix pcap-dlpi.c to work with isdn. Resulted from report by Flemming
Johansen (fsj@csd.cri.dk).
- Handle multi-digit interface unit numbers (aka ppa's) under dlpi.
Resulted from report by Daniel Ehrlich (ehrlich@cse.psu.edu).
- Fix pcap-dlpi.c to work in non-promiscuous mode. Resulted from report
by Jeff Murphy (jcmurphy@acsu.buffalo.edu).
- Add support for "long jumps". Thanks to Jeffrey Mogul
(mogul@pa.dec.com).
- Fix minor problems when compiling with BDEBUG as noticed by Scott
Bertilson (scott@unet.umn.edu).
- Declare sys_errlist "const char *const" to avoid problems under
FreeBSD. Resulted from report by jher@eden.com.
v0.0.6 Fri Apr 28 04:07:13 PDT 1995
- Add missing variable declaration missing from 0.0.6
v0.0.5 Fri Apr 28 00:22:21 PDT 1995
- Workaround for problems when pcap_read() returns 0 due to the timeout
expiring.
v0.0.4 Thu Apr 20 20:41:48 PDT 1995
- Change configuration to not use gcc v2 flags with gcc v1.
- Fixed a bug in pcap_next(); if pcap_dispatch() returns 0, pcap_next()
should also return 0. Thanks to Richard Stevens (rstevens@noao.edu).
- Fixed configure to test for snoop before dlpi to avoid problems under
IRIX 5. Thanks to J. Eric Townsend (jet@abulafia.genmagic.com).
- Hack around deficiency in Ultrix's make.
- Fix two bugs related to the Solaris pre-5.3.2 bufmod bug; handle
savefiles that have more than snapshot bytes of data in them (so we
can read old savefiles) and avoid writing such files.
- Added checkioctl which is used with gcc to check that the
"fixincludes" script has been run.
v0.0.3 Tue Oct 18 18:13:46 PDT 1994
- Fixed configure to test for snoop before dlpi to avoid problems under
IRIX 5. Thanks to J. Eric Townsend (jet@abulafia.genmagic.com).
v0.0.2 Wed Oct 12 20:56:37 PDT 1994
- Implement timeout in the dlpi pcap_open_live(). Thanks to Richard
Stevens.
- Determine pcap link type from dlpi media type. Resulted from report
by Mahesh Jethanandani (mahesh@npix.com).
v0.0.1 Fri Jun 24 14:50:57 PDT 1994
- Fixed bug in nit_setflags() in pcap-snit.c. The streams ioctl timeout
wasn't being initialized sometimes resulting in an "NIOCSFLAGS:
Invalid argument" error under OSF/1. Reported by Matt Day
(mday@artisoft.com) and Danny Mitzel (dmitzel@whitney.hitc.com).
- Turn on FDDI support by default.
v0.0 Mon Jun 20 19:20:16 PDT 1994
- Initial release.
- Fixed bug with greater/less keywords, reported by Mark Andrews
(mandrews@alias.com).
- Fix bug where '|' was defined as BPF_AND instead of BPF_OR, reported
by Elan Amir (elan@leeb.cs.berkeley.edu).
- Machines with little-endian byte ordering are supported thanks to
Jeff Mogul.
- Add hack for version 2.3 savefiles which don't have caplen and len
swapped thanks to Vern Paxson.
- Added "&&" and "||" aliases for "and" and "or" thanks to Vern Paxson.
- Added length, inbound and outbound keywords.

View File

@ -0,0 +1,103 @@
This file lists people who have contributed to libpcap:
The current maintainers:
Bill Fenner <fenner@research.att.com>
Fulvio Risso <risso@polito.it>
Guy Harris <guy@alum.mit.edu>
Hannes Gredler <hannes@juniper.net>
Jun-ichiro itojun Hagino <itojun@iijlab.net>
Michael Richardson <mcr@sandelman.ottawa.on.ca>
Additional people who have contributed patches:
Alan Bawden <Alan@LCS.MIT.EDU>
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Albert Chin <china@thewrittenword.com>
Andrew Brown <atatat@atatdot.net>
Antti Kantee <pooka@netbsd.org>
Arkadiusz Miskiewicz <misiek@pld.org.pl>
Armando L. Caro Jr. <acaro@mail.eecis.udel.edu>
Assar Westerlund <assar@sics.se>
Brian Ginsbach <ginsbach@cray.com>
Charles M. Hannum <mycroft@netbsd.org>
Chris G. Demetriou <cgd@netbsd.org>
Chris Lightfoot <cwrl@users.sourceforge.net>
Chris Pepper <pepper@mail.reppep.com>
Daniele Orlandi <daniele@orlandi.com>
Darren Reed <darrenr@reed.wattle.id.au>
David Kaelbling <drk@sgi.com>
David Young <dyoung@ojctech.com>
Dean Gaudet <dean@arctic.org>
Don Ebright <Don.Ebright@compuware.com>
Dug Song <dugsong@monkey.org>
Eric Anderson <anderse@hpl.hp.com>
Erik de Castro Lopo <erik.de.castro.lopo@sensorynetworks.com>
Franz Schaefer <schaefer@mond.at>
Gianluca Varenni <varenni@netgroup-serv.polito.it>
Gilbert Hoyek <gil_hoyek@hotmail.com>
Gisle Vanem <giva@bgnett.no>
Graeme Hewson <ghewson@cix.compulink.co.uk>
Greg Stark <gsstark@mit.edu>
Greg Troxel <gdt@ir.bbn.com>
Guillaume Pelat <endymion_@users.sourceforge.net>
Hyung Sik Yoon <hsyn@kr.ibm.com>
Igor Khristophorov <igor@atdot.org>
Jan-Philip Velders <jpv@veldersjes.net>
Jason R. Thorpe <thorpej@netbsd.org>
Javier Achirica <achirica@ttd.net>
Jean Tourrilhes <jt@hpl.hp.com>
Jefferson Ogata <jogata@nodc.noaa.gov>
Jesper Peterson <jesper@endace.com>
John Bankier <jbankier@rainfinity.com>
Jon Lindgren <jonl@yubyub.net>
Juergen Schoenwaelder <schoenw@ibr.cs.tu-bs.de>
Kazushi Sugyo <sugyo@pb.jp.nec.com>
Klaus Klein <kleink@netbsd.org>
Koryn Grant <koryn@endace.com>
Krzysztof Halasa <khc@pm.waw.pl>
Lorenzo Cavallaro <sullivan@sikurezza.org>
Loris Degioanni <loris@netgroup-serv.polito.it>
Love Hörnquist-Åstrand <lha@stacken.kth.se>
Maciej W. Rozycki <macro@ds2.pg.gda.pl>
Marcus Felipe Pereira <marcus@task.com.br>
Mark C. Brown <mbrown@hp.com>
Mark Pizzolato <List-tcpdump-workers@subscriptions.pizzolato.net>
Martin Husemann <martin@netbsd.org>
Matthew Luckie <mjl@luckie.org.nz>
Mike Kershaw <dragorn@kismetwireless.net>
Mike Wiacek <mike@iroot.net>
Monroe Williams <monroe@pobox.com>
Nicolas Dade <ndade@nsd.dyndns.org>
Octavian Cerna <tavy@ylabs.com>
Olaf Kirch <okir@caldera.de>
Ollie Wild <aaw@users.sourceforge.net>
Onno van der Linden <onno@simplex.nl>
Patrick Marie <mycroft@virgaria.org>
Paul Mundt <lethal@linux-sh.org>
Pavel Kankovsky <kan@dcit.cz>
Pawel Pokrywka <publicpp@gmail.com>
Peter Fales <peter@fales-lorenz.net>
Peter Jeremy <peter.jeremy@alcatel.com.au>
Phil Wood <cpw@lanl.gov>
Rafal Maszkowski <rzm@icm.edu.pl>
Rick Jones <raj@cup.hp.com>
Scott Barron <sb125499@ohiou.edu>
Scott Gifford <sgifford@tir.com>
Sebastian Krahmer <krahmer@cs.uni-potsdam.de>
Shaun Clowes <delius@progsoc.uts.edu.au>
Solomon Peachy <pizza@shaftnet.org>
Stefan Hudson <hudson@mbay.net>
Takashi Yamamoto <yamt@mwd.biglobe.ne.jp>
Tanaka Shin-ya <zstanaka@archer.livedoor.com>
Tony Li <tli@procket.com>
Torsten Landschoff <torsten@debian.org>
Uns Lider <unslider@miranda.org>
Uwe Girlich <Uwe.Girlich@philosys.de>
Xianjie Zhang <xzhang@cup.hp.com>
Yen Yen Lim
Yoann Vandoorselaere <yoann@prelude-ids.org>
The original LBL crew:
Steve McCanne
Craig Leres
Van Jacobson

View File

@ -0,0 +1,33 @@
#! /bin/sh
. /etc/rc.common
StartService ()
{
#
# Unfortunately, Mac OS X's devfs is based on the old FreeBSD
# one, not the current one, so there's no way to configure it
# to create BPF devices with particular owners or groups.
# This startup item will make it owned by the admin group,
# with permissions rw-rw----, so that anybody in the admin
# group can use programs that capture or send raw packets.
#
# Change this as appropriate for your site, e.g. to make
# it owned by a particular user without changing the permissions,
# so only that user and the super-user can capture or send raw
# packets, or give it the permissions rw-r-----, so that
# only the super-user can send raw packets but anybody in the
# admin group can capture packets.
#
chgrp admin /dev/bpf*
chmod g+rw /dev/bpf*
}
StopService ()
{
return 0;
}
RestartService () { StartService; }
RunService "$1"

View File

@ -0,0 +1,4 @@
{
Description = "Change BPF permissions";
Provides = ("Non-root permission to capture or send raw packets");
}

View File

@ -0,0 +1,125 @@
CHANGES
ChmodBPF/ChmodBPF
ChmodBPF/StartupParameters.plist
CREDITS
FILES
INSTALL.txt
LICENSE
Makefile.in
README
README.aix
README.dag
README.hpux
README.linux
README.macosx
README.septel
README.tru64
README.Win32
SUNOS4/nit_if.o.sparc
SUNOS4/nit_if.o.sun3
SUNOS4/nit_if.o.sun4c.4.0.3c
TODO
VERSION
acconfig.h
aclocal.m4
arcnet.h
atmuni31.h
bpf/net/bpf_filter.c
bpf_dump.c
bpf_image.c
config.guess
config.h.in
config.sub
configure
configure.in
etherent.c
ethertype.h
fad-getad.c
fad-gifc.c
fad-glifc.c
fad-null.c
fad-win32.c
gencode.c
gencode.h
grammar.y
inet.c
install-sh
lbl/os-aix4.h
lbl/os-hpux11.h
lbl/os-osf4.h
lbl/os-osf5.h
lbl/os-solaris2.h
lbl/os-sunos4.h
lbl/os-ultrix4.h
llc.h
missing/snprintf.c
mkdep
msdos/bin2c.c
msdos/common.dj
msdos/makefile
msdos/makefile.dj
msdos/makefile.wc
msdos/ndis2.c
msdos/ndis2.h
msdos/ndis_0.asm
msdos/pkt_rx0.asm
msdos/pkt_rx1.s
msdos/pktdrvr.c
msdos/pktdrvr.h
msdos/readme.dos
nametoaddr.c
nlpid.h
optimize.c
packaging/pcap.spec
packaging/pcap.spec.in
pcap-bpf.c
pcap-bpf.h
pcap-dag.c
pcap-dag.h
pcap-dlpi.c
pcap-dos.c
pcap-dos.h
pcap-enet.c
pcap-int.h
pcap-linux.c
pcap-namedb.h
pcap-nit.c
pcap-nit.h
pcap-null.c
pcap-pf.c
pcap-pf.h
pcap-septel.c
pcap-septel.h
pcap-stdinc.h
pcap-snit.c
pcap-snoop.c
pcap-win32.c
pcap.3
pcap.c
pcap.h
pf.h
ppp.h
savefile.c
scanner.l
sll.h
sunatmpos.h
Win32/Include/Gnuc.h
Win32/Include/addrinfo.h
Win32/Include/bittypes.h
Win32/Include/cdecl_ext.h
Win32/Include/inetprivate.h
Win32/Include/ip6_misc.h
Win32/Include/sockstorage.h
Win32/Include/arpa/nameser.h
Win32/Include/net/if.h
Win32/Include/net/netdb.h
Win32/Include/net/paths.h
Win32/Src/ffs.c
Win32/Src/getaddrinfo.c
Win32/Src/getnetbynm.c
Win32/Src/getnetent.c
Win32/Src/getopt.c
Win32/Src/getservent.c
Win32/Src/inet_aton.c
Win32/Src/inet_net.c
Win32/Src/inet_pton.c

View File

@ -0,0 +1,383 @@
@(#) $Header: /tcpdump/master/libpcap/INSTALL.txt,v 1.12.2.1 2005/06/20 21:30:14 guy Exp $ (LBL)
To build libpcap, run "./configure" (a shell script). The configure
script will determine your system attributes and generate an
appropriate Makefile from Makefile.in. Next run "make". If everything
goes well you can su to root and run "make install". However, you need
not install libpcap if you just want to build tcpdump; just make sure
the tcpdump and libpcap directory trees have the same parent
directory.
If configure says:
configure: warning: cannot determine packet capture interface
configure: warning: (see INSTALL for more info)
then your system either does not support packet capture or your system
does support packet capture but libpcap does not support that
particular type. (If you have HP-UX, see below.) If your system uses a
packet capture not supported by libpcap, please send us patches; don't
forget to include an autoconf fragment suitable for use in
configure.in.
It is possible to override the default packet capture type, although
the circumstance where this works are limited. For example if you have
installed bpf under SunOS 4 and wish to build a snit libpcap:
./configure --with-pcap=snit
Another example is to force a supported packet capture type in the case
where the configure scripts fails to detect it.
You will need an ANSI C compiler to build libpcap. 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/
If you use flex, you must use version 2.4.6 or higher. The configure
script automatically detects the version of flex and will not use it
unless it is new enough. You can use "flex -V" to see what version you
have (unless it's really old). The current version of flex is available
via anonymous ftp:
ftp://ftp.ee.lbl.gov/flex-*.tar.Z
As of this writing, the current version is 2.5.4.
If you use bison, you must use flex (and visa versa). The configure
script automatically falls back to lex and yacc if both flex and bison
are not found.
Sometimes the stock C compiler does not interact well with flex and
bison. The list of problems includes undefined references for alloca.
You can get around this by installing gcc or manually disabling flex
and bison with:
./configure --without-flex --without-bison
If your system only has AT&T lex, this is okay unless your libpcap
program uses other lex/yacc generated code. (Although it's possible to
map the yy* identifiers with a script, we use flex and bison so we
don't feel this is necessary.)
Some systems support the Berkeley Packet Filter natively; for example
out of the box OSF and BSD/OS have bpf. If your system does not support
bpf, you will need to pick up:
ftp://ftp.ee.lbl.gov/bpf-*.tar.Z
Note well: you MUST have kernel source for your operating system in
order to install bpf. An exception is SunOS 4; the bpf distribution
includes replacement kernel objects for some of the standard SunOS 4
network device drivers. See the bpf INSTALL document for more
information.
If you use Solaris, there is a bug with bufmod(7) that is fixed in
Solaris 2.3.2 (aka SunOS 5.3.2). Setting a snapshot length with the
broken bufmod(7) results in data be truncated from the FRONT of the
packet instead of the end. The work around is to not set a snapshot
length but this results in performance problems since the entire packet
is copied to user space. If you must run an older version of Solaris,
there is a patch available from Sun; ask for bugid 1149065. After
installing the patch, use "setenv BUFMOD_FIXED" to enable use of
bufmod(7). However, we recommend you run a more current release of
Solaris.
If you use the SPARCompiler, you must be careful to not use the
/usr/ucb/cc interface. If you do, you will get bogus warnings and
perhaps errors. Either make sure your path has /opt/SUNWspro/bin
before /usr/ucb or else:
setenv CC /opt/SUNWspro/bin/cc
before running configure. (You might have to do a "make distclean"
if you already ran configure once).
Also note that "make depend" won't work; while all of the known
universe uses -M, the SPARCompiler uses -xM to generate makefile
dependencies.
If you are trying to do packet capture with a FORE ATM card, you may or
may not be able to. They usually only release their driver in object
code so unless their driver supports packet capture, there's not much
libpcap can do.
If you get an error like:
tcpdump: recv_ack: bind error 0x???
when using DLPI, look for the DL_ERROR_ACK error return values, usually
in /usr/include/sys/dlpi.h, and find the corresponding value.
Under {DEC OSF/1, Digital UNIX, Tru64 UNIX}, packet capture must be
enabled before it can be used. For instructions on how to enable packet
filter support, see:
ftp://ftp.digital.com/pub/Digital/dec-faq/Digital-UNIX
Look for the "How do I configure the Berkeley Packet Filter and capture
tcpdump traces?" item.
Once you enable packet filter support, your OSF system will support bpf
natively.
Under Ultrix, packet capture must be enabled before it can be used. For
instructions on how to enable packet filter support, see:
ftp://ftp.digital.com/pub/Digital/dec-faq/ultrix
If you use HP-UX, you must have at least version 9 and either the
version of cc that supports ANSI C (cc -Aa) or else use the GNU C
compiler. You must also buy the optional streams package. If you don't
have:
/usr/include/sys/dlpi.h
/usr/include/sys/dlpi_ext.h
then you don't have the streams package. In addition, we believe you
need to install the "9.X LAN and DLPI drivers cumulative" patch
(PHNE_6855) to make the version 9 DLPI work with libpcap.
The DLPI streams package is standard starting with HP-UX 10.
The HP implementation of DLPI is a little bit eccentric. Unlike
Solaris, you must attach /dev/dlpi instead of the specific /dev/*
network pseudo device entry in order to capture packets. The PPA is
based on the ifnet "index" number. Under HP-UX 9, it is necessary to
read /dev/kmem and the kernel symbol file (/hp-ux). Under HP-UX 10,
DLPI can provide information for determining the PPA. It does not seem
to be possible to trace the loopback interface. Unlike other DLPI
implementations, PHYS implies MULTI and SAP and you get an error if you
try to enable more than one promiscuous mode at a time.
It is impossible to capture outbound packets on HP-UX 9. To do so on
HP-UX 10, you will, apparently, need a late "LAN products cumulative
patch" (at one point, it was claimed that this would be PHNE_18173 for
s700/10.20; at another point, it was claimed that the required patches
were PHNE_20892, PHNE_20725 and PHCO_10947, or newer patches), and to do
so on HP-UX 11 you will, apparently, need the latest lancommon/DLPI
patches and the latest driver patch for the interface(s) in use on HP-UX
11 (at one point, it was claimed that patches PHNE_19766, PHNE_19826,
PHNE_20008, and PHNE_20735 did the trick).
Furthermore, on HP-UX 10, you will need to turn on a kernel switch by
doing
echo 'lanc_outbound_promisc_flag/W 1' | adb -w /stand/vmunix /dev/mem
You would have to arrange that this happen on reboots; the right way to
do that would probably be to put it into an executable script file
"/sbin/init.d/outbound_promisc" and making
"/sbin/rc2.d/S350outbound_promisc" a symbolic link to that script.
Finally, testing shows that there can't be more than one simultaneous
DLPI user per network interface.
If you use Linux, this version of libpcap is known to compile and run
under Red Hat 4.0 with the 2.0.25 kernel. It may work with earlier 2.X
versions but is guaranteed not to work with 1.X kernels. Running more
than one libpcap program at a time, on a system with a 2.0.X kernel, can
cause problems since promiscuous mode is implemented by twiddling the
interface flags from the libpcap application; the packet capture
mechanism in the 2.2 and later kernels doesn't have this problem. Also,
packet timestamps aren't very good. This appears to be due to haphazard
handling of the timestamp in the kernel.
Note well: there is rumoured to be a version of tcpdump floating around
called 3.0.3 that includes libpcap and is supposed to support Linux.
You should be advised that neither the Network Research Group at LBNL
nor the Tcpdump Group ever generated a release with this version number.
The LBNL Network Research Group notes with interest that a standard
cracker trick to get people to install trojans is to distribute bogus
packages that have a version number higher than the current release.
They also noted with annoyance that 90% of the Linux related bug reports
they got are due to changes made to unofficial versions of their page.
If you are having trouble but aren't using a version that came from
tcpdump.org, please try that before submitting a bug report!
On Linux, libpcap will not work if the kernel does not have the packet
socket option enabled; see the README.linux file for information about
this.
If you use AIX, you may not be able to build libpcap from this release.
We do not have an AIX system in house so it's impossible for us to test
AIX patches submitted to us. We are told that you must link against
/lib/pse.exp, that you must use AIX cc or a GNU C compiler newer than
2.7.2, and that you may need to run strload before running a libpcap
application.
Read the README.aix file for information on installing libpcap and
configuring your system to be able to support libpcap.
If you use NeXTSTEP, you will not be able to build libpcap from this
release. We hope to support this operating system in some future
release of libpcap.
If you use SINIX, you should be able to build libpcap from this
release. It is known to compile and run on SINIX-Y/N 5.42 with the C-DS
V1.0 or V1.1 compiler. But note that in some releases of SINIX, yacc
emits incorrect code; if grammar.y fails to compile, change every
occurence of:
#ifdef YYDEBUG
to:
#if YYDEBUG
Another workaround is to use flex and bison.
If you use SCO, you might have trouble building libpcap from this
release. We do not have a machine running SCO and have not had reports
of anyone successfully building on it. Since SCO apparently supports
DLPI, it's possible the current version works. Meanwhile, SCO provides
a tcpdump binary as part of their "Network/Security Tools" package:
http://www.sco.com/technology/internet/goodies/#SECURITY
There is also a README that explains how to enable packet capture.
If you use UnixWare, you will not be able to build libpcap from this
release. We hope to support this operating system in some future
release of libpcap. Meanwhile, there appears to be an UnixWare port of
libpcap 0.0 (and tcpdump 3.0) in:
ftp://ftp1.freebird.org/pub/mirror/freebird/internet/systools/
UnixWare appears to use a hacked version of DLPI.
If linking tcpdump fails with "Undefined: _alloca" when using bison on
a Sun4, your version of bison is broken. In any case version 1.16 or
higher is recommended (1.14 is known to cause problems 1.16 is known to
work). Either pick up a current version from:
ftp://ftp.gnu.org/pub/gnu/bison
or hack around it by inserting the lines:
#ifdef __GNUC__
#define alloca __builtin_alloca
#else
#ifdef sparc
#include <alloca.h>
#else
char *alloca ();
#endif
#endif
right after the (100 line!) GNU license comment in bison.simple, remove
grammar.[co] and fire up make again.
If you use SunOS 4, your kernel must support streams NIT. If you run a
libpcap program and it dies with:
/dev/nit: No such device
You must add streams NIT support to your kernel configuration, run
config and boot the new kernel.
If you are running a version of SunOS earlier than 4.1, you will need
to replace the Sun supplied /sys/sun{3,4,4c}/OBJ/nit_if.o with the
appropriate version from this distribution's SUNOS4 subdirectory and
build a new kernel:
nit_if.o.sun3-sunos4 (any flavor of sun3)
nit_if.o.sun4c-sunos4.0.3c (SS1, SS1+, IPC, SLC, etc.)
nit_if.o.sun4-sunos4 (Sun4's not covered by
nit_if.o.sun4c-sunos4.0.3c)
These nit replacements fix a bug that makes nit essentially unusable in
pre-SunOS 4.1. In addition, our sun4c-sunos4.0.3c nit gives you
timestamps to the resolution of the SS-1 clock (1 us) rather than the
lousy 20ms timestamps Sun gives you (tcpdump will print out the full
timestamp resolution if it finds it's running on a SS-1).
FILES
-----
CHANGES - description of differences between releases
ChmodBPF/* - Mac OS X startup item to set ownership and permissions
on /dev/bpf*
CREDITS - people that have helped libpcap 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.aix - notes on using libpcap on AIX
README.dag - notes on using libpcap to capture on Endace DAG devices
README.hpux - notes on using libpcap on HP-UX
README.linux - notes on using libpcap on Linux
README.macosx - notes on using libpcap on Mac OS X
README.septel - notes on using libpcap to capture on Intel/Septel devices
README.tru64 - notes on using libpcap on Digital/Tru64 UNIX
README.Win32 - notes on using libpcap on Win32 systems (with WinPcap)
SUNOS4 - pre-SunOS 4.1 replacement kernel nit modules
VERSION - version of this release
acconfig.h - support for post-2.13 autoconf
aclocal.m4 - autoconf macros
arcnet.h - ARCNET definitions
atmuni31.h - ATM Q.2931 definitions
bpf/net - copy of bpf_filter.c
bpf_dump.c - BPF program printing routines
bpf_filter.c - symlink to bpf/net/bpf_filter.c
bpf_image.c - BPF disassembly routine
config.guess - autoconf support
config.h.in - autoconf input
config.sub - autoconf support
configure - configure script (run this first)
configure.in - configure script source
etherent.c - /etc/ethers support routines
ethertype.h - Ethernet protocol types and names definitions
fad-getad.c - pcap_findalldevs() for systems with getifaddrs()
fad-gifc.c - pcap_findalldevs() for systems with only SIOCGIFLIST
fad-glifc.c - pcap_findalldevs() for systems with SIOCGLIFCONF
fad-null.c - pcap_findalldevs() for systems without capture support
fad-win32.c - pcap_findalldevs() for WinPcap
gencode.c - BPF code generation routines
gencode.h - BPF code generation definitions
grammar.y - filter string grammar
inet.c - network routines
install-sh - BSD style install script
lbl/os-*.h - OS-dependent defines and prototypes
llc.h - 802.2 LLC SAP definitions
missing/* - replacements for missing library functions
mkdep - construct Makefile dependency list
msdos/* - drivers for MS-DOS capture support
nametoaddr.c - hostname to address routines
nlpid.h - OSI network layer protocol identifier definitions
net - symlink to bpf/net
optimize.c - BPF optimization routines
packaging - packaging information for building libpcap RPMs
pcap-bpf.c - BSD Packet Filter support
pcap-bpf.h - BPF definitions
pcap-dag.c - Endace DAG device capture support
pcap-dag.h - Endace DAG device capture support
pcap-dlpi.c - Data Link Provider Interface support
pcap-dos.c - MS-DOS capture support
pcap-dos.h - headers for MS-DOS capture support
pcap-enet.c - enet support
pcap-int.h - internal libpcap definitions
pcap-linux.c - Linux packet socket support
pcap-namedb.h - public libpcap name database definitions
pcap-nit.c - SunOS Network Interface Tap support
pcap-nit.h - SunOS Network Interface Tap definitions
pcap-null.c - dummy monitor support (allows offline use of libpcap)
pcap-pf.c - Ultrix and Digital/Tru64 UNIX Packet Filter support
pcap-pf.h - Ultrix and Digital/Tru64 UNIX Packet Filter definitions
pcap-septel.c - INTEL/Septel device capture support
pcap-septel.h - INTEL/Septel device capture support
pcap-stdinc.h - includes and #defines for compiling on Win32 systems
pcap-snit.c - SunOS 4.x STREAMS-based Network Interface Tap support
pcap-snoop.c - IRIX Snoop network monitoring support
pcap-win32.c - WinPcap capture support
pcap.3 - manual entry
pcap.c - pcap utility routines
pcap.h - public libpcap definitions
pf.h - OpenBSD DLT_PFLOG definitions
ppp.h - Point to Point Protocol definitions
rawss7.h - information on DLT_ types for SS7
savefile.c - offline support
scanner.l - filter string scanner
sll.h - definitions for Linux cooked mode fake link-layer header
sunatmpos.h - definitions for SunATM capturing
Win32 - headers and routines for building on Win32 systems

View File

@ -0,0 +1,28 @@
SubDir HAIKU_TOP src bin network tcpdump libpcap ;
UseHeaders [ FDirName $(SUBDIR) ] : true ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) bpf net ] ;
local defines = [ FDefines HAVE_CONFIG_H=1 _U_=\"__attribute__((unused))\" yylval=pcap_lval ] ;
SubDirCcFlags $(defines) ;
SubDirC++Flags $(defines) ;
StaticLibrary libpcap.a :
fad-gifc.c
pcap-haiku.cpp
bpf_filter.c
bpf_image.c
bpf_dump.c
etherent.c
gencode.c
grammar.y
inet.c
nametoaddr.c
optimize.c
pcap.c
savefile.c
scanner.l
version.c
;

View File

@ -0,0 +1,19 @@
License: BSD
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 names of the authors may not be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

View File

@ -0,0 +1,239 @@
# Copyright (c) 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/libpcap/Makefile.in,v 1.99 2003/12/15 01:35:03 guy Exp $ (LBL)
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
#
# Top level hierarchy
prefix = /usr/local
exec_prefix = ${prefix}
# Pathname of directory to install the include files
includedir = ${prefix}/include
# Pathname of directory to install the library
libdir = ${exec_prefix}/lib
# Pathname of directory to install the man page
mandir = ${prefix}/man
# VPATH
srcdir = .
#
# You shouldn't need to edit anything below.
#
CC = gcc
CCOPT = -O2
INCLS = -I.
DEFS = -DHAVE_CONFIG_H -D_U_="__attribute__((unused))"
LIBS =
DYEXT = so
# Standard CFLAGS
CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
INSTALL = /bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
RANLIB = ranlib
#
# Flex and bison allow you to specify the prefixes of the global symbols
# used by the generated parser. This allows programs to use lex/yacc
# and link against libpcap. If you don't have flex or bison, get them.
#
LEX = flex -Ppcap_
YACC = bison -y -p pcap_
# 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.
.c.o:
@rm -f $@
$(CC) $(CFLAGS) -c $(srcdir)/$*.c
PSRC = pcap-haiku.c
FSRC = fad-gifc.c
SSRC =
CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c \
etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c
GENSRC = scanner.c grammar.c version.c
LIBOBJS =
SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC)
# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
# hack the extra indirection
OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
HDR = pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
ethertype.h gencode.h gnuc.h
GENHDR = \
tokdefs.h version.h
TAGHDR = \
pcap-bpf.h
TAGFILES = \
$(SRC) $(HDR) $(TAGHDR)
CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
all: libpcap.a
libpcap.a: $(OBJ)
@rm -f $@
ar rc $@ $(OBJ) $(LIBS)
$(RANLIB) $@
shared: libpcap.$(DYEXT)
#
# XXX - this works with GNU ld, but won't necessarily work with native
# ld on, for example, various SVR4-flavored platforms, or Digital UNIX.
#
libpcap.so: $(OBJ)
@rm -f $@
ld -shared -o $@.`cat VERSION` $(OBJ)
# the following rule succeeds, but the result is untested.
libpcap.dylib: $(OBJ)
rm -f libpcap*.dylib
$(CC) -dynamiclib -undefined error -o libpcap.`cat VERSION`.dylib $(OBJ) \
-install_name $(libdir)/libpcap.0.dylib -compatibility_version `cat VERSION` \
-current_version `cat VERSION`
scanner.c: $(srcdir)/scanner.l
@rm -f $@
$(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
scanner.o: scanner.c tokdefs.h
$(CC) $(CFLAGS) -c scanner.c
pcap.o: version.h
tokdefs.h: grammar.c
grammar.c: $(srcdir)/grammar.y
@rm -f grammar.c tokdefs.h
$(YACC) -d $<
mv y.tab.c grammar.c
mv y.tab.h tokdefs.h
grammar.o: grammar.c
@rm -f $@
$(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
version.o: version.c
$(CC) $(CFLAGS) -c version.c
snprintf.o: $(srcdir)/missing/snprintf.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
version.c: $(srcdir)/VERSION
@rm -f $@
sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@
#
# NOTE: this really is supposed to be static; importing a string
# from a shared library does not work very well on many
# versions of UNIX (Solaris, Linux, and the BSDs, for example),
# so we make the version string static and return it from
# a function, which does work.
#
version.h: $(srcdir)/VERSION
@rm -f $@
sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION > $@
bpf_filter.c: $(srcdir)/bpf/net/bpf_filter.c
rm -f bpf_filter.c
ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c
bpf_filter.o: bpf_filter.c
$(CC) $(CFLAGS) -c bpf_filter.c
install: libpcap.a
[ -d $(DESTDIR)$(libdir) ] || \
(mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
$(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
$(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
[ -d $(DESTDIR)$(includedir) ] || \
(mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
$(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h
$(INSTALL_DATA) $(srcdir)/pcap-bpf.h \
$(DESTDIR)$(includedir)/pcap-bpf.h
$(INSTALL_DATA) $(srcdir)/pcap-namedb.h \
$(DESTDIR)$(includedir)/pcap-namedb.h
[ -d $(DESTDIR)$(mandir)/man3 ] || \
(mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3)
$(INSTALL_DATA) $(srcdir)/pcap.3 \
$(DESTDIR)$(mandir)/man3/pcap.3
install-shared: install-shared-$(DYEXT)
install-shared-so: libpcap.so
$(INSTALL_PROGRAM) libpcap.so.`cat VERSION` $(DESTDIR)$(libdir)/libpcap.so.`cat VERSION`
install-shared-dylib: libpcap.dylib
$(INSTALL_PROGRAM) libpcap.`cat VERSION`.dylib $(DESTDIR)$(libdir)/libpcap.`cat VERSION`.dylib
VER=`cat VERSION`; cd $(DESTDIR)$(libdir) && ln -sf libpcap.$$VER.dylib libpcap.0.dylib; ln -sf libpcap.0.dylib libpcap.dylib
uninstall:
rm -f $(DESTDIR)$(libdir)/libpcap.a
rm -f $(DESTDIR)$(includedir)/pcap.h
rm -f $(DESTDIR)$(includedir)/pcap-bpf.h
rm -f $(DESTDIR)$(includedir)/pcap-namedb.h
rm -f $(DESTDIR)$(mandir)/man3/pcap.3
clean:
rm -f $(CLEANFILES) libpcap*.dylib libpcap.so*
distclean: clean
rm -f Makefile config.cache config.log config.status \
config.h gnuc.h os-proto.h bpf_filter.c stamp-h stamp-h.in
rm -rf autom4te.cache
tags: $(TAGFILES)
ctags -wtd $(TAGFILES)
packaging/pcap.spec: packaging/pcap.spec.in VERSION
RPMVERSION=`cat VERSION | sed s/-.*//g`; \
sed -e s/@VERSION@/$$RPMVERSION/ -e s/@NAME@/libpcap-`cat VERSION`/ $< > $@
tar: Makefile packaging/pcap.spec
@cwd=`pwd` ; dir=`basename $$cwd` ; name=libpcap-`cat VERSION` ; \
list="" ; tar="tar chf" ; \
for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
echo \
"rm -f ../$$name; ln -s $$dir ../$$name" ; \
rm -f ../$$name; ln -s $$dir ../$$name ; \
echo \
"(cd .. ; $$tar - [lots of files]) | gzip -c > /tmp/$$name.tar.gz" ; \
(cd .. ; $$tar - $$list) | gzip -c > /tmp/$$name.tar.gz ; \
echo \
"rm -f ../$$name" ; \
rm -f ../$$name
depend: $(GENSRC) $(GENHDR) bpf_filter.c
./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
Makefile: Makefile.in config.status
./config.status
@echo your Makefile was out of date, now run $(MAKE) again
exit 1

View File

@ -0,0 +1,239 @@
# Copyright (c) 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/libpcap/Makefile.in,v 1.99 2003/12/15 01:35:03 guy Exp $ (LBL)
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
#
# Top level hierarchy
prefix = @prefix@
exec_prefix = @exec_prefix@
# Pathname of directory to install the include files
includedir = @includedir@
# Pathname of directory to install the library
libdir = @libdir@
# Pathname of directory to install the man page
mandir = @mandir@
# VPATH
srcdir = @srcdir@
VPATH = @srcdir@
#
# You shouldn't need to edit anything below.
#
CC = @CC@
CCOPT = @V_CCOPT@
INCLS = -I. @V_INCLS@
DEFS = @DEFS@ @V_DEFS@
LIBS = @V_LIBS@
DYEXT = @DYEXT@
# Standard CFLAGS
CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
RANLIB = @RANLIB@
#
# Flex and bison allow you to specify the prefixes of the global symbols
# used by the generated parser. This allows programs to use lex/yacc
# and link against libpcap. If you don't have flex or bison, get them.
#
LEX = @V_LEX@
YACC = @V_YACC@
# 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.
.c.o:
@rm -f $@
$(CC) $(CFLAGS) -c $(srcdir)/$*.c
PSRC = pcap-@V_PCAP@.c
FSRC = fad-@V_FINDALLDEVS@.c
SSRC = @SSRC@
CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c \
etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c
GENSRC = scanner.c grammar.c version.c
LIBOBJS = @LIBOBJS@
SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC)
# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
# hack the extra indirection
OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
HDR = pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
ethertype.h gencode.h gnuc.h
GENHDR = \
tokdefs.h version.h
TAGHDR = \
pcap-bpf.h
TAGFILES = \
$(SRC) $(HDR) $(TAGHDR)
CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
all: libpcap.a
libpcap.a: $(OBJ)
@rm -f $@
ar rc $@ $(OBJ) $(LIBS)
$(RANLIB) $@
shared: libpcap.$(DYEXT)
#
# XXX - this works with GNU ld, but won't necessarily work with native
# ld on, for example, various SVR4-flavored platforms, or Digital UNIX.
#
libpcap.so: $(OBJ)
@rm -f $@
ld -shared -o $@.`cat VERSION` $(OBJ)
# the following rule succeeds, but the result is untested.
libpcap.dylib: $(OBJ)
rm -f libpcap*.dylib
$(CC) -dynamiclib -undefined error -o libpcap.`cat VERSION`.dylib $(OBJ) \
-install_name $(libdir)/libpcap.0.dylib -compatibility_version `cat VERSION` \
-current_version `cat VERSION`
scanner.c: $(srcdir)/scanner.l
@rm -f $@
$(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
scanner.o: scanner.c tokdefs.h
$(CC) $(CFLAGS) -c scanner.c
pcap.o: version.h
tokdefs.h: grammar.c
grammar.c: $(srcdir)/grammar.y
@rm -f grammar.c tokdefs.h
$(YACC) -d $<
mv y.tab.c grammar.c
mv y.tab.h tokdefs.h
grammar.o: grammar.c
@rm -f $@
$(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
version.o: version.c
$(CC) $(CFLAGS) -c version.c
snprintf.o: $(srcdir)/missing/snprintf.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
version.c: $(srcdir)/VERSION
@rm -f $@
sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@
#
# NOTE: this really is supposed to be static; importing a string
# from a shared library does not work very well on many
# versions of UNIX (Solaris, Linux, and the BSDs, for example),
# so we make the version string static and return it from
# a function, which does work.
#
version.h: $(srcdir)/VERSION
@rm -f $@
sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION > $@
bpf_filter.c: $(srcdir)/bpf/net/bpf_filter.c
rm -f bpf_filter.c
ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c
bpf_filter.o: bpf_filter.c
$(CC) $(CFLAGS) -c bpf_filter.c
install: libpcap.a
[ -d $(DESTDIR)$(libdir) ] || \
(mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
$(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
$(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
[ -d $(DESTDIR)$(includedir) ] || \
(mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
$(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h
$(INSTALL_DATA) $(srcdir)/pcap-bpf.h \
$(DESTDIR)$(includedir)/pcap-bpf.h
$(INSTALL_DATA) $(srcdir)/pcap-namedb.h \
$(DESTDIR)$(includedir)/pcap-namedb.h
[ -d $(DESTDIR)$(mandir)/man3 ] || \
(mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3)
$(INSTALL_DATA) $(srcdir)/pcap.3 \
$(DESTDIR)$(mandir)/man3/pcap.3
install-shared: install-shared-$(DYEXT)
install-shared-so: libpcap.so
$(INSTALL_PROGRAM) libpcap.so.`cat VERSION` $(DESTDIR)$(libdir)/libpcap.so.`cat VERSION`
install-shared-dylib: libpcap.dylib
$(INSTALL_PROGRAM) libpcap.`cat VERSION`.dylib $(DESTDIR)$(libdir)/libpcap.`cat VERSION`.dylib
VER=`cat VERSION`; cd $(DESTDIR)$(libdir) && ln -sf libpcap.$$VER.dylib libpcap.0.dylib; ln -sf libpcap.0.dylib libpcap.dylib
uninstall:
rm -f $(DESTDIR)$(libdir)/libpcap.a
rm -f $(DESTDIR)$(includedir)/pcap.h
rm -f $(DESTDIR)$(includedir)/pcap-bpf.h
rm -f $(DESTDIR)$(includedir)/pcap-namedb.h
rm -f $(DESTDIR)$(mandir)/man3/pcap.3
clean:
rm -f $(CLEANFILES) libpcap*.dylib libpcap.so*
distclean: clean
rm -f Makefile config.cache config.log config.status \
config.h gnuc.h os-proto.h bpf_filter.c stamp-h stamp-h.in
rm -rf autom4te.cache
tags: $(TAGFILES)
ctags -wtd $(TAGFILES)
packaging/pcap.spec: packaging/pcap.spec.in VERSION
RPMVERSION=`cat VERSION | sed s/-.*//g`; \
sed -e s/@VERSION@/$$RPMVERSION/ -e s/@NAME@/libpcap-`cat VERSION`/ $< > $@
tar: Makefile packaging/pcap.spec
@cwd=`pwd` ; dir=`basename $$cwd` ; name=libpcap-`cat VERSION` ; \
list="" ; tar="tar chf" ; \
for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
echo \
"rm -f ../$$name; ln -s $$dir ../$$name" ; \
rm -f ../$$name; ln -s $$dir ../$$name ; \
echo \
"(cd .. ; $$tar - [lots of files]) | gzip -c > /tmp/$$name.tar.gz" ; \
(cd .. ; $$tar - $$list) | gzip -c > /tmp/$$name.tar.gz ; \
echo \
"rm -f ../$$name" ; \
rm -f ../$$name
depend: $(GENSRC) $(GENHDR) bpf_filter.c
./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
Makefile: Makefile.in config.status
./config.status
@echo your Makefile was out of date, now run $(MAKE) again
exit 1

View File

@ -0,0 +1,94 @@
@(#) $Header: /tcpdump/master/libpcap/README,v 1.30 2004/10/12 02:02:28 guy Exp $ (LBL)
LIBPCAP 0.9
Now maintained by "The Tcpdump Group"
See www.tcpdump.org
Please send inquiries/comments/reports to tcpdump-workers@tcpdump.org
Anonymous CVS is available via:
cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master login
(password "anoncvs")
cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout libpcap
Version 0.9 of LIBPCAP can be retrieved with the CVS tag "libpcap_0_9rel1":
cvs -d :pserver:tcpdump@cvs.tcpdump.org:/tcpdump/master checkout -r libpcap_0_9rel1 libpcap
Please send patches against the master copy to patches@tcpdump.org.
formerly from Lawrence Berkeley National Laboratory
Network Research Group <libpcap@ee.lbl.gov>
ftp://ftp.ee.lbl.gov/libpcap.tar.Z (0.4)
This directory contains source code for libpcap, a system-independent
interface for user-level packet capture. libpcap provides a portable
framework for low-level network monitoring. Applications include
network statistics collection, security monitoring, network debugging,
etc. Since almost every system vendor provides a different interface
for packet capture, and since we've developed several tools that
require this functionality, we've created this system-independent API
to ease in porting and to alleviate the need for several
system-dependent packet capture modules in each application.
Note well: this interface is new and is likely to change.
For some platforms there are README.{system} files that discuss issues
with the OS's interface for packet capture on those platforms, such as
how to enable support for that interface in the OS, if it's not built in
by default.
The libpcap interface supports a filtering mechanism based on the
architecture in the BSD packet filter. BPF is described in the 1993
Winter Usenix paper ``The BSD Packet Filter: A New Architecture for
User-level Packet Capture''. A compressed PostScript version can be
found at
ftp://ftp.ee.lbl.gov/papers/bpf-usenix93.ps.Z
or
http://www.tcpdump.org/papers/bpf-usenix93.ps.Z
and a gzipped version can be found at
http://www.tcpdump.org/papers/bpf-usenix93.ps.gz
A PDF version can be found at
http://www.tcpdump.org/papers/bpf-usenix93.pdf
Although most packet capture interfaces support in-kernel filtering,
libpcap utilizes in-kernel filtering only for the BPF interface.
On systems that don't have BPF, all packets are read into user-space
and the BPF filters are evaluated in the libpcap library, incurring
added overhead (especially, for selective filters). Ideally, libpcap
would translate BPF filters into a filter program that is compatible
with the underlying kernel subsystem, but this is not yet implemented.
BPF is standard in 4.4BSD, BSD/OS, NetBSD, FreeBSD, and OpenBSD. DEC
OSF/1/Digital UNIX/Tru64 UNIX uses the packetfilter interface but has
been extended to accept BPF filters (which libpcap utilizes). Also, you
can add BPF filter support to Ultrix using the kernel source and/or
object patches available in:
ftp://gatekeeper.dec.com/pub/DEC/net/bpfext42.tar.Z.
Linux, in the 2.2 kernel and later kernels, has a "Socket Filter"
mechanism that accepts BPF filters; see the README.linux file for
information on configuring that option.
Problems, bugs, questions, desirable enhancements, etc. should be sent
to the address "tcpdump-workers@tcpdump.org". Bugs, support requests,
and feature requests may also be submitted on the SourceForge site for
libpcap at
http://sourceforge.net/projects/libpcap/
Source code contributions, etc. should be sent to the email address
"patches@tcpdump.org", or submitted as patches on the SourceForge site
for libpcap.
Current versions can be found at www.tcpdump.org, or the SourceForge
site for libpcap.
- The TCPdump team

View File

@ -0,0 +1,46 @@
Under Win32, libpcap is integrated in the WinPcap packet capture system.
WinPcap provides a framework that allows libpcap to capture the packets
under Windows 95, Windows 98, Windows ME, Windows NT 4, Windows 2000
and Windows XP.
WinPcap binaries and source code can be found at http://winpcap.polito.it:
they include also a developer's pack with all the necessary to compile
libpcap-based applications under Windows.
How to compile libpcap with Visual Studio
-----------------------------------------
In order to compile libpcap you will need:
- version 6 (or higher) of Microsoft Visual Studio
- The November 2001 (or later) edition of Microsoft Platform
Software Development Kit (SDK), that contains some necessary includes
for IPv6 support. You can download it from http://www.microsoft.com/sdk
- the latest WinPcap sources from http://winpcap.polito.it/install
The WinPcap source code already contains a recent (usually the latest
stable) version of libpcap. If you need to compile a different one,
simply download it from www.tcpdump.org and copy the sources in the
winpcap\wpcap\libpcap folder of the WinPcap distribution. If you want to
compile a libpcap source retrieved from the tcpdump.org CVS, you will
have to create the scanner and the grammar by hand (with lex and yacc)
or with the cygnus makefile, since The Visual Studio project is not able
to build them.
Open the project file winpcap\wpcap\prj\wpcap.dsw with Visual Studio and
build wpcap.dll. wpcap.lib, the library file to link with the applications,
will be generated in winpcap\wpcap\lib\. wpcap.dll will be generated in
winpcap\wpcap\prj\release or winpcap\wpcap\prj\debug depending on the type
of binary that is being created.
How to compile libpcap with Cygnus
----------------------------------
To build wpcap.dll, cd to the directory WPCAP/PRJ of the WinPcap source code
distribution and type "make". libwpcap.a, the library file to link with the
applications, will be generated in winpcap\wpcap\lib\. wpcap.dll will be
generated in winpcap\wpcap\prj.
Remember, you CANNOT use the MSVC-generated .lib files with gcc, use
libwpcap.a instead.
"make install" installs wpcap.dll in the Windows system folder.

View File

@ -0,0 +1,78 @@
Using BPF:
(1) AIX 4.x's version of BPF is undocumented and somewhat unstandard; the
current BPF support code includes changes that should work around
that; it appears to compile and work on at least one AIX 4.3.3
machine.
Note that the BPF driver and the "/dev/bpf" devices might not exist
on your machine; AIX's tcpdump loads the driver and creates the
devices if they don't already exist. Our libpcap should do the
same, and the configure script should detect that it's on an AIX
system and choose BPF even if the devices aren't there.
(2) If libpcap doesn't compile on your machine when configured to use
BPF, or if the workarounds fail to make it work correctly, you
should send to tcpdump-workers@tcpdump.org a detailed bug report (if
the compile fails, send us the compile error messages; if it
compiles but fails to work correctly, send us as detailed as
possible a description of the symptoms, including indications of the
network link-layer type being wrong or time stamps being wrong).
If you fix the problems yourself, please send to patches@tcpdump.org
a patch, so we can incorporate them into the next release.
If you don't fix the problems yourself, you can, as a workaround,
make libpcap use DLPI instead of BPF.
This can be done by specifying the flag:
--with-pcap=dlpi
to the "configure" script for libpcap.
If you use DLPI:
(1) It is a good idea to have the latest version of the DLPI driver on
your system, since certain versions may be buggy and cause your AIX
system to crash. DLPI is included in the fileset bos.rte.tty. I
found that the DLPI driver that came with AIX 4.3.2 was buggy, and
had to upgrade to bos.rte.tty 4.3.2.4:
lslpp -l bos.rte.tty
bos.rte.tty 4.3.2.4 COMMITTED Base TTY Support and Commands
Updates for AIX filesets can be obtained from:
ftp://service.software.ibm.com/aix/fixes/
These updates can be installed with the smit program.
(2) After compiling libpcap, you need to make sure that the DLPI driver
is loaded. Type:
strload -q -d dlpi
If the result is:
dlpi: yes
then the DLPI driver is loaded correctly.
If it is:
dlpi: no
Then you need to type:
strload -f /etc/dlpi.conf
Check again with strload -q -d dlpi that the dlpi driver is loaded.
Alternatively, you can uncomment the lines for DLPI in
/etc/pse.conf and reboot the machine; this way DLPI will always
be loaded when you boot your system.
(3) There appears to be a problem in the DLPI code in some versions of
AIX, causing a warning about DL_PROMISC_MULTI failing; this might
be responsible for DLPI not being able to capture outgoing packets.

View File

@ -0,0 +1,114 @@
The following instructions apply if you have a Linux or FreeBSD platform and
want libpcap to support the DAG range of passive network monitoring cards from
Endace (http://www.endace.com, see below for further contact details).
1) Install and build the DAG software distribution by following the
instructions supplied with that package. Current Endace customers can download
the DAG software distibution from https://www.endace.com
2) Configure libcap. To allow the 'configure' script to locate the DAG
software distribution use the '--with-dag' option:
./configure --with-dag=DIR
Where DIR is the root of the DAG software distribution, for example
/var/src/dag. If the DAG software is correctly detected 'configure' will
report:
checking whether we have DAG API... yes
If 'configure' reports that there is no DAG API, the directory may have been
incorrectly specified or the DAG software was not built before configuring
libpcap.
See also the libpcap INSTALL.txt file for further libpcap configuration
options.
Building libpcap at this stage will include support for both the native packet
capture stream (linux or bpf) and for capturing from DAG cards. To build
libpcap with only DAG support specify the capture type as 'dag' when
configuring libpcap:
./configure --with-dag=DIR --with-pcap=dag
Applications built with libpcap configured in this way will only detect DAG
cards and will not capture from the native OS packet stream.
----------------------------------------------------------------------
Libpcap when built for DAG cards against dag-2.5.1 or later releases:
Timeouts are supported. pcap_dispatch() will return after to_ms milliseconds
regardless of how many packets are received. If to_ms is zero pcap_dispatch()
will block waiting for data indefinitely.
pcap_dispatch() will block on and process a minimum of 64kB of data (before
filtering) for efficiency. This can introduce high latencies on quiet
interfaces unless a timeout value is set. The timeout expiring will override
the 64kB minimum causing pcap_dispatch() to process any available data and
return.
pcap_setnonblock is supported. When nonblock is set, pcap_dispatch() will
check once for available data, process any data available up to count, then
return immediately.
pcap_findalldevs() is supported, e.g. dag0, dag1...
Some DAG cards can provide more than one 'stream' of received data.
This can be data from different physical ports, or separated by filtering
or load balancing mechanisms. Receive streams have even numbers, e.g.
dag0:0, dag0:2 etc. Specifying transmit streams for capture is not supported.
pcap_setfilter() is supported, BPF programs run in userspace.
pcap_setdirection() is not supported. Only received traffic is captured.
DAG cards normally do not have IP or link layer addresses assigned as
they are used to passively monitor links.
pcap_breakloop() is supported.
pcap_datalink() and pcap_list_datalinks() are supported. The DAG card does
not attempt to set the correct datalink type automatically where more than
one type is possible.
pcap_stats() is supported. ps_drop is the number of packets dropped due to
RX stream buffer overflow, this count is before filters are applied (it will
include packets that would have been dropped by the filter). The RX stream
buffer size is user configurable outside libpcap, typically 16-512MB.
pcap_get_selectable_fd() is not supported, as DAG cards do not support
poll/select methods.
pcap_inject() and pcap_sendpacket() are not supported.
Some DAG cards now support capturing to multiple virtual interfaces, called
streams. Capture streams have even numbers. These are available via libpcap
as separate interfaces, e.g. dag0:0, dag0:2, dag0:4 etc. dag0:0 is the same
as dag0. These are visible via pcap_findalldevs().
libpcap now does NOT set the card's hardware snaplen (slen). This must now be
set using the appropriate DAG coniguration program, e.g. dagthree, dagfour,
dagsix, dagconfig. This is because the snaplen is currently shared between
all of the streams. In future this may change if per-stream slen is
implemented.
DAG cards by default capture entire packets including the L2
CRC/FCS. If the card is not configured to discard the CRC/FCS, this
can confuse applications that use libpcap if they're not prepared for
packets to have an FCS. Libpcap now reads the environment variable
ERF_FCS_BITS to determine how many bits of CRC/FCS to strip from the
end of the captured frame. This defaults to 32 for use with
Ethernet. If the card is configured to strip the CRC/FCS, then set
ERF_FCS_BITS=0. If used with a HDLC/PoS/PPP/Frame Relay link with 16
bit CRC/FCS, then set ERF_FCS_BITS=16.
----------------------------------------------------------------------
Please submit bug reports via <support@endace.com>.
Please also visit our Web site at:
http://www.endace.com/
For more information about Endace DAG cards contact <sales@endace.com>.

View File

@ -0,0 +1,254 @@
For HP-UX 11i (11.11) and later, there are no known issues with
promiscuous mode under HP-UX. If you are using a earlier version of
HP-UX and cannot upgrade, please continue reading.
HP-UX patches to fix packet capture problems
Note that packet-capture programs such as tcpdump may, on HP-UX, not be
able to see packets sent from the machine on which they're running.
Some articles on groups.google.com discussing this are:
http://groups.google.com/groups?selm=82ld3v%2480i%241%40mamenchi.zrz.TU-Berlin.DE
which says:
Newsgroups: comp.sys.hp.hpux
Subject: Re: Did someone made tcpdump working on 10.20 ?
Date: 12/08/1999
From: Lutz Jaenicke <jaenicke@emserv1.ee.TU-Berlin.DE>
In article <82ks5i$5vc$1@news1.dti.ne.jp>, mtsat <mtsat@iris.dti.ne.jp>
wrote:
>Hello,
>
>I downloaded and compiled tcpdump3.4 a couple of week ago. I tried to use
>it, but I can only see incoming data, never outgoing.
>Someone (raj) explained me that a patch was missing, and that this patch
>must me "patched" (poked) in order to see outbound data in promiscuous mode.
>Many things to do .... So the question is : did someone has already this
>"ready to use" PHNE_**** patch ?
Two things:
1. You do need a late "LAN products cumulative patch" (e.g. PHNE_18173
for s700/10.20).
2. You must use
echo 'lanc_outbound_promisc_flag/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem
You can insert this e.g. into /sbin/init.d/lan
Best regards,
Lutz
and
http://groups.google.com/groups?selm=88cf4t%24p03%241%40web1.cup.hp.com
which says:
Newsgroups: comp.sys.hp.hpux
Subject: Re: tcpdump only shows incoming packets
Date: 02/15/2000
From: Rick Jones <foo@bar.baz.invalid>
Harald Skotnes <harald@cc.uit.no> wrote:
> I am running HPUX 11.0 on a C200 hanging on a 100Mb switch. I have
> compiled libpcap-0.4 an tcpdump-3.4 and it seems to work. But at a
> closer look I only get to see the incoming packets not the
> outgoing. I have tried tcpflow-0.12 which also uses libpcap and the
> same thing happens. Could someone please give me a hint on how to
> get this right?
Search/Read the archives ?-)
What you are seeing is expected, un-patched, behaviour for an HP-UX
system. On 11.00, you need to install the latest lancommon/DLPI
patches, and then the latest driver patch for the interface(s) in use.
At that point, a miracle happens and you should start seeing outbound
traffic.
[That article also mentions the patch that appears below.]
and
http://groups.google.com/groups?selm=38AA973E.96BE7DF7%40cc.uit.no
which says:
Newsgroups: comp.sys.hp.hpux
Subject: Re: tcpdump only shows incoming packets
Date: 02/16/2000
From: Harald Skotnes <harald@cc.uit.no>
Rick Jones wrote:
...
> What you are seeing is expected, un-patched, behaviour for an HP-UX
> system. On 11.00, you need to install the latest lancommon/DLPI
> patches, and then the latest driver patch for the interface(s) in
> use. At that point, a miracle happens and you should start seeing
> outbound traffic.
Thanks a lot. I have this problem on several machines running HPUX
10.20 and 11.00. The machines where patched up before y2k so did not
know what to think. Anyway I have now installed PHNE_19766,
PHNE_19826, PHNE_20008, PHNE_20735 on the C200 and now I can see the
outbound traffic too. Thanks again.
(although those patches may not be the ones to install - there may be
later patches).
And another message to tcpdump-workers@tcpdump.org, from Rick Jones:
Date: Mon, 29 Apr 2002 15:59:55 -0700
From: Rick Jones
To: tcpdump-workers@tcpdump.org
Subject: Re: [tcpdump-workers] I Can't Capture the Outbound Traffic
...
http://itrc.hp.com/ would be one place to start in a search for the most
up-to-date patches for DLPI and the lan driver(s) used on your system (I
cannot guess because 9000/800 is too generic - one hs to use the "model"
command these days and/or an ioscan command (see manpage) to guess what
the drivers (btlan[3456], gelan, etc) might be involved in addition to
DLPI.
Another option is to upgrade to 11i as outbound promiscuous mode support
is there in the base OS, no patches required.
Another posting:
http://groups.google.com/groups?selm=7d6gvn%24b3%241%40ocean.cup.hp.com
indicates that you need to install the optional STREAMS product to do
captures on HP-UX 9.x:
Newsgroups: comp.sys.hp.hpux
Subject: Re: tcpdump HP/UX 9.x
Date: 03/22/1999
From: Rick Jones <foo@bar.baz>
Dave Barr (barr@cis.ohio-state.edu) wrote:
: Has anyone ported tcpdump (or something similar) to HP/UX 9.x?
I'm reasonably confident that any port of tcpdump to 9.X would require
the (then optional) STREAMS product. This would bring DLPI, which is
what one uses to access interfaces in promiscuous mode.
I'm not sure that HP even sells the 9.X STREAMS product any longer,
since HP-UX 9.X is off the pricelist (well, maybe 9.10 for the old 68K
devices).
Your best bet is to be up on 10.20 or better if that is at all
possible. If your hardware is supported by it, I'd go with HP-UX 11.
If you want to see the system's own outbound traffic, you'll never get
that functionality on 9.X, but it might happen at some point for 10.20
and 11.X.
rick jones
(as per other messages cited here, the ability to see the system's own
outbound traffic did happen).
Rick Jones reports that HP-UX 11i needs no patches for outbound
promiscuous mode support.
An additional note, from Jost Martin, for HP-UX 10.20:
Q: How do I get ethereral on HPUX to capture the _outgoing_ packets
of an interface
A: You need to get PHNE_20892,PHNE_20725 and PHCO_10947 (or
newer, this is as of 4.4.00) and its dependencies. Then you can
enable the feature as descibed below:
Patch Name: PHNE_20892
Patch Description: s700 10.20 PCI 100Base-T cumulative patch
To trace the outbound packets, please do the following
to turn on a global promiscuous switch before running
the promiscuous applications like snoop or tcpdump:
adb -w /stand/vmunix /dev/mem
lanc_outbound_promisc_flag/W 1
(adb will echo the result showing that the flag has
been changed)
$quit
(Thanks for this part to HP-support, Ratingen)
The attached hack does this and some security-related stuff
(thanks to hildeb@www.stahl.bau.tu-bs.de (Ralf Hildebrandt) who
posted the security-part some time ago)
<<hack_ip_stack>>
(Don't switch IP-forwarding off, if you need it !)
Install the hack as /sbin/init.d/hacl_ip_stack (adjust
permissions !) and make a sequencing-symlink
/sbin/rc2.d/S350hack_ip_stack pointing to this script.
Now all this is done on every reboot.
According to Rick Jones, the global promiscuous switch also has to be
turned on for HP-UX 11.00, but not for 11i - and, in fact, the switch
doesn't even exist on 11i.
Here's the "hack_ip_stack" script:
-----------------------------------Cut Here-------------------------------------
#!/sbin/sh
#
# nettune: hack kernel parms for safety
OKAY=0
ERROR=-1
# /usr/contrib/bin fuer nettune auf Pfad
PATH=/sbin:/usr/sbin:/usr/bin:/usr/contrib/bin
export PATH
##########
# main #
##########
case $1 in
start_msg)
print "Tune IP-Stack for security"
exit $OKAY
;;
stop_msg)
print "This action is not applicable"
exit $OKAY
;;
stop)
exit $OKAY
;;
start)
;; # fall through
*)
print "USAGE: $0 {start_msg | stop_msg | start | stop}" >&2
exit $ERROR
;;
esac
###########
# start #
###########
#
# tcp-Sequence-Numbers nicht mehr inkrementieren sondern random
# Syn-Flood-Protection an
# ip_forwarding aus
# Source-Routing aus
# Ausgehende Packets an ethereal/tcpdump etc.
/usr/contrib/bin/nettune -s tcp_random_seq 2 || exit $ERROR
/usr/contrib/bin/nettune -s hp_syn_protect 1 || exit $ERROR
/usr/contrib/bin/nettune -s ip_forwarding 0 || exit $ERROR
echo 'ip_block_source_routed/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem || exit $ERROR
echo 'lanc_outbound_promisc_flag/W 1' | adb -w /stand/vmunix /dev/mem || exit $ERROR
exit $OKAY
-----------------------------------Cut Here-------------------------------------

View File

@ -0,0 +1,88 @@
In order for libpcap to be able to capture packets on a Linux system,
the "packet" protocol must be supported by your kernel. If it is not,
you may get error messages such as
modprobe: can't locate module net-pf-17
in "/var/adm/messages", or may get messages such as
socket: Address family not supported by protocol
from applications using libpcap.
You must configure the kernel with the CONFIG_PACKET option for this
protocol; the following note is from the Linux "Configure.help" file for
the 2.0[.x] kernel:
Packet socket
CONFIG_PACKET
The Packet protocol is used by applications which communicate
directly with network devices without an intermediate network
protocol implemented in the kernel, e.g. tcpdump. If you want them
to work, choose Y.
This driver is also available as a module called af_packet.o ( =
code which can be inserted in and removed from the running kernel
whenever you want). If you want to compile it as a module, say M
here and read Documentation/modules.txt; if you use modprobe or
kmod, you may also want to add "alias net-pf-17 af_packet" to
/etc/modules.conf.
and the note for the 2.2[.x] kernel says:
Packet socket
CONFIG_PACKET
The Packet protocol is used by applications which communicate
directly with network devices without an intermediate network
protocol implemented in the kernel, e.g. tcpdump. If you want them
to work, choose Y. This driver is also available as a module called
af_packet.o ( = code which can be inserted in and removed from the
running kernel whenever you want). If you want to compile it as a
module, say M here and read Documentation/modules.txt. You will
need to add 'alias net-pf-17 af_packet' to your /etc/conf.modules
file for the module version to function automatically. If unsure,
say Y.
In addition, there is an option that, in 2.2 and later kernels, will
allow packet capture filters specified to programs such as tcpdump to be
executed in the kernel, so that packets that don't pass the filter won't
be copied from the kernel to the program, rather than having all packets
copied to the program and libpcap doing the filtering in user mode.
Copying packets from the kernel to the program consumes a significant
amount of CPU, so filtering in the kernel can reduce the overhead of
capturing packets if a filter has been specified that discards a
significant number of packets. (If no filter is specified, it makes no
difference whether the filtering isn't performed in the kernel or isn't
performed in user mode. :-))
The option for this is the CONFIG_FILTER option; the "Configure.help"
file says:
Socket filtering
CONFIG_FILTER
The Linux Socket Filter is derived from the Berkeley Packet Filter.
If you say Y here, user-space programs can attach a filter to any
socket and thereby tell the kernel that it should allow or disallow
certain types of data to get through the socket. Linux Socket
Filtering works on all socket types except TCP for now. See the text
file linux/Documentation/networking/filter.txt for more information.
If unsure, say N.
Statistics:
Statistics reported by pcap are platform specific. The statistics
reported by pcap_stats on Linux are as follows:
2.2.x
=====
ps_recv Number of packets that were accepted by the pcap filter
ps_drops Always 0, this statistic is not gatherd on this platform
2.4.x
=====
ps_rec Number of packets that were accepted by the pcap filter
ps_drops Number of packets that had passed filtering but were not
passed on to pcap due to things like buffer shortage, etc.
This is useful because these are packets you are interested in
but won't be reported by, for example, tcpdump output.

View File

@ -0,0 +1,43 @@
As with other systems using BPF, Mac OS X allows users with read access
to the BPF devices to capture packets with libpcap and allows users with
write access to the BPF devices to send packets with libpcap.
On some systems that use BPF, the BPF devices live on the root file
system, and the permissions and/or ownership on those devices can be
changed to give users other than root permission to read or write those
devices.
On newer versions of FreeBSD, the BPF devices live on devfs, and devfs
can be configured to set the permissions and/or ownership of those
devices to give users other than root permission to read or write those
devices.
On Mac OS X, the BPF devices live on devfs, but the OS X version of
devfs is based on an older (non-default) FreeBSD devfs, and that version
of devfs cannot be configured to set the permissions and/or ownership of
those devices.
Therefore, we supply a "startup item" for OS X that will change the
ownership of the BPF devices so that the "admin" group owns them, and
will change the permission of the BPF devices to rw-rw----, so that all
users in the "admin" group - i.e., all users with "Allow user to
administer this computer" turned on - have both read and write access to
them.
The startup item is in the ChmodBPF directory in the source tree. A
/Library/StartupItems directory should be created if it doesn't already
exist, and the ChmodBPF directory should be copied to the
/Library/StartupItems directory (copy the entire directory, so that
there's a /Library/StartupItems/ChmodBPF directory, containing all the
files in the source tree's ChmodBPF directory; don't copy the individual
items in that directory to /Library/StartupItems).
If you want to give a particular user permission to access the BPF
devices, rather than giving all administrative users permission to
access them, you can have the ChmodBPF/ChmodBPF script change the
ownership of /dev/bpf* without changing the permissions. If you want to
give a particular user permission to read and write the BPF devices and
give the administrative users permission to read but not write the BPF
devices, you can have the script change the owner to that user, the
group to "admin", and the permissions to rw-r-----. Other possibilities
are left as an exercise for the reader.

View File

@ -0,0 +1,50 @@
The following instructions apply if you have a Linux platform and want
libpcap to support the Septel range of passive network monitoring cards
from Intel (http://www.intel.com)
1) Install and build the Septel software distribution by following the
instructions supplied with that package.
2) Configure libcap. To allow the 'configure' script to locate the Septel
software distribution use the '--with-septel' option:
./configure --with-septel=DIR
where DIR is the root of the Septel software distribution, for example
/var/src/septel.
By default (if you write only ./configure --with-septel) it takes
./../septel as argument for DIR.
If the Septel software is correctly detected 'configure' will
report:
checking whether we have Septel API... yes
If 'configure' reports that there is no Septel API, the directory may have been
incorrectly specified or the Septel software was not built before configuring
libpcap.
See also the libpcap INSTALL.txt file for further libpcap configuration
options.
Building libpcap at this stage will include support for both the native
packet capture stream and for capturing from Septel cards. To build
libpcap with only Septel support specify the capture type as 'septel'
when configuring libpcap:
./configure --with-septel=DIR --with-pcap=septel
Applications built with libpcap configured in this way will only detect Septel
cards and will not capture from the native OS packet stream.
Note: As mentioned in pcap-septel.c we should first edit the system.txt
file to change the user part example (UPE) module id to 0xdd instead of
0x2d for technical reason. So this change in system.txt is crutial and
things will go wrong if it's not done. System.txt along with config.txt
are configuration files that are edited by the user before running the
gctload program that uses these files for initialising modules and
configuring parameters.
----------------------------------------------------------------------
for more information please contact me : gil_hoyek@hotmail.com

View File

@ -0,0 +1,49 @@
The following instructions are applicable to Tru64 UNIX
(formerly Digital UNIX (formerly DEC OSF/1)) version 4.0, and
probably to later versions as well; at least some options apply to
Digital UNIX 3.2 - perhaps all do.
In order to use kernel packet filtering on this system, you have
to configure it in such a way:
Kernel configuration
--------------------
The packet filtering kernel option must be enabled at kernel
installation. If it was not the case, you can rebuild the kernel with
"doconfig -c" after adding the following line in the kernel
configuration file (/sys/conf/<HOSTNAME>):
option PACKETFILTER
or use "doconfig" without any arguments to add the packet filter driver
option via the kernel option menu (see the system administration
documentation for information on how to do this).
Device configuration
--------------------
Devices used for packet filtering must be created thanks to
the following command (executed in the /dev directory):
./MAKEDEV pfilt
Interface configuration
-----------------------
In order to capture all packets on a network, you may want to allow
applications to put the interface on that network into "local copy"
mode, so that tcpdump can see packets sent by the host on which it's
running as well as packets received by that host, and to put the
interface into "promiscuous" mode, so that tcpdump can see packets on
the network segment not sent to the host on which it's running, by using
the pfconfig(1) command:
pfconfig +c +p <network_device>
or allow application to put any interface into "local copy" or
"promiscuous" mode by using the command:
pfconfig +c +p -a
Note: all instructions given require root privileges.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,42 @@
TODO list for libpcap
=======================
Important stuff (to be done before the next release)
---------------
General
- configure should not be in the CVS. Most open source projects have an
autogen.sh script to run autoconf etc. after checkout. I think we
should stick to the standard.
- The source files should be better documented. There is no official
design guideline for what is done where. There should be a common coding
style (okay, you can guess that by looking at the code) and a guide for
what needs to be documented.
Linux kernel interface
- Currently there is a race condition in that a socket is activated at the
same time it is opened - before applying a filter. This has to
be corrected so that capture starts when pcap_read is called for the
first time.
Less urgent items
-----------------
- Better documentation and cleanup of the interface. I am seeing a few
problems at the first glance which needs fixing:
+ pcap_lookupnet makes little to no sense with protocols != IPv4
+ not very well suited for interactive programs (think ethereal). There
should be a way for the application to get a file descriptor which it
has to monitor and a callback in pcap which has to be called on
activity (XXX - "pcap_fileno()" handles the first part, although
"select()" and "poll()" don't work on BPF devices on most BSDs, and
you can call "pcap_dispatch()" as the dispatch routine after putting
the descriptor into non-blocking mode)
+ too many functions. There are a lot of functions for everything which
violates the KISS principle. Why do we need pcap_strerror, pcap_perror
and pcap_geterr?
+ the manpage has a brief description of each function but where is the
big picture? Seems like you need to buy UNP for that...

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