Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tcpdump 3.8.3

  • Loading branch information...
commit dd47fb4ef3dfc552fbf04aacd6643c27da5193cf 1 parent 516b5ee
itojun authored
Showing with 34,006 additions and 6,561 deletions.
  1. +7 −2 kame/kame/tcpdump/.cvsignore
  2. +220 −1 kame/kame/tcpdump/CHANGES
  3. +120 −0 kame/kame/tcpdump/CREDITS
  4. +132 −17 kame/kame/tcpdump/FILES
  5. +137 −59 kame/kame/tcpdump/INSTALL
  6. +19 −0 kame/kame/tcpdump/LICENSE
  7. +22 −0 kame/kame/tcpdump/Makefile-devel-adds
  8. +73 −33 kame/kame/tcpdump/Makefile.in
  9. +9 −0 kame/kame/tcpdump/PLATFORMS
  10. +45 −19 kame/kame/tcpdump/README
  11. +24 −0 kame/kame/tcpdump/Readme.Win32
  12. +6 −0 kame/kame/tcpdump/TODO
  13. +1 −1  kame/kame/tcpdump/VERSION
  14. +128 −0 kame/kame/tcpdump/acconfig.h
  15. +545 −45 kame/kame/tcpdump/aclocal.m4
  16. +523 −194 kame/kame/tcpdump/addrtoname.c
  17. +9 −8 kame/kame/tcpdump/addrtoname.h
  18. +57 −0 kame/kame/tcpdump/ah.h
  19. +190 −0 kame/kame/tcpdump/aodv.h
  20. +30 −30 kame/kame/tcpdump/appletalk.h
  21. +101 −0 kame/kame/tcpdump/arcnet.h
  22. +25 −0 kame/kame/tcpdump/atm.h
  23. +87 −0 kame/kame/tcpdump/atmuni31.h
  24. +148 −95 kame/kame/tcpdump/bootp.h
  25. +7 −6 kame/kame/tcpdump/bpf_dump.c
  26. +27 −0 kame/kame/tcpdump/chdlc.h
  27. +905 −169 kame/kame/tcpdump/config.guess
  28. +293 −0 kame/kame/tcpdump/config.h.in
  29. +705 −101 kame/kame/tcpdump/config.sub
  30. +10,158 −2,417 kame/kame/tcpdump/configure
  31. +654 −171 kame/kame/tcpdump/configure.in
  32. +17 −9 kame/kame/tcpdump/decnet.h
  33. +47 −0 kame/kame/tcpdump/enc.h
  34. +68 −0 kame/kame/tcpdump/esp.h
  35. +59 −0 kame/kame/tcpdump/ether.h
  36. +56 −5 kame/kame/tcpdump/ethertype.h
  37. +61 −20 kame/kame/tcpdump/extract.h
  38. +8 −1 kame/kame/tcpdump/fddi.h
  39. +134 −0 kame/kame/tcpdump/gmpls.c
  40. +20 −0 kame/kame/tcpdump/gmpls.h
  41. +7 −8 kame/kame/tcpdump/gmt2local.c
  42. +1 −1  kame/kame/tcpdump/gmt2local.h
  43. +451 −0 kame/kame/tcpdump/icmp6.h
  44. +285 −0 kame/kame/tcpdump/ieee802_11.h
  45. +17 −20 kame/kame/tcpdump/igrp.h
  46. +183 −89 kame/kame/tcpdump/interface.h
  47. +162 −0 kame/kame/tcpdump/ip.h
  48. +194 −0 kame/kame/tcpdump/ip6.h
  49. +29 −0 kame/kame/tcpdump/ipfc.h
  50. +136 −0 kame/kame/tcpdump/ipproto.h
  51. +15 −28 kame/kame/tcpdump/ipsec_doi.h
  52. +15 −13 kame/kame/tcpdump/ipx.h
  53. +15 −86 kame/kame/tcpdump/isakmp.h
  54. +3 −23 kame/kame/tcpdump/l2tp.h
  55. +41 −0 kame/kame/tcpdump/lane.h
  56. +26 −0 kame/kame/tcpdump/lbl/os-osf4.h
  57. +1 −25 kame/kame/tcpdump/lbl/os-solaris2.h
  58. +1 −1  kame/kame/tcpdump/lbl/os-sunos4.h
  59. +1 −1  kame/kame/tcpdump/lbl/os-ultrix4.h
  60. +54 −21 kame/kame/tcpdump/llc.h
  61. +26 −6 kame/kame/tcpdump/machdep.c
  62. +2 −2 kame/kame/tcpdump/machdep.h
  63. +111 −35 kame/kame/tcpdump/makemib
  64. +205 −1 kame/kame/tcpdump/mib.h
  65. +122 −0 kame/kame/tcpdump/missing/addrinfo.h
  66. +36 −0 kame/kame/tcpdump/missing/addrsize.h
  67. +67 −0 kame/kame/tcpdump/missing/bittypes.h
  68. +67 −0 kame/kame/tcpdump/missing/datalinks.c
  69. +175 −0 kame/kame/tcpdump/missing/dlnames.c
  70. +1,115 −0 kame/kame/tcpdump/missing/getaddrinfo.c
  71. +281 −0 kame/kame/tcpdump/missing/getnameinfo.c
  72. +60 −0 kame/kame/tcpdump/missing/inet_aton.c
  73. +104 −0 kame/kame/tcpdump/missing/inet_ntop.c
  74. +58 −0 kame/kame/tcpdump/missing/inet_pton.c
  75. +36 −0 kame/kame/tcpdump/missing/resolv6.h
  76. +49 −0 kame/kame/tcpdump/missing/resolv_ext.h
  77. +632 −0 kame/kame/tcpdump/missing/snprintf.c
  78. +38 −0 kame/kame/tcpdump/missing/sockstorage.h
  79. +57 −0 kame/kame/tcpdump/missing/strdup.c
  80. +76 −0 kame/kame/tcpdump/missing/strlcat.c
  81. +73 −0 kame/kame/tcpdump/missing/strlcpy.c
  82. +83 −0 kame/kame/tcpdump/missing/strsep.c
  83. +295 −0 kame/kame/tcpdump/nameser.h
  84. +1 −1  kame/kame/tcpdump/netbios.h
  85. +453 −0 kame/kame/tcpdump/nfs.h
  86. +36 −2 kame/kame/tcpdump/nfsfh.h
  87. +4 −4 kame/kame/tcpdump/ntp.h
  88. +3 −3 kame/kame/tcpdump/oakley.h
  89. +106 −45 kame/kame/tcpdump/ospf.h
  90. +16 −18 kame/kame/tcpdump/ospf6.h
  91. +62 −0 kame/kame/tcpdump/oui.c
  92. +41 −0 kame/kame/tcpdump/oui.h
  93. +57 −22 kame/kame/tcpdump/parsenfsfh.c
  94. +56 −0 kame/kame/tcpdump/pcap-missing.h
  95. +77 −0 kame/kame/tcpdump/pf.h
  96. +18 −1 kame/kame/tcpdump/ppp.h
  97. +1,003 −0 kame/kame/tcpdump/print-802_11.c
  98. +20 −31 kame/kame/tcpdump/print-ah.c
  99. +455 −0 kame/kame/tcpdump/print-aodv.c
  100. +119 −0 kame/kame/tcpdump/print-ap1394.c
  101. +290 −0 kame/kame/tcpdump/print-arcnet.c
  102. +251 −54 kame/kame/tcpdump/print-arp.c
  103. +185 −0 kame/kame/tcpdump/print-ascii.c
  104. +96 −48 kame/kame/tcpdump/print-atalk.c
  105. +182 −92 kame/kame/tcpdump/print-atm.c
  106. +71 −0 kame/kame/tcpdump/print-beep.c
  107. +160 −0 kame/kame/tcpdump/print-bfd.c
  108. +1,859 −0 kame/kame/tcpdump/print-bgp.c
  109. +391 −154 kame/kame/tcpdump/print-bootp.c
  110. +365 −0 kame/kame/tcpdump/print-cdp.c
  111. +67 −75 kame/kame/tcpdump/print-chdlc.c
  112. +108 −0 kame/kame/tcpdump/print-cip.c
  113. +184 −0 kame/kame/tcpdump/print-cnfp.c
  114. +19 −27 kame/kame/tcpdump/print-decnet.c
  115. +609 −0 kame/kame/tcpdump/print-dhcp6.c
  116. +484 −250 kame/kame/tcpdump/print-domain.c
  117. +115 −105 kame/kame/tcpdump/print-dvmrp.c
  118. +42 −44 kame/kame/tcpdump/print-egp.c
  119. +78 −0 kame/kame/tcpdump/print-enc.c
  120. +417 −216 kame/kame/tcpdump/print-esp.c
  121. +159 −85 kame/kame/tcpdump/print-ether.c
  122. +33 −76 kame/kame/tcpdump/print-fddi.c
  123. +487 −0 kame/kame/tcpdump/print-fr.c
  124. +38 −32 kame/kame/tcpdump/print-frag6.c
  125. +335 −103 kame/kame/tcpdump/print-gre.c
  126. +136 −0 kame/kame/tcpdump/print-hsrp.c
  127. +239 −91 kame/kame/tcpdump/print-icmp.c
  128. +878 −309 kame/kame/tcpdump/print-icmp6.c
  129. +335 −0 kame/kame/tcpdump/print-igmp.c
  130. +12 −19 kame/kame/tcpdump/print-igrp.c
  131. +415 −366 kame/kame/tcpdump/print-ip.c
  132. +84 −80 kame/kame/tcpdump/print-ip6.c
  133. +209 −25 kame/kame/tcpdump/print-ip6opts.c
  134. +13 −33 kame/kame/tcpdump/print-ipcomp.c
  135. +137 −0 kame/kame/tcpdump/print-ipfc.c
  136. +32 −32 kame/kame/tcpdump/print-ipx.c
  137. +682 −355 kame/kame/tcpdump/print-isakmp.c
Sorry, we could not display the entire diff because it was too big.
View
9 kame/kame/tcpdump/.cvsignore
@@ -1,6 +1,11 @@
+version.c
Makefile
+Makefile-devel.in
+config.status
config.log
config.cache
-config.status
-version.c
+config.h
+.devel
+stamp-h
+stamp-h.in
tcpdump
View
221 kame/kame/tcpdump/CHANGES
@@ -1,4 +1,223 @@
-@(#) $Header: CHANGES,v 1.54 98/07/25 12:41:06 leres Exp $ (LBL)
+$Header: /tcpdump/master/tcpdump/CHANGES,v 1.84.2.3 2004/03/30 14:36:24 mcr Exp $
+
+Tue. March 30, 2004. mcr@sandelman.ottawa.on.ca. Summary for 3.8.3 release
+
+ No changes from 3.8.2. Version bumped only to maintain consistency
+ with libpcap 0.8.3.
+
+Mon. March 29, 2004. mcr@sandelman.ottawa.on.ca. Summary for 3.8.2 release
+
+ Fixes for print-isakmp.c CVE: CAN-2004-0183, CAN-2004-0184
+ http://www.rapid7.com/advisories/R7-0017.html
+ IP-over-IEEE1394 printing.
+ some MINGW32 changes.
+ updates for autoconf 2.5
+ fixes for print-aodv.c - check for too short packets
+ formatting changes to print-ascii for hex output.
+ check for too short packets: print-bgp.c, print-bootp.c, print-cdp.c,
+ print-chdlc.c, print-domain.c, print-icmp.c, print-icmp6.c,
+ print-ip.c, print-lwres.c, print-ospf.c, print-pim.c,
+ print-ppp.c,print-pppoe.c, print-rsvp.c, print-wb.c
+ print-ether.c - better handling of unknown types.
+ print-isoclns.c - additional decoding of types.
+ print-llc.c - strings for LLC names added.
+ print-pfloc.c - various enhancements
+ print-radius.c - better decoding to strings.
+
+Wed. November 12, 2003. mcr@sandelman.ottawa.on.ca. Summary for 3.8 release
+
+ changed syntax of -E argument so that multiple SAs can be decrypted
+ fixes for Digital Unix headers and Documentation
+ __attribute__ fixes
+ CDP changes from Terry Kennedy <terry@tmk.com>.
+ IPv6 mobility updates from Kazushi Sugyo <sugyo@pb.jp.nec.com>
+ Fixes for ASN.1 decoder for 2.100.3 forms.
+ Added a count of packets received and processed to clarify numbers.
+ Incorporated WinDUMP patches for Win32 builds.
+ PPPoE payload length headers.
+ Fixes for HP C compiler builds.
+ Use new pcap_breakloop() and pcap_findalldevs() if we can.
+ BGP output split into multiple lines.
+ Fixes to 802.11 decoding.
+ Fixes to PIM decoder.
+ SuperH is a CPU that can't handle unaligned access. Many fixes for
+ unaligned access work.
+ Fixes to Frame-Relay decoder for Q.933/922 frames.
+ Clarified when Solaris can do captures as non-root.
+ Added tests/ subdir for examples/regression tests.
+ New -U flag. -flush stdout after every packet
+ New -A flag -print ascii only
+ support for decoding IS-IS inside Cisco HDLC Frames
+ more verbosity for tftp decoder
+ mDNS decoder
+ new BFD decoder
+ cross compilation patches
+ RFC 3561 AODV support.
+ UDP/TCP pseudo-checksum properly for source-route options.
+ sanitized all files to modified BSD license
+ Add support for RFC 2625 IP-over-Fibre Channel.
+ fixes for DECnet support.
+ Support RFC 2684 bridging of Ethernet, 802.5 Token Ring, and FDDI.
+ RFC 2684 encapsulation of BPDUs.
+
+Tuesday, February 25, 2003. fenner@research.att.com. 3.7.2 release
+
+ Fixed infinite loop when parsing malformed isakmp packets.
+ (reported by iDefense; already fixed in CVS)
+ Fixed infinite loop when parsing malformed BGP packets.
+ Fixed buffer overflow with certain malformed NFS packets.
+ Pretty-print unprintable network names in 802.11 printer.
+ Handle truncated nbp (appletalk) packets.
+ Updated DHCPv6 printer to match draft-ietf-dhc-dhcpv6-22.txt
+ Print IP protocol name even if we don't have a printer for it.
+ Print IP protocol name or number for fragments.
+ Print the whole MPLS label stack, not just the top label.
+ Print request header and file handle for NFS v3 FSINFO and PATHCONF
+ requests.
+ Fix NFS packet truncation checks.
+ Handle "old" DR-Priority and Bidir-Capable PIM HELLO options.
+ Handle unknown RADIUS attributes properly.
+ Fix an ASN.1 parsing error that would cause e.g. the OID
+ 2.100.3 to be misrepresented as 4.20.3 .
+
+Monday, January 21, 2002. mcr@sandelman.ottawa.on.ca. Summary for 3.7 release
+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
View
120 kame/kame/tcpdump/CREDITS
@@ -0,0 +1,120 @@
+This file lists people who have contributed to tcpdump:
+
+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:
+
+ Andrew Brown <atatat@atatdot.net>
+ Alfredo Andres <aandres@s21sec.com>
+ Andrew Hintz <adhintz@users.sourceforge.net>
+ Andrew Tridgell <tridge@linuxcare.com>
+ Arkadiusz Miskiewicz <misiek@pld.org.pl>
+ Armando L. Caro Jr. <acaro@mail.eecis.udel.edu>
+ 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 Young <dyoung@ojctech.com>
+ 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>
+ 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>
+ 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>
+ Marc A. Lehmann <pcg@goof.com>
+ Mark Ellzey Thomas <mark@ackers.net>
+ Marko Kiiskila <carnil@cs.tut.fi>
+ Marshall Rose <mrose@dbc.mtview.ca.us>
+ Martin Husemann <martin@netbsd.org>
+ Michael Madore <mmadore@turbolinux.com>
+ Michael Shalayeff <mickey@openbsd.org>
+ 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>
+ 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>
+ Rick Jones <raj@cup.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>
+ Seth Webster <swebster@sst.ll.mit.edu>
+ Takashi Yamamoto <yamt@mwd.biglobe.ne.jp>
+ Terry Kennedy <terry@tmk.com>
+ Timo Koskiahde
+ Tony Li <tli@procket.com>
+ Uns Lider <unslider@miranda.org>
+ Wilbert de Graaf <wilbertdg@hetnet.nl>
+ Yen Yen Lim
+
+The original LBL crew:
+ Steve McCanne
+ Craig Leres
+ Van Jacobson
View
149 kame/kame/tcpdump/FILES
@@ -1,103 +1,218 @@
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
+chdlc.h
config.guess
+config.h.in
config.sub
configure
configure.in
decnet.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
igrp.h
install-sh
interface.h
+ip.h
+ip6.h
+ipfc.h
+ipproto.h
+ipsec_doi.h
ipx.h
-lbl/gnuc.h
+isakmp.h
+l2tp.h
+lane.h
+lbl/os-osf4.h
lbl/os-solaris2.h
lbl/os-sunos4.h
lbl/os-ultrix4.h
-linux-include/net/slcompress.h
-linux-include/net/slip.h
-linux-include/netinet/if_ether.h
-linux-include/netinet/in_systm.h
-linux-include/netinet/ip.h
-linux-include/netinet/ip_icmp.h
-linux-include/netinet/ip_var.h
-linux-include/netinet/tcp.h
-linux-include/netinet/tcp_var.h
-linux-include/netinet/tcpip.h
-linux-include/netinet/udp.h
-linux-include/netinet/udp_var.h
-linux-include/sys/mbuf.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
+nameser.h
netbios.h
+nfs.h
nfsfh.h
-nfsv2.h
ntp.h
+oakley.h
ospf.h
+ospf6.h
packetdat.awk
parsenfsfh.c
+pcap-missing.h
ppp.h
+print-802_11.c
+print-ap1394.c
+print-ah.c
+print-aodv.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-decnet.c
+print-dhcp6.c
print-domain.c
print-dvmrp.c
print-egp.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-krb.c
+print-l2tp.c
+print-lane.c
+print-ldp.c
print-llc.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-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-sl.c
+print-sll.c
+print-smb.c
print-snmp.c
+print-stp.c
+print-sunatm.c
print-sunrpc.c
print-tcp.c
+print-telnet.c
print-tftp.c
+print-timed.c
+print-token.c
print-udp.c
+print-vjc.c
+print-vrrp.c
print-wb.c
-savestr.c
-savestr.h
+print-zephyr.c
+route6d.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/Include/Rpc/rpc.h
+win32/Src/getopt.c
+win32/prj/GNUmakefile
+win32/prj/WinDump.dsp
+win32/prj/WinDump.dsw
View
196 kame/kame/tcpdump/INSTALL
@@ -1,4 +1,4 @@
-@(#) $Header: INSTALL,v 1.36 98/07/12 13:12:26 leres Exp $ (LBL)
+@(#) $Header: /tcpdump/master/tcpdump/INSTALL,v 1.56.2.3 2004/03/17 19:47:47 guy Exp $ (LBL)
If you have not built libpcap, do so first. See the README
file in this directory for the ftp location.
@@ -7,140 +7,218 @@ 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://prep.ai.mit.edu/pub/gnu/gcc.tar.gz
+ ftp://ftp.gnu.org/pub/gnu/gcc/
-After libpcap has been built (either install it with "make install" and
-"make install-incl" or make sure both the libpcap and tcpdump source
-trees are in the same directory), edit the BINDEST and MANDEST paths in
-Makefile.in and run ./configure (a shell script). "configure" will
+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" (and optionally
-"make install-man). 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.
+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 tcpdump is shipped with some systems, for example, DEC/OSF
-and BSD/386. Remember to remove or rename the installed binary
-when upgrading.
+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
-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.
-
-If you use OSF 4, note that that there appears to be some serious bugs
-with the stock C compiler. The configure code fragments that detect if
-the ether_header and ether_arp structs use the ether_addr struct
-generates warnings instead of fatal errors (?!?!) This makes configure
-think that the ether_arp struct is used when in fact it is not. To get
-around this, delete:
-
- -DETHER_HEADER_HAS_EA=1 -DETHER_ARP_HAS_EA=1
-
-from the Makefile after running configure (and before attempting to
-compile tcpdump.
-
-Another workaround is to use gcc.
+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. However, we are not interested
-in ascii packet printer patches. We believe adding this feature would
-make it too easy for crackers who do not have the programming skills
-needed to write a password sniffer to grab clear text passwords.
+for any modifications you need to make.
+
+Please see "PLATFORMS" for notes about tested platforms.
+
FILES
-----
-CHANGES - description of differences between releases
+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
+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
-bcopy.c - missing routine
+atm.h - ATM traffic type definitions
+atmuni31.h - ATM Q.2931 definitions
bootp.h - BOOTP definitions
-bpf_dump.c - bpf instruction pretty-printer routine
+bpf_dump.c - BPF program printing routines, in case libpcap doesn't
+ have them
+chdlc.h - Cisco HDLC definitions
config.guess - autoconf support
+config.h.in - autoconf input
config.sub - autoconf support
configure - configure script (run this first)
configure.in - configure script source
decnet.h - DECnet definitions
-ethertype.h - ethernet definitions
+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
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.h - IP protocol type value definitions
+ipsec_doi.h - ISAKMP packet definitions - RFC2407
ipx.h - IPX definitions
-lbl/gnuc.h - gcc macros and defines
-lbl/os-*.h - os dependent defines and prototypes
-linux-include/* - network include files missing on Linux
+isakmp.h - ISAKMP packet definitions - RFC2408
+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
+nameser.h - DNS definitions
netbios.h - NETBIOS definitions
+nfs.h - Network File System V2 definitions
nfsfh.h - Network File System file handle definitions
-nfsv2.h - Network File System V2 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-missing.h - declarations of functions possibly missing from libpcap
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-bootp.c - BOOTP 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-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-enc.c - OpenBSD IPsec encapsulation BPF layer printer routines
print-egp.c - External Gateway Protocol printer routines
-print-ether.c - ethernet 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-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-isoclns.c - isoclns 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-llc.c - llc printer routines
-print-netbios.c - netbios 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-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 - null printer routines
+print-null.c - BSD loopback device printer routines
print-ospf.c - Open Shortest Path First printer routines
+print-ospf6.c - IPv6 Open Shortest Path First printer routines
+print-pflog.c - OpenBSD packet filter log file printer routines
print-pim.c - Protocol Independent Multicast printer routines
print-ppp.c - Point to Point Protocol printer routines
-print-raw.c - raw printer routines
+print-pppoe.c - PPP-over-Ethernet printer routines
+print-pptp.c - Point-to-Point Tunnelling Protocol printer routines
+print-radius.c - Radius protocol printer routines
+print-raw.c - Raw IP printer routines
print-rip.c - Routing Information Protocol printer routines
+print-ripng.c - IPv6 Routing Information Protocol printer routines
+print-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-sl.c - Compressed Serial Line Internet Protocol printer routines
+print-sll.c - Linux "cooked" capture printer routines
+print-smb.c - SMB/CIFS printer routines
print-snmp.c - Simple Network Management Protocol printer routines
+print-stp.c - IEEE 802.1d spanning tree protocol printer routines
+print-sunatm.c - SunATM DLPI capture printer routines
print-sunrpc.c - Sun Remote Procedure Call printer routines
print-tcp.c - TCP printer routines
+print-telnet.c - Telnet option printer routines
print-tftp.c - Trivial File Transfer Protocol printer routines
+print-timed.c - BSD time daemon protocol printer routines
+print-token.c - Token Ring printer routines
print-udp.c - UDP printer routines
-print-wb.c - white board printer routines
-savestr.c - savestr prototypes
-savestr.h - strdup() replacement
+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
+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
+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
19 kame/kame/tcpdump/LICENSE
@@ -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
22 kame/kame/tcpdump/Makefile-devel-adds
@@ -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
106 kame/kame/tcpdump/Makefile.in
@@ -17,7 +17,7 @@
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# @(#) $Header: Makefile.in,v 1.207 97/08/17 13:53:29 leres Exp $ (LBL)
+# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.276.2.4 2004/03/28 21:25:02 fenner Exp $ (LBL)
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
@@ -27,9 +27,9 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
# Pathname of directory to install the binary
-BINDEST = @sbindir@
+sbindir = @sbindir@
# Pathname of directory to install the man page
-MANDEST = @mandir@
+mandir = @mandir@
# VPATH
srcdir = @srcdir@
@@ -43,7 +43,7 @@ CC = @CC@
PROG = tcpdump
CCOPT = @V_CCOPT@
INCLS = -I. @V_INCLS@
-DEFS = @DEFS@ -DHAVE_FDDI
+DEFS = @DEFS@ @V_DEFS@
# Standard CFLAGS
CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
@@ -55,6 +55,8 @@ LDFLAGS = @LDFLAGS@
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
@@ -63,32 +65,42 @@ INSTALL = @INSTALL@
@rm -f $@
$(CC) $(CFLAGS) -c $(srcdir)/$*.c
-CSRC = tcpdump.c \
- print-arp.c print-atalk.c print-atm.c print-bootp.c \
- print-decnet.c print-domain.c print-dvmrp.c print-egp.c \
- print-ether.c print-fddi.c print-gre.c print-icmp.c \
- print-igrp.c print-ip.c print-ipx.c print-isoclns.c print-krb.c \
- print-llc.c print-nfs.c print-ntp.c print-null.c print-ospf.c \
- print-pim.c print-ppp.c print-raw.c print-rip.c print-sl.c \
- print-snmp.c print-sunrpc.c print-tcp.c print-tftp.c print-udp.c \
- print-wb.c addrtoname.c bpf_dump.c gmt2local.c machdep.c \
- parsenfsfh.c util.c savestr.c setsignal.c \
- print-esp.c print-ah.c print-vjc.c print-isakmp.c print-chdlc.c \
- print-ipcomp.c print-mobile.c print-l2tp.c
+CSRC = addrtoname.c gmpls.c gmt2local.c machdep.c oui.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-decnet.c \
+ print-domain.c print-dvmrp.c print-enc.c print-egp.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-krb.c \
+ print-l2tp.c print-lane.c print-ldp.c print-llc.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-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-sl.c print-sll.c \
+ print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \
+ print-tcp.c print-telnet.c print-tftp.c print-timed.c \
+ print-token.c print-udp.c print-vjc.c print-vrrp.c \
+ 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@
+OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LOCALSRC:.c=.o) $(LIBOBJS)
HDR = addrtoname.h appletalk.h bootp.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 \
- savestr.c setsignal.h \
- gnuc.h ipsec_doi.h isakmp.h l2tp.h netbios.h oakley.h ospf6.h ppp.h \
- route6d.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 \
@@ -111,20 +123,49 @@ $(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: force
- $(INSTALL) -m 550 -o bin -g @V_GROUP@ $(PROG) \
- $(DESTDIR)$(BINDEST)/$(PROG)
+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
-install-man: force
- $(INSTALL) -m 444 -o bin -g bin $(srcdir)/$(PROG).1 \
- $(DESTDIR)$(MANDEST)/man1/$(PROG).1
+uninstall:
+ rm -f $(DESTDIR)$(sbindir)/$(PROG)
+ rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
-lint: $(GENSRC) force
+lint: $(GENSRC)
lint -hbxn $(SRC) | \
grep -v 'struct/union .* never defined' | \
grep -v 'possible pointer alignment problem'
@@ -134,14 +175,14 @@ clean:
distclean:
rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
- gnuc.h os-proto.h
+ config.h gnuc.h os-proto.h stamp-h stamp-h.in
tags: $(TAGFILES)
ctags -wtd $(TAGFILES)
-tar: force
+tar:
@cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
- list="" ; tar="tar chFFf" ; \
+ list="" ; tar="tar chf" ; \
for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
echo \
"rm -f ../$$name; ln -s $$dir ../$$name" ; \
@@ -153,6 +194,5 @@ tar: force
"rm -f ../$$name" ; \
rm -f ../$$name
-force: /tmp
-depend: $(GENSRC) force
- ./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
+depend: $(GENSRC)
+ ${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
View
9 kame/kame/tcpdump/PLATFORMS
@@ -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
64 kame/kame/tcpdump/README
@@ -1,20 +1,36 @@
-@(#) $Header: README,v 1.54 98/01/27 21:36:20 vern Exp $ (LBL)
+@(#) $Header: /tcpdump/master/tcpdump/README,v 1.63.2.1 2003/11/16 10:17:30 guy Exp $ (LBL)
-TCPDUMP 3.4
-Lawrence Berkeley National Laboratory
-Network Research Group
-tcpdump@ee.lbl.gov
-ftp://ftp.ee.lbl.gov/tcpdump.tar.Z
+TCPDUMP 3.8
+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.8 of TCPDUMP can be retrived with the CVS tag "tcpdump_3_8rel1":
+ cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_3_8rel1 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. The original distribution is
-available via anonymous ftp to ftp.ee.lbl.gov, in tcpdump.tar.Z.
+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 now uses libpcap, a system-independent interface for user-level
+Tcpdump uses libpcap, a system-independent interface for user-level
packet capture. Before building tcpdump, you must first retrieve and
-build libpcap, also from LBL, in:
-
- ftp://ftp.ee.lbl.gov/libpcap.tar.Z
+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
@@ -50,13 +66,24 @@ 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, source code
-contributions, etc., should be sent to the email address
-"tcpdump@ee.lbl.gov".
+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
- - 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
@@ -205,4 +232,3 @@ The method was:
- Once a week, tell your funding agent that you're discovering
wonderful things and you'll write up that research report
"real soon now".
-
View
24 kame/kame/tcpdump/Readme.Win32
@@ -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
6 kame/kame/tcpdump/TODO
@@ -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
2  kame/kame/tcpdump/VERSION
@@ -1 +1 @@
-3.4
+3.8.3
View
128 kame/kame/tcpdump/acconfig.h
@@ -0,0 +1,128 @@
+/* "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 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 sized types */
+/* XXX this should move to the more standard uint*_t */
+#undef int8_t
+#undef int16_t
+#undef int32_t
+#undef u_int16_t
+#undef u_int32_t
+#undef u_int8_t
+
+/* 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
View
590 kame/kame/tcpdump/aclocal.m4
@@ -1,4 +1,4 @@
-dnl @(#) $Header: aclocal.m4,v 1.63 98/06/12 03:44:50 leres Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/aclocal.m4,v 1.98.2.4 2004/03/28 21:04:49 fenner Exp $ (LBL)
dnl
dnl Copyright (c) 1995, 1996, 1997, 1998
dnl The Regents of the University of California. All rights reserved.
@@ -51,13 +51,13 @@ AC_DEFUN(AC_LBL_C_INIT,
$1="-O"
$2=""
if test "${srcdir}" != "." ; then
- $2="-I\$\(srcdir\)"
+ $2="-I\$(srcdir)"
fi
if test "${CFLAGS+set}" = set; then
LBL_CFLAGS="$CFLAGS"
fi
if test -z "$CC" ; then
- case "$target_os" in
+ case "$host_os" in
bsdi*)
AC_CHECK_PROG(SHLICC2, shlicc2, yes, no)
@@ -100,7 +100,7 @@ AC_DEFUN(AC_LBL_C_INIT,
ac_cv_lbl_cc_ansi_prototypes=no))
AC_MSG_RESULT($ac_cv_lbl_cc_ansi_prototypes)
if test $ac_cv_lbl_cc_ansi_prototypes = no ; then
- case "$target_os" in
+ case "$host_os" in
hpux*)
AC_MSG_CHECKING(for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE))
@@ -129,14 +129,14 @@ AC_DEFUN(AC_LBL_C_INIT,
$2="$$2 -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
- case "$target_os" in
+ case "$host_os" in
irix*)
- V_CCOPT="$V_CCOPT -xansi -signed -g3"
+ V_CCOPT="$V_CCOPT -xansi -signed -O"
;;
osf*)
- V_CCOPT="$V_CCOPT -std1 -g3"
+ V_CCOPT="$V_CCOPT -std1 -O"
;;
ultrix*)
@@ -157,6 +157,51 @@ AC_DEFUN(AC_LBL_C_INIT,
fi
])
+#
+# Try compiling a sample of the type of code that appears in
+# gencode.c with "inline", "__inline__", and "__inline".
+#
+# Autoconf's AC_C_INLINE, at least in autoconf 2.13, isn't good enough,
+# as it just tests whether a function returning "int" can be inlined;
+# at least some versions of HP's C compiler can inline that, but can't
+# inline a function that returns a struct pointer.
+#
+AC_DEFUN(AC_LBL_C_INLINE,
+ [AC_MSG_CHECKING(for inline)
+ AC_CACHE_VAL(ac_cv_lbl_inline, [
+ ac_cv_lbl_inline=""
+ ac_lbl_cc_inline=no
+ for ac_lbl_inline in inline __inline__ __inline
+ do
+ AC_TRY_COMPILE(
+ [#define inline $ac_lbl_inline
+ static inline struct iltest *foo(void);
+ struct iltest {
+ int iltest1;
+ int iltest2;
+ };
+
+ static inline struct iltest *
+ foo()
+ {
+ static struct iltest xxx;
+
+ return &xxx;
+ }],,ac_lbl_cc_inline=yes,)
+ if test "$ac_lbl_cc_inline" = yes ; then
+ break;
+ fi
+ done
+ if test "$ac_lbl_cc_inline" = yes ; then
+ ac_cv_lbl_inline=$ac_lbl_inline
+ fi])
+ if test ! -z "$ac_cv_lbl_inline" ; then
+ AC_MSG_RESULT($ac_cv_lbl_inline)
+ else
+ AC_MSG_RESULT(no)
+ fi
+ AC_DEFINE_UNQUOTED(inline, $ac_cv_lbl_inline, [Define as token for inline if inlining supported])])
+
dnl
dnl Use pfopen.c if available and pfopen() not in standard libraries
dnl Require libpcap
@@ -191,16 +236,16 @@ AC_DEFUN(AC_LBL_LIBPCAP,
AC_MSG_CHECKING(for local pcap library)
libpcap=FAIL
lastdir=FAIL
- places=`ls .. | sed -e 's,/$,,' -e 's,^,../,' | \
- egrep '/libpcap-[[0-9]]*\.[[0-9]]*(\.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
- for dir in $places ../libpcap libpcap ; do
+ places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
+ egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
+ for dir in $places $srcdir/../libpcap $srcdir/libpcap ; do
basedir=`echo $dir | sed -e 's/[[ab]][[0-9]]*$//'`
if test $lastdir = $basedir ; then
dnl skip alphas when an actual release is present
continue;
fi
lastdir=$dir
- if test -r $dir/pcap.c ; then
+ if test -r $dir/libpcap.a ; then
libpcap=$dir/libpcap.a
d=$dir
dnl continue and select the last one that exists
@@ -212,13 +257,51 @@ AC_DEFUN(AC_LBL_LIBPCAP,
if test $libpcap = FAIL ; then
AC_MSG_ERROR(see the INSTALL doc for more info)
fi
+ dnl
+ dnl Good old Red Hat Linux puts "pcap.h" in
+ dnl "/usr/include/pcap"; had the LBL folks done so,
+ dnl that would have been a good idea, but for
+ dnl the Red Hat folks to do so just breaks source
+ dnl compatibility with other systems.
+ dnl
+ dnl We work around this by assuming that, as we didn't
+ dnl find a local libpcap, libpcap is in /usr/lib or
+ dnl /usr/local/lib and that the corresponding header
+ dnl file is under one of those directories; if we don't
+ dnl find it in either of those directories, we check to
+ dnl see if it's in a "pcap" subdirectory of them and,
+ dnl if so, add that subdirectory to the "-I" list.
+ dnl
+ AC_MSG_CHECKING(for extraneous pcap header directories)
+ if test \( ! -r /usr/local/include/pcap.h \) -a \
+ \( ! -r /usr/include/pcap.h \); then
+ if test -r /usr/local/include/pcap/pcap.h; then
+ d="/usr/local/include/pcap"
+ elif test -r /usr/include/pcap/pcap.h; then
+ d="/usr/include/pcap"
+ fi
+ fi
+ if test -z "$d" ; then
+ AC_MSG_RESULT(not found)
+ else
+ $2="-I$d $$2"
+ AC_MSG_RESULT(found -- -I$d added)
+ fi
else
$1=$libpcap
- $2="-I$d $$2"
+ places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
+ egrep '/libpcap-[[0-9]]*.[[0-9]]*(.[[0-9]]*)?([[ab]][[0-9]]*)?$'`
+ if test -r $d/pcap.h; then
+ $2="-I$d $$2"
+ elif test -r $places/pcap.h; then
+ $2="-I$places $$2"
+ else
+ AC_MSG_ERROR(cannot find pcap.h, see INSTALL)
+ fi
AC_MSG_RESULT($libpcap)
fi
LIBS="$libpcap $LIBS"
- case "$target_os" in
+ case "$host_os" in
aix*)
pseexe="/lib/pse.exp"
@@ -227,8 +310,42 @@ AC_DEFUN(AC_LBL_LIBPCAP,
AC_MSG_RESULT(yes)
LIBS="$LIBS -I:$pseexe"
fi
+ #
+ # We need "-lodm" and "-lcfg", as libpcap requires them on
+ # AIX, and we just build a static libpcap.a and thus can't
+ # arrange that when you link with libpcap you automatically
+ # link with those libraries.
+ #
+ LIBS="$LIBS -lodm -lcfg"
;;
- esac])
+ esac
+
+ dnl
+ dnl Check for "pcap_list_datalinks()", "pcap_set_datalink()",
+ dnl and "pcap_datalink_name_to_val()", and use substitute versions
+ dnl if they're not present
+ dnl
+ AC_CHECK_FUNC(pcap_list_datalinks,
+ AC_DEFINE(HAVE_PCAP_LIST_DATALINKS),
+ AC_LIBOBJ(datalinks))
+ AC_CHECK_FUNC(pcap_set_datalink,
+ AC_DEFINE(HAVE_PCAP_SET_DATALINK))
+ AC_CHECK_FUNC(pcap_datalink_name_to_val,
+ [
+ AC_DEFINE(HAVE_PCAP_DATALINK_NAME_TO_VAL)
+ AC_CHECK_FUNC(pcap_datalink_val_to_description,
+ AC_DEFINE(HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION),
+ AC_LIBOBJ(dlnames))
+ ],
+ AC_LIBOBJ(dlnames))
+
+ dnl
+ dnl Check for "pcap_breakloop()"; you can't substitute for it if
+ dnl it's absent (it has hooks into the live capture routines),
+ dnl so just define the HAVE_ value if it's there.
+ dnl
+ AC_CHECK_FUNCS(pcap_breakloop)
+])
dnl
dnl Define RETSIGTYPE and RETSIGVAL
@@ -250,17 +367,17 @@ AC_DEFUN(AC_LBL_TYPE_SIGNAL,
else
AC_DEFINE(RETSIGVAL,(0))
fi
- case "$target_os" in
+ case "$host_os" in
irix*)
AC_DEFINE(_BSD_SIGNALS)
;;
*)
- dnl prefer sigset() to sigaction()
- AC_CHECK_FUNCS(sigset)
- if test $ac_cv_func_sigset = no ; then
- AC_CHECK_FUNCS(sigaction)
+ dnl prefer sigaction() to sigset()
+ AC_CHECK_FUNCS(sigaction)
+ if test $ac_cv_func_sigaction = no ; then
+ AC_CHECK_FUNCS(sigset)
fi
;;
esac])
@@ -483,9 +600,41 @@ dnl
AC_DEFUN(AC_LBL_UNALIGNED_ACCESS,
[AC_MSG_CHECKING(if unaligned accesses fail)
AC_CACHE_VAL(ac_cv_lbl_unaligned_fail,
- [case "$target_cpu" in
+ [case "$host_cpu" in
- alpha|hp*|mips|sparc)
+ #
+ # These are CPU types where:
+ #
+ # the CPU faults on an unaligned access, but at least some
+ # OSes that support that CPU catch the fault and simulate
+ # the unaligned access (e.g., Alpha/{Digital,Tru64} UNIX) -
+ # the simulation is slow, so we don't want to use it;
+ #
+ # the CPU, I infer (from the old
+ #
+ # XXX: should also check that they don't do weird things (like on arm)
+ #
+ # comment) doesn't fault on unaligned accesses, but doesn't
+ # do a normal unaligned fetch, either (e.g., presumably, ARM);
+ #
+ # for whatever reason, the test program doesn't work
+ # (this has been claimed to be the case for several of those
+ # CPUs - I don't know what the problem is; the problem
+ # was reported as "the test program dumps core" for SuperH,
+ # but that's what the test program is *supposed* to do -
+ # it dumps core before it writes anything, so the test
+ # for an empty output file should find an empty output
+ # file and conclude that unaligned accesses don't work).
+ #
+ # This run-time test won't work if you're cross-compiling, so
+ # in order to support cross-compiling for a particular CPU,
+ # we have to wire in the list of CPU types anyway, as far as
+ # I know, so perhaps we should just have a set of CPUs on
+ # which we know it doesn't work, a set of CPUs on which we
+ # know it does work, and have the script just fail on other
+ # cpu types and update it when such a failure occurs.
+ #
+ alpha*|arm*|hp*|mips*|sh*|sparc*|ia64|nv1)
ac_cv_lbl_unaligned_fail=yes
;;
@@ -540,7 +689,8 @@ EOF
dnl
dnl If using gcc and the file .devel exists:
dnl Compile with -g (if supported) and -Wall
-dnl If using gcc 2, do extra prototype checking
+dnl If using gcc 2 or later, do extra prototype checking and some other
+dnl checks
dnl If an os prototype include exists, symlink os-proto.h to it
dnl
dnl usage:
@@ -566,11 +716,11 @@ AC_DEFUN(AC_LBL_DEVEL,
fi
$1="$$1 -Wall"
if test $ac_cv_lbl_gcc_vers -gt 1 ; then
- $1="$$1 -Wmissing-prototypes -Wstrict-prototypes"
+ $1="$$1 -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -W"
fi
fi
else
- case "$target_os" in
+ case "$host_os" in
irix6*)
V_CCOPT="$V_CCOPT -n32"
@@ -580,7 +730,7 @@ AC_DEFUN(AC_LBL_DEVEL,
;;
esac
fi
- os=`echo $target_os | sed -e 's/\([[0-9]][[0-9]]*\)[[^0-9]].*$/\1/'`
+ os=`echo $host_os | sed -e 's/\([[0-9]][[0-9]]*\)[[^0-9]].*$/\1/'`
name="lbl/os-$os.h"
if test -f $name ; then
ln -s $name os-proto.h
@@ -604,13 +754,19 @@ dnl results:
dnl
dnl LIBS
dnl
+dnl XXX - "AC_LBL_LIBRARY_NET" was redone to use "AC_SEARCH_LIBS"
+dnl rather than "AC_LBL_CHECK_LIB", so this isn't used any more.
+dnl We keep it around for reference purposes in case it's ever
+dnl useful in the future.
+dnl
define(AC_LBL_CHECK_LIB,
[AC_MSG_CHECKING([for $2 in -l$1])
-dnl Use a cache variable name containing both the library and function name,
-dnl because the test really is for library $1 defining function $2, not
-dnl just for library $1. Separate tests with the same $1 and different $2's
-dnl may have different results.
+dnl Use a cache variable name containing the library, function
+dnl name, and extra libraries to link with, because the test really is
+dnl for library $1 defining function $2, when linked with potinal
+dnl library $5, not just for library $1. Separate tests with the same
+dnl $1 and different $2's or $5's may have different results.
ac_lib_var=`echo $1['_']$2['_']$5 | sed 'y%./+- %__p__%'`
AC_CACHE_VAL(ac_cv_lbl_lib_$ac_lib_var,
[ac_save_LIBS="$LIBS"
@@ -686,21 +842,365 @@ dnl
AC_DEFUN(AC_LBL_LIBRARY_NET, [
# Most operating systems have gethostbyname() in the default searched
# libraries (i.e. libc):
- AC_CHECK_FUNC(gethostbyname, ,
- # Some OSes (eg. Solaris) place it in libnsl:
- AC_LBL_CHECK_LIB(nsl, gethostbyname, ,
- # Some strange OSes (SINIX) have it in libsocket:
- AC_LBL_CHECK_LIB(socket, gethostbyname, ,
- # Unfortunately libsocket sometimes depends on libnsl.
- # AC_CHECK_LIB's API is essentially broken so the
- # following ugliness is necessary:
- AC_LBL_CHECK_LIB(socket, gethostbyname,
- LIBS="-lsocket -lnsl $LIBS",
- AC_CHECK_LIB(resolv, gethostbyname),
- -lnsl))))
- AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, ,
- AC_LBL_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", ,
- -lnsl)))
+ # Some OSes (eg. Solaris) place it in libnsl
+ # Some strange OSes (SINIX) have it in libsocket:
+ AC_SEARCH_LIBS(gethostbyname, nsl socket resolv)
+ # Unfortunately libsocket sometimes depends on libnsl and
+ # AC_SEARCH_LIBS isn't up to the task of handling dependencies like this.
+ if test "$ac_cv_search_gethostbyname" = "no"
+ then
+ AC_CHECK_LIB(socket, gethostbyname,
+ LIBS="-lsocket -lnsl $LIBS", , -lnsl)
+ fi
+ AC_SEARCH_LIBS(socket, socket, ,
+ AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl))
# DLPI needs putmsg under HPUX so test for -lstr while we're at it
- AC_CHECK_LIB(str, putmsg)
+ AC_SEARCH_LIBS(putmsg, str)
])
+
+dnl Copyright (c) 1999 WIDE Project. All rights reserved.
+dnl
+dnl Redistribution and use in source and binary forms, with or without
+dnl modification, are permitted provided that the following conditions
+dnl are met:
+dnl 1. Redistributions of source code must retain the above copyright
+dnl notice, this list of conditions and the following disclaimer.
+dnl 2. Redistributions in binary form must reproduce the above copyright
+dnl notice, this list of conditions and the following disclaimer in the
+dnl documentation and/or other materials provided with the distribution.
+dnl 3. Neither the name of the project nor the names of its contributors
+dnl may be used to endorse or promote products derived from this software
+dnl without specific prior written permission.
+dnl
+dnl THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+dnl ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+dnl IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+dnl ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+dnl FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+dnl OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+dnl LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+dnl OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+dnl SUCH DAMAGE.
+
+dnl
+dnl Checks to see if AF_INET6 is defined
+AC_DEFUN(AC_CHECK_AF_INET6, [
+ AC_MSG_CHECKING(for AF_INET6)
+ AC_CACHE_VAL($1,
+ AC_TRY_COMPILE([
+# include <sys/types.h>
+# include <sys/socket.h>],
+ [int a = AF_INET6],
+ $1=yes,
+ $1=no))
+ AC_MSG_RESULT($$1)
+ if test $$1 = yes ; then
+ AC_DEFINE(HAVE_AF_INET6)
+ fi
+])
+
+dnl
+dnl Checks to see if the sockaddr struct has the 4.4 BSD sa_len member
+dnl borrowed from LBL libpcap
+AC_DEFUN(AC_CHECK_SA_LEN, [
+ AC_MSG_CHECKING(if sockaddr struct has sa_len member)
+ AC_CACHE_VAL($1,
+ AC_TRY_COMPILE([
+# include <sys/types.h>
+# include <sys/socket.h>],
+ [u_int i = sizeof(((struct sockaddr *)0)->sa_len)],
+ $1=yes,
+ $1=no))
+ AC_MSG_RESULT($$1)
+ if test $$1 = yes ; then
+ AC_DEFINE(HAVE_SOCKADDR_SA_LEN)
+ fi
+])
+
+dnl
+dnl Checks for portable prototype declaration macro
+AC_DEFUN(AC_CHECK_PORTABLE_PROTO, [
+ AC_MSG_CHECKING(for __P)
+ AC_CACHE_VAL($1,
+ AC_TRY_COMPILE([
+# include <unistd.h>],
+ [int f __P(())],
+ $1=yes,
+ $1=no))
+ AC_MSG_RESULT($$1)
+ if test $$1 = yes; then
+ AC_DEFINE(HAVE_PORTABLE_PROTOTYPE)
+ fi
+])
+
+dnl checks for u_intXX_t
+AC_DEFUN(AC_CHECK_BITTYPES, [
+ $1=yes
+dnl check for u_int8_t
+ AC_MSG_CHECKING(for u_int8_t)
+ AC_CACHE_VAL(ac_cv_u_int8_t,
+ AC_TRY_COMPILE([
+# include <sys/types.h>],
+ [u_int8_t i],
+ ac_cv_u_int8_t=yes,
+ ac_cv_u_int8_t=no))
+ AC_MSG_RESULT($ac_cv_u_int8_t)
+ if test $ac_cv_u_int8_t = yes; then
+ AC_DEFINE(HAVE_U_INT8_T)
+ else
+ $1=no
+ fi
+dnl check for u_int16_t
+ AC_MSG_CHECKING(for u_int16_t)
+ AC_CACHE_VAL(ac_cv_u_int16_t,
+ AC_TRY_COMPILE([
+# include <sys/types.h>],
+ [u_int16_t i],
+ ac_cv_u_int16_t=yes,
+ ac_cv_u_int16_t=no))
+ AC_MSG_RESULT($ac_cv_u_int16_t)
+ if test $ac_cv_u_int16_t = yes; then
+ AC_DEFINE(HAVE_U_INT16_T)
+ else
+ $1=no
+ fi
+dnl check for u_int32_t
+ AC_MSG_CHECKING(for u_int32_t)
+ AC_CACHE_VAL(ac_cv_u_int32_t,
+ AC_TRY_COMPILE([
+# include <sys/types.h>],
+ [u_int32_t i],
+ ac_cv_u_int32_t=yes,
+ ac_cv_u_int32_t=no))
+ AC_MSG_RESULT($ac_cv_u_int32_t)
+ if test $ac_cv_u_int32_t = yes; then
+ AC_DEFINE(HAVE_U_INT32_T)
+ else
+ $1=no
+ fi
+])
+
+dnl
+dnl Checks for addrinfo structure
+AC_DEFUN(AC_STRUCT_ADDRINFO, [
+ AC_MSG_CHECKING(for addrinfo)
+ AC_CACHE_VAL($1,
+ AC_TRY_COMPILE([
+# include <netdb.h>],
+ [struct addrinfo a],
+ $1=yes,
+ $1=no))
+ AC_MSG_RESULT($$1)
+ if test $$1 = yes; then
+ AC_DEFINE(HAVE_ADDRINFO)
+ else
+ AC_DEFINE(NEED_ADDRINFO_H)
+ fi
+])
+
+dnl
+dnl Checks for NI_MAXSERV
+AC_DEFUN(AC_NI_MAXSERV, [
+ AC_MSG_CHECKING(for NI_MAXSERV)
+ AC_CACHE_VAL($1,
+ AC_EGREP_CPP(yes, [#include <netdb.h>
+#ifdef NI_MAXSERV
+yes
+#endif],
+ $1=yes,
+ $1=no))
+ AC_MSG_RESULT($$1)
+ if test $$1 != yes; then
+ AC_DEFINE(NEED_ADDRINFO_H)
+ fi
+])
+
+dnl
+dnl Checks for NI_NAMEREQD
+AC_DEFUN(AC_NI_NAMEREQD, [
+ AC_MSG_CHECKING(for NI_NAMEREQD)
+ AC_CACHE_VAL($1,
+ AC_EGREP_CPP(yes, [#include <netdb.h>
+#ifdef NI_NOFQDN
+yes
+#endif],
+ $1=yes,
+ $1=no))
+ AC_MSG_RESULT($$1)
+ if test $$1 != yes; then
+ AC_DEFINE(NEED_ADDRINFO_H)
+ fi
+])
+
+dnl
+dnl Checks for sockaddr_storage structure
+AC_DEFUN(AC_STRUCT_SA_STORAGE, [
+ AC_MSG_CHECKING(for sockaddr_storage)
+ AC_CACHE_VAL($1,
+ AC_TRY_COMPILE([
+# include <sys/types.h>
+# include <sys/socket.h>],
+ [struct sockaddr_storage s],
+ $1=yes,
+ $1=no))
+ AC_MSG_RESULT($$1)
+ if test $$1 = yes; then
+ AC_DEFINE(HAVE_SOCKADDR_STORAGE)
+ fi
+])
+
+dnl
+dnl Checks for macro of IP address size
+AC_DEFUN(AC_CHECK_ADDRSZ, [
+ $1=yes
+dnl check for INADDRSZ
+ AC_MSG_CHECKING(for INADDRSZ)
+ AC_CACHE_VAL(ac_cv_inaddrsz,
+ AC_TRY_COMPILE([
+# include <arpa/nameser.h>],
+ [int a = INADDRSZ],
+ ac_cv_inaddrsz=yes,
+ ac_cv_inaddrsz=no))
+ AC_MSG_RESULT($ac_cv_inaddrsz)
+ if test $ac_cv_inaddrsz = yes; then
+ AC_DEFINE(HAVE_INADDRSZ)
+ else
+ $1=no
+ fi
+dnl check for IN6ADDRSZ
+ AC_MSG_CHECKING(for IN6ADDRSZ)
+ AC_CACHE_VAL(ac_cv_in6addrsz,
+ AC_TRY_COMPILE([
+# include <arpa/nameser.h>],
+ [int a = IN6ADDRSZ],
+ ac_cv_in6addrsz=yes,
+ ac_cv_in6addrsz=no))
+ AC_MSG_RESULT($ac_cv_in6addrsz)
+ if test $ac_cv_in6addrsz = yes; then
+ AC_DEFINE(HAVE_IN6ADDRSZ)
+ else
+ $1=no
+ fi
+])
+
+dnl
+dnl check for RES_USE_INET6
+AC_DEFUN(AC_CHECK_RES_USE_INET6, [
+ AC_MSG_CHECKING(for RES_USE_INET6)
+ AC_CACHE_VAL($1,
+ AC_TRY_COMPILE([
+# include <sys/types.h>
+# include <netinet/in.h>
+# include <resolv.h>],
+ [int a = RES_USE_INET6],
+ $1=yes,
+ $1=no))
+ AC_MSG_RESULT($$1)
+ if test $$1 = yes; then
+ AC_DEFINE(HAVE_RES_USE_INET6)
+ fi
+])
+
+dnl
+dnl check for AAAA
+AC_DEFUN(AC_CHECK_AAAA, [
+ AC_MSG_CHECKING(for AAAA)
+ AC_CACHE_VAL($1,
+ AC_TRY_COMPILE([
+# include <sys/types.h>
+# include <arpa/nameser.h>],
+ [int a = T_AAAA],
+ $1=yes,
+ $1=no))
+ AC_MSG_RESULT($$1)
+ if test $$1 = yes; then
+ AC_DEFINE(HAVE_AAAA)
+ fi
+])
+
+dnl
+dnl check for struct res_state_ext
+AC_DEFUN(AC_STRUCT_RES_STATE_EXT, [
+ AC_MSG_CHECKING(for res_state_ext)
+ AC_CACHE_VAL($1,
+ AC_TRY_COMPILE([
+# include <sys/types.h>
+# include <netinet/in.h>
+# include <netinet6/in6.h>
+# include <resolv.h>],
+ [struct __res_state_ext e],
+ $1=yes,
+ $1=no))
+ AC_MSG_RESULT($$1)
+ if test $$1 = yes; then
+ AC_DEFINE(HAVE_RES_STATE_EXT)
+ fi
+])
+
+dnl
+dnl check for struct res_state_ext
+AC_DEFUN(AC_STRUCT_RES_STATE, [
+ AC_MSG_CHECKING(for nsort in res_state)
+ AC_CACHE_VAL($1,
+ AC_TRY_COMPILE([
+# include <sys/types.h>
+# include <netinet/in.h>
+# include <netinet6/in6.h>
+# include <resolv.h>],
+ [struct __res_state e; e.nsort = 0],
+ $1=yes,
+ $1=no))
+ AC_MSG_RESULT($$1)
+ if test $$1 = yes; then
+ AC_DEFINE(HAVE_NEW_RES_STATE)
+ fi
+])
+
+dnl
+dnl check for h_errno
+AC_DEFUN(AC_VAR_H_ERRNO, [
+ AC_MSG_CHECKING(for h_errno)
+ AC_CACHE_VAL(ac_cv_var_h_errno,
+ AC_TRY_COMPILE([
+# include <sys/types.h>
+# include <netdb.h>],
+ [int foo = h_errno;],
+ ac_cv_var_h_errno=yes,
+ ac_cv_var_h_errno=no))
+ AC_MSG_RESULT($ac_cv_var_h_errno)
+ if test "$ac_cv_var_h_errno" = "yes"; then
+ AC_DEFINE(HAVE_H_ERRNO)
+ fi
+])
+
+dnl
+dnl Test for __attribute__
+dnl
+
+AC_DEFUN(AC_C___ATTRIBUTE__, [
+AC_MSG_CHECKING(for __attribute__)
+AC_CACHE_VAL(ac_cv___attribute__, [
+AC_TRY_COMPILE([
+#include <stdlib.h>
+],
+[
+static void foo(void) __attribute__ ((noreturn));
+
+static void
+foo(void)
+{
+ exit(1);
+}
+],
+ac_cv___attribute__=yes,
+ac_cv___attribute__=no)])
+if test "$ac_cv___attribute__" = "yes"; then
+ AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
+ V_DEFS="$V_DEFS -D_U_=\"__attribute__((unused))\""
+else
+ V_DEFS="$V_DEFS -D_U_=\"\""
+fi
+AC_MSG_RESULT($ac_cv___attribute__)
+])
View
717 kame/kame/tcpdump/addrtoname.c
@@ -22,63 +22,51 @@
* and address to string conversion routines
*/
#ifndef lint
-static const char rcsid[] =
- "@(#) $Header: addrtoname.c,v 1.61 97/06/15 13:20:18 leres Exp $ (LBL)";
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.96.2.6 2004/03/24 04:14:31 guy Exp $ (LBL)";
#endif
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-
-#if __STDC__
-struct mbuf;
-struct rtentry;
+#ifdef HAVE_CONFIG_H
+#include "config.h"
#endif
-#include <net/if.h>
-
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
-#ifdef INET6
-#include <netinet6/ip6.h>
-#endif
+#include <tcpdump-stdinc.h>
-#include <arpa/inet.h>
+#ifdef USE_ETHER_NTOHOST
+#ifdef HAVE_NETINET_IF_ETHER_H
+struct mbuf; /* Squelch compiler warnings on some platforms for */
+struct rtentry; /* declarations in <net/if.h> */
+#include <net/if.h> /* for "struct ifnet" in "struct arpcom" on Solaris */
+#include <netinet/if_ether.h>
+#endif /* HAVE_NETINET_IF_ETHER_H */
+#ifdef HAVE_NETINET_ETHER_H
+#include <netinet/ether.h> /* ether_ntohost on linux */
+#endif /* HAVE_NETINET_ETHER_H */
+#endif /* USE_ETHER_NTOHOST */
-#include <ctype.h>
-#include <netdb.h>
#include <pcap.h>
#include <pcap-namedb.h>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <unistd.h>
#include "interface.h"
#include "addrtoname.h"
#include "llc.h"
-#include "savestr.h"
#include "setsignal.h"
-/* Forwards */
-static RETSIGTYPE nohostname(int);
-
/*
* hash tables for whatever-to-name translations
+ *
+ * XXX there has to be error checks against strdup(3) failure
*/
#define HASHNAMESIZE 4096
struct hnamemem {
u_int32_t addr;
- char *name;
+ const char *name;
struct hnamemem *nxt;
};
@@ -88,6 +76,52 @@ struct hnamemem uporttable[HASHNAMESIZE];
struct hnamemem eprototable[HASHNAMESIZE];
struct hnamemem dnaddrtable[HASHNAMESIZE];
struct hnamemem llcsaptable[HASHNAMESIZE];
+struct hnamemem ipxsaptable[HASHNAMESIZE];
+
+#if defined(INET6) && defined(WIN32)
+/*
+ * fake gethostbyaddr for Win2k/XP
+ * gethostbyaddr() returns incorrect value when AF_INET6 is passed
+ * to 3rd argument.
+ *
+ * h_name in struct hostent is only valid.
+ */
+static struct hostent *
+win32_gethostbyaddr(const char *addr, int len, int type)
+{
+ static struct hostent host;
+ static char hostbuf[NI_MAXHOST];
+ char hname[NI_MAXHOST];
+ struct sockaddr_in6 addr6;
+
+ host.h_name = hostbuf;
+ switch (type) {
+ case AF_INET:
+ return gethostbyaddr(addr, len, type);
+ break;
+ case AF_INET6:
+ memset(&addr6, 0, sizeof(addr6));
+ addr6.sin6_family = AF_INET6;
+ memcpy(&addr6.sin6_addr, addr, len);
+#ifdef __MINGW32__
+ /* MinGW doesn't provide getnameinfo */
+ return NULL;
+#else
+ if (getnameinfo((struct sockaddr *)&addr6, sizeof(addr6),
+ hname, sizeof(hname), NULL, 0, 0)) {
+ return NULL;
+ } else {
+ strcpy(host.h_name, hname);
+ return &host;
+ }
+#endif /* __MINGW32__ */
+ break;
+ default:
+ return NULL;
+ }
+}
+#define gethostbyaddr win32_gethostbyaddr
+#endif /* INET6 & WIN32*/
#ifdef INET6
struct h6namemem {
@@ -103,18 +137,20 @@ struct enamemem {
u_short e_addr0;
u_short e_addr1;
u_short e_addr2;
- char *e_name;
+ const char *e_name;
u_char *e_nsap; /* used only for nsaptable[] */
+#define e_bs e_nsap /* for bytestringtable */
struct enamemem *e_nxt;
};
struct enamemem enametable[HASHNAMESIZE];
struct enamemem nsaptable[HASHNAMESIZE];
+struct enamemem bytestringtable[HASHNAMESIZE];
struct protoidmem {
u_int32_t p_oui;
u_short p_proto;
- char *p_name;
+ const char *p_name;
struct protoidmem *p_nxt;
};
@@ -123,7 +159,7 @@ struct protoidmem protoidtable[HASHNAMESIZE];
/*
* A faster replacement for inet_ntoa().
*/
-char *
+const char *
intoa(u_int32_t addr)
{
register char *cp;
@@ -155,70 +191,34 @@ intoa(u_int32_t addr)
static u_int32_t f_netmask;
static u_int32_t f_localnet;
-static u_int32_t netmask;
-
-/*
- * "getname" is written in this atrocious way to make sure we don't
- * wait forever while trying to get hostnames from yp.
- */
-#include <setjmp.h>
-
-jmp_buf getname_env;
-
-static RETSIGTYPE
-nohostname(int signo)
-{
- longjmp(getname_env, 1);
-}
/*
* Return a name for the IP address pointed to by ap. This address
* is assumed to be in network byte order.
+ *
+ * NOTE: ap is *NOT* necessarily part of the packet data (not even if
+ * this is being called with the "ipaddr_string()" macro), so you
+ * *CANNOT* use the TCHECK{2}/TTEST{2} macros on it. Furthermore,
+ * even in cases where it *is* part of the packet data, the caller
+ * would still have to check for a null return value, even if it's
+ * just printing the return value with "%s" - not all versions of
+ * printf print "(null)" with "%s" and a null pointer, some of them
+ * don't check for a null pointer and crash in that case.
+ *
+ * The callers of this routine should, before handing this routine
+ * a pointer to packet data, be sure that the data is present in
+ * the packet buffer. They should probably do those checks anyway,
+ * as other data at that layer might not be IP addresses, and it
+ * also needs to check whether they're present in the packet buffer.
*/
-char *
+const char *
getname(const u_char *ap)
{
register struct hostent *hp;
u_int32_t addr;
static struct hnamemem *p; /* static for longjmp() */
-#ifndef LBL_ALIGN
- addr = *(const u_int32_t *)ap;
-#else
- /*
- * Extract 32 bits in network order, dealing with alignment.
- */
- switch ((long)ap & 3) {
-
- case 0:
- addr = *(u_int32_t *)ap;
- break;
-
- case 2:
-#ifdef WORDS_BIGENDIAN
- addr = ((u_int32_t)*(u_short *)ap << 16) |
- (u_int32_t)*(u_short *)(ap + 2);
-#else
- addr = ((u_int32_t)*(u_short *)(ap + 2) << 16) |
- (u_int32_t)*(u_short *)ap;
-#endif
- break;
-
- default:
-#ifdef WORDS_BIGENDIAN
- addr = ((u_int32_t)ap[0] << 24) |
- ((u_int32_t)ap[1] << 16) |
- ((u_int32_t)ap[2] << 8) |
- (u_int32_t)ap[3];
-#else
- addr = ((u_int32_t)ap[3] << 24) |
- ((u_int32_t)ap[2] << 16) |
- ((u_int32_t)ap[1] << 8) |
- (u_int32_t)ap[0];
-#endif
- break;
- }
-#endif
+ memcpy(&addr, ap, sizeof(addr));
p = &hnametable[addr & (HASHNAMESIZE-1)];
for (; p->nxt; p = p->nxt) {
if (p->addr == addr)
@@ -228,38 +228,29 @@ getname(const u_char *ap)
p->nxt = newhnamemem();
/*
- * Only print names when:
- * (1) -n was not given.
+ * Print names unless:
+ * (1) -n was given.
* (2) Address is foreign and -f was given. (If -f was not
- * give, f_netmask and f_local are 0 and the test
+ * given, f_netmask and f_localnet are 0 and the test
* evaluates to true)
- * (3) -a was given or the host portion is not all ones
- * nor all zeros (i.e. not a network or broadcast address)
*/
if (!nflag &&
- (addr & f_netmask) == f_localnet &&
- (aflag ||
- !((addr & ~netmask) == 0 || (addr | netmask) == 0xffffffff))) {
- if (!setjmp(getname_env)) {
- (void)setsignal(SIGALRM, nohostname);
- (void)alarm(20);
- hp = gethostbyaddr((char *)&addr, 4, AF_INET);
- (void)alarm(0);
- if (hp) {
- char *dotp;
-
- p->name = savestr(hp->h_name);
- if (Nflag) {
- /* Remove domain qualifications */
- dotp = strchr(p->name, '.');
- if (dotp)
- *dotp = '\0';
- }
- return (p->name);
+ (addr & f_netmask) == f_localnet) {
+ hp = gethostbyaddr((char *)&addr, 4, AF_INET);
+ if (hp) {
+ char *dotp;
+
+ p->name = strdup(hp->h_name);
+ if (Nflag) {
+ /* Remove domain qualifications */
+ dotp = strchr(p->name, '.');
+ if (dotp)
+ *dotp = '\0';
}
+ return (p->name);
}
}
- p->name = savestr(intoa(addr));
+ p->name = strdup(intoa(addr));
return (p->name);
}
@@ -268,17 +259,17 @@ getname(const u_char *ap)
* Return a name for the IP6 address pointed to by ap. This address
* is assumed to be in network byte order.
*/
-char *
+const char *
getname6(const u_char *ap)
{
register struct hostent *hp;
struct in6_addr addr;
static struct h6namemem *p; /* static for longjmp() */
- register char *cp;
+ register const char *cp;
char ntop_buf[INET6_ADDRSTRLEN];
memcpy(&addr, ap, sizeof(addr));
- p = &h6nametable[addr.s6_addr16[7] & (HASHNAMESIZE-1)];
+ p = &h6nametable[*(u_int16_t *)&addr.s6_addr[14] & (HASHNAMESIZE-1)];
for (; p->nxt; p = p->nxt) {
if (memcmp(&p->addr, &addr, sizeof(addr)) == 0)
return (p->name);
@@ -287,43 +278,25 @@ getname6(const u_char *ap)
p->nxt = newh6namemem();
/*
- * Only print names when:
- * (1) -n was not given.
- * (2) Address is foreign and -f was given. (If -f was not
- * give, f_netmask and f_local are 0 and the test
- * evaluates to true)
- * (3) -a was given or the host portion is not all ones
- * nor all zeros (i.e. not a network or broadcast address)
+ * Do not print names if -n was given.
*/
- if (!nflag
-#if 0
- &&
- (addr & f_netmask) == f_localnet &&
- (aflag ||
- !((addr & ~netmask) == 0 || (addr | netmask) == 0xffffffff))
-#endif
- ) {
- if (!setjmp(getname_env)) {
- (void)setsignal(SIGALRM, nohostname);
- (void)alarm(20);
- hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET6);
- (void)alarm(0);
- if (hp) {
- char *dotp;
-
- p->name = savestr(hp->h_name);
- if (Nflag) {
- /* Remove domain qualifications */
- dotp = strchr(p->name, '.');
- if (dotp)
- *dotp = '\0';
- }
- return (p->name);
+ if (!nflag) {
+ hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET6);
+ if (hp) {
+ char *dotp;
+