[Midnightbsd-cvs] src [8321] trunk/contrib/tcpdump: tcpdump 4.3.0
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Sep 17 18:44:52 EDT 2016
Revision: 8321
http://svnweb.midnightbsd.org/src/?rev=8321
Author: laffer1
Date: 2016-09-17 18:44:52 -0400 (Sat, 17 Sep 2016)
Log Message:
-----------
tcpdump 4.3.0
Modified Paths:
--------------
trunk/contrib/tcpdump/CHANGES
trunk/contrib/tcpdump/CREDITS
trunk/contrib/tcpdump/Makefile.in
trunk/contrib/tcpdump/README
trunk/contrib/tcpdump/VERSION
trunk/contrib/tcpdump/acconfig.h
trunk/contrib/tcpdump/addrtoname.c
trunk/contrib/tcpdump/addrtoname.h
trunk/contrib/tcpdump/af.c
trunk/contrib/tcpdump/af.h
trunk/contrib/tcpdump/aodv.h
trunk/contrib/tcpdump/appletalk.h
trunk/contrib/tcpdump/arcnet.h
trunk/contrib/tcpdump/atm.h
trunk/contrib/tcpdump/atmuni31.h
trunk/contrib/tcpdump/bgp.h
trunk/contrib/tcpdump/bootp.h
trunk/contrib/tcpdump/bpf_dump.c
trunk/contrib/tcpdump/chdlc.h
trunk/contrib/tcpdump/config.guess
trunk/contrib/tcpdump/config.h.in
trunk/contrib/tcpdump/config.sub
trunk/contrib/tcpdump/configure
trunk/contrib/tcpdump/configure.in
trunk/contrib/tcpdump/cpack.c
trunk/contrib/tcpdump/cpack.h
trunk/contrib/tcpdump/dccp.h
trunk/contrib/tcpdump/decnet.h
trunk/contrib/tcpdump/decode_prefix.h
trunk/contrib/tcpdump/enc.h
trunk/contrib/tcpdump/ether.h
trunk/contrib/tcpdump/ethertype.h
trunk/contrib/tcpdump/extract.h
trunk/contrib/tcpdump/fddi.h
trunk/contrib/tcpdump/gmpls.c
trunk/contrib/tcpdump/gmpls.h
trunk/contrib/tcpdump/gmt2local.c
trunk/contrib/tcpdump/gmt2local.h
trunk/contrib/tcpdump/icmp6.h
trunk/contrib/tcpdump/ieee802_11.h
trunk/contrib/tcpdump/ieee802_11_radio.h
trunk/contrib/tcpdump/igrp.h
trunk/contrib/tcpdump/interface.h
trunk/contrib/tcpdump/ip.h
trunk/contrib/tcpdump/ip6.h
trunk/contrib/tcpdump/ipfc.h
trunk/contrib/tcpdump/ipproto.c
trunk/contrib/tcpdump/ipproto.h
trunk/contrib/tcpdump/ipsec_doi.h
trunk/contrib/tcpdump/ipx.h
trunk/contrib/tcpdump/isakmp.h
trunk/contrib/tcpdump/l2tp.h
trunk/contrib/tcpdump/l2vpn.c
trunk/contrib/tcpdump/l2vpn.h
trunk/contrib/tcpdump/lane.h
trunk/contrib/tcpdump/lbl/os-osf4.h
trunk/contrib/tcpdump/lbl/os-solaris2.h
trunk/contrib/tcpdump/lbl/os-sunos4.h
trunk/contrib/tcpdump/lbl/os-ultrix4.h
trunk/contrib/tcpdump/llc.h
trunk/contrib/tcpdump/machdep.c
trunk/contrib/tcpdump/machdep.h
trunk/contrib/tcpdump/makemib
trunk/contrib/tcpdump/missing/addrinfo.h
trunk/contrib/tcpdump/missing/datalinks.c
trunk/contrib/tcpdump/missing/dlnames.c
trunk/contrib/tcpdump/missing/getnameinfo.c
trunk/contrib/tcpdump/missing/inet_aton.c
trunk/contrib/tcpdump/missing/inet_ntop.c
trunk/contrib/tcpdump/missing/inet_pton.c
trunk/contrib/tcpdump/missing/snprintf.c
trunk/contrib/tcpdump/missing/strdup.c
trunk/contrib/tcpdump/missing/strlcat.c
trunk/contrib/tcpdump/missing/strlcpy.c
trunk/contrib/tcpdump/missing/strsep.c
trunk/contrib/tcpdump/mpls.h
trunk/contrib/tcpdump/nameser.h
trunk/contrib/tcpdump/netbios.h
trunk/contrib/tcpdump/netdissect.h
trunk/contrib/tcpdump/nfs.h
trunk/contrib/tcpdump/nfsfh.h
trunk/contrib/tcpdump/nlpid.c
trunk/contrib/tcpdump/nlpid.h
trunk/contrib/tcpdump/ntp.h
trunk/contrib/tcpdump/oakley.h
trunk/contrib/tcpdump/ospf.h
trunk/contrib/tcpdump/ospf6.h
trunk/contrib/tcpdump/oui.c
trunk/contrib/tcpdump/oui.h
trunk/contrib/tcpdump/parsenfsfh.c
trunk/contrib/tcpdump/pcap-missing.h
trunk/contrib/tcpdump/pcap_dump_ftell.c
trunk/contrib/tcpdump/pmap_prot.h
trunk/contrib/tcpdump/ppp.h
trunk/contrib/tcpdump/print-802_11.c
trunk/contrib/tcpdump/print-ah.c
trunk/contrib/tcpdump/print-aodv.c
trunk/contrib/tcpdump/print-ap1394.c
trunk/contrib/tcpdump/print-arcnet.c
trunk/contrib/tcpdump/print-arp.c
trunk/contrib/tcpdump/print-ascii.c
trunk/contrib/tcpdump/print-atalk.c
trunk/contrib/tcpdump/print-atm.c
trunk/contrib/tcpdump/print-beep.c
trunk/contrib/tcpdump/print-bfd.c
trunk/contrib/tcpdump/print-bgp.c
trunk/contrib/tcpdump/print-bootp.c
trunk/contrib/tcpdump/print-cdp.c
trunk/contrib/tcpdump/print-chdlc.c
trunk/contrib/tcpdump/print-cip.c
trunk/contrib/tcpdump/print-cnfp.c
trunk/contrib/tcpdump/print-dccp.c
trunk/contrib/tcpdump/print-decnet.c
trunk/contrib/tcpdump/print-dhcp6.c
trunk/contrib/tcpdump/print-domain.c
trunk/contrib/tcpdump/print-dvmrp.c
trunk/contrib/tcpdump/print-eap.c
trunk/contrib/tcpdump/print-egp.c
trunk/contrib/tcpdump/print-eigrp.c
trunk/contrib/tcpdump/print-enc.c
trunk/contrib/tcpdump/print-esp.c
trunk/contrib/tcpdump/print-ether.c
trunk/contrib/tcpdump/print-fddi.c
trunk/contrib/tcpdump/print-fr.c
trunk/contrib/tcpdump/print-frag6.c
trunk/contrib/tcpdump/print-gre.c
trunk/contrib/tcpdump/print-hsrp.c
trunk/contrib/tcpdump/print-icmp.c
trunk/contrib/tcpdump/print-icmp6.c
trunk/contrib/tcpdump/print-igmp.c
trunk/contrib/tcpdump/print-igrp.c
trunk/contrib/tcpdump/print-ip.c
trunk/contrib/tcpdump/print-ip6.c
trunk/contrib/tcpdump/print-ip6opts.c
trunk/contrib/tcpdump/print-ipcomp.c
trunk/contrib/tcpdump/print-ipfc.c
trunk/contrib/tcpdump/print-ipx.c
trunk/contrib/tcpdump/print-isakmp.c
trunk/contrib/tcpdump/print-isoclns.c
trunk/contrib/tcpdump/print-juniper.c
trunk/contrib/tcpdump/print-krb.c
trunk/contrib/tcpdump/print-l2tp.c
trunk/contrib/tcpdump/print-lane.c
trunk/contrib/tcpdump/print-ldp.c
trunk/contrib/tcpdump/print-llc.c
trunk/contrib/tcpdump/print-lmp.c
trunk/contrib/tcpdump/print-lspping.c
trunk/contrib/tcpdump/print-lwres.c
trunk/contrib/tcpdump/print-mobile.c
trunk/contrib/tcpdump/print-mobility.c
trunk/contrib/tcpdump/print-mpls.c
trunk/contrib/tcpdump/print-msdp.c
trunk/contrib/tcpdump/print-netbios.c
trunk/contrib/tcpdump/print-nfs.c
trunk/contrib/tcpdump/print-ntp.c
trunk/contrib/tcpdump/print-null.c
trunk/contrib/tcpdump/print-olsr.c
trunk/contrib/tcpdump/print-ospf.c
trunk/contrib/tcpdump/print-ospf6.c
trunk/contrib/tcpdump/print-pflog.c
trunk/contrib/tcpdump/print-pgm.c
trunk/contrib/tcpdump/print-pim.c
trunk/contrib/tcpdump/print-ppp.c
trunk/contrib/tcpdump/print-pppoe.c
trunk/contrib/tcpdump/print-pptp.c
trunk/contrib/tcpdump/print-radius.c
trunk/contrib/tcpdump/print-raw.c
trunk/contrib/tcpdump/print-rip.c
trunk/contrib/tcpdump/print-ripng.c
trunk/contrib/tcpdump/print-rsvp.c
trunk/contrib/tcpdump/print-rt6.c
trunk/contrib/tcpdump/print-rx.c
trunk/contrib/tcpdump/print-sctp.c
trunk/contrib/tcpdump/print-sip.c
trunk/contrib/tcpdump/print-sl.c
trunk/contrib/tcpdump/print-sll.c
trunk/contrib/tcpdump/print-slow.c
trunk/contrib/tcpdump/print-smb.c
trunk/contrib/tcpdump/print-snmp.c
trunk/contrib/tcpdump/print-stp.c
trunk/contrib/tcpdump/print-sunatm.c
trunk/contrib/tcpdump/print-sunrpc.c
trunk/contrib/tcpdump/print-symantec.c
trunk/contrib/tcpdump/print-syslog.c
trunk/contrib/tcpdump/print-tcp.c
trunk/contrib/tcpdump/print-telnet.c
trunk/contrib/tcpdump/print-tftp.c
trunk/contrib/tcpdump/print-timed.c
trunk/contrib/tcpdump/print-token.c
trunk/contrib/tcpdump/print-udp.c
trunk/contrib/tcpdump/print-vjc.c
trunk/contrib/tcpdump/print-vrrp.c
trunk/contrib/tcpdump/print-wb.c
trunk/contrib/tcpdump/print-zephyr.c
trunk/contrib/tcpdump/route6d.h
trunk/contrib/tcpdump/rpc_auth.h
trunk/contrib/tcpdump/rpc_msg.h
trunk/contrib/tcpdump/rx.h
trunk/contrib/tcpdump/sctpConstants.h
trunk/contrib/tcpdump/sctpHeader.h
trunk/contrib/tcpdump/setsignal.c
trunk/contrib/tcpdump/setsignal.h
trunk/contrib/tcpdump/slcompress.h
trunk/contrib/tcpdump/slip.h
trunk/contrib/tcpdump/sll.h
trunk/contrib/tcpdump/smb.h
trunk/contrib/tcpdump/smbutil.c
trunk/contrib/tcpdump/strcasecmp.c
trunk/contrib/tcpdump/tcp.h
trunk/contrib/tcpdump/tcpdump-stdinc.h
trunk/contrib/tcpdump/tcpdump.c
trunk/contrib/tcpdump/telnet.h
trunk/contrib/tcpdump/tftp.h
trunk/contrib/tcpdump/timed.h
trunk/contrib/tcpdump/token.h
trunk/contrib/tcpdump/udp.h
trunk/contrib/tcpdump/util.c
trunk/contrib/tcpdump/vfprintf.c
Added Paths:
-----------
trunk/contrib/tcpdump/INSTALL.txt
trunk/contrib/tcpdump/checksum.c
trunk/contrib/tcpdump/forces.h
trunk/contrib/tcpdump/in_cksum.c
trunk/contrib/tcpdump/ipnet.h
trunk/contrib/tcpdump/ppi.h
trunk/contrib/tcpdump/print-802_15_4.c
trunk/contrib/tcpdump/print-babel.c
trunk/contrib/tcpdump/print-bt.c
trunk/contrib/tcpdump/print-carp.c
trunk/contrib/tcpdump/print-cfm.c
trunk/contrib/tcpdump/print-dtp.c
trunk/contrib/tcpdump/print-forces.c
trunk/contrib/tcpdump/print-ipnet.c
trunk/contrib/tcpdump/print-lldp.c
trunk/contrib/tcpdump/print-lwapp.c
trunk/contrib/tcpdump/print-mpcp.c
trunk/contrib/tcpdump/print-msnlb.c
trunk/contrib/tcpdump/print-otv.c
trunk/contrib/tcpdump/print-pfsync.c
trunk/contrib/tcpdump/print-ppi.c
trunk/contrib/tcpdump/print-rpki-rtr.c
trunk/contrib/tcpdump/print-rrcp.c
trunk/contrib/tcpdump/print-sflow.c
trunk/contrib/tcpdump/print-tipc.c
trunk/contrib/tcpdump/print-udld.c
trunk/contrib/tcpdump/print-usb.c
trunk/contrib/tcpdump/print-vqp.c
trunk/contrib/tcpdump/print-vtp.c
trunk/contrib/tcpdump/print-vxlan.c
trunk/contrib/tcpdump/print-zeromq.c
trunk/contrib/tcpdump/signature.c
trunk/contrib/tcpdump/signature.h
trunk/contrib/tcpdump/tcpdump.1.in
Removed Paths:
-------------
trunk/contrib/tcpdump/FILES
trunk/contrib/tcpdump/INSTALL
trunk/contrib/tcpdump/PLATFORMS
trunk/contrib/tcpdump/Readme.Win32
trunk/contrib/tcpdump/TODO
trunk/contrib/tcpdump/tcpdump.1
trunk/contrib/tcpdump/tests/
Property Changed:
----------------
trunk/contrib/tcpdump/bgp.h
trunk/contrib/tcpdump/config.guess
trunk/contrib/tcpdump/config.sub
trunk/contrib/tcpdump/configure
trunk/contrib/tcpdump/configure.in
trunk/contrib/tcpdump/install-sh
trunk/contrib/tcpdump/ipproto.c
trunk/contrib/tcpdump/l2vpn.c
trunk/contrib/tcpdump/l2vpn.h
trunk/contrib/tcpdump/makemib
trunk/contrib/tcpdump/mkdep
trunk/contrib/tcpdump/nlpid.c
trunk/contrib/tcpdump/print-syslog.c
Modified: trunk/contrib/tcpdump/CHANGES
===================================================================
--- trunk/contrib/tcpdump/CHANGES 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/CHANGES 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,21 +1,189 @@
-$Header: /home/cvs/src/contrib/tcpdump/CHANGES,v 1.1.1.3 2009-03-25 16:54:04 laffer1 Exp $
+Thursday February 19, 2013 guy at alum.mit.edu.
+ Summary for 4.4.0 tcpdump release
+ RPKI-RTR (RFC6810) is now official (TCP Port 323)
+ Fix detection of OpenSSL libcrypto.
+ Add DNSSL (RFC6106) support.
+ Add "radius" as an option for -T.
+ Update Action codes for handle_action function according to
+ 802.11s amendment.
+ Decode DHCPv6 AFTR-Name option (RFC6334).
+ Updates for Babel.
+ Fix printing of infinite lifetime in ICMPv6.
+ Added support for SPB, SPBM Service Identifier, and Unicast
+ Address sub-TLV in ISIS.
+ Decode RIPv2 authentication up to RFC4822.
+ Fix RIP Request/full table decoding issues.
+ On Linux systems with cap-ng.h, drop root privileges
+ using Linux Capabilities.
+ Add support for reading multiple files.
-Mon. September 10, 2007. ken at xelerance.com. Summary for 0.9.8 tcpdump release
- Rework ARP printer
- Rework OSPFv3 printer
- Add support for Frame-Relay ARP
- Decode DHCP Option 121 (RFC 3442 Classless Static Route)
- Decode DHCP Option 249 (MS Classless Static Route) the same as Option 121
- TLV: Add support for Juniper .pcap extensions
- Print EGP header in new-world-order style
- Converted print-isakmp.c to NETDISSECT
- Moved AF specific stuff into af.h
- Test subsystem now table driven, and saves outputs and diffs to one place
+Wednesday November 28, 2012 guy at alum.mit.edu.
+ Summary for 4.3.1 tcpdump release
+ Print "LLDP, length N" for LLDP packets even when not in verbose
+ mode, so something is printed even if only the timestamp is
+ present
+ Document "-T carp"
+ Print NTP poll interval correctly (it's an exponent, so print
+ both its raw value and 2^value)
+ Document that "-e" is used to get MAC addresses
+ More clearly document that you need to escape or quote
+ backslashes in filter expressions on the command line
+ Fix some "the the" in the man page
+ Use the right maximum path length
+ Don't treat 192_1_2, when passed to -i, as an interface number
+
+Friday April 3, 2011. mcr at sandelman.ca.
+ Summary for 4.3.0 tcpdump release
+ fixes for forces: SPARSE data (per RFC 5810)
+ some more test cases added
+ updates to documentation on -l, -U and -w flags.
+ Fix printing of BGP optional headers.
+ Tried to include DLT_PFSYNC support, failed due to headers required.
+ added TIPC support.
+ Fix LLDP Network Policy bit definitions.
+ fixes for IGMPv3's Max Response Time: it is in units of 0.1 second.
+ SIGUSR1 can be used rather than SIGINFO for stats
+ permit -n flag to affect print-ip for protocol numbers
+ ND_OPT_ADVINTERVAL is in milliseconds, not seconds
+ Teach PPPoE parser about RFC 4638
+
+
+Friday December 9, 2011. guy at alum.mit.edu.
+ Summary for 4.2.1 tcpdump release
+ Only build the Babel printer if IPv6 is enabled.
+ Support Babel on port 6696 as well as 6697.
+ Include ppi.h in release tarball.
+ Include all the test files in the release tarball, and don't
+ "include" test files that no longer exist.
+ Don't assume we have <rpc/rpc.h> - check for it.
+ Support "-T carp" as a way of dissecting IP protocol 112 as CARP
+ rather than VRRP.
+ Support Hilscher NetAnalyzer link-layer header format.
+ Constify some pointers and fix compiler warnings.
+ Get rid of never-true test.
+ Fix an unintended fall-through in a case statement in the ARP
+ printer.
+ Fix several cases where sizeof(sizeof(XXX)) was used when just
+ sizeof(XXX) was intended.
+ Make stricter sanity checks in the ES-IS printer.
+ Get rid of some GCCisms that caused builds to fai with compilers
+ that don't support them.
+ Fix typo in man page.
+ Added length checks to Babel printer.
+
+Sunday July 24, 2011. mcr at sandelman.ca.
+ Summary for 4.2.+
+ merged 802.15.4 decoder from Dmitry Eremin-Solenikov <dbaryshkov
+ at gmail dot com>
+ updates to forces for new port numbers
+ Use "-H", not "-h", for the 802.11s option. (-h always help)
+ Better ICMPv6 checksum handling.
+ add support for the RPKI/Router Protocol, per -ietf-sidr-rpki-rtr-12
+ get rid of uuencoded pcap test files, git can do binary.
+ sFlow changes for 64-bit counters.
+ fixes for PPI packet header handling and printing.
+ Add DCB Exchange protocol (DCBX) version 1.01.
+ Babel dissector, from Juliusz Chroboczek and Grégoire Henry.
+ improvements to radiotap for rate values > 127.
+ Many improvements to ForCES decode, including fix SCTP TML port
+ updated RPL type code to RPL-17 draft
+ Improve printout of DHCPv6 options.
+ added support and test case for QinQ (802.1q VLAN) packets
+ Handle DLT_IEEE802_15_4_NOFCS like DLT_IEEE802_15_4.
+ Build fixes for Sparc and other machines with alignment restrictions.
+ Merged changes from Debian package.
+ PGM: Add ACK decoding and add PGMCC DATA and FEEDBACK options.
+ Build fixes for OSX (Snow Leopard and others)
+ Add support for IEEE 802.15.4 packets
+
+Tue. July 20, 2010. guy at alum.mit.edu.
+ Summary for 4.1.2 tcpdump release
+ If -U is specified, flush the file after creating it, so it's
+ not zero-length
+ Fix TCP flags output description, and some typoes, in the man
+ page
+ Add a -h flag, and only attempt to recognize 802.11s mesh
+ headers if it's set
+ When printing the link-layer type list, send *all* output to
+ stderr
+ Include the CFLAGS setting when configure was run in the
+ compiler flags
+
+Thu. April 1, 2010. guy at alum.mit.edu.
+ Summary for 4.1.1 tcpdump release
+ Fix build on systems with PF, such as FreeBSD and OpenBSD.
+ Don't blow up if a zero-length link-layer address is passed to
+ linkaddr_string().
+
+Thu. March 11, 2010. ken at netfunctional.ca/guy at alum.mit.edu.
+ Summary for 4.1.0 tcpdump release
+ Fix printing of MAC addresses for VLAN frames with a length
+ field
+ Add some additional bounds checks and use the EXTRACT_ macros
+ more
+ Add a -b flag to print the AS number in BGP packets in ASDOT
+ notation rather than ASPLAIN notation
+ Add ICMPv6 RFC 5006 support
+ Decode the access flags in NFS access requests
+ Handle the new DLT_ for memory-mapped USB captures on Linux
+ Make the default snapshot (-s) the maximum
+ Print name of device (when -L is used)
+ Support for OpenSolaris (and SXCE build 125 and later)
+ Print new TCP flags
+ Add support for RPL DIO
+ Add support for TCP User Timeout (UTO)
+ Add support for non-standard Ethertypes used by 3com PPPoE gear
+ Add support for 802.11n and 802.11s
+ Add support for Transparent Ethernet Bridge ethertype in GRE
+ Add 4 byte AS support for BGP printer
+ Add support for the MDT SAFI 66 BG printer
+ Add basic IPv6 support to print-olsr
+ Add USB printer
+ Add printer for ForCES
+ Handle frames with an FCS
+ Handle 802.11n Control Wrapper, Block Acq Req and Block Ack frames
+ Fix TCP sequence number printing
+ Report 802.2 packets as 802.2 instead of 802.3
+ Don't include -L/usr/lib in LDFLAGS
+ On x86_64 Linux, look in lib64 directory too
+ Lots of code clean ups
+ Autoconf clean ups
+ Update testcases to make output changes
+ Fix compiling with/out smi (--with{,out}-smi)
+ Fix compiling without IPv6 support (--disable-ipv6)
+
+Mon. October 27, 2008. ken at netfunctional.ca. Summary for 4.0.0 tcpdump release
+ Add support for Bluetooth Sniffing
+ Add support for Realtek Remote Control Protocol (openrrcp.org.ru)
+ Add support for 802.11 AVS
+ Add support for SMB over TCP
+ Add support for 4 byte BGP AS printing
+ Add support for compiling on case-insensitive file systems
+ Add support for ikev2 printing
+ Update support for decoding AFS
+ Update DHCPv6 printer
+ Use newer libpcap API's (allows -B option on all platforms)
+ Add -I to turn on monitor mode
+ Bugfixes in lldp, lspping, dccp, ESP, NFS printers
+ Cleanup unused files and various cruft
+
+Mon. September 10, 2007. ken at xelerance.com. Summary for 3.9.8 tcpdump release
+ Rework ARP printer
+ Rework OSPFv3 printer
+ Add support for Frame-Relay ARP
+ Decode DHCP Option 121 (RFC 3442 Classless Static Route)
+ Decode DHCP Option 249 (MS Classless Static Route) the same as Option 121
+ TLV: Add support for Juniper .pcap extensions
+ Print EGP header in new-world-order style
+ Converted print-isakmp.c to NETDISSECT
+ Moved AF specific stuff into af.h
+ Test subsystem now table driven, and saves outputs and diffs to one place
Require <net/pfvar.h> for pf definitions - allows reading of pflog formatted
libpcap files on an OS other than where the file was generated
-Wed. July 23, 2007. mcr at xelerance.com. Summary for 0.9.7 tcpdump release
+Wed. July 23, 2007. mcr at xelerance.com. Summary for 3.9.7 libpcap release
+
NFS: Print unsigned values as such.
RX: parse safely.
BGP: fixes for IPv6-less builds.
Modified: trunk/contrib/tcpdump/CREDITS
===================================================================
--- trunk/contrib/tcpdump/CREDITS 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/CREDITS 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,151 +1,207 @@
This file lists people who have contributed to tcpdump:
The current maintainers:
- Bill Fenner <fenner at research.att.com>
- David Young <dyoung at pobox.com>
- Fulvio Risso <risso at polito.it>
- Guy Harris <guy at alum.mit.edu>
- Hannes Gredler <hannes at juniper.net>
- Jun-ichiro itojun Hagino <itojun at iijlab.net>
- Michael Richardson <mcr at sandelman.ottawa.on.ca>
+ Bill Fenner <fenner at research dot att dot com>
+ David Young <dyoung at pobox dot com>
+ Fulvio Risso <risso at polito dot it>
+ Guy Harris <guy at alum dot mit dot edu>
+ Hannes Gredler <hannes at juniper dot net>
+ Michael Richardson <mcr at sandelman dot ottawa dot on dot ca>
Additional people who have contributed patches:
- Aaron Campbell <aaron at arbor.net>
- Alfredo Andres <aandres at s21sec.com>
- Albert Chin <china at thewrittenword.com>
- Andrew Brown <atatat at atatdot.net>
- Andrew Church <andrew at users.sourceforge.net>
- Andrew Hintz <adhintz at users.sourceforge.net>
- Andrew Tridgell <tridge at linuxcare.com>
- Andy Heffernan <ahh at juniper.net>
- Arkadiusz Miskiewicz <misiek at pld.org.pl>
- Armando L. Caro Jr. <acaro at mail.eecis.udel.edu>
- Arnaldo Carvalho de Melo <acme at ghostprotocols.net>
- Atsushi Onoe <onoe at netbsd.org>
- Ben Smithurst <ben at scientia.demon.co.uk>
- Brent L. Bates <blbates at vigyan.com>
- Brian Ginsbach <ginsbach at cray.com>
- Bruce M. Simpson <bms at spc.org>
- Carles Kishimoto Bisbe <ckishimo at ac.upc.es>
- Charlie Lenahan <clenahan at fortresstech.com>
- Charles M. Hannum <mycroft at netbsd.org>
- Chris Cogdon <chris at cogdon.org>
- Chris G. Demetriou <cgd at netbsd.org>
- Christian Sievers <c_s at users.sourceforge.net>
- Chris Jepeway <jepeway at blasted-heath.com>
- Chris Larson <clarson at kergoth.com>
- Craig Rodrigues <rodrigc at mediaone.net>
- Crist J. Clark <cjclark at alum.mit.edu>
- Daniel Hagerty <hag at ai.mit.edu>
- Darren Reed <darrenr at reed.wattle.id.au>
- David Binderman <d.binderman at virgin.net>
- David Smith <dsmith at redhat.com>
- David Young <dyoung at ojctech.com>
- Don Ebright <Don.Ebright at compuware.com>
- Eddie Kohler <xexd at sourceforge.net>
- Francis Dupont <Francis.Dupont at enst-bretagne.fr>
- Francisco Matias Cuenca-Acuna <mcuenca at george.rutgers.edu>
- Frank Volf <volf at oasis.IAEhv.nl>
- Fulvio Risso <risso at polito.it>
- George Bakos <gbakos at ists.dartmouth.edu>
- Gerald Combs <gerald at ethereal.com>
- Gert Doering <gert at greenie.muc.de>
- Greg Stark <gsstark at mit.edu>
- Gilbert Ramirez Jr. <gram at xiexie.org>
- Gisle Vanem <giva at bgnett.no>
- Hannes Viertel <hviertel at juniper.net>
- Hank Leininger <tcpdump-workers at progressive-comp.com>
- Harry Raaymakers <harryr at connect.com.au>
- Heinz-Ado Arnolds <Ado.Arnolds at dhm-systems.de>
- Hendrik Scholz <hendrik at scholz.net>
- Ian McDonald <imcdnzl at gmail.com>
- Jacek Tobiasz <Jacek.Tobiasz at atm.com.pl>
- Jakob Schlyter <jakob at openbsd.org>
- Jan Oravec <wsx at wsx6.net>
- Jason R. Thorpe <thorpej at netbsd.org>
- Jefferson Ogata <jogata at nodc.noaa.gov>
- Jeffrey Hutzelman <jhutz at cmu.edu>
- Jesper Peterson <jesper at endace.com>
- Jim Hutchins <jim at ca.sandia.gov>
- Jonathan Heusser <jonny at drugphish.ch>
- Tatuya Jinmei <jinmei at kame.net>
- J\xF8rgen Thomsen <jth at jth.net>
- Julian Cowley <julian at lava.net>
- Kaarthik Sivakumar <kaarthik at torrentnet.com>
- Kazushi Sugyo <sugyo at pb.jp.nec.com>
- Kelly Carmichael <kcarmich at ipapp.com>
- Ken Hornstein <kenh at cmf.nrl.navy.mil>
- Kevin Steves <stevesk at pobox.com>
- Klaus Klein <kleink at reziprozitaet.de>
- Kris Kennaway <kris at freebsd.org>
- Krzysztof Halasa <khc at pm.waw.pl>
- Larry Lile <lile at stdio.com>
- Lennert Buytenhek <buytenh at gnu.org>
- Loris Degioanni <loris at netgroup-serv.polito.it>
- Love H\xF6rnquist-\xC5strand <lha at stacken.kth.se>
- Maciej W. Rozycki <macro at ds2.pg.gda.pl>
- Manu Pathak <mapathak at cisco.com>
- Marc A. Lehmann <pcg at goof.com>
- Mark Ellzey Thomas <mark at ackers.net>
- Marko Kiiskila <carnil at cs.tut.fi>
- Markus Sch\xF6pflin <schoepflin at sourceforge.net>
- Marshall Rose <mrose at dbc.mtview.ca.us>
- Martin Husemann <martin at netbsd.org>
- Max Laier <max at love2party.net>
- Michael Madore <mmadore at turbolinux.com>
- Michael Shalayeff <mickey at openbsd.org>
- Michael Shields <shields at msrl.com>
- Michael T. Stolarchuk <mts at off.to>
- Michele "mydecay" Marchetto <smarchetto1 at tin.it>
- Monroe Williams <monroe at pobox.com>
- Motonori Shindo <mshindo at mshindo.net>
- Nathan J. Williams <nathanw at MIT.EDU>
- Nathaniel Couper-Noles <Nathaniel at isi1.tccisi.com>
- Neil T. Spring <bluehal at users.sourceforge.net>
- Niels Provos <provos at openbsd.org>
- Nickolai Zeldovich <kolya at MIT.EDU>
- Nicolas Ferrero <toorop at babylo.net>
- Noritoshi Demizu <demizu at users.sourceforge.net>
- Olaf Kirch <okir at caldera.de>
- Onno van der Linden <onno at simplex.nl>
- Pascal Hennequin <pascal.hennequin at int-evry.fr>
- Pasvorn Boonmark <boonmark at juniper.net>
- Paul Mundt <lethal at linux-sh.org>
- Paul S. Traina <pst at freebsd.org>
- Pavlin Radoslavov <pavlin at icir.org>
- Pekka Savola <pekkas at netcore.fi>
- Peter Fales <peter at fales-lorenz.net>
- Peter Jeremy <peter.jeremy at alcatel.com.au>
- <pfhunt at users.sourceforge.net>
- Phil Wood <cpw at lanl.gov>
- Rafal Maszkowski <rzm at icm.edu.pl>
- Raphael Raimbault <raphael.raimbault at netasq.com>
- Rick Cheng <rcheng at juniper.net>
- Rick Jones <rick.jones2 at hp.com>
- Rick Watson <watsonrick at users.sourceforge.net>
- Rob Braun <bbraun at synack.net>
- Roderick Schertler <roderick at argon.org>
- Sami Farin <safari at iki.fi>
- Scott Rose <syberpunk at users.sourceforge.net>
- Sebastian Krahmer <krahmer at cs.uni-potsdam.de>
- Sebastien Vincent <svincent at idems.fr>
- Seth Webster <swebster at sst.ll.mit.edu>
- Shinsuke Suzuki <suz at kame.net>
- Steinar Haug <sthaug at nethelp.no>
- Swaminathan Chandrasekaran <chander at juniper.net>
- Takashi Yamamoto <yamt at mwd.biglobe.ne.jp>
- Terry Kennedy <terry at tmk.com>
- Timo Koskiahde
- Tony Li <tli at procket.com>
- Uns Lider <unslider at miranda.org>
- Victor Oppleman <oppleman at users.sourceforge.net>
- Wesley Griffin <wgriffin at users.sourceforge.net>
- Wilbert de Graaf <wilbertdg at hetnet.nl>
- Yen Yen Lim
- Yoshifumi Nishida
+ A Costa <agcosta at gis dot net>
+ Aaron Campbell <aaron at arbor dot net>
+ Alfredo Andres <aandres at s21sec dot com>
+ Albert Chin <china at thewrittenword dot com>
+ Ananth Suryanarayana <anantha at juniper dot net>
+ Andrea Bittau <a dot bittau at cs dot ucl dot ac dot uk>
+ Andrew Brown <atatat at atatdot dot net>
+ Andrew Church <andrew at users dot sourceforge dot net>
+ Andrew Hintz <adhintz at users dot sourceforge dot net>
+ Andrew Nording <andrew at nording dot ru>
+ Andrew Tridgell <tridge at linuxcare dot com>
+ Andy Heffernan <ahh at juniper dot net>
+ Anton Bernal <anton at juniper dot net>
+ Arkadiusz Miskiewicz <misiek at pld dot org dot pl>
+ Armando L. Caro Jr. <acaro at mail dot eecis dot udel dot edu>
+ Arnaldo Carvalho de Melo <acme at ghostprotocols dot net>
+ Ben Byer <bushing at sourceforge dot net>
+ Atsushi Onoe <onoe at netbsd dot org>
+ Ben Smithurst <ben at scientia dot demon dot co dot uk>
+ Bert Vermeulen <bert at biot dot com>
+ Bjoern A. Zeeb <bzeeb at Zabbadoz dot NeT>
+ Brent L. Bates <blbates at vigyan dot com>
+ Brian Ginsbach <ginsbach at cray dot com>
+ Bruce M. Simpson <bms at spc dot org>
+ Carles Kishimoto Bisbe <ckishimo at ac dot upc dot es>
+ Charlie Lenahan <clenahan at fortresstech dot com>
+ Charles M. Hannum <mycroft at netbsd dot org>
+ Chris Cogdon <chris at cogdon dot org>
+ Chris G. Demetriou <cgd at netbsd dot org>
+ Chris Jepeway <jepeway at blasted-heath dot com>
+ Chris Larson <clarson at kergoth dot com>
+ Christian Sievers <c_s at users dot sourceforge dot net>
+ Christophe Rhodes <csr21 at cantab dot net>
+ Cliff Frey <cliff at meraki dot com>
+ Craig Rodrigues <rodrigc at mediaone dot net>
+ Crist J. Clark <cjclark at alum dot mit dot edu>
+ Daniel Hagerty <hag at ai dot mit dot edu>
+ Darren Reed <darrenr at reed dot wattle dot id dot au>
+ David Binderman <d dot binderman at virgin dot net>
+ David Horn <dhorn2000 at gmail dot com>
+ David Smith <dsmith at redhat dot com>
+ David Young <dyoung at ojctech dot com>
+ Denis Ovsienko <infrastation at yandex dot ru>
+ Dmitry Eremin-Solenikov <dbaryshkov at gmail dot com>
+ Don Ebright <Don dot Ebright at compuware dot com>
+ Eddie Kohler <xexd at sourceforge dot net>
+ Elmar Kirchner <elmar at juniper dot net>
+ Fang Wang <fangwang at sourceforge dot net>
+ Florent Drouin <Florent dot Drouin at alcatel-lucent dot fr>
+ Florian Forster <octo at verplant dot org>
+ Francis Dupont <Francis dot Dupont at enst-bretagne dot fr>
+ Francisco Matias Cuenca-Acuna <mcuenca at george dot rutgers dot edu>
+ Francois-Xavier Le Bail <fx dot lebail at yahoo dot com>
+ Frank Volf <volf at oasis dot IAEhv dot nl>
+ Fulvio Risso <risso at polito dot it>
+ George Bakos <gbakos at ists dot dartmouth dot edu>
+ Gerald Combs <gerald at ethereal dot com>
+ Gerrit Renker <gerrit at erg dot abdn dot ac dot uk>
+ Gert Doering <gert at greenie dot muc dot de>
+ Greg Minshall <minshall at acm dot org>
+ Greg Stark <gsstark at mit dot edu>
+ Grégoire Henry <henry at pps.jussieu.fr>
+ Gilbert Ramirez Jr. <gram at xiexie dot org>
+ Gisle Vanem <gvanem at broadpark dot no>
+ Hannes Viertel <hviertel at juniper dot net>
+ Hank Leininger <tcpdump-workers at progressive-comp dot com>
+ Harry Raaymakers <harryr at connect dot com dot au>
+ Heinz-Ado Arnolds <Ado dot Arnolds at dhm-systems dot de>
+ Hendrik Scholz <hendrik at scholz dot net>
+ Ian McDonald <imcdnzl at gmail dot com>
+ Ilpo Järvinen <ilpo dot jarvinen at helsinki dot fi>
+ Jacek Tobiasz <Jacek dot Tobiasz at atm dot com dot pl>
+ Jakob Schlyter <jakob at openbsd dot org>
+ Jamal Hadi Salim <hadi at cyberus dot ca>
+ Jan Oravec <wsx at wsx6 dot net>
+ Jason R. Thorpe <thorpej at netbsd dot org>
+ Jefferson Ogata <jogata at nodc dot noaa dot gov>
+ Jeffrey Hutzelman <jhutz at cmu dot edu>
+ Jesper Peterson <jesper at endace dot com>
+ Jim Hutchins <jim at ca dot sandia dot gov>
+ Jonathan Heusser <jonny at drugphish dot ch>
+ Tatuya Jinmei <jinmei at kame dot net>
+ João Medeiros <ignotus21 at sourceforge dot net>
+ Joerg Mayer <jmayer at loplof.de>
+ Jørgen Thomsen <jth at jth dot net>
+ Julian Cowley <julian at lava dot net>
+ Juliusz Chroboczek <jch at pps.jussieu.fr>
+ Kaarthik Sivakumar <kaarthik at torrentnet dot com>
+ Kaladhar Musunuru <kaladharm at sourceforge dot net>
+ Karl Norby <karl-norby at sourceforge dot net>
+ Kazushi Sugyo <sugyo at pb dot jp dot nec dot com>
+ Kelly Carmichael <kcarmich at ipapp dot com>
+ Ken Hornstein <kenh at cmf dot nrl dot navy dot mil>
+ Kevin Steves <stevesk at pobox dot com>
+ Kenichi Maehashi <webmaster at kenichimaehashi dot com>
+ Klaus Klein <kleink at reziprozitaet dot de>
+ Kris Kennaway <kris at freebsd dot org>
+ Krzysztof Halasa <khc at pm dot waw dot pl>
+ Larry Lile <lile at stdio dot com>
+ Lennert Buytenhek <buytenh at gnu dot org>
+ Loris Degioanni <loris at netgroup-serv dot polito dot it>
+ Love Hörnquist-Åstrand <lha at stacken dot kth dot se>
+ Lucas C. Villa Real <lucasvr at us dot ibm dot com>
+ Luis MartinGarcia <luis dot mgarc at gmail dot com>
+ Maciej W. Rozycki <macro at ds2 dot pg dot gda dot pl>
+ Manu Pathak <mapathak at cisco dot com>
+ Marc Binderberger <mbind at sourceforge dot net>
+ Marc A. Lehmann <pcg at goof dot com>
+ Mark Ellzey Thomas <mark at ackers dot net>
+ Marko Kiiskila <carnil at cs dot tut dot fi>
+ Markus Schöpflin <schoepflin at sourceforge dot net>
+ Marshall Rose <mrose at dbc dot mtview dot ca dot us>
+ Martin Husemann <martin at netbsd dot org>
+ Max Laier <max at love2party dot net>
+ Michael A. Meffie III <meffie at sourceforge dot net>
+ Michael Madore <mmadore at turbolinux dot com>
+ Michael Riepe <too-tired at sourceforge dot net>
+ Michael Shalayeff <mickey at openbsd dot org>
+ Michael Shields <shields at msrl dot com>
+ Michael T. Stolarchuk <mts at off dot to>
+ Michal Sekletar <msekleta at redhat dot com>
+ Michele "mydecay" Marchetto <smarchetto1 at tin dot it>
+ Mike Frysinger <vapier at gmail dot com>
+ Minto Jeyananth <minto at juniper dot net>
+ Monroe Williams <monroe at pobox dot com>
+ Motonori Shindo <mshindo at mshindo dot net>
+ Nathan J. Williams <nathanw at MIT dot EDU>
+ Nathaniel Couper-Noles <Nathaniel at isi1 dot tccisi dot com>
+ Neil T. Spring <bluehal at users dot sourceforge dot net>
+ Niels Provos <provos at openbsd dot org>
+ Nickolai Zeldovich <kolya at MIT dot EDU>
+ Nicolas Ferrero <toorop at babylo dot net>
+ Noritoshi Demizu <demizu at users dot sourceforge dot net>
+ Olaf Kirch <okir at caldera dot de>
+ Onno van der Linden <onno at simplex dot nl>
+ Paolo Abeni <paolo dot abeni at email dot it>
+ Pascal Hennequin <pascal dot hennequin at int-evry dot fr>
+ Pasvorn Boonmark <boonmark at juniper dot net>
+ Paul Ferrell <pflarr at sourceforge dot net>
+ Paul Mundt <lethal at linux-sh dot org>
+ Paul S. Traina <pst at freebsd dot org>
+ Pavlin Radoslavov <pavlin at icir dot org>
+ Pawel Worach <pawel dot worach at gmail dot com>
+ Pekka Savola <pekkas at netcore dot fi>
+ Peter Fales <peter at fales-lorenz dot net>
+ Peter Jeremy <peter dot jeremy at alcatel dot com dot au>
+ <pfhunt at users dot sourceforge dot net>
+ Peter Volkov <pva at gentoo dot org>
+ Phil Wood <cpw at lanl dot gov>
+ Rafal Maszkowski <rzm at icm dot edu dot pl>
+ Randy Sofia <rsofia at users dot sourceforge dot net>
+ Raphael Raimbault <raphael dot raimbault at netasq dot com>
+ Rick Cheng <rcheng at juniper dot net>
+ Rick Jones <rick dot jones2 at hp dot com>
+ Rick Watson <watsonrick at users dot sourceforge dot net>
+ Rob Braun <bbraun at synack dot net>
+ Robert Edmonds <stu-42 at sourceforge dot net>
+ Roderick Schertler <roderick at argon dot org>
+ Romain Francoise <rfrancoise at debian dot org>
+ Sagun Shakya <sagun dot shakya at sun dot com>
+ Sami Farin <safari at iki dot fi>
+ Scott Mcmillan <scott.a.mcmillan at intel dot com>
+ Scott Rose <syberpunk at users dot sourceforge dot net>
+ Sebastian Krahmer <krahmer at cs dot uni-potsdam dot de>
+ Sebastien Raveau <sebastien dot raveau at epita dot fr>
+ Sebastien Vincent <svincent at idems dot fr>
+ Sepherosa Ziehau <sepherosa at gmail dot com>
+ Seth Webster <swebster at sst dot ll dot mit dot edu>
+ Shinsuke Suzuki <suz at kame dot net>
+ Simon Ruderich <simon at ruderich dot org>
+ Steinar Haug <sthaug at nethelp dot no>
+ Swaminathan Chandrasekaran <chander at juniper dot net>
+ Takashi Yamamoto <yamt at mwd dot biglobe dot ne dot jp>
+ Terry Kennedy <terry at tmk dot com>
+ Timo Koskiahde
+ Tony Li <tli at procket dot com>
+ Toshihiro Kanda <candy at fct dot kgc dot co dot jp>
+ Uns Lider <unslider at miranda dot org>
+ Victor Oppleman <oppleman at users dot sourceforge dot net>
+ Weesan Lee <weesan at juniper dot net>
+ Wesley Griffin <wgriffin at users dot sourceforge dot net>
+ Wesley Shields <wxs at FreeBSD dot org>
+ Wilbert de Graaf <wilbertdg at hetnet dot nl>
+ Will Drewry <will at alum dot bu dot edu>
+ William J. Hulley <bill dot hulley at gmail dot com>
+ Yen Yen Lim
+ Yoshifumi Nishida
The original LBL crew:
- Steve McCanne
- Craig Leres
- Van Jacobson
+ Steve McCanne
+ Craig Leres
+ Van Jacobson
+
+Past maintainers:
+ Jun-ichiro itojun Hagino <itojun at iijlab dot net>
Deleted: trunk/contrib/tcpdump/FILES
===================================================================
--- trunk/contrib/tcpdump/FILES 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/FILES 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,251 +0,0 @@
-CHANGES
-CREDITS
-FILES
-INSTALL
-LICENSE
-Makefile.in
-README
-Readme.Win32
-VERSION
-acconfig.h
-aclocal.m4
-addrtoname.c
-addrtoname.h
-af.c
-af.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
-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-olsr.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
-tftp.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
Deleted: trunk/contrib/tcpdump/INSTALL
===================================================================
--- trunk/contrib/tcpdump/INSTALL 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/INSTALL 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,252 +0,0 @@
-@(#) $Header: /home/cvs/src/contrib/tcpdump/INSTALL,v 1.1.1.3 2009-03-25 16:54:04 laffer1 Exp $ (LBL)
-
-If you have not built libpcap, and your system does not have libpcap
-installed, install libpcap first. Your system might provide a version
-of libpcap that can be installed; if so, to compile tcpdump you might
-need to install a "developer" version of libpcap as well as the
-"run-time" version. You can also install tcpdump.org's version of
-libpcap; see the README file in this directory for the ftp location.
-
-You will need an ANSI C compiler to build tcpdump. The configure script
-will abort if your compiler is not ANSI compliant. If this happens, use
-the GNU C compiler, available via anonymous ftp:
-
- ftp://ftp.gnu.org/pub/gnu/gcc/
-
-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. Any user will be able to use tcpdump to
-read saved captures. Whether a user will be able to capture traffic
-depends on the OS and the configuration of the system; see the tcpdump
-man page for details. DO NOT give untrusted users the ability to
-capture traffic. If a user can capture traffic, he or she could use
-utilities such as tcpdump to 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 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
-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
-tftp.h - TFTP definitions
-timed.h - BSD time daemon protocol definitions
-token.h - Token Ring definitions
-udp.h - UDP definitions
-util.c - utility routines
-vfprintf.c - emulation routine
-win32 - headers and routines for building on Win32 systems
Added: trunk/contrib/tcpdump/INSTALL.txt
===================================================================
--- trunk/contrib/tcpdump/INSTALL.txt (rev 0)
+++ trunk/contrib/tcpdump/INSTALL.txt 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,255 @@
+@(#) $Header: /tcpdump/master/tcpdump/INSTALL.txt,v 1.2 2008-02-06 10:47:53 guy Exp $ (LBL)
+
+If you have not built libpcap, and your system does not have libpcap
+installed, install libpcap first. Your system might provide a version
+of libpcap that can be installed; if so, to compile tcpdump you might
+need to install a "developer" version of libpcap as well as the
+"run-time" version. You can also install tcpdump.org's version of
+libpcap; see the README file in this directory for the ftp location.
+
+You will need an ANSI C compiler to build tcpdump. The configure script
+will abort if your compiler is not ANSI compliant. If this happens, use
+the GNU C compiler, available via anonymous ftp:
+
+ ftp://ftp.gnu.org/pub/gnu/gcc/
+
+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. Any user will be able to use tcpdump to
+read saved captures. Whether a user will be able to capture traffic
+depends on the OS and the configuration of the system; see the tcpdump
+man page for details. DO NOT give untrusted users the ability to
+capture traffic. If a user can capture traffic, he or she could use
+utilities such as tcpdump to 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 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.txt - this file
+LICENSE - the license under which tcpdump is distributed
+Makefile.in - compilation rules (input to the configure script)
+README - description of distribution
+Readme.Win32 - notes on building tcpdump on Win32 systems (with WinPcap)
+VERSION - version of this release
+acconfig.h - autoconf input
+aclocal.m4 - autoconf macros
+addrtoname.c - address to hostname routines
+addrtoname.h - address to hostname definitions
+ah.h - IPSEC Authentication Header definitions
+aodv.h - AODV definitions
+appletalk.h - AppleTalk definitions
+arcnet.h - ARCNET definitions
+atime.awk - TCP ack awk script
+atm.h - ATM traffic type definitions
+atmuni31.h - ATM Q.2931 definitions
+bgp.h - BGP declarations
+bootp.h - BOOTP definitions
+bpf_dump.c - BPF program printing routines, in case libpcap doesn't
+ have them
+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
+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-beep.c - BEEP printer routines
+print-bgp.c - Border Gateway Protocol printer routines
+print-bootp.c - BOOTP and IPv4 DHCP printer routines
+print-bt.c - Bluetooth 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-rrcp.c - Realtek Remote Control Protocol 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-usb.c - USB 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
+tftp.h - TFTP definitions
+timed.h - BSD time daemon protocol definitions
+token.h - Token Ring definitions
+udp.h - UDP definitions
+util.c - utility routines
+vfprintf.c - emulation routine
+win32 - headers and routines for building on Win32 systems
Property changes on: trunk/contrib/tcpdump/INSTALL.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/Makefile.in
===================================================================
--- trunk/contrib/tcpdump/Makefile.in 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/Makefile.in 2016-09-17 22:44:52 UTC (rev 8321)
@@ -17,7 +17,7 @@
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# @(#) $Header: /home/cvs/src/contrib/tcpdump/Makefile.in,v 1.1.1.3 2009-03-25 16:54:04 laffer1 Exp $ (LBL)
+# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.325 2008-11-21 23:17:26 guy Exp $ (LBL)
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
@@ -26,6 +26,7 @@
# Top level hierarchy
prefix = @prefix@
exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
# Pathname of directory to install the binary
sbindir = @sbindir@
# Pathname of directory to install the man page
@@ -46,7 +47,8 @@
DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@
# Standard CFLAGS
-CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
+CFLAGS = @CFLAGS@
+FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS)
# Standard LDFLAGS
LDFLAGS = @LDFLAGS@
@@ -57,6 +59,7 @@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
+RANLIB = @RANLIB@
# 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,47 +66,129 @@
# problem if you don't own the file but can write to the directory.
.c.o:
@rm -f $@
- $(CC) $(CFLAGS) -c $(srcdir)/$*.c
+ $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c
-CSRC = addrtoname.c af.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 \
+CSRC = addrtoname.c af.c checksum.c cpack.c gmpls.c oui.c gmt2local.c ipproto.c \
+ nlpid.c l2vpn.c machdep.c parsenfsfh.c in_cksum.c \
+ print-802_11.c print-802_15_4.c print-ap1394.c print-ah.c \
+ print-arcnet.c print-aodv.c print-arp.c print-ascii.c print-atalk.c \
+ print-atm.c print-beep.c print-bfd.c print-bgp.c \
+ print-bootp.c print-bt.c print-carp.c print-cdp.c print-cfm.c \
print-chdlc.c print-cip.c print-cnfp.c print-dccp.c print-decnet.c \
- print-domain.c print-dvmrp.c print-enc.c print-egp.c \
+ print-domain.c print-dtp.c print-dvmrp.c print-enc.c print-egp.c \
print-eap.c print-eigrp.c\
- print-esp.c print-ether.c print-fddi.c print-fr.c \
+ print-esp.c print-ether.c print-fddi.c print-forces.c print-fr.c \
print-gre.c print-hsrp.c print-icmp.c print-igmp.c \
- print-igrp.c print-ip.c print-ipcomp.c print-ipfc.c \
- print-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-olsr.c print-ospf.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-igrp.c print-ip.c print-ipcomp.c print-ipfc.c print-ipnet.c \
+ print-ipx.c print-isoclns.c print-juniper.c print-krb.c \
+ print-l2tp.c print-lane.c print-ldp.c print-lldp.c print-llc.c \
+ print-lmp.c print-lspping.c print-lwapp.c \
+ print-lwres.c print-mobile.c print-mpcp.c print-mpls.c print-msdp.c \
+ print-msnlb.c print-nfs.c print-ntp.c print-null.c print-olsr.c print-ospf.c \
+ print-pgm.c print-pim.c \
+ print-ppi.c print-ppp.c print-pppoe.c print-pptp.c \
+ print-radius.c print-raw.c print-rip.c print-rpki-rtr.c print-rrcp.c print-rsvp.c \
+ print-rx.c print-sctp.c print-sflow.c print-sip.c print-sl.c print-sll.c \
print-slow.c print-snmp.c print-stp.c print-sunatm.c print-sunrpc.c \
print-symantec.c print-syslog.c print-tcp.c print-telnet.c print-tftp.c \
- print-timed.c print-token.c print-udp.c print-vjc.c print-vrrp.c \
- print-wb.c print-zephyr.c setsignal.c tcpdump.c util.c
+ print-timed.c print-tipc.c print-token.c print-udld.c print-udp.c \
+ print-usb.c print-vjc.c print-vqp.c print-vrrp.c print-vtp.c \
+ print-wb.c print-zephyr.c print-zeromq.c print-vxlan.c print-otv.c signature.c setsignal.c tcpdump.c util.c
+LIBNETDISSECT_SRC=print-isakmp.c
+LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o)
+LIBNETDISSECT=libnetdissect.a
+
LOCALSRC = @LOCALSRC@
GENSRC = version.c
LIBOBJS = @LIBOBJS@
-SRC = $(CSRC) $(GENSRC) $(LOCALSRC)
+SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC)
# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
# hack the extra indirection
-OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LOCALSRC:.c=.o) $(LIBOBJS)
-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 \
+OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LOCALSRC:.c=.o) $(LIBOBJS) $(LIBNETDISSECT_OBJ)
+HDR = \
+ acconfig.h \
+ addrtoname.h \
+ af.h \
+ ah.h \
+ aodv.h \
+ appletalk.h \
+ arcnet.h \
+ atm.h \
+ atmuni31.h \
+ bootp.h \
+ bgp.h \
+ chdlc.h \
+ cpack.h \
+ dccp.h \
+ decnet.h \
+ decode_prefix.h \
+ enc.h \
+ esp.h \
+ ether.h \
+ ethertype.h \
+ extract.h \
+ fddi.h \
+ forces.h \
+ gmpls.h \
+ gmt2local.h \
+ icmp6.h \
+ ieee802_11.h \
+ ieee802_11_radio.h \
+ igrp.h \
+ interface.h \
+ interface.h \
+ ip.h \
+ ip6.h \
+ ipfc.h \
+ ipnet.h \
+ ipproto.h \
+ ipsec_doi.h \
+ ipx.h \
+ isakmp.h \
+ l2tp.h \
+ l2vpn.h \
+ lane.h \
+ llc.h \
+ machdep.h \
+ mib.h \
+ mpls.h \
+ nameser.h \
+ netbios.h \
+ netdissect.h \
+ nfs.h \
+ nfsfh.h \
+ nlpid.h \
+ ntp.h \
+ oakley.h \
+ ospf.h \
+ ospf6.h \
+ oui.h \
+ pcap-missing.h \
+ pmap_prot.h \
+ ppi.h \
+ ppp.h \
+ route6d.h \
+ rpc_auth.h \
+ rpc_msg.h \
+ rx.h \
+ sctpConstants.h \
+ sctpHeader.h \
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
+ signature.h \
+ slcompress.h \
+ slip.h \
+ sll.h \
+ smb.h \
+ tcp.h \
+ tcpdump-stdinc.h \
+ telnet.h \
+ tftp.h \
+ timed.h \
+ token.h \
+ udp.h
TAGHDR = \
/usr/include/arpa/tftp.h \
@@ -120,49 +205,131 @@
CLEANFILES = $(PROG) $(OBJ) $(GENSRC)
+EXTRA_DIST = \
+ CHANGES \
+ CREDITS \
+ INSTALL.txt \
+ LICENSE \
+ Makefile.in \
+ Makefile-devel-adds \
+ README \
+ Readme.Win32 \
+ VERSION \
+ aclocal.m4 \
+ atime.awk \
+ bpf_dump.c \
+ config.guess \
+ config.h.in \
+ config.sub \
+ configure \
+ configure.in \
+ install-sh \
+ lbl/os-osf4.h \
+ lbl/os-solaris2.h \
+ lbl/os-sunos4.h \
+ lbl/os-ultrix4.h \
+ makemib \
+ missing/addrinfo.h \
+ missing/dlnames.c \
+ missing/datalinks.c \
+ missing/getnameinfo.c \
+ missing/inet_aton.c \
+ missing/inet_ntop.c \
+ missing/inet_pton.c \
+ missing/snprintf.c \
+ missing/sockstorage.h \
+ missing/strdup.c \
+ missing/strlcat.c \
+ missing/strlcpy.c \
+ missing/strsep.c \
+ mkdep \
+ packetdat.awk \
+ pcap_dump_ftell.c \
+ print-babel.c \
+ print-dhcp6.c \
+ print-frag6.c \
+ print-icmp6.c \
+ print-ip6.c \
+ print-ip6opts.c \
+ print-mobility.c \
+ print-netbios.c \
+ print-ospf6.c \
+ print-pflog.c \
+ print-ripng.c \
+ print-rt6.c \
+ print-smb.c \
+ send-ack.awk \
+ smbutil.c \
+ stime.awk \
+ strcasecmp.c \
+ tcpdump.1.in \
+ vfprintf.c \
+ win32/Include/bittypes.h \
+ win32/Include/errno.h \
+ win32/Include/getopt.h \
+ win32/Include/w32_fzs.h \
+ win32/Src/getopt.c \
+ win32/prj/GNUmakefile \
+ win32/prj/WinDump.dsp \
+ win32/prj/WinDump.dsw
+
+TEST_DIST= `find tests \( -name 'DIFF' -prune \) -o \( -name NEW -prune \) -o -type f \! -name '.*' \! -name '*~' -print`
+
all: $(PROG)
$(PROG): $(OBJ) @V_PCAPDEP@
@rm -f $@
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
+ $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
+$(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
+ @rm -f $@
+ $(AR) $(ARFLAGS) $@ $(LIBNETDISSECT_OBJ)
+ $(RANLIB) $@
+
datalinks.o: $(srcdir)/missing/datalinks.c
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
+ $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
dlnames.o: $(srcdir)/missing/dlnames.c
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
+ $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
getnameinfo.o: $(srcdir)/missing/getnameinfo.c
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c
+ $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c
getaddrinfo.o: $(srcdir)/missing/getaddrinfo.c
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/getaddrinfo.c
+ $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getaddrinfo.c
inet_pton.o: $(srcdir)/missing/inet_pton.c
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c
+ $(CC) $(FULL_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
+ $(CC) $(FULL_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
+ $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c
snprintf.o: $(srcdir)/missing/snprintf.c
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
+ $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
strlcat.o: $(srcdir)/missing/strlcat.c
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
+ $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
strlcpy.o: $(srcdir)/missing/strlcpy.c
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
+ $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
strsep.o: $(srcdir)/missing/strsep.c
- $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
+ $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
version.o: version.c
- $(CC) $(CFLAGS) -c version.c
+ $(CC) $(FULL_CFLAGS) -c version.c
version.c: $(srcdir)/VERSION
@rm -f $@
- sed -e 's/.*/char version[] = "&";/' $(srcdir)/VERSION > $@
+ if grep GIT ${srcdir}/VERSION >/dev/null; then \
+ read ver <${srcdir}/VERSION; \
+ echo $$ver | tr -d '\012'; \
+ date +_%Y_%m_%d; \
+ else \
+ cat ${srcdir}/VERSION; \
+ fi | sed -e 's/.*/const char version[] = "&";/' > $@
-install:
+install: all
[ -d $(DESTDIR)$(sbindir) ] || \
(mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir))
$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
+ $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG).`cat ${srcdir}/VERSION`
[ -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_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
uninstall:
rm -f $(DESTDIR)$(sbindir)/$(PROG)
@@ -174,19 +341,31 @@
grep -v 'possible pointer alignment problem'
clean:
- rm -f $(CLEANFILES)
+ rm -f $(CLEANFILES) $(PROG)-`cat VERSION`.tar.gz
distclean:
rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
- config.h gnuc.h os-proto.h stamp-h stamp-h.in
+ config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1
+ rm -rf autom4te.cache
+check: tcpdump
+ (cd tests && ./TESTrun.sh)
+
tags: $(TAGFILES)
ctags -wtd $(TAGFILES)
+TAGS: $(TAGFILES)
+ etags $(TAGFILES)
+
releasetar:
@cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
- list="" ; make distclean; cd ..; mkdir -p n; cd n; ln -s ../$$dir $$name; \
- tar -c -z -f $$name.tar.gz $$name/. ;
+ mkdir $$name; \
+ tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST) | (cd $$name; tar xf -); \
+ tar -c -z -f $$name.tar.gz $$name; \
+ rm -rf $$name
+testlist:
+ echo $(TEST_DIST)
+
depend: $(GENSRC)
${srcdir}/mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
Deleted: trunk/contrib/tcpdump/PLATFORMS
===================================================================
--- trunk/contrib/tcpdump/PLATFORMS 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/PLATFORMS 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,9 +0,0 @@
-== 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)
-
-
Modified: trunk/contrib/tcpdump/README
===================================================================
--- trunk/contrib/tcpdump/README 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/README 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,22 +1,24 @@
-@(#) $Header: /home/cvs/src/contrib/tcpdump/README,v 1.1.1.3 2009-03-25 16:54:04 laffer1 Exp $ (LBL)
+@(#) $Header: /tcpdump/master/tcpdump/README,v 1.68 2008-12-15 00:05:27 guy Exp $ (LBL)
-TCPDUMP 3.9
+TCPDUMP 4.x.y
Now maintained by "The Tcpdump Group"
See www.tcpdump.org
-Please send inquiries/comments/reports to tcpdump-workers at tcpdump.org
+Please send inquiries/comments/reports to:
+ tcpdump-workers at lists.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
+Anonymous Git is available via:
+ git clone git://bpf.tcpdump.org/tcpdump
-Version 3.9 of TCPDUMP can be retrieved with the CVS tag "tcpdump_3_9rel1":
- cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_3_9rel1 tcpdump
+Version 4.x.y of TCPDUMP can be retrieved with the CVS tag "tcpdump_4_xrely":
+ cvs -d :pserver:cvs.tcpdump.org:/tcpdump/master checkout -r tcpdump_4_xrely tcpdump
-Please submit patches against the master copy to the tcpdump project on
-sourceforge.net.
+Please submit patches by forking the branch on GitHub at
+ http://github.com/mcr/tcpdump/tree/master
+
+and issuing a pull request.
+
formerly from Lawrence Berkeley National Laboratory
Network Research Group <tcpdump at ee.lbl.gov>
ftp://ftp.ee.lbl.gov/tcpdump.tar.Z (3.4)
@@ -68,19 +70,21 @@
documentation.
Problems, bugs, questions, desirable enhancements, etc. should be sent
-to the address "tcpdump-workers at tcpdump.org". Bugs, support requests,
-and feature requests may also be submitted on the SourceForge site for
-tcpdump at
+to the address "tcpdump-workers at lists.tcpdump.org". Bugs, support
+requests, and feature requests may also be submitted on the GitHub issue
+tracker for tcpdump at
- http://sourceforge.net/projects/tcpdump/
+ https://github.com/mcr/tcpdump/issues
Source code contributions, etc. should be sent to the email address
-"patches at tcpdump.org", or submitted as patches on the SourceForge site
-for tcpdump.
+above or submitted by forking the branch on GitHub at
-Current versions can be found at www.tcpdump.org, or the SourceForge
-site for tcpdump.
+ http://github.com/mcr/tcpdump/tree/master
+and issuing a pull request.
+
+Current versions can be found at www.tcpdump.org.
+
- The TCPdump team
original text by: Steve McCanne, Craig Leres, Van Jacobson
Deleted: trunk/contrib/tcpdump/Readme.Win32
===================================================================
--- trunk/contrib/tcpdump/Readme.Win32 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/Readme.Win32 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,24 +0,0 @@
-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.
\ No newline at end of file
Deleted: trunk/contrib/tcpdump/TODO
===================================================================
--- trunk/contrib/tcpdump/TODO 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/TODO 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,6 +0,0 @@
-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
Modified: trunk/contrib/tcpdump/VERSION
===================================================================
--- trunk/contrib/tcpdump/VERSION 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/VERSION 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1 +1 @@
-3.9.8
+4.4.0
Modified: trunk/contrib/tcpdump/acconfig.h
===================================================================
--- trunk/contrib/tcpdump/acconfig.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/acconfig.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -2,9 +2,6 @@
* 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
@@ -11,23 +8,6 @@
/* 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
@@ -37,24 +17,6 @@
/* 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
@@ -91,21 +53,6 @@
/* 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
@@ -115,14 +62,6 @@
/* 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
Modified: trunk/contrib/tcpdump/addrtoname.c
===================================================================
--- trunk/contrib/tcpdump/addrtoname.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/addrtoname.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,11 +21,11 @@
* Internet, ethernet, port, and protocol string to address
* and address to string conversion routines
*
- * $FreeBSD: src/contrib/tcpdump/addrtoname.c,v 1.15.2.1 2007/10/19 03:03:57 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/addrtoname.c 252283 2013-06-27 00:37:59Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/addrtoname.c,v 1.1.1.3 2009-03-25 16:54:04 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.119 2007-08-08 14:06:34 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -81,7 +81,6 @@
*/
#define HASHNAMESIZE 4096
-#define BUFSIZE 128
struct hnamemem {
u_int32_t addr;
@@ -89,12 +88,12 @@
struct hnamemem *nxt;
};
-struct hnamemem hnametable[HASHNAMESIZE];
-struct hnamemem tporttable[HASHNAMESIZE];
-struct hnamemem uporttable[HASHNAMESIZE];
-struct hnamemem eprototable[HASHNAMESIZE];
-struct hnamemem dnaddrtable[HASHNAMESIZE];
-struct hnamemem ipxsaptable[HASHNAMESIZE];
+static struct hnamemem hnametable[HASHNAMESIZE];
+static struct hnamemem tporttable[HASHNAMESIZE];
+static struct hnamemem uporttable[HASHNAMESIZE];
+static struct hnamemem eprototable[HASHNAMESIZE];
+static struct hnamemem dnaddrtable[HASHNAMESIZE];
+static struct hnamemem ipxsaptable[HASHNAMESIZE];
#if defined(INET6) && defined(WIN32)
/*
@@ -143,7 +142,7 @@
struct h6namemem *nxt;
};
-struct h6namemem h6nametable[HASHNAMESIZE];
+static struct h6namemem h6nametable[HASHNAMESIZE];
#endif /* INET6 */
struct enamemem {
@@ -156,9 +155,9 @@
struct enamemem *e_nxt;
};
-struct enamemem enametable[HASHNAMESIZE];
-struct enamemem nsaptable[HASHNAMESIZE];
-struct enamemem bytestringtable[HASHNAMESIZE];
+static struct enamemem enametable[HASHNAMESIZE];
+static struct enamemem nsaptable[HASHNAMESIZE];
+static struct enamemem bytestringtable[HASHNAMESIZE];
struct protoidmem {
u_int32_t p_oui;
@@ -167,7 +166,7 @@
struct protoidmem *p_nxt;
};
-struct protoidmem protoidtable[HASHNAMESIZE];
+static struct protoidmem protoidtable[HASHNAMESIZE];
/*
* A faster replacement for inet_ntoa().
@@ -314,7 +313,7 @@
}
#endif /* INET6 */
-static char hex[] = "0123456789abcdef";
+static const char hex[] = "0123456789abcdef";
/* Find the hash node that corresponds the ether address 'ep' */
@@ -384,6 +383,9 @@
tp->e_addr2 = k;
tp->e_bs = (u_char *) calloc(1, nlen + 1);
+ if (tp->e_bs == NULL)
+ error("lookup_bytestring: calloc");
+
memcpy(tp->e_bs, bs, nlen);
tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp));
if (tp->e_nxt == NULL)
@@ -511,15 +513,49 @@
}
const char *
-linkaddr_string(const u_char *ep, const unsigned int len)
+le64addr_string(const u_char *ep)
{
+ const unsigned int len = 8;
register u_int i;
register char *cp;
register struct enamemem *tp;
+ char buf[BUFSIZE];
- if (len == ETHER_ADDR_LEN) /* XXX not totally correct... */
- return etheraddr_string(ep);
+ tp = lookup_bytestring(ep, len);
+ if (tp->e_name)
+ return (tp->e_name);
+ cp = buf;
+ for (i = len; i > 0 ; --i) {
+ *cp++ = hex[*(ep + i - 1) >> 4];
+ *cp++ = hex[*(ep + i - 1) & 0xf];
+ *cp++ = ':';
+ }
+ cp --;
+
+ *cp = '\0';
+
+ tp->e_name = strdup(buf);
+
+ return (tp->e_name);
+}
+
+const char *
+linkaddr_string(const u_char *ep, const unsigned int type, const unsigned int len)
+{
+ register u_int i;
+ register char *cp;
+ register struct enamemem *tp;
+
+ if (len == 0)
+ return ("<empty>");
+
+ if (type == LINKADDR_ETHER && len == ETHER_ADDR_LEN)
+ return (etheraddr_string(ep));
+
+ if (type == LINKADDR_FRELAY)
+ return (q922_string(ep));
+
tp = lookup_bytestring(ep, len);
if (tp->e_name)
return (tp->e_name);
@@ -745,7 +781,7 @@
}
}
-static struct protoidlist {
+static const struct protoidlist {
const u_char protoid[5];
const char *name;
} protoidlist[] = {
@@ -766,7 +802,7 @@
{
register int i;
register struct protoidmem *tp;
- struct protoidlist *pl;
+ const struct protoidlist *pl;
u_char protoid[5];
protoid[0] = 0;
@@ -790,7 +826,7 @@
}
}
-static struct etherlist {
+static const struct etherlist {
const u_char addr[6];
const char *name;
} etherlist[] = {
@@ -815,7 +851,7 @@
static void
init_etherarray(void)
{
- register struct etherlist *el;
+ register const struct etherlist *el;
register struct enamemem *tp;
#ifdef USE_ETHER_NTOHOST
char name[256];
@@ -859,7 +895,7 @@
}
}
-static struct tok ipxsap_db[] = {
+static const struct tok ipxsap_db[] = {
{ 0x0000, "Unknown" },
{ 0x0001, "User" },
{ 0x0002, "User Group" },
Modified: trunk/contrib/tcpdump/addrtoname.h
===================================================================
--- trunk/contrib/tcpdump/addrtoname.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/addrtoname.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,13 +18,23 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/addrtoname.h,v 1.1.1.2 2006-02-25 02:34:01 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/addrtoname.h,v 1.20 2007-08-08 14:06:34 hannes Exp $ (LBL)
*/
/* Name to address translation routines. */
-extern const char *linkaddr_string(const u_char *, const unsigned int);
+enum {
+ LINKADDR_ETHER,
+ LINKADDR_FRELAY,
+ LINKADDR_IEEE1394,
+ LINKADDR_ATM
+};
+
+#define BUFSIZE 128
+
+extern const char *linkaddr_string(const u_char *, const unsigned int, const unsigned int);
extern const char *etheraddr_string(const u_char *);
+extern const char *le64addr_string(const u_char *);
extern const char *etherproto_string(u_short);
extern const char *tcpport_string(u_short);
extern const char *udpport_string(u_short);
Modified: trunk/contrib/tcpdump/af.c
===================================================================
--- trunk/contrib/tcpdump/af.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/af.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -17,7 +17,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/af.c,v 1.1.1.1 2009-03-25 16:54:04 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/af.c,v 1.3 2006-03-23 14:58:44 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -28,7 +28,7 @@
#include "interface.h"
#include "af.h"
-struct tok af_values[] = {
+const struct tok af_values[] = {
{ 0, "Reserved"},
{ AFNUM_INET, "IPv4"},
{ AFNUM_INET6, "IPv6"},
@@ -50,7 +50,7 @@
{ 0, NULL},
};
-struct tok bsd_af_values[] = {
+const struct tok bsd_af_values[] = {
{ BSD_AFNUM_INET, "IPv4" },
{ BSD_AFNUM_NS, "NS" },
{ BSD_AFNUM_ISO, "ISO" },
Modified: trunk/contrib/tcpdump/af.h
===================================================================
--- trunk/contrib/tcpdump/af.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/af.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/af.h,v 1.1.1.1 2009-03-25 16:54:04 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/af.h,v 1.3 2006-03-23 14:58:44 hannes Exp $ (LBL) */
/*
* Copyright (c) 1998-2006 The TCPDUMP project
@@ -17,8 +17,8 @@
* Original code by Hannes Gredler (hannes at juniper.net)
*/
-extern struct tok af_values[];
-extern struct tok bsd_af_values[];
+extern const struct tok af_values[];
+extern const struct tok bsd_af_values[];
/* RFC1700 address family numbers */
#define AFNUM_INET 1
Modified: trunk/contrib/tcpdump/aodv.h
===================================================================
--- trunk/contrib/tcpdump/aodv.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/aodv.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/aodv.h,v 1.1.1.2 2006-02-25 02:34:01 laffer1 Exp $ (LBL) */
+/* @(#) $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 at spc.org>
* All rights reserved.
Modified: trunk/contrib/tcpdump/appletalk.h
===================================================================
--- trunk/contrib/tcpdump/appletalk.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/appletalk.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -20,7 +20,7 @@
*
* AppleTalk protocol formats (courtesy Bill Croft of Stanford/SUMEX).
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/appletalk.h,v 1.1.1.2 2006-02-25 02:34:01 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/appletalk.h,v 1.16 2004-05-01 09:41:50 hannes Exp $ (LBL)
*/
struct LAP {
Modified: trunk/contrib/tcpdump/arcnet.h
===================================================================
--- trunk/contrib/tcpdump/arcnet.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/arcnet.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#) $Id: arcnet.h,v 1.1.1.2 2006-02-25 02:34:01 laffer1 Exp $ (LBL)
+ * @(#) $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
*/
Modified: trunk/contrib/tcpdump/atm.h
===================================================================
--- trunk/contrib/tcpdump/atm.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/atm.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -14,7 +14,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/atm.h,v 1.1.1.2 2006-02-25 02:34:01 laffer1 Exp $
+ * @(#) $Header: /tcpdump/master/tcpdump/atm.h,v 1.3 2006-02-08 01:43:00 hannes Exp $
*/
/*
@@ -30,3 +30,4 @@
*/
#define ATM_OAM_NOHEC 0
#define ATM_OAM_HEC 1
+#define ATM_HDR_LEN_NOHEC 4
Modified: trunk/contrib/tcpdump/atmuni31.h
===================================================================
--- trunk/contrib/tcpdump/atmuni31.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/atmuni31.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -29,18 +29,18 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/atmuni31.h,v 1.1.1.2 2006-02-25 02:34:01 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/atmuni31.h,v 1.3 2007-10-22 19:37:51 guy Exp $ (LBL)
*/
/* Based on UNI3.1 standard by ATM Forum */
/* 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 */
+#define VCI_PPC 0x05 /* Point-to-point signal msg */
+#define VCI_BCC 0x02 /* Broadcast signal msg */
+#define VCI_OAMF4SC 0x03 /* Segment OAM F4 flow cell */
+#define VCI_OAMF4EC 0x04 /* End-to-end OAM F4 flow cell */
+#define VCI_METAC 0x01 /* Meta signal msg */
+#define VCI_ILMIC 0x10 /* ILMI msg */
/* Q.2931 signalling messages */
#define CALL_PROCEED 0x02 /* call proceeding */
Modified: trunk/contrib/tcpdump/bgp.h
===================================================================
--- trunk/contrib/tcpdump/bgp.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/bgp.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/bgp.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL) */
+/* @(#) $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
Property changes on: trunk/contrib/tcpdump/bgp.h
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/contrib/tcpdump/bootp.h
===================================================================
--- trunk/contrib/tcpdump/bootp.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/bootp.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/bootp.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/bootp.h,v 1.19 2008-04-22 09:46:03 hannes Exp $ (LBL) */
/*
* Bootstrap Protocol (BOOTP). RFC951 and RFC1048.
*
@@ -27,7 +27,8 @@
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 */
+ 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 */
@@ -36,7 +37,7 @@
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 */
-};
+} UNALIGNED;
/*
* UDP port numbers, server and client.
@@ -216,7 +217,7 @@
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 */
-};
+} UNALIGNED;
/* v_flags values */
Modified: trunk/contrib/tcpdump/bpf_dump.c
===================================================================
--- trunk/contrib/tcpdump/bpf_dump.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/bpf_dump.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/bpf_dump.c,v 1.1.1.2 2006-02-25 02:34:01 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/bpf_dump.c,v 1.17 2008-02-14 20:53:49 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -35,7 +35,7 @@
#include "interface.h"
void
-bpf_dump(struct bpf_program *p, int option)
+bpf_dump(const struct bpf_program *p, int option)
{
struct bpf_insn *insn;
int i;
Modified: trunk/contrib/tcpdump/chdlc.h
===================================================================
--- trunk/contrib/tcpdump/chdlc.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/chdlc.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/chdlc.h,v 1.1.1.2 2006-02-25 02:34:01 laffer1 Exp $ (LBL) */
+/* @(#) $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.
Added: trunk/contrib/tcpdump/checksum.c
===================================================================
--- trunk/contrib/tcpdump/checksum.c (rev 0)
+++ trunk/contrib/tcpdump/checksum.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 1998-2006 The TCPDUMP project
+ *
+ * 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.
+ *
+ * miscellaneous checksumming routines
+ *
+ * Original code by Hannes Gredler (hannes at juniper.net)
+ */
+
+#ifndef lint
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/checksum.c,v 1.4 2006-09-25 09:23:32 hannes Exp $";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#include "interface.h"
+
+/*
+ * CRC-10 table generated using the following Python snippet:
+
+import sys
+
+crc_table = []
+for i in range(256):
+ accum = i << 2
+ for j in range(8):
+ accum <<= 1
+ if accum & 0x400:
+ accum ^= 0x633
+ crc_table.append(accum)
+
+for i in range(len(crc_table)/8):
+ for j in range(8):
+ sys.stdout.write("0x%04x, " % crc_table[i*8+j])
+ sys.stdout.write("\n")
+
+ */
+static const u_int16_t crc10_table[256] =
+{
+ 0x0000, 0x0233, 0x0255, 0x0066, 0x0299, 0x00aa, 0x00cc, 0x02ff,
+ 0x0301, 0x0132, 0x0154, 0x0367, 0x0198, 0x03ab, 0x03cd, 0x01fe,
+ 0x0031, 0x0202, 0x0264, 0x0057, 0x02a8, 0x009b, 0x00fd, 0x02ce,
+ 0x0330, 0x0103, 0x0165, 0x0356, 0x01a9, 0x039a, 0x03fc, 0x01cf,
+ 0x0062, 0x0251, 0x0237, 0x0004, 0x02fb, 0x00c8, 0x00ae, 0x029d,
+ 0x0363, 0x0150, 0x0136, 0x0305, 0x01fa, 0x03c9, 0x03af, 0x019c,
+ 0x0053, 0x0260, 0x0206, 0x0035, 0x02ca, 0x00f9, 0x009f, 0x02ac,
+ 0x0352, 0x0161, 0x0107, 0x0334, 0x01cb, 0x03f8, 0x039e, 0x01ad,
+ 0x00c4, 0x02f7, 0x0291, 0x00a2, 0x025d, 0x006e, 0x0008, 0x023b,
+ 0x03c5, 0x01f6, 0x0190, 0x03a3, 0x015c, 0x036f, 0x0309, 0x013a,
+ 0x00f5, 0x02c6, 0x02a0, 0x0093, 0x026c, 0x005f, 0x0039, 0x020a,
+ 0x03f4, 0x01c7, 0x01a1, 0x0392, 0x016d, 0x035e, 0x0338, 0x010b,
+ 0x00a6, 0x0295, 0x02f3, 0x00c0, 0x023f, 0x000c, 0x006a, 0x0259,
+ 0x03a7, 0x0194, 0x01f2, 0x03c1, 0x013e, 0x030d, 0x036b, 0x0158,
+ 0x0097, 0x02a4, 0x02c2, 0x00f1, 0x020e, 0x003d, 0x005b, 0x0268,
+ 0x0396, 0x01a5, 0x01c3, 0x03f0, 0x010f, 0x033c, 0x035a, 0x0169,
+ 0x0188, 0x03bb, 0x03dd, 0x01ee, 0x0311, 0x0122, 0x0144, 0x0377,
+ 0x0289, 0x00ba, 0x00dc, 0x02ef, 0x0010, 0x0223, 0x0245, 0x0076,
+ 0x01b9, 0x038a, 0x03ec, 0x01df, 0x0320, 0x0113, 0x0175, 0x0346,
+ 0x02b8, 0x008b, 0x00ed, 0x02de, 0x0021, 0x0212, 0x0274, 0x0047,
+ 0x01ea, 0x03d9, 0x03bf, 0x018c, 0x0373, 0x0140, 0x0126, 0x0315,
+ 0x02eb, 0x00d8, 0x00be, 0x028d, 0x0072, 0x0241, 0x0227, 0x0014,
+ 0x01db, 0x03e8, 0x038e, 0x01bd, 0x0342, 0x0171, 0x0117, 0x0324,
+ 0x02da, 0x00e9, 0x008f, 0x02bc, 0x0043, 0x0270, 0x0216, 0x0025,
+ 0x014c, 0x037f, 0x0319, 0x012a, 0x03d5, 0x01e6, 0x0180, 0x03b3,
+ 0x024d, 0x007e, 0x0018, 0x022b, 0x00d4, 0x02e7, 0x0281, 0x00b2,
+ 0x017d, 0x034e, 0x0328, 0x011b, 0x03e4, 0x01d7, 0x01b1, 0x0382,
+ 0x027c, 0x004f, 0x0029, 0x021a, 0x00e5, 0x02d6, 0x02b0, 0x0083,
+ 0x012e, 0x031d, 0x037b, 0x0148, 0x03b7, 0x0184, 0x01e2, 0x03d1,
+ 0x022f, 0x001c, 0x007a, 0x0249, 0x00b6, 0x0285, 0x02e3, 0x00d0,
+ 0x011f, 0x032c, 0x034a, 0x0179, 0x0386, 0x01b5, 0x01d3, 0x03e0,
+ 0x021e, 0x002d, 0x004b, 0x0278, 0x0087, 0x02b4, 0x02d2, 0x00e1
+};
+
+static void
+init_crc10_table(void)
+{
+#define CRC10_POLYNOMIAL 0x633
+ register int i, j;
+ register u_int16_t accum;
+ u_int16_t verify_crc10_table[256];
+
+ for ( i = 0; i < 256; i++ )
+ {
+ accum = ((unsigned short) i << 2);
+ for ( j = 0; j < 8; j++ )
+ {
+ if ((accum <<= 1) & 0x400) accum ^= CRC10_POLYNOMIAL;
+ }
+ verify_crc10_table[i] = accum;
+ }
+ assert(memcmp(verify_crc10_table,
+ crc10_table,
+ sizeof(verify_crc10_table)) == 0);
+#undef CRC10_POLYNOMIAL
+}
+
+u_int16_t
+verify_crc10_cksum(u_int16_t accum, const u_char *p, int length)
+{
+ register int i;
+
+ for ( i = 0; i < length; i++ )
+ {
+ accum = ((accum << 8) & 0x3ff)
+ ^ crc10_table[( accum >> 2) & 0xff]
+ ^ *p++;
+ }
+ return accum;
+}
+
+/* precompute checksum tables */
+void
+init_checksum(void) {
+
+ init_crc10_table();
+
+}
+
+/*
+ * Creates the OSI Fletcher checksum. See 8473-1, Appendix C, section C.3.
+ * The checksum field of the passed PDU does not need to be reset to zero.
+ */
+u_int16_t
+create_osi_cksum (const u_int8_t *pptr, int checksum_offset, int length)
+{
+
+ int x;
+ int y;
+ u_int32_t mul;
+ u_int32_t c0;
+ u_int32_t c1;
+ u_int16_t checksum;
+ int index;
+
+ c0 = 0;
+ c1 = 0;
+
+ for (index = 0; index < length; index++) {
+ /*
+ * Ignore the contents of the checksum field.
+ */
+ if (index == checksum_offset ||
+ index == checksum_offset+1) {
+ c1 += c0;
+ pptr++;
+ } else {
+ c0 = c0 + *(pptr++);
+ c1 += c0;
+ }
+ }
+
+ c0 = c0 % 255;
+ c1 = c1 % 255;
+
+ mul = (length - checksum_offset)*(c0);
+
+ x = mul - c0 - c1;
+ y = c1 - mul - 1;
+
+ if ( y >= 0 ) y++;
+ if ( x < 0 ) x--;
+
+ x %= 255;
+ y %= 255;
+
+
+ if (x == 0) x = 255;
+ if (y == 0) y = 255;
+
+ y &= 0x00FF;
+ checksum = ((x << 8) | y);
+
+ return checksum;
+}
Property changes on: trunk/contrib/tcpdump/checksum.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/config.guess
===================================================================
--- trunk/contrib/tcpdump/config.guess 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/config.guess 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,9 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+# Free Software Foundation, Inc.
-timestamp='2003-10-16'
+timestamp='2009-12-30'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -17,7 +18,8 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -24,16 +26,17 @@
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
-# Originally written by Per Bothner <per at bothner.com>.
-# Please send patches to <config-patches at gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+
+# Originally written by Per Bothner. Please send patches (context
+# diff format) to <config-patches at gnu.org> and include a ChangeLog
+# entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -53,8 +56,9 @@
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -66,11 +70,11 @@
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
+ echo "$timestamp" ; exit ;;
--version | -v )
- echo "$version" ; exit 0 ;;
+ echo "$version" ; exit ;;
--help | --h* | -h )
- echo "$usage"; exit 0 ;;
+ echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
@@ -104,7 +108,7 @@
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -123,7 +127,7 @@
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
+esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi at noc.rutgers.edu 1994-08-24)
@@ -158,6 +162,7 @@
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
@@ -166,7 +171,7 @@
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
+ | grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
@@ -196,53 +201,32 @@
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvmeppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pegasos:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mipseb-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
alpha:OSF1:*:*)
- if test $UNAME_RELEASE = "V4.0"; then
+ case $UNAME_RELEASE in
+ *4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- fi
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
@@ -280,45 +264,49 @@
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
+ # A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit 0 ;;
- Alpha*:OpenVMS:*:*)
- echo alpha-hp-vms
- exit 0 ;;
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
- exit 0 ;;
+ exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
- exit 0 ;;
+ exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
- exit 0;;
+ exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
+ exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
- exit 0 ;;
+ exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
- exit 0 ;;
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
- exit 0 ;;
+ exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
+ exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -326,32 +314,51 @@
else
echo pyramid-pyramid-bsd
fi
- exit 0 ;;
+ exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
- exit 0 ;;
+ exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
- exit 0 ;;
- DRS?6000:UNIX_SV:4.2*:7*)
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7 && exit 0 ;;
+ sparc) echo sparc-icl-nx7; exit ;;
esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
@@ -360,10 +367,10 @@
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
+ exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
@@ -375,10 +382,10 @@
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
- exit 0 ;;
+ exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -389,37 +396,40 @@
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
- exit 0 ;;
+ exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -443,32 +453,33 @@
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c \
- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && exit 0
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
- exit 0 ;;
+ exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
- exit 0 ;;
+ exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
- exit 0 ;;
+ exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
- exit 0 ;;
+ exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
- exit 0 ;;
+ exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
- exit 0 ;;
+ exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
- exit 0 ;;
+ exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -484,29 +495,29 @@
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit 0 ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
- exit 0 ;;
+ exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
- exit 0 ;;
+ exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
- exit 0 ;;
+ exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
- exit 0 ;;
+ exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
+ exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
- exit 0 ;;
+ exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
@@ -514,7 +525,7 @@
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit 0 ;;
+ exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
@@ -529,15 +540,19 @@
exit(0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo rs6000-ibm-aix3.2.5
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
- exit 0 ;;
- *:AIX:*:[45])
+ exit ;;
+ *:AIX:*:[456])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@@ -550,28 +565,28 @@
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
+ exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
- exit 0 ;;
+ exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
- exit 0 ;;
+ exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
+ exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
- exit 0 ;;
+ exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
- exit 0 ;;
+ exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
- exit 0 ;;
+ exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
- exit 0 ;;
+ exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
@@ -633,9 +648,19 @@
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
- # avoid double evaluation of $set_cc_for_build
- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
then
HP_ARCH="hppa2.0w"
else
@@ -643,11 +668,11 @@
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
+ exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
- exit 0 ;;
+ exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -675,24 +700,25 @@
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
- exit 0 ;;
+ exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
- exit 0 ;;
+ exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
- exit 0 ;;
+ exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
- exit 0 ;;
+ exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
- exit 0 ;;
+ exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
- exit 0 ;;
+ exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
@@ -699,197 +725,223 @@
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
- exit 0 ;;
+ exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
- exit 0 ;;
+ exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit 0 ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit 0 ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit 0 ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit 0 ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit 0 ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
*:UNICOS/mp:*:*)
- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
+ exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
+ exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:FreeBSD:*:*)
- # Determine whether the default compiler uses glibc.
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #if __GLIBC__ >= 2
- LIBC=gnu
- #else
- LIBC=
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
- # FreeBSD's kernel, but not the complete OS.
- case ${LIBC} in gnu) kernel_only='k' ;; esac
- echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
- exit 0 ;;
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
- i*:MINGW*:*)
+ exit ;;
+ *:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
- exit 0 ;;
- x86:Interix*:[34]*)
- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
- exit 0 ;;
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
- exit 0 ;;
+ exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
- exit 0 ;;
+ exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
- exit 0 ;;
+ exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
+ exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit 0 ;;
+ exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
- exit 0 ;;
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
- exit 0 ;;
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
- mips:Linux:*:*)
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
- #undef mips
- #undef mipsel
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
+ CPU=${UNAME_MACHINE}el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
+ CPU=${UNAME_MACHINE}
#else
CPU=
#endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
- ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit 0 ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit 0 ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit 0 ;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -897,87 +949,40 @@
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
- exit 0 ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
- exit 0 ;;
+ exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
- exit 0 ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0 ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit 0 ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #ifdef __INTEL_COMPILER
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
- ;;
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
- exit 0 ;;
+ exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
@@ -985,24 +990,27 @@
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
+ exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
+ exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
+ exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
+ exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -1010,8 +1018,9 @@
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
- exit 0 ;;
- i*86:*:5:[78]*)
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
@@ -1018,7 +1027,7 @@
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit 0 ;;
+ exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -1036,19 +1045,22 @@
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
- exit 0 ;;
+ exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit 0 ;;
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configury will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
- exit 0 ;;
+ exit ;;
paragon:*:*:*)
echo i860-intel-osf1
- exit 0 ;;
+ exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
@@ -1055,54 +1067,64 @@
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
- exit 0 ;;
+ exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
- exit 0 ;;
+ exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
- exit 0 ;;
+ exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
- exit 0 ;;
- M68*:*:R3V[567]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
- exit 0 ;;
+ exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
- exit 0 ;;
+ exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
- exit 0 ;;
+ exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1110,30 +1132,34 @@
else
echo ns32k-sni-sysv
fi
- exit 0 ;;
+ exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel at ccMail.Census.GOV>
echo i586-unisys-sysv4
- exit 0 ;;
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes at openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
- exit 0 ;;
+ exit ;;
*:*:*:FTX*)
# From seanf at swdc.stratus.com.
echo i860-stratus-sysv4
- exit 0 ;;
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green at stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
*:VOS:*:*)
# From Paul.Green at stratus.com.
echo hppa1.1-stratus-vos
- exit 0 ;;
+ exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
- exit 0 ;;
+ exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
@@ -1140,38 +1166,60 @@
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
- exit 0 ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
- exit 0 ;;
+ exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
- exit 0 ;;
+ exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
- exit 0 ;;
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Darwin:*:*)
- case `uname -p` in
- *86) UNAME_PROCESSOR=i686 ;;
- powerpc) UNAME_PROCESSOR=powerpc ;;
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1179,22 +1227,25 @@
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
- exit 0 ;;
- NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*)
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
- exit 0 ;;
+ exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
- exit 0 ;;
+ exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
@@ -1205,31 +1256,50 @@
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
- exit 0 ;;
+ exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
- exit 0 ;;
+ exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
- exit 0 ;;
+ exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
- exit 0 ;;
+ exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
- exit 0 ;;
+ exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
- exit 0 ;;
+ exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
- exit 0 ;;
+ exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
- exit 0 ;;
- *:DRAGONFLY:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1261,7 +1331,7 @@
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
+ printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
@@ -1350,11 +1420,12 @@
}
EOF
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
@@ -1363,22 +1434,22 @@
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
- exit 0 ;;
+ exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit 0 ;;
+ exit ;;
c34*)
echo c34-convex-bsd
- exit 0 ;;
+ exit ;;
c38*)
echo c38-convex-bsd
- exit 0 ;;
+ exit ;;
c4*)
echo c4-convex-bsd
- exit 0 ;;
+ exit ;;
esac
fi
@@ -1389,7 +1460,9 @@
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
- ftp://ftp.gnu.org/pub/gnu/config/
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
Property changes on: trunk/contrib/tcpdump/config.guess
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/contrib/tcpdump/config.h.in
===================================================================
--- trunk/contrib/tcpdump/config.h.in 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/config.h.in 2016-09-17 22:44:52 UTC (rev 8321)
@@ -2,9 +2,6 @@
/* "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
@@ -11,23 +8,6 @@
/* 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
@@ -37,24 +17,6 @@
/* 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
@@ -91,21 +53,6 @@
/* 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
@@ -115,14 +62,6 @@
/* 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
@@ -151,8 +90,8 @@
/* 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 `fork' function. */
+#undef HAVE_FORK
/* Define to 1 if you have the `getnameinfo' function. */
#undef HAVE_GETNAMEINFO
@@ -187,9 +126,18 @@
/* Define to 1 if you have the <openssl/evp.h> header file. */
#undef HAVE_OPENSSL_EVP_H
+/* if there's an os_proto.h for this platform, to use additional prototypes */
+#undef HAVE_OS_PROTO_H
+
+/* Define to 1 if you have the <pcap/bluetooth.h> header file. */
+#undef HAVE_PCAP_BLUETOOTH_H
+
/* Define to 1 if you have the `pcap_breakloop' function. */
#undef HAVE_PCAP_BREAKLOOP
+/* Define to 1 if you have the `pcap_create' function. */
+#undef HAVE_PCAP_CREATE
+
/* Define to 1 if you have the `pcap_dump_flush' function. */
#undef HAVE_PCAP_DUMP_FLUSH
@@ -202,6 +150,12 @@
/* Define to 1 if you have the `pcap_lib_version' function. */
#undef HAVE_PCAP_LIB_VERSION
+/* Define to 1 if you have the `pcap_set_tstamp_type' function. */
+#undef HAVE_PCAP_SET_TSTAMP_TYPE
+
+/* Define to 1 if you have the <pcap/usb.h> header file. */
+#undef HAVE_PCAP_USB_H
+
/* Define to 1 if you have the `pfopen' function. */
#undef HAVE_PFOPEN
@@ -208,6 +162,9 @@
/* Define to 1 if you have the <rpc/rpcent.h> header file. */
#undef HAVE_RPC_RPCENT_H
+/* Define to 1 if you have the <rpc/rpc.h> header file. */
+#undef HAVE_RPC_RPC_H
+
/* Define to 1 if you have the `setlinebuf' function. */
#undef HAVE_SETLINEBUF
@@ -223,6 +180,9 @@
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
+/* if struct sockaddr has the sa_len member */
+#undef HAVE_SOCKADDR_SA_LEN
+
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -268,6 +228,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the `vfork' function. */
+#undef HAVE_VFORK
+
/* Define to 1 if you have the `vfprintf' function. */
#undef HAVE_VFPRINTF
@@ -277,6 +240,9 @@
/* define if your compiler has __attribute__ */
#undef HAVE___ATTRIBUTE__
+/* if unaligned access fails */
+#undef LBL_ALIGN
+
/* Define to 1 if netinet/ether.h declares `ether_ntohost' */
#undef NETINET_ETHER_H_DECLARES_ETHER_NTOHOST
@@ -301,21 +267,9 @@
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
-/* The size of `char', as computed by sizeof. */
-#undef SIZEOF_CHAR
+/* return value of signal handlers */
+#undef RETSIGVAL
-/* The size of `int', as computed by sizeof. */
-#undef SIZEOF_INT
-
-/* The size of `long', as computed by sizeof. */
-#undef SIZEOF_LONG
-
-/* The size of `long long', as computed by sizeof. */
-#undef SIZEOF_LONG_LONG
-
-/* The size of `short', as computed by sizeof. */
-#undef SIZEOF_SHORT
-
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
@@ -322,6 +276,22 @@
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
+/* get BSD semantics on Irix */
+#undef _BSD_SIGNALS
+
+/* needed on HP-UX */
+#undef _HPUX_SOURCE
+
+/* define on AIX to get certain functions */
+#undef _SUN
+
+/* define if your compiler allows __attribute__((format)) to be applied to
+ function pointers */
+#undef __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS
+
+/* to handle Ultrix compilers that don't support const in prototypes */
+#undef const
+
/* Define as token for inline if inlining supported */
#undef inline
Modified: trunk/contrib/tcpdump/config.sub
===================================================================
--- trunk/contrib/tcpdump/config.sub 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/config.sub 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,9 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+# Free Software Foundation, Inc.
-timestamp='2003-11-03'
+timestamp='2009-12-31'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -21,16 +22,17 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
+
# Please send patches to <config-patches at gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
+# diff and a properly formatted GNU ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -37,6 +39,9 @@
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
@@ -70,8 +75,9 @@
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -83,11 +89,11 @@
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
+ echo "$timestamp" ; exit ;;
--version | -v )
- echo "$version" ; exit 0 ;;
+ echo "$version" ; exit ;;
--help | --h* | -h )
- echo "$usage"; exit 0 ;;
+ echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
@@ -99,7 +105,7 @@
*local*)
# First pass through any local machine types.
echo $1
- exit 0;;
+ exit ;;
* )
break ;;
@@ -118,8 +124,10 @@
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
- kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -145,10 +153,13 @@
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis)
+ -apple | -axis | -knuth | -cray | -microblaze)
os=
basic_machine=$1
;;
+ -bluegene*)
+ os=-cnk
+ ;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
@@ -170,6 +181,10 @@
-hiux*)
os=-hiuxwe2
;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -186,6 +201,10 @@
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -230,22 +249,28 @@
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
- | fr30 | frv \
+ | fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
- | m32r | m68000 | m68k | m88k | mcore \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
| mips64vr | mips64vrel \
- | mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
@@ -254,24 +279,31 @@
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
+ | moxie \
+ | mt \
| msp430 \
+ | nios | nios2 \
| ns16k | ns32k \
- | openrisc | or32 \
+ | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
- | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
- | strongarm \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
+ | ubicom32 \
| v850 | v850e \
| we32k \
- | x86 | xscale | xstormy16 | xtensa \
- | z8k)
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k | z80)
basic_machine=$basic_machine-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12)
+ m6811 | m68hc11 | m6812 | m68hc12 | picochip)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
@@ -278,6 +310,9 @@
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
@@ -297,28 +332,32 @@
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* \
- | bs2000-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | cydra-* \
+ | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
- | m32r-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | mcore-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
| mips64vr-* | mips64vrel-* \
- | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
@@ -326,27 +365,36 @@
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
| msp430-* \
- | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
- | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
| tron-* \
+ | ubicom32-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
- | xtensa-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa*-* \
| ymp-* \
- | z8k-*)
+ | z8k-* | z80-*)
;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
@@ -363,6 +411,9 @@
basic_machine=a29k-amd
os=-udi
;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
@@ -380,6 +431,9 @@
amd64)
basic_machine=x86_64-pc
;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
amdahl)
basic_machine=580-amdahl
os=-sysv
@@ -403,6 +457,10 @@
basic_machine=m68k-apollo
os=-bsd
;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -411,10 +469,26 @@
basic_machine=ns32k-sequent
os=-dynix
;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
c90)
basic_machine=c90-cray
os=-unicos
;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
convex-c1)
basic_machine=c1-convex
os=-bsd
@@ -439,12 +513,27 @@
basic_machine=j90-cray
os=-unicos
;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
crds | unos)
basic_machine=m68k-crds
;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
da30 | da30-*)
basic_machine=m68k-da30
;;
@@ -467,6 +556,14 @@
basic_machine=m88k-motorola
os=-sysv3
;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
@@ -617,6 +714,14 @@
basic_machine=m68k-isi
os=-sysv
;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
m88k-omron*)
basic_machine=m88k-omron
;;
@@ -628,10 +733,17 @@
basic_machine=ns32k-utek
os=-sysv
;;
+ microblaze)
+ basic_machine=microblaze-xilinx
+ ;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
miniframe)
basic_machine=m68000-convergent
;;
@@ -645,10 +757,6 @@
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
- mmix*)
- basic_machine=mmix-knuth
- os=-mmixware
- ;;
monitor)
basic_machine=m68k-rom68k
os=-coff
@@ -661,6 +769,9 @@
basic_machine=i386-pc
os=-msdos
;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
mvs)
basic_machine=i370-ibm
os=-mvs
@@ -729,10 +840,6 @@
np1)
basic_machine=np1-gould
;;
- nv1)
- basic_machine=nv1-cray
- os=-unicosmp
- ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -740,9 +847,8 @@
basic_machine=hppa1.1-oki
os=-proelf
;;
- or32 | or32-*)
+ openrisc | openrisc-*)
basic_machine=or32-unknown
- os=-coff
;;
os400)
basic_machine=powerpc-ibm
@@ -764,6 +870,14 @@
basic_machine=i860-intel
os=-osf
;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
pbd)
basic_machine=sparc-tti
;;
@@ -773,6 +887,12 @@
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
@@ -829,6 +949,10 @@
basic_machine=i586-unknown
os=-pw32
;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
@@ -855,6 +979,10 @@
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
sei)
basic_machine=mips-sei
os=-seiux
@@ -866,6 +994,9 @@
basic_machine=sh-hitachi
os=-hms
;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
sh64)
basic_machine=sh64-unknown
;;
@@ -955,6 +1086,10 @@
basic_machine=tic6x-unknown
os=-coff
;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
tx39)
basic_machine=mipstx39-unknown
;;
@@ -1015,6 +1150,10 @@
basic_machine=hppa1.1-winbond
os=-proelf
;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
xps | xps100)
basic_machine=xps100-honeywell
;;
@@ -1026,6 +1165,10 @@
basic_machine=z8k-unknown
os=-sim
;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
none)
basic_machine=none-none
os=-none
@@ -1045,6 +1188,9 @@
romp)
basic_machine=romp-ibm
;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
rs6000)
basic_machine=rs6000-ibm
;;
@@ -1061,13 +1207,10 @@
we32k)
basic_machine=we32k-att
;;
- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparc | sparcv9 | sparcv9b)
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra)
@@ -1114,6 +1257,9 @@
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
@@ -1134,25 +1280,30 @@
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
+ | -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1170,7 +1321,7 @@
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
@@ -1215,6 +1366,9 @@
-atheos*)
os=-atheos
;;
+ -syllable*)
+ os=-syllable
+ ;;
-386bsd)
os=-bsd
;;
@@ -1276,6 +1430,14 @@
-kaos*)
os=-kaos
;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
-none)
;;
*)
@@ -1298,6 +1460,12 @@
# system, and we'll never get to this point.
case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
*-acorn)
os=-riscix1.2
;;
@@ -1307,9 +1475,9 @@
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
@@ -1335,6 +1503,9 @@
m68*-cisco)
os=-aout
;;
+ mep-*)
+ os=-elf
+ ;;
mips*-cisco)
os=-elf
;;
@@ -1353,9 +1524,15 @@
*-be)
os=-beos
;;
+ *-haiku)
+ os=-haiku
+ ;;
*-ibm)
os=-aix
;;
+ *-knuth)
+ os=-mmixware
+ ;;
*-wec)
os=-proelf
;;
@@ -1458,7 +1635,7 @@
-sunos*)
vendor=sun
;;
- -aix*)
+ -cnk*|-aix*)
vendor=ibm
;;
-beos*)
@@ -1521,7 +1698,7 @@
esac
echo $basic_machine$os
-exit 0
+exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
Property changes on: trunk/contrib/tcpdump/config.sub
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/contrib/tcpdump/configure
===================================================================
--- trunk/contrib/tcpdump/configure 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/configure 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,61 +1,84 @@
#! /bin/sh
-# From configure.in Revision: 1.188.2.8 .
+# From configure.in Revision: 1.204 .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61.
+# Generated by GNU Autoconf 2.68.
#
+#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
esac
-
fi
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
else
- PATH_SEPARATOR=:
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
fi
- rm -f conf$$.sh
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
fi
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
fi
@@ -64,12 +87,11 @@
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
-as_nl='
-'
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
+as_myself=
+case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -76,8 +98,8 @@
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
IFS=$as_save_IFS
;;
@@ -88,13 +110,17 @@
as_myself=$0
fi
if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
fi
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
@@ -101,341 +127,311 @@
PS4='+ '
# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- fi
-done
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
-# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-
-# Name of the executable.
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
# CDPATH.
-$as_unset CDPATH
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
if test "x$CONFIG_SHELL" = x; then
- if (eval ":") 2>/dev/null; then
- as_have_required=yes
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
else
- as_have_required=no
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
- if test $as_have_required = yes && (eval ":
-(as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
else
- exitcode=1
- echo as_func_ret_success failed.
+ exitcode=1; echo positional parameters were not saved.
fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
+test x\$exitcode = x0 || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
else
- exitcode=1
- echo positional parameters were not saved.
+ as_have_required=no
fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-test \$exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=\$LINENO
- as_lineno_2=\$LINENO
- test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
- test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
- :
else
- as_candidate_shells=
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- case $as_dir in
+ as_found=:
+ case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
- as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
done;;
esac
+ as_found=false
done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
IFS=$as_save_IFS
- for as_shell in $as_candidate_shells $SHELL; do
- # Try only shells that exist, to save several forks.
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
+ if test "x$CONFIG_SHELL" != x; then :
+ # We cannot yet assume a decent shell, so we have to provide a
+ # neutralization value for shells without unset; and this also
+ # works around shells that cannot unset nonexistent variables.
+ # Preserve -v and -x to the replacement shell.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+ esac
+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
fi
-
-:
-_ASEOF
-}; then
- CONFIG_SHELL=$as_shell
- as_have_required=yes
- if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf at gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
fi
-
-
-:
-(as_func_return () {
- (exit $1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
-if ( set x; as_func_ret_success y && test x = "$1" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
-test $exitcode = 0) || { (exit 1); exit 1; }
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
-(
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-_ASEOF
-}; then
- break
-fi
-fi
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
- done
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
- if test "x$CONFIG_SHELL" != x; then
- for as_var in BASH_ENV ENV
- do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- done
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
- if test $as_have_required = no; then
- echo This script requires a shell more modern than all the
- echo shells that I found on your system. Please install a
- echo modern shell, or manually run the script under such a
- echo shell if you do have one.
- { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
else
- exitcode=1
- echo as_func_success failed.
+ as_expr=false
fi
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
else
- exitcode=1
- echo as_func_ret_success failed.
+ as_basename=false
fi
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
else
- exitcode=1
- echo positional parameters were not saved.
+ as_dirname=false
fi
-test \$exitcode = 0") || {
- echo No shell found that supports shell functions.
- echo Please tell autoconf at gnu.org about your system,
- echo including any error possibly output before this
- echo message
-}
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
@@ -452,8 +448,7 @@
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
@@ -463,49 +458,40 @@
exit
}
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
+case `echo -n x` in #(((((
-n*)
- case `echo 'x\c'` in
+ case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
- mkdir conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+ fi
else
as_ln_s='cp -p'
fi
@@ -513,7 +499,7 @@
rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
+ as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
@@ -530,12 +516,12 @@
as_test_x='
eval sh -c '\''
if test -d "$1"; then
- test -d "$1/.";
+ test -d "$1/.";
else
- case $1 in
- -*)set "./$1";;
+ case $1 in #(
+ -*)set "./$1";;
esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
@@ -549,11 +535,11 @@
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
-exec 7<&0 </dev/null 6>&1
-
# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
@@ -568,7 +554,6 @@
subdirs=
MFLAGS=
MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME=
@@ -576,6 +561,7 @@
PACKAGE_VERSION=
PACKAGE_STRING=
PACKAGE_BUGREPORT=
+PACKAGE_URL=
ac_unique_file="tcpdump.c"
# Factoring default headers for most tests.
@@ -614,74 +600,90 @@
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL
+ac_subst_vars='LTLIBOBJS
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+MAN_MISC_INFO
+MAN_FILE_FORMATS
+LOCALSRC
+V_PCAPDEP
+V_INCLS
+V_GROUP
+V_DEFS
+V_CCOPT
+RANLIB
+PCAP_CONFIG
+LIBOBJS
+EGREP
+GREP
+CPP
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+SHLICC2
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
-SHLICC2
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-CPP
-GREP
-EGREP
-LIBOBJS
-V_CCOPT
-V_DEFS
-V_GROUP
-V_INCLS
-V_PCAPDEP
-LOCALSRC
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-LTLIBOBJS'
+SHELL'
ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+with_gcc
+enable_universal
+with_smi
+enable_smb
+with_user
+with_chroot
+enable_ipv6
+with_crypto
+'
ac_precious_vars='build_alias
host_alias
target_alias
@@ -696,6 +698,8 @@
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
@@ -751,8 +755,9 @@
fi
case $ac_option in
- *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *) ac_optarg=yes ;;
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
@@ -794,13 +799,20 @@
datarootdir=$ac_optarg ;;
-disable-* | --disable-*)
- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=no ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
@@ -813,13 +825,20 @@
dvidir=$ac_optarg ;;
-enable-* | --enable-*)
- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid feature name: $ac_feature" >&2
- { (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
- eval enable_$ac_feature=\$ac_optarg ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -1010,22 +1029,36 @@
ac_init_version=: ;;
-with-* | --with-*)
- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=\$ac_optarg ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
-without-* | --without-*)
- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid package name: $ac_package" >&2
- { (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
- eval with_$ac_package=no ;;
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
--x)
# Obsolete; use --with-x.
@@ -1045,26 +1078,26 @@
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
- -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; }
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
- { (exit 1); exit 1; }; }
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
- echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
esac
@@ -1072,11 +1105,18 @@
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- { echo "$as_me: error: missing argument to $ac_option" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error $? "missing argument to $ac_option"
fi
-# Be sure to have absolute directory names.
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
@@ -1083,12 +1123,18 @@
libdir localedir mandir
do
eval ac_val=\$$ac_var
+ # Remove trailing slashes.
case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
@@ -1102,8 +1148,8 @@
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used." >&2
+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1118,11 +1164,9 @@
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- { echo "$as_me: error: Working directory cannot be determined" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- { echo "$as_me: error: pwd does not report name of working directory" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error $? "pwd does not report name of working directory"
# Find the source files, if location was not specified.
@@ -1129,12 +1173,12 @@
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -1161,13 +1205,11 @@
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
- { (exit 1); exit 1; }; }
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
- { (exit 1); exit 1; }; }
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1207,7 +1249,7 @@
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking...' messages
+ -q, --quiet, --silent do not print \`checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
@@ -1215,9 +1257,9 @@
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
+ [$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
+ [PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
@@ -1227,25 +1269,25 @@
For better control, use the options below.
Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
@@ -1261,8 +1303,10 @@
cat <<\_ACEOF
Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-universal don't build universal on OS X
--enable-smb enable possibly-buggy SMB printer default=yes
--disable-smb disable possibly-buggy SMB printer
--enable-ipv6 enable ipv6 (with ipv4) support
@@ -1272,9 +1316,11 @@
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--without-gcc don't use gcc
+ --with-smi link with libsmi (allows to load MIBs on the fly to decode SNMP packets. default=yes
+ --without-smi don't link with libsmi
--with-user=USERNAME drop privileges by default to USERNAME
--with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY
- --without-crypto disable crypto support
+ --with-crypto use OpenSSL libcrypto [default=yes, if available]
Some influential environment variables:
CC C compiler command
@@ -1282,7 +1328,7 @@
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
@@ -1289,6 +1335,7 @@
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
+Report bugs to the package provider.
_ACEOF
ac_status=$?
fi
@@ -1296,15 +1343,17 @@
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" || continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -1340,7 +1389,7 @@
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
@@ -1350,21 +1399,472 @@
if $ac_init_version; then
cat <<\_ACEOF
configure
-generated by GNU Autoconf 2.61
+generated by GNU Autoconf 2.68
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit
fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.61. Invocation command line was
+generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -1400,8 +1900,8 @@
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- echo "PATH: $as_dir"
-done
+ $as_echo "PATH: $as_dir"
+ done
IFS=$as_save_IFS
} >&5
@@ -1435,12 +1935,12 @@
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2)
- ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ as_fn_append ac_configure_args1 " '$ac_arg'"
if test $ac_must_keep_next = true; then
ac_must_keep_next=false # Got value, back to normal.
else
@@ -1456,13 +1956,13 @@
-* ) ac_must_keep_next=true ;;
esac
fi
- ac_configure_args="$ac_configure_args '$ac_arg'"
+ as_fn_append ac_configure_args " '$ac_arg'"
;;
esac
done
done
-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
@@ -1474,11 +1974,9 @@
{
echo
- cat <<\_ASBOX
-## ---------------- ##
+ $as_echo "## ---------------- ##
## Cache variables. ##
-## ---------------- ##
-_ASBOX
+## ---------------- ##"
echo
# The following way of writing the cache mishandles newlines in values,
(
@@ -1487,12 +1985,13 @@
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
@@ -1511,53 +2010,47 @@
)
echo
- cat <<\_ASBOX
-## ----------------- ##
+ $as_echo "## ----------------- ##
## Output variables. ##
-## ----------------- ##
-_ASBOX
+## ----------------- ##"
echo
for ac_var in $ac_subst_vars
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- echo "$ac_var='\''$ac_val'\''"
+ $as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
- cat <<\_ASBOX
-## ------------------- ##
+ $as_echo "## ------------------- ##
## File substitutions. ##
-## ------------------- ##
-_ASBOX
+## ------------------- ##"
echo
for ac_var in $ac_subst_files
do
eval ac_val=\$$ac_var
case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
- echo "$ac_var='\''$ac_val'\''"
+ $as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
- cat <<\_ASBOX
-## ----------- ##
+ $as_echo "## ----------- ##
## confdefs.h. ##
-## ----------- ##
-_ASBOX
+## ----------- ##"
echo
cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
- echo "$as_me: caught signal $ac_signal"
- echo "$as_me: exit $exit_status"
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
@@ -1564,7 +2057,7 @@
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
done
ac_signal=0
@@ -1571,6 +2064,8 @@
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
+$as_echo "/* confdefs.h */" > confdefs.h
+
# Predefined preprocessor variables.
cat >>confdefs.h <<_ACEOF
@@ -1577,54 +2072,66 @@
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF
-
cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF
-
cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF
-
cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF
-
cat >>confdefs.h <<_ACEOF
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
- set x "$CONFIG_SITE"
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
elif test "x$prefix" != xNONE; then
- set x "$prefix/share/config.site" "$prefix/etc/config.site"
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
else
- set x "$ac_default_prefix/share/config.site" \
- "$ac_default_prefix/etc/config.site"
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
fi
-shift
-for ac_site_file
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
- if test -r "$ac_site_file"; then
- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file"
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
fi
done
if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
- { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
@@ -1631,8 +2138,8 @@
esac
fi
else
- { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
@@ -1646,61 +2153,57 @@
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
-echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
-echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
- { (exit 1); exit 1; }; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -1726,9 +2229,7 @@
fi
done
if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
@@ -1742,35 +2243,27 @@
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-{ echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
-if test "${ac_cv_build+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
test "x$ac_build_alias" = x &&
- { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-echo "$as_me: error: invalid value of canonical build" >&2;}
- { (exit 1); exit 1; }; };;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
@@ -1786,28 +2279,24 @@
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-{ echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
-if test "${ac_cv_host+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
else
if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-echo "$as_me: error: invalid value of canonical host" >&2;}
- { (exit 1); exit 1; }; };;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
@@ -1829,8 +2318,9 @@
+
# Check whether --with-gcc was given.
-if test "${with_gcc+set}" = set; then
+if test "${with_gcc+set}" = set; then :
withval=$with_gcc;
fi
@@ -1837,7 +2327,7 @@
V_CCOPT="-O"
V_INCLS=""
if test "${srcdir}" != "." ; then
- V_INCLS="-I\$(srcdir)"
+ V_INCLS="-I$srcdir"
fi
if test "${CFLAGS+set}" = set; then
LBL_CFLAGS="$CFLAGS"
@@ -1848,10 +2338,10 @@
bsdi*)
# Extract the first word of "shlicc2", so it can be a program name with args.
set dummy shlicc2; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_SHLICC2+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_SHLICC2+:} false; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$SHLICC2"; then
ac_cv_prog_SHLICC2="$SHLICC2" # Let the user override the test.
@@ -1861,14 +2351,14 @@
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_SHLICC2="yes"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
test -z "$ac_cv_prog_SHLICC2" && ac_cv_prog_SHLICC2="no"
@@ -1876,11 +2366,11 @@
fi
SHLICC2=$ac_cv_prog_SHLICC2
if test -n "$SHLICC2"; then
- { echo "$as_me:$LINENO: result: $SHLICC2" >&5
-echo "${ECHO_T}$SHLICC2" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHLICC2" >&5
+$as_echo "$SHLICC2" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -1895,7 +2385,8 @@
CC=cc
export CC
fi
- ac_ext=c
+
+ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -1903,10 +2394,10 @@
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1916,14 +2407,14 @@
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
@@ -1930,11 +2421,11 @@
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -1943,10 +2434,10 @@
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -1956,14 +2447,14 @@
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="gcc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
@@ -1970,11 +2461,11 @@
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
@@ -1982,12 +2473,8 @@
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
@@ -2000,10 +2487,10 @@
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2013,14 +2500,14 @@
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
@@ -2027,11 +2514,11 @@
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2040,10 +2527,10 @@
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2054,7 +2541,7 @@
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
@@ -2061,11 +2548,11 @@
continue
fi
ac_cv_prog_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
if test $ac_prog_rejected = yes; then
@@ -2084,11 +2571,11 @@
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2099,10 +2586,10 @@
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2112,14 +2599,14 @@
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
@@ -2126,11 +2613,11 @@
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2143,10 +2630,10 @@
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2156,14 +2643,14 @@
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="$ac_prog"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
-done
+ done
IFS=$as_save_IFS
fi
@@ -2170,11 +2657,11 @@
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
@@ -2186,12 +2673,8 @@
else
case $cross_compiling:$ac_tool_warned in
yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
@@ -2201,51 +2684,37 @@
fi
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -2257,42 +2726,38 @@
}
_ACEOF
ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
ac_rmfiles=
for ac_file in $ac_files
do
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
* ) ac_rmfiles="$ac_rmfiles $ac_file";;
esac
done
rm -f $ac_rmfiles
-if { (ac_try="$ac_link_default"
+if { { ac_try="$ac_link_default"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
@@ -2302,7 +2767,7 @@
do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
;;
[ab].out )
# We found the default executable, but exeext='' is most
@@ -2309,7 +2774,7 @@
# certainly right.
break;;
*.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
@@ -2328,78 +2793,41 @@
else
ac_file=''
fi
-
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
-if test -z "$ac_file"; then
- echo "$as_me: failed program was:" >&5
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
-See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
fi
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
- fi
- fi
-fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
-
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-if { (ac_try="$ac_link"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -2407,7 +2835,7 @@
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
break;;
* ) break;;
@@ -2414,30 +2842,83 @@
esac
done
else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
-rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
-
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
-if test "${ac_cv_objext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -2449,51 +2930,46 @@
}
_ACEOF
rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
+if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else
- echo "$as_me: failed program was:" >&5
+ $as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
fi
-
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -2507,54 +2983,34 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_compiler_gnu=no
+ ac_compiler_gnu=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -2565,34 +3021,11 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -2603,35 +3036,12 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
+if ac_fn_c_try_compile "$LINENO"; then :
+
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_c_werror_flag=$ac_save_c_werror_flag
+ ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -2642,42 +3052,18 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
@@ -2693,18 +3079,14 @@
CFLAGS=
fi
fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
@@ -2761,31 +3143,9 @@
-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_c89=$ac_arg
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
rm -f core conftest.err conftest.$ac_objext
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
@@ -2796,17 +3156,19 @@
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
x)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -2814,15 +3176,19 @@
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
if test "$GCC" = yes ; then
if test "$SHLICC2" = yes ; then
ac_cv_lbl_gcc_vers=2
V_CCOPT="-O2"
else
- { echo "$as_me:$LINENO: checking gcc version" >&5
-echo $ECHO_N "checking gcc version... $ECHO_C" >&6; }
- if test "${ac_cv_lbl_gcc_vers+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking gcc version" >&5
+$as_echo_n "checking gcc version... " >&6; }
+ if ${ac_cv_lbl_gcc_vers+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_cv_lbl_gcc_vers=`$CC -v 2>&1 | \
sed -e '/^gcc version /!d' \
@@ -2831,24 +3197,20 @@
-e 's/\..*//'`
fi
- { echo "$as_me:$LINENO: result: $ac_cv_lbl_gcc_vers" >&5
-echo "${ECHO_T}$ac_cv_lbl_gcc_vers" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_gcc_vers" >&5
+$as_echo "$ac_cv_lbl_gcc_vers" >&6; }
if test $ac_cv_lbl_gcc_vers -gt 1 ; then
V_CCOPT="-O2"
fi
fi
else
- { echo "$as_me:$LINENO: checking that $CC handles ansi prototypes" >&5
-echo $ECHO_N "checking that $CC handles ansi prototypes... $ECHO_C" >&6; }
- if test "${ac_cv_lbl_cc_ansi_prototypes+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking that $CC handles ansi prototypes" >&5
+$as_echo_n "checking that $CC handles ansi prototypes... " >&6; }
+ if ${ac_cv_lbl_cc_ansi_prototypes+:} false; then :
+ $as_echo_n "(cached) " >&6
else
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
int
@@ -2859,52 +3221,28 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_lbl_cc_ansi_prototypes=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lbl_cc_ansi_prototypes=no
+ ac_cv_lbl_cc_ansi_prototypes=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
- { echo "$as_me:$LINENO: result: $ac_cv_lbl_cc_ansi_prototypes" >&5
-echo "${ECHO_T}$ac_cv_lbl_cc_ansi_prototypes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_cc_ansi_prototypes" >&5
+$as_echo "$ac_cv_lbl_cc_ansi_prototypes" >&6; }
if test $ac_cv_lbl_cc_ansi_prototypes = no ; then
case "$host_os" in
hpux*)
- { echo "$as_me:$LINENO: checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)" >&5
-echo $ECHO_N "checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)... $ECHO_C" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)" >&5
+$as_echo_n "checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)... " >&6; }
savedcflags="$CFLAGS"
CFLAGS="-Aa -D_HPUX_SOURCE $CFLAGS"
- if test "${ac_cv_lbl_cc_hpux_cc_aa+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if ${ac_cv_lbl_cc_hpux_cc_aa+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
int
@@ -2915,53 +3253,64 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_lbl_cc_hpux_cc_aa=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lbl_cc_hpux_cc_aa=no
+ ac_cv_lbl_cc_hpux_cc_aa=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
- { echo "$as_me:$LINENO: result: $ac_cv_lbl_cc_hpux_cc_aa" >&5
-echo "${ECHO_T}$ac_cv_lbl_cc_hpux_cc_aa" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_cc_hpux_cc_aa" >&5
+$as_echo "$ac_cv_lbl_cc_hpux_cc_aa" >&6; }
if test $ac_cv_lbl_cc_hpux_cc_aa = no ; then
- { { echo "$as_me:$LINENO: error: see the INSTALL doc for more info" >&5
-echo "$as_me: error: see the INSTALL doc for more info" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "see the INSTALL doc for more info" "$LINENO" 5
fi
CFLAGS="$savedcflags"
V_CCOPT="-Aa $V_CCOPT"
- cat >>confdefs.h <<\_ACEOF
-#define _HPUX_SOURCE 1
+
+$as_echo "#define _HPUX_SOURCE 1" >>confdefs.h
+
+ ;;
+
+ osf*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ansi mode in DEC compiler ($CC -std1)" >&5
+$as_echo_n "checking for ansi mode in DEC compiler ($CC -std1)... " >&6; }
+ savedcflags="$CFLAGS"
+ CFLAGS="-std1"
+ if ${ac_cv_lbl_cc_osf1_cc_std1+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+int
+main ()
+{
+int frob(int, char *)
+ ;
+ return 0;
+}
_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_lbl_cc_osf1_cc_std1=yes
+else
+ ac_cv_lbl_cc_osf1_cc_std1=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_cc_osf1_cc_std1" >&5
+$as_echo "$ac_cv_lbl_cc_osf1_cc_std1" >&6; }
+ if test $ac_cv_lbl_cc_osf1_cc_std1 = no ; then
+ as_fn_error $? "see the INSTALL doc for more info" "$LINENO" 5
+ fi
+ CFLAGS="$savedcflags"
+ V_CCOPT="-std1 $V_CCOPT"
;;
*)
- { { echo "$as_me:$LINENO: error: see the INSTALL doc for more info" >&5
-echo "$as_me: error: see the INSTALL doc for more info" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "see the INSTALL doc for more info" "$LINENO" 5
;;
esac
fi
@@ -2975,20 +3324,20 @@
;;
osf*)
- V_CCOPT="$V_CCOPT -std1 -O"
+ #
+ # Presumed to be DEC OSF/1, Digital UNIX, or
+ # Tru64 UNIX.
+ #
+ V_CCOPT="$V_CCOPT -O"
;;
ultrix*)
- { echo "$as_me:$LINENO: checking that Ultrix $CC hacks const in prototypes" >&5
-echo $ECHO_N "checking that Ultrix $CC hacks const in prototypes... $ECHO_C" >&6; }
- if test "${ac_cv_lbl_cc_const_proto+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking that Ultrix $CC hacks const in prototypes" >&5
+$as_echo_n "checking that Ultrix $CC hacks const in prototypes... " >&6; }
+ if ${ac_cv_lbl_cc_const_proto+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
int
@@ -3000,50 +3349,31 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_lbl_cc_const_proto=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lbl_cc_const_proto=no
+ ac_cv_lbl_cc_const_proto=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
- { echo "$as_me:$LINENO: result: $ac_cv_lbl_cc_const_proto" >&5
-echo "${ECHO_T}$ac_cv_lbl_cc_const_proto" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_cc_const_proto" >&5
+$as_echo "$ac_cv_lbl_cc_const_proto" >&6; }
if test $ac_cv_lbl_cc_const_proto = no ; then
- cat >>confdefs.h <<\_ACEOF
-#define const
-_ACEOF
+$as_echo "#define const /**/" >>confdefs.h
+
fi
;;
esac
fi
-{ echo "$as_me:$LINENO: checking for inline" >&5
-echo $ECHO_N "checking for inline... $ECHO_C" >&6; }
- if test "${ac_cv_lbl_inline+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$V_CCOPT"
+ if ${ac_cv_lbl_inline+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_cv_lbl_inline=""
@@ -3050,11 +3380,7 @@
ac_lbl_cc_inline=no
for ac_lbl_inline in inline __inline__ __inline
do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#define inline $ac_lbl_inline
static inline struct iltest *foo(void);
@@ -3078,31 +3404,9 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_lbl_cc_inline=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$ac_lbl_cc_inline" = yes ; then
break;
@@ -3113,12 +3417,13 @@
fi
fi
+ CFLAGS="$save_CFLAGS"
if test ! -z "$ac_cv_lbl_inline" ; then
- { echo "$as_me:$LINENO: result: $ac_cv_lbl_inline" >&5
-echo "${ECHO_T}$ac_cv_lbl_inline" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_inline" >&5
+$as_echo "$ac_cv_lbl_inline" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
cat >>confdefs.h <<_ACEOF
@@ -3126,19 +3431,16 @@
_ACEOF
-{ echo "$as_me:$LINENO: checking for __attribute__" >&5
-echo $ECHO_N "checking for __attribute__... $ECHO_C" >&6; }
-if test "${ac_cv___attribute__+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__" >&5
+$as_echo_n "checking for __attribute__... " >&6; }
+if ${ac_cv___attribute__+:} false; then :
+ $as_echo_n "(cached) " >&6
else
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+
#include <stdlib.h>
static void foo(void) __attribute__ ((noreturn));
@@ -3156,61 +3458,80 @@
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv___attribute__=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv___attribute__=no
+ ac_cv___attribute__=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test "$ac_cv___attribute__" = "yes"; then
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___ATTRIBUTE__ 1
-_ACEOF
+$as_echo "#define HAVE___ATTRIBUTE__ 1" >>confdefs.h
V_DEFS="$V_DEFS -D_U_=\"__attribute__((unused))\""
else
V_DEFS="$V_DEFS -D_U_=\"\""
fi
-{ echo "$as_me:$LINENO: result: $ac_cv___attribute__" >&5
-echo "${ECHO_T}$ac_cv___attribute__" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute__" >&5
+$as_echo "$ac_cv___attribute__" >&6; }
+if test "$ac_cv___attribute__" = "yes"; then
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __attribute__((format)) can be applied to function pointers" >&5
+$as_echo_n "checking whether __attribute__((format)) can be applied to function pointers... " >&6; }
+if ${ac_cv___attribute___format_function_pointer+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+#include <stdlib.h>
+
+extern int (*foo)(const char *fmt, ...)
+ __attribute__ ((format (printf, 1, 2)));
+
+int
+main(int argc, char **argv)
+{
+ (*foo)("%s", "test");
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv___attribute___format_function_pointer=yes
+else
+ ac_cv___attribute___format_function_pointer=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+if test "$ac_cv___attribute___format_function_pointer" = "yes"; then
+
+$as_echo "#define __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute___format_function_pointer" >&5
+$as_echo "$ac_cv___attribute___format_function_pointer" >&6; }
+
+fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
else
# Double quotes because CPP needs to be expanded
for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -3224,11 +3545,7 @@
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
@@ -3237,76 +3554,34 @@
#endif
Syntax error
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
+if ac_fn_c_try_cpp "$LINENO"; then :
+
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
# Broken: fails on valid input.
continue
fi
+rm -f conftest.err conftest.i conftest.$ac_ext
-rm -f conftest.err conftest.$ac_ext
-
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
# Passes both tests.
ac_preproc_ok=:
break
fi
+rm -f conftest.err conftest.i conftest.$ac_ext
-rm -f conftest.err conftest.$ac_ext
-
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
break
fi
@@ -3318,8 +3593,8 @@
else
ac_cv_prog_CPP=$CPP
fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
@@ -3329,11 +3604,7 @@
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
@@ -3342,83 +3613,40 @@
#endif
Syntax error
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
+if ac_fn_c_try_cpp "$LINENO"; then :
+
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
# Broken: fails on valid input.
continue
fi
+rm -f conftest.err conftest.i conftest.$ac_ext
-rm -f conftest.err conftest.$ac_ext
-
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
+if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
# Passes both tests.
ac_preproc_ok=:
break
fi
+rm -f conftest.err conftest.i conftest.$ac_ext
-rm -f conftest.err conftest.$ac_ext
-
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
fi
ac_ext=c
@@ -3428,29 +3656,24 @@
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+ if test -z "$GREP"; then
ac_path_GREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
- # Check for GNU ac_path_GREP and select it if it is found.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
*GNU*)
@@ -3457,16 +3680,16 @@
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ $as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- echo 'GREP' >> "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
"$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_GREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_GREP="$ac_path_GREP"
@@ -3478,61 +3701,45 @@
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
-
- $ac_path_GREP_found && break 3
+ $ac_path_GREP_found && break 3
+ done
done
-done
-
-done
+ done
IFS=$as_save_IFS
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
else
ac_cv_path_GREP=$GREP
fi
-
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
else
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
- # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+ if test -z "$EGREP"; then
ac_path_EGREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
- # Check for GNU ac_path_EGREP and select it if it is found.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
*GNU*)
@@ -3539,16 +3746,16 @@
ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ $as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
- echo 'EGREP' >> "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
"$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_EGREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_EGREP="$ac_path_EGREP"
@@ -3560,46 +3767,31 @@
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
-
- $ac_path_EGREP_found && break 3
+ $ac_path_EGREP_found && break 3
+ done
done
-done
-
-done
+ done
IFS=$as_save_IFS
-
-
-fi
-
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
else
ac_cv_path_EGREP=$EGREP
fi
-
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
@@ -3614,47 +3806,23 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_header_stdc=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_stdc=no
+ ac_cv_header_stdc=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <string.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
else
ac_cv_header_stdc=no
fi
@@ -3664,18 +3832,14 @@
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
+ $EGREP "free" >/dev/null 2>&1; then :
+
else
ac_cv_header_stdc=no
fi
@@ -3685,14 +3849,10 @@
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
+ if test "$cross_compiling" = yes; then :
:
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ctype.h>
#include <stdlib.h>
@@ -3719,113 +3879,35 @@
return 0;
}
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
+if ac_fn_c_try_run "$LINENO"; then :
+
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
+ ac_cv_header_stdc=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
fi
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -3833,142 +3915,13 @@
done
-
-
-
-for ac_header in fcntl.h rpc/rpcent.h netdnet/dnetdb.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+for ac_header in fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -3975,60 +3928,15 @@
done
-
for ac_header in net/pfvar.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
+do :
+ ac_fn_c_check_header_compile "$LINENO" "net/pfvar.h" "ac_cv_header_net_pfvar_h" "#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+"
+if test "x$ac_cv_header_net_pfvar_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_NET_PFVAR_H 1
_ACEOF
fi
@@ -4035,62 +3943,17 @@
done
-if test "$ac_cv_header_net_pfvar_h" == yes; then
+if test "$ac_cv_header_net_pfvar_h" = yes; then
LOCALSRC="print-pflog.c $LOCALSRC"
fi
-
for ac_header in netinet/if_ether.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
+do :
+ ac_fn_c_check_header_compile "$LINENO" "netinet/if_ether.h" "ac_cv_header_netinet_if_ether_h" "#include <sys/types.h>
#include <sys/socket.h>
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+"
+if test "x$ac_cv_header_netinet_if_ether_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_NETINET_IF_ETHER_H 1
_ACEOF
fi
@@ -4105,66 +3968,21 @@
# treat the previous failure as a cached value and
# suppress the next test.
#
- { echo "$as_me:$LINENO: Rechecking with some additional includes" >&5
-echo "$as_me: Rechecking with some additional includes" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rechecking with some additional includes" >&5
+$as_echo "$as_me: Rechecking with some additional includes" >&6;}
unset ac_cv_header_netinet_if_ether_h
-
-for ac_header in netinet/if_ether.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <sys/types.h>
+ for ac_header in netinet/if_ether.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "netinet/if_ether.h" "ac_cv_header_netinet_if_ether_h" "#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
struct mbuf;
struct rtentry;
#include <net/if.h>
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- eval "$as_ac_Header=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+"
+if test "x$ac_cv_header_netinet_if_ether_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_NETINET_IF_ETHER_H 1
_ACEOF
fi
@@ -4173,16 +3991,12 @@
fi
-{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
-echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
-if test "${ac_cv_header_time+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if ${ac_cv_header_time+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/time.h>
@@ -4197,40 +4011,18 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_header_time=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_time=no
+ ac_cv_header_time=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
-echo "${ECHO_T}$ac_cv_header_time" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
if test $ac_cv_header_time = yes; then
-cat >>confdefs.h <<\_ACEOF
-#define TIME_WITH_SYS_TIME 1
-_ACEOF
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
fi
@@ -4237,19 +4029,49 @@
case "$host_os" in
+darwin*)
+ # Check whether --enable-universal was given.
+if test "${enable_universal+set}" = set; then :
+ enableval=$enable_universal;
+fi
+
+ if test "$enable_universal" != "no"; then
+ case "$host_os" in
+
+ darwin9.*)
+ #
+ # Leopard. Build for x86 and 32-bit PowerPC, with
+ # x86 first. (That's what Apple does.)
+ #
+ V_CCOPT="$V_CCOPT -arch i386 -arch ppc"
+ LDFLAGS="$LDFLAGS -arch i386 -arch ppc"
+ ;;
+
+ darwin10.*)
+ #
+ # Snow Leopard. Build for x86-64 and x86, with
+ # x86-64 first. (That's what Apple does.)
+ #
+ V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
+ LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
+ ;;
+ esac
+ fi
+ ;;
+
linux*)
- { echo "$as_me:$LINENO: checking Linux kernel version" >&5
-echo $ECHO_N "checking Linux kernel version... $ECHO_C" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Linux kernel version" >&5
+$as_echo_n "checking Linux kernel version... " >&6; }
if test "$cross_compiling" = yes; then
- if test "${ac_cv_linux_vers+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if ${ac_cv_linux_vers+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_cv_linux_vers=unknown
fi
else
- if test "${ac_cv_linux_vers+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ if ${ac_cv_linux_vers+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_cv_linux_vers=`uname -r 2>&1 | \
sed -n -e '$s/.* //' -e '$s/\..*//p'`
@@ -4256,17 +4078,13 @@
fi
fi
- { echo "$as_me:$LINENO: result: $ac_cv_linux_vers" >&5
-echo "${ECHO_T}$ac_cv_linux_vers" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_linux_vers" >&5
+$as_echo "$ac_cv_linux_vers" >&6; }
if test $ac_cv_linux_vers = unknown ; then
- { { echo "$as_me:$LINENO: error: cannot determine linux version when cross-compiling" >&5
-echo "$as_me: error: cannot determine linux version when cross-compiling" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "cannot determine linux version when cross-compiling" "$LINENO" 5
fi
if test $ac_cv_linux_vers -lt 2 ; then
- { { echo "$as_me:$LINENO: error: version 2 or higher required; see the INSTALL doc for more info" >&5
-echo "$as_me: error: version 2 or higher required; see the INSTALL doc for more info" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "version 2 or higher required; see the INSTALL doc for more info" "$LINENO" 5
fi
;;
@@ -4276,139 +4094,21 @@
-for ac_header in smi.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+# Check whether --with-smi was given.
+if test "${with_smi+set}" = set; then :
+ withval=$with_smi;
else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
+ with_smi=yes
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+if test "x$with_smi" != "xno" ; then
+for ac_header in smi.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "smi.h" "ac_cv_header_smi_h" "$ac_includes_default"
+if test "x$ac_cv_header_smi_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_SMI_H 1
_ACEOF
fi
@@ -4415,19 +4115,14 @@
done
-
-{ echo "$as_me:$LINENO: checking for smiInit in -lsmi" >&5
-echo $ECHO_N "checking for smiInit in -lsmi... $ECHO_C" >&6; }
-if test "${ac_cv_lib_smi_smiInit+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for smiInit in -lsmi" >&5
+$as_echo_n "checking for smiInit in -lsmi... " >&6; }
+if ${ac_cv_lib_smi_smiInit+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsmi $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -4445,39 +4140,18 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_smi_smiInit=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_smi_smiInit=no
+ ac_cv_lib_smi_smiInit=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_smi_smiInit" >&5
-echo "${ECHO_T}$ac_cv_lib_smi_smiInit" >&6; }
-if test $ac_cv_lib_smi_smiInit = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smi_smiInit" >&5
+$as_echo "$ac_cv_lib_smi_smiInit" >&6; }
+if test "x$ac_cv_lib_smi_smiInit" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBSMI 1
_ACEOF
@@ -4488,19 +4162,15 @@
if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
then
-{ echo "$as_me:$LINENO: checking whether to enable libsmi" >&5
-echo $ECHO_N "checking whether to enable libsmi... $ECHO_C" >&6; }
- if test "$cross_compiling" = yes; then
- { echo "$as_me:$LINENO: result: not when cross-compiling" >&5
-echo "${ECHO_T}not when cross-compiling" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable libsmi" >&5
+$as_echo_n "checking whether to enable libsmi... " >&6; }
+ if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not when cross-compiling" >&5
+$as_echo "not when cross-compiling" >&6; }
libsmi=no
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* libsmi available check */
#include <smi.h>
@@ -4521,63 +4191,38 @@
}
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- cat >>confdefs.h <<\_ACEOF
-#define LIBSMI 1
-_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ $as_echo "#define LIBSMI 1" >>confdefs.h
libsmi=yes
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
- case $? in
- 1) { echo "$as_me:$LINENO: result: no - smiInit failed" >&5
-echo "${ECHO_T}no - smiInit failed" >&6; } ;;
- 2) { echo "$as_me:$LINENO: result: no - header/library version mismatch" >&5
-echo "${ECHO_T}no - header/library version mismatch" >&6; } ;;
- 3) { echo "$as_me:$LINENO: result: no - can't determine library version" >&5
-echo "${ECHO_T}no - can't determine library version" >&6; } ;;
- 4) { echo "$as_me:$LINENO: result: no - too old" >&5
-echo "${ECHO_T}no - too old" >&6; } ;;
- *) { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; } ;;
+ case $? in
+ 1) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - smiInit failed" >&5
+$as_echo "no - smiInit failed" >&6; } ;;
+ 2) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - header/library version mismatch" >&5
+$as_echo "no - header/library version mismatch" >&6; } ;;
+ 3) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - can't determine library version" >&5
+$as_echo "no - can't determine library version" >&6; } ;;
+ 4) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - too old" >&5
+$as_echo "no - too old" >&6; } ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; } ;;
esac
libsmi=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-
fi
+fi
-{ echo "$as_me:$LINENO: checking whether to enable the possibly-buggy SMB printer" >&5
-echo $ECHO_N "checking whether to enable the possibly-buggy SMB printer... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the possibly-buggy SMB printer" >&5
+$as_echo_n "checking whether to enable the possibly-buggy SMB printer... " >&6; }
# Check whether --enable-smb was given.
-if test "${enable_smb+set}" = set; then
+if test "${enable_smb+set}" = set; then :
enableval=$enable_smb;
else
enableval=yes
@@ -4584,93 +4229,85 @@
fi
case "$enableval" in
-yes) { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- { echo "$as_me:$LINENO: WARNING: The SMB printer may have exploitable buffer overflows!!!" >&5
-echo "$as_me: WARNING: The SMB printer may have exploitable buffer overflows!!!" >&2;}
- cat >>confdefs.h <<\_ACEOF
-#define TCPDUMP_DO_SMB 1
-_ACEOF
+yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The SMB printer may have exploitable buffer overflows!!!" >&5
+$as_echo "$as_me: WARNING: The SMB printer may have exploitable buffer overflows!!!" >&2;}
+ $as_echo "#define TCPDUMP_DO_SMB 1" >>confdefs.h
LOCALSRC="print-smb.c smbutil.c $LOCALSRC"
;;
-*) { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
;;
esac
# Check whether --with-user was given.
-if test "${with_user+set}" = set; then
+if test "${with_user+set}" = set; then :
withval=$with_user;
fi
-{ echo "$as_me:$LINENO: checking whether to drop root privileges by default" >&5
-echo $ECHO_N "checking whether to drop root privileges by default... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to drop root privileges by default" >&5
+$as_echo_n "checking whether to drop root privileges by default... " >&6; }
if test ! -z "$with_user" ; then
cat >>confdefs.h <<_ACEOF
#define WITH_USER "$withval"
_ACEOF
- { echo "$as_me:$LINENO: result: to \"$withval\"" >&5
-echo "${ECHO_T}to \"$withval\"" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: to \"$withval\"" >&5
+$as_echo "to \"$withval\"" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
# Check whether --with-chroot was given.
-if test "${with_chroot+set}" = set; then
+if test "${with_chroot+set}" = set; then :
withval=$with_chroot;
fi
-{ echo "$as_me:$LINENO: checking whether to chroot" >&5
-echo $ECHO_N "checking whether to chroot... $ECHO_C" >&6; }
-if test ! -z "$with_chroot" ; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to chroot" >&5
+$as_echo_n "checking whether to chroot... " >&6; }
+if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
cat >>confdefs.h <<_ACEOF
#define WITH_CHROOT "$withval"
_ACEOF
- { echo "$as_me:$LINENO: result: to \"$withval\"" >&5
-echo "${ECHO_T}to \"$withval\"" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: to \"$withval\"" >&5
+$as_echo "to \"$withval\"" >&6; }
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
-{ echo "$as_me:$LINENO: checking whether to enable ipv6" >&5
-echo $ECHO_N "checking whether to enable ipv6... $ECHO_C" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable ipv6" >&5
+$as_echo_n "checking whether to enable ipv6... " >&6; }
# Check whether --enable-ipv6 was given.
-if test "${enable_ipv6+set}" = set; then
+if test "${enable_ipv6+set}" = set; then :
enableval=$enable_ipv6; case "$enableval" in
-yes) { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- 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"
- cat >>confdefs.h <<\_ACEOF
-#define INET6 1
-_ACEOF
+yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
+ $as_echo "#define INET6 1" >>confdefs.h
ipv6=yes
;;
*)
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
ipv6=no
;;
esac
else
- if test "$cross_compiling" = yes; then
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ if test "$cross_compiling" = yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
ipv6=no
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* AF_INET6 available check */
#include <sys/types.h>
@@ -4684,48 +4321,22 @@
}
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- 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"
- cat >>confdefs.h <<\_ACEOF
-#define INET6 1
-_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
+ $as_echo "#define INET6 1" >>confdefs.h
ipv6=yes
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
ipv6=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-
fi
@@ -4734,16 +4345,12 @@
ipv6trylibc=no
if test "$ipv6" = "yes"; then
- { echo "$as_me:$LINENO: checking ipv6 stack type" >&5
-echo $ECHO_N "checking ipv6 stack type... $ECHO_C" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking ipv6 stack type" >&5
+$as_echo_n "checking ipv6 stack type... " >&6; }
for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
case $i in
inria)
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <netinet/in.h>
#ifdef IPV6_INRIA_VERSION
@@ -4751,7 +4358,7 @@
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "yes" >/dev/null 2>&1; then
+ $EGREP "yes" >/dev/null 2>&1; then :
ipv6type=$i;
CFLAGS="-DINET6 $CFLAGS"
fi
@@ -4759,11 +4366,7 @@
;;
kame)
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <netinet/in.h>
#ifdef __KAME__
@@ -4771,7 +4374,7 @@
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "yes" >/dev/null 2>&1; then
+ $EGREP "yes" >/dev/null 2>&1; then :
ipv6type=$i;
ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib;
@@ -4782,11 +4385,7 @@
;;
linux-glibc)
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <features.h>
#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
@@ -4794,7 +4393,7 @@
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "yes" >/dev/null 2>&1; then
+ $EGREP "yes" >/dev/null 2>&1; then :
ipv6type=$i;
CFLAGS="-DINET6 $CFLAGS"
fi
@@ -4811,11 +4410,7 @@
fi
;;
toshiba)
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/param.h>
#ifdef _TOSHIBA_INET6
@@ -4823,7 +4418,7 @@
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "yes" >/dev/null 2>&1; then
+ $EGREP "yes" >/dev/null 2>&1; then :
ipv6type=$i;
ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib;
@@ -4833,11 +4428,7 @@
;;
v6d)
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include </usr/local/v6/include/sys/v6config.h>
#ifdef __V6D__
@@ -4845,7 +4436,7 @@
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "yes" >/dev/null 2>&1; then
+ $EGREP "yes" >/dev/null 2>&1; then :
ipv6type=$i;
ipv6lib=v6;
ipv6libdir=/usr/local/v6/lib;
@@ -4855,11 +4446,7 @@
;;
zeta)
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/param.h>
#ifdef _ZETA_MINAMI_INET6
@@ -4867,7 +4454,7 @@
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "yes" >/dev/null 2>&1; then
+ $EGREP "yes" >/dev/null 2>&1; then :
ipv6type=$i;
ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib;
@@ -4881,8 +4468,8 @@
break
fi
done
- { echo "$as_me:$LINENO: result: $ipv6type" >&5
-echo "${ECHO_T}$ipv6type" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ipv6type" >&5
+$as_echo "$ipv6type" >&6; }
fi
if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
@@ -4916,17 +4503,13 @@
# script to become confused, and results in libpcap
# being unbuildable.
#
- { echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5
-echo $ECHO_N "checking for library containing getaddrinfo... $ECHO_C" >&6; }
-if test "${ac_cv_search_getaddrinfo+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5
+$as_echo_n "checking for library containing getaddrinfo... " >&6; }
+if ${ac_cv_search_getaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -4951,40 +4534,17 @@
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_getaddrinfo=$ac_res
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext
- if test "${ac_cv_search_getaddrinfo+set}" = set; then
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_getaddrinfo+:} false; then :
break
fi
done
-if test "${ac_cv_search_getaddrinfo+set}" = set; then
- :
+if ${ac_cv_search_getaddrinfo+:} false; then :
+
else
ac_cv_search_getaddrinfo=no
fi
@@ -4991,24 +4551,20 @@
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_getaddrinfo" >&5
-echo "${ECHO_T}$ac_cv_search_getaddrinfo" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5
+$as_echo "$ac_cv_search_getaddrinfo" >&6; }
ac_res=$ac_cv_search_getaddrinfo
-if test "$ac_res" != no; then
+if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- { echo "$as_me:$LINENO: checking getaddrinfo bug" >&5
-echo $ECHO_N "checking getaddrinfo bug... $ECHO_C" >&6; }
- if test "${td_cv_buggygetaddrinfo+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug" >&5
+$as_echo_n "checking getaddrinfo bug... " >&6; }
+ if ${td_cv_buggygetaddrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test "$cross_compiling" = yes; then
+ if test "$cross_compiling" = yes; then :
td_cv_buggygetaddrinfo=yes
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
@@ -5106,47 +4662,23 @@
}
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
td_cv_buggygetaddrinfo=no
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-td_cv_buggygetaddrinfo=yes
+ td_cv_buggygetaddrinfo=yes
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-
fi
if test "$td_cv_buggygetaddrinfo" = no; then
- { echo "$as_me:$LINENO: result: good" >&5
-echo "${ECHO_T}good" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: good" >&5
+$as_echo "good" >&6; }
else
- { echo "$as_me:$LINENO: result: buggy" >&5
-echo "${ECHO_T}buggy" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: buggy" >&5
+$as_echo "buggy" >&6; }
fi
if test "$td_cv_buggygetaddrinfo" = "yes"; then
@@ -5170,127 +4702,34 @@
fi
+ ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo"
+if test "x$ac_cv_func_getnameinfo" = xyes; then :
+ $as_echo "#define HAVE_GETNAMEINFO 1" >>confdefs.h
-
-for ac_func in getaddrinfo getnameinfo
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-else
case " $LIBOBJS " in
- *" $ac_func.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
+ *" getnameinfo.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS getnameinfo.$ac_objext"
;;
esac
fi
-done
fi
-{ echo "$as_me:$LINENO: checking for dnet_htoa declaration in netdnet/dnetdb.h" >&5
-echo $ECHO_N "checking for dnet_htoa declaration in netdnet/dnetdb.h... $ECHO_C" >&6; }
-if test "${td_cv_decl_netdnet_dnetdb_h_dnet_htoa+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_htoa declaration in netdnet/dnetdb.h" >&5
+$as_echo_n "checking for dnet_htoa declaration in netdnet/dnetdb.h... " >&6; }
+if ${td_cv_decl_netdnet_dnetdb_h_dnet_htoa+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <netdnet/dnetdb.h>
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "dnet_htoa" >/dev/null 2>&1; then
+ $EGREP "dnet_htoa" >/dev/null 2>&1; then :
td_cv_decl_netdnet_dnetdb_h_dnet_htoa=yes
else
td_cv_decl_netdnet_dnetdb_h_dnet_htoa=no
@@ -5298,2055 +4737,22 @@
rm -f conftest*
fi
-{ echo "$as_me:$LINENO: result: $td_cv_decl_netdnet_dnetdb_h_dnet_htoa" >&5
-echo "${ECHO_T}$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $td_cv_decl_netdnet_dnetdb_h_dnet_htoa" >&5
+$as_echo "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" >&6; }
if test "$td_cv_decl_netdnet_dnetdb_h_dnet_htoa" = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_NETDNET_DNETDB_H_DNET_HTOA 1
-_ACEOF
+ $as_echo "#define HAVE_NETDNET_DNETDB_H_DNET_HTOA 1" >>confdefs.h
fi
-{ echo "$as_me:$LINENO: checking for char" >&5
-echo $ECHO_N "checking for char... $ECHO_C" >&6; }
-if test "${ac_cv_type_char+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef char ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_char=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_char=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5
-echo "${ECHO_T}$ac_cv_type_char" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of char" >&5
-echo $ECHO_N "checking size of char... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_char+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addrinfo" >&5
+$as_echo_n "checking for addrinfo... " >&6; }
+ if ${ac_cv_addrinfo+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-$ac_includes_default
- typedef char ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef char ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef char ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef char ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef char ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_char=$ac_lo;;
-'') if test "$ac_cv_type_char" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (char)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_char=0
- fi ;;
-esac
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef char ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_char=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_char" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (char)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (char)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_char=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
-echo "${ECHO_T}$ac_cv_sizeof_char" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_CHAR $ac_cv_sizeof_char
-_ACEOF
-
-
-{ echo "$as_me:$LINENO: checking for short" >&5
-echo $ECHO_N "checking for short... $ECHO_C" >&6; }
-if test "${ac_cv_type_short+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef short ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_short=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_short=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5
-echo "${ECHO_T}$ac_cv_type_short" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of short" >&5
-echo $ECHO_N "checking size of short... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_short+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef short ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef short ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef short ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef short ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef short ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_short=$ac_lo;;
-'') if test "$ac_cv_type_short" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_short=0
- fi ;;
-esac
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef short ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_short=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_short" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (short)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (short)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_short=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
-echo "${ECHO_T}$ac_cv_sizeof_short" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SHORT $ac_cv_sizeof_short
-_ACEOF
-
-
-{ echo "$as_me:$LINENO: checking for int" >&5
-echo $ECHO_N "checking for int... $ECHO_C" >&6; }
-if test "${ac_cv_type_int+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef int ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_int=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_int=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
-echo "${ECHO_T}$ac_cv_type_int" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of int" >&5
-echo $ECHO_N "checking size of int... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_int+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_int=$ac_lo;;
-'') if test "$ac_cv_type_int" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_int=0
- fi ;;
-esac
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef int ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_int=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_int" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (int)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_int=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
-echo "${ECHO_T}$ac_cv_sizeof_int" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
-_ACEOF
-
-
-{ echo "$as_me:$LINENO: checking for long" >&5
-echo $ECHO_N "checking for long... $ECHO_C" >&6; }
-if test "${ac_cv_type_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef long ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_long=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_long=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
-echo "${ECHO_T}$ac_cv_type_long" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of long" >&5
-echo $ECHO_N "checking size of long... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long=$ac_lo;;
-'') if test "$ac_cv_type_long" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long=0
- fi ;;
-esac
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_long=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_long" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
-_ACEOF
-
-
-{ echo "$as_me:$LINENO: checking for long long" >&5
-echo $ECHO_N "checking for long long... $ECHO_C" >&6; }
-if test "${ac_cv_type_long_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef long long ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_long_long=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_long_long=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5
-echo "${ECHO_T}$ac_cv_type_long_long" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ echo "$as_me:$LINENO: checking size of long long" >&5
-echo $ECHO_N "checking size of long long... $ECHO_C" >&6; }
-if test "${ac_cv_sizeof_long_long+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test "$cross_compiling" = yes; then
- # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=0 ac_mid=0
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr $ac_mid + 1`
- if test $ac_lo -le $ac_mid; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=-1 ac_mid=-1
- while :; do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_lo=$ac_mid; break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_hi=`expr '(' $ac_mid ')' - 1`
- if test $ac_mid -le $ac_hi; then
- ac_lo= ac_hi=
- break
- fi
- ac_mid=`expr 2 '*' $ac_mid`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- done
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo= ac_hi=
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
- ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long ac__type_sizeof_;
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
-test_array [0] = 0
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_hi=$ac_mid
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lo=`expr '(' $ac_mid ')' + 1`
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long_long=$ac_lo;;
-'') if test "$ac_cv_type_long_long" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long_long=0
- fi ;;
-esac
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
- typedef long long ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
- FILE *f = fopen ("conftest.val", "w");
- if (! f)
- return 1;
- if (((long int) (sizeof (ac__type_sizeof_))) < 0)
- {
- long int i = longval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%ld\n", i);
- }
- else
- {
- unsigned long int i = ulongval ();
- if (i != ((long int) (sizeof (ac__type_sizeof_))))
- return 1;
- fprintf (f, "%lu\n", i);
- }
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_sizeof_long_long=`cat conftest.val`
-else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_long_long" = yes; then
- { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
- else
- ac_cv_sizeof_long_long=0
- fi
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
-_ACEOF
-
-
-
-
-
- { echo "$as_me:$LINENO: checking for addrinfo" >&5
-echo $ECHO_N "checking for addrinfo... $ECHO_C" >&6; }
- if test "${ac_cv_addrinfo+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
# include <netdb.h>
int
main ()
@@ -7356,45 +4762,21 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_addrinfo=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_addrinfo=no
+ ac_cv_addrinfo=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
- { echo "$as_me:$LINENO: result: $ac_cv_addrinfo" >&5
-echo "${ECHO_T}$ac_cv_addrinfo" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_addrinfo" >&5
+$as_echo "$ac_cv_addrinfo" >&6; }
if test $ac_cv_addrinfo = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_ADDRINFO 1
-_ACEOF
+ $as_echo "#define HAVE_ADDRINFO 1" >>confdefs.h
else
- cat >>confdefs.h <<\_ACEOF
-#define NEED_ADDRINFO_H 1
-_ACEOF
+ $as_echo "#define NEED_ADDRINFO_H 1" >>confdefs.h
fi
@@ -7403,16 +4785,12 @@
fi
- { echo "$as_me:$LINENO: checking for NI_MAXSERV" >&5
-echo $ECHO_N "checking for NI_MAXSERV... $ECHO_C" >&6; }
- if test "${ac_cv_maxserv+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NI_MAXSERV" >&5
+$as_echo_n "checking for NI_MAXSERV... " >&6; }
+ if ${ac_cv_maxserv+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <netdb.h>
#ifdef NI_MAXSERV
@@ -7420,7 +4798,7 @@
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "yes" >/dev/null 2>&1; then
+ $EGREP "yes" >/dev/null 2>&1; then :
ac_cv_maxserv=yes
else
ac_cv_maxserv=no
@@ -7429,12 +4807,10 @@
fi
- { echo "$as_me:$LINENO: result: $ac_cv_maxserv" >&5
-echo "${ECHO_T}$ac_cv_maxserv" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_maxserv" >&5
+$as_echo "$ac_cv_maxserv" >&6; }
if test $ac_cv_maxserv != yes; then
- cat >>confdefs.h <<\_ACEOF
-#define NEED_ADDRINFO_H 1
-_ACEOF
+ $as_echo "#define NEED_ADDRINFO_H 1" >>confdefs.h
fi
@@ -7443,16 +4819,12 @@
fi
- { echo "$as_me:$LINENO: checking for NI_NAMEREQD" >&5
-echo $ECHO_N "checking for NI_NAMEREQD... $ECHO_C" >&6; }
- if test "${ac_cv_namereqd+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NI_NAMEREQD" >&5
+$as_echo_n "checking for NI_NAMEREQD... " >&6; }
+ if ${ac_cv_namereqd+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <netdb.h>
#ifdef NI_NOFQDN
@@ -7460,7 +4832,7 @@
#endif
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "yes" >/dev/null 2>&1; then
+ $EGREP "yes" >/dev/null 2>&1; then :
ac_cv_namereqd=yes
else
ac_cv_namereqd=no
@@ -7469,12 +4841,10 @@
fi
- { echo "$as_me:$LINENO: result: $ac_cv_namereqd" >&5
-echo "${ECHO_T}$ac_cv_namereqd" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_namereqd" >&5
+$as_echo "$ac_cv_namereqd" >&6; }
if test $ac_cv_namereqd != yes; then
- cat >>confdefs.h <<\_ACEOF
-#define NEED_ADDRINFO_H 1
-_ACEOF
+ $as_echo "#define NEED_ADDRINFO_H 1" >>confdefs.h
fi
@@ -7483,16 +4853,12 @@
fi
- { echo "$as_me:$LINENO: checking for sockaddr_storage" >&5
-echo $ECHO_N "checking for sockaddr_storage... $ECHO_C" >&6; }
- if test "${ac_cv_sa_storage+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage" >&5
+$as_echo_n "checking for sockaddr_storage... " >&6; }
+ if ${ac_cv_sa_storage+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# include <sys/types.h>
@@ -7505,40 +4871,18 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_sa_storage=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_sa_storage=no
+ ac_cv_sa_storage=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
- { echo "$as_me:$LINENO: result: $ac_cv_sa_storage" >&5
-echo "${ECHO_T}$ac_cv_sa_storage" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sa_storage" >&5
+$as_echo "$ac_cv_sa_storage" >&6; }
if test $ac_cv_sa_storage = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SOCKADDR_STORAGE 1
-_ACEOF
+ $as_echo "#define HAVE_SOCKADDR_STORAGE 1" >>confdefs.h
fi
@@ -7546,617 +4890,104 @@
missing_includes=yes
fi
+ac_fn_c_check_func "$LINENO" "vfprintf" "ac_cv_func_vfprintf"
+if test "x$ac_cv_func_vfprintf" = xyes; then :
+ $as_echo "#define HAVE_VFPRINTF 1" >>confdefs.h
- ac_cv_addrsz=yes
- { echo "$as_me:$LINENO: checking for INADDRSZ" >&5
-echo $ECHO_N "checking for INADDRSZ... $ECHO_C" >&6; }
- if test "${ac_cv_inaddrsz+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-# include <arpa/nameser.h>
-int
-main ()
-{
-int a = INADDRSZ
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+ case " $LIBOBJS " in
+ *" vfprintf.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS vfprintf.$ac_objext"
+ ;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_inaddrsz=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_inaddrsz=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
+if test "x$ac_cv_func_strcasecmp" = xyes; then :
+ $as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h
- { echo "$as_me:$LINENO: result: $ac_cv_inaddrsz" >&5
-echo "${ECHO_T}$ac_cv_inaddrsz" >&6; }
- if test $ac_cv_inaddrsz = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_INADDRSZ 1
-_ACEOF
-
- else
- ac_cv_addrsz=no
- fi
- { echo "$as_me:$LINENO: checking for IN6ADDRSZ" >&5
-echo $ECHO_N "checking for IN6ADDRSZ... $ECHO_C" >&6; }
- if test "${ac_cv_in6addrsz+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-# include <arpa/nameser.h>
-int
-main ()
-{
-int a = IN6ADDRSZ
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+ case " $LIBOBJS " in
+ *" strcasecmp.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strcasecmp.$ac_objext"
+ ;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_in6addrsz=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_in6addrsz=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat"
+if test "x$ac_cv_func_strlcat" = xyes; then :
+ $as_echo "#define HAVE_STRLCAT 1" >>confdefs.h
- { echo "$as_me:$LINENO: result: $ac_cv_in6addrsz" >&5
-echo "${ECHO_T}$ac_cv_in6addrsz" >&6; }
- if test $ac_cv_in6addrsz = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_IN6ADDRSZ 1
-_ACEOF
-
- else
- ac_cv_addrsz=no
- fi
-
-if test "$ac_cv_addrsz" = no; then
- missing_includes=yes
-fi
-
-
- { echo "$as_me:$LINENO: checking for RES_USE_INET6" >&5
-echo $ECHO_N "checking for RES_USE_INET6... $ECHO_C" >&6; }
- if test "${ac_cv_res_inet6+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-# include <sys/types.h>
-# include <netinet/in.h>
-# include <resolv.h>
-int
-main ()
-{
-int a = RES_USE_INET6
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+ case " $LIBOBJS " in
+ *" strlcat.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strlcat.$ac_objext"
+ ;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_res_inet6=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_res_inet6=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy"
+if test "x$ac_cv_func_strlcpy" = xyes; then :
+ $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h
- { echo "$as_me:$LINENO: result: $ac_cv_res_inet6" >&5
-echo "${ECHO_T}$ac_cv_res_inet6" >&6; }
- if test $ac_cv_res_inet6 = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_RES_USE_INET6 1
-_ACEOF
-
- fi
-
-if test "$ac_cv_res_inet6" = no; then
- missing_includes=yes
-fi
-
-
- { echo "$as_me:$LINENO: checking for res_state_ext" >&5
-echo $ECHO_N "checking for res_state_ext... $ECHO_C" >&6; }
- if test "${ac_cv_res_state_ext+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-# include <sys/types.h>
-# include <netinet/in.h>
-# include <netinet6/in6.h>
-# include <resolv.h>
-int
-main ()
-{
-struct __res_state_ext e
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+ case " $LIBOBJS " in
+ *" strlcpy.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext"
+ ;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_res_state_ext=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_res_state_ext=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup"
+if test "x$ac_cv_func_strdup" = xyes; then :
+ $as_echo "#define HAVE_STRDUP 1" >>confdefs.h
- { echo "$as_me:$LINENO: result: $ac_cv_res_state_ext" >&5
-echo "${ECHO_T}$ac_cv_res_state_ext" >&6; }
- if test $ac_cv_res_state_ext = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_RES_STATE_EXT 1
-_ACEOF
-
- fi
-
-if test "$ac_cv_res_state_ext" = no; then
- missing_includes=yes
-fi
-
-
- { echo "$as_me:$LINENO: checking for nsort in res_state" >&5
-echo $ECHO_N "checking for nsort in res_state... $ECHO_C" >&6; }
- if test "${ac_cv_res_state+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-# include <sys/types.h>
-# include <netinet/in.h>
-# include <netinet6/in6.h>
-# include <resolv.h>
-int
-main ()
-{
-struct __res_state e; e.nsort = 0
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
+ case " $LIBOBJS " in
+ *" strdup.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strdup.$ac_objext"
+ ;;
esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_res_state=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_res_state=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+ac_fn_c_check_func "$LINENO" "strsep" "ac_cv_func_strsep"
+if test "x$ac_cv_func_strsep" = xyes; then :
+ $as_echo "#define HAVE_STRSEP 1" >>confdefs.h
- { echo "$as_me:$LINENO: result: $ac_cv_res_state" >&5
-echo "${ECHO_T}$ac_cv_res_state" >&6; }
- if test $ac_cv_res_state = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_NEW_RES_STATE 1
-_ACEOF
-
- fi
-
-
-
-
-
-
-
-
-
-for ac_func in vfprintf strcasecmp strlcat strlcpy strdup strsep
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-else
case " $LIBOBJS " in
- *" $ac_func.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
+ *" strsep.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strsep.$ac_objext"
;;
esac
fi
-done
-
-for ac_func in strftime
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+for ac_func in fork vfork strftime
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
-
-
for ac_func in setlinebuf alarm
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
@@ -8164,96 +4995,13 @@
needsnprintf=no
-
-
for ac_func in vsnprintf snprintf
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
else
@@ -8271,16 +5019,12 @@
fi
- { echo "$as_me:$LINENO: checking return type of signal handlers" >&5
-echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
-if test "${ac_cv_type_signal+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
+$as_echo_n "checking return type of signal handlers... " >&6; }
+if ${ac_cv_type_signal+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <signal.h>
@@ -8293,35 +5037,15 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_type_signal=int
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_signal=void
+ ac_cv_type_signal=void
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
-echo "${ECHO_T}$ac_cv_type_signal" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
+$as_echo "$ac_cv_type_signal" >&6; }
cat >>confdefs.h <<_ACEOF
#define RETSIGTYPE $ac_cv_type_signal
@@ -8329,115 +5053,29 @@
if test "$ac_cv_type_signal" = void ; then
- cat >>confdefs.h <<\_ACEOF
-#define RETSIGVAL
-_ACEOF
+$as_echo "#define RETSIGVAL /**/" >>confdefs.h
+
else
- cat >>confdefs.h <<\_ACEOF
-#define RETSIGVAL (0)
-_ACEOF
+$as_echo "#define RETSIGVAL (0)" >>confdefs.h
+
fi
case "$host_os" in
irix*)
- cat >>confdefs.h <<\_ACEOF
-#define _BSD_SIGNALS 1
-_ACEOF
+$as_echo "#define _BSD_SIGNALS 1" >>confdefs.h
+
;;
*)
-
-for ac_func in sigaction
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ for ac_func in sigaction
+do :
+ ac_fn_c_check_func "$LINENO" "sigaction" "ac_cv_func_sigaction"
+if test "x$ac_cv_func_sigaction" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_SIGACTION 1
_ACEOF
fi
@@ -8444,95 +5082,12 @@
done
if test $ac_cv_func_sigaction = no ; then
-
-for ac_func in sigset
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ for ac_func in sigset
+do :
+ ac_fn_c_check_func "$LINENO" "sigset" "ac_cv_func_sigset"
+if test "x$ac_cv_func_sigset" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_SIGSET 1
_ACEOF
fi
@@ -8542,17 +5097,13 @@
;;
esac
-{ echo "$as_me:$LINENO: checking for library containing dnet_htoa" >&5
-echo $ECHO_N "checking for library containing dnet_htoa... $ECHO_C" >&6; }
-if test "${ac_cv_search_dnet_htoa+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dnet_htoa" >&5
+$as_echo_n "checking for library containing dnet_htoa... " >&6; }
+if ${ac_cv_search_dnet_htoa+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -8577,40 +5128,17 @@
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_dnet_htoa=$ac_res
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext
- if test "${ac_cv_search_dnet_htoa+set}" = set; then
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_dnet_htoa+:} false; then :
break
fi
done
-if test "${ac_cv_search_dnet_htoa+set}" = set; then
- :
+if ${ac_cv_search_dnet_htoa+:} false; then :
+
else
ac_cv_search_dnet_htoa=no
fi
@@ -8617,31 +5145,24 @@
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_dnet_htoa" >&5
-echo "${ECHO_T}$ac_cv_search_dnet_htoa" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dnet_htoa" >&5
+$as_echo "$ac_cv_search_dnet_htoa" >&6; }
ac_res=$ac_cv_search_dnet_htoa
-if test "$ac_res" != no; then
+if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_DNET_HTOA 1
-_ACEOF
+ $as_echo "#define HAVE_DNET_HTOA 1" >>confdefs.h
fi
-
-{ echo "$as_me:$LINENO: checking for main in -lrpc" >&5
-echo $ECHO_N "checking for main in -lrpc... $ECHO_C" >&6; }
-if test "${ac_cv_lib_rpc_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lrpc" >&5
+$as_echo_n "checking for main in -lrpc... " >&6; }
+if ${ac_cv_lib_rpc_main+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lrpc $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8653,39 +5174,18 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_rpc_main=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_rpc_main=no
+ ac_cv_lib_rpc_main=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_rpc_main" >&5
-echo "${ECHO_T}$ac_cv_lib_rpc_main" >&6; }
-if test $ac_cv_lib_rpc_main = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rpc_main" >&5
+$as_echo "$ac_cv_lib_rpc_main" >&6; }
+if test "x$ac_cv_lib_rpc_main" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBRPC 1
_ACEOF
@@ -8694,17 +5194,13 @@
fi
-{ echo "$as_me:$LINENO: checking for library containing getrpcbynumber" >&5
-echo $ECHO_N "checking for library containing getrpcbynumber... $ECHO_C" >&6; }
-if test "${ac_cv_search_getrpcbynumber+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getrpcbynumber" >&5
+$as_echo_n "checking for library containing getrpcbynumber... " >&6; }
+if ${ac_cv_search_getrpcbynumber+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -8729,40 +5225,17 @@
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_getrpcbynumber=$ac_res
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext
- if test "${ac_cv_search_getrpcbynumber+set}" = set; then
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_getrpcbynumber+:} false; then :
break
fi
done
-if test "${ac_cv_search_getrpcbynumber+set}" = set; then
- :
+if ${ac_cv_search_getrpcbynumber+:} false; then :
+
else
ac_cv_search_getrpcbynumber=no
fi
@@ -8769,14 +5242,12 @@
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_getrpcbynumber" >&5
-echo "${ECHO_T}$ac_cv_search_getrpcbynumber" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getrpcbynumber" >&5
+$as_echo "$ac_cv_search_getrpcbynumber" >&6; }
ac_res=$ac_cv_search_getrpcbynumber
-if test "$ac_res" != no; then
+if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETRPCBYNUMBER 1
-_ACEOF
+ $as_echo "#define HAVE_GETRPCBYNUMBER 1" >>confdefs.h
fi
@@ -8787,17 +5258,13 @@
# libraries (i.e. libc):
# Some OSes (eg. Solaris) place it in libnsl
# Some strange OSes (SINIX) have it in libsocket:
- { echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5
-echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; }
-if test "${ac_cv_search_gethostbyname+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
+$as_echo_n "checking for library containing gethostbyname... " >&6; }
+if ${ac_cv_search_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -8822,40 +5289,17 @@
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_gethostbyname=$ac_res
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext
- if test "${ac_cv_search_gethostbyname+set}" = set; then
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_gethostbyname+:} false; then :
break
fi
done
-if test "${ac_cv_search_gethostbyname+set}" = set; then
- :
+if ${ac_cv_search_gethostbyname+:} false; then :
+
else
ac_cv_search_gethostbyname=no
fi
@@ -8862,10 +5306,10 @@
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
+$as_echo "$ac_cv_search_gethostbyname" >&6; }
ac_res=$ac_cv_search_gethostbyname
-if test "$ac_res" != no; then
+if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
@@ -8874,18 +5318,14 @@
# AC_SEARCH_LIBS isn't up to the task of handling dependencies like this.
if test "$ac_cv_search_gethostbyname" = "no"
then
- { echo "$as_me:$LINENO: checking for gethostbyname in -lsocket" >&5
-echo $ECHO_N "checking for gethostbyname in -lsocket... $ECHO_C" >&6; }
-if test "${ac_cv_lib_socket_gethostbyname+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lsocket" >&5
+$as_echo_n "checking for gethostbyname in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket -lnsl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -8903,54 +5343,29 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_socket_gethostbyname=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_socket_gethostbyname=no
+ ac_cv_lib_socket_gethostbyname=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_gethostbyname" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_gethostbyname" >&6; }
-if test $ac_cv_lib_socket_gethostbyname = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_gethostbyname" >&5
+$as_echo "$ac_cv_lib_socket_gethostbyname" >&6; }
+if test "x$ac_cv_lib_socket_gethostbyname" = xyes; then :
LIBS="-lsocket -lnsl $LIBS"
fi
fi
- { echo "$as_me:$LINENO: checking for library containing socket" >&5
-echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6; }
-if test "${ac_cv_search_socket+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
+$as_echo_n "checking for library containing socket... " >&6; }
+if ${ac_cv_search_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -8975,40 +5390,17 @@
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_socket=$ac_res
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext
- if test "${ac_cv_search_socket+set}" = set; then
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_socket+:} false; then :
break
fi
done
-if test "${ac_cv_search_socket+set}" = set; then
- :
+if ${ac_cv_search_socket+:} false; then :
+
else
ac_cv_search_socket=no
fi
@@ -9015,25 +5407,21 @@
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5
-echo "${ECHO_T}$ac_cv_search_socket" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
+$as_echo "$ac_cv_search_socket" >&6; }
ac_res=$ac_cv_search_socket
-if test "$ac_res" != no; then
+if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
else
- { echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
-echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; }
-if test "${ac_cv_lib_socket_socket+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
+$as_echo_n "checking for socket in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket -lnsl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -9051,39 +5439,18 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_socket_socket=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_socket_socket=no
+ ac_cv_lib_socket_socket=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; }
-if test $ac_cv_lib_socket_socket = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
+$as_echo "$ac_cv_lib_socket_socket" >&6; }
+if test "x$ac_cv_lib_socket_socket" = xyes; then :
LIBS="-lsocket -lnsl $LIBS"
fi
@@ -9090,17 +5457,13 @@
fi
# DLPI needs putmsg under HPUX so test for -lstr while we're at it
- { echo "$as_me:$LINENO: checking for library containing putmsg" >&5
-echo $ECHO_N "checking for library containing putmsg... $ECHO_C" >&6; }
-if test "${ac_cv_search_putmsg+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing putmsg" >&5
+$as_echo_n "checking for library containing putmsg... " >&6; }
+if ${ac_cv_search_putmsg+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -9125,40 +5488,17 @@
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_putmsg=$ac_res
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext
- if test "${ac_cv_search_putmsg+set}" = set; then
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_putmsg+:} false; then :
break
fi
done
-if test "${ac_cv_search_putmsg+set}" = set; then
- :
+if ${ac_cv_search_putmsg+:} false; then :
+
else
ac_cv_search_putmsg=no
fi
@@ -9165,10 +5505,10 @@
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_putmsg" >&5
-echo "${ECHO_T}$ac_cv_search_putmsg" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_putmsg" >&5
+$as_echo "$ac_cv_search_putmsg" >&6; }
ac_res=$ac_cv_search_putmsg
-if test "$ac_res" != no; then
+if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
fi
@@ -9178,95 +5518,12 @@
LBL_LIBS="$LIBS"
pfopen=/usr/examples/packetfilter/pfopen.c
if test -f $pfopen ; then
-
-for ac_func in pfopen
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ for ac_func in pfopen
+do :
+ ac_fn_c_check_func "$LINENO" "pfopen" "ac_cv_func_pfopen"
+if test "x$ac_cv_func_pfopen" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_PFOPEN 1
_ACEOF
fi
@@ -9273,19 +5530,20 @@
done
if test $ac_cv_func_pfopen = "no" ; then
- { echo "$as_me:$LINENO: result: Using $pfopen" >&5
-echo "${ECHO_T}Using $pfopen" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using $pfopen" >&5
+$as_echo "Using $pfopen" >&6; }
LIBS="$LIBS $pfopen"
fi
fi
- { echo "$as_me:$LINENO: checking for local pcap library" >&5
-echo $ECHO_N "checking for local pcap library... $ECHO_C" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for local pcap library" >&5
+$as_echo_n "checking for local pcap library... " >&6; }
libpcap=FAIL
lastdir=FAIL
places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
- egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'`
+ egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'`
for dir in $places $srcdir/../libpcap $srcdir/libpcap ; do
- basedir=`echo $dir | sed -e 's/[ab][0-9]*$//'`
+ basedir=`echo $dir | sed -e 's/[ab][0-9]*$//' | \
+ sed -e 's/-PRE-GIT$//' `
if test $lastdir = $basedir ; then
continue;
fi
@@ -9296,20 +5554,137 @@
fi
done
if test $libpcap = FAIL ; then
- { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
- { echo "$as_me:$LINENO: checking for main in -lpcap" >&5
-echo $ECHO_N "checking for main in -lpcap... $ECHO_C" >&6; }
-if test "${ac_cv_lib_pcap_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+
+ #
+ # Look for pcap-config.
+ #
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pcap-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pcap-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PCAP_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
else
+ case $PCAP_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PCAP_CONFIG="$PCAP_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PCAP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PCAP_CONFIG=$ac_cv_path_PCAP_CONFIG
+if test -n "$PCAP_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCAP_CONFIG" >&5
+$as_echo "$PCAP_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PCAP_CONFIG"; then
+ ac_pt_PCAP_CONFIG=$PCAP_CONFIG
+ # Extract the first word of "pcap-config", so it can be a program name with args.
+set dummy pcap-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PCAP_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PCAP_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PCAP_CONFIG="$ac_pt_PCAP_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_ac_pt_PCAP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PCAP_CONFIG=$ac_cv_path_ac_pt_PCAP_CONFIG
+if test -n "$ac_pt_PCAP_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PCAP_CONFIG" >&5
+$as_echo "$ac_pt_PCAP_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PCAP_CONFIG" = x; then
+ PCAP_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PCAP_CONFIG=$ac_pt_PCAP_CONFIG
+ fi
+else
+ PCAP_CONFIG="$ac_cv_path_PCAP_CONFIG"
+fi
+
+ if test -n "$PCAP_CONFIG" ; then
+ #
+ # Found - use it to get the include flags for
+ # libpcap and the flags to link with libpcap.
+ #
+ # Please read section 11.6 "Shell Substitutions"
+ # in the autoconf manual before doing anything
+ # to this that involves quoting. Especially note
+ # the statement "There is just no portable way to use
+ # double-quoted strings inside double-quoted back-quoted
+ # expressions (pfew!)."
+ #
+ cflags=`"$PCAP_CONFIG" --cflags`
+ V_INCLS="$cflags $V_INCLS"
+ libpcap=`"$PCAP_CONFIG" --libs`
+ else
+ #
+ # Not found; look for pcap.
+ #
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpcap" >&5
+$as_echo_n "checking for main in -lpcap... " >&6; }
+if ${ac_cv_lib_pcap_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpcap $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -9321,65 +5696,43 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_pcap_main=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_pcap_main=no
+ ac_cv_lib_pcap_main=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_pcap_main" >&5
-echo "${ECHO_T}$ac_cv_lib_pcap_main" >&6; }
-if test $ac_cv_lib_pcap_main = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_main" >&5
+$as_echo "$ac_cv_lib_pcap_main" >&6; }
+if test "x$ac_cv_lib_pcap_main" = xyes; then :
libpcap="-lpcap"
fi
- if test $libpcap = FAIL ; then
- { { echo "$as_me:$LINENO: error: see the INSTALL doc for more info" >&5
-echo "$as_me: error: see the INSTALL doc for more info" >&2;}
- { (exit 1); exit 1; }; }
- fi
- { echo "$as_me:$LINENO: checking for extraneous pcap header directories" >&5
-echo $ECHO_N "checking for extraneous pcap header directories... $ECHO_C" >&6; }
- if test \( ! -r /usr/local/include/pcap.h \) -a \
+ if test $libpcap = FAIL ; then
+ as_fn_error $? "see the INSTALL doc for more info" "$LINENO" 5
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extraneous pcap header directories" >&5
+$as_echo_n "checking for extraneous pcap header directories... " >&6; }
+ 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"
+ 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
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+ else
+ V_INCLS="-I$d $V_INCLS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found -- -I$d added" >&5
+$as_echo "found -- -I$d added" >&6; }
+ fi
fi
- if test -z "$d" ; then
- { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
- else
- V_INCLS="-I$d $V_INCLS"
- { echo "$as_me:$LINENO: result: found -- -I$d added" >&5
-echo "${ECHO_T}found -- -I$d added" >&6; }
- fi
else
V_PCAPDEP=$libpcap
places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
@@ -9389,123 +5742,128 @@
elif test -r $places/pcap.h; then
V_INCLS="-I$places $V_INCLS"
else
- { { echo "$as_me:$LINENO: error: cannot find pcap.h" >&5
-echo "$as_me: error: cannot find pcap.h" >&2;}
- { (exit see INSTALL); exit see INSTALL; }; }
+ as_fn_error see INSTALL "cannot find pcap.h" "$LINENO" 5
fi
- { echo "$as_me:$LINENO: result: $libpcap" >&5
-echo "${ECHO_T}$libpcap" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libpcap" >&5
+$as_echo "$libpcap" >&6; }
+ # Extract the first word of "pcap-config", so it can be a program name with args.
+set dummy pcap-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PCAP_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PCAP_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PCAP_CONFIG="$PCAP_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $d
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PCAP_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PCAP_CONFIG=$ac_cv_path_PCAP_CONFIG
+if test -n "$PCAP_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCAP_CONFIG" >&5
+$as_echo "$PCAP_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test -n "$PCAP_CONFIG"; then
+ #
+ # The libpcap directory has a pcap-config script.
+ # Use it to get any additioal libraries needed
+ # to link with the libpcap archive library in
+ # that directory.
+ #
+ # Please read section 11.6 "Shell Substitutions"
+ # in the autoconf manual before doing anything
+ # to this that involves quoting. Especially note
+ # the statement "There is just no portable way to use
+ # double-quoted strings inside double-quoted back-quoted
+ # expressions (pfew!)."
+ #
+ additional_libs=`"$PCAP_CONFIG" --additional-libs --static`
+ libpcap="$libpcap $additional_libs"
+ fi
fi
LIBS="$libpcap $LIBS"
- case "$host_os" in
+ if ! test -n "$PCAP_CONFIG" ; then
+ #
+ # We don't have pcap-config; find out any additional link flags
+ # we need. (If we have pcap-config, we assume it tells us what
+ # we need.)
+ #
+ case "$host_os" in
- aix*)
+ aix*)
+ #
+ # If libpcap is DLPI-based, we have to use /lib/pse.exp if
+ # present, as we use the STREAMS routines.
+ #
+ # (XXX - true only if we're linking with a static libpcap?)
+ #
pseexe="/lib/pse.exp"
- { echo "$as_me:$LINENO: checking for $pseexe" >&5
-echo $ECHO_N "checking for $pseexe... $ECHO_C" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $pseexe" >&5
+$as_echo_n "checking for $pseexe... " >&6; }
if test -f $pseexe ; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
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.
+ # If libpcap is BPF-based, we need "-lodm" and "-lcfg", as
+ # we use them to load the BPF module.
#
+ # (XXX - true only if we're linking with a static libpcap?)
+ #
LIBS="$LIBS -lodm -lcfg"
;;
- esac
+ esac
+ fi
- { echo "$as_me:$LINENO: checking for pcap_list_datalinks" >&5
-echo $ECHO_N "checking for pcap_list_datalinks... $ECHO_C" >&6; }
-if test "${ac_cv_func_pcap_list_datalinks+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ ac_fn_c_check_func "$LINENO" "pcap_loop" "ac_cv_func_pcap_loop"
+if test "x$ac_cv_func_pcap_loop" = xyes; then :
+
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define pcap_list_datalinks to an innocuous variant, in case <limits.h> declares pcap_list_datalinks.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define pcap_list_datalinks innocuous_pcap_list_datalinks
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char pcap_list_datalinks (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
+ as_fn_error $? "Report this to tcpdump-workers at lists.tcpdump.org, and include the
+config.log file in your report. If you have downloaded libpcap from
+tcpdump.org, and built it yourself, please also include the config.log
+file from the libpcap source directory, the Makefile from the libpcap
+source directory, and the output of the make process for libpcap, as
+this could be a problem with the libpcap that was built, and we will
+not be able to determine why this is happening, and thus will not be
+able to fix it, without that information, as we have not been able to
+reproduce this problem ourselves." "$LINENO" 5
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+fi
-#undef pcap_list_datalinks
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pcap_list_datalinks ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_pcap_list_datalinks || defined __stub___pcap_list_datalinks
-choke me
-#endif
+ ac_fn_c_check_func "$LINENO" "pcap_list_datalinks" "ac_cv_func_pcap_list_datalinks"
+if test "x$ac_cv_func_pcap_list_datalinks" = xyes; then :
+ $as_echo "#define HAVE_PCAP_LIST_DATALINKS 1" >>confdefs.h
-int
-main ()
-{
-return pcap_list_datalinks ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_pcap_list_datalinks=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_func_pcap_list_datalinks=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_pcap_list_datalinks" >&5
-echo "${ECHO_T}$ac_cv_func_pcap_list_datalinks" >&6; }
-if test $ac_cv_func_pcap_list_datalinks = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_PCAP_LIST_DATALINKS 1
-_ACEOF
-
-else
-
case " $LIBOBJS " in
*" datalinks.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS datalinks.$ac_objext"
@@ -9515,269 +5873,23 @@
fi
- { echo "$as_me:$LINENO: checking for pcap_set_datalink" >&5
-echo $ECHO_N "checking for pcap_set_datalink... $ECHO_C" >&6; }
-if test "${ac_cv_func_pcap_set_datalink+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define pcap_set_datalink to an innocuous variant, in case <limits.h> declares pcap_set_datalink.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define pcap_set_datalink innocuous_pcap_set_datalink
+ ac_fn_c_check_func "$LINENO" "pcap_set_datalink" "ac_cv_func_pcap_set_datalink"
+if test "x$ac_cv_func_pcap_set_datalink" = xyes; then :
+ $as_echo "#define HAVE_PCAP_SET_DATALINK 1" >>confdefs.h
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char pcap_set_datalink (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef pcap_set_datalink
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pcap_set_datalink ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_pcap_set_datalink || defined __stub___pcap_set_datalink
-choke me
-#endif
-
-int
-main ()
-{
-return pcap_set_datalink ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_pcap_set_datalink=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_pcap_set_datalink=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_pcap_set_datalink" >&5
-echo "${ECHO_T}$ac_cv_func_pcap_set_datalink" >&6; }
-if test $ac_cv_func_pcap_set_datalink = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_PCAP_SET_DATALINK 1
-_ACEOF
+ ac_fn_c_check_func "$LINENO" "pcap_datalink_name_to_val" "ac_cv_func_pcap_datalink_name_to_val"
+if test "x$ac_cv_func_pcap_datalink_name_to_val" = xyes; then :
-fi
+ $as_echo "#define HAVE_PCAP_DATALINK_NAME_TO_VAL 1" >>confdefs.h
- { echo "$as_me:$LINENO: checking for pcap_datalink_name_to_val" >&5
-echo $ECHO_N "checking for pcap_datalink_name_to_val... $ECHO_C" >&6; }
-if test "${ac_cv_func_pcap_datalink_name_to_val+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define pcap_datalink_name_to_val to an innocuous variant, in case <limits.h> declares pcap_datalink_name_to_val.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define pcap_datalink_name_to_val innocuous_pcap_datalink_name_to_val
+ ac_fn_c_check_func "$LINENO" "pcap_datalink_val_to_description" "ac_cv_func_pcap_datalink_val_to_description"
+if test "x$ac_cv_func_pcap_datalink_val_to_description" = xyes; then :
+ $as_echo "#define HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION 1" >>confdefs.h
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char pcap_datalink_name_to_val (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef pcap_datalink_name_to_val
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pcap_datalink_name_to_val ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_pcap_datalink_name_to_val || defined __stub___pcap_datalink_name_to_val
-choke me
-#endif
-
-int
-main ()
-{
-return pcap_datalink_name_to_val ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_pcap_datalink_name_to_val=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_func_pcap_datalink_name_to_val=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_pcap_datalink_name_to_val" >&5
-echo "${ECHO_T}$ac_cv_func_pcap_datalink_name_to_val" >&6; }
-if test $ac_cv_func_pcap_datalink_name_to_val = yes; then
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_PCAP_DATALINK_NAME_TO_VAL 1
-_ACEOF
-
- { echo "$as_me:$LINENO: checking for pcap_datalink_val_to_description" >&5
-echo $ECHO_N "checking for pcap_datalink_val_to_description... $ECHO_C" >&6; }
-if test "${ac_cv_func_pcap_datalink_val_to_description+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define pcap_datalink_val_to_description to an innocuous variant, in case <limits.h> declares pcap_datalink_val_to_description.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define pcap_datalink_val_to_description innocuous_pcap_datalink_val_to_description
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char pcap_datalink_val_to_description (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef pcap_datalink_val_to_description
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pcap_datalink_val_to_description ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_pcap_datalink_val_to_description || defined __stub___pcap_datalink_val_to_description
-choke me
-#endif
-
-int
-main ()
-{
-return pcap_datalink_val_to_description ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_pcap_datalink_val_to_description=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_func_pcap_datalink_val_to_description=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_pcap_datalink_val_to_description" >&5
-echo "${ECHO_T}$ac_cv_func_pcap_datalink_val_to_description" >&6; }
-if test $ac_cv_func_pcap_datalink_val_to_description = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION 1
-_ACEOF
-
-else
-
case " $LIBOBJS " in
*" dlnames.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS dlnames.$ac_objext"
@@ -9800,95 +5912,12 @@
fi
-
-for ac_func in pcap_breakloop
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ for ac_func in pcap_breakloop
+do :
+ ac_fn_c_check_func "$LINENO" "pcap_breakloop" "ac_cv_func_pcap_breakloop"
+if test "x$ac_cv_func_pcap_breakloop" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_PCAP_BREAKLOOP 1
_ACEOF
fi
@@ -9895,94 +5924,12 @@
done
- { echo "$as_me:$LINENO: checking for pcap_dump_ftell" >&5
-echo $ECHO_N "checking for pcap_dump_ftell... $ECHO_C" >&6; }
-if test "${ac_cv_func_pcap_dump_ftell+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define pcap_dump_ftell to an innocuous variant, in case <limits.h> declares pcap_dump_ftell.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define pcap_dump_ftell innocuous_pcap_dump_ftell
+ ac_fn_c_check_func "$LINENO" "pcap_dump_ftell" "ac_cv_func_pcap_dump_ftell"
+if test "x$ac_cv_func_pcap_dump_ftell" = xyes; then :
+ $as_echo "#define HAVE_PCAP_DUMP_FTELL 1" >>confdefs.h
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char pcap_dump_ftell (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef pcap_dump_ftell
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pcap_dump_ftell ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_pcap_dump_ftell || defined __stub___pcap_dump_ftell
-choke me
-#endif
-
-int
-main ()
-{
-return pcap_dump_ftell ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_func_pcap_dump_ftell=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_func_pcap_dump_ftell=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_pcap_dump_ftell" >&5
-echo "${ECHO_T}$ac_cv_func_pcap_dump_ftell" >&6; }
-if test $ac_cv_func_pcap_dump_ftell = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_PCAP_DUMP_FTELL 1
-_ACEOF
-
-else
-
case " $LIBOBJS " in
*" pcap_dump_ftell.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS pcap_dump_ftell.$ac_objext"
@@ -10006,13 +5953,9 @@
# "_inet_ntop()", and has a #define macro in one of the system headers
# to rename it.
#
-{ echo "$as_me:$LINENO: checking for inet_ntop" >&5
-echo $ECHO_N "checking for inet_ntop... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop" >&5
+$as_echo_n "checking for inet_ntop... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/socket.h>
@@ -10027,32 +5970,12 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
case " $LIBOBJS " in
*" inet_ntop.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS inet_ntop.$ac_objext"
@@ -10060,16 +5983,11 @@
esac
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-{ echo "$as_me:$LINENO: checking for inet_pton" >&5
-echo $ECHO_N "checking for inet_pton... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton" >&5
+$as_echo_n "checking for inet_pton... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/socket.h>
@@ -10084,32 +6002,12 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
case " $LIBOBJS " in
*" inet_pton.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS inet_pton.$ac_objext"
@@ -10117,16 +6015,11 @@
esac
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-{ echo "$as_me:$LINENO: checking for inet_aton" >&5
-echo $ECHO_N "checking for inet_aton... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton" >&5
+$as_echo_n "checking for inet_aton... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
#include <netinet/in.h>
@@ -10141,32 +6034,12 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+if ac_fn_c_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
case " $LIBOBJS " in
*" inet_aton.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS inet_aton.$ac_objext"
@@ -10174,10 +6047,9 @@
esac
fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-
#
# Check for these after AC_LBL_LIBPCAP, for the same reason.
#
@@ -10191,111 +6063,24 @@
#
# Before you is a C compiler.
#
-
for ac_func in ether_ntohost
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+do :
+ ac_fn_c_check_func "$LINENO" "ether_ntohost" "ac_cv_func_ether_ntohost"
+if test "x$ac_cv_func_ether_ntohost" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_ETHER_NTOHOST 1
_ACEOF
- { echo "$as_me:$LINENO: checking for buggy ether_ntohost" >&5
-echo $ECHO_N "checking for buggy ether_ntohost... $ECHO_C" >&6; }
-if test "${ac_cv_buggy_ether_ntohost+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for buggy ether_ntohost" >&5
+$as_echo_n "checking for buggy ether_ntohost... " >&6; }
+if ${ac_cv_buggy_ether_ntohost+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- if test "$cross_compiling" = yes; then
+ if test "$cross_compiling" = yes; then :
ac_cv_buggy_ether_ntohost="not while cross-compiling"
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <netdb.h>
@@ -10314,46 +6099,20 @@
}
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
ac_cv_buggy_ether_ntohost=no
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_buggy_ether_ntohost=yes
+ ac_cv_buggy_ether_ntohost=yes
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_buggy_ether_ntohost" >&5
-echo "${ECHO_T}$ac_cv_buggy_ether_ntohost" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_buggy_ether_ntohost" >&5
+$as_echo "$ac_cv_buggy_ether_ntohost" >&6; }
if test "$ac_cv_buggy_ether_ntohost" = "no"; then
- cat >>confdefs.h <<\_ACEOF
-#define USE_ETHER_NTOHOST 1
-_ACEOF
+ $as_echo "#define USE_ETHER_NTOHOST 1" >>confdefs.h
fi
@@ -10369,18 +6128,7 @@
#
# Yes. Does it declare ether_ntohost()?
#
- { echo "$as_me:$LINENO: checking whether ether_ntohost is declared" >&5
-echo $ECHO_N "checking whether ether_ntohost is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_ether_ntohost+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
+ ac_fn_c_check_decl "$LINENO" "ether_ntohost" "ac_cv_have_decl_ether_ntohost" "
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -10390,57 +6138,15 @@
#include <net/if.h>
#include <netinet/if_ether.h>
+"
+if test "x$ac_cv_have_decl_ether_ntohost" = xyes; then :
-int
-main ()
-{
-#ifndef ether_ntohost
- (void) ether_ntohost;
-#endif
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_ether_ntohost=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+$as_echo "#define NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST /**/" >>confdefs.h
- ac_cv_have_decl_ether_ntohost=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_ether_ntohost" >&5
-echo "${ECHO_T}$ac_cv_have_decl_ether_ntohost" >&6; }
-if test $ac_cv_have_decl_ether_ntohost = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define NETINET_IF_ETHER_H_DECLARES_ETHER_NTOHOST
-_ACEOF
-
-
-fi
-
fi
#
# Did that succeed?
@@ -10449,140 +6155,12 @@
#
# No, how about <netinet/ether.h>, as on Linux?
#
-
-for ac_header in netinet/ether.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ for ac_header in netinet/ether.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "netinet/ether.h" "ac_cv_header_netinet_ether_h" "$ac_includes_default"
+if test "x$ac_cv_header_netinet_ether_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_NETINET_ETHER_H 1
_ACEOF
fi
@@ -10597,71 +6175,18 @@
# suppress the next test.
#
unset ac_cv_have_decl_ether_ntohost
- { echo "$as_me:$LINENO: checking whether ether_ntohost is declared" >&5
-echo $ECHO_N "checking whether ether_ntohost is declared... $ECHO_C" >&6; }
-if test "${ac_cv_have_decl_ether_ntohost+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
+ ac_fn_c_check_decl "$LINENO" "ether_ntohost" "ac_cv_have_decl_ether_ntohost" "
#include <netinet/ether.h>
+"
+if test "x$ac_cv_have_decl_ether_ntohost" = xyes; then :
-int
-main ()
-{
-#ifndef ether_ntohost
- (void) ether_ntohost;
-#endif
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl_ether_ntohost=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+$as_echo "#define NETINET_ETHER_H_DECLARES_ETHER_NTOHOST /**/" >>confdefs.h
- ac_cv_have_decl_ether_ntohost=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_ether_ntohost" >&5
-echo "${ECHO_T}$ac_cv_have_decl_ether_ntohost" >&6; }
-if test $ac_cv_have_decl_ether_ntohost = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define NETINET_ETHER_H_DECLARES_ETHER_NTOHOST
-_ACEOF
-
-
-fi
-
fi
fi
#
@@ -10672,18 +6197,7 @@
# No, we'll have to declare it ourselves.
# Do we have "struct ether_addr"?
#
- { echo "$as_me:$LINENO: checking for struct ether_addr" >&5
-echo $ECHO_N "checking for struct ether_addr... $ECHO_C" >&6; }
-if test "${ac_cv_type_struct_ether_addr+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
+ ac_fn_c_check_type "$LINENO" "struct ether_addr" "ac_cv_type_struct_ether_addr" "
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -10693,50 +6207,9 @@
#include <net/if.h>
#include <netinet/if_ether.h>
+"
+if test "x$ac_cv_type_struct_ether_addr" = xyes; then :
-typedef struct ether_addr ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_struct_ether_addr=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_struct_ether_addr=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_ether_addr" >&5
-echo "${ECHO_T}$ac_cv_type_struct_ether_addr" >&6; }
-if test $ac_cv_type_struct_ether_addr = yes; then
-
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_ETHER_ADDR 1
_ACEOF
@@ -10745,30 +6218,64 @@
fi
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DECL_ETHER_NTOHOST 0
-_ACEOF
+$as_echo "#define HAVE_DECL_ETHER_NTOHOST 0" >>confdefs.h
else
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_DECL_ETHER_NTOHOST 1
-_ACEOF
+$as_echo "#define HAVE_DECL_ETHER_NTOHOST 1" >>confdefs.h
fi
fi
+# libdlpi is needed for Solaris 11 and later.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlpi_walk in -ldlpi" >&5
+$as_echo_n "checking for dlpi_walk in -ldlpi... " >&6; }
+if ${ac_cv_lib_dlpi_dlpi_walk+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldlpi -L/lib $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
- { echo "$as_me:$LINENO: checking if sockaddr struct has sa_len member" >&5
-echo $ECHO_N "checking if sockaddr struct has sa_len member... $ECHO_C" >&6; }
- if test "${ac_cv_sockaddr_has_sa_len+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlpi_walk ();
+int
+main ()
+{
+return dlpi_walk ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dlpi_dlpi_walk=yes
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ ac_cv_lib_dlpi_dlpi_walk=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dlpi_dlpi_walk" >&5
+$as_echo "$ac_cv_lib_dlpi_dlpi_walk" >&6; }
+if test "x$ac_cv_lib_dlpi_dlpi_walk" = xyes; then :
+ LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS"
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sockaddr struct has sa_len member" >&5
+$as_echo_n "checking if sockaddr struct has sa_len member... " >&6; }
+ if ${ac_cv_sockaddr_has_sa_len+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# include <sys/types.h>
@@ -10781,40 +6288,18 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_sockaddr_has_sa_len=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_sockaddr_has_sa_len=no
+ ac_cv_sockaddr_has_sa_len=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
- { echo "$as_me:$LINENO: result: $ac_cv_sockaddr_has_sa_len" >&5
-echo "${ECHO_T}$ac_cv_sockaddr_has_sa_len" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sockaddr_has_sa_len" >&5
+$as_echo "$ac_cv_sockaddr_has_sa_len" >&6; }
if test $ac_cv_sockaddr_has_sa_len = yes ; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SOCKADDR_SA_LEN 1
-_ACEOF
+ $as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h
fi
@@ -10822,97 +6307,47 @@
missing_includes=yes
fi
-
-
-
-for ac_func in pcap_findalldevs pcap_dump_flush pcap_lib_version
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
+#
+# Do we have the new open API? Check for pcap_create, and assume that,
+# if we do, we also have pcap_activate() and the other new routines
+# introduced in libpcap 1.0.0.
+#
+for ac_func in pcap_create
+do :
+ ac_fn_c_check_func "$LINENO" "pcap_create" "ac_cv_func_pcap_create"
+if test "x$ac_cv_func_pcap_create" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_CREATE 1
_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
+fi
+done
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
+if test $ac_cv_func_pcap_create = "yes" ; then
+ #
+ # OK, do we have pcap_set_tstamp_type? If so, assume we have
+ # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
+ #
+ for ac_func in pcap_set_tstamp_type
+do :
+ ac_fn_c_check_func "$LINENO" "pcap_set_tstamp_type" "ac_cv_func_pcap_set_tstamp_type"
+if test "x$ac_cv_func_pcap_set_tstamp_type" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_SET_TSTAMP_TYPE 1
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- eval "$as_ac_var=no"
fi
+done
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+
+for ac_func in pcap_findalldevs pcap_dump_flush pcap_lib_version
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
@@ -10919,64 +6354,12 @@
done
if test $ac_cv_func_pcap_findalldevs = "yes" ; then
- savedcflags="$CFLAGS"
- CFLAGS="$CFLAGS $V_INCLS"
- { echo "$as_me:$LINENO: checking for pcap_if_t" >&5
-echo $ECHO_N "checking for pcap_if_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_pcap_if_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <pcap.h>
+ savedcppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $V_INCLS"
+ ac_fn_c_check_type "$LINENO" "pcap_if_t" "ac_cv_type_pcap_if_t" "#include <pcap.h>
+"
+if test "x$ac_cv_type_pcap_if_t" = xyes; then :
-typedef pcap_if_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_pcap_if_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_type_pcap_if_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_pcap_if_t" >&5
-echo "${ECHO_T}$ac_cv_type_pcap_if_t" >&6; }
-if test $ac_cv_type_pcap_if_t = yes; then
-
cat >>confdefs.h <<_ACEOF
#define HAVE_PCAP_IF_T 1
_ACEOF
@@ -10984,17 +6367,13 @@
fi
- CFLAGS="$savedcflags"
+ CPPFLAGS="$savedcppflags"
fi
if test $ac_cv_func_pcap_lib_version = "no" ; then
- { echo "$as_me:$LINENO: checking whether pcap_version is defined by libpcap" >&5
-echo $ECHO_N "checking whether pcap_version is defined by libpcap... $ECHO_C" >&6; }
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pcap_version is defined by libpcap" >&5
+$as_echo_n "checking whether pcap_version is defined by libpcap... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -11009,53 +6388,26 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_lbl_cv_pcap_version_defined=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lbl_cv_pcap_version_defined=no
+ ac_lbl_cv_pcap_version_defined=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test "$ac_lbl_cv_pcap_version_defined" = yes ; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_PCAP_VERSION 1
-_ACEOF
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ $as_echo "#define HAVE_PCAP_VERSION 1" >>confdefs.h
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
fi
-{ echo "$as_me:$LINENO: checking whether pcap_debug is defined by libpcap" >&5
-echo $ECHO_N "checking whether pcap_debug is defined by libpcap... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pcap_debug is defined by libpcap" >&5
+$as_echo_n "checking whether pcap_debug is defined by libpcap... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -11070,54 +6422,27 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_lbl_cv_pcap_debug_defined=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lbl_cv_pcap_debug_defined=no
+ ac_lbl_cv_pcap_debug_defined=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test "$ac_lbl_cv_pcap_debug_defined" = yes ; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_PCAP_DEBUG 1
-_ACEOF
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ $as_echo "#define HAVE_PCAP_DEBUG 1" >>confdefs.h
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
#
# OK, what about "yydebug"?
#
- { echo "$as_me:$LINENO: checking whether yydebug is defined by libpcap" >&5
-echo $ECHO_N "checking whether yydebug is defined by libpcap... $ECHO_C" >&6; }
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yydebug is defined by libpcap" >&5
+$as_echo_n "checking whether yydebug is defined by libpcap... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -11132,146 +6457,35 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_lbl_cv_yydebug_defined=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_lbl_cv_yydebug_defined=no
+ ac_lbl_cv_yydebug_defined=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
if test "$ac_lbl_cv_yydebug_defined" = yes ; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_YYDEBUG 1
-_ACEOF
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ $as_echo "#define HAVE_YYDEBUG 1" >>confdefs.h
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
fi
+ac_fn_c_check_func "$LINENO" "bpf_dump" "ac_cv_func_bpf_dump"
+if test "x$ac_cv_func_bpf_dump" = xyes; then :
+ $as_echo "#define HAVE_BPF_DUMP 1" >>confdefs.h
-for ac_func in bpf_dump
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
-choke me
-#endif
-
-int
-main ()
-{
-return $ac_func ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_var=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-else
case " $LIBOBJS " in
- *" $ac_func.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
+ *" bpf_dump.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS bpf_dump.$ac_objext"
;;
esac
fi
-done
V_GROUP=0
@@ -11278,25 +6492,56 @@
if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
V_GROUP=wheel
fi
+#
+# Assume V7/BSD convention for man pages (file formats in section 5,
+# miscellaneous info in section 7).
+#
+MAN_FILE_FORMATS=5
+MAN_MISC_INFO=7
case "$host_os" in
aix*)
- cat >>confdefs.h <<\_ACEOF
-#define _SUN 1
-_ACEOF
+$as_echo "#define _SUN 1" >>confdefs.h
+
;;
+hpux*)
+ #
+ # Use System V conventions for man pages.
+ #
+ MAN_FILE_FORMATS=4
+ MAN_MISC_INFO=5
+ ;;
+
irix*)
V_GROUP=sys
+
+ #
+ # Use System V conventions for man pages.
+ #
+ MAN_FILE_FORMATS=4
+ MAN_MISC_INFO=5
;;
osf*)
V_GROUP=system
+
+ #
+ # Use System V conventions for man pages.
+ #
+ MAN_FILE_FORMATS=4
+ MAN_MISC_INFO=5
;;
solaris*)
V_GROUP=sys
+
+ #
+ # Use System V conventions for man pages.
+ #
+ MAN_FILE_FORMATS=4
+ MAN_MISC_INFO=5
;;
esac
@@ -11304,140 +6549,12 @@
V_GROUP=bpf
fi
-
for ac_header in sys/bitypes.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "sys/bitypes.h" "ac_cv_header_sys_bitypes_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_bitypes_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_SYS_BITYPES_H 1
_ACEOF
fi
@@ -11445,680 +6562,132 @@
done
-{ echo "$as_me:$LINENO: checking for int8_t" >&5
-echo $ECHO_N "checking for int8_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_int8_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef int8_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_int8_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "$ac_includes_default
+#ifdef HAVE_SYS_BITYPES_H
+#include <sys/bitypes.h>
+#endif
+"
+if test "x$ac_cv_type_int8_t" = xyes; then :
- ac_cv_type_int8_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_int8_t" >&5
-echo "${ECHO_T}$ac_cv_type_int8_t" >&6; }
-if test $ac_cv_type_int8_t = yes; then
- :
else
-cat >>confdefs.h <<\_ACEOF
-#define int8_t signed char
-_ACEOF
+$as_echo "#define int8_t signed char" >>confdefs.h
fi
-{ echo "$as_me:$LINENO: checking for u_int8_t" >&5
-echo $ECHO_N "checking for u_int8_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_u_int8_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
+ac_fn_c_check_type "$LINENO" "u_int8_t" "ac_cv_type_u_int8_t" "$ac_includes_default
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif
+"
+if test "x$ac_cv_type_u_int8_t" = xyes; then :
-typedef u_int8_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_u_int8_t=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_u_int8_t=no
-fi
+$as_echo "#define u_int8_t unsigned char" >>confdefs.h
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int8_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int8_t" >&6; }
-if test $ac_cv_type_u_int8_t = yes; then
- :
-else
-cat >>confdefs.h <<\_ACEOF
-#define u_int8_t unsigned char
-_ACEOF
+ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "$ac_includes_default"
+if test "x$ac_cv_type_int16_t" = xyes; then :
-fi
-
-{ echo "$as_me:$LINENO: checking for int16_t" >&5
-echo $ECHO_N "checking for int16_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_int16_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef int16_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_int16_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_int16_t=no
-fi
+$as_echo "#define int16_t short" >>confdefs.h
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ $ac_includes_default
+#ifdef HAVE_SYS_BITYPES_H
+#include <sys/bitypes.h>
+#endif
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5
-echo "${ECHO_T}$ac_cv_type_int16_t" >&6; }
-if test $ac_cv_type_int16_t = yes; then
- :
-else
-cat >>confdefs.h <<\_ACEOF
-#define int16_t short
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for u_int16_t" >&5
-echo $ECHO_N "checking for u_int16_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_u_int16_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
+ac_fn_c_check_type "$LINENO" "u_int16_t" "ac_cv_type_u_int16_t" "$ac_includes_default
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif
+"
+if test "x$ac_cv_type_u_int16_t" = xyes; then :
-typedef u_int16_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_u_int16_t=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_u_int16_t=no
-fi
+$as_echo "#define u_int16_t unsigned short" >>confdefs.h
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int16_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int16_t" >&6; }
-if test $ac_cv_type_u_int16_t = yes; then
- :
-else
-cat >>confdefs.h <<\_ACEOF
-#define u_int16_t unsigned short
-_ACEOF
+ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "$ac_includes_default
+#ifdef HAVE_SYS_BITYPES_H
+#include <sys/bitypes.h>
+#endif
+"
+if test "x$ac_cv_type_int32_t" = xyes; then :
-fi
-
-{ echo "$as_me:$LINENO: checking for int32_t" >&5
-echo $ECHO_N "checking for int32_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_int32_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef int32_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_int32_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_int32_t=no
-fi
+$as_echo "#define int32_t int" >>confdefs.h
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5
-echo "${ECHO_T}$ac_cv_type_int32_t" >&6; }
-if test $ac_cv_type_int32_t = yes; then
- :
-else
-cat >>confdefs.h <<\_ACEOF
-#define int32_t int
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for u_int32_t" >&5
-echo $ECHO_N "checking for u_int32_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_u_int32_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
+ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "$ac_includes_default
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif
+"
+if test "x$ac_cv_type_u_int32_t" = xyes; then :
-typedef u_int32_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_u_int32_t=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_u_int32_t=no
-fi
+$as_echo "#define u_int32_t unsigned int" >>confdefs.h
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int32_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int32_t" >&6; }
-if test $ac_cv_type_u_int32_t = yes; then
- :
-else
-cat >>confdefs.h <<\_ACEOF
-#define u_int32_t unsigned int
-_ACEOF
+ac_fn_c_check_type "$LINENO" "int64_t" "ac_cv_type_int64_t" "$ac_includes_default
+#ifdef HAVE_SYS_BITYPES_H
+#include <sys/bitypes.h>
+#endif
+"
+if test "x$ac_cv_type_int64_t" = xyes; then :
-fi
-
-{ echo "$as_me:$LINENO: checking for int64_t" >&5
-echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_int64_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-typedef int64_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_int64_t=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_int64_t=no
-fi
+$as_echo "#define int64_t long long" >>confdefs.h
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5
-echo "${ECHO_T}$ac_cv_type_int64_t" >&6; }
-if test $ac_cv_type_int64_t = yes; then
- :
-else
-cat >>confdefs.h <<\_ACEOF
-#define int64_t long long
-_ACEOF
-
-fi
-
-{ echo "$as_me:$LINENO: checking for u_int64_t" >&5
-echo $ECHO_N "checking for u_int64_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_u_int64_t+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
+ac_fn_c_check_type "$LINENO" "u_int64_t" "ac_cv_type_u_int64_t" "$ac_includes_default
#ifdef HAVE_SYS_BITYPES_H
#include <sys/bitypes.h>
#endif
+"
+if test "x$ac_cv_type_u_int64_t" = xyes; then :
-typedef u_int64_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
- return 0;
-if (sizeof (ac__type_new_))
- return 0;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_u_int64_t=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_u_int64_t=no
-fi
+$as_echo "#define u_int64_t unsigned long long" >>confdefs.h
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_u_int64_t" >&5
-echo "${ECHO_T}$ac_cv_type_u_int64_t" >&6; }
-if test $ac_cv_type_u_int64_t = yes; then
- :
-else
-cat >>confdefs.h <<\_ACEOF
-#define u_int64_t unsigned long long
-_ACEOF
-fi
-
-
#
# We can't just check for <inttypes.h> - some systems have one that
# doesn't define all the PRI[doxu]64 macros.
#
-
for ac_header in inttypes.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
+if test "x$ac_cv_header_inttypes_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_INTTYPES_H 1
_ACEOF
#
# OK, we have inttypes.h, but does it define those macros?
#
- { echo "$as_me:$LINENO: checking whether inttypes.h defines the PRI[doxu]64 macros" >&5
-echo $ECHO_N "checking whether inttypes.h defines the PRI[doxu]64 macros... $ECHO_C" >&6; }
- cat >conftest.$ac_ext <<_ACEOF
-
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inttypes.h defines the PRI[doxu]64 macros" >&5
+$as_echo_n "checking whether inttypes.h defines the PRI[doxu]64 macros... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+
#include <inttypes.h>
#include <stdio.h>
#include <sys/types.h>
@@ -12136,39 +6705,19 @@
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
ac_lbl_inttypes_h_defines_formats=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
ac_lbl_inttypes_h_defines_formats=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
@@ -12185,23 +6734,18 @@
if test "$ac_lbl_inttypes_h_defines_formats" = no; then
- { echo "$as_me:$LINENO: checking whether %lx can be used to format 64-bit integers" >&5
-echo $ECHO_N "checking whether %lx can be used to format 64-bit integers... $ECHO_C" >&6; }
- if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether %lx can be used to format 64-bit integers" >&5
+$as_echo_n "checking whether %lx can be used to format 64-bit integers... " >&6; }
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
else
- cat >conftest.$ac_ext <<_ACEOF
-
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
# endif
@@ -12224,74 +6768,37 @@
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
- cat >>confdefs.h <<\_ACEOF
-#define PRId64 "ld"
-_ACEOF
+ $as_echo "#define PRId64 \"ld\"" >>confdefs.h
- cat >>confdefs.h <<\_ACEOF
-#define PRIo64 "lo"
-_ACEOF
+ $as_echo "#define PRIo64 \"lo\"" >>confdefs.h
- cat >>confdefs.h <<\_ACEOF
-#define PRIx64 "lx"
-_ACEOF
+ $as_echo "#define PRIx64 \"lx\"" >>confdefs.h
- cat >>confdefs.h <<\_ACEOF
-#define PRIu64 "lu"
-_ACEOF
+ $as_echo "#define PRIu64 \"lu\"" >>confdefs.h
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-( exit $ac_status )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
- { echo "$as_me:$LINENO: checking whether %llx can be used to format 64-bit integers" >&5
-echo $ECHO_N "checking whether %llx can be used to format 64-bit integers... $ECHO_C" >&6; }
- if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether %llx can be used to format 64-bit integers" >&5
+$as_echo_n "checking whether %llx can be used to format 64-bit integers... " >&6; }
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
else
- cat >conftest.$ac_ext <<_ACEOF
-
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
# endif
@@ -12314,74 +6821,37 @@
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
- cat >>confdefs.h <<\_ACEOF
-#define PRId64 "lld"
-_ACEOF
+ $as_echo "#define PRId64 \"lld\"" >>confdefs.h
- cat >>confdefs.h <<\_ACEOF
-#define PRIo64 "llo"
-_ACEOF
+ $as_echo "#define PRIo64 \"llo\"" >>confdefs.h
- cat >>confdefs.h <<\_ACEOF
-#define PRIx64 "llx"
-_ACEOF
+ $as_echo "#define PRIx64 \"llx\"" >>confdefs.h
- cat >>confdefs.h <<\_ACEOF
-#define PRIu64 "llu"
-_ACEOF
+ $as_echo "#define PRIu64 \"llu\"" >>confdefs.h
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-( exit $ac_status )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
- { echo "$as_me:$LINENO: checking whether %Lx can be used to format 64-bit integers" >&5
-echo $ECHO_N "checking whether %Lx can be used to format 64-bit integers... $ECHO_C" >&6; }
- if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether %Lx can be used to format 64-bit integers" >&5
+$as_echo_n "checking whether %Lx can be used to format 64-bit integers... " >&6; }
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
else
- cat >conftest.$ac_ext <<_ACEOF
-
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
# endif
@@ -12404,74 +6874,37 @@
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
- cat >>confdefs.h <<\_ACEOF
-#define PRId64 "Ld"
-_ACEOF
+ $as_echo "#define PRId64 \"Ld\"" >>confdefs.h
- cat >>confdefs.h <<\_ACEOF
-#define PRIo64 "Lo"
-_ACEOF
+ $as_echo "#define PRIo64 \"Lo\"" >>confdefs.h
- cat >>confdefs.h <<\_ACEOF
-#define PRIx64 "Lx"
-_ACEOF
+ $as_echo "#define PRIx64 \"Lx\"" >>confdefs.h
- cat >>confdefs.h <<\_ACEOF
-#define PRIu64 "Lu"
-_ACEOF
+ $as_echo "#define PRIu64 \"Lu\"" >>confdefs.h
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-( exit $ac_status )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-
- { echo "$as_me:$LINENO: checking whether %qx can be used to format 64-bit integers" >&5
-echo $ECHO_N "checking whether %qx can be used to format 64-bit integers... $ECHO_C" >&6; }
- if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether %qx can be used to format 64-bit integers" >&5
+$as_echo_n "checking whether %qx can be used to format 64-bit integers... " >&6; }
+ if test "$cross_compiling" = yes; then :
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
else
- cat >conftest.$ac_ext <<_ACEOF
-
- /* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+
# ifdef HAVE_INTTYPES_H
#include <inttypes.h>
# endif
@@ -12494,93 +6927,189 @@
_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+if ac_fn_c_try_run "$LINENO"; then :
- cat >>confdefs.h <<\_ACEOF
-#define PRId64 "qd"
-_ACEOF
+ $as_echo "#define PRId64 \"qd\"" >>confdefs.h
- cat >>confdefs.h <<\_ACEOF
-#define PRIo64 "qo"
-_ACEOF
+ $as_echo "#define PRIo64 \"qo\"" >>confdefs.h
- cat >>confdefs.h <<\_ACEOF
-#define PRIx64 "qx"
-_ACEOF
+ $as_echo "#define PRIx64 \"qx\"" >>confdefs.h
- cat >>confdefs.h <<\_ACEOF
-#define PRIu64 "qu"
-_ACEOF
+ $as_echo "#define PRIu64 \"qu\"" >>confdefs.h
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
else
- echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-( exit $ac_status )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ as_fn_error $? "neither %llx nor %Lx nor %qx worked on a 64-bit integer" "$LINENO" 5
- { { echo "$as_me:$LINENO: error: neither %llx nor %Lx nor %qx worked on a 64-bit integer" >&5
-echo "$as_me: error: neither %llx nor %Lx nor %qx worked on a 64-bit integer" >&2;}
- { (exit 1); exit 1; }; }
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
-
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+
+#
+# Check for some headers introduced in later versions of libpcap
+# and used by some printers.
+#
+# Those headers use the {u_}intN_t types, so we must do this after
+# we check for what's needed to get them defined.
+#
+savedcppflags="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $V_INCLS"
+for ac_header in pcap/bluetooth.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "pcap/bluetooth.h" "ac_cv_header_pcap_bluetooth_h" "#include <tcpdump-stdinc.h>
+"
+if test "x$ac_cv_header_pcap_bluetooth_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_BLUETOOTH_H 1
+_ACEOF
+
fi
+done
+for ac_header in pcap/usb.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "pcap/usb.h" "ac_cv_header_pcap_usb_h" "#include <tcpdump-stdinc.h>
+"
+if test "x$ac_cv_header_pcap_usb_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PCAP_USB_H 1
+_ACEOF
+fi
+done
+CPPFLAGS="$savedcppflags"
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
rm -f os-proto.h
if test "${LBL_CFLAGS+set}" = set; then
V_CCOPT="$V_CCOPT ${LBL_CFLAGS}"
@@ -12611,26 +7140,21 @@
name="lbl/os-$os.h"
if test -f $name ; then
ln -s $name os-proto.h
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_OS_PROTO_H 1
-_ACEOF
+$as_echo "#define HAVE_OS_PROTO_H 1" >>confdefs.h
+
else
- { echo "$as_me:$LINENO: WARNING: can't find $name" >&5
-echo "$as_me: WARNING: can't find $name" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: can't find $name" >&5
+$as_echo "$as_me: WARNING: can't find $name" >&2;}
fi
fi
-{ echo "$as_me:$LINENO: checking if sockaddr struct has sa_len member" >&5
-echo $ECHO_N "checking if sockaddr struct has sa_len member... $ECHO_C" >&6; }
- if test "${ac_cv_lbl_sockaddr_has_sa_len+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sockaddr struct has the sa_len member" >&5
+$as_echo_n "checking if sockaddr struct has the sa_len member... " >&6; }
+ if ${ac_cv_lbl_sockaddr_has_sa_len+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# include <sys/types.h>
@@ -12643,47 +7167,26 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_lbl_sockaddr_has_sa_len=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lbl_sockaddr_has_sa_len=no
+ ac_cv_lbl_sockaddr_has_sa_len=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
- { echo "$as_me:$LINENO: result: $ac_cv_lbl_sockaddr_has_sa_len" >&5
-echo "${ECHO_T}$ac_cv_lbl_sockaddr_has_sa_len" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_sockaddr_has_sa_len" >&5
+$as_echo "$ac_cv_lbl_sockaddr_has_sa_len" >&6; }
if test $ac_cv_lbl_sockaddr_has_sa_len = yes ; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_SOCKADDR_SA_LEN 1
-_ACEOF
+$as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h
+
fi
-{ echo "$as_me:$LINENO: checking if unaligned accesses fail" >&5
-echo $ECHO_N "checking if unaligned accesses fail... $ECHO_C" >&6; }
- if test "${ac_cv_lbl_unaligned_fail+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if unaligned accesses fail" >&5
+$as_echo_n "checking if unaligned accesses fail... " >&6; }
+ if ${ac_cv_lbl_unaligned_fail+:} false; then :
+ $as_echo_n "(cached) " >&6
else
case "$host_cpu" in
@@ -12719,7 +7222,7 @@
# 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)
+ alpha*|arm*|bfin*|hp*|mips*|sh*|sparc*|ia64|nv1)
ac_cv_lbl_unaligned_fail=yes
;;
@@ -12762,31 +7265,26 @@
ac_cv_lbl_unaligned_fail=no
fi
fi
- rm -f conftest* core core.conftest
+ rm -f -r conftest* core core.conftest
;;
esac
fi
- { echo "$as_me:$LINENO: result: $ac_cv_lbl_unaligned_fail" >&5
-echo "${ECHO_T}$ac_cv_lbl_unaligned_fail" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_unaligned_fail" >&5
+$as_echo "$ac_cv_lbl_unaligned_fail" >&6; }
if test $ac_cv_lbl_unaligned_fail = yes ; then
- cat >>confdefs.h <<\_ACEOF
-#define LBL_ALIGN 1
-_ACEOF
+$as_echo "#define LBL_ALIGN 1" >>confdefs.h
+
fi
- { echo "$as_me:$LINENO: checking for h_errno" >&5
-echo $ECHO_N "checking for h_errno... $ECHO_C" >&6; }
- if test "${ac_cv_var_h_errno+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for h_errno" >&5
+$as_echo_n "checking for h_errno... " >&6; }
+ if ${ac_cv_var_h_errno+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# include <sys/types.h>
@@ -12799,116 +7297,63 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_var_h_errno=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_var_h_errno=no
+ ac_cv_var_h_errno=no
fi
-
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
- { echo "$as_me:$LINENO: result: $ac_cv_var_h_errno" >&5
-echo "${ECHO_T}$ac_cv_var_h_errno" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_h_errno" >&5
+$as_echo "$ac_cv_var_h_errno" >&6; }
if test "$ac_cv_var_h_errno" = "yes"; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_H_ERRNO 1
-_ACEOF
+ $as_echo "#define HAVE_H_ERRNO 1" >>confdefs.h
fi
+# Check for OpenSSL libcrypto
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use OpenSSL libcrypto" >&5
+$as_echo_n "checking whether to use OpenSSL libcrypto... " >&6; }
+# Specify location for both includes and libraries.
+want_libcrypto=ifavailable
# Check whether --with-crypto was given.
-if test "${with_crypto+set}" = set; then
+if test "${with_crypto+set}" = set; then :
withval=$with_crypto;
+ if test $withval = no
+ then
+ want_libcrypto=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ elif test $withval = yes
+ then
+ want_libcrypto=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ fi
+
else
-{ echo "$as_me:$LINENO: checking for SSLeay" >&5
-echo $ECHO_N "checking for SSLeay... $ECHO_C" >&6; }
-ac_cv_ssleay_path=no
-incdir=no
+ #
+ # Use libcrypto if it's present, otherwise don't.
+ #
+ want_libcrypto=ifavailable
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, if available" >&5
+$as_echo "yes, if available" >&6; }
-#
-# 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
-{ echo "$as_me:$LINENO: result: $ac_cv_ssleay_path" >&5
-echo "${ECHO_T}$ac_cv_ssleay_path" >&6; }
-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
-
-{ echo "$as_me:$LINENO: checking for DES_cbc_encrypt in -lcrypto" >&5
-echo $ECHO_N "checking for DES_cbc_encrypt in -lcrypto... $ECHO_C" >&6; }
-if test "${ac_cv_lib_crypto_DES_cbc_encrypt+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if test "$want_libcrypto" != "no"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DES_cbc_encrypt in -lcrypto" >&5
+$as_echo_n "checking for DES_cbc_encrypt in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_DES_cbc_encrypt+:} false; then :
+ $as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcrypto $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
@@ -12926,39 +7371,18 @@
return 0;
}
_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_crypto_DES_cbc_encrypt=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_crypto_DES_cbc_encrypt=no
+ ac_cv_lib_crypto_DES_cbc_encrypt=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_DES_cbc_encrypt" >&5
-echo "${ECHO_T}$ac_cv_lib_crypto_DES_cbc_encrypt" >&6; }
-if test $ac_cv_lib_crypto_DES_cbc_encrypt = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_DES_cbc_encrypt" >&5
+$as_echo "$ac_cv_lib_crypto_DES_cbc_encrypt" >&6; }
+if test "x$ac_cv_lib_crypto_DES_cbc_encrypt" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBCRYPTO 1
_ACEOF
@@ -12967,142 +7391,12 @@
fi
-
- CPPFLAGS="$CPPFLAGS $V_INCLS"
-
-for ac_header in openssl/evp.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
- # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_header_compiler=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- ac_header_preproc=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
- ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ for ac_header in openssl/evp.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "openssl/evp.h" "ac_cv_header_openssl_evp_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_evp_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_OPENSSL_EVP_H 1
_ACEOF
fi
@@ -13111,13 +7405,12 @@
fi
+if test "$missing_includes" = "yes"; then
+ CPPFLAGS="$CPPFLAGS -I$srcdir/missing"
+ V_INCLS="$V_INCLS -I$srcdir/missing"
fi
-if test "$missing_includes" = "yes"; then
- CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
- V_INCLS="$V_INCLS -I\$(srcdir)/missing"
-fi
@@ -13139,11 +7432,12 @@
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -13150,11 +7444,11 @@
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
- ./ | .// | /cC/* | \
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
@@ -13172,8 +7466,18 @@
# program-specific install script used by HP pwplus--don't use.
:
else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
fi
fi
done
@@ -13180,9 +7484,11 @@
done
;;
esac
-done
+
+ done
IFS=$as_save_IFS
+rm -rf conftest.one conftest.two conftest.dir
fi
if test "${ac_cv_path_install+set}" = set; then
@@ -13195,8 +7501,8 @@
INSTALL=$ac_install_sh
fi
fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
@@ -13212,7 +7518,7 @@
ac_config_commands="$ac_config_commands default-1"
-ac_config_files="$ac_config_files Makefile"
+ac_config_files="$ac_config_files Makefile tcpdump.1"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -13241,12 +7547,13 @@
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
@@ -13254,8 +7561,8 @@
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes (double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \).
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
@@ -13277,13 +7584,24 @@
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
- test "x$cache_file" != "x/dev/null" &&
- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
- cat confcache >$cache_file
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
else
- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
@@ -13296,14 +7614,15 @@
ac_libobjs=
ac_ltlibobjs=
+U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`echo "$ac_i" | sed "$ac_script"`
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
- ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
@@ -13311,12 +7630,14 @@
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
@@ -13326,59 +7647,79 @@
debug=false
ac_cs_recheck=false
ac_cs_silent=false
+
SHELL=\${CONFIG_SHELL-$SHELL}
-_ACEOF
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
-cat >>$CONFIG_STATUS <<\_ACEOF
-## --------------------- ##
-## M4sh Initialization. ##
-## --------------------- ##
-
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
esac
-
fi
-
-
-# PATH needs CR
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
else
- PATH_SEPARATOR=:
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
fi
- rm -f conf$$.sh
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
fi
-# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- as_unset=unset
-else
- as_unset=false
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
fi
@@ -13387,12 +7728,11 @@
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
-as_nl='
-'
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
+as_myself=
+case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -13399,8 +7739,8 @@
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
IFS=$as_save_IFS
;;
@@ -13411,13 +7751,17 @@
as_myself=$0
fi
if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
fi
-# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
@@ -13424,19 +7768,94 @@
PS4='+ '
# NLS nuisances.
-for as_var in \
- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- LC_TELEPHONE LC_TIME
-do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- eval $as_var=C; export $as_var
- else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
-done
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
-# Required to use basename.
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
@@ -13450,13 +7869,17 @@
as_basename=false
fi
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
-# Name of the executable.
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
@@ -13471,96 +7894,47 @@
}
s/.*/./; q'`
-# CDPATH.
-$as_unset CDPATH
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
-
- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
- # uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
- { (exit 1); exit 1; }; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
+case `echo -n x` in #(((((
-n*)
- case `echo 'x\c'` in
+ case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
- mkdir conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
+ fi
else
as_ln_s='cp -p'
fi
@@ -13567,8 +7941,56 @@
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
- as_mkdir_p=:
+ as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
@@ -13585,12 +8007,12 @@
as_test_x='
eval sh -c '\''
if test -d "$1"; then
- test -d "$1/.";
+ test -d "$1/.";
else
- case $1 in
- -*)set "./$1";;
+ case $1 in #(
+ -*)set "./$1";;
esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
@@ -13605,13 +8027,19 @@
exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-# Save the log message, to keep $[0] and so on meaningful, and to
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.61. Invocation command line was
+generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -13624,7 +8052,16 @@
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
config_headers="$ac_config_headers"
@@ -13632,22 +8069,25 @@
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
-Usage: $0 [OPTIONS] [FILE]...
+Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
- -q, --quiet do not print progress messages
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
Configuration files:
$config_files
@@ -13658,16 +8098,17 @@
Configuration commands:
$config_commands
-Report bugs to <bug-autoconf at gnu.org>."
+Report bugs to the package provider."
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.61,
- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.68,
+ with options \\"\$ac_cs_config\\"
-Copyright (C) 2006 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -13674,20 +8115,25 @@
ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
+test -n "\$AWK" || AWK=awk
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value. By we need to know if files were specified by the user.
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
case $1 in
- --*=*)
+ --*=?*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
*)
ac_option=$1
ac_optarg=$2
@@ -13700,34 +8146,41 @@
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- echo "$ac_cs_version"; exit ;;
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
- CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--header | --heade | --head | --hea )
$ac_shift
- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
- { echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; };;
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
--help | --hel | -h )
- echo "$ac_cs_usage"; exit ;;
+ $as_echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
- -*) { echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; } ;;
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
- *) ac_config_targets="$ac_config_targets $1"
+ *) as_fn_append ac_config_targets " $1"
ac_need_defaults=false ;;
esac
@@ -13742,16 +8195,18 @@
fi
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- CONFIG_SHELL=$SHELL
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
- exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ exec "\$@"
fi
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
echo
@@ -13758,11 +8213,11 @@
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
- echo "$ac_log"
+ $as_echo "$ac_log"
} >&5
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
@@ -13770,7 +8225,7 @@
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Handling of arguments.
for ac_config_target in $ac_config_targets
@@ -13779,10 +8234,9 @@
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "tcpdump.1") CONFIG_FILES="$CONFIG_FILES tcpdump.1" ;;
- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
- { (exit 1); exit 1; }; };;
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
@@ -13805,169 +8259,295 @@
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
- tmp=
+ tmp= ac_tmp=
trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
- trap '{ (exit 1); exit 1; }' 1 2 13 15
+ trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -n "$tmp" && test -d "$tmp"
+ test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
-} ||
-{
- echo "$me: cannot create a temporary directory in ." >&2
- { (exit 1); exit 1; }
-}
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
-
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-build!$build$ac_delim
-build_cpu!$build_cpu$ac_delim
-build_vendor!$build_vendor$ac_delim
-build_os!$build_os$ac_delim
-host!$host$ac_delim
-host_cpu!$host_cpu$ac_delim
-host_vendor!$host_vendor$ac_delim
-host_os!$host_os$ac_delim
-SHLICC2!$SHLICC2$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-CPP!$CPP$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-V_CCOPT!$V_CCOPT$ac_delim
-V_DEFS!$V_DEFS$ac_delim
-V_GROUP!$V_GROUP$ac_delim
-V_INCLS!$V_INCLS$ac_delim
-V_PCAPDEP!$V_PCAPDEP$ac_delim
-LOCALSRC!$LOCALSRC$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 67; then
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
+rm -f conf$$subs.sh
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[ ]*\):*/\1/
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
s/^[^=]*=[ ]*$//
}'
fi
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
-for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
@@ -13974,9 +8554,7 @@
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
- { (exit 1); exit 1; }; };;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@@ -13995,7 +8573,7 @@
for ac_f
do
case $ac_f in
- -) ac_f="$tmp/stdin";;
+ -) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
@@ -14004,26 +8582,34 @@
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
- { (exit 1); exit 1; }; };;
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
- ac_file_inputs="$ac_file_inputs $ac_f"
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
done
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
- configure_input="Generated from "`IFS=:
- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin";;
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
@@ -14033,7 +8619,7 @@
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
+$as_echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -14051,55 +8637,15 @@
q
}
s/.*/./; q'`
- { as_dir="$ac_dir"
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
- { (exit 1); exit 1; }; }; }
+ as_dir="$ac_dir"; as_fn_mkdir_p
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -14139,12 +8685,12 @@
esac
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
-
-case `sed -n '/datarootdir/ {
+ac_sed_dataroot='
+/datarootdir/ {
p
q
}
@@ -14152,14 +8698,14 @@
/@docdir@/p
/@infodir@/p
/@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
s&@datadir@&$datadir&g
s&@docdir@&$docdir&g
@@ -14166,7 +8712,7 @@
s&@infodir@&$infodir&g
s&@localedir@&$localedir&g
s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
+ s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF
@@ -14173,15 +8719,16 @@
# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
- sed "$ac_vpsub
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
+s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
@@ -14191,123 +8738,53 @@
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
- { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&2;}
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
- rm -f "$tmp/stdin"
+ rm -f "$ac_tmp/stdin"
case $ac_file in
- -) cat "$tmp/out"; rm -f "$tmp/out";;
- *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
- esac
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
:H)
#
# CONFIG_HEADER
#
-_ACEOF
-
-# Transform confdefs.h into a sed script `conftest.defines', that
-# substitutes the proper values into config.h.in to produce config.h.
-rm -f conftest.defines conftest.tail
-# First, append a space to every undef/define line, to ease matching.
-echo 's/$/ /' >conftest.defines
-# Then, protect against being on the right side of a sed subst, or in
-# an unquoted here document, in config.status. If some macros were
-# called several times there might be several #defines for the same
-# symbol, which is useless. But do not sort them, since the last
-# AC_DEFINE must be honored.
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
-# NAME is the cpp macro being defined, VALUE is the value it is being given.
-# PARAMS is the parameter list in the macro definition--in most cases, it's
-# just an empty string.
-ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
-ac_dB='\\)[ (].*,\\1define\\2'
-ac_dC=' '
-ac_dD=' ,'
-
-uniq confdefs.h |
- sed -n '
- t rset
- :rset
- s/^[ ]*#[ ]*define[ ][ ]*//
- t ok
- d
- :ok
- s/[\\&,]/\\&/g
- s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
- s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
- ' >>conftest.defines
-
-# Remove the space that was appended to ease matching.
-# Then replace #undef with comments. This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-# (The regexp can be short, since the line contains either #define or #undef.)
-echo 's/ $//
-s,^[ #]*u.*,/* & */,' >>conftest.defines
-
-# Break up conftest.defines:
-ac_max_sed_lines=50
-
-# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
-# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
-# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
-# et cetera.
-ac_in='$ac_file_inputs'
-ac_out='"$tmp/out1"'
-ac_nxt='"$tmp/out2"'
-
-while :
-do
- # Write a here document:
- cat >>$CONFIG_STATUS <<_ACEOF
- # First, check the format of the line:
- cat >"\$tmp/defines.sed" <<\\CEOF
-/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
-/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
-b
-:def
-_ACEOF
- sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
- echo 'CEOF
- sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
- ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
- sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
- grep . conftest.tail >/dev/null || break
- rm -f conftest.defines
- mv conftest.tail conftest.defines
-done
-rm -f conftest.defines conftest.tail
-
-echo "ac_result=$ac_in" >>$CONFIG_STATUS
-cat >>$CONFIG_STATUS <<\_ACEOF
if test x"$ac_file" != x-; then
- echo "/* $configure_input */" >"$tmp/config.h"
- cat "$ac_result" >>"$tmp/config.h"
- if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
else
- rm -f $ac_file
- mv "$tmp/config.h" $ac_file
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
fi
else
- echo "/* $configure_input */"
- cat "$ac_result"
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
fi
- rm -f "$tmp/out12"
;;
- :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
-echo "$as_me: executing $ac_file commands" >&6;}
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
;;
esac
@@ -14323,12 +8800,14 @@
done # for ac_tag
-{ (exit 0); exit 0; }
+as_fn_exit 0
_ACEOF
-chmod +x $CONFIG_STATUS
ac_clean_files=$ac_clean_files_save
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
@@ -14347,7 +8826,11 @@
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
- $ac_cs_success || { (exit 1); exit 1; }
+ $ac_cs_success || as_fn_exit 1
fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
exit 0
Property changes on: trunk/contrib/tcpdump/configure
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/contrib/tcpdump/configure.in
===================================================================
--- trunk/contrib/tcpdump/configure.in 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/configure.in 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-dnl @(#) $Header: /home/cvs/src/contrib/tcpdump/configure.in,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/tcpdump/configure.in,v 1.204 2008-11-18 07:39:20 guy Exp $ (LBL)
dnl
dnl Copyright (c) 1994, 1995, 1996, 1997
dnl The Regents of the University of California. All rights reserved.
@@ -6,20 +6,34 @@
dnl Process this file with autoconf to produce a configure script.
dnl
-AC_REVISION($Revision: 1.1.1.3 $)
+#
+# See
+#
+# http://ftp.gnu.org/gnu/config/README
+#
+# for the URLs to use to fetch new versions of config.guess and
+# config.sub.
+#
+
+AC_REVISION($Revision: 1.204 $)
AC_PREREQ(2.50)
AC_INIT(tcpdump.c)
AC_CANONICAL_HOST
+AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS)
+AC_PROG_CC
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)
+if test "$ac_cv___attribute__" = "yes"; then
+ AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER
+fi
+AC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.h)
AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>])
-if test "$ac_cv_header_net_pfvar_h" == yes; then
+if test "$ac_cv_header_net_pfvar_h" = yes; then
LOCALSRC="print-pflog.c $LOCALSRC"
fi
AC_CHECK_HEADERS(netinet/if_ether.h, , , [#include <sys/types.h>
@@ -46,6 +60,33 @@
case "$host_os" in
+darwin*)
+ AC_ARG_ENABLE(universal,
+ AC_HELP_STRING([--disable-universal],[don't build universal on OS X]))
+ if test "$enable_universal" != "no"; then
+ case "$host_os" in
+
+ darwin9.*)
+ #
+ # Leopard. Build for x86 and 32-bit PowerPC, with
+ # x86 first. (That's what Apple does.)
+ #
+ V_CCOPT="$V_CCOPT -arch i386 -arch ppc"
+ LDFLAGS="$LDFLAGS -arch i386 -arch ppc"
+ ;;
+
+ darwin10.*)
+ #
+ # Snow Leopard. Build for x86-64 and x86, with
+ # x86-64 first. (That's what Apple does.)
+ #
+ V_CCOPT="$V_CCOPT -arch x86_64 -arch i386"
+ LDFLAGS="$LDFLAGS -arch x86_64 -arch i386"
+ ;;
+ esac
+ fi
+ ;;
+
linux*)
AC_MSG_CHECKING(Linux kernel version)
if test "$cross_compiling" = yes; then
@@ -70,6 +111,12 @@
esac
+AC_ARG_WITH(smi,
+[ --with-smi link with libsmi (allows to load MIBs on the fly to decode SNMP packets. [default=yes]
+ --without-smi don't link with libsmi],,
+ with_smi=yes)
+
+if test "x$with_smi" != "xno" ; then
AC_CHECK_HEADERS(smi.h)
AC_CHECK_LIB(smi, smiInit)
if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
@@ -111,6 +158,7 @@
libsmi=no]
)
fi
+fi
AC_MSG_CHECKING([whether to enable the possibly-buggy SMB printer])
AC_ARG_ENABLE(smb,
@@ -138,7 +186,7 @@
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
+if test ! -z "$with_chroot" && test "$with_chroot" != "no" ; then
AC_DEFINE_UNQUOTED(WITH_CHROOT, "$withval")
AC_MSG_RESULT(to \"$withval\")
else
@@ -151,7 +199,7 @@
--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"
+ LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
AC_DEFINE(INET6)
ipv6=yes
;;
@@ -173,7 +221,7 @@
}
],
[ 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"
+ LOCALSRC="print-ip6.c print-ip6opts.c print-mobility.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c print-babel.c $LOCALSRC"
AC_DEFINE(INET6)
ipv6=yes],
[ AC_MSG_RESULT(no)
@@ -434,7 +482,7 @@
fi
fi
])
- AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
+ AC_REPLACE_FUNCS(getnameinfo)
fi
AC_CACHE_CHECK([for dnet_htoa declaration in netdnet/dnetdb.h],
@@ -447,22 +495,6 @@
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
@@ -490,34 +522,8 @@
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(fork vfork strftime)
AC_CHECK_FUNCS(setlinebuf alarm)
needsnprintf=no
@@ -696,6 +702,9 @@
fi
fi
+# libdlpi is needed for Solaris 11 and later.
+AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib)
+
dnl portability macros for getaddrinfo/getnameinfo
dnl
dnl Check for sa_len
@@ -704,15 +713,29 @@
missing_includes=yes
fi
+#
+# Do we have the new open API? Check for pcap_create, and assume that,
+# if we do, we also have pcap_activate() and the other new routines
+# introduced in libpcap 1.0.0.
+#
+AC_CHECK_FUNCS(pcap_create)
+if test $ac_cv_func_pcap_create = "yes" ; then
+ #
+ # OK, do we have pcap_set_tstamp_type? If so, assume we have
+ # pcap_list_tstamp_types and pcap_free_tstamp_types as well.
+ #
+ AC_CHECK_FUNCS(pcap_set_tstamp_type)
+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"
+ savedcppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $V_INCLS"
AC_CHECK_TYPES(pcap_if_t, , , [#include <pcap.h>])
- CFLAGS="$savedcflags"
+ CPPFLAGS="$savedcppflags"
fi
if test $ac_cv_func_pcap_lib_version = "no" ; then
@@ -771,23 +794,55 @@
if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
V_GROUP=wheel
fi
+#
+# Assume V7/BSD convention for man pages (file formats in section 5,
+# miscellaneous info in section 7).
+#
+MAN_FILE_FORMATS=5
+MAN_MISC_INFO=7
case "$host_os" in
aix*)
dnl Workaround to enable certain features
- AC_DEFINE(_SUN)
+ AC_DEFINE(_SUN,1,[define on AIX to get certain functions])
;;
+hpux*)
+ #
+ # Use System V conventions for man pages.
+ #
+ MAN_FILE_FORMATS=4
+ MAN_MISC_INFO=5
+ ;;
+
irix*)
V_GROUP=sys
+
+ #
+ # Use System V conventions for man pages.
+ #
+ MAN_FILE_FORMATS=4
+ MAN_MISC_INFO=5
;;
osf*)
V_GROUP=system
+
+ #
+ # Use System V conventions for man pages.
+ #
+ MAN_FILE_FORMATS=4
+ MAN_MISC_INFO=5
;;
solaris*)
V_GROUP=sys
+
+ #
+ # Use System V conventions for man pages.
+ #
+ MAN_FILE_FORMATS=4
+ MAN_MISC_INFO=5
;;
esac
@@ -799,7 +854,11 @@
AC_CHECK_TYPE([int8_t], ,
[AC_DEFINE([int8_t], [signed char],
- [Define to `signed char' if int8_t not defined.])])
+ [Define to `signed char' if int8_t not defined.])],
+ [AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_BITYPES_H
+#include <sys/bitypes.h>
+#endif])
AC_CHECK_TYPE([u_int8_t], ,
[AC_DEFINE([u_int8_t], [unsigned char],
[Define to `unsigned char' if u_int8_t not defined.])],
@@ -809,7 +868,11 @@
#endif])
AC_CHECK_TYPE([int16_t], ,
[AC_DEFINE([int16_t], [short],
- [Define to `short' if int16_t not defined.])])
+ [Define to `short' if int16_t not defined.])]
+ [AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_BITYPES_H
+#include <sys/bitypes.h>
+#endif])
AC_CHECK_TYPE([u_int16_t], ,
[AC_DEFINE([u_int16_t], [unsigned short],
[Define to `unsigned short' if u_int16_t not defined.])],
@@ -819,7 +882,11 @@
#endif])
AC_CHECK_TYPE([int32_t], ,
[AC_DEFINE([int32_t], [int],
- [Define to `int' if int32_t not defined.])])
+ [Define to `int' if int32_t not defined.])],
+ [AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_BITYPES_H
+#include <sys/bitypes.h>
+#endif])
AC_CHECK_TYPE([u_int32_t], ,
[AC_DEFINE([u_int32_t], [unsigned int],
[Define to `unsigned int' if u_int32_t not defined.])],
@@ -829,7 +896,11 @@
#endif])
AC_CHECK_TYPE([int64_t], ,
[AC_DEFINE([int64_t], [long long],
- [Define to `long long' if int64_t not defined.])])
+ [Define to `long long' if int64_t not defined.])],
+ [AC_INCLUDES_DEFAULT
+#ifdef HAVE_SYS_BITYPES_H
+#include <sys/bitypes.h>
+#endif])
AC_CHECK_TYPE([u_int64_t], ,
[AC_DEFINE([u_int64_t], [unsigned long long],
[Define to `unsigned long long' if u_int64_t not defined.])],
@@ -900,6 +971,21 @@
])
fi
+#
+# Check for some headers introduced in later versions of libpcap
+# and used by some printers.
+#
+# Those headers use the {u_}intN_t types, so we must do this after
+# we check for what's needed to get them defined.
+#
+savedcppflags="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $V_INCLS"
+AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include <tcpdump-stdinc.h>])
+AC_CHECK_HEADERS(pcap/usb.h,,,[#include <tcpdump-stdinc.h>])
+CPPFLAGS="$savedcppflags"
+
+AC_PROG_RANLIB
+
AC_LBL_DEVEL(V_CCOPT)
AC_LBL_SOCKADDR_SA_LEN
@@ -908,71 +994,40 @@
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
+# Check for OpenSSL libcrypto
+AC_MSG_CHECKING(whether to use OpenSSL libcrypto)
+# Specify location for both includes and libraries.
+want_libcrypto=ifavailable
+AC_ARG_WITH(crypto,
+ AS_HELP_STRING([--with-crypto],
+ [use OpenSSL libcrypto @<:@default=yes, if available@:>@]),
+[
+ if test $withval = no
+ then
+ want_libcrypto=no
+ AC_MSG_RESULT(no)
+ elif test $withval = yes
+ then
+ want_libcrypto=yes
+ AC_MSG_RESULT(yes)
+ fi
+],[
#
- # 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?
+ # Use libcrypto if it's present, otherwise don't.
#
- # 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
+ want_libcrypto=ifavailable
+ AC_MSG_RESULT([yes, if available])
+])
+if test "$want_libcrypto" != "no"; then
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"
+ CPPFLAGS="$CPPFLAGS -I$srcdir/missing"
+ V_INCLS="$V_INCLS -I$srcdir/missing"
fi
AC_SUBST(V_CCOPT)
@@ -981,6 +1036,8 @@
AC_SUBST(V_INCLS)
AC_SUBST(V_PCAPDEP)
AC_SUBST(LOCALSRC)
+AC_SUBST(MAN_FILE_FORMATS)
+AC_SUBST(MAN_MISC_INFO)
AC_PROG_INSTALL
@@ -991,5 +1048,5 @@
cat Makefile-devel-adds >> Makefile
make depend
fi])
-AC_OUTPUT(Makefile)
+AC_OUTPUT(Makefile tcpdump.1)
exit 0
Property changes on: trunk/contrib/tcpdump/configure.in
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/contrib/tcpdump/cpack.c
===================================================================
--- trunk/contrib/tcpdump/cpack.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/cpack.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -38,7 +38,7 @@
#include "cpack.h"
#include "extract.h"
-static u_int8_t *
+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;
@@ -53,7 +53,7 @@
* wordsize bytes remain in the buffer after the boundary. Otherwise,
* return a pointer to the boundary.
*/
-static u_int8_t *
+u_int8_t *
cpack_align_and_reserve(struct cpack_state *cs, size_t wordsize)
{
u_int8_t *next;
Modified: trunk/contrib/tcpdump/cpack.h
===================================================================
--- trunk/contrib/tcpdump/cpack.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/cpack.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -43,6 +43,9 @@
int cpack_uint32(struct cpack_state *, u_int32_t *);
int cpack_uint64(struct cpack_state *, u_int64_t *);
+u_int8_t *cpack_next_boundary(u_int8_t *buf, u_int8_t *p, size_t alignment);
+u_int8_t *cpack_align_and_reserve(struct cpack_state *cs, size_t wordsize);
+
#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))
Modified: trunk/contrib/tcpdump/dccp.h
===================================================================
--- trunk/contrib/tcpdump/dccp.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/dccp.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/dccp.h,v 1.1.1.1 2009-03-25 16:54:05 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/dccp.h,v 1.5 2006-11-02 09:05:23 hannes Exp $ (LBL) */
/*
* Copyright (C) Arnaldo Carvalho de Melo 2004
* Copyright (C) Ian McDonald 2005 <iam4 at cs.waikato.ac.nz>
@@ -36,8 +36,8 @@
} dccph_xtrs;
};
-#define DCCPH_CCVAL(dh) (((dh)->dccph_ccval_cscov) & 0x0F)
-#define DCCPH_CSCOV(dh) (((dh)->dccph_ccval_cscov >> 4) & 0x0F)
+#define DCCPH_CCVAL(dh) (((dh)->dccph_ccval_cscov >> 4) & 0xF)
+#define DCCPH_CSCOV(dh) (((dh)->dccph_ccval_cscov) & 0xF)
#define DCCPH_X(dh) ((dh)->dccph_xtrs.dccph_xtr & 1)
#define DCCPH_TYPE(dh) (((dh)->dccph_xtrs.dccph_xtr >> 1) & 0xF)
Modified: trunk/contrib/tcpdump/decnet.h
===================================================================
--- trunk/contrib/tcpdump/decnet.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/decnet.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/decnet.h,v 1.1.1.2 2006-02-25 02:34:01 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/decnet.h,v 1.11 2002-12-11 07:13:50 guy Exp $ (LBL)
*/
#ifndef WIN32
Modified: trunk/contrib/tcpdump/decode_prefix.h
===================================================================
--- trunk/contrib/tcpdump/decode_prefix.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/decode_prefix.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -33,9 +33,9 @@
#ifndef tcpdump_decode_prefix_h
#define tcpdump_decode_prefix_h
-extern int decode_prefix4(const u_char *pptr, char *buf, u_int buflen);
+extern int decode_prefix4(const u_char *pptr, u_int itemlen, char *buf, u_int buflen);
#ifdef INET6
-extern int decode_prefix6(const u_char *pd, char *buf, u_int buflen);
+extern int decode_prefix6(const u_char *pd, u_int itemlen, char *buf, u_int buflen);
#endif
#endif
Modified: trunk/contrib/tcpdump/enc.h
===================================================================
--- trunk/contrib/tcpdump/enc.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/enc.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/enc.h,v 1.1.1.2 2006-02-25 02:34:01 laffer1 Exp $ (LBL) */
+/* @(#) $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 at tla.org),
Modified: trunk/contrib/tcpdump/ether.h
===================================================================
--- trunk/contrib/tcpdump/ether.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ether.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/ether.h,v 1.1.1.2 2006-02-25 02:34:01 laffer1 Exp $ (LBL) */
+/* @(#) $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.
Modified: trunk/contrib/tcpdump/ethertype.h
===================================================================
--- trunk/contrib/tcpdump/ethertype.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ethertype.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,9 +18,8 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- *
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/ethertype.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)
- * $FreeBSD: src/contrib/tcpdump/ethertype.h,v 1.10 2006/09/04 20:25:03 sam Exp $
+ * @(#) $Header: /tcpdump/master/tcpdump/ethertype.h,v 1.30 2008-02-06 10:47:53 guy Exp $ (LBL)
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/ethertype.h 252283 2013-06-27 00:37:59Z delphij $
*/
/*
@@ -78,6 +77,9 @@
#ifndef ETHERTYPE_SCA
#define ETHERTYPE_SCA 0x6007
#endif
+#ifndef ETHERTYPE_TEB
+#define ETHERTYPE_TEB 0x6558
+#endif
#ifndef ETHERTYPE_LANBRIDGE
#define ETHERTYPE_LANBRIDGE 0x8038
#endif
@@ -99,9 +101,26 @@
#ifndef ETHERTYPE_AARP
#define ETHERTYPE_AARP 0x80f3
#endif
+#ifndef ETHERTYPE_TIPC
+#define ETHERTYPE_TIPC 0x88ca
+#endif
#ifndef ETHERTYPE_8021Q
#define ETHERTYPE_8021Q 0x8100
#endif
+
+/* see:
+ http://en.wikipedia.org/wiki/IEEE_802.1Q
+ and http://en.wikipedia.org/wiki/QinQ
+*/
+#ifndef ETHERTYPE_8021Q9100
+#define ETHERTYPE_8021Q9100 0x9100
+#endif
+#ifndef ETHERTYPE_8021Q9200
+#define ETHERTYPE_8021Q9200 0x9200
+#endif
+#ifndef ETHERTYPE_8021QinQ
+#define ETHERTYPE_8021QinQ 0x88a8
+#endif
#ifndef ETHERTYPE_IPX
#define ETHERTYPE_IPX 0x8137
#endif
@@ -111,6 +130,9 @@
#ifndef ETHERTYPE_PPP
#define ETHERTYPE_PPP 0x880b
#endif
+#ifndef ETHERTYPE_MPCP
+#define ETHERTYPE_MPCP 0x8808
+#endif
#ifndef ETHERTYPE_SLOW
#define ETHERTYPE_SLOW 0x8809
#endif
@@ -132,12 +154,21 @@
#ifndef ETHERTYPE_PPPOES2
#define ETHERTYPE_PPPOES2 0x3c13
#endif
+#ifndef ETHERTYPE_MS_NLB_HB
+#define ETHERTYPE_MS_NLB_HB 0x886f /* MS Network Load Balancing Heartbeat */
+#endif
#ifndef ETHERTYPE_JUMBO
#define ETHERTYPE_JUMBO 0x8870
#endif
+#ifndef ETHERTYPE_LLDP
+#define ETHERTYPE_LLDP 0x88cc
+#endif
#ifndef ETHERTYPE_EAPOL
#define ETHERTYPE_EAPOL 0x888e
#endif
+#ifndef ETHERTYPE_RRCP
+#define ETHERTYPE_RRCP 0x8899
+#endif
#ifndef ETHERTYPE_LOOPBACK
#define ETHERTYPE_LOOPBACK 0x9000
#endif
@@ -144,6 +175,12 @@
#ifndef ETHERTYPE_VMAN
#define ETHERTYPE_VMAN 0x9100 /* Extreme VMAN Protocol */
#endif
+#ifndef ETHERTYPE_CFM_OLD
+#define ETHERTYPE_CFM_OLD 0xabcd /* 802.1ag depreciated */
+#endif
+#ifndef ETHERTYPE_CFM
+#define ETHERTYPE_CFM 0x8902 /* 802.1ag */
+#endif
#ifndef ETHERTYPE_ISO
#define ETHERTYPE_ISO 0xfefe /* nonstandard - used in Cisco HDLC encapsulation */
#endif
Modified: trunk/contrib/tcpdump/extract.h
===================================================================
--- trunk/contrib/tcpdump/extract.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/extract.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/extract.h,v 1.1.1.2 2006-02-25 02:34:01 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/extract.h,v 1.25 2006-01-30 16:20:07 hannes Exp $ (LBL)
*/
/*
@@ -115,6 +115,10 @@
(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_24BITS(p) \
+ ((u_int32_t)((u_int32_t)*((const u_int8_t *)(p) + 2) << 16 | \
+ (u_int32_t)*((const u_int8_t *)(p) + 1) << 8 | \
+ (u_int32_t)*((const u_int8_t *)(p) + 0)))
#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 | \
Modified: trunk/contrib/tcpdump/fddi.h
===================================================================
--- trunk/contrib/tcpdump/fddi.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/fddi.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/fddi.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/fddi.h,v 1.11 2002-12-11 07:13:51 guy Exp $ (LBL)
*/
/*
Added: trunk/contrib/tcpdump/forces.h
===================================================================
--- trunk/contrib/tcpdump/forces.h (rev 0)
+++ trunk/contrib/tcpdump/forces.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,679 @@
+/*
+ * Copyright (c) 1982, 1986, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * Copyright (c) 2009 Mojatatu Networks, Inc
+ *
+ */
+
+/*
+ * Per draft-ietf-forces-protocol-22
+*/
+#define ForCES_VERS 1
+#define ForCES_HDRL 24
+#define ForCES_ALNL 4U
+#define TLV_HDRL 4
+#define ILV_HDRL 8
+
+#define TOM_RSVD 0x0
+#define TOM_ASSNSETUP 0x1
+#define TOM_ASSNTEARD 0x2
+#define TOM_CONFIG 0x3
+#define TOM_QUERY 0x4
+#define TOM_EVENTNOT 0x5
+#define TOM_PKTREDIR 0x6
+#define TOM_HEARTBT 0x0F
+#define TOM_ASSNSETREP 0x11
+#define TOM_CONFIGREP 0x13
+#define TOM_QUERYREP 0x14
+
+/*
+ * tom_h Flags: resv1(8b):maxtlvs(4b):resv2(2b):mintlv(2b)
+*/
+#define ZERO_TTLV 0x01
+#define ZERO_MORE_TTLV 0x02
+#define ONE_MORE_TTLV 0x04
+#define ZERO_TLV 0x00
+#define ONE_TLV 0x10
+#define TWO_TLV 0x20
+#define MAX_TLV 0xF0
+
+#define TTLV_T1 (ONE_MORE_TTLV|ONE_TLV)
+#define TTLV_T2 (ONE_MORE_TTLV|MAX_TLV)
+
+struct tom_h {
+ u_int32_t v;
+ u_int16_t flags;
+ u_int16_t op_msk;
+ const char *s;
+ int (*print) (register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+};
+
+enum {
+ TOM_RSV_I,
+ TOM_ASS_I,
+ TOM_AST_I,
+ TOM_CFG_I,
+ TOM_QRY_I,
+ TOM_EVN_I,
+ TOM_RED_I,
+ TOM_HBT_I,
+ TOM_ASR_I,
+ TOM_CNR_I,
+ TOM_QRR_I,
+ _TOM_RSV_MAX
+};
+#define TOM_MAX_IND (_TOM_RSV_MAX - 1)
+
+int lfbselect_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+int redirect_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+int asrtlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+int asttlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+int gentltlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+int print_metailv(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+int print_metatlv(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+int print_reddata(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+
+static inline int tom_valid(u_int8_t tom)
+{
+ if (tom > 0) {
+ if (tom >= 0x7 && tom <= 0xe)
+ return 0;
+ if (tom == 0x10)
+ return 0;
+ if (tom > 0x14)
+ return 0;
+ return 1;
+ } else
+ return 0;
+}
+
+static inline const char *ForCES_node(u_int32_t node)
+{
+ if (node <= 0x3FFFFFFF)
+ return "FE";
+ if (node >= 0x40000000 && node <= 0x7FFFFFFF)
+ return "CE";
+ if (node >= 0xC0000000 && node <= 0xFFFFFFEF)
+ return "AllMulticast";
+ if (node == 0xFFFFFFFD)
+ return "AllCEsBroadcast";
+ if (node == 0xFFFFFFFE)
+ return "AllFEsBroadcast";
+ if (node == 0xFFFFFFFF)
+ return "AllBroadcast";
+
+ return "ForCESreserved";
+
+}
+
+static inline const char *ForCES_ACKp(u_int32_t flg)
+{
+ if (flg == 0x0)
+ return "NoACK";
+ if (flg == 0x1)
+ return "SuccessACK";
+ if (flg == 0x2)
+ return "FailureACK";
+ if (flg == 0x3)
+ return "AlwaysACK";
+ return "ACKUnknown";
+}
+
+static inline const char *ForCES_EMp(u_int32_t flg)
+{
+ if (flg == 0x0)
+ return "EMReserved";
+ if (flg == 0x1)
+ return "execute-all-or-none";
+ if (flg == 0x2)
+ return "execute-until-failure";
+ if (flg == 0x3)
+ return "continue-execute-on-failure";
+ return "EMUnknown";
+}
+
+static inline const char *ForCES_ATp(u_int32_t flg)
+{
+ if (flg == 0x0)
+ return "Standalone";
+ if (flg == 0x1)
+ return "2PCtransaction";
+ return "ATUnknown";
+}
+
+static inline const char *ForCES_TPp(u_int32_t flg)
+{
+ if (flg == 0x0)
+ return "StartofTransaction";
+ if (flg == 0x1)
+ return "MiddleofTransaction";
+ if (flg == 0x2)
+ return "EndofTransaction";
+ if (flg == 0x3)
+ return "abort";
+ return "TPUnknown";
+}
+
+/*
+ * Structure of forces header, naked of TLVs.
+ */
+struct forcesh {
+ u_int8_t fm_vrsvd; /* version and reserved */
+#define ForCES_V(forcesh) ((forcesh)->fm_vrsvd >> 4)
+ u_int8_t fm_tom; /* type of message */
+ u_int16_t fm_len; /* total length * 4 bytes */
+#define ForCES_BLN(forcesh) ((u_int32_t)(EXTRACT_16BITS(&(forcesh)->fm_len) << 2))
+ u_int32_t fm_sid; /* Source ID */
+#define ForCES_SID(forcesh) EXTRACT_32BITS(&(forcesh)->fm_sid)
+ u_int32_t fm_did; /* Destination ID */
+#define ForCES_DID(forcesh) EXTRACT_32BITS(&(forcesh)->fm_did)
+ u_int8_t fm_cor[8]; /* correlator */
+ u_int32_t fm_flags; /* flags */
+#define ForCES_ACK(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0xC0000000) >> 30)
+#define ForCES_PRI(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x38000000) >> 27)
+#define ForCES_RS1(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x07000000) >> 24)
+#define ForCES_EM(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x00C00000) >> 22)
+#define ForCES_AT(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x00200000) >> 21)
+#define ForCES_TP(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x00180000) >> 19)
+#define ForCES_RS2(forcesh) ((EXTRACT_32BITS(&(forcesh)->fm_flags)&0x0007FFFF) >> 0)
+};
+
+#define ForCES_HLN_VALID(fhl,tlen) ((tlen) >= ForCES_HDRL && \
+ (fhl) >= ForCES_HDRL && \
+ (fhl) == (tlen))
+
+#define F_LFB_RSVD 0x0
+#define F_LFB_FEO 0x1
+#define F_LFB_FEPO 0x2
+const struct tok ForCES_LFBs[] = {
+ {F_LFB_RSVD, "Invalid TLV"},
+ {F_LFB_FEO, "FEObj LFB"},
+ {F_LFB_FEPO, "FEProtoObj LFB"},
+ {0, NULL}
+};
+
+int forces_type_print(register const u_char * pptr, const struct forcesh *fhdr,
+ register u_int mlen, const struct tom_h *tops);
+
+enum {
+ F_OP_RSV,
+ F_OP_SET,
+ F_OP_SETPROP,
+ F_OP_SETRESP,
+ F_OP_SETPRESP,
+ F_OP_DEL,
+ F_OP_DELRESP,
+ F_OP_GET,
+ F_OP_GETPROP,
+ F_OP_GETRESP,
+ F_OP_GETPRESP,
+ F_OP_REPORT,
+ F_OP_COMMIT,
+ F_OP_RCOMMIT,
+ F_OP_RTRCOMP,
+ _F_OP_MAX
+};
+
+#define F_OP_MAX (_F_OP_MAX - 1)
+enum {
+ B_OP_SET = 1 << (F_OP_SET - 1),
+ B_OP_SETPROP = 1 << (F_OP_SETPROP - 1),
+ B_OP_SETRESP = 1 << (F_OP_SETRESP - 1),
+ B_OP_SETPRESP = 1 << (F_OP_SETPRESP - 1),
+ B_OP_DEL = 1 << (F_OP_DEL - 1),
+ B_OP_DELRESP = 1 << (F_OP_DELRESP - 1),
+ B_OP_GET = 1 << (F_OP_GET - 1),
+ B_OP_GETPROP = 1 << (F_OP_GETPROP - 1),
+ B_OP_GETRESP = 1 << (F_OP_GETRESP - 1),
+ B_OP_GETPRESP = 1 << (F_OP_GETPRESP - 1),
+ B_OP_REPORT = 1 << (F_OP_REPORT - 1),
+ B_OP_COMMIT = 1 << (F_OP_COMMIT - 1),
+ B_OP_RCOMMIT = 1 << (F_OP_RCOMMIT - 1),
+ B_OP_RTRCOMP = 1 << (F_OP_RTRCOMP - 1),
+};
+
+struct optlv_h {
+ u_int16_t flags;
+ u_int16_t op_msk;
+ const char *s;
+ int (*print) (register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+};
+
+int genoptlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+int recpdoptlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+int invoptlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+
+#define OP_MIN_SIZ 8
+struct pathdata_h {
+ u_int16_t pflags;
+ u_int16_t pIDcnt;
+};
+
+#define B_FULLD 0x1
+#define B_SPARD 0x2
+#define B_RESTV 0x4
+#define B_KEYIN 0x8
+
+static const struct optlv_h OPTLV_msg[F_OP_MAX + 1] = {
+ /* F_OP_RSV */ {ZERO_TTLV, 0, "Invalid OPTLV", invoptlv_print},
+ /* F_OP_SET */ {TTLV_T2, B_FULLD | B_SPARD, " Set", recpdoptlv_print},
+ /* F_OP_SETPROP */
+ {TTLV_T2, B_FULLD | B_SPARD, " SetProp", recpdoptlv_print},
+ /* F_OP_SETRESP */ {TTLV_T2, B_RESTV, " SetResp", recpdoptlv_print},
+ /* F_OP_SETPRESP */ {TTLV_T2, B_RESTV, " SetPropResp", recpdoptlv_print},
+ /* F_OP_DEL */ {ZERO_TTLV, 0, " Del", recpdoptlv_print},
+ /* F_OP_DELRESP */ {TTLV_T2, B_RESTV, " DelResp", recpdoptlv_print},
+ /* F_OP_GET */ {ZERO_TTLV, 0, " Get", recpdoptlv_print},
+ /* F_OP_GETPROP */ {ZERO_TTLV, 0, " GetProp", recpdoptlv_print},
+ /* F_OP_GETRESP */
+ {TTLV_T2, B_FULLD | B_SPARD | B_RESTV, " GetResp", recpdoptlv_print},
+ /* F_OP_GETPRESP */
+ {TTLV_T2, B_FULLD | B_RESTV, " GetPropResp", recpdoptlv_print},
+ /* F_OP_REPORT */
+ {TTLV_T2, B_FULLD | B_SPARD, " Report", recpdoptlv_print},
+ /* F_OP_COMMIT */ {ZERO_TTLV, 0, " Commit", NULL},
+ /* F_OP_RCOMMIT */ {TTLV_T1, B_RESTV, " RCommit", genoptlv_print},
+ /* F_OP_RTRCOMP */ {ZERO_TTLV, 0, " RTRCOMP", NULL},
+};
+
+static inline const struct optlv_h *get_forces_optlv_h(u_int16_t opt)
+{
+ if (opt > F_OP_MAX || opt <= F_OP_RSV)
+ return &OPTLV_msg[F_OP_RSV];
+
+ return &OPTLV_msg[opt];
+}
+
+#define IND_SIZE 256
+#define IND_CHR ' '
+#define IND_PREF '\n'
+#define IND_SUF 0x0
+char ind_buf[IND_SIZE];
+
+static inline char *indent_pr(int indent, int nlpref)
+{
+ int i = 0;
+ char *r = ind_buf;
+
+ if (indent > (IND_SIZE - 1))
+ indent = IND_SIZE - 1;
+
+ if (nlpref) {
+ r[i] = IND_PREF;
+ i++;
+ indent--;
+ }
+
+ while (--indent >= 0)
+ r[i++] = IND_CHR;
+
+ r[i] = IND_SUF;
+ return r;
+}
+
+static inline int op_valid(u_int16_t op, u_int16_t mask)
+{
+ int opb = 1 << (op - 1);
+
+ if (op == 0)
+ return 0;
+ if (opb & mask)
+ return 1;
+ /* I guess we should allow vendor operations? */
+ if (op >= 0x8000)
+ return 1;
+ return 0;
+}
+
+#define F_TLV_RSVD 0x0000
+#define F_TLV_REDR 0x0001
+#define F_TLV_ASRS 0x0010
+#define F_TLV_ASRT 0x0011
+#define F_TLV_LFBS 0x1000
+#define F_TLV_PDAT 0x0110
+#define F_TLV_KEYI 0x0111
+#define F_TLV_FULD 0x0112
+#define F_TLV_SPAD 0x0113
+#define F_TLV_REST 0x0114
+#define F_TLV_METD 0x0115
+#define F_TLV_REDD 0x0116
+#define F_TLV_VNST 0x8000
+
+static const struct tok ForCES_TLV[] = {
+ {F_TLV_RSVD, "Invalid TLV"},
+ {F_TLV_REDR, "REDIRECT TLV"},
+ {F_TLV_ASRS, "ASResult TLV"},
+ {F_TLV_ASRT, "ASTreason TLV"},
+ {F_TLV_LFBS, "LFBselect TLV"},
+ {F_TLV_PDAT, "PATH-DATA TLV"},
+ {F_TLV_KEYI, "KEYINFO TLV"},
+ {F_TLV_FULD, "FULLDATA TLV"},
+ {F_TLV_SPAD, "SPARSEDATA TLV"},
+ {F_TLV_REST, "RESULT TLV"},
+ {F_TLV_METD, "METADATA TLV"},
+ {F_TLV_REDD, "REDIRECTDATA TLV"},
+ {0, NULL}
+};
+
+#define TLV_HLN 4
+static inline int ttlv_valid(u_int16_t ttlv)
+{
+ if (ttlv > 0) {
+ if (ttlv == 1 || ttlv == 0x1000)
+ return 1;
+ if (ttlv >= 0x10 && ttlv <= 0x11)
+ return 1;
+ if (ttlv >= 0x110 && ttlv <= 0x116)
+ return 1;
+ if (ttlv >= 0x8000)
+ return 0; /* XXX: */
+ }
+
+ return 0;
+}
+
+struct forces_ilv {
+ u_int32_t type;
+ u_int32_t length;
+};
+
+struct forces_tlv {
+ u_int16_t type;
+ u_int16_t length;
+};
+
+int otlv_print(const struct forces_tlv *otlv, u_int16_t op_msk, int indent);
+
+#define F_ALN_LEN(len) ( ((len)+ForCES_ALNL-1) & ~(ForCES_ALNL-1) )
+#define GET_TOP_TLV(fhdr) ((struct forces_tlv *)((fhdr) + sizeof (struct forcesh)))
+#define TLV_SET_LEN(len) (F_ALN_LEN(TLV_HDRL) + (len))
+#define TLV_ALN_LEN(len) F_ALN_LEN(TLV_SET_LEN(len))
+#define TLV_RDAT_LEN(tlv) ((int)(EXTRACT_16BITS(&(tlv)->length) - TLV_SET_LEN(0))
+#define TLV_DATA(tlvp) ((void*)(((char*)(tlvp)) + TLV_SET_LEN(0)))
+#define GO_NXT_TLV(tlv,rlen) ((rlen) -= F_ALN_LEN(EXTRACT_16BITS(&(tlv)->length)), \
+ (struct forces_tlv*)(((char*)(tlv)) \
+ + F_ALN_LEN(EXTRACT_16BITS(&(tlv)->length))))
+#define ILV_SET_LEN(len) (F_ALN_LEN(ILV_HDRL) + (len))
+#define ILV_ALN_LEN(len) F_ALN_LEN(ILV_SET_LEN(len))
+#define ILV_RDAT_LEN(ilv) ((int)(EXTRACT_32BITS(&(ilv)->length)) - ILV_SET_LEN(0))
+#define ILV_DATA(ilvp) ((void*)(((char*)(ilvp)) + ILV_SET_LEN(0)))
+#define GO_NXT_ILV(ilv,rlen) ((rlen) -= F_ALN_LEN(EXTRACT_32BITS(&(ilv)->length)), \
+ (struct forces_ilv *)(((char*)(ilv)) \
+ + F_ALN_LEN(EXTRACT_32BITS(&(ilv)->length))))
+#define INVALID_RLEN -1
+#define INVALID_STLN -2
+#define INVALID_LTLN -3
+#define INVALID_ALEN -4
+
+static const struct tok ForCES_TLV_err[] = {
+ {INVALID_RLEN, "Invalid total length"},
+ {INVALID_STLN, "xLV too short"},
+ {INVALID_LTLN, "xLV too long"},
+ {INVALID_ALEN, "data padding missing"},
+ {0, NULL}
+};
+
+static inline int tlv_valid(const struct forces_tlv *tlv, u_int rlen)
+{
+ if (rlen < TLV_HDRL)
+ return INVALID_RLEN;
+ if (EXTRACT_16BITS(&tlv->length) < TLV_HDRL)
+ return INVALID_STLN;
+ if (EXTRACT_16BITS(&tlv->length) > rlen)
+ return INVALID_LTLN;
+ if (rlen < F_ALN_LEN(EXTRACT_16BITS(&tlv->length)))
+ return INVALID_ALEN;
+
+ return 0;
+}
+
+static inline int ilv_valid(const struct forces_ilv *ilv, u_int rlen)
+{
+ if (rlen < ILV_HDRL)
+ return INVALID_RLEN;
+ if (EXTRACT_32BITS(&ilv->length) < ILV_HDRL)
+ return INVALID_STLN;
+ if (EXTRACT_32BITS(&ilv->length) > rlen)
+ return INVALID_LTLN;
+ if (rlen < F_ALN_LEN(EXTRACT_32BITS(&ilv->length)))
+ return INVALID_ALEN;
+
+ return 0;
+}
+
+struct forces_lfbsh {
+ u_int32_t class;
+ u_int32_t instance;
+};
+
+#define ASSNS_OPS (B_OP_REPORT)
+#define CFG_OPS (B_OP_SET|B_OP_SETPROP|B_OP_DEL|B_OP_COMMIT|B_OP_RTRCOMP)
+#define CFG_ROPS (B_OP_SETRESP|B_OP_SETPRESP|B_OP_DELRESP|B_OP_RCOMMIT)
+#define CFG_QY (B_OP_GET|B_OP_GETPROP)
+#define CFG_QYR (B_OP_GETRESP|B_OP_GETPRESP)
+#define CFG_EVN (B_OP_REPORT)
+
+static const struct tom_h ForCES_msg[TOM_MAX_IND + 1] = {
+ /* TOM_RSV_I */ {TOM_RSVD, ZERO_TTLV, 0, "Invalid message", NULL},
+ /* TOM_ASS_I */ {TOM_ASSNSETUP, ZERO_MORE_TTLV | TWO_TLV, ASSNS_OPS,
+ "Association Setup", lfbselect_print},
+ /* TOM_AST_I */
+ {TOM_ASSNTEARD, TTLV_T1, 0, "Association TearDown", asttlv_print},
+ /* TOM_CFG_I */ {TOM_CONFIG, TTLV_T2, CFG_OPS, "Config", lfbselect_print},
+ /* TOM_QRY_I */ {TOM_QUERY, TTLV_T2, CFG_QY, "Query", lfbselect_print},
+ /* TOM_EVN_I */ {TOM_EVENTNOT, TTLV_T1, CFG_EVN, "Event Notification",
+ lfbselect_print},
+ /* TOM_RED_I */
+ {TOM_PKTREDIR, TTLV_T2, 0, "Packet Redirect", redirect_print},
+ /* TOM_HBT_I */ {TOM_HEARTBT, ZERO_TTLV, 0, "HeartBeat", NULL},
+ /* TOM_ASR_I */
+ {TOM_ASSNSETREP, TTLV_T1, 0, "Association Response", asrtlv_print},
+ /* TOM_CNR_I */ {TOM_CONFIGREP, TTLV_T2, CFG_ROPS, "Config Response",
+ lfbselect_print},
+ /* TOM_QRR_I */
+ {TOM_QUERYREP, TTLV_T2, CFG_QYR, "Query Response", lfbselect_print},
+};
+
+static inline const struct tom_h *get_forces_tom(u_int8_t tom)
+{
+ int i;
+ for (i = TOM_RSV_I; i <= TOM_MAX_IND; i++) {
+ const struct tom_h *th = &ForCES_msg[i];
+ if (th->v == tom)
+ return th;
+ }
+ return &ForCES_msg[TOM_RSV_I];
+}
+
+struct pdata_ops {
+ u_int32_t v;
+ u_int16_t flags;
+ u_int16_t op_msk;
+ const char *s;
+ int (*print) (register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+};
+
+enum {
+ PD_RSV_I,
+ PD_SEL_I,
+ PD_FDT_I,
+ PD_SDT_I,
+ PD_RES_I,
+ PD_PDT_I,
+ _PD_RSV_MAX
+};
+#define PD_MAX_IND (_TOM_RSV_MAX - 1)
+
+static inline int pd_valid(u_int16_t pd)
+{
+ if (pd >= F_TLV_PDAT && pd <= F_TLV_REST)
+ return 1;
+ return 0;
+}
+
+static inline void chk_op_type(u_int16_t type, u_int16_t msk, u_int16_t omsk)
+{
+ if (type != F_TLV_PDAT) {
+ if (msk & B_KEYIN) {
+ if (type != F_TLV_KEYI) {
+ printf
+ ("Based on flags expected KEYINFO TLV!\n");
+ }
+ } else {
+ if (!(msk & omsk)) {
+ printf
+ ("Illegal DATA encoding for type 0x%x programmed %x got %x \n",
+ type, omsk, msk);
+ }
+ }
+ }
+
+}
+
+int fdatatlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+int sdatailv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+int sdatatlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+int pdatatlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+int pkeyitlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+
+int pdatacnt_print(register const u_char * pptr, register u_int len,
+ u_int16_t IDcnt, u_int16_t op_msk, int indent);
+int pdata_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+
+int prestlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent);
+#define F_SELKEY 1
+
+struct res_val {
+ u_int8_t result;
+ u_int8_t resv1;
+ u_int16_t resv2;
+};
+
+static const struct pdata_ops ForCES_pdata[PD_MAX_IND + 1] = {
+ /* PD_RSV_I */ {0, 0, 0, "Invalid message", NULL},
+ /* PD_SEL_I */ {F_TLV_KEYI, 0, 0, "KEYINFO TLV", pkeyitlv_print},
+ /* PD_FDT_I */ {F_TLV_FULD, 0, B_FULLD, "FULLDATA TLV", fdatatlv_print},
+ /* PD_SDT_I */ {F_TLV_SPAD, 0, B_SPARD, "SPARSEDATA TLV", sdatatlv_print},
+ /* PD_RES_I */ {F_TLV_REST, 0, B_RESTV, "RESULT TLV", prestlv_print},
+ /* PD_PDT_I */
+ {F_TLV_PDAT, 0, 0, "Inner PATH-DATA TLV", recpdoptlv_print},
+};
+
+static inline const struct pdata_ops *get_forces_pd(u_int16_t pd)
+{
+ int i;
+ for (i = PD_RSV_I + 1; i <= PD_MAX_IND; i++) {
+ const struct pdata_ops *pdo = &ForCES_pdata[i];
+ if (pdo->v == pd)
+ return pdo;
+ }
+ return &ForCES_pdata[TOM_RSV_I];
+}
+
+enum {
+ E_SUCCESS,
+ E_INVALID_HEADER,
+ E_LENGTH_MISMATCH,
+ E_VERSION_MISMATCH,
+ E_INVALID_DESTINATION_PID,
+ E_LFB_UNKNOWN,
+ E_LFB_NOT_FOUND,
+ E_LFB_INSTANCE_ID_NOT_FOUND,
+ E_INVALID_PATH,
+ E_COMPONENT_DOES_NOT_EXIST,
+ E_EXISTS,
+ E_NOT_FOUND,
+ E_READ_ONLY,
+ E_INVALID_ARRAY_CREATION,
+ E_VALUE_OUT_OF_RANGE,
+ E_CONTENTS_TOO_LONG,
+ E_INVALID_PARAMETERS,
+ E_INVALID_MESSAGE_TYPE,
+ E_INVALID_FLAGS,
+ E_INVALID_TLV,
+ E_EVENT_ERROR,
+ E_NOT_SUPPORTED,
+ E_MEMORY_ERROR,
+ E_INTERNAL_ERROR,
+ /* 0x18-0xFE are reserved .. */
+ E_UNSPECIFIED_ERROR = 0XFF
+};
+
+const struct tok ForCES_errs[] = {
+ {E_SUCCESS, "SUCCESS"},
+ {E_INVALID_HEADER, "INVALID HEADER"},
+ {E_LENGTH_MISMATCH, "LENGTH MISMATCH"},
+ {E_VERSION_MISMATCH, "VERSION MISMATCH"},
+ {E_INVALID_DESTINATION_PID, "INVALID DESTINATION PID"},
+ {E_LFB_UNKNOWN, "LFB UNKNOWN"},
+ {E_LFB_NOT_FOUND, "LFB NOT FOUND"},
+ {E_LFB_INSTANCE_ID_NOT_FOUND, "LFB INSTANCE ID NOT FOUND"},
+ {E_INVALID_PATH, "INVALID PATH"},
+ {E_COMPONENT_DOES_NOT_EXIST, "COMPONENT DOES NOT EXIST"},
+ {E_EXISTS, "EXISTS ALREADY"},
+ {E_NOT_FOUND, "NOT FOUND"},
+ {E_READ_ONLY, "READ ONLY"},
+ {E_INVALID_ARRAY_CREATION, "INVALID ARRAY CREATION"},
+ {E_VALUE_OUT_OF_RANGE, "VALUE OUT OF RANGE"},
+ {E_CONTENTS_TOO_LONG, "CONTENTS TOO LONG"},
+ {E_INVALID_PARAMETERS, "INVALID PARAMETERS"},
+ {E_INVALID_MESSAGE_TYPE, "INVALID MESSAGE TYPE"},
+ {E_INVALID_FLAGS, "INVALID FLAGS"},
+ {E_INVALID_TLV, "INVALID TLV"},
+ {E_EVENT_ERROR, "EVENT ERROR"},
+ {E_NOT_SUPPORTED, "NOT SUPPORTED"},
+ {E_MEMORY_ERROR, "MEMORY ERROR"},
+ {E_INTERNAL_ERROR, "INTERNAL ERROR"},
+ {E_UNSPECIFIED_ERROR, "UNSPECIFIED ERROR"},
+ {0, NULL}
+};
Property changes on: trunk/contrib/tcpdump/forces.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/gmpls.c
===================================================================
--- trunk/contrib/tcpdump/gmpls.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/gmpls.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -15,7 +15,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/gmpls.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/gmpls.c,v 1.7 2006-04-14 07:11:59 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -25,9 +25,10 @@
#include <tcpdump-stdinc.h>
#include "interface.h"
+#include "gmpls.h"
/* rfc3471 */
-struct tok gmpls_link_prot_values[] = {
+const struct tok gmpls_link_prot_values[] = {
{ 0x01, "Extra Traffic"},
{ 0x02, "Unprotected"},
{ 0x04, "Shared"},
@@ -40,20 +41,27 @@
};
/* 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"},
+const struct tok gmpls_switch_cap_values[] = {
+ { GMPLS_PSC1, "Packet-Switch Capable-1"},
+ { GMPLS_PSC2, "Packet-Switch Capable-2"},
+ { GMPLS_PSC3, "Packet-Switch Capable-3"},
+ { GMPLS_PSC4, "Packet-Switch Capable-4"},
+ { GMPLS_L2SC, "Layer-2 Switch Capable"},
+ { GMPLS_TSC, "Time-Division-Multiplex"},
+ { GMPLS_LSC, "Lambda-Switch Capable"},
+ { GMPLS_FSC, "Fiber-Switch Capable"},
{ 0, NULL }
};
+/* rfc4205 */
+const struct tok gmpls_switch_cap_tsc_indication_values[] = {
+ { 0, "Standard SONET/SDH" },
+ { 1, "Arbitrary SONET/SDH" },
+ { 0, NULL }
+};
+
/* rfc3471 */
-struct tok gmpls_encoding_values[] = {
+const struct tok gmpls_encoding_values[] = {
{ 1, "Packet"},
{ 2, "Ethernet V2/DIX"},
{ 3, "ANSI/ETSI PDH"},
@@ -69,7 +77,7 @@
};
/* rfc3471 */
-struct tok gmpls_payload_values[] = {
+const struct tok gmpls_payload_values[] = {
{ 0, "Unknown"},
{ 1, "Reserved"},
{ 2, "Reserved"},
@@ -137,7 +145,7 @@
* 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[] = {
+const struct tok lmp_sd_service_config_cpsa_link_type_values[] = {
{ 5, "SDH ITU-T G.707"},
{ 6, "SONET ANSI T1.105"},
{ 0, NULL}
@@ -148,7 +156,7 @@
* 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[] = {
+const struct tok lmp_sd_service_config_cpsa_signal_type_sdh_values[] = {
{ 5, "VC-3"},
{ 6, "VC-4"},
{ 7, "STM-0"},
@@ -165,7 +173,7 @@
* 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[] = {
+const struct tok lmp_sd_service_config_cpsa_signal_type_sonet_values[] = {
{ 5, "STS-1 SPE"},
{ 6, "STS-3c SPE"},
{ 7, "STS-1"},
@@ -181,7 +189,7 @@
#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[] = {
+const 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"},
Modified: trunk/contrib/tcpdump/gmpls.h
===================================================================
--- trunk/contrib/tcpdump/gmpls.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/gmpls.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/gmpls.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/gmpls.h,v 1.5 2006-04-14 07:11:59 hannes Exp $ (LBL) */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code
@@ -14,11 +14,21 @@
* Original code by Hannes Gredler (hannes at 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[];
+#define GMPLS_PSC1 1
+#define GMPLS_PSC2 2
+#define GMPLS_PSC3 3
+#define GMPLS_PSC4 4
+#define GMPLS_L2SC 51
+#define GMPLS_TSC 100
+#define GMPLS_LSC 150
+#define GMPLS_FSC 200
+
+extern const struct tok gmpls_link_prot_values[];
+extern const struct tok gmpls_switch_cap_values[];
+extern const struct tok gmpls_switch_cap_tsc_indication_values[];
+extern const struct tok gmpls_encoding_values[];
+extern const struct tok gmpls_payload_values[];
+extern const struct tok diffserv_te_bc_values[];
+extern const struct tok lmp_sd_service_config_cpsa_link_type_values[];
+extern const struct tok lmp_sd_service_config_cpsa_signal_type_sdh_values[];
+extern const struct tok lmp_sd_service_config_cpsa_signal_type_sonet_values[];
Modified: trunk/contrib/tcpdump/gmt2local.c
===================================================================
--- trunk/contrib/tcpdump/gmt2local.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/gmt2local.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/gmt2local.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/gmt2local.c,v 1.9 2003-11-16 09:36:09 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/gmt2local.h
===================================================================
--- trunk/contrib/tcpdump/gmt2local.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/gmt2local.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/gmt2local.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/gmt2local.h,v 1.2 1999-10-07 23:47:10 mcr Exp $ (LBL)
*/
#ifndef gmt2local_h
#define gmt2local_h
Modified: trunk/contrib/tcpdump/icmp6.h
===================================================================
--- trunk/contrib/tcpdump/icmp6.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/icmp6.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,5 +1,5 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/icmp6.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL) */
-/* $NetBSD: icmp6.h,v 1.13 2000/08/03 16:30:37 itojun Exp $ */
+/* @(#) $Header: /tcpdump/master/tcpdump/icmp6.h,v 1.18 2007-08-29 02:31:44 mcr Exp $ (LBL) */
+/* NetBSD: icmp6.h,v 1.13 2000/08/03 16:30:37 itojun Exp */
/* $KAME: icmp6.h,v 1.22 2000/08/03 15:25:16 jinmei Exp $ */
/*
@@ -276,8 +276,9 @@
#define ND_OPT_ADVINTERVAL 7
#define ND_OPT_HOMEAGENT_INFO 8
#define ND_OPT_ROUTE_INFO 9 /* draft-ietf-ipngwg-router-preference, not officially assigned yet */
+#define ND_OPT_RDNSS 25
+#define ND_OPT_DNSSL 31
-
struct nd_opt_prefix_info { /* prefix information */
u_int8_t nd_opt_pi_type;
u_int8_t nd_opt_pi_len;
@@ -308,6 +309,22 @@
u_int32_t nd_opt_mtu_mtu;
};
+struct nd_opt_rdnss { /* RDNSS RFC 6106 5.1 */
+ u_int8_t nd_opt_rdnss_type;
+ u_int8_t nd_opt_rdnss_len;
+ u_int16_t nd_opt_rdnss_reserved;
+ u_int32_t nd_opt_rdnss_lifetime;
+ struct in6_addr nd_opt_rdnss_addr[1]; /* variable-length */
+};
+
+struct nd_opt_dnssl { /* DNSSL RFC 6106 5.2 */
+ u_int8_t nd_opt_dnssl_type;
+ u_int8_t nd_opt_dnssl_len;
+ u_int16_t nd_opt_dnssl_reserved;
+ u_int32_t nd_opt_dnssl_lifetime;
+ /* followed by list of DNS search domains, variable-length */
+};
+
struct nd_opt_advinterval { /* Advertisement interval option */
u_int8_t nd_opt_adv_type;
u_int8_t nd_opt_adv_len;
Modified: trunk/contrib/tcpdump/ieee802_11.h
===================================================================
--- trunk/contrib/tcpdump/ieee802_11.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ieee802_11.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,5 +1,4 @@
-/* $FreeBSD: src/contrib/tcpdump/ieee802_11.h,v 1.2.2.1 2007/10/19 03:03:58 mlaier Exp $ */
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/ieee802_11.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.12 2007-07-22 19:59:06 guy Exp $ (LBL) */
/*
* Copyright (c) 2001
* Fortress Technologies
@@ -69,12 +68,14 @@
#define ST_DISASSOC 0xA
#define ST_AUTH 0xB
#define ST_DEAUTH 0xC
-/* RESERVED 0xD */
+#define ST_ACTION 0xD
/* RESERVED 0xE */
/* RESERVED 0xF */
+#define CTRL_CONTROL_WRAPPER 0x7
#define CTRL_BAR 0x8
+#define CTRL_BA 0x9
#define CTRL_PS_POLL 0xA
#define CTRL_RTS 0xB
#define CTRL_CTS 0xC
@@ -143,12 +144,6 @@
#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;
@@ -236,20 +231,20 @@
u_int16_t reason_code;
u_int16_t auth_alg;
u_int16_t auth_trans_seq_num;
- elem_status_t challenge_status;
+ int challenge_present;
struct challenge_t challenge;
u_int16_t capability_info;
- elem_status_t ssid_status;
+ int ssid_present;
struct ssid_t ssid;
- elem_status_t rates_status;
+ int rates_present;
struct rates_t rates;
- elem_status_t ds_status;
+ int ds_present;
struct ds_t ds;
- elem_status_t cf_status;
+ int cf_present;
struct cf_t cf;
- elem_status_t fh_status;
+ int fh_present;
struct fh_t fh;
- elem_status_t tim_status;
+ int tim_present;
struct tim_t tim;
};
@@ -315,6 +310,15 @@
#define CTRL_END_ACK_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+\
IEEE802_11_RA_LEN+IEEE802_11_BSSID_LEN)
+struct ctrl_ba_t {
+ u_int16_t fc;
+ u_int16_t duration;
+ u_int8_t ra[6];
+ u_int8_t fcs[4];
+};
+
+#define CTRL_BA_HDRLEN (IEEE802_11_FC_LEN+IEEE802_11_DUR_LEN+IEEE802_11_RA_LEN)
+
struct ctrl_bar_t {
u_int16_t fc;
u_int16_t dur;
@@ -329,6 +333,15 @@
IEEE802_11_RA_LEN+IEEE802_11_TA_LEN+\
IEEE802_11_CTL_LEN+IEEE802_11_SEQ_LEN)
+struct meshcntl_t {
+ u_int8_t flags;
+ u_int8_t ttl;
+ u_int8_t seq[4];
+ u_int8_t addr4[6];
+ u_int8_t addr5[6];
+ u_int8_t addr6[6];
+};
+
#define IV_IV(iv) ((iv) & 0xFFFFFF)
#define IV_PAD(iv) (((iv) >> 24) & 0x3F)
#define IV_KEYID(iv) (((iv) >> 30) & 0x03)
Modified: trunk/contrib/tcpdump/ieee802_11_radio.h
===================================================================
--- trunk/contrib/tcpdump/ieee802_11_radio.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ieee802_11_radio.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,6 +1,6 @@
-/* $FreeBSD: src/contrib/tcpdump/ieee802_11_radio.h,v 1.2.2.1 2007/10/19 03:03:58 mlaier Exp $ */
-/* $NetBSD: ieee802_11_radio.h,v 1.2 2006/02/26 03:04:03 dyoung Exp $ */
-/* $Header: /home/cvs/src/contrib/tcpdump/ieee802_11_radio.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ */
+/* $FreeBSD: release/9.2.0/contrib/tcpdump/ieee802_11_radio.h 236192 2012-05-28 19:13:21Z delphij $ */
+/* NetBSD: ieee802_11_radio.h,v 1.2 2006/02/26 03:04:03 dyoung Exp */
+/* $Header: /tcpdump/master/tcpdump/ieee802_11_radio.h,v 1.3 2007-08-29 02:31:44 mcr Exp $ */
/*-
* Copyright (c) 2003, 2004 David Young. All rights reserved.
@@ -33,11 +33,11 @@
#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.
+/* A generic radio capture format is desirable. It must be
+ * rigidly defined (e.g., units for fields should be given),
+ * and easily extensible.
*
- * I suggest the following extensible radio capture format. It is
+ * The following is an extensible radio capture format. It is
* based on a bitmap indicating which fields are present.
*
* I am trying to describe precisely what the application programmer
@@ -47,11 +47,6 @@
* 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.
@@ -77,7 +72,7 @@
* Additional extensions are made
* by setting bit 31.
*/
-} __attribute__((__packed__));
+};
/* Name Data type Units
* ---- --------- -----
@@ -163,6 +158,10 @@
* Unitless indication of the Rx/Tx antenna for this packet.
* The first antenna is antenna 0.
*
+ * IEEE80211_RADIOTAP_RX_FLAGS u_int16_t bitmap
+ *
+ * Properties of received frames. See flags defined below.
+ *
* IEEE80211_RADIOTAP_XCHANNEL u_int32_t bitmap
* u_int16_t MHz
* u_int8_t channel number
@@ -174,9 +173,24 @@
* units. This property supersedes IEEE80211_RADIOTAP_CHANNEL
* and only one of the two should be present.
*
- * IEEE80211_RADIOTAP_FCS u_int32_t data
+ * IEEE80211_RADIOTAP_MCS u_int8_t known
+ * u_int8_t flags
+ * u_int8_t mcs
*
- * FCS from frame in network byte order.
+ * Bitset indicating which fields have known values, followed
+ * by bitset of flag values, followed by the MCS rate index as
+ * in IEEE 802.11n.
+ *
+ * IEEE80211_RADIOTAP_VENDOR_NAMESPACE
+ * u_int8_t OUI[3]
+ * u_int8_t subspace
+ * u_int16_t length
+ *
+ * The Vendor Namespace Field contains three sub-fields. The first
+ * sub-field is 3 bytes long. It contains the vendor's IEEE 802
+ * Organizationally Unique Identifier (OUI). The fourth byte is a
+ * vendor-specific "namespace selector."
+ *
*/
enum ieee80211_radiotap_type {
IEEE80211_RADIOTAP_TSFT = 0,
@@ -193,12 +207,16 @@
IEEE80211_RADIOTAP_ANTENNA = 11,
IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12,
IEEE80211_RADIOTAP_DB_ANTNOISE = 13,
- IEEE80211_RADIOTAP_XCHANNEL = 14,
+ IEEE80211_RADIOTAP_RX_FLAGS = 14,
+ /* NB: gap for netbsd definitions */
+ IEEE80211_RADIOTAP_XCHANNEL = 18,
+ IEEE80211_RADIOTAP_MCS = 19,
+ IEEE80211_RADIOTAP_NAMESPACE = 29,
+ IEEE80211_RADIOTAP_VENDOR_NAMESPACE = 30,
IEEE80211_RADIOTAP_EXT = 31
};
-#ifndef _KERNEL
-/* Channel flags; some are used only with XCHANNEL */
+/* channel attributes */
#define IEEE80211_CHAN_TURBO 0x00010 /* Turbo channel */
#define IEEE80211_CHAN_CCK 0x00020 /* CCK channel */
#define IEEE80211_CHAN_OFDM 0x00040 /* OFDM channel */
@@ -214,8 +232,20 @@
#define IEEE80211_CHAN_HT20 0x10000 /* HT 20 channel */
#define IEEE80211_CHAN_HT40U 0x20000 /* HT 40 channel w/ ext above */
#define IEEE80211_CHAN_HT40D 0x40000 /* HT 40 channel w/ ext below */
-#endif /* !_KERNEL */
+/* Useful combinations of channel characteristics, borrowed from Ethereal */
+#define IEEE80211_CHAN_A \
+ (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM)
+#define IEEE80211_CHAN_B \
+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK)
+#define IEEE80211_CHAN_G \
+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN)
+#define IEEE80211_CHAN_TA \
+ (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO)
+#define IEEE80211_CHAN_TG \
+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN | IEEE80211_CHAN_TURBO)
+
+
/* For IEEE80211_RADIOTAP_FLAGS */
#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received
* during CFP
@@ -237,4 +267,25 @@
*/
#define IEEE80211_RADIOTAP_F_BADFCS 0x40 /* does not pass FCS check */
+/* For IEEE80211_RADIOTAP_RX_FLAGS */
+#define IEEE80211_RADIOTAP_F_RX_BADFCS 0x0001 /* frame failed crc check */
+#define IEEE80211_RADIOTAP_F_RX_PLCP_CRC 0x0002 /* frame failed PLCP CRC check */
+
+/* For IEEE80211_RADIOTAP_MCS known */
+#define IEEE80211_RADIOTAP_MCS_BANDWIDTH_KNOWN 0x01
+#define IEEE80211_RADIOTAP_MCS_MCS_INDEX_KNOWN 0x02 /* MCS index field */
+#define IEEE80211_RADIOTAP_MCS_GUARD_INTERVAL_KNOWN 0x04
+#define IEEE80211_RADIOTAP_MCS_HT_FORMAT_KNOWN 0x08
+#define IEEE80211_RADIOTAP_MCS_FEC_TYPE_KNOWN 0x10
+
+/* For IEEE80211_RADIOTAP_MCS flags */
+#define IEEE80211_RADIOTAP_MCS_BANDWIDTH_MASK 0x03
+#define IEEE80211_RADIOTAP_MCS_BANDWIDTH_20 0
+#define IEEE80211_RADIOTAP_MCS_BANDWIDTH_40 1
+#define IEEE80211_RADIOTAP_MCS_BANDWIDTH_20L 2
+#define IEEE80211_RADIOTAP_MCS_BANDWIDTH_20U 3
+#define IEEE80211_RADIOTAP_MCS_SHORT_GI 0x04 /* short guard interval */
+#define IEEE80211_RADIOTAP_MCS_HT_GREENFIELD 0x08
+#define IEEE80211_RADIOTAP_MCS_FEC_LDPC 0x10
+
#endif /* _NET_IF_IEEE80211RADIOTAP_H_ */
Modified: trunk/contrib/tcpdump/igrp.h
===================================================================
--- trunk/contrib/tcpdump/igrp.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/igrp.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/igrp.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/igrp.h,v 1.6 2002-12-11 07:13:52 guy Exp $ (LBL) */
/* Cisco IGRP definitions */
/* IGRP Header */
Added: trunk/contrib/tcpdump/in_cksum.c
===================================================================
--- trunk/contrib/tcpdump/in_cksum.c (rev 0)
+++ trunk/contrib/tcpdump/in_cksum.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,200 @@
+/* in_cksum.c
+ * 4.4-Lite-2 Internet checksum routine, modified to take a vector of
+ * pointers/lengths giving the pieces to be checksummed. Also using
+ * Tahoe/CGI version of ADDCARRY(x) macro instead of from portable version.
+ */
+
+/*
+ * Copyright (c) 1988, 1992, 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. 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.
+ *
+ * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include "interface.h"
+
+/*
+ * Checksum routine for Internet Protocol family headers (Portable Version).
+ *
+ * This routine is very heavily used in the network
+ * code and should be modified for each CPU to be as fast as possible.
+ */
+
+#define ADDCARRY(x) {if ((x) > 65535) (x) -= 65535;}
+#define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);}
+
+u_int16_t
+in_cksum(const struct cksum_vec *vec, int veclen)
+{
+ register const u_int16_t *w;
+ register int sum = 0;
+ register int mlen = 0;
+ int byte_swapped = 0;
+
+ union {
+ u_int8_t c[2];
+ u_int16_t s;
+ } s_util;
+ union {
+ u_int16_t s[2];
+ u_int32_t l;
+ } l_util;
+
+ for (; veclen != 0; vec++, veclen--) {
+ if (vec->len == 0)
+ continue;
+ w = (const u_int16_t *)(void *)vec->ptr;
+ if (mlen == -1) {
+ /*
+ * The first byte of this chunk is the continuation
+ * of a word spanning between this chunk and the
+ * last chunk.
+ *
+ * s_util.c[0] is already saved when scanning previous
+ * chunk.
+ */
+ s_util.c[1] = *(const u_int8_t *)w;
+ sum += s_util.s;
+ w = (const u_int16_t *)(void *)((const u_int8_t *)w + 1);
+ mlen = vec->len - 1;
+ } else
+ mlen = vec->len;
+ /*
+ * Force to even boundary.
+ */
+ if ((1 & (unsigned long) w) && (mlen > 0)) {
+ REDUCE;
+ sum <<= 8;
+ s_util.c[0] = *(const u_int8_t *)w;
+ w = (const u_int16_t *)(void *)((const u_int8_t *)w + 1);
+ mlen--;
+ byte_swapped = 1;
+ }
+ /*
+ * Unroll the loop to make overhead from
+ * branches &c small.
+ */
+ while ((mlen -= 32) >= 0) {
+ sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
+ sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7];
+ sum += w[8]; sum += w[9]; sum += w[10]; sum += w[11];
+ sum += w[12]; sum += w[13]; sum += w[14]; sum += w[15];
+ w += 16;
+ }
+ mlen += 32;
+ while ((mlen -= 8) >= 0) {
+ sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
+ w += 4;
+ }
+ mlen += 8;
+ if (mlen == 0 && byte_swapped == 0)
+ continue;
+ REDUCE;
+ while ((mlen -= 2) >= 0) {
+ sum += *w++;
+ }
+ if (byte_swapped) {
+ REDUCE;
+ sum <<= 8;
+ byte_swapped = 0;
+ if (mlen == -1) {
+ s_util.c[1] = *(const u_int8_t *)w;
+ sum += s_util.s;
+ mlen = 0;
+ } else
+ mlen = -1;
+ } else if (mlen == -1)
+ s_util.c[0] = *(const u_int8_t *)w;
+ }
+ if (mlen == -1) {
+ /* The last mbuf has odd # of bytes. Follow the
+ standard (the odd byte may be shifted left by 8 bits
+ or not as determined by endian-ness of the machine) */
+ s_util.c[1] = 0;
+ sum += s_util.s;
+ }
+ REDUCE;
+ return (~sum & 0xffff);
+}
+
+/*
+ * Given the host-byte-order value of the checksum field in a packet
+ * header, and the network-byte-order computed checksum of the data
+ * that the checksum covers (including the checksum itself), compute
+ * what the checksum field *should* have been.
+ */
+u_int16_t
+in_cksum_shouldbe(u_int16_t sum, u_int16_t computed_sum)
+{
+ u_int32_t shouldbe;
+
+ /*
+ * The value that should have gone into the checksum field
+ * is the negative of the value gotten by summing up everything
+ * *but* the checksum field.
+ *
+ * We can compute that by subtracting the value of the checksum
+ * field from the sum of all the data in the packet, and then
+ * computing the negative of that value.
+ *
+ * "sum" is the value of the checksum field, and "computed_sum"
+ * is the negative of the sum of all the data in the packets,
+ * so that's -(-computed_sum - sum), or (sum + computed_sum).
+ *
+ * All the arithmetic in question is one's complement, so the
+ * addition must include an end-around carry; we do this by
+ * doing the arithmetic in 32 bits (with no sign-extension),
+ * and then adding the upper 16 bits of the sum, which contain
+ * the carry, to the lower 16 bits of the sum, and then do it
+ * again in case *that* sum produced a carry.
+ *
+ * As RFC 1071 notes, the checksum can be computed without
+ * byte-swapping the 16-bit words; summing 16-bit words
+ * on a big-endian machine gives a big-endian checksum, which
+ * can be directly stuffed into the big-endian checksum fields
+ * in protocol headers, and summing words on a little-endian
+ * machine gives a little-endian checksum, which must be
+ * byte-swapped before being stuffed into a big-endian checksum
+ * field.
+ *
+ * "computed_sum" is a network-byte-order value, so we must put
+ * it in host byte order before subtracting it from the
+ * host-byte-order value from the header; the adjusted checksum
+ * will be in host byte order, which is what we'll return.
+ */
+ shouldbe = sum;
+ shouldbe += ntohs(computed_sum);
+ shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16);
+ shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16);
+ return shouldbe;
+}
Property changes on: trunk/contrib/tcpdump/in_cksum.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: trunk/contrib/tcpdump/install-sh
===================================================================
--- trunk/contrib/tcpdump/install-sh 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/install-sh 2016-09-17 22:44:52 UTC (rev 8321)
Property changes on: trunk/contrib/tcpdump/install-sh
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/contrib/tcpdump/interface.h
===================================================================
--- trunk/contrib/tcpdump/interface.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/interface.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,8 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/interface.h,v 1.12.2.1 2007/10/19 03:03:58 mlaier Exp $
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/interface.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.285 2008-08-16 11:36:20 hannes Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
@@ -29,10 +28,6 @@
#include "os-proto.h"
#endif
-#ifndef HAVE___ATTRIBUTE__
-#define __attribute__(x)
-#endif
-
/* snprintf et al */
#include <stdarg.h>
@@ -75,6 +70,10 @@
#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 */
+#define PT_CARP 10 /* Common Address Redundancy Protocol */
+#define PT_RADIUS 11 /* RADIUS authentication Protocol */
+#define PT_ZMTP1 12 /* ZeroMQ Message Transport Protocol 1.0 */
+#define PT_VXLAN 13 /* Virtual eXtensible Local Area Network */
#ifndef min
#define min(a,b) ((a)>(b)?(b):(a))
@@ -83,21 +82,6 @@
#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)
@@ -165,6 +149,11 @@
extern const char *dnname_string(u_short);
extern const char *dnnum_string(u_short);
+/* checksum routines */
+extern void init_checksum(void);
+extern u_int16_t verify_crc10_cksum(u_int16_t, const u_char *, int);
+extern u_int16_t create_osi_cksum(const u_int8_t *, int, int);
+
/* The printer routines. */
#include <pcap.h>
@@ -177,10 +166,9 @@
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 int snap_print(const u_char *, u_int, u_int, u_int);
extern void aarp_print(const u_char *, u_int);
extern void aodv_print(const u_char *, u_int, int);
extern void atalk_print(const u_char *, u_int);
@@ -198,10 +186,9 @@
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 void pfsync_ip_print(const u_char *, u_int);
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);
@@ -210,10 +197,13 @@
extern u_int mfr_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int fr_print(register const u_char *, u_int);
extern u_int mfr_print(register const u_char *, u_int);
+extern char *q922_string(const u_char *);
extern u_int ieee802_11_if_print(const struct pcap_pkthdr *, const u_char *);
extern u_int ieee802_11_radio_if_print(const struct pcap_pkthdr *,
const u_char *);
extern u_int ap1394_if_print(const struct pcap_pkthdr *, const u_char *);
+extern u_int ieee802_11_radio_avs_if_print(const struct pcap_pkthdr *,
+ const u_char *);
extern void gre_print(const u_char *, u_int);
extern void icmp_print(const u_char *, u_int, const u_char *, int);
extern void igmp_print(const u_char *, u_int);
@@ -229,19 +219,24 @@
extern void nfsreply_print(const u_char *, u_int, const u_char *);
extern void nfsreq_print(const u_char *, u_int, const u_char *);
extern void ns_print(const u_char *, u_int, int);
+extern const u_char * ns_nprint (register const u_char *, register const u_char *);
extern void ntp_print(const u_char *, u_int);
extern u_int null_if_print(const struct pcap_pkthdr *, const u_char *);
extern void ospf_print(const u_char *, u_int, const u_char *);
-extern void olsr_print (const u_char *, u_int);
+extern void olsr_print (const u_char *, u_int, int);
extern void pimv1_print(const u_char *, u_int);
extern void cisco_autorp_print(const u_char *, u_int);
extern void rsvp_print(const u_char *, u_int);
extern void ldp_print(const u_char *, u_int);
+extern void lldp_print(const u_char *, u_int);
+extern void rpki_rtr_print(const u_char *, u_int);
extern void lmp_print(const u_char *, u_int);
extern void lspping_print(const u_char *, u_int);
+extern void lwapp_control_print(const u_char *, u_int, int);
+extern void lwapp_data_print(const u_char *, u_int);
extern void eigrp_print(const u_char *, u_int);
extern void mobile_print(const u_char *, u_int);
-extern void pim_print(const u_char *, u_int);
+extern void pim_print(const u_char *, u_int, u_int);
extern u_int pppoe_print(const u_char *, u_int);
extern u_int ppp_print(register const u_char *, u_int);
extern u_int ppp_if_print(const struct pcap_pkthdr *, const u_char *);
@@ -251,6 +246,7 @@
extern u_int prism_if_print(const struct pcap_pkthdr *, const u_char *);
extern void q933_print(const u_char *, u_int);
extern int vjc_print(register const char *, u_short);
+extern void vqp_print(register const u_char *, register u_int);
extern u_int raw_if_print(const struct pcap_pkthdr *, const u_char *);
extern void rip_print(const u_char *, u_int);
extern u_int sl_if_print(const struct pcap_pkthdr *, const u_char *);
@@ -282,7 +278,9 @@
extern void tcp_print(const u_char *, u_int, const u_char *, int);
extern void tftp_print(const u_char *, u_int);
extern void timed_print(const u_char *);
+extern void udld_print(const u_char *, u_int);
extern void udp_print(const u_char *, u_int, const u_char *, int);
+extern void vtp_print(const u_char *, u_int);
extern void wb_print(const void *, u_int);
extern int ah_print(register const u_char *);
extern int ipcomp_print(register const u_char *, int *);
@@ -292,14 +290,20 @@
extern void nbt_tcp_print(const u_char *, int);
extern void nbt_udp137_print(const u_char *, int);
extern void nbt_udp138_print(const u_char *, int);
+extern void smb_tcp_print(const u_char *, int);
extern char *smb_errstr(int, int);
extern const char *nt_errstr(u_int32_t);
extern void print_data(const unsigned char *, int);
extern void l2tp_print(const u_char *, u_int);
extern void vrrp_print(const u_char *, u_int, int);
+extern void carp_print(const u_char *, u_int, int);
extern void slow_print(const u_char *, u_int);
+extern void sflow_print(const u_char *, u_int);
+extern void mpcp_print(const u_char *, u_int);
+extern void cfm_print(const u_char *, u_int);
extern void pgm_print(const u_char *, u_int, const u_char *);
extern void cdp_print(const u_char *, u_int, u_int);
+extern void dtp_print(const u_char *, u_int);
extern void stp_print(const u_char *, u_int);
extern void radius_print(const u_char *, u_int);
extern void lwres_print(const u_char *, u_int);
@@ -306,34 +310,47 @@
extern void pptp_print(const u_char *);
extern void dccp_print(const u_char *, const u_char *, u_int);
extern void sctp_print(const u_char *, const u_char *, u_int);
+extern void forces_print(const u_char *, u_int);
extern void mpls_print(const u_char *, u_int);
extern void mpls_lsp_ping_print(const u_char *, u_int);
extern void zephyr_print(const u_char *, int);
+extern void zmtp1_print(const u_char *, u_int);
extern void hsrp_print(const u_char *, u_int);
extern void bfd_print(const u_char *, u_int, u_int);
extern void sip_print(const u_char *, u_int);
extern void syslog_print(const u_char *, u_int);
+extern u_int bt_if_print(const struct pcap_pkthdr *, const u_char *);
+extern u_int usb_linux_48_byte_print(const struct pcap_pkthdr *, const u_char *);
+extern u_int usb_linux_64_byte_print(const struct pcap_pkthdr *, const u_char *);
+extern void vxlan_print(const u_char *, u_int);
+extern void otv_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);
+extern void babel_print(const u_char *, u_int);
+extern int mask62plen(const u_char *);
#endif /*INET6*/
-extern u_short in_cksum(const u_short *, register u_int, int);
+
+struct cksum_vec {
+ const u_int8_t *ptr;
+ int len;
+};
+extern u_int16_t in_cksum(const struct cksum_vec *, int);
extern u_int16_t in_cksum_shouldbe(u_int16_t, u_int16_t);
#ifndef HAVE_BPF_DUMP
struct bpf_program;
-extern void bpf_dump(struct bpf_program *, int);
+extern void bpf_dump(const struct bpf_program *, int);
#endif
@@ -341,10 +358,14 @@
/* forward compatibility */
+#ifndef NETDISSECT_REWORKED
extern netdissect_options *gndo;
+#define bflag gndo->ndo_bflag
#define eflag gndo->ndo_eflag
#define fflag gndo->ndo_fflag
+#define jflag gndo->ndo_jflag
+#define Kflag gndo->ndo_Kflag
#define nflag gndo->ndo_nflag
#define Nflag gndo->ndo_Nflag
#define Oflag gndo->ndo_Oflag
@@ -360,13 +381,20 @@
#define xflag gndo->ndo_xflag
#define Xflag gndo->ndo_Xflag
#define Cflag gndo->ndo_Cflag
+#define Gflag gndo->ndo_Gflag
#define Aflag gndo->ndo_Aflag
+#define Bflag gndo->ndo_Bflag
+#define Iflag gndo->ndo_Iflag
#define suppress_default_print gndo->ndo_suppress_default_print
#define packettype gndo->ndo_packettype
-#define tcpmd5secret gndo->ndo_tcpmd5secret
+#define sigsecret gndo->ndo_sigsecret
#define Wflag gndo->ndo_Wflag
#define WflagChars gndo->ndo_WflagChars
#define Cflag_count gndo->ndo_Cflag_count
+#define Gflag_count gndo->ndo_Gflag_count
+#define Gflag_time gndo->ndo_Gflag_time
+#define Hflag gndo->ndo_Hflag
#define snaplen gndo->ndo_snaplen
#define snapend gndo->ndo_snapend
+#endif
Modified: trunk/contrib/tcpdump/ip.h
===================================================================
--- trunk/contrib/tcpdump/ip.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ip.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/ip.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ip.h,v 1.12 2007-09-14 01:29:28 guy Exp $ (LBL) */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
@@ -62,7 +62,7 @@
u_int8_t ip_p; /* protocol */
u_int16_t ip_sum; /* checksum */
struct in_addr ip_src,ip_dst; /* source and dest address */
-};
+} UNALIGNED;
#define IP_MAXPACKET 65535 /* maximum packet size */
@@ -134,7 +134,7 @@
u_int32_t ipt_time;
} ipt_ta[1];
} ipt_timestamp;
-};
+} UNALIGNED;
/* flag bits for ipt_flg */
#define IPOPT_TS_TSONLY 0 /* timestamps only */
@@ -161,4 +161,4 @@
#define IP_MSS 576 /* default maximum segment size */
/* in print-ip.c */
-extern u_int32_t ip_finddst(const struct ip *);
+extern int nextproto4_cksum(const struct ip *, const u_int8_t *, u_int, u_int);
Modified: trunk/contrib/tcpdump/ip6.h
===================================================================
--- trunk/contrib/tcpdump/ip6.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ip6.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,5 +1,5 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/ip6.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL) */
-/* $NetBSD: ip6.h,v 1.9 2000/07/13 05:34:21 itojun Exp $ */
+/* @(#) $Header: /tcpdump/master/tcpdump/ip6.h,v 1.8 2007-08-29 02:31:44 mcr Exp $ (LBL) */
+/* NetBSD: ip6.h,v 1.9 2000/07/13 05:34:21 itojun Exp */
/* $KAME: ip6.h,v 1.9 2000/07/02 21:01:32 itojun Exp $ */
/*
@@ -86,7 +86,7 @@
} ip6_ctlun;
struct in6_addr ip6_src; /* source address */
struct in6_addr ip6_dst; /* destination address */
-};
+} UNALIGNED;
#define ip6_vfc ip6_ctlun.ip6_un2_vfc
#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
@@ -109,25 +109,23 @@
*/
struct ip6_ext {
- u_char ip6e_nxt;
- u_char ip6e_len;
-};
+ u_int8_t ip6e_nxt;
+ u_int8_t ip6e_len;
+} UNALIGNED;
/* 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 */
-};
+} UNALIGNED;
/* 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 */
-};
+} UNALIGNED;
/* Option types and related macros */
#define IP6OPT_PAD1 0x00 /* 00 0 00000 */
@@ -163,7 +161,7 @@
u_int8_t ip6r_type; /* routing type */
u_int8_t ip6r_segleft; /* segments left */
/* followed by routing type specific data */
-};
+} UNALIGNED;
/* Type 0 Routing header */
struct ip6_rthdr0 {
@@ -174,7 +172,7 @@
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 */
-};
+} UNALIGNED;
/* Fragment header */
struct ip6_frag {
@@ -182,10 +180,13 @@
u_int8_t ip6f_reserved; /* reserved field */
u_int16_t ip6f_offlg; /* offset, reserved, and flag */
u_int32_t ip6f_ident; /* identification */
-};
+} UNALIGNED;
#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 */
+/* in print-ip6.c */
+extern int nextproto6_cksum(const struct ip6_hdr *, const u_int8_t *, u_int, u_int);
+
#endif /* not _NETINET_IP6_H_ */
Modified: trunk/contrib/tcpdump/ipfc.h
===================================================================
--- trunk/contrib/tcpdump/ipfc.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ipfc.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/ipfc.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/ipfc.h,v 1.4 2002-12-11 07:13:53 guy Exp $ (LBL)
*/
struct ipfc_header {
Added: trunk/contrib/tcpdump/ipnet.h
===================================================================
--- trunk/contrib/tcpdump/ipnet.h (rev 0)
+++ trunk/contrib/tcpdump/ipnet.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,13 @@
+typedef struct ipnet_hdr {
+ uint8_t iph_version;
+ uint8_t iph_family;
+ uint16_t iph_htype;
+ uint32_t iph_pktlen;
+ uint32_t iph_ifindex;
+ uint32_t iph_grifindex;
+ uint32_t iph_zsrc;
+ uint32_t iph_zdst;
+} ipnet_hdr_t;
+
+#define IPH_AF_INET 2 /* Matches Solaris's AF_INET */
+#define IPH_AF_INET6 26 /* Matches Solaris's AF_INET6 */
Property changes on: trunk/contrib/tcpdump/ipnet.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/ipproto.c
===================================================================
--- trunk/contrib/tcpdump/ipproto.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ipproto.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -15,7 +15,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/ipproto.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/ipproto.c,v 1.6 2005-09-20 06:01:22 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -27,7 +27,7 @@
#include "interface.h"
#include "ipproto.h"
-struct tok ipproto_values[] = {
+const struct tok ipproto_values[] = {
{ IPPROTO_HOPOPTS, "Options" },
{ IPPROTO_ICMP, "ICMP" },
{ IPPROTO_IGMP, "IGMP" },
@@ -55,6 +55,8 @@
{ IPPROTO_PGM, "PGM" },
{ IPPROTO_SCTP, "SCTP" },
{ IPPROTO_MOBILITY, "Mobility" },
+ { IPPROTO_CARP, "CARP" },
+ { IPPROTO_PFSYNC, "pfsync" },
{ 0, NULL }
};
Property changes on: trunk/contrib/tcpdump/ipproto.c
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/contrib/tcpdump/ipproto.h
===================================================================
--- trunk/contrib/tcpdump/ipproto.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ipproto.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -30,14 +30,15 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/ipproto.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/ipproto.h,v 1.6 2005-09-20 06:01:22 guy Exp $ (LBL)
*
* From:
* @(#)in.h 8.3 (Berkeley) 1/3/94
- * $FreeBSD: src/contrib/tcpdump/ipproto.h,v 1.1.1.4 2006/09/04 20:03:46 sam Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/ipproto.h 236192 2012-05-28 19:13:21Z delphij $
+ * FreeBSD: src/sys/netinet/in.h,v 1.38.2.3 1999/08/29 16:29:34 peter Exp
*/
-extern struct tok ipproto_values[];
+extern const struct tok ipproto_values[];
#ifndef IPPROTO_IP
#define IPPROTO_IP 0 /* dummy for IP */
@@ -133,6 +134,9 @@
#ifndef IPPROTO_VRRP
#define IPPROTO_VRRP 112
#endif
+#ifndef IPPROTO_CARP
+#define IPPROTO_CARP 112
+#endif
#ifndef IPPROTO_PGM
#define IPPROTO_PGM 113
#endif
Modified: trunk/contrib/tcpdump/ipsec_doi.h
===================================================================
--- trunk/contrib/tcpdump/ipsec_doi.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ipsec_doi.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-/* YIPS @(#)$Id: ipsec_doi.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ */
+/* YIPS @(#)$Id: ipsec_doi.h,v 1.7 2002-12-11 07:13:53 guy Exp $ */
/* refer to RFC 2407 */
Modified: trunk/contrib/tcpdump/ipx.h
===================================================================
--- trunk/contrib/tcpdump/ipx.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ipx.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,7 +1,7 @@
/*
* IPX protocol formats
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/ipx.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $
+ * @(#) $Header: /tcpdump/master/tcpdump/ipx.h,v 1.8 2002-12-11 07:13:54 guy Exp $
*/
/* well-known sockets */
Modified: trunk/contrib/tcpdump/isakmp.h
===================================================================
--- trunk/contrib/tcpdump/isakmp.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/isakmp.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-/* YIPS @(#)$Id: isakmp.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ */
+/* YIPS @(#)$Id: isakmp.h,v 1.12 2007-11-24 18:13:33 mcr Exp $ */
/* refer to RFC 2408 */
@@ -81,7 +81,7 @@
#define ISAKMP_TIMER_DEFAULT 10 /* seconds */
#define ISAKMP_TRY_DEFAULT 3 /* times */
-/* 3.1 ISAKMP Header Format
+/* 3.1 ISAKMP Header Format (IKEv1 and IKEv2)
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! Initiator !
@@ -127,10 +127,14 @@
#define ISAKMP_NPTYPE_N 11 /* Notification */
#define ISAKMP_NPTYPE_D 12 /* Delete */
#define ISAKMP_NPTYPE_VID 13 /* Vendor ID */
+#define ISAKMP_NPTYPE_v2E 46 /* v2 Encrypted payload */
-#define ISAKMP_MAJOR_VERSION 1
-#define ISAKMP_MINOR_VERSION 0
+#define IKEv1_MAJOR_VERSION 1
+#define IKEv1_MINOR_VERSION 0
+#define IKEv2_MAJOR_VERSION 2
+#define IKEv2_MINOR_VERSION 0
+
/* Exchange Type */
#define ISAKMP_ETYPE_NONE 0 /* NONE */
#define ISAKMP_ETYPE_BASE 1 /* Base */
@@ -142,7 +146,14 @@
/* Flags */
#define ISAKMP_FLAG_E 0x01 /* Encryption Bit */
#define ISAKMP_FLAG_C 0x02 /* Commit Bit */
+#define ISAKMP_FLAG_extra 0x04
+/* IKEv2 */
+#define ISAKMP_FLAG_I (1 << 3) /* (I)nitiator */
+#define ISAKMP_FLAG_V (1 << 4) /* (V)ersion */
+#define ISAKMP_FLAG_R (1 << 5) /* (R)esponse */
+
+
/* 3.2 Payload Generic Header
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -151,7 +162,7 @@
*/
struct isakmp_gen {
u_int8_t np; /* Next Payload */
- u_int8_t reserved; /* RESERVED, unused, must set to 0 */
+ u_int8_t critical; /* bit 7 - critical, rest is RESERVED */
u_int16_t len; /* Payload Length */
};
@@ -188,7 +199,7 @@
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 ikev1_pl_sa {
struct isakmp_gen h;
u_int32_t doi; /* Domain of Interpretation */
u_int32_t sit; /* Situation */
@@ -202,7 +213,7 @@
last within the security association proposal, then this field will
be 0.
*/
-struct isakmp_pl_p {
+struct ikev1_pl_p {
struct isakmp_gen h;
u_int8_t p_no; /* Proposal # */
u_int8_t prot_id; /* Protocol */
@@ -218,7 +229,7 @@
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 ikev1_pl_t {
struct isakmp_gen h;
u_int8_t t_no; /* Transform # */
u_int8_t t_id; /* Transform-Id */
@@ -227,7 +238,7 @@
};
/* 3.7 Key Exchange Payload */
-struct isakmp_pl_ke {
+struct ikev1_pl_ke {
struct isakmp_gen h;
/* Key Exchange Data */
};
@@ -234,7 +245,7 @@
/* 3.8 Identification Payload */
/* MUST NOT to be used, because of being defined in ipsec-doi. */
-struct isakmp_pl_id {
+struct ikev1_pl_id {
struct isakmp_gen h;
union {
u_int8_t id_type; /* ID Type */
@@ -244,7 +255,7 @@
};
/* 3.9 Certificate Payload */
-struct isakmp_pl_cert {
+struct ikev1_pl_cert {
struct isakmp_gen h;
u_int8_t encode; /* Cert Encoding */
char cert; /* Certificate Data */
@@ -268,7 +279,7 @@
#define ISAKMP_CERT_SPKI 9
/* 3.10 Certificate Request Payload */
-struct isakmp_pl_cr {
+struct ikev1_pl_cr {
struct isakmp_gen h;
u_int8_t num_cert; /* # Cert. Types */
/*
@@ -283,7 +294,7 @@
/* 3.11 Hash Payload */
/* may not be used, because of having only data. */
-struct isakmp_pl_hash {
+struct ikev1_pl_hash {
struct isakmp_gen h;
/* Hash Data */
};
@@ -290,7 +301,7 @@
/* 3.12 Signature Payload */
/* may not be used, because of having only data. */
-struct isakmp_pl_sig {
+struct ikev1_pl_sig {
struct isakmp_gen h;
/* Signature Data */
};
@@ -297,13 +308,13 @@
/* 3.13 Nonce Payload */
/* may not be used, because of having only data. */
-struct isakmp_pl_nonce {
+struct ikev1_pl_nonce {
struct isakmp_gen h;
/* Nonce Data */
};
/* 3.14 Notification Payload */
-struct isakmp_pl_n {
+struct ikev1_pl_n {
struct isakmp_gen h;
u_int32_t doi; /* Domain of Interpretation */
u_int8_t prot_id; /* Protocol-ID */
@@ -347,7 +358,7 @@
#define ISAKMP_LOG_RETRY_LIMIT_REACHED 65530
/* 3.15 Delete Payload */
-struct isakmp_pl_d {
+struct ikev1_pl_d {
struct isakmp_gen h;
u_int32_t doi; /* Domain of Interpretation */
u_int8_t prot_id; /* Protocol-Id */
@@ -357,15 +368,15 @@
};
-struct isakmp_ph1tab {
- struct isakmp_ph1 *head;
- struct isakmp_ph1 *tail;
+struct ikev1_ph1tab {
+ struct ikev1_ph1 *head;
+ struct ikev1_ph1 *tail;
int len;
};
struct isakmp_ph2tab {
- struct isakmp_ph2 *head;
- struct isakmp_ph2 *tail;
+ struct ikev1_ph2 *head;
+ struct ikev1_ph2 *tail;
int len;
};
@@ -375,4 +386,116 @@
#define PFS_NEED 1
#define PFS_NONEED 0
+/* IKEv2 (RFC4306) */
+
+/* 3.3 Security Association Payload -- generic header */
+/* 3.3.1. Proposal Substructure */
+struct ikev2_p {
+ struct isakmp_gen h;
+ u_int8_t p_no; /* Proposal # */
+ u_int8_t prot_id; /* Protocol */
+ u_int8_t spi_size; /* SPI Size */
+ u_int8_t num_t; /* Number of Transforms */
+};
+
+/* 3.3.2. Transform Substructure */
+struct ikev2_t {
+ struct isakmp_gen h;
+ u_int8_t t_type; /* Transform Type (ENCR,PRF,INTEG,etc.*/
+ u_int8_t res2; /* reserved byte */
+ u_int16_t t_id; /* Transform ID */
+};
+
+enum ikev2_t_type {
+ IV2_T_ENCR = 1,
+ IV2_T_PRF = 2,
+ IV2_T_INTEG= 3,
+ IV2_T_DH = 4,
+ IV2_T_ESN = 5,
+};
+
+/* 3.4. Key Exchange Payload */
+struct ikev2_ke {
+ struct isakmp_gen h;
+ u_int16_t ke_group;
+ u_int16_t ke_res1;
+ /* KE data */
+};
+
+
+/* 3.5. Identification Payloads */
+enum ikev2_id_type {
+ ID_IPV4_ADDR=1,
+ ID_FQDN=2,
+ ID_RFC822_ADDR=3,
+ ID_IPV6_ADDR=5,
+ ID_DER_ASN1_DN=9,
+ ID_DER_ASN1_GN=10,
+ ID_KEY_ID=11,
+};
+struct ikev2_id {
+ struct isakmp_gen h;
+ u_int8_t type; /* ID type */
+ u_int8_t res1;
+ u_int16_t res2;
+ /* SPI */
+ /* Notification Data */
+};
+
+/* 3.10 Notification Payload */
+struct ikev2_n {
+ struct isakmp_gen h;
+ u_int8_t prot_id; /* Protocol-ID */
+ u_int8_t spi_size; /* SPI Size */
+ u_int16_t type; /* Notify Message Type */
+};
+
+enum ikev2_n_type {
+ IV2_NOTIFY_UNSUPPORTED_CRITICAL_PAYLOAD = 1,
+ IV2_NOTIFY_INVALID_IKE_SPI = 4,
+ IV2_NOTIFY_INVALID_MAJOR_VERSION = 5,
+ IV2_NOTIFY_INVALID_SYNTAX = 7,
+ IV2_NOTIFY_INVALID_MESSAGE_ID = 9,
+ IV2_NOTIFY_INVALID_SPI =11,
+ IV2_NOTIFY_NO_PROPOSAL_CHOSEN =14,
+ IV2_NOTIFY_INVALID_KE_PAYLOAD =17,
+ IV2_NOTIFY_AUTHENTICATION_FAILED =24,
+ IV2_NOTIFY_SINGLE_PAIR_REQUIRED =34,
+ IV2_NOTIFY_NO_ADDITIONAL_SAS =35,
+ IV2_NOTIFY_INTERNAL_ADDRESS_FAILURE =36,
+ IV2_NOTIFY_FAILED_CP_REQUIRED =37,
+ IV2_NOTIFY_INVALID_SELECTORS =39,
+ IV2_NOTIFY_INITIAL_CONTACT =16384,
+ IV2_NOTIFY_SET_WINDOW_SIZE =16385,
+ IV2_NOTIFY_ADDITIONAL_TS_POSSIBLE =16386,
+ IV2_NOTIFY_IPCOMP_SUPPORTED =16387,
+ IV2_NOTIFY_NAT_DETECTION_SOURCE_IP =16388,
+ IV2_NOTIFY_NAT_DETECTION_DESTINATION_IP =16389,
+ IV2_NOTIFY_COOKIE =16390,
+ IV2_NOTIFY_USE_TRANSPORT_MODE =16391,
+ IV2_NOTIFY_HTTP_CERT_LOOKUP_SUPPORTED =16392,
+ IV2_NOTIFY_REKEY_SA =16393,
+ IV2_NOTIFY_ESP_TFC_PADDING_NOT_SUPPORTED =16394,
+ IV2_NOTIFY_NON_FIRST_FRAGMENTS_ALSO =16395
+};
+
+struct notify_messages {
+ u_int16_t type;
+ char *msg;
+};
+
+/* 3.8 Notification Payload */
+struct ikev2_auth {
+ struct isakmp_gen h;
+ u_int8_t auth_method; /* Protocol-ID */
+ u_int8_t reserved[3];
+ /* authentication data */
+};
+
+enum ikev2_auth_type {
+ IV2_RSA_SIG = 1,
+ IV2_SHARED = 2,
+ IV2_DSS_SIG = 3,
+};
+
#endif /* !defined(_ISAKMP_H_) */
Modified: trunk/contrib/tcpdump/l2tp.h
===================================================================
--- trunk/contrib/tcpdump/l2tp.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/l2tp.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/l2tp.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL) */
+/* @(#) $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.
Modified: trunk/contrib/tcpdump/l2vpn.c
===================================================================
--- trunk/contrib/tcpdump/l2vpn.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/l2vpn.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -15,7 +15,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/l2vpn.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/l2vpn.c,v 1.1 2004-06-15 09:42:40 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -27,7 +27,7 @@
#include "l2vpn.h"
/* draft-ietf-pwe3-iana-allocation-04 */
-struct tok l2vpn_encaps_values[] = {
+const struct tok l2vpn_encaps_values[] = {
{ 0x00, "Reserved"},
{ 0x01, "Frame Relay"},
{ 0x02, "ATM AAL5 VCC transport"},
Property changes on: trunk/contrib/tcpdump/l2vpn.c
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/contrib/tcpdump/l2vpn.h
===================================================================
--- trunk/contrib/tcpdump/l2vpn.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/l2vpn.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/l2vpn.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL) */
+/* @(#) $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
@@ -14,4 +14,4 @@
* Original code by Hannes Gredler (hannes at juniper.net)
*/
-extern struct tok l2vpn_encaps_values[];
+extern const struct tok l2vpn_encaps_values[];
Property changes on: trunk/contrib/tcpdump/l2vpn.h
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/contrib/tcpdump/lane.h
===================================================================
--- trunk/contrib/tcpdump/lane.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/lane.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -20,7 +20,7 @@
*
*/
-/* $Id: lane.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ */
+/* $Id: lane.h,v 1.7 2002-12-11 07:13:54 guy Exp $ */
#ifndef ETHER_ADDR_LEN
#define ETHER_ADDR_LEN 6
Modified: trunk/contrib/tcpdump/lbl/os-osf4.h
===================================================================
--- trunk/contrib/tcpdump/lbl/os-osf4.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/lbl/os-osf4.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/lbl/os-osf4.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)
+ * @(#) $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 */
Modified: trunk/contrib/tcpdump/lbl/os-solaris2.h
===================================================================
--- trunk/contrib/tcpdump/lbl/os-solaris2.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/lbl/os-solaris2.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/lbl/os-solaris2.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)
+ * @(#) $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 */
Modified: trunk/contrib/tcpdump/lbl/os-sunos4.h
===================================================================
--- trunk/contrib/tcpdump/lbl/os-sunos4.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/lbl/os-sunos4.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/lbl/os-sunos4.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/lbl/os-sunos4.h,v 1.32 1999-10-07 23:47:13 mcr Exp $ (LBL)
*/
/* Prototypes missing in SunOS 4 */
Modified: trunk/contrib/tcpdump/lbl/os-ultrix4.h
===================================================================
--- trunk/contrib/tcpdump/lbl/os-ultrix4.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/lbl/os-ultrix4.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/lbl/os-ultrix4.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/lbl/os-ultrix4.h,v 1.19 1999-10-07 23:47:13 mcr Exp $ (LBL)
*/
/* Prototypes missing in Ultrix 4 */
Modified: trunk/contrib/tcpdump/llc.h
===================================================================
--- trunk/contrib/tcpdump/llc.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/llc.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/llc.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/llc.h,v 1.23 2007-04-13 09:43:11 hannes Exp $ (LBL)
*/
/*
@@ -104,6 +104,8 @@
#define PID_CISCO_CDP 0x2000 /* Cisco Discovery Protocol */
#define PID_CISCO_VTP 0x2003 /* Cisco VLAN Trunk Protocol */
#define PID_CISCO_DTP 0x2004 /* Cisco Dynamic Trunk Protocol */
+#define PID_CISCO_UDLD 0x0111 /* Unidirectional Link Detection */
+#define PID_CISCO_PVST 0x010b /* Per VLAN Spanning Tree+ and RPVST+ */
/*
* PIDs for use with OUI_RFC2684.
Modified: trunk/contrib/tcpdump/machdep.c
===================================================================
--- trunk/contrib/tcpdump/machdep.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/machdep.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/machdep.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/machdep.c,v 1.13 2003-12-15 03:53:21 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/machdep.h
===================================================================
--- trunk/contrib/tcpdump/machdep.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/machdep.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/machdep.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/machdep.h,v 1.2 2000-01-17 06:24:24 itojun Exp $ (LBL)
*/
#ifndef tcpdump_machdep_h
#define tcpdump_machdep_h
Modified: trunk/contrib/tcpdump/makemib
===================================================================
--- trunk/contrib/tcpdump/makemib 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/makemib 2016-09-17 22:44:52 UTC (rev 8321)
@@ -27,7 +27,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
-# @(#) $Id: makemib,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (jlv)
+# @(#) $Id: makemib,v 1.3 2001-09-17 22:16:52 fenner Exp $ (jlv)
#
# This script will read either ASN.1-style MIB files or the ".defs" files
Property changes on: trunk/contrib/tcpdump/makemib
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/contrib/tcpdump/missing/addrinfo.h
===================================================================
--- trunk/contrib/tcpdump/missing/addrinfo.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/missing/addrinfo.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
-/* $Id: addrinfo.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ */
+/* $Id: addrinfo.h,v 1.4 2002-06-11 17:13:36 itojun Exp $ */
#ifndef HAVE_ADDRINFO
@@ -81,9 +81,6 @@
extern void freeaddrinfo (struct addrinfo *);
extern void freehostent (struct hostent *);
-extern char *gai_strerror (int);
-extern int getaddrinfo (const char *, const char *,
- const struct addrinfo *, struct addrinfo **);
extern int getnameinfo (const struct sockaddr *, size_t, char *,
size_t, char *, size_t, int);
extern struct hostent *getipnodebyaddr (const void *, size_t, int, int *);
Modified: trunk/contrib/tcpdump/missing/datalinks.c
===================================================================
--- trunk/contrib/tcpdump/missing/datalinks.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/missing/datalinks.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -33,7 +33,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/missing/datalinks.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/missing/datalinks.c,v 1.3 2003-11-16 09:36:47 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/missing/dlnames.c
===================================================================
--- trunk/contrib/tcpdump/missing/dlnames.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/missing/dlnames.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -33,7 +33,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/missing/dlnames.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/missing/dlnames.c,v 1.5 2003-11-18 23:09:43 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/missing/getnameinfo.c
===================================================================
--- trunk/contrib/tcpdump/missing/getnameinfo.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/missing/getnameinfo.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -43,7 +43,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/missing/getnameinfo.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/missing/getnameinfo.c,v 1.11 2003-11-16 09:36:49 guy Exp $";
#endif
#include <sys/types.h>
Modified: trunk/contrib/tcpdump/missing/inet_aton.c
===================================================================
--- trunk/contrib/tcpdump/missing/inet_aton.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/missing/inet_aton.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -36,11 +36,11 @@
* SUCH DAMAGE.
*/
-/* $Id: inet_aton.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ */
+/* $Id: inet_aton.c,v 1.6 2003-11-16 09:36:49 guy Exp $ */
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/missing/inet_aton.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/missing/inet_aton.c,v 1.6 2003-11-16 09:36:49 guy Exp $";
#endif
#include <tcpdump-stdinc.h>
Modified: trunk/contrib/tcpdump/missing/inet_ntop.c
===================================================================
--- trunk/contrib/tcpdump/missing/inet_ntop.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/missing/inet_ntop.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -36,11 +36,11 @@
* SUCH DAMAGE.
*/
-/* $Id: inet_ntop.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ */
+/* $Id: inet_ntop.c,v 1.8 2005-02-09 02:25:46 guy Exp $ */
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/missing/inet_ntop.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/missing/inet_ntop.c,v 1.8 2005-02-09 02:25:46 guy Exp $";
#endif
#include <tcpdump-stdinc.h>
Modified: trunk/contrib/tcpdump/missing/inet_pton.c
===================================================================
--- trunk/contrib/tcpdump/missing/inet_pton.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/missing/inet_pton.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -36,11 +36,11 @@
* SUCH DAMAGE.
*/
-/* $Id: inet_pton.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ */
+/* $Id: inet_pton.c,v 1.6 2003-11-16 09:36:51 guy Exp $ */
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/missing/inet_pton.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/missing/inet_pton.c,v 1.6 2003-11-16 09:36:51 guy Exp $";
#endif
#include <tcpdump-stdinc.h>
Modified: trunk/contrib/tcpdump/missing/snprintf.c
===================================================================
--- trunk/contrib/tcpdump/missing/snprintf.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/missing/snprintf.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*/
-/* $Id: snprintf.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ */
+/* $Id: snprintf.c,v 1.8 2003-11-16 09:36:51 guy Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -39,7 +39,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/missing/snprintf.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/missing/snprintf.c,v 1.8 2003-11-16 09:36:51 guy Exp $";
#endif
#include <stdio.h>
Modified: trunk/contrib/tcpdump/missing/strdup.c
===================================================================
--- trunk/contrib/tcpdump/missing/strdup.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/missing/strdup.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/missing/strdup.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/missing/strdup.c,v 1.1 2001-01-20 07:26:08 guy Exp $ (LBL)";
#endif /* LIBC_SCCS and not lint */
#include <stddef.h>
Modified: trunk/contrib/tcpdump/missing/strlcat.c
===================================================================
--- trunk/contrib/tcpdump/missing/strlcat.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/missing/strlcat.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -30,7 +30,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/missing/strlcat.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/missing/strlcat.c,v 1.5 2003-11-16 09:36:51 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/missing/strlcpy.c
===================================================================
--- trunk/contrib/tcpdump/missing/strlcpy.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/missing/strlcpy.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -30,7 +30,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/missing/strlcpy.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/missing/strlcpy.c,v 1.5 2003-11-16 09:36:52 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/missing/strsep.c
===================================================================
--- trunk/contrib/tcpdump/missing/strsep.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/missing/strsep.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -33,7 +33,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/missing/strsep.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/missing/strsep.c,v 1.3 2003-03-25 08:33:48 guy Exp $ (LBL)";
#endif /* LIBC_SCCS and not lint */
#ifdef HAVE_CONFIG_H
Index: trunk/contrib/tcpdump/mkdep
===================================================================
--- trunk/contrib/tcpdump/mkdep 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/mkdep 2016-09-17 22:44:52 UTC (rev 8321)
Property changes on: trunk/contrib/tcpdump/mkdep
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/contrib/tcpdump/mpls.h
===================================================================
--- trunk/contrib/tcpdump/mpls.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/mpls.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/mpls.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)
+/* @(#) $Header: /tcpdump/master/tcpdump/mpls.h,v 1.1 2004-06-14 14:47:58 hannes Exp $ (LBL)
* Copyright (C) 2001 WIDE Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Modified: trunk/contrib/tcpdump/nameser.h
===================================================================
--- trunk/contrib/tcpdump/nameser.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/nameser.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/nameser.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/nameser.h,v 1.16 2006-11-10 03:18:21 guy Exp $ (LBL) */
/*
* Copyright (c) 1983, 1989, 1993
* The Regents of the University of California. All rights reserved.
Modified: trunk/contrib/tcpdump/netbios.h
===================================================================
--- trunk/contrib/tcpdump/netbios.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/netbios.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,7 +1,7 @@
/*
* NETBIOS protocol formats
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/netbios.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $
+ * @(#) $Header: /tcpdump/master/tcpdump/netbios.h,v 1.3 2002-12-11 07:13:55 guy Exp $
*/
struct p8022Hdr {
Modified: trunk/contrib/tcpdump/netdissect.h
===================================================================
--- trunk/contrib/tcpdump/netdissect.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/netdissect.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -2,7 +2,7 @@
* Copyright (c) 1988-1997
* The Regents of the University of California. All rights reserved.
*
- * Copyright (c) 1998-2004 Michael Richardson <mcr at tcpdump.org>
+ * Copyright (c) 1998-2012 Michael Richardson <mcr at tcpdump.org>
* The TCPDUMP project
*
* Redistribution and use in source and binary forms, with or without
@@ -21,7 +21,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/netdissect.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.27 2008-08-16 11:36:20 hannes Exp $ (LBL)
*/
#ifndef netdissect_h
@@ -77,6 +77,7 @@
/* tok2str is deprecated */
extern const char *tok2str(const struct tok *, const char *, int);
extern char *bittok2str(const struct tok *, const char *, int);
+extern char *bittok2str_nosep(const struct tok *, const char *, int);
typedef struct netdissect_options netdissect_options;
@@ -83,8 +84,10 @@
struct netdissect_options {
int ndo_aflag; /* translate network and broadcast addresses */
+ int ndo_bflag; /* print 4 byte ASes in ASDOT notation */
int ndo_eflag; /* print ethernet header */
int ndo_fflag; /* don't translate "foreign" IP address */
+ int ndo_Kflag; /* don't check TCP checksums */
int ndo_nflag; /* leave addresses as numbers */
int ndo_Nflag; /* remove domains from printed host names */
int ndo_qflag; /* quick (shorter) output */
@@ -100,14 +103,21 @@
int ndo_Aflag; /* print packet only in ascii observing TAB,
* LF, CR and SPACE as graphical chars
*/
+ int ndo_Bflag; /* buffer size */
+ int ndo_Iflag; /* rfmon (monitor) mode */
int ndo_Oflag; /* run filter code optimizer */
int ndo_dlt; /* if != -1, ask libpcap for the DLT it names*/
+ int ndo_jflag; /* packet time stamp source */
int ndo_pflag; /* don't go promiscuous */
- int ndo_Cflag; /* rotate dump files after this many bytes */
+ int ndo_Cflag; /* rotate dump files after this many bytes */
int ndo_Cflag_count; /* Keep track of which file number we're writing */
+ int ndo_Gflag; /* rotate dump files after this many seconds */
+ int ndo_Gflag_count; /* number of files created with Gflag rotation */
+ time_t ndo_Gflag_time; /* The last time_t the dump file was rotated. */
int ndo_Wflag; /* recycle output files after this number of files */
int ndo_WflagChars;
+ int ndo_Hflag; /* dissect 802.11s draft mesh standard */
int ndo_suppress_default_print; /* don't use default_print() for unknown packet types */
const char *ndo_dltname;
@@ -115,7 +125,7 @@
struct sa_list *ndo_sa_list_head; /* used by print-esp.c */
struct sa_list *ndo_sa_default;
- char *ndo_tcpmd5secret; /* TCP-MD5 secret key */
+ char *ndo_sigsecret; /* Signature verification secret key */
struct esp_algorithm *ndo_espsecret_xform; /* cache of decoded */
char *ndo_espsecret_key;
@@ -141,11 +151,23 @@
void (*ndo_info)(netdissect_options *, int verbose);
int (*ndo_printf)(netdissect_options *,
- const char *fmt, ...);
+ const char *fmt, ...)
+#ifdef __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS
+ __attribute__ ((format (printf, 2, 3)))
+#endif
+ ;
void (*ndo_error)(netdissect_options *,
- const char *fmt, ...);
+ const char *fmt, ...)
+#ifdef __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS
+ __attribute__ ((noreturn, format (printf, 2, 3)))
+#endif
+ ;
void (*ndo_warning)(netdissect_options *,
- const char *fmt, ...);
+ const char *fmt, ...)
+#ifdef __ATTRIBUTE___FORMAT_OK_FOR_FUNCTION_POINTERS
+ __attribute__ ((format (printf, 2, 3)))
+#endif
+ ;
};
#define PT_VAT 1 /* Visual Audio Tool */
@@ -155,6 +177,12 @@
#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 */
+#define PT_CARP 10 /* Common Address Redundancy Protocol */
+#define PT_RADIUS 11 /* RADIUS authentication Protocol */
+#define PT_ZMTP1 12 /* ZeroMQ Message Transport Protocol 1.0 */
+#define PT_VXLAN 13 /* Virtual eXtensible Local Area Network */
#ifndef min
#define min(a,b) ((a)>(b)?(b):(a))
@@ -163,22 +191,21 @@
#define max(a,b) ((b)>(a)?(b):(a))
#endif
-#ifndef INET6
/*
- * The default snapshot length. This value allows most printers to print
- * useful information while keeping the amount of unwanted data down.
- * In particular, it allows for an ethernet header, tcp/ip header, and
- * 14 bytes of data (assuming no ip options).
+ * Maximum snapshot length. This should be enough to capture the full
+ * packet on most network interfaces.
+ *
+ * XXX - could it be larger? If so, should it? Some applications might
+ * use the snapshot length in a savefile header to control the size of
+ * the buffer they allocate, so a size of, say, 2^31-1 might not work
+ * well.
*/
-#define DEFAULT_SNAPLEN 68
-#else
-#define DEFAULT_SNAPLEN 96
-#endif
+#define MAXIMUM_SNAPLEN 65535
-#ifndef BIG_ENDIAN
-#define BIG_ENDIAN 4321
-#define LITTLE_ENDIAN 1234
-#endif
+/*
+ * The default snapshot length is the maximum.
+ */
+#define DEFAULT_SNAPLEN MAXIMUM_SNAPLEN
#define ESRC(ep) ((ep)->ether_shost)
#define EDST(ep) ((ep)->ether_dhost)
@@ -213,7 +240,7 @@
#define ND_PRINT(STUFF) (*ndo->ndo_printf)STUFF
#define ND_DEFAULTPRINT(ap, length) (*ndo->ndo_default_print)(ndo, ap, length)
-#if 0
+#if 0
extern void ts_print(netdissect_options *ipdo,
const struct timeval *);
extern void relts_print(int);
@@ -233,6 +260,9 @@
extern void safeputchar(int);
extern void safeputs(const char *, int);
+#define PLURAL_SUFFIX(n) \
+ (((n) != 1) ? "s" : "")
+
#if 0
extern const char *isonsap_string(netdissect_options *, const u_char *);
extern const char *protoid_string(netdissect_options *, const u_char *);
@@ -244,12 +274,22 @@
#include <pcap.h>
+typedef u_int (*if_ndo_printer)(struct netdissect_options *ndo,
+ const struct pcap_pkthdr *, const u_char *);
+typedef u_int (*if_printer)(const struct pcap_pkthdr *, const u_char *);
-extern void eap_print(netdissect_options *,const u_char *, u_int);
+extern if_ndo_printer lookup_ndo_printer(int);
+extern if_printer lookup_printer(int);
+
+extern void eap_print(netdissect_options *,const u_char *, u_int);
extern int esp_print(netdissect_options *,
register const u_char *bp, int len, register const u_char *bp2,
int *nhdr, int *padlen);
extern void arp_print(netdissect_options *,const u_char *, u_int, u_int);
+extern void tipc_print(netdissect_options *, const u_char *, u_int, u_int);
+extern void msnlb_print(netdissect_options *, const u_char *, u_int);
+extern void icmp6_print(netdissect_options *ndo, const u_char *,
+ u_int, const u_char *, int);
extern void isakmp_print(netdissect_options *,const u_char *,
u_int, const u_char *);
extern void isakmp_rfc3948_print(netdissect_options *,const u_char *,
@@ -258,7 +298,24 @@
extern void ip_print_inner(netdissect_options *ndo,
const u_char *bp, u_int length, u_int nh,
const u_char *bp2);
+extern void rrcp_print(netdissect_options *,const u_char *, u_int);
+extern void ether_print(netdissect_options *,
+ const u_char *, u_int, u_int,
+ void (*)(netdissect_options *, const u_char *),
+ const u_char *);
+
+extern u_int ether_if_print(netdissect_options *,
+ const struct pcap_pkthdr *,const u_char *);
+extern u_int netanalyzer_if_print(netdissect_options *,
+ const struct pcap_pkthdr *,const u_char *);
+extern u_int netanalyzer_transparent_if_print(netdissect_options *,
+ const struct pcap_pkthdr *,
+ const u_char *);
+
+extern int ethertype_print(netdissect_options *,u_short, const u_char *,
+ u_int, u_int);
+
/* stuff that has not yet been rototiled */
#if 0
extern void ascii_print(netdissect_options *,u_int);
@@ -269,8 +326,6 @@
u_int, u_int);
extern void hex_print(netdissect_options *,const char *, u_int);
extern void telnet_print(netdissect_options *,const u_char *, u_int);
-extern int ether_encap_print(netdissect_options *,u_short, const u_char *,
- u_int, u_int, u_short *);
extern int llc_print(netdissect_options *,
const u_char *, u_int, u_int, const u_char *,
const u_char *, u_short *);
@@ -297,7 +352,6 @@
const u_char *);
extern void arcnet_if_print(u_char*,const struct pcap_pkthdr *,const u_char *);
-extern void ether_if_print(u_char *,const struct pcap_pkthdr *,const u_char *);
extern void token_if_print(u_char *,const struct pcap_pkthdr *,const u_char *);
extern void fddi_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
@@ -311,6 +365,7 @@
register const u_char *, u_int);
extern void igrp_print(netdissect_options *,const u_char *, u_int,
const u_char *);
+extern int nextproto4_cksum(const struct ip *, const u_int8_t *, u_int, u_int);
extern void ipN_print(netdissect_options *,const u_char *, u_int);
extern void ipx_print(netdissect_options *,const u_char *, u_int);
extern void isoclns_print(netdissect_options *,const u_char *,
@@ -337,7 +392,7 @@
u_int, const u_char *);
extern void pimv1_print(netdissect_options *,const u_char *, u_int);
extern void mobile_print(netdissect_options *,const u_char *, u_int);
-extern void pim_print(netdissect_options *,const u_char *, u_int);
+extern void pim_print(netdissect_options *,const u_char *, u_int, u_int);
extern void pppoe_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
extern void pppoe_print(netdissect_options *,const u_char *, u_int);
extern void ppp_print(netdissect_options *,
@@ -356,9 +411,10 @@
const struct pcap_pkthdr *, const u_char *);
extern void rip_print(netdissect_options *,const u_char *, u_int);
+extern void rpki_rtr_print(netdissect_options *,const u_char *, u_int);
extern void sctp_print(netdissect_options *ndo,
- const u_char *bp, const u_char *bp2,
+ const u_char *bp, const u_char *bp2,
u_int sctpPacketLength);
extern void sl_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
@@ -402,6 +458,8 @@
extern void lcp_print(netdissect_options *,const u_char *, u_int);
extern void vrrp_print(netdissect_options *,const u_char *bp,
u_int len, int ttl);
+extern void carp_print(netdissect_options *,const u_char *bp,
+ u_int len, int ttl);
extern void cdp_print(netdissect_options *,const u_char *,
u_int, u_int, const u_char *, const u_char *);
extern void stp_print(netdissect_options *,const u_char *p, u_int length);
@@ -408,10 +466,18 @@
extern void radius_print(netdissect_options *,const u_char *, u_int);
extern void lwres_print(netdissect_options *,const u_char *, u_int);
extern void pptp_print(netdissect_options *,const u_char *, u_int);
+#endif
+extern u_int ipnet_if_print(netdissect_options *,const struct pcap_pkthdr *, const u_char *);
+extern u_int ppi_if_print(netdissect_options *,const struct pcap_pkthdr *, const u_char *);
+
+extern u_int ieee802_15_4_if_print(netdissect_options *,const struct pcap_pkthdr *, const u_char *);
+
#ifdef INET6
extern void ip6_print(netdissect_options *,const u_char *, u_int);
+#if 0
extern void ip6_opt_print(netdissect_options *,const u_char *, int);
+extern int nextproto6_cksum(const struct ip6_hdr *, const u_int8_t *, u_int, u_int);
extern int hbhopt_print(netdissect_options *,const u_char *);
extern int dstopt_print(netdissect_options *,const u_char *);
extern int frag6_print(netdissect_options *,const u_char *,
@@ -426,11 +492,24 @@
extern void zephyr_print(netdissect_options * ndo,
const u_char *cp, int length);
+#endif /* 0 */
#endif /*INET6*/
-extern u_short in_cksum(const u_short *,
- register u_int, int);
+#if 0
+struct cksum_vec {
+ const u_int8_t *ptr;
+ int len;
+};
+extern u_int16_t in_cksum(const struct cksum_vec *, int);
+extern u_int16_t in_cksum_shouldbe(u_int16_t, u_int16_t);
#endif
+extern void esp_print_decodesecret(netdissect_options *ndo);
+extern int esp_print_decrypt_buffer_by_ikev2(netdissect_options *ndo,
+ int initiator,
+ u_char spii[8], u_char spir[8],
+ u_char *buf, u_char *end);
+
+
#endif /* netdissect_h */
Modified: trunk/contrib/tcpdump/nfs.h
===================================================================
--- trunk/contrib/tcpdump/nfs.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/nfs.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,5 +1,5 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/nfs.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL) */
-/* $NetBSD: nfs.h,v 1.1 1996/05/23 22:49:53 fvdl Exp $ */
+/* @(#) $Header: /tcpdump/master/tcpdump/nfs.h,v 1.9 2007-11-18 03:24:38 guy Exp $ (LBL) */
+/* NetBSD: nfs.h,v 1.1 1996/05/23 22:49:53 fvdl Exp */
/*
* Copyright (c) 1989, 1993
@@ -36,7 +36,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/contrib/tcpdump/nfs.h,v 1.4 2004/03/31 14:57:24 bms Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/nfs.h 214478 2010-10-28 19:06:17Z rpaulo $
* @(#)nfsproto.h 8.2 (Berkeley) 3/30/95
*/
@@ -216,6 +216,7 @@
#define NFSV3ACCESS_EXTEND 0x08
#define NFSV3ACCESS_DELETE 0x10
#define NFSV3ACCESS_EXECUTE 0x20
+#define NFSV3ACCESS_FULL 0x3f
#define NFSV3WRITE_UNSTABLE 0
#define NFSV3WRITE_DATASYNC 1
@@ -287,22 +288,7 @@
};
typedef struct nfs_uquad nfsuint64;
-#if 0 /* XXX - this doesn't seemed to be used and it doesn't work
- * with non-gcc, so comment it out for now.
- */
-
/*
- * Used to convert between two u_longs and a u_quad_t.
- */
-union nfs_quadconvert {
- u_int32_t lval[2];
- u_int64_t qval;
-};
-typedef union nfs_quadconvert nfsquad_t;
-
-#endif
-
-/*
* NFS Version 3 special file number.
*/
struct nfsv3_spec {
Modified: trunk/contrib/tcpdump/nfsfh.h
===================================================================
--- trunk/contrib/tcpdump/nfsfh.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/nfsfh.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/nfsfh.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/nfsfh.h,v 1.13 2002-04-24 06:27:05 guy Exp $ (LBL) */
/*
* Copyright (c) 1993, 1994 Jeffrey C. Mogul, Digital Equipment Corporation,
@@ -39,7 +39,7 @@
* Jeffrey C. Mogul
* Digital Equipment Corporation
* Western Research Laboratory
- * $FreeBSD: src/contrib/tcpdump/nfsfh.h,v 1.8 2004/03/31 14:57:24 bms Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/nfsfh.h 190207 2009-03-21 18:30:25Z rpaulo $
* $NetBSD: nfsfh.h,v 1.1.1.2 1997/10/03 17:25:13 christos Exp $
*/
Modified: trunk/contrib/tcpdump/nlpid.c
===================================================================
--- trunk/contrib/tcpdump/nlpid.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/nlpid.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -15,7 +15,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/nlpid.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/nlpid.c,v 1.4 2004-10-19 15:27:55 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -26,7 +26,7 @@
#include "interface.h"
#include "nlpid.h"
-struct tok nlpid_values[] = {
+const struct tok nlpid_values[] = {
{ NLPID_NULLNS, "NULL" },
{ NLPID_Q933, "Q.933" },
{ NLPID_LMI, "LMI" },
@@ -36,6 +36,7 @@
{ NLPID_ISIS, "IS-IS" },
{ NLPID_CONS, "CONS" },
{ NLPID_IDRP, "IDRP" },
+ { NLPID_SPB, "ISIS_SPB" },
{ NLPID_MFR, "FRF.15" },
{ NLPID_IP, "IPv4" },
{ NLPID_PPP, "PPP" },
Property changes on: trunk/contrib/tcpdump/nlpid.c
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/contrib/tcpdump/nlpid.h
===================================================================
--- trunk/contrib/tcpdump/nlpid.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/nlpid.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/nlpid.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/nlpid.h,v 1.4 2004-10-19 15:27:55 hannes Exp $ (LBL) */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code
@@ -14,18 +14,19 @@
* Original code by Hannes Gredler (hannes at juniper.net)
*/
-extern struct tok nlpid_values[];
+extern const struct tok nlpid_values[];
-#define NLPID_NULLNS 0x00
+#define NLPID_NULLNS 0x00
#define NLPID_Q933 0x08 /* ANSI T1.617 Annex D or ITU-T Q.933 Annex A */
#define NLPID_LMI 0x09 /* The original, aka Cisco, aka Gang of Four */
#define NLPID_SNAP 0x80
-#define NLPID_CLNP 0x81 /* iso9577 */
-#define NLPID_ESIS 0x82 /* iso9577 */
-#define NLPID_ISIS 0x83 /* iso9577 */
+#define NLPID_CLNP 0x81 /* iso9577 */
+#define NLPID_ESIS 0x82 /* iso9577 */
+#define NLPID_ISIS 0x83 /* iso9577 */
#define NLPID_CONS 0x84
#define NLPID_IDRP 0x85
#define NLPID_MFR 0xb1 /* FRF.15 */
+#define NLPID_SPB 0xc1 /* IEEE 802.1aq/D4.5 */
#define NLPID_IP 0xcc
#define NLPID_PPP 0xcf
#define NLPID_X25_ESIS 0x8a
Modified: trunk/contrib/tcpdump/ntp.h
===================================================================
--- trunk/contrib/tcpdump/ntp.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ntp.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* $Header: /home/cvs/src/contrib/tcpdump/ntp.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ */
+/* $Header: /tcpdump/master/tcpdump/ntp.h,v 1.8 2004-01-28 14:34:50 hannes Exp $ */
/*
* Based on ntp.h from the U of MD implementation
Modified: trunk/contrib/tcpdump/oakley.h
===================================================================
--- trunk/contrib/tcpdump/oakley.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/oakley.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-/* YIPS @(#)$Id: oakley.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ */
+/* YIPS @(#)$Id: oakley.h,v 1.4 2002-12-11 07:13:56 guy Exp $ */
/* refer to RFC 2409 */
Modified: trunk/contrib/tcpdump/ospf.h
===================================================================
--- trunk/contrib/tcpdump/ospf.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ospf.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/ospf.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ospf.h,v 1.23 2007-10-08 07:53:21 hannes Exp $ (LBL) */
/*
* Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved.
@@ -31,7 +31,7 @@
/* Options field
*
* +------------------------------------+
- * | * | O | DC | EA | N/P | MC | E | T |
+ * | DN | O | DC | L | N/P | MC | E | T |
* +------------------------------------+
*
*/
@@ -41,6 +41,7 @@
#define OSPF_OPTION_MC 0x04 /* MC bit: Multicast capable */
#define OSPF_OPTION_NP 0x08 /* N/P bit: NSSA capable */
#define OSPF_OPTION_EA 0x10 /* EA bit: External Attribute capable */
+#define OSPF_OPTION_L 0x10 /* L bit: Packet contains LLS data block */
#define OSPF_OPTION_DC 0x20 /* DC bit: Demand circuit capable */
#define OSPF_OPTION_O 0x40 /* O bit: Opaque LSA capable */
#define OSPF_OPTION_DN 0x80 /* DN bit: Up/Down Bit capable - draft-ietf-ospf-2547-dnbit-04 */
@@ -53,9 +54,10 @@
#define OSPF_AUTH_MD5_LEN 16 /* length of MD5 authentication */
/* db_flags */
-#define OSPF_DB_INIT 0x04 /* */
+#define OSPF_DB_INIT 0x04
#define OSPF_DB_MORE 0x02
-#define OSPF_DB_MASTER 0x01
+#define OSPF_DB_MASTER 0x01
+#define OSPF_DB_RESYNC 0x08 /* RFC4811 */
/* ls_type */
#define LS_TYPE_ROUTER 1 /* router link */
@@ -86,10 +88,10 @@
#define LS_OPAQUE_TE_LINK_SUBTLV_MAX_RES_BW 7 /* rfc3630 */
#define LS_OPAQUE_TE_LINK_SUBTLV_UNRES_BW 8 /* rfc3630 */
#define LS_OPAQUE_TE_LINK_SUBTLV_ADMIN_GROUP 9 /* rfc3630 */
-#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_LOCAL_REMOTE_ID 11 /* draft-ietf-ccamp-ospf-gmpls-extensions */
-#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_PROTECTION_TYPE 14 /* draft-ietf-ccamp-ospf-gmpls-extensions */
-#define LS_OPAQUE_TE_LINK_SUBTLV_INTF_SW_CAP_DESCR 15 /* draft-ietf-ccamp-ospf-gmpls-extensions */
-#define LS_OPAQUE_TE_LINK_SUBTLV_SHARED_RISK_GROUP 16 /* draft-ietf-ccamp-ospf-gmpls-extensions */
+#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_LOCAL_REMOTE_ID 11 /* rfc4203 */
+#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_PROTECTION_TYPE 14 /* rfc4203 */
+#define LS_OPAQUE_TE_LINK_SUBTLV_INTF_SW_CAP_DESCR 15 /* rfc4203 */
+#define LS_OPAQUE_TE_LINK_SUBTLV_SHARED_RISK_GROUP 16 /* rfc4203 */
#define LS_OPAQUE_TE_LINK_SUBTLV_BW_CONSTRAINTS 17 /* rfc4124 */
#define LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE_PTP 1 /* rfc3630 */
@@ -106,13 +108,7 @@
#define LS_OPAQUE_RI_TLV_CAP 1 /* draft-ietf-ospf-cap-03 */
-/*************************************************
- *
- * is the above a bug in the documentation?
- *
- *************************************************/
-
/* rla_link.link_type */
#define RLA_TYPE_ROUTER 1 /* point-to-point to another router */
#define RLA_TYPE_TRANSIT 2 /* connection to transit network */
@@ -140,6 +136,31 @@
#define MCLA_VERTEX_ROUTER 1
#define MCLA_VERTEX_NETWORK 2
+/* Link-Local-Signaling */
+#define OSPF_LLS_EO 1 /* RFC4811, RFC4812 */
+#define OSPF_LLS_MD5 2 /* RFC4813 */
+
+#define OSPF_LLS_EO_LR 0x00000001 /* RFC4811 */
+#define OSPF_LLS_EO_RS 0x00000002 /* RFC4812 */
+
+/*
+ * TOS metric struct (will be 0 or more in router links update)
+ */
+struct tos_metric {
+ u_int8_t tos_type;
+ u_int8_t reserved;
+ u_int8_t tos_metric[2];
+};
+struct tos_link {
+ u_int8_t link_type;
+ u_int8_t link_tos_count;
+ u_int8_t tos_metric[2];
+};
+union un_tos {
+ struct tos_link link;
+ struct tos_metric metrics;
+};
+
/* link state advertisement header */
struct lsa_hdr {
u_int16_t ls_age;
@@ -172,9 +193,7 @@
struct rlalink {
struct in_addr link_id;
struct in_addr link_data;
- u_int8_t link_type;
- u_int8_t link_toscount;
- u_int16_t link_tos0metric;
+ union un_tos un_tos;
} rla_link[1]; /* may repeat */
} un_rla;
@@ -235,16 +254,6 @@
} lsa_un;
};
-
-/*
- * TOS metric struct (will be 0 or more in router links update)
- */
-struct tos_metric {
- u_int8_t tos_type;
- u_int8_t tos_zero;
- u_int16_t tos_metric;
-};
-
#define OSPF_AUTH_SIZE 8
/*
@@ -275,7 +284,7 @@
/* Database Description packet */
struct {
- u_int8_t db_zero[2];
+ u_int16_t db_ifmtu;
u_int8_t db_options;
u_int8_t db_flags;
u_int32_t db_seq;
@@ -314,3 +323,6 @@
#define ospf_lsu ospf_un.un_lsu
#define ospf_lsa ospf_un.un_lsa
+/* Functions shared by ospf and ospf6 */
+extern int ospf_print_te_lsa(const u_int8_t *, u_int);
+extern int ospf_print_grace_lsa(const u_int8_t *, u_int);
Modified: trunk/contrib/tcpdump/ospf6.h
===================================================================
--- trunk/contrib/tcpdump/ospf6.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ospf6.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/ospf6.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ospf6.h,v 1.7 2006-09-05 15:50:26 hannes Exp $ (LBL) */
/*
* Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved.
@@ -21,13 +21,11 @@
*
* OSPF support contributed by Jeffrey Honig (jch at mitchell.cit.cornell.edu)
*/
-#define OSPF_TYPE_UMD 0 /* UMd's special monitoring packets */
-#define OSPF_TYPE_HELLO 1 /* Hello */
-#define OSPF_TYPE_DB 2 /* Database Description */
-#define OSPF_TYPE_LSR 3 /* Link State Request */
-#define OSPF_TYPE_LSU 4 /* Link State Update */
-#define OSPF_TYPE_LSA 5 /* Link State Ack */
-#define OSPF_TYPE_MAX 6
+#define OSPF_TYPE_HELLO 1 /* Hello */
+#define OSPF_TYPE_DD 2 /* Database Description */
+#define OSPF_TYPE_LS_REQ 3 /* Link State Request */
+#define OSPF_TYPE_LS_UPDATE 4 /* Link State Update */
+#define OSPF_TYPE_LS_ACK 5 /* Link State Ack */
/* Options *_options */
#define OSPF6_OPTION_V6 0x01 /* V6 bit: A bit for peeping tom */
@@ -50,10 +48,11 @@
#define LS_TYPE_INTER_AR 4 /* Inter-Area-Router */
#define LS_TYPE_ASE 5 /* ASE */
#define LS_TYPE_GROUP 6 /* Group membership */
-#define LS_TYPE_TYPE7 7 /* Type 7 LSA */
+#define LS_TYPE_NSSA 7 /* NSSA */
#define LS_TYPE_LINK 8 /* Link LSA */
#define LS_TYPE_INTRA_AP 9 /* Intra-Area-Prefix */
-#define LS_TYPE_MAX 10
+#define LS_TYPE_INTRA_ATE 10 /* Intra-Area-TE */
+#define LS_TYPE_GRACE 11 /* Grace LSA */
#define LS_TYPE_MASK 0x1fff
#define LS_SCOPE_LINKLOCAL 0x0000
@@ -60,14 +59,8 @@
#define LS_SCOPE_AREA 0x2000
#define LS_SCOPE_AS 0x4000
#define LS_SCOPE_MASK 0x6000
+#define LS_SCOPE_U 0x8000
-/*************************************************
- *
- * is the above a bug in the documentation?
- *
- *************************************************/
-
-
/* rla_link.link_type */
#define RLA_TYPE_ROUTER 1 /* point-to-point to another router */
#define RLA_TYPE_TRANSIT 2 /* connection to transit network */
@@ -78,7 +71,15 @@
#define RLA_FLAG_E 0x02
#define RLA_FLAG_V 0x04
#define RLA_FLAG_W 0x08
+#define RLA_FLAG_N 0x10
+/* lsa_prefix options */
+#define LSA_PREFIX_OPT_NU 0x01
+#define LSA_PREFIX_OPT_LA 0x02
+#define LSA_PREFIX_OPT_MC 0x04
+#define LSA_PREFIX_OPT_P 0x08
+#define LSA_PREFIX_OPT_DN 0x10
+
/* sla_tosmetric breakdown */
#define SLA_MASK_TOS 0x7f000000
#define SLA_MASK_METRIC 0x00ffffff
@@ -85,19 +86,14 @@
#define SLA_SHIFT_TOS 24
/* asla_metric */
-#define ASLA_FLAG_EXTERNAL 0x04000000
#define ASLA_FLAG_FWDADDR 0x02000000
#define ASLA_FLAG_ROUTETAG 0x01000000
#define ASLA_MASK_METRIC 0x00ffffff
-/* multicast vertex type */
-#define MCLA_VERTEX_ROUTER 1
-#define MCLA_VERTEX_NETWORK 2
-
typedef u_int32_t rtrid_t;
/* link state advertisement header */
-struct lsa_hdr {
+struct lsa6_hdr {
u_int16_t ls_age;
u_int16_t ls_type;
rtrid_t ls_stateid;
@@ -107,16 +103,16 @@
u_int16_t ls_length;
};
-struct lsa_prefix {
+struct lsa6_prefix {
u_int8_t lsa_p_len;
u_int8_t lsa_p_opt;
- u_int16_t lsa_p_mbz;
+ u_int16_t lsa_p_metric;
u_int8_t lsa_p_prefix[4];
};
/* link state advertisement */
-struct lsa {
- struct lsa_hdr ls_hdr;
+struct lsa6 {
+ struct lsa6_hdr ls_hdr;
/* Link state types */
union {
@@ -128,7 +124,7 @@
} rla_flgandopt;
#define rla_flags rla_flgandopt.flg
#define rla_options rla_flgandopt.opt
- struct rlalink {
+ struct rlalink6 {
u_int8_t link_type;
u_int8_t link_zero[1];
u_int16_t link_metric;
@@ -147,13 +143,13 @@
/* Inter Area Prefix LSA */
struct {
u_int32_t inter_ap_metric;
- struct lsa_prefix inter_ap_prefix[1];
+ struct lsa6_prefix inter_ap_prefix[1];
} un_inter_ap;
/* AS external links advertisements */
struct {
u_int32_t asla_metric;
- struct lsa_prefix asla_prefix[1];
+ struct lsa6_prefix asla_prefix[1];
/* some optional fields follow */
} un_asla;
@@ -183,7 +179,7 @@
#define llsa_options llsa_priandopt.opt
struct in6_addr llsa_lladdr;
u_int32_t llsa_nprefix;
- struct lsa_prefix llsa_prefix[1];
+ struct lsa6_prefix llsa_prefix[1];
} un_llsa;
/* Intra-Area-Prefix */
@@ -192,21 +188,12 @@
u_int16_t intra_ap_lstype;
rtrid_t intra_ap_lsid;
rtrid_t intra_ap_rtid;
- struct lsa_prefix intra_ap_prefix[1];
+ struct lsa6_prefix intra_ap_prefix[1];
} un_intra_ap;
} lsa_un;
};
-/*
- * TOS metric struct (will be 0 or more in router links update)
- */
-struct tos_metric {
- u_int8_t tos_type;
- u_int8_t tos_zero;
- u_int16_t tos_metric;
-};
-
#define OSPF_AUTH_SIZE 8
/*
@@ -246,11 +233,11 @@
u_int8_t db_mbz;
u_int8_t db_flags;
u_int32_t db_seq;
- struct lsa_hdr db_lshdr[1]; /* may repeat */
+ struct lsa6_hdr db_lshdr[1]; /* may repeat */
} un_db;
/* Link State Request */
- struct lsr {
+ struct lsr6 {
u_int16_t ls_mbz;
u_int16_t ls_type;
rtrid_t ls_stateid;
@@ -260,12 +247,12 @@
/* Link State Update */
struct {
u_int32_t lsu_count;
- struct lsa lsu_lsa[1]; /* may repeat */
+ struct lsa6 lsu_lsa[1]; /* may repeat */
} un_lsu;
/* Link State Acknowledgement */
struct {
- struct lsa_hdr lsa_lshdr[1]; /* may repeat */
+ struct lsa6_hdr lsa_lshdr[1]; /* may repeat */
} un_lsa ;
} ospf6_un ;
};
Modified: trunk/contrib/tcpdump/oui.c
===================================================================
--- trunk/contrib/tcpdump/oui.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/oui.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -15,7 +15,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/oui.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/oui.c,v 1.9 2008-01-09 09:40:47 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -28,7 +28,7 @@
/* FIXME complete OUI list using a script */
-struct tok oui_values[] = {
+const struct tok oui_values[] = {
{ OUI_ENCAP_ETHER, "Ethernet" },
{ OUI_CISCO, "Cisco" },
{ OUI_NORTEL, "Nortel Networks SONMP" },
@@ -39,6 +39,10 @@
{ OUI_APPLETALK, "Appletalk" },
{ OUI_JUNIPER, "Juniper" },
{ OUI_HP, "Hewlett-Packard" },
+ { OUI_IEEE_8021_PRIVATE, "IEEE 802.1 Private"},
+ { OUI_IEEE_8023_PRIVATE, "IEEE 802.3 Private"},
+ { OUI_TIA, "ANSI/TIA"},
+ { OUI_DCBX, "DCBX"},
{ 0, NULL }
};
@@ -52,7 +56,7 @@
*
* List taken from Ethereal's epan/sminmpec.c.
*/
-struct tok smi_values[] = {
+const struct tok smi_values[] = {
{ SMI_IETF, "IETF (reserved)"},
{ SMI_ACC, "ACC"},
{ SMI_CISCO, "Cisco"},
Modified: trunk/contrib/tcpdump/oui.h
===================================================================
--- trunk/contrib/tcpdump/oui.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/oui.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/oui.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/oui.h,v 1.8 2008-01-09 09:40:47 hannes Exp $ (LBL) */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code
@@ -14,8 +14,8 @@
* Original code by Hannes Gredler (hannes at juniper.net)
*/
-extern struct tok oui_values[];
-extern struct tok smi_values[];
+extern const struct tok oui_values[];
+extern const struct tok smi_values[];
#define OUI_ENCAP_ETHER 0x000000 /* encapsulated Ethernet */
#define OUI_CISCO 0x00000c /* Cisco protocols */
@@ -27,6 +27,10 @@
#define OUI_APPLETALK 0x080007 /* Appletalk */
#define OUI_JUNIPER 0x009069 /* Juniper */
#define OUI_HP 0x080009 /* Hewlett-Packard */
+#define OUI_IEEE_8021_PRIVATE 0x0080c2 /* IEEE 802.1 Organisation Specific - Annex F */
+#define OUI_IEEE_8023_PRIVATE 0x00120f /* IEEE 802.3 Organisation Specific - Annex G */
+#define OUI_TIA 0x0012bb /* TIA - Telecommunications Industry Association - ANSI/TIA-1057- 2006 */
+#define OUI_DCBX 0x001B21 /* DCBX */
/*
* These are SMI Network Management Private Enterprise Codes for
Modified: trunk/contrib/tcpdump/parsenfsfh.c
===================================================================
--- trunk/contrib/tcpdump/parsenfsfh.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/parsenfsfh.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -39,12 +39,12 @@
* Digital Equipment Corporation
* Western Research Laboratory
*
- * $FreeBSD: src/contrib/tcpdump/parsenfsfh.c,v 1.9.10.1 2007/10/19 03:03:58 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/parsenfsfh.c 190207 2009-03-21 18:30:25Z rpaulo $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/parsenfsfh.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/parsenfsfh.c,v 1.29 2006-06-13 22:21:38 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/pcap-missing.h
===================================================================
--- trunk/contrib/tcpdump/pcap-missing.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/pcap-missing.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/pcap-missing.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/pcap-missing.h,v 1.3 2005-06-03 22:08:52 guy Exp $ (LBL)
*/
#ifndef tcpdump_pcap_missing_h
Modified: trunk/contrib/tcpdump/pcap_dump_ftell.c
===================================================================
--- trunk/contrib/tcpdump/pcap_dump_ftell.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/pcap_dump_ftell.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/pcap_dump_ftell.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/pcap_dump_ftell.c,v 1.1 2005-06-03 22:08:52 guy Exp $ (LBL)";
#endif
#include <stdio.h>
Modified: trunk/contrib/tcpdump/pmap_prot.h
===================================================================
--- trunk/contrib/tcpdump/pmap_prot.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/pmap_prot.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/pmap_prot.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/pmap_prot.h,v 1.3 2005-04-27 21:43:48 guy Exp $ (LBL) */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
@@ -29,7 +29,8 @@
*
* from: @(#)pmap_prot.h 1.14 88/02/08 SMI
* from: @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC
- * $FreeBSD: src/contrib/tcpdump/pmap_prot.h,v 1.1.1.2 2005/07/11 03:53:37 sam Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/pmap_prot.h 190207 2009-03-21 18:30:25Z rpaulo $
+ * FreeBSD: src/include/rpc/pmap_prot.h,v 1.9.2.1 1999/08/29 14:39:05 peter Exp
*/
/*
Added: trunk/contrib/tcpdump/ppi.h
===================================================================
--- trunk/contrib/tcpdump/ppi.h (rev 0)
+++ trunk/contrib/tcpdump/ppi.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,9 @@
+typedef struct ppi_header {
+ uint8_t ppi_ver;
+ uint8_t ppi_flags;
+ uint16_t ppi_len;
+ uint32_t ppi_dlt;
+} ppi_header_t;
+
+#define PPI_HDRLEN 8
+
Property changes on: trunk/contrib/tcpdump/ppi.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/ppp.h
===================================================================
--- trunk/contrib/tcpdump/ppp.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/ppp.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/ppp.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/ppp.h,v 1.16 2004-10-20 16:14:16 hannes Exp $ (LBL) */
/*
* Point to Point Protocol (PPP) RFC1331
*
@@ -15,7 +15,7 @@
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
- * $FreeBSD: src/contrib/tcpdump/ppp.h,v 1.8 2006/09/04 20:25:04 sam Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/ppp.h 190207 2009-03-21 18:30:25Z rpaulo $
*/
#define PPP_HDRLEN 4 /* length of PPP header */
Modified: trunk/contrib/tcpdump/print-802_11.c
===================================================================
--- trunk/contrib/tcpdump/print-802_11.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-802_11.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,3 @@
-/* $FreeBSD: src/contrib/tcpdump/print-802_11.c,v 1.2.2.1 2007/10/19 03:03:58 mlaier Exp $ */
/*
* Copyright (c) 2001
* Fortress Technologies, Inc. All rights reserved.
@@ -23,7 +22,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-802_11.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.49 2007-12-29 23:25:02 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -47,115 +46,593 @@
#include "ieee802_11.h"
#include "ieee802_11_radio.h"
+/* Radiotap state */
+/* This is used to save state when parsing/processing parameters */
+struct radiotap_state
+{
+ u_int32_t present;
+
+ u_int8_t rate;
+};
+
#define PRINT_SSID(p) \
- switch (p.ssid_status) { \
- case TRUNCATED: \
- return 0; \
- case PRESENT: \
+ if (p.ssid_present) { \
printf(" ("); \
fn_print(p.ssid.ssid, NULL); \
printf(")"); \
- break; \
- case NOT_PRESENT: \
- break; \
}
#define PRINT_RATE(_sep, _r, _suf) \
printf("%s%2.1f%s", _sep, (.5 * ((_r) & 0x7f)), _suf)
#define PRINT_RATES(p) \
- switch (p.rates_status) { \
- case TRUNCATED: \
- return 0; \
- case PRESENT: \
- do { \
- int z; \
- const char *sep = " ["; \
- for (z = 0; z < p.rates.length ; z++) { \
- PRINT_RATE(sep, p.rates.rate[z], \
- (p.rates.rate[z] & 0x80 ? "*" : "")); \
- sep = " "; \
- } \
- if (p.rates.length != 0) \
- printf(" Mbit]"); \
- } while (0); \
- break; \
- case NOT_PRESENT: \
- break; \
+ if (p.rates_present) { \
+ int z; \
+ const char *sep = " ["; \
+ for (z = 0; z < p.rates.length ; z++) { \
+ PRINT_RATE(sep, p.rates.rate[z], \
+ (p.rates.rate[z] & 0x80 ? "*" : "")); \
+ sep = " "; \
+ } \
+ if (p.rates.length != 0) \
+ printf(" Mbit]"); \
}
#define PRINT_DS_CHANNEL(p) \
- switch (p.ds_status) { \
- case TRUNCATED: \
- return 0; \
- case PRESENT: \
+ if (p.ds_present) \
printf(" CH: %u", p.ds.channel); \
- break; \
- case NOT_PRESENT: \
- break; \
- } \
printf("%s", \
CAPABILITY_PRIVACY(p.capability_info) ? ", PRIVACY" : "" );
-static const int ieee80211_htrates[16] = {
- 13, /* IFM_IEEE80211_MCS0 */
- 26, /* IFM_IEEE80211_MCS1 */
- 39, /* IFM_IEEE80211_MCS2 */
- 52, /* IFM_IEEE80211_MCS3 */
- 78, /* IFM_IEEE80211_MCS4 */
- 104, /* IFM_IEEE80211_MCS5 */
- 117, /* IFM_IEEE80211_MCS6 */
- 130, /* IFM_IEEE80211_MCS7 */
- 26, /* IFM_IEEE80211_MCS8 */
- 52, /* IFM_IEEE80211_MCS9 */
- 78, /* IFM_IEEE80211_MCS10 */
- 104, /* IFM_IEEE80211_MCS11 */
- 156, /* IFM_IEEE80211_MCS12 */
- 208, /* IFM_IEEE80211_MCS13 */
- 234, /* IFM_IEEE80211_MCS14 */
- 260, /* IFM_IEEE80211_MCS15 */
+#define MAX_MCS_INDEX 76
+
+/*
+ * Indices are:
+ *
+ * the MCS index (0-76);
+ *
+ * 0 for 20 MHz, 1 for 40 MHz;
+ *
+ * 0 for a long guard interval, 1 for a short guard interval.
+ */
+static const float ieee80211_float_htrates[MAX_MCS_INDEX+1][2][2] = {
+ /* MCS 0 */
+ { /* 20 Mhz */ { 6.5, /* SGI */ 7.2, },
+ /* 40 Mhz */ { 13.5, /* SGI */ 15.0, },
+ },
+
+ /* MCS 1 */
+ { /* 20 Mhz */ { 13.0, /* SGI */ 14.4, },
+ /* 40 Mhz */ { 27.0, /* SGI */ 30.0, },
+ },
+
+ /* MCS 2 */
+ { /* 20 Mhz */ { 19.5, /* SGI */ 21.7, },
+ /* 40 Mhz */ { 40.5, /* SGI */ 45.0, },
+ },
+
+ /* MCS 3 */
+ { /* 20 Mhz */ { 26.0, /* SGI */ 28.9, },
+ /* 40 Mhz */ { 54.0, /* SGI */ 60.0, },
+ },
+
+ /* MCS 4 */
+ { /* 20 Mhz */ { 39.0, /* SGI */ 43.3, },
+ /* 40 Mhz */ { 81.0, /* SGI */ 90.0, },
+ },
+
+ /* MCS 5 */
+ { /* 20 Mhz */ { 52.0, /* SGI */ 57.8, },
+ /* 40 Mhz */ { 108.0, /* SGI */ 120.0, },
+ },
+
+ /* MCS 6 */
+ { /* 20 Mhz */ { 58.5, /* SGI */ 65.0, },
+ /* 40 Mhz */ { 121.5, /* SGI */ 135.0, },
+ },
+
+ /* MCS 7 */
+ { /* 20 Mhz */ { 65.0, /* SGI */ 72.2, },
+ /* 40 Mhz */ { 135.0, /* SGI */ 150.0, },
+ },
+
+ /* MCS 8 */
+ { /* 20 Mhz */ { 13.0, /* SGI */ 14.4, },
+ /* 40 Mhz */ { 27.0, /* SGI */ 30.0, },
+ },
+
+ /* MCS 9 */
+ { /* 20 Mhz */ { 26.0, /* SGI */ 28.9, },
+ /* 40 Mhz */ { 54.0, /* SGI */ 60.0, },
+ },
+
+ /* MCS 10 */
+ { /* 20 Mhz */ { 39.0, /* SGI */ 43.3, },
+ /* 40 Mhz */ { 81.0, /* SGI */ 90.0, },
+ },
+
+ /* MCS 11 */
+ { /* 20 Mhz */ { 52.0, /* SGI */ 57.8, },
+ /* 40 Mhz */ { 108.0, /* SGI */ 120.0, },
+ },
+
+ /* MCS 12 */
+ { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
+ /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
+ },
+
+ /* MCS 13 */
+ { /* 20 Mhz */ { 104.0, /* SGI */ 115.6, },
+ /* 40 Mhz */ { 216.0, /* SGI */ 240.0, },
+ },
+
+ /* MCS 14 */
+ { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
+ /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
+ },
+
+ /* MCS 15 */
+ { /* 20 Mhz */ { 130.0, /* SGI */ 144.4, },
+ /* 40 Mhz */ { 270.0, /* SGI */ 300.0, },
+ },
+
+ /* MCS 16 */
+ { /* 20 Mhz */ { 19.5, /* SGI */ 21.7, },
+ /* 40 Mhz */ { 40.5, /* SGI */ 45.0, },
+ },
+
+ /* MCS 17 */
+ { /* 20 Mhz */ { 39.0, /* SGI */ 43.3, },
+ /* 40 Mhz */ { 81.0, /* SGI */ 90.0, },
+ },
+
+ /* MCS 18 */
+ { /* 20 Mhz */ { 58.5, /* SGI */ 65.0, },
+ /* 40 Mhz */ { 121.5, /* SGI */ 135.0, },
+ },
+
+ /* MCS 19 */
+ { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
+ /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
+ },
+
+ /* MCS 20 */
+ { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
+ /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
+ },
+
+ /* MCS 21 */
+ { /* 20 Mhz */ { 156.0, /* SGI */ 173.3, },
+ /* 40 Mhz */ { 324.0, /* SGI */ 360.0, },
+ },
+
+ /* MCS 22 */
+ { /* 20 Mhz */ { 175.5, /* SGI */ 195.0, },
+ /* 40 Mhz */ { 364.5, /* SGI */ 405.0, },
+ },
+
+ /* MCS 23 */
+ { /* 20 Mhz */ { 195.0, /* SGI */ 216.7, },
+ /* 40 Mhz */ { 405.0, /* SGI */ 450.0, },
+ },
+
+ /* MCS 24 */
+ { /* 20 Mhz */ { 26.0, /* SGI */ 28.9, },
+ /* 40 Mhz */ { 54.0, /* SGI */ 60.0, },
+ },
+
+ /* MCS 25 */
+ { /* 20 Mhz */ { 52.0, /* SGI */ 57.8, },
+ /* 40 Mhz */ { 108.0, /* SGI */ 120.0, },
+ },
+
+ /* MCS 26 */
+ { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
+ /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
+ },
+
+ /* MCS 27 */
+ { /* 20 Mhz */ { 104.0, /* SGI */ 115.6, },
+ /* 40 Mhz */ { 216.0, /* SGI */ 240.0, },
+ },
+
+ /* MCS 28 */
+ { /* 20 Mhz */ { 156.0, /* SGI */ 173.3, },
+ /* 40 Mhz */ { 324.0, /* SGI */ 360.0, },
+ },
+
+ /* MCS 29 */
+ { /* 20 Mhz */ { 208.0, /* SGI */ 231.1, },
+ /* 40 Mhz */ { 432.0, /* SGI */ 480.0, },
+ },
+
+ /* MCS 30 */
+ { /* 20 Mhz */ { 234.0, /* SGI */ 260.0, },
+ /* 40 Mhz */ { 486.0, /* SGI */ 540.0, },
+ },
+
+ /* MCS 31 */
+ { /* 20 Mhz */ { 260.0, /* SGI */ 288.9, },
+ /* 40 Mhz */ { 540.0, /* SGI */ 600.0, },
+ },
+
+ /* MCS 32 */
+ { /* 20 Mhz */ { 0.0, /* SGI */ 0.0, }, /* not valid */
+ /* 40 Mhz */ { 6.0, /* SGI */ 6.7, },
+ },
+
+ /* MCS 33 */
+ { /* 20 Mhz */ { 39.0, /* SGI */ 43.3, },
+ /* 40 Mhz */ { 81.0, /* SGI */ 90.0, },
+ },
+
+ /* MCS 34 */
+ { /* 20 Mhz */ { 52.0, /* SGI */ 57.8, },
+ /* 40 Mhz */ { 108.0, /* SGI */ 120.0, },
+ },
+
+ /* MCS 35 */
+ { /* 20 Mhz */ { 65.0, /* SGI */ 72.2, },
+ /* 40 Mhz */ { 135.0, /* SGI */ 150.0, },
+ },
+
+ /* MCS 36 */
+ { /* 20 Mhz */ { 58.5, /* SGI */ 65.0, },
+ /* 40 Mhz */ { 121.5, /* SGI */ 135.0, },
+ },
+
+ /* MCS 37 */
+ { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
+ /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
+ },
+
+ /* MCS 38 */
+ { /* 20 Mhz */ { 97.5, /* SGI */ 108.3, },
+ /* 40 Mhz */ { 202.5, /* SGI */ 225.0, },
+ },
+
+ /* MCS 39 */
+ { /* 20 Mhz */ { 52.0, /* SGI */ 57.8, },
+ /* 40 Mhz */ { 108.0, /* SGI */ 120.0, },
+ },
+
+ /* MCS 40 */
+ { /* 20 Mhz */ { 65.0, /* SGI */ 72.2, },
+ /* 40 Mhz */ { 135.0, /* SGI */ 150.0, },
+ },
+
+ /* MCS 41 */
+ { /* 20 Mhz */ { 65.0, /* SGI */ 72.2, },
+ /* 40 Mhz */ { 135.0, /* SGI */ 150.0, },
+ },
+
+ /* MCS 42 */
+ { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
+ /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
+ },
+
+ /* MCS 43 */
+ { /* 20 Mhz */ { 91.0, /* SGI */ 101.1, },
+ /* 40 Mhz */ { 189.0, /* SGI */ 210.0, },
+ },
+
+ /* MCS 44 */
+ { /* 20 Mhz */ { 91.0, /* SGI */ 101.1, },
+ /* 40 Mhz */ { 189.0, /* SGI */ 210.0, },
+ },
+
+ /* MCS 45 */
+ { /* 20 Mhz */ { 104.0, /* SGI */ 115.6, },
+ /* 40 Mhz */ { 216.0, /* SGI */ 240.0, },
+ },
+
+ /* MCS 46 */
+ { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
+ /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
+ },
+
+ /* MCS 47 */
+ { /* 20 Mhz */ { 97.5, /* SGI */ 108.3, },
+ /* 40 Mhz */ { 202.5, /* SGI */ 225.0, },
+ },
+
+ /* MCS 48 */
+ { /* 20 Mhz */ { 97.5, /* SGI */ 108.3, },
+ /* 40 Mhz */ { 202.5, /* SGI */ 225.0, },
+ },
+
+ /* MCS 49 */
+ { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
+ /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
+ },
+
+ /* MCS 50 */
+ { /* 20 Mhz */ { 136.5, /* SGI */ 151.7, },
+ /* 40 Mhz */ { 283.5, /* SGI */ 315.0, },
+ },
+
+ /* MCS 51 */
+ { /* 20 Mhz */ { 136.5, /* SGI */ 151.7, },
+ /* 40 Mhz */ { 283.5, /* SGI */ 315.0, },
+ },
+
+ /* MCS 52 */
+ { /* 20 Mhz */ { 156.0, /* SGI */ 173.3, },
+ /* 40 Mhz */ { 324.0, /* SGI */ 360.0, },
+ },
+
+ /* MCS 53 */
+ { /* 20 Mhz */ { 65.0, /* SGI */ 72.2, },
+ /* 40 Mhz */ { 135.0, /* SGI */ 150.0, },
+ },
+
+ /* MCS 54 */
+ { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
+ /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
+ },
+
+ /* MCS 55 */
+ { /* 20 Mhz */ { 91.0, /* SGI */ 101.1, },
+ /* 40 Mhz */ { 189.0, /* SGI */ 210.0, },
+ },
+
+ /* MCS 56 */
+ { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
+ /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
+ },
+
+ /* MCS 57 */
+ { /* 20 Mhz */ { 91.0, /* SGI */ 101.1, },
+ /* 40 Mhz */ { 189.0, /* SGI */ 210.0, },
+ },
+
+ /* MCS 58 */
+ { /* 20 Mhz */ { 104.0, /* SGI */ 115.6, },
+ /* 40 Mhz */ { 216.0, /* SGI */ 240.0, },
+ },
+
+ /* MCS 59 */
+ { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
+ /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
+ },
+
+ /* MCS 60 */
+ { /* 20 Mhz */ { 104.0, /* SGI */ 115.6, },
+ /* 40 Mhz */ { 216.0, /* SGI */ 240.0, },
+ },
+
+ /* MCS 61 */
+ { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
+ /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
+ },
+
+ /* MCS 62 */
+ { /* 20 Mhz */ { 130.0, /* SGI */ 144.4, },
+ /* 40 Mhz */ { 270.0, /* SGI */ 300.0, },
+ },
+
+ /* MCS 63 */
+ { /* 20 Mhz */ { 130.0, /* SGI */ 144.4, },
+ /* 40 Mhz */ { 270.0, /* SGI */ 300.0, },
+ },
+
+ /* MCS 64 */
+ { /* 20 Mhz */ { 143.0, /* SGI */ 158.9, },
+ /* 40 Mhz */ { 297.0, /* SGI */ 330.0, },
+ },
+
+ /* MCS 65 */
+ { /* 20 Mhz */ { 97.5, /* SGI */ 108.3, },
+ /* 40 Mhz */ { 202.5, /* SGI */ 225.0, },
+ },
+
+ /* MCS 66 */
+ { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
+ /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
+ },
+
+ /* MCS 67 */
+ { /* 20 Mhz */ { 136.5, /* SGI */ 151.7, },
+ /* 40 Mhz */ { 283.5, /* SGI */ 315.0, },
+ },
+
+ /* MCS 68 */
+ { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
+ /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
+ },
+
+ /* MCS 69 */
+ { /* 20 Mhz */ { 136.5, /* SGI */ 151.7, },
+ /* 40 Mhz */ { 283.5, /* SGI */ 315.0, },
+ },
+
+ /* MCS 70 */
+ { /* 20 Mhz */ { 156.0, /* SGI */ 173.3, },
+ /* 40 Mhz */ { 324.0, /* SGI */ 360.0, },
+ },
+
+ /* MCS 71 */
+ { /* 20 Mhz */ { 175.5, /* SGI */ 195.0, },
+ /* 40 Mhz */ { 364.5, /* SGI */ 405.0, },
+ },
+
+ /* MCS 72 */
+ { /* 20 Mhz */ { 156.0, /* SGI */ 173.3, },
+ /* 40 Mhz */ { 324.0, /* SGI */ 360.0, },
+ },
+
+ /* MCS 73 */
+ { /* 20 Mhz */ { 175.5, /* SGI */ 195.0, },
+ /* 40 Mhz */ { 364.5, /* SGI */ 405.0, },
+ },
+
+ /* MCS 74 */
+ { /* 20 Mhz */ { 195.0, /* SGI */ 216.7, },
+ /* 40 Mhz */ { 405.0, /* SGI */ 450.0, },
+ },
+
+ /* MCS 75 */
+ { /* 20 Mhz */ { 195.0, /* SGI */ 216.7, },
+ /* 40 Mhz */ { 405.0, /* SGI */ 450.0, },
+ },
+
+ /* MCS 76 */
+ { /* 20 Mhz */ { 214.5, /* SGI */ 238.3, },
+ /* 40 Mhz */ { 445.5, /* SGI */ 495.0, },
+ },
};
-#define PRINT_HT_RATE(_sep, _r, _suf) \
- printf("%s%.1f%s", _sep, (.5 * ieee80211_htrates[(_r) & 0xf]), _suf)
static const char *auth_alg_text[]={"Open System","Shared Key","EAP"};
#define NUM_AUTH_ALGS (sizeof auth_alg_text / sizeof auth_alg_text[0])
static const char *status_text[] = {
- "Succesful", /* 0 */
- "Unspecified failure", /* 1 */
- "Reserved", /* 2 */
- "Reserved", /* 3 */
- "Reserved", /* 4 */
- "Reserved", /* 5 */
- "Reserved", /* 6 */
- "Reserved", /* 7 */
- "Reserved", /* 8 */
- "Reserved", /* 9 */
- "Cannot Support all requested capabilities in the Capability Information field", /* 10 */
- "Reassociation denied due to inability to confirm that association exists", /* 11 */
- "Association denied due to reason outside the scope of the standard", /* 12 */
- "Responding station does not support the specified authentication algorithm ", /* 13 */
- "Received an Authentication frame with authentication transaction " \
- "sequence number out of expected sequence", /* 14 */
- "Authentication rejected because of challenge failure", /* 15 */
- "Authentication rejected due to timeout waiting for next frame in sequence", /* 16 */
- "Association denied because AP is unable to handle additional associated stations", /* 17 */
- "Association denied due to requesting station not supporting all of the " \
- "data rates in BSSBasicRateSet parameter", /* 18 */
+ "Successful", /* 0 */
+ "Unspecified failure", /* 1 */
+ "Reserved", /* 2 */
+ "Reserved", /* 3 */
+ "Reserved", /* 4 */
+ "Reserved", /* 5 */
+ "Reserved", /* 6 */
+ "Reserved", /* 7 */
+ "Reserved", /* 8 */
+ "Reserved", /* 9 */
+ "Cannot Support all requested capabilities in the Capability "
+ "Information field", /* 10 */
+ "Reassociation denied due to inability to confirm that association "
+ "exists", /* 11 */
+ "Association denied due to reason outside the scope of the "
+ "standard", /* 12 */
+ "Responding station does not support the specified authentication "
+ "algorithm ", /* 13 */
+ "Received an Authentication frame with authentication transaction "
+ "sequence number out of expected sequence", /* 14 */
+ "Authentication rejected because of challenge failure", /* 15 */
+ "Authentication rejected due to timeout waiting for next frame in "
+ "sequence", /* 16 */
+ "Association denied because AP is unable to handle additional"
+ "associated stations", /* 17 */
+ "Association denied due to requesting station not supporting all of "
+ "the data rates in BSSBasicRateSet parameter", /* 18 */
+ "Association denied due to requesting station not supporting "
+ "short preamble operation", /* 19 */
+ "Association denied due to requesting station not supporting "
+ "PBCC encoding", /* 20 */
+ "Association denied due to requesting station not supporting "
+ "channel agility", /* 21 */
+ "Association request rejected because Spectrum Management "
+ "capability is required", /* 22 */
+ "Association request rejected because the information in the "
+ "Power Capability element is unacceptable", /* 23 */
+ "Association request rejected because the information in the "
+ "Supported Channels element is unacceptable", /* 24 */
+ "Association denied due to requesting station not supporting "
+ "short slot operation", /* 25 */
+ "Association denied due to requesting station not supporting "
+ "DSSS-OFDM operation", /* 26 */
+ "Association denied because the requested STA does not support HT "
+ "features", /* 27 */
+ "Reserved", /* 28 */
+ "Association denied because the requested STA does not support "
+ "the PCO transition time required by the AP", /* 29 */
+ "Reserved", /* 30 */
+ "Reserved", /* 31 */
+ "Unspecified, QoS-related failure", /* 32 */
+ "Association denied due to QAP having insufficient bandwidth "
+ "to handle another QSTA", /* 33 */
+ "Association denied due to excessive frame loss rates and/or "
+ "poor conditions on current operating channel", /* 34 */
+ "Association (with QBSS) denied due to requesting station not "
+ "supporting the QoS facility", /* 35 */
+ "Association denied due to requesting station not supporting "
+ "Block Ack", /* 36 */
+ "The request has been declined", /* 37 */
+ "The request has not been successful as one or more parameters "
+ "have invalid values", /* 38 */
+ "The TS has not been created because the request cannot be honored. "
+ "However, a suggested TSPEC is provided so that the initiating QSTA"
+ "may attempt to set another TS with the suggested changes to the "
+ "TSPEC", /* 39 */
+ "Invalid Information Element", /* 40 */
+ "Group Cipher is not valid", /* 41 */
+ "Pairwise Cipher is not valid", /* 42 */
+ "AKMP is not valid", /* 43 */
+ "Unsupported RSN IE version", /* 44 */
+ "Invalid RSN IE Capabilities", /* 45 */
+ "Cipher suite is rejected per security policy", /* 46 */
+ "The TS has not been created. However, the HC may be capable of "
+ "creating a TS, in response to a request, after the time indicated "
+ "in the TS Delay element", /* 47 */
+ "Direct Link is not allowed in the BSS by policy", /* 48 */
+ "Destination STA is not present within this QBSS.", /* 49 */
+ "The Destination STA is not a QSTA.", /* 50 */
+
};
#define NUM_STATUSES (sizeof status_text / sizeof status_text[0])
static const char *reason_text[] = {
- "Reserved", /* 0 */
- "Unspecified reason", /* 1 */
- "Previous authentication no longer valid", /* 2 */
- "Deauthenticated because sending station is leaving (or has left) IBSS or ESS", /* 3 */
- "Disassociated due to inactivity", /* 4 */
- "Disassociated because AP is unable to handle all currently associated stations", /* 5 */
+ "Reserved", /* 0 */
+ "Unspecified reason", /* 1 */
+ "Previous authentication no longer valid", /* 2 */
+ "Deauthenticated because sending station is leaving (or has left) "
+ "IBSS or ESS", /* 3 */
+ "Disassociated due to inactivity", /* 4 */
+ "Disassociated because AP is unable to handle all currently "
+ " associated stations", /* 5 */
"Class 2 frame received from nonauthenticated station", /* 6 */
- "Class 3 frame received from nonassociated station", /* 7 */
- "Disassociated because sending station is leaving (or has left) BSS", /* 8 */
- "Station requesting (re)association is not authenticated with responding station", /* 9 */
+ "Class 3 frame received from nonassociated station", /* 7 */
+ "Disassociated because sending station is leaving "
+ "(or has left) BSS", /* 8 */
+ "Station requesting (re)association is not authenticated with "
+ "responding station", /* 9 */
+ "Disassociated because the information in the Power Capability "
+ "element is unacceptable", /* 10 */
+ "Disassociated because the information in the SupportedChannels "
+ "element is unacceptable", /* 11 */
+ "Invalid Information Element", /* 12 */
+ "Reserved", /* 13 */
+ "Michael MIC failure", /* 14 */
+ "4-Way Handshake timeout", /* 15 */
+ "Group key update timeout", /* 16 */
+ "Information element in 4-Way Handshake different from (Re)Association"
+ "Request/Probe Response/Beacon", /* 17 */
+ "Group Cipher is not valid", /* 18 */
+ "AKMP is not valid", /* 20 */
+ "Unsupported RSN IE version", /* 21 */
+ "Invalid RSN IE Capabilities", /* 22 */
+ "IEEE 802.1X Authentication failed", /* 23 */
+ "Cipher suite is rejected per security policy", /* 24 */
+ "Reserved", /* 25 */
+ "Reserved", /* 26 */
+ "Reserved", /* 27 */
+ "Reserved", /* 28 */
+ "Reserved", /* 29 */
+ "Reserved", /* 30 */
+ "TS deleted because QoS AP lacks sufficient bandwidth for this "
+ "QoS STA due to a change in BSS service characteristics or "
+ "operational mode (e.g. an HT BSS change from 40 MHz channel "
+ "to 20 MHz channel)", /* 31 */
+ "Disassociated for unspecified, QoS-related reason", /* 32 */
+ "Disassociated because QoS AP lacks sufficient bandwidth for this "
+ "QoS STA", /* 33 */
+ "Disassociated because of excessive number of frames that need to be "
+ "acknowledged, but are not acknowledged for AP transmissions "
+ "and/or poor channel conditions", /* 34 */
+ "Disassociated because STA is transmitting outside the limits "
+ "of its TXOPs", /* 35 */
+ "Requested from peer STA as the STA is leaving the BSS "
+ "(or resetting)", /* 36 */
+ "Requested from peer STA as it does not want to use the "
+ "mechanism", /* 37 */
+ "Requested from peer STA as the STA received frames using the "
+ "mechanism for which a set up is required", /* 38 */
+ "Requested from peer STA due to time out", /* 39 */
+ "Reserved", /* 40 */
+ "Reserved", /* 41 */
+ "Reserved", /* 42 */
+ "Reserved", /* 43 */
+ "Reserved", /* 44 */
+ "Peer STA does not support the requested cipher suite", /* 45 */
+ "Association denied due to requesting STA not supporting HT "
+ "features", /* 46 */
};
#define NUM_REASONS (sizeof reason_text / sizeof reason_text[0])
@@ -174,141 +651,242 @@
return 1;
}
-static void
-parse_elements(struct mgmt_body_t *pbody, const u_char *p, int offset)
+static int
+parse_elements(struct mgmt_body_t *pbody, const u_char *p, int offset,
+ u_int length)
{
+ u_int elementlen;
+ struct ssid_t ssid;
+ struct challenge_t challenge;
+ struct rates_t rates;
+ struct ds_t ds;
+ struct cf_t cf;
+ struct tim_t tim;
+
/*
* We haven't seen any elements yet.
*/
- pbody->challenge_status = NOT_PRESENT;
- pbody->ssid_status = NOT_PRESENT;
- pbody->rates_status = NOT_PRESENT;
- pbody->ds_status = NOT_PRESENT;
- pbody->cf_status = NOT_PRESENT;
- pbody->tim_status = NOT_PRESENT;
+ pbody->challenge_present = 0;
+ pbody->ssid_present = 0;
+ pbody->rates_present = 0;
+ pbody->ds_present = 0;
+ pbody->cf_present = 0;
+ pbody->tim_present = 0;
- for (;;) {
+ while (length != 0) {
if (!TTEST2(*(p + offset), 1))
- return;
+ return 0;
+ if (length < 1)
+ return 0;
switch (*(p + offset)) {
case E_SSID:
- /* Present, possibly truncated */
- pbody->ssid_status = TRUNCATED;
if (!TTEST2(*(p + offset), 2))
- return;
- memcpy(&pbody->ssid, p + offset, 2);
+ return 0;
+ if (length < 2)
+ return 0;
+ memcpy(&ssid, p + offset, 2);
offset += 2;
- if (pbody->ssid.length != 0) {
- if (pbody->ssid.length >
- sizeof(pbody->ssid.ssid) - 1)
- return;
- if (!TTEST2(*(p + offset), pbody->ssid.length))
- return;
- memcpy(&pbody->ssid.ssid, p + offset,
- pbody->ssid.length);
- offset += pbody->ssid.length;
+ length -= 2;
+ if (ssid.length != 0) {
+ if (ssid.length > sizeof(ssid.ssid) - 1)
+ return 0;
+ if (!TTEST2(*(p + offset), ssid.length))
+ return 0;
+ if (length < ssid.length)
+ return 0;
+ memcpy(&ssid.ssid, p + offset, ssid.length);
+ offset += ssid.length;
+ length -= ssid.length;
}
- pbody->ssid.ssid[pbody->ssid.length] = '\0';
- /* Present and not truncated */
- pbody->ssid_status = PRESENT;
+ ssid.ssid[ssid.length] = '\0';
+ /*
+ * Present and not truncated.
+ *
+ * If we haven't already seen an SSID IE,
+ * copy this one, otherwise ignore this one,
+ * so we later report the first one we saw.
+ */
+ if (!pbody->ssid_present) {
+ pbody->ssid = ssid;
+ pbody->ssid_present = 1;
+ }
break;
case E_CHALLENGE:
- /* Present, possibly truncated */
- pbody->challenge_status = TRUNCATED;
if (!TTEST2(*(p + offset), 2))
- return;
- memcpy(&pbody->challenge, p + offset, 2);
+ return 0;
+ if (length < 2)
+ return 0;
+ memcpy(&challenge, p + offset, 2);
offset += 2;
- if (pbody->challenge.length != 0) {
- if (pbody->challenge.length >
- sizeof(pbody->challenge.text) - 1)
- return;
- if (!TTEST2(*(p + offset), pbody->challenge.length))
- return;
- memcpy(&pbody->challenge.text, p + offset,
- pbody->challenge.length);
- offset += pbody->challenge.length;
+ length -= 2;
+ if (challenge.length != 0) {
+ if (challenge.length >
+ sizeof(challenge.text) - 1)
+ return 0;
+ if (!TTEST2(*(p + offset), challenge.length))
+ return 0;
+ if (length < challenge.length)
+ return 0;
+ memcpy(&challenge.text, p + offset,
+ challenge.length);
+ offset += challenge.length;
+ length -= challenge.length;
}
- pbody->challenge.text[pbody->challenge.length] = '\0';
- /* Present and not truncated */
- pbody->challenge_status = PRESENT;
+ challenge.text[challenge.length] = '\0';
+ /*
+ * Present and not truncated.
+ *
+ * If we haven't already seen a challenge IE,
+ * copy this one, otherwise ignore this one,
+ * so we later report the first one we saw.
+ */
+ if (!pbody->challenge_present) {
+ pbody->challenge = challenge;
+ pbody->challenge_present = 1;
+ }
break;
case E_RATES:
- /* Present, possibly truncated */
- pbody->rates_status = TRUNCATED;
if (!TTEST2(*(p + offset), 2))
- return;
- memcpy(&(pbody->rates), p + offset, 2);
+ return 0;
+ if (length < 2)
+ return 0;
+ memcpy(&rates, p + offset, 2);
offset += 2;
- if (pbody->rates.length != 0) {
- if (pbody->rates.length > sizeof pbody->rates.rate)
- return;
- if (!TTEST2(*(p + offset), pbody->rates.length))
- return;
- memcpy(&pbody->rates.rate, p + offset,
- pbody->rates.length);
- offset += pbody->rates.length;
+ length -= 2;
+ if (rates.length != 0) {
+ if (rates.length > sizeof rates.rate)
+ return 0;
+ if (!TTEST2(*(p + offset), rates.length))
+ return 0;
+ if (length < rates.length)
+ return 0;
+ memcpy(&rates.rate, p + offset, rates.length);
+ offset += rates.length;
+ length -= rates.length;
}
- /* Present and not truncated */
- pbody->rates_status = PRESENT;
+ /*
+ * Present and not truncated.
+ *
+ * If we haven't already seen a rates IE,
+ * copy this one if it's not zero-length,
+ * otherwise ignore this one, so we later
+ * report the first one we saw.
+ *
+ * We ignore zero-length rates IEs as some
+ * devices seem to put a zero-length rates
+ * IE, followed by an SSID IE, followed by
+ * a non-zero-length rates IE into frames,
+ * even though IEEE Std 802.11-2007 doesn't
+ * seem to indicate that a zero-length rates
+ * IE is valid.
+ */
+ if (!pbody->rates_present && rates.length != 0) {
+ pbody->rates = rates;
+ pbody->rates_present = 1;
+ }
break;
case E_DS:
- /* Present, possibly truncated */
- pbody->ds_status = TRUNCATED;
if (!TTEST2(*(p + offset), 3))
- return;
- memcpy(&pbody->ds, p + offset, 3);
+ return 0;
+ if (length < 3)
+ return 0;
+ memcpy(&ds, p + offset, 3);
offset += 3;
- /* Present and not truncated */
- pbody->ds_status = PRESENT;
+ length -= 3;
+ /*
+ * Present and not truncated.
+ *
+ * If we haven't already seen a DS IE,
+ * copy this one, otherwise ignore this one,
+ * so we later report the first one we saw.
+ */
+ if (!pbody->ds_present) {
+ pbody->ds = ds;
+ pbody->ds_present = 1;
+ }
break;
case E_CF:
- /* Present, possibly truncated */
- pbody->cf_status = TRUNCATED;
if (!TTEST2(*(p + offset), 8))
- return;
- memcpy(&pbody->cf, p + offset, 8);
+ return 0;
+ if (length < 8)
+ return 0;
+ memcpy(&cf, p + offset, 8);
offset += 8;
- /* Present and not truncated */
- pbody->cf_status = PRESENT;
+ length -= 8;
+ /*
+ * Present and not truncated.
+ *
+ * If we haven't already seen a CF IE,
+ * copy this one, otherwise ignore this one,
+ * so we later report the first one we saw.
+ */
+ if (!pbody->cf_present) {
+ pbody->cf = cf;
+ pbody->cf_present = 1;
+ }
break;
case E_TIM:
- /* Present, possibly truncated */
- pbody->tim_status = TRUNCATED;
if (!TTEST2(*(p + offset), 2))
- return;
- memcpy(&pbody->tim, p + offset, 2);
+ return 0;
+ if (length < 2)
+ return 0;
+ memcpy(&tim, p + offset, 2);
offset += 2;
+ length -= 2;
if (!TTEST2(*(p + offset), 3))
- return;
- memcpy(&pbody->tim.count, p + offset, 3);
+ return 0;
+ if (length < 3)
+ return 0;
+ memcpy(&tim.count, p + offset, 3);
offset += 3;
+ length -= 3;
- if (pbody->tim.length <= 3)
+ if (tim.length <= 3)
break;
- if (pbody->tim.length - 3 > sizeof pbody->tim.bitmap)
- return;
- if (!TTEST2(*(p + offset), pbody->tim.length - 3))
- return;
- memcpy(pbody->tim.bitmap, p + (pbody->tim.length - 3),
- (pbody->tim.length - 3));
- offset += pbody->tim.length - 3;
- /* Present and not truncated */
- pbody->tim_status = PRESENT;
+ if (tim.length - 3 > (int)sizeof tim.bitmap)
+ return 0;
+ if (!TTEST2(*(p + offset), tim.length - 3))
+ return 0;
+ if (length < (u_int)(tim.length - 3))
+ return 0;
+ memcpy(tim.bitmap, p + (tim.length - 3),
+ (tim.length - 3));
+ offset += tim.length - 3;
+ length -= tim.length - 3;
+ /*
+ * Present and not truncated.
+ *
+ * If we haven't already seen a TIM IE,
+ * copy this one, otherwise ignore this one,
+ * so we later report the first one we saw.
+ */
+ if (!pbody->tim_present) {
+ pbody->tim = tim;
+ pbody->tim_present = 1;
+ }
break;
default:
#if 0
printf("(1) unhandled element_id (%d) ",
- *(p + offset) );
+ *(p + offset));
#endif
if (!TTEST2(*(p + offset), 2))
- return;
- if (!TTEST2(*(p + offset + 2), *(p + offset + 1)))
- return;
- offset += *(p + offset + 1) + 2;
+ return 0;
+ if (length < 2)
+ return 0;
+ elementlen = *(p + offset + 1);
+ if (!TTEST2(*(p + offset + 2), elementlen))
+ return 0;
+ if (length < elementlen + 2)
+ return 0;
+ offset += elementlen + 2;
+ length -= elementlen + 2;
break;
}
}
+
+ /* No problems found. */
+ return 1;
}
/*********************************************************************************
@@ -316,10 +894,11 @@
*********************************************************************************/
static int
-handle_beacon(const u_char *p)
+handle_beacon(const u_char *p, u_int length)
{
struct mgmt_body_t pbody;
int offset = 0;
+ int ret;
memset(&pbody, 0, sizeof(pbody));
@@ -326,14 +905,20 @@
if (!TTEST2(*p, IEEE802_11_TSTAMP_LEN + IEEE802_11_BCNINT_LEN +
IEEE802_11_CAPINFO_LEN))
return 0;
+ if (length < IEEE802_11_TSTAMP_LEN + IEEE802_11_BCNINT_LEN +
+ IEEE802_11_CAPINFO_LEN)
+ return 0;
memcpy(&pbody.timestamp, p, IEEE802_11_TSTAMP_LEN);
offset += IEEE802_11_TSTAMP_LEN;
+ length -= IEEE802_11_TSTAMP_LEN;
pbody.beacon_interval = EXTRACT_LE_16BITS(p+offset);
offset += IEEE802_11_BCNINT_LEN;
+ length -= IEEE802_11_BCNINT_LEN;
pbody.capability_info = EXTRACT_LE_16BITS(p+offset);
offset += IEEE802_11_CAPINFO_LEN;
+ length -= IEEE802_11_CAPINFO_LEN;
- parse_elements(&pbody, p, offset);
+ ret = parse_elements(&pbody, p, offset, length);
PRINT_SSID(pbody);
PRINT_RATES(pbody);
@@ -341,36 +926,42 @@
CAPABILITY_ESS(pbody.capability_info) ? "ESS" : "IBSS");
PRINT_DS_CHANNEL(pbody);
- return 1;
+ return ret;
}
static int
-handle_assoc_request(const u_char *p)
+handle_assoc_request(const u_char *p, u_int length)
{
struct mgmt_body_t pbody;
int offset = 0;
+ int ret;
memset(&pbody, 0, sizeof(pbody));
if (!TTEST2(*p, IEEE802_11_CAPINFO_LEN + IEEE802_11_LISTENINT_LEN))
return 0;
+ if (length < IEEE802_11_CAPINFO_LEN + IEEE802_11_LISTENINT_LEN)
+ return 0;
pbody.capability_info = EXTRACT_LE_16BITS(p);
offset += IEEE802_11_CAPINFO_LEN;
+ length -= IEEE802_11_CAPINFO_LEN;
pbody.listen_interval = EXTRACT_LE_16BITS(p+offset);
offset += IEEE802_11_LISTENINT_LEN;
+ length -= IEEE802_11_LISTENINT_LEN;
- parse_elements(&pbody, p, offset);
+ ret = parse_elements(&pbody, p, offset, length);
PRINT_SSID(pbody);
PRINT_RATES(pbody);
- return 1;
+ return ret;
}
static int
-handle_assoc_response(const u_char *p)
+handle_assoc_response(const u_char *p, u_int length)
{
struct mgmt_body_t pbody;
int offset = 0;
+ int ret;
memset(&pbody, 0, sizeof(pbody));
@@ -377,14 +968,20 @@
if (!TTEST2(*p, IEEE802_11_CAPINFO_LEN + IEEE802_11_STATUS_LEN +
IEEE802_11_AID_LEN))
return 0;
+ if (length < IEEE802_11_CAPINFO_LEN + IEEE802_11_STATUS_LEN +
+ IEEE802_11_AID_LEN)
+ return 0;
pbody.capability_info = EXTRACT_LE_16BITS(p);
offset += IEEE802_11_CAPINFO_LEN;
+ length -= IEEE802_11_CAPINFO_LEN;
pbody.status_code = EXTRACT_LE_16BITS(p+offset);
offset += IEEE802_11_STATUS_LEN;
+ length -= IEEE802_11_STATUS_LEN;
pbody.aid = EXTRACT_LE_16BITS(p+offset);
offset += IEEE802_11_AID_LEN;
+ length -= IEEE802_11_AID_LEN;
- parse_elements(&pbody, p, offset);
+ ret = parse_elements(&pbody, p, offset, length);
printf(" AID(%x) :%s: %s", ((u_int16_t)(pbody.aid << 2 )) >> 2 ,
CAPABILITY_PRIVACY(pbody.capability_info) ? " PRIVACY " : "",
@@ -392,14 +989,15 @@
? status_text[pbody.status_code]
: "n/a"));
- return 1;
+ return ret;
}
static int
-handle_reassoc_request(const u_char *p)
+handle_reassoc_request(const u_char *p, u_int length)
{
struct mgmt_body_t pbody;
int offset = 0;
+ int ret;
memset(&pbody, 0, sizeof(pbody));
@@ -406,49 +1004,57 @@
if (!TTEST2(*p, IEEE802_11_CAPINFO_LEN + IEEE802_11_LISTENINT_LEN +
IEEE802_11_AP_LEN))
return 0;
+ if (length < IEEE802_11_CAPINFO_LEN + IEEE802_11_LISTENINT_LEN +
+ IEEE802_11_AP_LEN)
+ return 0;
pbody.capability_info = EXTRACT_LE_16BITS(p);
offset += IEEE802_11_CAPINFO_LEN;
+ length -= IEEE802_11_CAPINFO_LEN;
pbody.listen_interval = EXTRACT_LE_16BITS(p+offset);
offset += IEEE802_11_LISTENINT_LEN;
+ length -= IEEE802_11_LISTENINT_LEN;
memcpy(&pbody.ap, p+offset, IEEE802_11_AP_LEN);
offset += IEEE802_11_AP_LEN;
+ length -= IEEE802_11_AP_LEN;
- parse_elements(&pbody, p, offset);
+ ret = parse_elements(&pbody, p, offset, length);
PRINT_SSID(pbody);
printf(" AP : %s", etheraddr_string( pbody.ap ));
- return 1;
+ return ret;
}
static int
-handle_reassoc_response(const u_char *p)
+handle_reassoc_response(const u_char *p, u_int length)
{
/* Same as a Association Reponse */
- return handle_assoc_response(p);
+ return handle_assoc_response(p, length);
}
static int
-handle_probe_request(const u_char *p)
+handle_probe_request(const u_char *p, u_int length)
{
struct mgmt_body_t pbody;
int offset = 0;
+ int ret;
memset(&pbody, 0, sizeof(pbody));
- parse_elements(&pbody, p, offset);
+ ret = parse_elements(&pbody, p, offset, length);
PRINT_SSID(pbody);
PRINT_RATES(pbody);
- return 1;
+ return ret;
}
static int
-handle_probe_response(const u_char *p)
+handle_probe_response(const u_char *p, u_int length)
{
struct mgmt_body_t pbody;
int offset = 0;
+ int ret;
memset(&pbody, 0, sizeof(pbody));
@@ -455,21 +1061,26 @@
if (!TTEST2(*p, IEEE802_11_TSTAMP_LEN + IEEE802_11_BCNINT_LEN +
IEEE802_11_CAPINFO_LEN))
return 0;
-
+ if (length < IEEE802_11_TSTAMP_LEN + IEEE802_11_BCNINT_LEN +
+ IEEE802_11_CAPINFO_LEN)
+ return 0;
memcpy(&pbody.timestamp, p, IEEE802_11_TSTAMP_LEN);
offset += IEEE802_11_TSTAMP_LEN;
+ length -= IEEE802_11_TSTAMP_LEN;
pbody.beacon_interval = EXTRACT_LE_16BITS(p+offset);
offset += IEEE802_11_BCNINT_LEN;
+ length -= IEEE802_11_BCNINT_LEN;
pbody.capability_info = EXTRACT_LE_16BITS(p+offset);
offset += IEEE802_11_CAPINFO_LEN;
+ length -= IEEE802_11_CAPINFO_LEN;
- parse_elements(&pbody, p, offset);
+ ret = parse_elements(&pbody, p, offset, length);
PRINT_SSID(pbody);
PRINT_RATES(pbody);
PRINT_DS_CHANNEL(pbody);
- return 1;
+ return ret;
}
static int
@@ -480,7 +1091,7 @@
}
static int
-handle_disassoc(const u_char *p)
+handle_disassoc(const u_char *p, u_int length)
{
struct mgmt_body_t pbody;
@@ -488,6 +1099,8 @@
if (!TTEST2(*p, IEEE802_11_REASON_LEN))
return 0;
+ if (length < IEEE802_11_REASON_LEN)
+ return 0;
pbody.reason_code = EXTRACT_LE_16BITS(p);
printf(": %s",
@@ -499,23 +1112,29 @@
}
static int
-handle_auth(const u_char *p)
+handle_auth(const u_char *p, u_int length)
{
struct mgmt_body_t pbody;
int offset = 0;
+ int ret;
memset(&pbody, 0, sizeof(pbody));
if (!TTEST2(*p, 6))
return 0;
+ if (length < 6)
+ return 0;
pbody.auth_alg = EXTRACT_LE_16BITS(p);
offset += 2;
+ length -= 2;
pbody.auth_trans_seq_num = EXTRACT_LE_16BITS(p + offset);
offset += 2;
+ length -= 2;
pbody.status_code = EXTRACT_LE_16BITS(p + offset);
offset += 2;
+ length -= 2;
- parse_elements(&pbody, p, offset);
+ ret = parse_elements(&pbody, p, offset, length);
if ((pbody.auth_alg == 1) &&
((pbody.auth_trans_seq_num == 2) ||
@@ -529,7 +1148,7 @@
? ((pbody.status_code < NUM_STATUSES)
? status_text[pbody.status_code]
: "n/a") : ""));
- return 1;
+ return ret;
}
printf(" (%s)-%x: %s",
(pbody.auth_alg < NUM_AUTH_ALGS)
@@ -542,11 +1161,11 @@
: "n/a")
: "");
- return 1;
+ return ret;
}
static int
-handle_deauth(const struct mgmt_header_t *pmh, const u_char *p)
+handle_deauth(const struct mgmt_header_t *pmh, const u_char *p, u_int length)
{
struct mgmt_body_t pbody;
int offset = 0;
@@ -556,8 +1175,11 @@
if (!TTEST2(*p, IEEE802_11_REASON_LEN))
return 0;
+ if (length < IEEE802_11_REASON_LEN)
+ return 0;
pbody.reason_code = EXTRACT_LE_16BITS(p);
offset += IEEE802_11_REASON_LEN;
+ length -= IEEE802_11_REASON_LEN;
reason = (pbody.reason_code < NUM_REASONS)
? reason_text[pbody.reason_code]
@@ -571,7 +1193,98 @@
return 1;
}
+#define PRINT_HT_ACTION(v) (\
+ (v) == 0 ? printf("TxChWidth") : \
+ (v) == 1 ? printf("MIMOPwrSave") : \
+ printf("Act#%d", (v)) \
+)
+#define PRINT_BA_ACTION(v) (\
+ (v) == 0 ? printf("ADDBA Request") : \
+ (v) == 1 ? printf("ADDBA Response") : \
+ (v) == 2 ? printf("DELBA") : \
+ printf("Act#%d", (v)) \
+)
+#define PRINT_MESHLINK_ACTION(v) (\
+ (v) == 0 ? printf("Request") : \
+ (v) == 1 ? printf("Report") : \
+ printf("Act#%d", (v)) \
+)
+#define PRINT_MESHPEERING_ACTION(v) (\
+ (v) == 0 ? printf("Open") : \
+ (v) == 1 ? printf("Confirm") : \
+ (v) == 2 ? printf("Close") : \
+ printf("Act#%d", (v)) \
+)
+#define PRINT_MESHPATH_ACTION(v) (\
+ (v) == 0 ? printf("Request") : \
+ (v) == 1 ? printf("Report") : \
+ (v) == 2 ? printf("Error") : \
+ (v) == 3 ? printf("RootAnnouncement") : \
+ printf("Act#%d", (v)) \
+)
+#define PRINT_MESH_ACTION(v) (\
+ (v) == 0 ? printf("MeshLink") : \
+ (v) == 1 ? printf("HWMP") : \
+ (v) == 2 ? printf("Gate Announcement") : \
+ (v) == 3 ? printf("Congestion Control") : \
+ (v) == 4 ? printf("MCCA Setup Request") : \
+ (v) == 5 ? printf("MCCA Setup Reply") : \
+ (v) == 6 ? printf("MCCA Advertisement Request") : \
+ (v) == 7 ? printf("MCCA Advertisement") : \
+ (v) == 8 ? printf("MCCA Teardown") : \
+ (v) == 9 ? printf("TBTT Adjustment Request") : \
+ (v) == 10 ? printf("TBTT Adjustment Response") : \
+ printf("Act#%d", (v)) \
+)
+#define PRINT_MULTIHOP_ACTION(v) (\
+ (v) == 0 ? printf("Proxy Update") : \
+ (v) == 1 ? printf("Proxy Update Confirmation") : \
+ printf("Act#%d", (v)) \
+)
+#define PRINT_SELFPROT_ACTION(v) (\
+ (v) == 1 ? printf("Peering Open") : \
+ (v) == 2 ? printf("Peering Confirm") : \
+ (v) == 3 ? printf("Peering Close") : \
+ (v) == 4 ? printf("Group Key Inform") : \
+ (v) == 5 ? printf("Group Key Acknowledge") : \
+ printf("Act#%d", (v)) \
+)
+
+static int
+handle_action(const struct mgmt_header_t *pmh, const u_char *p, u_int length)
+{
+ if (!TTEST2(*p, 2))
+ return 0;
+ if (length < 2)
+ return 0;
+ if (eflag) {
+ printf(": ");
+ } else {
+ printf(" (%s): ", etheraddr_string(pmh->sa));
+ }
+ switch (p[0]) {
+ case 0: printf("Spectrum Management Act#%d", p[1]); break;
+ case 1: printf("QoS Act#%d", p[1]); break;
+ case 2: printf("DLS Act#%d", p[1]); break;
+ case 3: printf("BA "); PRINT_BA_ACTION(p[1]); break;
+ case 7: printf("HT "); PRINT_HT_ACTION(p[1]); break;
+ case 13: printf("MeshAction "); PRINT_MESH_ACTION(p[1]); break;
+ case 14:
+ printf("MultiohopAction ");
+ PRINT_MULTIHOP_ACTION(p[1]); break;
+ case 15:
+ printf("SelfprotectAction ");
+ PRINT_SELFPROT_ACTION(p[1]); break;
+ case 127: printf("Vendor Act#%d", p[1]); break;
+ default:
+ printf("Reserved(%d) Act#%d", p[0], p[1]);
+ break;
+ }
+ return 1;
+}
+
+
/*********************************************************************************
* Print Body funcs
*********************************************************************************/
@@ -579,36 +1292,36 @@
static int
mgmt_body_print(u_int16_t fc, const struct mgmt_header_t *pmh,
- const u_char *p)
+ const u_char *p, u_int length)
{
switch (FC_SUBTYPE(fc)) {
case ST_ASSOC_REQUEST:
printf("Assoc Request");
- return handle_assoc_request(p);
+ return handle_assoc_request(p, length);
case ST_ASSOC_RESPONSE:
printf("Assoc Response");
- return handle_assoc_response(p);
+ return handle_assoc_response(p, length);
case ST_REASSOC_REQUEST:
printf("ReAssoc Request");
- return handle_reassoc_request(p);
+ return handle_reassoc_request(p, length);
case ST_REASSOC_RESPONSE:
printf("ReAssoc Response");
- return handle_reassoc_response(p);
+ return handle_reassoc_response(p, length);
case ST_PROBE_REQUEST:
printf("Probe Request");
- return handle_probe_request(p);
+ return handle_probe_request(p, length);
case ST_PROBE_RESPONSE:
printf("Probe Response");
- return handle_probe_response(p);
+ return handle_probe_response(p, length);
case ST_BEACON:
printf("Beacon");
- return handle_beacon(p);
+ return handle_beacon(p, length);
case ST_ATIM:
printf("ATIM");
return handle_atim();
case ST_DISASSOC:
printf("Disassociation");
- return handle_disassoc(p);
+ return handle_disassoc(p, length);
case ST_AUTH:
printf("Authentication");
if (!TTEST2(*p, 3))
@@ -617,11 +1330,15 @@
printf("Authentication (Shared-Key)-3 ");
return wep_print(p);
}
- return handle_auth(p);
+ return handle_auth(p, length);
case ST_DEAUTH:
printf("DeAuthentication");
- return handle_deauth(pmh, p);
+ return handle_deauth(pmh, p, length);
break;
+ case ST_ACTION:
+ printf("Action");
+ return handle_action(pmh, p, length);
+ break;
default:
printf("Unhandled Management subtype(%x)",
FC_SUBTYPE(fc));
@@ -638,6 +1355,10 @@
ctrl_body_print(u_int16_t fc, const u_char *p)
{
switch (FC_SUBTYPE(fc)) {
+ case CTRL_CONTROL_WRAPPER:
+ printf("Control Wrapper");
+ /* XXX - requires special handling */
+ break;
case CTRL_BAR:
printf("BAR");
if (!TTEST2(*p, CTRL_BAR_HDRLEN))
@@ -649,6 +1370,14 @@
EXTRACT_LE_16BITS(&(((const struct ctrl_bar_t *)p)->ctl)),
EXTRACT_LE_16BITS(&(((const struct ctrl_bar_t *)p)->seq)));
break;
+ case CTRL_BA:
+ printf("BA");
+ if (!TTEST2(*p, CTRL_BA_HDRLEN))
+ return 0;
+ if (!eflag)
+ printf(" RA:%s ",
+ etheraddr_string(((const struct ctrl_ba_t *)p)->ra));
+ break;
case CTRL_PS_POLL:
printf("Power Save-Poll");
if (!TTEST2(*p, CTRL_PS_POLL_HDRLEN))
@@ -829,6 +1558,10 @@
EXTRACT_LE_16BITS(&(((const struct ctrl_bar_t *)p)->ctl)),
EXTRACT_LE_16BITS(&(((const struct ctrl_bar_t *)p)->seq)));
break;
+ case CTRL_BA:
+ printf("RA:%s ",
+ etheraddr_string(((const struct ctrl_ba_t *)p)->ra));
+ break;
case CTRL_PS_POLL:
printf("BSSID:%s TA:%s ",
etheraddr_string(((const struct ctrl_ps_poll_t *)p)->bssid),
@@ -901,14 +1634,20 @@
}
}
+static int
+extract_mesh_header_length(const u_char *p)
+{
+ return (p[0] &~ 3) ? 0 : 6*(1 + (p[0] & 3));
+}
+
/*
* Print the 802.11 MAC header if eflag is set, and set "*srcp" and "*dstp"
* to point to the source and destination MAC addresses in any case if
* "srcp" and "dstp" aren't null.
*/
-static inline void
-ieee_802_11_hdr_print(u_int16_t fc, const u_char *p, const u_int8_t **srcp,
- const u_int8_t **dstp)
+static void
+ieee_802_11_hdr_print(u_int16_t fc, const u_char *p, u_int hdrlen,
+ u_int meshdrlen, const u_int8_t **srcp, const u_int8_t **dstp)
{
if (vflag) {
if (FC_MORE_DATA(fc))
@@ -928,7 +1667,22 @@
EXTRACT_LE_16BITS(
&((const struct mgmt_header_t *)p)->duration));
}
+ if (meshdrlen != 0) {
+ const struct meshcntl_t *mc =
+ (const struct meshcntl_t *)&p[hdrlen - meshdrlen];
+ int ae = mc->flags & 3;
+ printf("MeshData (AE %d TTL %u seq %u", ae, mc->ttl,
+ EXTRACT_LE_32BITS(mc->seq));
+ if (ae > 0)
+ printf(" A4:%s", etheraddr_string(mc->addr4));
+ if (ae > 1)
+ printf(" A5:%s", etheraddr_string(mc->addr5));
+ if (ae > 2)
+ printf(" A6:%s", etheraddr_string(mc->addr6));
+ printf(") ");
+ }
+
switch (FC_TYPE(fc)) {
case T_MGMT:
mgmt_header_print(p, srcp, dstp);
@@ -953,29 +1707,51 @@
#endif
static u_int
-ieee802_11_print(const u_char *p, u_int length, u_int caplen, int pad)
+ieee802_11_print(const u_char *p, u_int length, u_int orig_caplen, int pad,
+ u_int fcslen)
{
u_int16_t fc;
- u_int hdrlen;
+ u_int caplen, hdrlen, meshdrlen;
const u_int8_t *src, *dst;
u_short extracted_ethertype;
- if (caplen < IEEE802_11_FC_LEN) {
+ caplen = orig_caplen;
+ /* Remove FCS, if present */
+ if (length < fcslen) {
printf("[|802.11]");
return caplen;
}
+ length -= fcslen;
+ if (caplen > length) {
+ /* Amount of FCS in actual packet data, if any */
+ fcslen = caplen - length;
+ caplen -= fcslen;
+ snapend -= fcslen;
+ }
+ if (caplen < IEEE802_11_FC_LEN) {
+ printf("[|802.11]");
+ return orig_caplen;
+ }
+
fc = EXTRACT_LE_16BITS(p);
hdrlen = extract_header_length(fc);
if (pad)
hdrlen = roundup2(hdrlen, 4);
+ if (Hflag && FC_TYPE(fc) == T_DATA &&
+ DATA_FRAME_IS_QOS(FC_SUBTYPE(fc))) {
+ meshdrlen = extract_mesh_header_length(p+hdrlen);
+ hdrlen += meshdrlen;
+ } else
+ meshdrlen = 0;
+
if (caplen < hdrlen) {
printf("[|802.11]");
return hdrlen;
}
- ieee_802_11_hdr_print(fc, p, &src, &dst);
+ ieee_802_11_hdr_print(fc, p, hdrlen, meshdrlen, &src, &dst);
/*
* Go past the 802.11 header.
@@ -987,7 +1763,7 @@
switch (FC_TYPE(fc)) {
case T_MGMT:
if (!mgmt_body_print(fc,
- (const struct mgmt_header_t *)(p - hdrlen), p)) {
+ (const struct mgmt_header_t *)(p - hdrlen), p, length)) {
printf("[|802.11]");
return hdrlen;
}
@@ -1014,8 +1790,8 @@
* handle intelligently
*/
if (!eflag)
- ieee_802_11_hdr_print(fc, p - hdrlen, NULL,
- NULL);
+ ieee_802_11_hdr_print(fc, p - hdrlen, hdrlen,
+ meshdrlen, NULL, NULL);
if (extracted_ethertype)
printf("(LLC %s) ",
etherproto_string(
@@ -1041,7 +1817,7 @@
u_int
ieee802_11_if_print(const struct pcap_pkthdr *h, const u_char *p)
{
- return ieee802_11_print(p, h->len, h->caplen, 0);
+ return ieee802_11_print(p, h->len, h->caplen, 0, 0);
}
#define IEEE80211_CHAN_FHSS \
@@ -1103,7 +1879,8 @@
}
static int
-print_radiotap_field(struct cpack_state *s, u_int32_t bit, int *pad)
+print_radiotap_field(struct cpack_state *s, u_int32_t bit, u_int8_t *flags,
+ struct radiotap_state *state, u_int32_t presentflags)
{
union {
int8_t i8;
@@ -1118,10 +1895,18 @@
switch (bit) {
case IEEE80211_RADIOTAP_FLAGS:
rc = cpack_uint8(s, &u.u8);
- if (u.u8 & IEEE80211_RADIOTAP_F_DATAPAD)
- *pad = 1;
+ if (rc != 0)
+ break;
+ *flags = u.u8;
break;
case IEEE80211_RADIOTAP_RATE:
+ rc = cpack_uint8(s, &u.u8);
+ if (rc != 0)
+ break;
+
+ /* Save state rate */
+ state->rate = u.u8;
+ break;
case IEEE80211_RADIOTAP_DB_ANTSIGNAL:
case IEEE80211_RADIOTAP_DB_ANTNOISE:
case IEEE80211_RADIOTAP_ANTENNA:
@@ -1140,6 +1925,7 @@
case IEEE80211_RADIOTAP_FHSS:
case IEEE80211_RADIOTAP_LOCK_QUALITY:
case IEEE80211_RADIOTAP_TX_ATTENUATION:
+ case IEEE80211_RADIOTAP_RX_FLAGS:
rc = cpack_uint16(s, &u.u16);
break;
case IEEE80211_RADIOTAP_DB_TX_ATTENUATION:
@@ -1163,12 +1949,51 @@
break;
rc = cpack_uint8(s, &u4.u8);
break;
+ case IEEE80211_RADIOTAP_MCS:
+ rc = cpack_uint8(s, &u.u8);
+ if (rc != 0)
+ break;
+ rc = cpack_uint8(s, &u2.u8);
+ if (rc != 0)
+ break;
+ rc = cpack_uint8(s, &u3.u8);
+ break;
+ case IEEE80211_RADIOTAP_VENDOR_NAMESPACE: {
+ u_int8_t vns[3];
+ u_int16_t length;
+ u_int8_t subspace;
+
+ if ((cpack_align_and_reserve(s, 2)) == NULL) {
+ rc = -1;
+ break;
+ }
+
+ rc = cpack_uint8(s, &vns[0]);
+ if (rc != 0)
+ break;
+ rc = cpack_uint8(s, &vns[1]);
+ if (rc != 0)
+ break;
+ rc = cpack_uint8(s, &vns[2]);
+ if (rc != 0)
+ break;
+ rc = cpack_uint8(s, &subspace);
+ if (rc != 0)
+ break;
+ rc = cpack_uint16(s, &length);
+ if (rc != 0)
+ break;
+
+ /* Skip up to length */
+ s->c_next += length;
+ break;
+ }
default:
/* this bit indicates a field whose
* size we do not know, so we cannot
- * proceed.
+ * proceed. Just print the bit number.
*/
- printf("[0x%08x] ", bit);
+ printf("[bit %u] ", bit);
return -1;
}
@@ -1177,8 +2002,17 @@
return rc;
}
+ /* Preserve the state present flags */
+ state->present = presentflags;
+
switch (bit) {
case IEEE80211_RADIOTAP_CHANNEL:
+ /*
+ * If CHANNEL and XCHANNEL are both present, skip
+ * CHANNEL.
+ */
+ if (presentflags & (1 << IEEE80211_RADIOTAP_XCHANNEL))
+ break;
print_chaninfo(u.u16, u2.u16);
break;
case IEEE80211_RADIOTAP_FHSS:
@@ -1185,10 +2019,47 @@
printf("fhset %d fhpat %d ", u.u16 & 0xff, (u.u16 >> 8) & 0xff);
break;
case IEEE80211_RADIOTAP_RATE:
- if (u.u8 & 0x80)
- PRINT_RATE("", u.u8, " Mb/s ");
- else
- PRINT_HT_RATE("", u.u8, " Mb/s ");
+ /*
+ * XXX On FreeBSD rate & 0x80 means we have an MCS. On
+ * Linux and AirPcap it does not. (What about
+ * Mac OS X, NetBSD, OpenBSD, and DragonFly BSD?)
+ *
+ * This is an issue either for proprietary extensions
+ * to 11a or 11g, which do exist, or for 11n
+ * implementations that stuff a rate value into
+ * this field, which also appear to exist.
+ *
+ * We currently handle that by assuming that
+ * if the 0x80 bit is set *and* the remaining
+ * bits have a value between 0 and 15 it's
+ * an MCS value, otherwise it's a rate. If
+ * there are cases where systems that use
+ * "0x80 + MCS index" for MCS indices > 15,
+ * or stuff a rate value here between 64 and
+ * 71.5 Mb/s in here, we'll need a preference
+ * setting. Such rates do exist, e.g. 11n
+ * MCS 7 at 20 MHz with a long guard interval.
+ */
+ if (u.u8 >= 0x80 && u.u8 <= 0x8f) {
+ /*
+ * XXX - we don't know the channel width
+ * or guard interval length, so we can't
+ * convert this to a data rate.
+ *
+ * If you want us to show a data rate,
+ * use the MCS field, not the Rate field;
+ * the MCS field includes not only the
+ * MCS index, it also includes bandwidth
+ * and guard interval information.
+ *
+ * XXX - can we get the channel width
+ * from XChannel and the guard interval
+ * information from Flags, at least on
+ * FreeBSD?
+ */
+ printf("MCS %u ", u.u8 & 0x7f);
+ } else
+ printf("%2.1f Mb/s ", .5*u.u8);
break;
case IEEE80211_RADIOTAP_DBM_ANTSIGNAL:
printf("%ddB signal ", u.i8);
@@ -1232,9 +2103,89 @@
case IEEE80211_RADIOTAP_TSFT:
printf("%" PRIu64 "us tsft ", u.u64);
break;
+ case IEEE80211_RADIOTAP_RX_FLAGS:
+ /* Do nothing for now */
+ break;
case IEEE80211_RADIOTAP_XCHANNEL:
print_chaninfo(u2.u16, u.u32);
break;
+ case IEEE80211_RADIOTAP_MCS: {
+ static const char *bandwidth[4] = {
+ "20 MHz",
+ "40 MHz",
+ "20 MHz (L)",
+ "20 MHz (U)"
+ };
+ float htrate;
+
+ if (u.u8 & IEEE80211_RADIOTAP_MCS_MCS_INDEX_KNOWN) {
+ /*
+ * We know the MCS index.
+ */
+ if (u3.u8 <= MAX_MCS_INDEX) {
+ /*
+ * And it's in-range.
+ */
+ if (u.u8 & (IEEE80211_RADIOTAP_MCS_BANDWIDTH_KNOWN|IEEE80211_RADIOTAP_MCS_GUARD_INTERVAL_KNOWN)) {
+ /*
+ * And we know both the bandwidth and
+ * the guard interval, so we can look
+ * up the rate.
+ */
+ htrate =
+ ieee80211_float_htrates \
+ [u3.u8] \
+ [((u2.u8 & IEEE80211_RADIOTAP_MCS_BANDWIDTH_MASK) == IEEE80211_RADIOTAP_MCS_BANDWIDTH_40 ? 1 : 0)] \
+ [((u2.u8 & IEEE80211_RADIOTAP_MCS_SHORT_GI) ? 1 : 0)];
+ } else {
+ /*
+ * We don't know both the bandwidth
+ * and the guard interval, so we can
+ * only report the MCS index.
+ */
+ htrate = 0.0;
+ }
+ } else {
+ /*
+ * The MCS value is out of range.
+ */
+ htrate = 0.0;
+ }
+ if (htrate != 0.0) {
+ /*
+ * We have the rate.
+ * Print it.
+ */
+ printf("%.1f Mb/s MCS %u ", htrate, u3.u8);
+ } else {
+ /*
+ * We at least have the MCS index.
+ * Print it.
+ */
+ printf("MCS %u ", u3.u8);
+ }
+ }
+ if (u.u8 & IEEE80211_RADIOTAP_MCS_BANDWIDTH_KNOWN) {
+ printf("%s ",
+ bandwidth[u2.u8 & IEEE80211_RADIOTAP_MCS_BANDWIDTH_MASK]);
+ }
+ if (u.u8 & IEEE80211_RADIOTAP_MCS_GUARD_INTERVAL_KNOWN) {
+ printf("%s GI ",
+ (u2.u8 & IEEE80211_RADIOTAP_MCS_SHORT_GI) ?
+ "short" : "lon");
+ }
+ if (u.u8 & IEEE80211_RADIOTAP_MCS_HT_FORMAT_KNOWN) {
+ printf("%s ",
+ (u2.u8 & IEEE80211_RADIOTAP_MCS_HT_GREENFIELD) ?
+ "greenfield" : "mixed");
+ }
+ if (u.u8 & IEEE80211_RADIOTAP_MCS_FEC_TYPE_KNOWN) {
+ printf("%s FEC ",
+ (u2.u8 & IEEE80211_RADIOTAP_MCS_FEC_LDPC) ?
+ "LDPC" : "BCC");
+ }
+ break;
+ }
}
return 0;
}
@@ -1247,7 +2198,7 @@
#define BITNO_8(x) (((x) >> 4) ? 4 + BITNO_4((x) >> 4) : BITNO_4((x)))
#define BITNO_4(x) (((x) >> 2) ? 2 + BITNO_2((x) >> 2) : BITNO_2((x)))
#define BITNO_2(x) (((x) & 2) ? 1 : 0)
-#define BIT(n) (1 << n)
+#define BIT(n) (1U << n)
#define IS_EXTENDED(__p) \
(EXTRACT_LE_32BITS(__p) & BIT(IEEE80211_RADIOTAP_EXT)) != 0
@@ -1254,12 +2205,16 @@
struct cpack_state cpacker;
struct ieee80211_radiotap_header *hdr;
u_int32_t present, next_present;
+ u_int32_t presentflags = 0;
u_int32_t *presentp, *last_presentp;
enum ieee80211_radiotap_type bit;
int bit0;
const u_char *iter;
u_int len;
+ u_int8_t flags;
int pad;
+ u_int fcslen;
+ struct radiotap_state state;
if (caplen < sizeof(*hdr)) {
printf("[|802.11]");
@@ -1293,10 +2248,19 @@
return caplen;
}
+ /* Assume no flags */
+ flags = 0;
/* Assume no Atheros padding between 802.11 header and body */
pad = 0;
+ /* Assume no FCS at end of frame */
+ fcslen = 0;
for (bit0 = 0, presentp = &hdr->it_present; presentp <= last_presentp;
presentp++, bit0 += 32) {
+ presentflags = EXTRACT_LE_32BITS(presentp);
+
+ /* Clear state. */
+ memset(&state, 0, sizeof(state));
+
for (present = EXTRACT_LE_32BITS(presentp); present;
present = next_present) {
/* clear the least significant bit that is set */
@@ -1306,12 +2270,18 @@
bit = (enum ieee80211_radiotap_type)
(bit0 + BITNO_32(present ^ next_present));
- if (print_radiotap_field(&cpacker, bit, &pad) != 0)
+ if (print_radiotap_field(&cpacker, bit, &flags, &state, presentflags) != 0)
goto out;
}
}
+
out:
- return len + ieee802_11_print(p + len, length - len, caplen - len, pad);
+ if (flags & IEEE80211_RADIOTAP_F_DATAPAD)
+ pad = 1; /* Atheros padding */
+ if (flags & IEEE80211_RADIOTAP_F_FCS)
+ fcslen = 4; /* FCS at end of packet */
+ return len + ieee802_11_print(p + len, length - len, caplen - len, pad,
+ fcslen);
#undef BITNO_32
#undef BITNO_16
#undef BITNO_8
@@ -1325,6 +2295,11 @@
{
u_int32_t caphdr_len;
+ if (caplen < 8) {
+ printf("[|802.11]");
+ return caplen;
+ }
+
caphdr_len = EXTRACT_32BITS(p + 4);
if (caphdr_len < 8) {
/*
@@ -1342,12 +2317,14 @@
}
return caphdr_len + ieee802_11_print(p + caphdr_len,
- length - caphdr_len, caplen - caphdr_len, 0);
+ length - caphdr_len, caplen - caphdr_len, 0, 0);
}
#define PRISM_HDR_LEN 144
+#define WLANCAP_MAGIC_COOKIE_BASE 0x80211000
#define WLANCAP_MAGIC_COOKIE_V1 0x80211001
+#define WLANCAP_MAGIC_COOKIE_V2 0x80211002
/*
* For DLT_PRISM_HEADER; like DLT_IEEE802_11, but with an extra header,
@@ -1354,12 +2331,13 @@
* containing information such as radio information, which we
* currently ignore.
*
- * If, however, the packet begins with WLANCAP_MAGIC_COOKIE_V1, it's
- * really DLT_IEEE802_11_RADIO (currently, on Linux, there's no
- * ARPHRD_ type for DLT_IEEE802_11_RADIO, as there is a
- * ARPHRD_IEEE80211_PRISM for DLT_PRISM_HEADER, so
- * ARPHRD_IEEE80211_PRISM is used for DLT_IEEE802_11_RADIO, and
- * the first 4 bytes of the header are used to indicate which it is).
+ * If, however, the packet begins with WLANCAP_MAGIC_COOKIE_V1 or
+ * WLANCAP_MAGIC_COOKIE_V2, it's really DLT_IEEE802_11_RADIO_AVS
+ * (currently, on Linux, there's no ARPHRD_ type for
+ * DLT_IEEE802_11_RADIO_AVS, as there is a ARPHRD_IEEE80211_PRISM
+ * for DLT_PRISM_HEADER, so ARPHRD_IEEE80211_PRISM is used for
+ * the AVS header, and the first 4 bytes of the header are used to
+ * indicate whether it's a Prism header or an AVS header).
*/
u_int
prism_if_print(const struct pcap_pkthdr *h, const u_char *p)
@@ -1366,6 +2344,7 @@
{
u_int caplen = h->caplen;
u_int length = h->len;
+ u_int32_t msgcode;
if (caplen < 4) {
printf("[|802.11]");
@@ -1372,7 +2351,9 @@
return caplen;
}
- if (EXTRACT_32BITS(p) == WLANCAP_MAGIC_COOKIE_V1)
+ msgcode = EXTRACT_32BITS(p);
+ if (msgcode == WLANCAP_MAGIC_COOKIE_V1 ||
+ msgcode == WLANCAP_MAGIC_COOKIE_V2)
return ieee802_11_avs_radio_print(p, length, caplen);
if (caplen < PRISM_HDR_LEN) {
@@ -1381,24 +2362,26 @@
}
return PRISM_HDR_LEN + ieee802_11_print(p + PRISM_HDR_LEN,
- length - PRISM_HDR_LEN, caplen - PRISM_HDR_LEN, 0);
+ length - PRISM_HDR_LEN, caplen - PRISM_HDR_LEN, 0, 0);
}
/*
* For DLT_IEEE802_11_RADIO; like DLT_IEEE802_11, but with an extra
- * header, containing information such as radio information, which we
- * currently ignore.
+ * header, containing information such as radio information.
*/
u_int
ieee802_11_radio_if_print(const struct pcap_pkthdr *h, const u_char *p)
{
- u_int caplen = h->caplen;
- u_int length = h->len;
+ return ieee802_11_radio_print(p, h->len, h->caplen);
+}
- if (caplen < 8) {
- printf("[|802.11]");
- return caplen;
- }
-
- return ieee802_11_radio_print(p, length, caplen);
+/*
+ * For DLT_IEEE802_11_RADIO_AVS; like DLT_IEEE802_11, but with an
+ * extra header, containing information such as radio information,
+ * which we currently ignore.
+ */
+u_int
+ieee802_11_radio_avs_if_print(const struct pcap_pkthdr *h, const u_char *p)
+{
+ return ieee802_11_avs_radio_print(p, h->len, h->caplen);
}
Added: trunk/contrib/tcpdump/print-802_15_4.c
===================================================================
--- trunk/contrib/tcpdump/print-802_15_4.c (rev 0)
+++ trunk/contrib/tcpdump/print-802_15_4.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2009
+ * Siemens AG, All rights reserved.
+ * Dmitry Eremin-Solenikov (dbaryshkov at gmail.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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <pcap.h>
+#include <string.h>
+
+#include "interface.h"
+#include "addrtoname.h"
+
+#include "extract.h"
+
+static const char *ftypes[] = {
+ "Beacon", /* 0 */
+ "Data", /* 1 */
+ "ACK", /* 2 */
+ "Command", /* 3 */
+ "Reserved", /* 4 */
+ "Reserved", /* 5 */
+ "Reserved", /* 6 */
+ "Reserved", /* 7 */
+};
+
+static int
+extract_header_length(u_int16_t fc)
+{
+ int len = 0;
+
+ switch ((fc >> 10) & 0x3) {
+ case 0x00:
+ if (fc & (1 << 6)) /* intra-PAN with none dest addr */
+ return -1;
+ break;
+ case 0x01:
+ return -1;
+ case 0x02:
+ len += 4;
+ break;
+ case 0x03:
+ len += 10;
+ break;
+ }
+
+ switch ((fc >> 14) & 0x3) {
+ case 0x00:
+ break;
+ case 0x01:
+ return -1;
+ case 0x02:
+ len += 4;
+ break;
+ case 0x03:
+ len += 10;
+ break;
+ }
+
+ if (fc & (1 << 6)) {
+ if (len < 2)
+ return -1;
+ len -= 2;
+ }
+
+ return len;
+}
+
+
+u_int
+ieee802_15_4_if_print(struct netdissect_options *ndo,
+ const struct pcap_pkthdr *h, const u_char *p)
+{
+ u_int caplen = h->caplen;
+ int hdrlen;
+ u_int16_t fc;
+ u_int8_t seq;
+
+ if (caplen < 3) {
+ ND_PRINT((ndo, "[|802.15.4] %x", caplen));
+ return caplen;
+ }
+
+ fc = EXTRACT_LE_16BITS(p);
+ hdrlen = extract_header_length(fc);
+
+ seq = EXTRACT_LE_8BITS(p + 2);
+
+ p += 3;
+ caplen -= 3;
+
+ ND_PRINT((ndo,"IEEE 802.15.4 %s packet ", ftypes[fc & 0x7]));
+ if (vflag)
+ ND_PRINT((ndo,"seq %02x ", seq));
+ if (hdrlen == -1) {
+ ND_PRINT((ndo,"malformed! "));
+ return caplen;
+ }
+
+
+ if (!vflag) {
+ p+= hdrlen;
+ caplen -= hdrlen;
+ } else {
+ u_int16_t panid = 0;
+
+ switch ((fc >> 10) & 0x3) {
+ case 0x00:
+ ND_PRINT((ndo,"none "));
+ break;
+ case 0x01:
+ ND_PRINT((ndo,"reserved destination addressing mode"));
+ return 0;
+ case 0x02:
+ panid = EXTRACT_LE_16BITS(p);
+ p += 2;
+ ND_PRINT((ndo,"%04x:%04x ", panid, EXTRACT_LE_16BITS(p)));
+ p += 2;
+ break;
+ case 0x03:
+ panid = EXTRACT_LE_16BITS(p);
+ p += 2;
+ ND_PRINT((ndo,"%04x:%s ", panid, le64addr_string(p)));
+ p += 8;
+ break;
+ }
+ ND_PRINT((ndo,"< ");
+
+ switch ((fc >> 14) & 0x3) {
+ case 0x00:
+ ND_PRINT((ndo,"none "));
+ break;
+ case 0x01:
+ ND_PRINT((ndo,"reserved source addressing mode"));
+ return 0;
+ case 0x02:
+ if (!(fc & (1 << 6))) {
+ panid = EXTRACT_LE_16BITS(p);
+ p += 2;
+ }
+ ND_PRINT((ndo,"%04x:%04x ", panid, EXTRACT_LE_16BITS(p)));
+ p += 2;
+ break;
+ case 0x03:
+ if (!(fc & (1 << 6))) {
+ panid = EXTRACT_LE_16BITS(p);
+ p += 2;
+ }
+ ND_PRINT((ndo,"%04x:%s ", panid, le64addr_string(p))));
+ p += 8;
+ break;
+ }
+
+ caplen -= hdrlen;
+ }
+
+ if (!suppress_default_print)
+ (ndo->ndo_default_print)(ndo, p, caplen);
+
+ return 0;
+}
Property changes on: trunk/contrib/tcpdump/print-802_15_4.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-ah.c
===================================================================
--- trunk/contrib/tcpdump/print-ah.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ah.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ah.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ah.c,v 1.22 2003-11-19 00:36:06 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-aodv.c
===================================================================
--- trunk/contrib/tcpdump/print-aodv.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-aodv.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -32,7 +32,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-aodv.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-aodv.c,v 1.11 2004-03-24 00:30:19 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-ap1394.c
===================================================================
--- trunk/contrib/tcpdump/print-ap1394.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ap1394.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ap1394.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ap1394.c,v 1.5 2006-02-11 22:12:06 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -33,6 +33,7 @@
#include <pcap.h>
#include "interface.h"
+#include "extract.h"
#include "addrtoname.h"
#include "ethertype.h"
@@ -57,18 +58,21 @@
ap1394_hdr_print(register const u_char *bp, u_int length)
{
register const struct firewire_header *fp;
+ u_int16_t firewire_type;
+
fp = (const struct firewire_header *)bp;
(void)printf("%s > %s",
- linkaddr_string(fp->firewire_dhost, FIREWIRE_EUI64_LEN),
- linkaddr_string(fp->firewire_shost, FIREWIRE_EUI64_LEN));
+ linkaddr_string(fp->firewire_dhost, LINKADDR_IEEE1394, FIREWIRE_EUI64_LEN),
+ linkaddr_string(fp->firewire_shost, LINKADDR_IEEE1394, FIREWIRE_EUI64_LEN));
+ firewire_type = EXTRACT_16BITS(&fp->firewire_type);
if (!qflag) {
(void)printf(", ethertype %s (0x%04x)",
- tok2str(ethertype_values,"Unknown", ntohs(fp->firewire_type)),
- ntohs(fp->firewire_type));
+ tok2str(ethertype_values,"Unknown", firewire_type),
+ firewire_type);
} else {
- (void)printf(", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", ntohs(fp->firewire_type)));
+ (void)printf(", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", firewire_type));
}
(void)printf(", length %u: ", length);
@@ -87,7 +91,6 @@
u_int caplen = h->caplen;
struct firewire_header *fp;
u_short ether_type;
- u_short extracted_ether_type;
if (caplen < FIREWIRE_HDRLEN) {
printf("[|ap1394]");
@@ -102,11 +105,8 @@
fp = (struct firewire_header *)p;
p += FIREWIRE_HDRLEN;
- ether_type = ntohs(fp->firewire_type);
-
- extracted_ether_type = 0;
- if (ether_encap_print(ether_type, p, length, caplen,
- &extracted_ether_type) == 0) {
+ ether_type = EXTRACT_16BITS(&fp->firewire_type);
+ if (ethertype_print(gndo, ether_type, p, length, caplen) == 0) {
/* ether_type not known, print raw packet */
if (!eflag)
ap1394_hdr_print((u_char *)fp, length + FIREWIRE_HDRLEN);
Modified: trunk/contrib/tcpdump/print-arcnet.c
===================================================================
--- trunk/contrib/tcpdump/print-arcnet.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-arcnet.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -22,7 +22,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-arcnet.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-arcnet.c,v 1.20 2005-04-06 21:32:38 mcr Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -35,6 +35,7 @@
#include <pcap.h>
#include "interface.h"
+#include "extract.h"
#include "arcnet.h"
static int arcnet_encap_print(u_char arctype, const u_char *p,
@@ -151,11 +152,11 @@
return (caplen);
}
flag = ap->arc_flag2;
- seqid = ntohs(ap->arc_seqid2);
+ seqid = EXTRACT_16BITS(&ap->arc_seqid2);
archdrlen = ARC_HDRNEWLEN_EXC;
} else {
flag = ap->arc_flag;
- seqid = ntohs(ap->arc_seqid);
+ seqid = EXTRACT_16BITS(&ap->arc_seqid);
archdrlen = ARC_HDRNEWLEN;
}
}
@@ -264,7 +265,7 @@
#ifdef INET6
case ARCTYPE_INET6:
- ip6_print(p, length);
+ ip6_print(gndo, p, length);
return (1);
#endif /*INET6*/
@@ -271,7 +272,7 @@
case ARCTYPE_ARP_OLD:
case ARCTYPE_ARP:
case ARCTYPE_REVARP:
- arp_print(gndo, p, length, caplen);
+ arp_print(gndo, p, length, caplen);
return (1);
case ARCTYPE_ATALK: /* XXX was this ever used? */
Modified: trunk/contrib/tcpdump/print-arp.c
===================================================================
--- trunk/contrib/tcpdump/print-arp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-arp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,12 +18,12 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-arp.c,v 1.10 2005/05/29 19:09:27 sam Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-arp.c 236192 2012-05-28 19:13:21Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-arp.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.66 2006-03-03 22:53:21 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -51,24 +51,27 @@
* arp_tha and arp_tpa in that order, according to the lengths
* specified. Field names used correspond to RFC 826.
*/
-struct arp_pkthdr {
- u_short ar_hrd; /* format of hardware address */
-#define ARPHRD_ETHER 1 /* ethernet hardware format */
-#define ARPHRD_IEEE802 6 /* token-ring hardware format */
-#define ARPHRD_ARCNET 7 /* arcnet hardware format */
-#define ARPHRD_FRELAY 15 /* frame relay hardware format */
-#define ARPHRD_STRIP 23 /* Ricochet Starmode Radio hardware format */
-#define ARPHRD_IEEE1394 24 /* IEEE 1394 (FireWire) hardware format */
- u_short ar_pro; /* format of protocol address */
- u_char ar_hln; /* length of hardware address */
- u_char ar_pln; /* length of protocol address */
- u_short ar_op; /* one of: */
-#define ARPOP_REQUEST 1 /* request to resolve address */
-#define ARPOP_REPLY 2 /* response to previous request */
-#define ARPOP_REVREQUEST 3 /* request protocol address given hardware */
-#define ARPOP_REVREPLY 4 /* response giving protocol address */
-#define ARPOP_INVREQUEST 8 /* request to identify peer */
-#define ARPOP_INVREPLY 9 /* response identifying peer */
+struct arp_pkthdr {
+ u_short ar_hrd; /* format of hardware address */
+#define ARPHRD_ETHER 1 /* ethernet hardware format */
+#define ARPHRD_IEEE802 6 /* token-ring hardware format */
+#define ARPHRD_ARCNET 7 /* arcnet hardware format */
+#define ARPHRD_FRELAY 15 /* frame relay hardware format */
+#define ARPHRD_ATM2225 19 /* ATM (RFC 2225) */
+#define ARPHRD_STRIP 23 /* Ricochet Starmode Radio hardware format */
+#define ARPHRD_IEEE1394 24 /* IEEE 1394 (FireWire) hardware format */
+ u_short ar_pro; /* format of protocol address */
+ u_char ar_hln; /* length of hardware address */
+ u_char ar_pln; /* length of protocol address */
+ u_short ar_op; /* one of: */
+#define ARPOP_REQUEST 1 /* request to resolve address */
+#define ARPOP_REPLY 2 /* response to previous request */
+#define ARPOP_REVREQUEST 3 /* request protocol address given hardware */
+#define ARPOP_REVREPLY 4 /* response giving protocol address */
+#define ARPOP_INVREQUEST 8 /* request to identify peer */
+#define ARPOP_INVREPLY 9 /* response identifying peer */
+#define ARPOP_NAK 10 /* NAK - only valif for ATM ARP */
+
/*
* The remaining fields are variable in size,
* according to the sizes above.
@@ -88,8 +91,8 @@
#define ARP_HDRLEN 8
#define HRD(ap) EXTRACT_16BITS(&(ap)->ar_hrd)
-#define HLN(ap) ((ap)->ar_hln)
-#define PLN(ap) ((ap)->ar_pln)
+#define HRD_LEN(ap) ((ap)->ar_hln)
+#define PROTO_LEN(ap) ((ap)->ar_pln)
#define OP(ap) EXTRACT_16BITS(&(ap)->ar_op)
#define PRO(ap) EXTRACT_16BITS(&(ap)->ar_pro)
#define SHA(ap) (ar_sha(ap))
@@ -97,6 +100,29 @@
#define THA(ap) (ar_tha(ap))
#define TPA(ap) (ar_tpa(ap))
+
+struct tok arpop_values[] = {
+ { ARPOP_REQUEST, "Request" },
+ { ARPOP_REPLY, "Reply" },
+ { ARPOP_REVREQUEST, "Reverse Request" },
+ { ARPOP_REVREPLY, "Reverse Reply" },
+ { ARPOP_INVREQUEST, "Inverse Request" },
+ { ARPOP_INVREPLY, "Inverse Reply" },
+ { ARPOP_NAK, "NACK Reply" },
+ { 0, NULL }
+};
+
+struct tok arphrd_values[] = {
+ { ARPHRD_ETHER, "Ethernet" },
+ { ARPHRD_IEEE802, "TokenRing" },
+ { ARPHRD_ARCNET, "ArcNet" },
+ { ARPHRD_FRELAY, "FrameRelay" },
+ { ARPHRD_STRIP, "Strip" },
+ { ARPHRD_IEEE1394, "IEEE 1394" },
+ { ARPHRD_ATM2225, "ATM" },
+ { 0, NULL }
+};
+
/*
* ATM Address Resolution Protocol.
*
@@ -106,20 +132,18 @@
* the ATM number and subaddress - and the hardware addresses consist
* of an ATM number and an ATM subaddress.
*/
-struct atmarp_pkthdr {
- u_short aar_hrd; /* format of hardware address */
-#define ARPHRD_ATM2225 19 /* ATM (RFC 2225) */
- u_short aar_pro; /* format of protocol address */
- u_char aar_shtl; /* length of source ATM number */
- u_char aar_sstl; /* length of source ATM subaddress */
-#define ATMARP_IS_E164 0x40 /* bit in type/length for E.164 format */
-#define ATMARP_LEN_MASK 0x3F /* length of {sub}address in type/length */
- u_short aar_op; /* same as regular ARP */
-#define ATMARPOP_NAK 10 /* NAK */
- u_char aar_spln; /* length of source protocol address */
- u_char aar_thtl; /* length of target ATM number */
- u_char aar_tstl; /* length of target ATM subaddress */
- u_char aar_tpln; /* length of target protocol address */
+struct atmarp_pkthdr {
+ u_short aar_hrd; /* format of hardware address */
+ u_short aar_pro; /* format of protocol address */
+ u_char aar_shtl; /* length of source ATM number */
+ u_char aar_sstl; /* length of source ATM subaddress */
+#define ATMARP_IS_E164 0x40 /* bit in type/length for E.164 format */
+#define ATMARP_LEN_MASK 0x3F /* length of {sub}address in type/length */
+ u_short aar_op; /* same as regular ARP */
+ u_char aar_spln; /* length of source protocol address */
+ u_char aar_thtl; /* length of target ATM number */
+ u_char aar_tstl; /* length of target ATM subaddress */
+ u_char aar_tpln; /* length of target protocol address */
/*
* The remaining fields are variable in size,
* according to the sizes above.
@@ -134,19 +158,19 @@
#endif
#define ATMHRD(ap) EXTRACT_16BITS(&(ap)->aar_hrd)
-#define ATMSHLN(ap) ((ap)->aar_shtl & ATMARP_LEN_MASK)
+#define ATMSHRD_LEN(ap) ((ap)->aar_shtl & ATMARP_LEN_MASK)
#define ATMSSLN(ap) ((ap)->aar_sstl & ATMARP_LEN_MASK)
-#define ATMSPLN(ap) ((ap)->aar_spln)
+#define ATMSPROTO_LEN(ap) ((ap)->aar_spln)
#define ATMOP(ap) EXTRACT_16BITS(&(ap)->aar_op)
#define ATMPRO(ap) EXTRACT_16BITS(&(ap)->aar_pro)
-#define ATMTHLN(ap) ((ap)->aar_thtl & ATMARP_LEN_MASK)
+#define ATMTHRD_LEN(ap) ((ap)->aar_thtl & ATMARP_LEN_MASK)
#define ATMTSLN(ap) ((ap)->aar_tstl & ATMARP_LEN_MASK)
-#define ATMTPLN(ap) ((ap)->aar_tpln)
+#define ATMTPROTO_LEN(ap) ((ap)->aar_tpln)
#define aar_sha(ap) ((const u_char *)((ap)+1))
-#define aar_ssa(ap) (aar_sha(ap) + ATMSHLN(ap))
+#define aar_ssa(ap) (aar_sha(ap) + ATMSHRD_LEN(ap))
#define aar_spa(ap) (aar_ssa(ap) + ATMSSLN(ap))
-#define aar_tha(ap) (aar_spa(ap) + ATMSPLN(ap))
-#define aar_tsa(ap) (aar_tha(ap) + ATMTHLN(ap))
+#define aar_tha(ap) (aar_spa(ap) + ATMSPROTO_LEN(ap))
+#define aar_tsa(ap) (aar_tha(ap) + ATMTHRD_LEN(ap))
#define aar_tpa(ap) (aar_tsa(ap) + ATMTSLN(ap))
};
@@ -167,10 +191,10 @@
if (ha_len == 0)
ND_PRINT((ndo, "<No address>"));
else {
- ND_PRINT((ndo, "%s", linkaddr_string(ha, ha_len)));
+ ND_PRINT((ndo, "%s", linkaddr_string(ha, LINKADDR_ATM, ha_len)));
if (srca_len != 0)
ND_PRINT((ndo, ",%s",
- linkaddr_string(srca, srca_len)));
+ linkaddr_string(srca, LINKADDR_ATM, srca_len)));
}
}
@@ -188,69 +212,86 @@
pro = ATMPRO(ap);
op = ATMOP(ap);
- if (!ND_TTEST2(*aar_tpa(ap), ATMTPLN(ap))) {
- ND_PRINT((ndo, "truncated-atmarp"));
+ if (!ND_TTEST2(*aar_tpa(ap), ATMTPROTO_LEN(ap))) {
+ ND_PRINT((ndo, "[|ARP]"));
ND_DEFAULTPRINT((const u_char *)ap, length);
return;
}
+ if (!ndo->ndo_eflag) {
+ ND_PRINT((ndo, "ARP, "));
+ }
+
if ((pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL) ||
- ATMSPLN(ap) != 4 || ATMTPLN(ap) != 4) {
- ND_PRINT((ndo, "atmarp-#%d for proto #%d (%d/%d) hardware #%d",
- op, pro, ATMSPLN(ap), ATMTPLN(ap), hrd));
- return;
+ ATMSPROTO_LEN(ap) != 4 ||
+ ATMTPROTO_LEN(ap) != 4 ||
+ ndo->ndo_vflag) {
+ ND_PRINT((ndo, "%s, %s (len %u/%u)",
+ tok2str(arphrd_values, "Unknown Hardware (%u)", hrd),
+ tok2str(ethertype_values, "Unknown Protocol (0x%04x)", pro),
+ ATMSPROTO_LEN(ap),
+ ATMTPROTO_LEN(ap)));
+
+ /* don't know know about the address formats */
+ if (!ndo->ndo_vflag) {
+ goto out;
+ }
}
- if (pro == ETHERTYPE_TRAIL)
- ND_PRINT((ndo, "trailer-"));
+
+ /* print operation */
+ printf("%s%s ",
+ ndo->ndo_vflag ? ", " : "",
+ tok2str(arpop_values, "Unknown (%u)", op));
+
switch (op) {
case ARPOP_REQUEST:
- ND_PRINT((ndo, "arp who-has %s", ipaddr_string(ATMTPA(ap))));
- if (ATMTHLN(ap) != 0) {
+ ND_PRINT((ndo, "who-has %s", ipaddr_string(ATMTPA(ap))));
+ if (ATMTHRD_LEN(ap) != 0) {
ND_PRINT((ndo, " ("));
- atmarp_addr_print(ndo, ATMTHA(ap), ATMTHLN(ap),
+ atmarp_addr_print(ndo, ATMTHA(ap), ATMTHRD_LEN(ap),
ATMTSA(ap), ATMTSLN(ap));
ND_PRINT((ndo, ")"));
}
- ND_PRINT((ndo, " tell %s", ipaddr_string(ATMSPA(ap))));
+ ND_PRINT((ndo, "tell %s", ipaddr_string(ATMSPA(ap))));
break;
case ARPOP_REPLY:
- ND_PRINT((ndo, "arp reply %s", ipaddr_string(ATMSPA(ap))));
- ND_PRINT((ndo, " is-at "));
- atmarp_addr_print(ndo, ATMSHA(ap), ATMSHLN(ap), ATMSSA(ap),
- ATMSSLN(ap));
+ ND_PRINT((ndo, "%s is-at ", ipaddr_string(ATMSPA(ap))));
+ atmarp_addr_print(ndo, ATMSHA(ap), ATMSHRD_LEN(ap), ATMSSA(ap),
+ ATMSSLN(ap));
break;
case ARPOP_INVREQUEST:
- ND_PRINT((ndo, "invarp who-is "));
- atmarp_addr_print(ndo, ATMTHA(ap), ATMTHLN(ap), ATMTSA(ap),
+ ND_PRINT((ndo, "who-is "));
+ atmarp_addr_print(ndo, ATMTHA(ap), ATMTHRD_LEN(ap), ATMTSA(ap),
ATMTSLN(ap));
ND_PRINT((ndo, " tell "));
- atmarp_addr_print(ndo, ATMSHA(ap), ATMSHLN(ap), ATMSSA(ap),
+ atmarp_addr_print(ndo, ATMSHA(ap), ATMSHRD_LEN(ap), ATMSSA(ap),
ATMSSLN(ap));
break;
case ARPOP_INVREPLY:
- ND_PRINT((ndo, "invarp reply "));
- atmarp_addr_print(ndo, ATMSHA(ap), ATMSHLN(ap), ATMSSA(ap),
+ atmarp_addr_print(ndo, ATMSHA(ap), ATMSHRD_LEN(ap), ATMSSA(ap),
ATMSSLN(ap));
- ND_PRINT((ndo, " at %s", ipaddr_string(ATMSPA(ap))));
+ ND_PRINT((ndo, "at %s", ipaddr_string(ATMSPA(ap))));
break;
- case ATMARPOP_NAK:
- ND_PRINT((ndo, "nak reply for %s",
- ipaddr_string(ATMSPA(ap))));
+ case ARPOP_NAK:
+ ND_PRINT((ndo, "for %s", ipaddr_string(ATMSPA(ap))));
break;
default:
- ND_PRINT((ndo, "atmarp-#%d", op));
ND_DEFAULTPRINT((const u_char *)ap, caplen);
return;
}
- return;
+
+ out:
+ ND_PRINT((ndo, ", length %u", length));
+ return;
+
trunc:
- ND_PRINT((ndo, "[|atmarp]"));
+ ND_PRINT((ndo, "[|ARP]"));
}
void
@@ -258,81 +299,116 @@
const u_char *bp, u_int length, u_int caplen)
{
const struct arp_pkthdr *ap;
- u_short pro, hrd, op;
+ u_short pro, hrd, op, linkaddr;
ap = (const struct arp_pkthdr *)bp;
ND_TCHECK(*ap);
+
hrd = HRD(ap);
- if (hrd == ARPHRD_ATM2225) {
- atmarp_print(ndo, bp, length, caplen);
- return;
- }
pro = PRO(ap);
op = OP(ap);
- if (!ND_TTEST2(*ar_tpa(ap), PLN(ap))) {
- ND_PRINT((ndo, "truncated-arp"));
+
+ /* if its ATM then call the ATM ARP printer
+ for Frame-relay ARP most of the fields
+ are similar to Ethernet so overload the Ethernet Printer
+ and set the linkaddr type for linkaddr_string() accordingly */
+
+ switch(hrd) {
+ case ARPHRD_ATM2225:
+ atmarp_print(ndo, bp, length, caplen);
+ return;
+ case ARPHRD_FRELAY:
+ linkaddr = LINKADDR_FRELAY;
+ break;
+ default:
+ linkaddr = LINKADDR_ETHER;
+ break;
+ }
+
+ if (!ND_TTEST2(*ar_tpa(ap), PROTO_LEN(ap))) {
+ ND_PRINT((ndo, "[|ARP]"));
ND_DEFAULTPRINT((const u_char *)ap, length);
return;
}
- if ((pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL) ||
- PLN(ap) != 4 || HLN(ap) == 0) {
- ND_PRINT((ndo, "arp-#%d for proto #%d (%d) hardware #%d (%d)",
- op, pro, PLN(ap), hrd, HLN(ap)));
- return;
+ if (!ndo->ndo_eflag) {
+ ND_PRINT((ndo, "ARP, "));
+ }
+
+ /* print hardware type/len and proto type/len */
+ if ((pro != ETHERTYPE_IP && pro != ETHERTYPE_TRAIL) ||
+ PROTO_LEN(ap) != 4 ||
+ HRD_LEN(ap) == 0 ||
+ ndo->ndo_vflag) {
+ ND_PRINT((ndo, "%s (len %u), %s (len %u)",
+ tok2str(arphrd_values, "Unknown Hardware (%u)", hrd),
+ HRD_LEN(ap),
+ tok2str(ethertype_values, "Unknown Protocol (0x%04x)", pro),
+ PROTO_LEN(ap)));
+
+ /* don't know know about the address formats */
+ if (!ndo->ndo_vflag) {
+ goto out;
+ }
}
- if (pro == ETHERTYPE_TRAIL)
- ND_PRINT((ndo, "trailer-"));
+
+ /* print operation */
+ printf("%s%s ",
+ ndo->ndo_vflag ? ", " : "",
+ tok2str(arpop_values, "Unknown (%u)", op));
+
switch (op) {
case ARPOP_REQUEST:
- ND_PRINT((ndo, "arp who-has %s", ipaddr_string(TPA(ap))));
- if (memcmp((const char *)ezero, (const char *)THA(ap), HLN(ap)) != 0)
+ ND_PRINT((ndo, "who-has %s", ipaddr_string(TPA(ap))));
+ if (memcmp((const char *)ezero, (const char *)THA(ap), HRD_LEN(ap)) != 0)
ND_PRINT((ndo, " (%s)",
- linkaddr_string(THA(ap), HLN(ap))));
+ linkaddr_string(THA(ap), linkaddr, HRD_LEN(ap))));
ND_PRINT((ndo, " tell %s", ipaddr_string(SPA(ap))));
break;
case ARPOP_REPLY:
- ND_PRINT((ndo, "arp reply %s", ipaddr_string(SPA(ap))));
- ND_PRINT((ndo, " is-at %s", linkaddr_string(SHA(ap), HLN(ap))));
+ ND_PRINT((ndo, "%s is-at %s",
+ ipaddr_string(SPA(ap)),
+ linkaddr_string(SHA(ap), linkaddr, HRD_LEN(ap))));
break;
case ARPOP_REVREQUEST:
- ND_PRINT((ndo, "rarp who-is %s tell %s",
- linkaddr_string(THA(ap), HLN(ap)),
- linkaddr_string(SHA(ap), HLN(ap))));
+ ND_PRINT((ndo, "who-is %s tell %s",
+ linkaddr_string(THA(ap), linkaddr, HRD_LEN(ap)),
+ linkaddr_string(SHA(ap), linkaddr, HRD_LEN(ap))));
break;
case ARPOP_REVREPLY:
- ND_PRINT((ndo, "rarp reply %s at %s",
- linkaddr_string(THA(ap), HLN(ap)),
+ ND_PRINT((ndo, "%s at %s",
+ linkaddr_string(THA(ap), linkaddr, HRD_LEN(ap)),
ipaddr_string(TPA(ap))));
break;
case ARPOP_INVREQUEST:
- ND_PRINT((ndo, "invarp who-is %s tell %s",
- linkaddr_string(THA(ap), HLN(ap)),
- linkaddr_string(SHA(ap), HLN(ap))));
+ ND_PRINT((ndo, "who-is %s tell %s",
+ linkaddr_string(THA(ap), linkaddr, HRD_LEN(ap)),
+ linkaddr_string(SHA(ap), linkaddr, HRD_LEN(ap))));
break;
case ARPOP_INVREPLY:
- ND_PRINT((ndo,"invarp reply %s at %s",
- linkaddr_string(THA(ap), HLN(ap)),
+ ND_PRINT((ndo,"%s at %s",
+ linkaddr_string(THA(ap), linkaddr, HRD_LEN(ap)),
ipaddr_string(TPA(ap))));
break;
default:
- ND_PRINT((ndo, "arp-#%d", op));
ND_DEFAULTPRINT((const u_char *)ap, caplen);
return;
}
- if (hrd != ARPHRD_ETHER)
- ND_PRINT((ndo, " hardware #%d", hrd));
+
+ out:
+ ND_PRINT((ndo, ", length %u", length));
+
return;
trunc:
- ND_PRINT((ndo, "[|arp]"));
+ ND_PRINT((ndo, "[|ARP]"));
}
/*
Modified: trunk/contrib/tcpdump/print-ascii.c
===================================================================
--- trunk/contrib/tcpdump/print-ascii.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ascii.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -42,7 +42,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ascii.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ascii.c,v 1.17 2005-07-06 20:53:32 guy Exp $";
#endif
#include <tcpdump-stdinc.h>
#include <stdio.h>
Modified: trunk/contrib/tcpdump/print-atalk.c
===================================================================
--- trunk/contrib/tcpdump/print-atalk.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-atalk.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -20,12 +20,12 @@
*
* Format and print AppleTalk packets.
*
- * $FreeBSD: src/contrib/tcpdump/print-atalk.c,v 1.13 2005/05/29 19:09:27 sam Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-atalk.c 236192 2012-05-28 19:13:21Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-atalk.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.81 2004-05-01 09:41:50 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -101,30 +101,19 @@
u_short snet;
u_int hdrlen;
-#if 0
- /*
- * Our packet is on a 4-byte boundary, as we're either called
- * directly from a top-level link-layer printer (ltalk_if_print)
- * or from the UDP printer. The LLAP+DDP header is a multiple
- * of 4 bytes in length, so the DDP payload is also on a 4-byte
- * boundary, and we don't need to align it before calling
- * "ddp_print()".
- */
+ if (length < sizeof(*lp)) {
+ (void)printf(" [|llap %u]", length);
+ return (length);
+ }
lp = (const struct LAP *)bp;
bp += sizeof(*lp);
length -= sizeof(*lp);
-#else
- {
- static struct LAP lp_ = {0, 0, lapDDP};
- lp = &lp_;
- }
-#endif
hdrlen = sizeof(*lp);
switch (lp->type) {
case lapShortDDP:
if (length < ddpSSize) {
- (void)printf(" [|sddp %d]", length);
+ (void)printf(" [|sddp %u]", length);
return (length);
}
sdp = (const struct atShortDDP *)bp;
@@ -140,7 +129,7 @@
case lapDDP:
if (length < ddpSize) {
- (void)printf(" [|ddp %d]", length);
+ (void)printf(" [|ddp %u]", length);
return (length);
}
dp = (const struct atDDP *)bp;
@@ -163,7 +152,7 @@
#endif
default:
- printf("%d > %d at-lap#%d %d",
+ printf("%d > %d at-lap#%d %u",
lp->src, lp->dst, lp->type, length);
break;
}
@@ -185,7 +174,7 @@
printf("AT ");
if (length < ddpSize) {
- (void)printf(" [|ddp %d]", length);
+ (void)printf(" [|ddp %u]", length);
return;
}
dp = (const struct atDDP *)bp;
@@ -274,6 +263,10 @@
fputs(tstr, stdout);
return;
}
+ if (length < sizeof(*ap)) {
+ (void)printf(" [|atp %u]", length);
+ return;
+ }
length -= sizeof(*ap);
switch (ap->control & 0xc0) {
@@ -285,7 +278,7 @@
atp_bitmap_print(ap->bitmap);
if (length != 0)
- (void)printf(" [len=%d]", length);
+ (void)printf(" [len=%u]", length);
switch (ap->control & (atpEOM|atpSTS)) {
case atpEOM:
@@ -301,7 +294,7 @@
break;
case atpRspCode:
- (void)printf(" atp-resp%s%d:%d (%d)",
+ (void)printf(" atp-resp%s%d:%d (%u)",
ap->control & atpEOM? "*" : " ",
EXTRACT_16BITS(&ap->transID), ap->bitmap, length);
switch (ap->control & (atpXO|atpSTS)) {
@@ -324,7 +317,7 @@
/* length should be zero */
if (length)
- (void)printf(" [len=%d]", length);
+ (void)printf(" [len=%u]", length);
/* there shouldn't be any control flags */
if (ap->control & (atpXO|atpEOM|atpSTS)) {
@@ -346,7 +339,7 @@
break;
default:
- (void)printf(" atp-0x%x %d (%d)", ap->control,
+ (void)printf(" atp-0x%x %d (%u)", ap->control,
EXTRACT_16BITS(&ap->transID), length);
break;
}
@@ -396,7 +389,7 @@
const u_char *ep;
if (length < nbpHeaderSize) {
- (void)printf(" truncated-nbp %d", length);
+ (void)printf(" truncated-nbp %u", length);
return;
}
@@ -403,7 +396,7 @@
length -= nbpHeaderSize;
if (length < 8) {
/* must be room for at least one tuple */
- (void)printf(" truncated-nbp %d", length + nbpHeaderSize);
+ (void)printf(" truncated-nbp %u", length + nbpHeaderSize);
return;
}
/* ep points to end of available data */
@@ -448,7 +441,7 @@
break;
default:
- (void)printf(" nbp-0x%x %d (%d)", np->control, np->id,
+ (void)printf(" nbp-0x%x %d (%u)", np->control, np->id,
length);
break;
}
@@ -560,19 +553,17 @@
if (first && (first = 0, !nflag)
&& (fp = fopen("/etc/atalk.names", "r"))) {
char line[256];
- int i1, i2, i3;
+ int i1, i2;
while (fgets(line, sizeof(line), fp)) {
if (line[0] == '\n' || line[0] == 0 || line[0] == '#')
continue;
- if (sscanf(line, "%d.%d.%d %256s", &i1, &i2, &i3,
- nambuf) == 4)
+ if (sscanf(line, "%d.%d %256s", &i1, &i2, nambuf) == 3)
/* got a hostname. */
- i3 |= ((i1 << 8) | i2) << 8;
- else if (sscanf(line, "%d.%d %256s", &i1, &i2,
- nambuf) == 3)
+ i2 |= (i1 << 8);
+ else if (sscanf(line, "%d %256s", &i1, nambuf) == 2)
/* got a net name */
- i3 = (((i1 << 8) | i2) << 8) | 255;
+ i2 = (i1 << 8) | 255;
else
continue;
@@ -605,11 +596,9 @@
tp->addr = (atnet << 8) | athost;
tp->nxt = newhnamemem();
if (athost != 255)
- (void)snprintf(nambuf, sizeof(nambuf), "%d.%d.%d",
- atnet >> 8, atnet & 0xff, athost);
+ (void)snprintf(nambuf, sizeof(nambuf), "%d.%d", atnet, athost);
else
- (void)snprintf(nambuf, sizeof(nambuf), "%d.%d", atnet >> 8,
- atnet & 0xff);
+ (void)snprintf(nambuf, sizeof(nambuf), "%d", atnet);
tp->name = strdup(nambuf);
return (tp->name);
Modified: trunk/contrib/tcpdump/print-atm.c
===================================================================
--- trunk/contrib/tcpdump/print-atm.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-atm.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,11 +18,11 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-atm.c,v 1.12.2.1 2007/10/19 03:03:58 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-atm.c 236192 2012-05-28 19:13:21Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-atm.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.49 2007-10-22 19:37:51 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -45,25 +45,51 @@
#include "ether.h"
+#define OAM_CRC10_MASK 0x3ff
+#define OAM_PAYLOAD_LEN 48
+#define OAM_FUNCTION_SPECIFIC_LEN 45 /* this excludes crc10 and cell-type/function-type */
+#define OAM_CELLTYPE_FUNCTYPE_LEN 1
+
struct tok oam_f_values[] = {
- { OAMF4SC, "OAM F4 (segment)" },
- { OAMF4EC, "OAM F4 (end)" },
+ { VCI_OAMF4SC, "OAM F4 (segment)" },
+ { VCI_OAMF4EC, "OAM F4 (end)" },
{ 0, NULL }
};
+struct tok atm_pty_values[] = {
+ { 0x0, "user data, uncongested, SDU 0" },
+ { 0x1, "user data, uncongested, SDU 1" },
+ { 0x2, "user data, congested, SDU 0" },
+ { 0x3, "user data, congested, SDU 1" },
+ { 0x4, "VCC OAM F5 flow segment" },
+ { 0x5, "VCC OAM F5 flow end-to-end" },
+ { 0x6, "Traffic Control and resource Mgmt" },
+ { 0, NULL }
+};
+
+#define OAM_CELLTYPE_FM 0x1
+#define OAM_CELLTYPE_PM 0x2
+#define OAM_CELLTYPE_AD 0x8
+#define OAM_CELLTYPE_SM 0xf
+
struct tok oam_celltype_values[] = {
- { 0x1, "Fault Management" },
- { 0x2, "Performance Management" },
- { 0x8, "activate/deactivate" },
- { 0xf, "System Management" },
+ { OAM_CELLTYPE_FM, "Fault Management" },
+ { OAM_CELLTYPE_PM, "Performance Management" },
+ { OAM_CELLTYPE_AD, "activate/deactivate" },
+ { OAM_CELLTYPE_SM, "System Management" },
{ 0, NULL }
};
+#define OAM_FM_FUNCTYPE_AIS 0x0
+#define OAM_FM_FUNCTYPE_RDI 0x1
+#define OAM_FM_FUNCTYPE_CONTCHECK 0x4
+#define OAM_FM_FUNCTYPE_LOOPBACK 0x8
+
struct tok oam_fm_functype_values[] = {
- { 0x0, "AIS" },
- { 0x1, "RDI" },
- { 0x4, "Continuity Check" },
- { 0x8, "Loopback" },
+ { OAM_FM_FUNCTYPE_AIS, "AIS" },
+ { OAM_FM_FUNCTYPE_RDI, "RDI" },
+ { OAM_FM_FUNCTYPE_CONTCHECK, "Continuity Check" },
+ { OAM_FM_FUNCTYPE_LOOPBACK, "Loopback" },
{ 0, NULL }
};
@@ -80,6 +106,14 @@
{ 0, NULL }
};
+#define OAM_FM_LOOPBACK_INDICATOR_MASK 0x1
+
+struct tok oam_fm_loopback_indicator_values[] = {
+ { 0x0, "Reply" },
+ { 0x1, "Request" },
+ { 0, NULL }
+};
+
static const struct tok *oam_functype_values[16] = {
NULL,
oam_fm_functype_values, /* 1 */
@@ -238,10 +272,12 @@
printf(":%s ",
tok2str(msgtype2str, "msgtype#%d", p[MSG_TYPE_POS]));
- if (caplen < CALL_REF_POS+3) {
- printf("[|atm]");
- return;
- }
+ /*
+ * The call reference comes before the message type,
+ * so if we know we have the message type, which we
+ * do from the caplen test above, we also know we have
+ * the call reference.
+ */
call_ref = EXTRACT_24BITS(&p[CALL_REF_POS]);
printf("CALL_REF:0x%06x", call_ref);
} else {
@@ -263,24 +299,24 @@
if (vpi == 0) {
switch (vci) {
- case PPC:
+ case VCI_PPC:
sig_print(p, caplen);
return;
- case BCC:
+ case VCI_BCC:
printf("broadcast sig: ");
return;
- case OAMF4SC: /* fall through */
- case OAMF4EC:
+ case VCI_OAMF4SC: /* fall through */
+ case VCI_OAMF4EC:
oam_print(p, length, ATM_OAM_HEC);
return;
- case METAC:
+ case VCI_METAC:
printf("meta: ");
return;
- case ILMIC:
+ case VCI_ILMIC:
printf("ilmi: ");
snmp_print(p, length);
return;
@@ -303,15 +339,36 @@
}
}
+struct oam_fm_loopback_t {
+ u_int8_t loopback_indicator;
+ u_int8_t correlation_tag[4];
+ u_int8_t loopback_id[12];
+ u_int8_t source_id[12];
+ u_int8_t unused[16];
+};
+
+struct oam_fm_ais_rdi_t {
+ u_int8_t failure_type;
+ u_int8_t failure_location[16];
+ u_int8_t unused[28];
+};
+
int
oam_print (const u_char *p, u_int length, u_int hec) {
u_int32_t cell_header;
- u_int16_t cell_type, func_type,vpi,vci,payload,clp;
+ u_int16_t vpi, vci, cksum, cksum_shouldbe, idx;
+ u_int8_t cell_type, func_type, payload, clp;
+ union {
+ const struct oam_fm_loopback_t *oam_fm_loopback;
+ const struct oam_fm_ais_rdi_t *oam_fm_ais_rdi;
+ } oam_ptr;
+
+
cell_header = EXTRACT_32BITS(p+hec);
- cell_type = ((*(p+4+hec))>>4) & 0x0f;
- func_type = *(p+4+hec) & 0x0f;
+ cell_type = ((*(p+ATM_HDR_LEN_NOHEC+hec))>>4) & 0x0f;
+ func_type = (*(p+ATM_HDR_LEN_NOHEC+hec)) & 0x0f;
vpi = (cell_header>>20)&0xff;
vci = (cell_header>>4)&0xffff;
@@ -318,11 +375,17 @@
payload = (cell_header>>1)&0x7;
clp = cell_header&0x1;
- printf("%s, vpi %u, vci %u, payload %u, clp %u, ",
+ printf("%s, vpi %u, vci %u, payload [ %s ], clp %u, length %u",
tok2str(oam_f_values, "OAM F5", vci),
- vpi, vci, payload, clp);
+ vpi, vci,
+ tok2str(atm_pty_values, "Unknown", payload),
+ clp, length);
- printf("cell-type %s (%u)",
+ if (!vflag) {
+ return 1;
+ }
+
+ printf("\n\tcell-type %s (%u)",
tok2str(oam_celltype_values, "unknown", cell_type),
cell_type);
@@ -330,9 +393,61 @@
printf(", func-type unknown (%u)", func_type);
else
printf(", func-type %s (%u)",
- bittok2str(oam_functype_values[cell_type],"none",func_type),
+ tok2str(oam_functype_values[cell_type],"none",func_type),
func_type);
- printf(", length %u",length);
+ p += ATM_HDR_LEN_NOHEC + hec;
+
+ switch (cell_type << 4 | func_type) {
+ case (OAM_CELLTYPE_FM << 4 | OAM_FM_FUNCTYPE_LOOPBACK):
+ oam_ptr.oam_fm_loopback = (const struct oam_fm_loopback_t *)(p + OAM_CELLTYPE_FUNCTYPE_LEN);
+ printf("\n\tLoopback-Indicator %s, Correlation-Tag 0x%08x",
+ tok2str(oam_fm_loopback_indicator_values,
+ "Unknown",
+ oam_ptr.oam_fm_loopback->loopback_indicator & OAM_FM_LOOPBACK_INDICATOR_MASK),
+ EXTRACT_32BITS(&oam_ptr.oam_fm_loopback->correlation_tag));
+ printf("\n\tLocation-ID ");
+ for (idx = 0; idx < sizeof(oam_ptr.oam_fm_loopback->loopback_id); idx++) {
+ if (idx % 2) {
+ printf("%04x ", EXTRACT_16BITS(&oam_ptr.oam_fm_loopback->loopback_id[idx]));
+ }
+ }
+ printf("\n\tSource-ID ");
+ for (idx = 0; idx < sizeof(oam_ptr.oam_fm_loopback->source_id); idx++) {
+ if (idx % 2) {
+ printf("%04x ", EXTRACT_16BITS(&oam_ptr.oam_fm_loopback->source_id[idx]));
+ }
+ }
+ break;
+
+ case (OAM_CELLTYPE_FM << 4 | OAM_FM_FUNCTYPE_AIS):
+ case (OAM_CELLTYPE_FM << 4 | OAM_FM_FUNCTYPE_RDI):
+ oam_ptr.oam_fm_ais_rdi = (const struct oam_fm_ais_rdi_t *)(p + OAM_CELLTYPE_FUNCTYPE_LEN);
+ printf("\n\tFailure-type 0x%02x", oam_ptr.oam_fm_ais_rdi->failure_type);
+ printf("\n\tLocation-ID ");
+ for (idx = 0; idx < sizeof(oam_ptr.oam_fm_ais_rdi->failure_location); idx++) {
+ if (idx % 2) {
+ printf("%04x ", EXTRACT_16BITS(&oam_ptr.oam_fm_ais_rdi->failure_location[idx]));
+ }
+ }
+ break;
+
+ case (OAM_CELLTYPE_FM << 4 | OAM_FM_FUNCTYPE_CONTCHECK):
+ /* FIXME */
+ break;
+
+ default:
+ break;
+ }
+
+ /* crc10 checksum verification */
+ cksum = EXTRACT_16BITS(p + OAM_CELLTYPE_FUNCTYPE_LEN + OAM_FUNCTION_SPECIFIC_LEN)
+ & OAM_CRC10_MASK;
+ cksum_shouldbe = verify_crc10_cksum(0, p, OAM_PAYLOAD_LEN);
+
+ printf("\n\tcksum 0x%03x (%scorrect)",
+ cksum,
+ cksum_shouldbe == 0 ? "" : "in");
+
return 1;
}
Added: trunk/contrib/tcpdump/print-babel.c
===================================================================
--- trunk/contrib/tcpdump/print-babel.c (rev 0)
+++ trunk/contrib/tcpdump/print-babel.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,447 @@
+/*
+ * Copyright (c) 2007-2011 Grégoire Henry, Juliusz Chroboczek
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include "addrtoname.h"
+#include "interface.h"
+#include "extract.h"
+
+static void babel_print_v2(const u_char *cp, u_int length);
+
+void
+babel_print(const u_char *cp, u_int length) {
+ printf("babel");
+
+ TCHECK2(*cp, 4);
+
+ if(cp[0] != 42) {
+ printf(" malformed header");
+ return;
+ } else {
+ printf(" %d", cp[1]);
+ }
+
+ switch(cp[1]) {
+ case 2:
+ babel_print_v2(cp,length);
+ break;
+ default:
+ printf(" unknown version");
+ break;
+ }
+
+ return;
+
+ trunc:
+ printf(" [|babel]");
+ return;
+}
+
+#define MESSAGE_PAD1 0
+#define MESSAGE_PADN 1
+#define MESSAGE_ACK_REQ 2
+#define MESSAGE_ACK 3
+#define MESSAGE_HELLO 4
+#define MESSAGE_IHU 5
+#define MESSAGE_ROUTER_ID 6
+#define MESSAGE_NH 7
+#define MESSAGE_UPDATE 8
+#define MESSAGE_REQUEST 9
+#define MESSAGE_MH_REQUEST 10
+#define MESSAGE_TSPC 11
+#define MESSAGE_HMAC 12
+
+static const char *
+format_id(const u_char *id)
+{
+ static char buf[25];
+ snprintf(buf, 25, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
+ id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7]);
+ buf[24] = '\0';
+ return buf;
+}
+
+static const unsigned char v4prefix[16] =
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0, 0, 0, 0 };
+
+static const char *
+format_prefix(const u_char *prefix, unsigned char plen)
+{
+ static char buf[50];
+ if(plen >= 96 && memcmp(prefix, v4prefix, 12) == 0)
+ snprintf(buf, 50, "%s/%u", ipaddr_string(prefix + 12), plen - 96);
+ else
+#ifdef INET6
+ snprintf(buf, 50, "%s/%u", ip6addr_string(prefix), plen);
+#else
+ snprintf(buf, 50, "IPv6 addresses not supported");
+#endif
+ buf[49] = '\0';
+ return buf;
+}
+
+static const char *
+format_address(const u_char *prefix)
+{
+ if(memcmp(prefix, v4prefix, 12) == 0)
+ return ipaddr_string(prefix + 12);
+ else
+#ifdef INET6
+ return ip6addr_string(prefix);
+#else
+ return "IPv6 addresses not supported";
+#endif
+}
+
+static int
+network_prefix(int ae, int plen, unsigned int omitted,
+ const unsigned char *p, const unsigned char *dp,
+ unsigned int len, unsigned char *p_r)
+{
+ unsigned pb;
+ unsigned char prefix[16];
+
+ if(plen >= 0)
+ pb = (plen + 7) / 8;
+ else if(ae == 1)
+ pb = 4;
+ else
+ pb = 16;
+
+ if(pb > 16)
+ return -1;
+
+ memset(prefix, 0, 16);
+
+ switch(ae) {
+ case 0: break;
+ case 1:
+ if(omitted > 4 || pb > 4 || (pb > omitted && len < pb - omitted))
+ return -1;
+ memcpy(prefix, v4prefix, 12);
+ if(omitted) {
+ if (dp == NULL) return -1;
+ memcpy(prefix, dp, 12 + omitted);
+ }
+ if(pb > omitted) memcpy(prefix + 12 + omitted, p, pb - omitted);
+ break;
+ case 2:
+ if(omitted > 16 || (pb > omitted && len < pb - omitted))
+ return -1;
+ if(omitted) {
+ if (dp == NULL) return -1;
+ memcpy(prefix, dp, omitted);
+ }
+ if(pb > omitted) memcpy(prefix + omitted, p, pb - omitted);
+ break;
+ case 3:
+ if(pb > 8 && len < pb - 8) return -1;
+ prefix[0] = 0xfe;
+ prefix[1] = 0x80;
+ if(pb > 8) memcpy(prefix + 8, p, pb - 8);
+ break;
+ default:
+ return -1;
+ }
+
+ memcpy(p_r, prefix, 16);
+ return 1;
+}
+
+static int
+network_address(int ae, const unsigned char *a, unsigned int len,
+ unsigned char *a_r)
+{
+ return network_prefix(ae, -1, 0, a, NULL, len, a_r);
+}
+
+#define ICHECK(i, l) \
+ if ((i) + (l) > bodylen || (i) + (l) > length) goto corrupt;
+
+static void
+babel_print_v2(const u_char *cp, u_int length) {
+ u_int i;
+ u_short bodylen;
+ u_char v4_prefix[16] =
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0, 0, 0, 0 };
+ u_char v6_prefix[16] = {0};
+
+ TCHECK2(*cp, 4);
+ if (length < 4)
+ goto corrupt;
+ bodylen = EXTRACT_16BITS(cp + 2);
+ printf(" (%u)", bodylen);
+
+ /* Process the TLVs in the body */
+ i = 0;
+ while(i < bodylen) {
+ const u_char *message;
+ u_int type, len;
+
+ message = cp + 4 + i;
+ TCHECK2(*message, 2);
+ ICHECK(i, 2);
+ type = message[0];
+ len = message[1];
+
+ TCHECK2(*message, 2 + len);
+ ICHECK(i, 2 + len);
+
+ switch(type) {
+ case MESSAGE_PAD1: {
+ if(!vflag)
+ printf(" pad1");
+ else
+ printf("\n\tPad 1");
+ }
+ break;
+
+ case MESSAGE_PADN: {
+ if(!vflag)
+ printf(" padN");
+ else
+ printf("\n\tPad %d", len + 2);
+ }
+ break;
+
+ case MESSAGE_ACK_REQ: {
+ u_short nonce, interval;
+ if(!vflag)
+ printf(" ack-req");
+ else {
+ printf("\n\tAcknowledgment Request ");
+ if(len < 6) goto corrupt;
+ nonce = EXTRACT_16BITS(message + 4);
+ interval = EXTRACT_16BITS(message + 6);
+ printf("%04x %d", nonce, interval);
+ }
+ }
+ break;
+
+ case MESSAGE_ACK: {
+ u_short nonce;
+ if(!vflag)
+ printf(" ack");
+ else {
+ printf("\n\tAcknowledgment ");
+ if(len < 2) goto corrupt;
+ nonce = EXTRACT_16BITS(message + 2);
+ printf("%04x", nonce);
+ }
+ }
+ break;
+
+ case MESSAGE_HELLO: {
+ u_short seqno, interval;
+ if(!vflag)
+ printf(" hello");
+ else {
+ printf("\n\tHello ");
+ if(len < 6) goto corrupt;
+ seqno = EXTRACT_16BITS(message + 4);
+ interval = EXTRACT_16BITS(message + 6);
+ printf("seqno %u interval %u", seqno, interval);
+ }
+ }
+ break;
+
+ case MESSAGE_IHU: {
+ unsigned short txcost, interval;
+ if(!vflag)
+ printf(" ihu");
+ else {
+ u_char address[16];
+ int rc;
+ printf("\n\tIHU ");
+ if(len < 6) goto corrupt;
+ txcost = EXTRACT_16BITS(message + 4);
+ interval = EXTRACT_16BITS(message + 6);
+ rc = network_address(message[2], message + 8, len - 6, address);
+ if(rc < 0) { printf("[|babel]"); break; }
+ printf("%s txcost %u interval %d",
+ format_address(address), txcost, interval);
+ }
+ }
+ break;
+
+ case MESSAGE_ROUTER_ID: {
+ if(!vflag)
+ printf(" router-id");
+ else {
+ printf("\n\tRouter Id");
+ if(len < 10) goto corrupt;
+ printf(" %s", format_id(message + 4));
+ }
+ }
+ break;
+
+ case MESSAGE_NH: {
+ if(!vflag)
+ printf(" nh");
+ else {
+ int rc;
+ u_char nh[16];
+ printf("\n\tNext Hop");
+ if(len < 2) goto corrupt;
+ rc = network_address(message[2], message + 4, len - 2, nh);
+ if(rc < 0) goto corrupt;
+ printf(" %s", format_address(nh));
+ }
+ }
+ break;
+
+ case MESSAGE_UPDATE: {
+ if(!vflag) {
+ printf(" update");
+ if(len < 1)
+ printf("/truncated");
+ else
+ printf("%s%s%s",
+ (message[3] & 0x80) ? "/prefix": "",
+ (message[3] & 0x40) ? "/id" : "",
+ (message[3] & 0x3f) ? "/unknown" : "");
+ } else {
+ u_short interval, seqno, metric;
+ u_char plen;
+ int rc;
+ u_char prefix[16];
+ printf("\n\tUpdate");
+ if(len < 10) goto corrupt;
+ plen = message[4] + (message[2] == 1 ? 96 : 0);
+ rc = network_prefix(message[2], message[4], message[5],
+ message + 12,
+ message[2] == 1 ? v4_prefix : v6_prefix,
+ len - 10, prefix);
+ if(rc < 0) goto corrupt;
+ interval = EXTRACT_16BITS(message + 6);
+ seqno = EXTRACT_16BITS(message + 8);
+ metric = EXTRACT_16BITS(message + 10);
+ printf("%s%s%s %s metric %u seqno %u interval %u",
+ (message[3] & 0x80) ? "/prefix": "",
+ (message[3] & 0x40) ? "/id" : "",
+ (message[3] & 0x3f) ? "/unknown" : "",
+ format_prefix(prefix, plen),
+ metric, seqno, interval);
+ if(message[3] & 0x80) {
+ if(message[2] == 1)
+ memcpy(v4_prefix, prefix, 16);
+ else
+ memcpy(v6_prefix, prefix, 16);
+ }
+ }
+ }
+ break;
+
+ case MESSAGE_REQUEST: {
+ if(!vflag)
+ printf(" request");
+ else {
+ int rc;
+ u_char prefix[16], plen;
+ printf("\n\tRequest ");
+ if(len < 2) goto corrupt;
+ plen = message[3] + (message[2] == 1 ? 96 : 0);
+ rc = network_prefix(message[2], message[3], 0,
+ message + 4, NULL, len - 2, prefix);
+ if(rc < 0) goto corrupt;
+ plen = message[3] + (message[2] == 1 ? 96 : 0);
+ printf("for %s",
+ message[2] == 0 ? "any" : format_prefix(prefix, plen));
+ }
+ }
+ break;
+
+ case MESSAGE_MH_REQUEST : {
+ if(!vflag)
+ printf(" mh-request");
+ else {
+ int rc;
+ u_short seqno;
+ u_char prefix[16], plen;
+ printf("\n\tMH-Request ");
+ if(len < 14) goto corrupt;
+ seqno = EXTRACT_16BITS(message + 4);
+ rc = network_prefix(message[2], message[3], 0,
+ message + 16, NULL, len - 14, prefix);
+ if(rc < 0) goto corrupt;
+ plen = message[3] + (message[2] == 1 ? 96 : 0);
+ printf("(%u hops) for %s seqno %u id %s",
+ message[6], format_prefix(prefix, plen),
+ seqno, format_id(message + 8));
+ }
+ }
+ break;
+ case MESSAGE_TSPC :
+ if(!vflag)
+ printf(" tspc");
+ else {
+ printf("\n\tTS/PC ");
+ if(len < 6) goto corrupt;
+ printf("timestamp %u packetcounter %u", EXTRACT_32BITS (message + 4),
+ EXTRACT_16BITS(message + 2));
+ }
+ break;
+ case MESSAGE_HMAC : {
+ if(!vflag)
+ printf(" hmac");
+ else {
+ unsigned j;
+ printf("\n\tHMAC ");
+ if(len < 18) goto corrupt;
+ printf("key-id %u digest-%u ", EXTRACT_16BITS(message + 2), len - 2);
+ for (j = 0; j < len - 2; j++)
+ printf ("%02X", message[4 + j]);
+ }
+ }
+ break;
+ default:
+ if(!vflag)
+ printf(" unknown");
+ else
+ printf("\n\tUnknown message type %d", type);
+ }
+ i += len + 2;
+ }
+ return;
+
+ trunc:
+ printf(" [|babel]");
+ return;
+
+ corrupt:
+ printf(" (corrupt)");
+ return;
+}
Property changes on: trunk/contrib/tcpdump/print-babel.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-beep.c
===================================================================
--- trunk/contrib/tcpdump/print-beep.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-beep.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -11,7 +11,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-beep.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-beep.c,v 1.6 2003-11-16 09:36:13 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-bfd.c
===================================================================
--- trunk/contrib/tcpdump/print-bfd.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-bfd.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -15,7 +15,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-bfd.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-bfd.c,v 1.10 2006-02-02 06:35:52 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -171,14 +171,18 @@
{
const struct bfd_header_t *bfd_header;
const struct bfd_auth_header_t *bfd_auth_header;
- u_int8_t version;
+ u_int8_t version = 0;
bfd_header = (const struct bfd_header_t *)pptr;
- TCHECK(*bfd_header);
- version = BFD_EXTRACT_VERSION(bfd_header->version_diag);
+ if (port == BFD_CONTROL_PORT) {
+ TCHECK(*bfd_header);
+ version = BFD_EXTRACT_VERSION(bfd_header->version_diag);
+ } else if (port == BFD_ECHO_PORT) {
+ /* Echo is BFD v1 only */
+ version = 1;
+ }
+ switch ((port << 8) | version) {
- switch (port << 8 | version) {
-
/* BFDv0 */
case (BFD_CONTROL_PORT << 8):
if (vflag < 1 )
Modified: trunk/contrib/tcpdump/print-bgp.c
===================================================================
--- trunk/contrib/tcpdump/print-bgp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-bgp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -36,7 +36,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-bgp.c,v 1.3 2009-03-25 16:56:49 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-bgp.c,v 1.118 2007-12-07 15:54:52 hannes Exp $";
#endif
#include <tcpdump-stdinc.h>
@@ -49,8 +49,8 @@
#include "addrtoname.h"
#include "extract.h"
#include "bgp.h"
+#include "af.h"
#include "l2vpn.h"
-#include "af.h"
struct bgp {
u_int8_t bgp_marker[16];
@@ -93,9 +93,8 @@
/* variable length */
};
#define BGP_OPT_SIZE 2 /* some compilers may pad to 4 bytes */
+#define BGP_CAP_HEADER_SIZE 2 /* some compilers may pad to 4 bytes */
-#define BGP_UPDATE_MINSIZE 23
-
struct bgp_notification {
u_int8_t bgpn_marker[16];
u_int16_t bgpn_len;
@@ -115,19 +114,10 @@
}; /* EXTRACT_16BITS(&bgp_route_refresh->afi) (sigh) */
#define BGP_ROUTE_REFRESH_SIZE 23
-struct bgp_attr {
- u_int8_t bgpa_flags;
- u_int8_t bgpa_type;
- union {
- u_int8_t len;
- u_int16_t elen;
- } bgpa_len;
-#define bgp_attr_len(p) \
- (((p)->bgpa_flags & 0x10) ? \
- EXTRACT_16BITS(&(p)->bgpa_len.elen) : (p)->bgpa_len.len)
-#define bgp_attr_off(p) \
- (((p)->bgpa_flags & 0x10) ? 4 : 3)
-};
+#define bgp_attr_lenlen(flags, p) \
+ (((flags) & 0x10) ? 2 : 1)
+#define bgp_attr_len(flags, p) \
+ (((flags) & 0x10) ? EXTRACT_16BITS(p) : *(p))
#define BGPTYPE_ORIGIN 1
#define BGPTYPE_AS_PATH 2
@@ -145,6 +135,9 @@
#define BGPTYPE_MP_REACH_NLRI 14 /* RFC2283 */
#define BGPTYPE_MP_UNREACH_NLRI 15 /* RFC2283 */
#define BGPTYPE_EXTD_COMMUNITIES 16 /* draft-ietf-idr-bgp-ext-communities */
+#define BGPTYPE_AS4_PATH 17 /* RFC4893 */
+#define BGPTYPE_AGGREGATOR4 18 /* RFC4893 */
+#define BGPTYPE_PMSI_TUNNEL 22 /* draft-ietf-l3vpn-2547bis-mcast-bgp-02.txt */
#define BGPTYPE_ATTR_SET 128 /* draft-marques-ppvpn-ibgp */
#define BGP_MP_NLRI_MINSIZE 3 /* End of RIB Marker detection */
@@ -152,11 +145,13 @@
static struct tok bgp_attr_values[] = {
{ BGPTYPE_ORIGIN, "Origin"},
{ BGPTYPE_AS_PATH, "AS Path"},
+ { BGPTYPE_AS4_PATH, "AS4 Path"},
{ BGPTYPE_NEXT_HOP, "Next Hop"},
{ BGPTYPE_MULTI_EXIT_DISC, "Multi Exit Discriminator"},
{ BGPTYPE_LOCAL_PREF, "Local Preference"},
{ BGPTYPE_ATOMIC_AGGREGATE, "Atomic Aggregate"},
{ BGPTYPE_AGGREGATOR, "Aggregator"},
+ { BGPTYPE_AGGREGATOR4, "Aggregator4"},
{ BGPTYPE_COMMUNITIES, "Community"},
{ BGPTYPE_ORIGINATOR_ID, "Originator ID"},
{ BGPTYPE_CLUSTER_LIST, "Cluster List"},
@@ -166,6 +161,7 @@
{ BGPTYPE_MP_REACH_NLRI, "Multi-Protocol Reach NLRI"},
{ BGPTYPE_MP_UNREACH_NLRI, "Multi-Protocol Unreach NLRI"},
{ BGPTYPE_EXTD_COMMUNITIES, "Extended Community"},
+ { BGPTYPE_PMSI_TUNNEL, "PMSI Tunnel"},
{ BGPTYPE_ATTR_SET, "Attribute Set"},
{ 255, "Reserved for development"},
{ 0, NULL}
@@ -176,6 +172,9 @@
#define BGP_CONFED_AS_SEQUENCE 3 /* draft-ietf-idr-rfc3065bis-01 */
#define BGP_CONFED_AS_SET 4 /* draft-ietf-idr-rfc3065bis-01 */
+#define BGP_AS_SEG_TYPE_MIN BGP_AS_SET
+#define BGP_AS_SEG_TYPE_MAX BGP_CONFED_AS_SET
+
static struct tok bgp_as_path_segment_open_values[] = {
{ BGP_AS_SEQUENCE, ""},
{ BGP_AS_SET, "{ "},
@@ -267,6 +266,7 @@
{ 4, "Unsupported Optional Parameter"},
{ 5, "Authentication Failure"},
{ 6, "Unacceptable Hold Time"},
+ { 7, "Capability Message Error"},
{ 0, NULL}
};
@@ -300,6 +300,31 @@
{ 0, NULL}
};
+#define BGP_PMSI_TUNNEL_RSVP_P2MP 1
+#define BGP_PMSI_TUNNEL_LDP_P2MP 2
+#define BGP_PMSI_TUNNEL_PIM_SSM 3
+#define BGP_PMSI_TUNNEL_PIM_SM 4
+#define BGP_PMSI_TUNNEL_PIM_BIDIR 5
+#define BGP_PMSI_TUNNEL_INGRESS 6
+#define BGP_PMSI_TUNNEL_LDP_MP2MP 7
+
+static struct tok bgp_pmsi_tunnel_values[] = {
+ { BGP_PMSI_TUNNEL_RSVP_P2MP, "RSVP-TE P2MP LSP"},
+ { BGP_PMSI_TUNNEL_LDP_P2MP, "LDP P2MP LSP"},
+ { BGP_PMSI_TUNNEL_PIM_SSM, "PIM-SSM Tree"},
+ { BGP_PMSI_TUNNEL_PIM_SM, "PIM-SM Tree"},
+ { BGP_PMSI_TUNNEL_PIM_BIDIR, "PIM-Bidir Tree"},
+ { BGP_PMSI_TUNNEL_INGRESS, "Ingress Replication"},
+ { BGP_PMSI_TUNNEL_LDP_MP2MP, "LDP MP2MP LSP"},
+ { 0, NULL}
+};
+
+static struct tok bgp_pmsi_flag_values[] = {
+ { 0x01, "Leaf Information required"},
+ { 0, NULL}
+};
+
+
/* Subsequent address family identifier, RFC2283 section 7 */
#define SAFNUM_RES 0
#define SAFNUM_UNICAST 1
@@ -307,9 +332,12 @@
#define SAFNUM_UNIMULTICAST 3
/* labeled BGP RFC3107 */
#define SAFNUM_LABUNICAST 4
+/* draft-ietf-l3vpn-2547bis-mcast-bgp-02.txt */
+#define SAFNUM_MULTICAST_VPN 5
#define SAFNUM_TUNNEL 64 /* XXX */
#define SAFNUM_VPLS 65 /* XXX */
-#define SAFNUM_MDT 66 /* XXX */
+/* draft-nalawade-idr-mdt-safi-03 */
+#define SAFNUM_MDT 66
/* Section 4.3.4 of draft-rosen-rfc2547bis-03.txt */
#define SAFNUM_VPNUNICAST 128
#define SAFNUM_VPNMULTICAST 129
@@ -331,7 +359,8 @@
{ SAFNUM_VPNUNICAST, "labeled VPN Unicast"},
{ SAFNUM_VPNMULTICAST, "labeled VPN Multicast"},
{ SAFNUM_VPNUNIMULTICAST, "labeled VPN Unicast+Multicast"},
- { SAFNUM_RT_ROUTING_INFO, "Route Target Routing Information"}, /* draft-marques-ppvpn-rt-constrain-01.txt */
+ { SAFNUM_RT_ROUTING_INFO, "Route Target Routing Information"},
+ { SAFNUM_MULTICAST_VPN, "Multicast VPN"},
{ 0, NULL }
};
@@ -349,8 +378,6 @@
#define BGP_EXT_COM_RO_2 0x0203 /* Route Origin,Format AN(4bytes):local(2bytes) */
#define BGP_EXT_COM_LINKBAND 0x4004 /* Link Bandwidth,Format AS(2B):Bandwidth(4B) */
/* rfc2547 bgp-mpls-vpns */
-#define BGP_EXT_COM_CISCO_MCAST 0x0009 /* cisco proprietary */
-
#define BGP_EXT_COM_VPN_ORIGIN 0x0005 /* OSPF Domain ID / VPN of Origin - draft-rosen-vpns-ospf-bgp-mpls */
#define BGP_EXT_COM_VPN_ORIGIN2 0x0105 /* duplicate - keep for backwards compatability */
#define BGP_EXT_COM_VPN_ORIGIN3 0x0205 /* duplicate - keep for backwards compatability */
@@ -364,6 +391,12 @@
#define BGP_EXT_COM_L2INFO 0x800a /* draft-kompella-ppvpn-l2vpn */
+#define BGP_EXT_COM_SOURCE_AS 0x0009 /* RFC-ietf-l3vpn-2547bis-mcast-bgp-08.txt */
+#define BGP_EXT_COM_VRF_RT_IMP 0x010b /* RFC-ietf-l3vpn-2547bis-mcast-bgp-08.txt */
+#define BGP_EXT_COM_L2VPN_RT_0 0x000a /* L2VPN Identifier,Format AS(2bytes):AN(4bytes) */
+#define BGP_EXT_COM_L2VPN_RT_1 0xF10a /* L2VPN Identifier,Format IP address:AN(2bytes) */
+
+
/* http://www.cisco.com/en/US/tech/tk436/tk428/technologies_tech_note09186a00801eb09a.shtml */
#define BGP_EXT_COM_EIGRP_GEN 0x8800
#define BGP_EXT_COM_EIGRP_METRIC_AS_DELAY 0x8801
@@ -386,7 +419,6 @@
{ BGP_EXT_COM_RO_1, "origin"},
{ BGP_EXT_COM_RO_2, "origin"},
{ BGP_EXT_COM_LINKBAND, "link-BW"},
- { BGP_EXT_COM_CISCO_MCAST, "mdt-group"},
{ BGP_EXT_COM_VPN_ORIGIN, "ospf-domain"},
{ BGP_EXT_COM_VPN_ORIGIN2, "ospf-domain"},
{ BGP_EXT_COM_VPN_ORIGIN3, "ospf-domain"},
@@ -402,6 +434,10 @@
{ BGP_EXT_COM_EIGRP_METRIC_LOAD_MTU , "eigrp-route-metric (load, MTU)" },
{ BGP_EXT_COM_EIGRP_EXT_REMAS_REMID , "eigrp-external-route (remote-AS, remote-ID)" },
{ BGP_EXT_COM_EIGRP_EXT_REMPROTO_REMMETRIC , "eigrp-external-route (remote-proto, remote-metric)" },
+ { BGP_EXT_COM_SOURCE_AS, "source-AS" },
+ { BGP_EXT_COM_VRF_RT_IMP, "vrf-route-import"},
+ { BGP_EXT_COM_L2VPN_RT_0, "l2vpn-id"},
+ { BGP_EXT_COM_L2VPN_RT_1, "l2vpn-id"},
{ 0, NULL},
};
@@ -424,38 +460,72 @@
{ 0, NULL },
};
+#define TOKBUFSIZE 128
+static char astostr[20];
+
+/*
+ * as_printf
+ *
+ * Convert an AS number into a string and return string pointer.
+ *
+ * Bepending on bflag is set or not, AS number is converted into ASDOT notation
+ * or plain number notation.
+ *
+ */
+static char *
+as_printf (char *str, int size, u_int asnum)
+{
+ if (!bflag || asnum <= 0xFFFF) {
+ snprintf(str, size, "%u", asnum);
+ } else {
+ snprintf(str, size, "%u.%u", asnum >> 16, asnum & 0xFFFF);
+ }
+ return str;
+}
+
+#define ITEMCHECK(minlen) if (itemlen < minlen) goto badtlv;
+
int
-decode_prefix4(const u_char *pptr, char *buf, u_int buflen)
+decode_prefix4(const u_char *pptr, u_int itemlen, char *buf, u_int buflen)
{
struct in_addr addr;
- u_int plen;
+ u_int plen, plenbytes;
TCHECK(pptr[0]);
+ ITEMCHECK(1);
plen = pptr[0];
if (32 < plen)
return -1;
+ itemlen -= 1;
memset(&addr, 0, sizeof(addr));
- TCHECK2(pptr[1], (plen + 7) / 8);
- memcpy(&addr, &pptr[1], (plen + 7) / 8);
+ plenbytes = (plen + 7) / 8;
+ TCHECK2(pptr[1], plenbytes);
+ ITEMCHECK(plenbytes);
+ memcpy(&addr, &pptr[1], plenbytes);
if (plen % 8) {
- ((u_char *)&addr)[(plen + 7) / 8 - 1] &=
+ ((u_char *)&addr)[plenbytes - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
snprintf(buf, buflen, "%s/%d", getname((u_char *)&addr), plen);
- return 1 + (plen + 7) / 8;
+ return 1 + plenbytes;
trunc:
return -2;
+
+badtlv:
+ return -3;
}
static int
-decode_labeled_prefix4(const u_char *pptr, char *buf, u_int buflen)
+decode_labeled_prefix4(const u_char *pptr, u_int itemlen, char *buf, u_int buflen)
{
struct in_addr addr;
- u_int plen;
+ u_int plen, plenbytes;
- TCHECK(pptr[0]);
+ /* prefix length and label = 4 bytes */
+ TCHECK2(pptr[0], 4);
+ ITEMCHECK(4);
plen = pptr[0]; /* get prefix length */
/* this is one of the weirdnesses of rfc3107
@@ -473,12 +543,15 @@
if (32 < plen)
return -1;
+ itemlen -= 4;
memset(&addr, 0, sizeof(addr));
- TCHECK2(pptr[4], (plen + 7) / 8);
- memcpy(&addr, &pptr[4], (plen + 7) / 8);
+ plenbytes = (plen + 7) / 8;
+ TCHECK2(pptr[4], plenbytes);
+ ITEMCHECK(plenbytes);
+ memcpy(&addr, &pptr[4], plenbytes);
if (plen % 8) {
- ((u_char *)&addr)[(plen + 7) / 8 - 1] &=
+ ((u_char *)&addr)[plenbytes - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
/* the label may get offsetted by 4 bits so lets shift it right */
@@ -488,12 +561,108 @@
EXTRACT_24BITS(pptr+1)>>4,
((pptr[3]&1)==0) ? "(BOGUS: Bottom of Stack NOT set!)" : "(bottom)" );
- return 4 + (plen + 7) / 8;
+ return 4 + plenbytes;
trunc:
return -2;
+
+badtlv:
+ return -3;
}
+/*
+ * bgp_vpn_ip_print
+ *
+ * print an ipv4 or ipv6 address into a buffer dependend on address length.
+ */
+static char *
+bgp_vpn_ip_print (const u_char *pptr, u_int addr_length) {
+
+ /* worst case string is s fully formatted v6 address */
+ static char addr[sizeof("1234:5678:89ab:cdef:1234:5678:89ab:cdef")];
+ char *pos = addr;
+
+ switch(addr_length) {
+ case (sizeof(struct in_addr) << 3): /* 32 */
+ TCHECK2(pptr[0], sizeof(struct in_addr));
+ snprintf(pos, sizeof(addr), "%s", ipaddr_string(pptr));
+ break;
+#ifdef INET6
+ case (sizeof(struct in6_addr) << 3): /* 128 */
+ TCHECK2(pptr[0], sizeof(struct in6_addr));
+ snprintf(pos, sizeof(addr), "%s", ip6addr_string(pptr));
+ break;
+#endif
+ default:
+ snprintf(pos, sizeof(addr), "bogus address length %u", addr_length);
+ break;
+ }
+ pos += strlen(pos);
+
+trunc:
+ *(pos) = '\0';
+ return (addr);
+}
+
+/*
+ * bgp_vpn_sg_print
+ *
+ * print an multicast s,g entry into a buffer.
+ * the s,g entry is encoded like this.
+ *
+ * +-----------------------------------+
+ * | Multicast Source Length (1 octet) |
+ * +-----------------------------------+
+ * | Multicast Source (Variable) |
+ * +-----------------------------------+
+ * | Multicast Group Length (1 octet) |
+ * +-----------------------------------+
+ * | Multicast Group (Variable) |
+ * +-----------------------------------+
+ *
+ * return the number of bytes read from the wire.
+ */
+static int
+bgp_vpn_sg_print (const u_char *pptr, char *buf, u_int buflen) {
+
+ u_int8_t addr_length;
+ u_int total_length, offset;
+
+ total_length = 0;
+
+ /* Source address length, encoded in bits */
+ TCHECK2(pptr[0], 1);
+ addr_length = *pptr++;
+
+ /* Source address */
+ TCHECK2(pptr[0], (addr_length >> 3));
+ total_length += (addr_length >> 3) + 1;
+ offset = strlen(buf);
+ if (addr_length) {
+ snprintf(buf + offset, buflen - offset, ", Source %s",
+ bgp_vpn_ip_print(pptr, addr_length));
+ pptr += (addr_length >> 3);
+ }
+
+ /* Group address length, encoded in bits */
+ TCHECK2(pptr[0], 1);
+ addr_length = *pptr++;
+
+ /* Group address */
+ TCHECK2(pptr[0], (addr_length >> 3));
+ total_length += (addr_length >> 3) + 1;
+ offset = strlen(buf);
+ if (addr_length) {
+ snprintf(buf + offset, buflen - offset, ", Group %s",
+ bgp_vpn_ip_print(pptr, addr_length));
+ pptr += (addr_length >> 3);
+ }
+
+trunc:
+ return (total_length);
+}
+
+
/* RDs and RTs share the same semantics
* we use bgp_vpn_rd_print for
* printing route targets inside a NLRI */
@@ -507,10 +676,12 @@
/* ok lets load the RD format */
switch (EXTRACT_16BITS(pptr)) {
- /* AS:IP-address fmt*/
+ /* 2-byte-AS:number fmt*/
case 0:
- snprintf(pos, sizeof(rd) - (pos - rd), "%u:%u.%u.%u.%u",
- EXTRACT_16BITS(pptr+2), *(pptr+4), *(pptr+5), *(pptr+6), *(pptr+7));
+ snprintf(pos, sizeof(rd) - (pos - rd), "%u:%u (= %u.%u.%u.%u)",
+ EXTRACT_16BITS(pptr+2),
+ EXTRACT_32BITS(pptr+4),
+ *(pptr+4), *(pptr+5), *(pptr+6), *(pptr+7));
break;
/* IP-address:AS fmt*/
@@ -521,9 +692,10 @@
/* 4-byte-AS:number fmt*/
case 2:
- snprintf(pos, sizeof(rd) - (pos - rd), "%u:%u (%u.%u.%u.%u:%u)",
- EXTRACT_32BITS(pptr+2), EXTRACT_16BITS(pptr+6),
- *(pptr+2), *(pptr+3), *(pptr+4), *(pptr+5), EXTRACT_16BITS(pptr+6));
+ snprintf(pos, sizeof(rd) - (pos - rd), "%s:%u (%u.%u.%u.%u:%u)",
+ as_printf(astostr, sizeof(astostr), EXTRACT_32BITS(pptr+2)),
+ EXTRACT_16BITS(pptr+6), *(pptr+2), *(pptr+3), *(pptr+4),
+ *(pptr+5), EXTRACT_16BITS(pptr+6));
break;
default:
snprintf(pos, sizeof(rd) - (pos - rd), "unknown RD format");
@@ -561,9 +733,9 @@
((u_char *)&route_target)[(plen + 7) / 8 - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
- snprintf(buf, buflen, "origin AS: %u, route target %s",
- EXTRACT_32BITS(pptr+1),
- bgp_vpn_rd_print((u_char *)&route_target));
+ snprintf(buf, buflen, "origin AS: %s, route target %s",
+ as_printf(astostr, sizeof(astostr), EXTRACT_32BITS(pptr+1)),
+ bgp_vpn_rd_print((u_char *)&route_target));
return 5 + (plen + 7) / 8;
@@ -610,6 +782,159 @@
}
/*
+ * +-------------------------------+
+ * | |
+ * | RD:IPv4-address (12 octets) |
+ * | |
+ * +-------------------------------+
+ * | MDT Group-address (4 octets) |
+ * +-------------------------------+
+ */
+
+#define MDT_VPN_NLRI_LEN 16
+
+static int
+decode_mdt_vpn_nlri(const u_char *pptr, char *buf, u_int buflen)
+{
+
+ const u_char *rd;
+ const u_char *vpn_ip;
+
+ TCHECK(pptr[0]);
+
+ /* if the NLRI is not predefined length, quit.*/
+ if (*pptr != MDT_VPN_NLRI_LEN * NBBY)
+ return -1;
+ pptr++;
+
+ /* RD */
+ TCHECK2(pptr[0], 8);
+ rd = pptr;
+ pptr+=8;
+
+ /* IPv4 address */
+ TCHECK2(pptr[0], sizeof(struct in_addr));
+ vpn_ip = pptr;
+ pptr+=sizeof(struct in_addr);
+
+ /* MDT Group Address */
+ TCHECK2(pptr[0], sizeof(struct in_addr));
+
+ snprintf(buf, buflen, "RD: %s, VPN IP Address: %s, MC Group Address: %s",
+ bgp_vpn_rd_print(rd), ipaddr_string(vpn_ip), ipaddr_string(pptr));
+
+ return MDT_VPN_NLRI_LEN + 1;
+
+ trunc:
+
+return -2;
+}
+
+#define BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_I_PMSI 1
+#define BGP_MULTICAST_VPN_ROUTE_TYPE_INTER_AS_I_PMSI 2
+#define BGP_MULTICAST_VPN_ROUTE_TYPE_S_PMSI 3
+#define BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_SEG_LEAF 4
+#define BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_ACTIVE 5
+#define BGP_MULTICAST_VPN_ROUTE_TYPE_SHARED_TREE_JOIN 6
+#define BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_TREE_JOIN 7
+
+static struct tok bgp_multicast_vpn_route_type_values[] = {
+ { BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_I_PMSI, "Intra-AS I-PMSI"},
+ { BGP_MULTICAST_VPN_ROUTE_TYPE_INTER_AS_I_PMSI, "Inter-AS I-PMSI"},
+ { BGP_MULTICAST_VPN_ROUTE_TYPE_S_PMSI, "S-PMSI"},
+ { BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_SEG_LEAF, "Intra-AS Segment-Leaf"},
+ { BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_ACTIVE, "Source-Active"},
+ { BGP_MULTICAST_VPN_ROUTE_TYPE_SHARED_TREE_JOIN, "Shared Tree Join"},
+ { BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_TREE_JOIN, "Source Tree Join"},
+};
+
+static int
+decode_multicast_vpn(const u_char *pptr, char *buf, u_int buflen)
+{
+ u_int8_t route_type, route_length, addr_length, sg_length;
+ u_int offset;
+
+ TCHECK2(pptr[0], 2);
+ route_type = *pptr++;
+ route_length = *pptr++;
+
+ snprintf(buf, buflen, "Route-Type: %s (%u), length: %u",
+ tok2str(bgp_multicast_vpn_route_type_values,
+ "Unknown", route_type),
+ route_type, route_length);
+
+ switch(route_type) {
+ case BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_I_PMSI:
+ TCHECK2(pptr[0], BGP_VPN_RD_LEN);
+ offset = strlen(buf);
+ snprintf(buf + offset, buflen - offset, ", RD: %s, Originator %s",
+ bgp_vpn_rd_print(pptr),
+ bgp_vpn_ip_print(pptr + BGP_VPN_RD_LEN,
+ (route_length - BGP_VPN_RD_LEN) << 3));
+ break;
+ case BGP_MULTICAST_VPN_ROUTE_TYPE_INTER_AS_I_PMSI:
+ TCHECK2(pptr[0], BGP_VPN_RD_LEN + 4);
+ offset = strlen(buf);
+ snprintf(buf + offset, buflen - offset, ", RD: %s, Source-AS %s",
+ bgp_vpn_rd_print(pptr),
+ as_printf(astostr, sizeof(astostr),
+ EXTRACT_32BITS(pptr + BGP_VPN_RD_LEN)));
+ break;
+
+ case BGP_MULTICAST_VPN_ROUTE_TYPE_S_PMSI:
+ TCHECK2(pptr[0], BGP_VPN_RD_LEN);
+ offset = strlen(buf);
+ snprintf(buf + offset, buflen - offset, ", RD: %s",
+ bgp_vpn_rd_print(pptr));
+ pptr += BGP_VPN_RD_LEN;
+
+ sg_length = bgp_vpn_sg_print(pptr, buf, buflen);
+ addr_length = route_length - sg_length;
+
+ TCHECK2(pptr[0], addr_length);
+ offset = strlen(buf);
+ snprintf(buf + offset, buflen - offset, ", Originator %s",
+ bgp_vpn_ip_print(pptr, addr_length << 3));
+ break;
+
+ case BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_ACTIVE:
+ TCHECK2(pptr[0], BGP_VPN_RD_LEN);
+ offset = strlen(buf);
+ snprintf(buf + offset, buflen - offset, ", RD: %s",
+ bgp_vpn_rd_print(pptr));
+ pptr += BGP_VPN_RD_LEN;
+
+ bgp_vpn_sg_print(pptr, buf, buflen);
+ break;
+
+ case BGP_MULTICAST_VPN_ROUTE_TYPE_SHARED_TREE_JOIN: /* fall through */
+ case BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_TREE_JOIN:
+ TCHECK2(pptr[0], BGP_VPN_RD_LEN);
+ offset = strlen(buf);
+ snprintf(buf + offset, buflen - offset, ", RD: %s, Source-AS %s",
+ bgp_vpn_rd_print(pptr),
+ as_printf(astostr, sizeof(astostr),
+ EXTRACT_32BITS(pptr + BGP_VPN_RD_LEN)));
+ pptr += BGP_VPN_RD_LEN;
+
+ bgp_vpn_sg_print(pptr, buf, buflen);
+ break;
+
+ /*
+ * no per route-type printing yet.
+ */
+ case BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_SEG_LEAF:
+ default:
+ break;
+ }
+
+ return route_length + 2;
+
+trunc:
+ return -2;
+}
+
+/*
* As I remember, some versions of systems have an snprintf() that
* returns -1 if the buffer would have overflowed. If the return
* value is negative, set buflen to 0, to indicate that we've filled
@@ -638,57 +963,84 @@
plen=EXTRACT_16BITS(pptr);
tlen=plen;
pptr+=2;
- TCHECK2(pptr[0],15);
- buf[0]='\0';
- strlen=snprintf(buf, buflen, "RD: %s, CE-ID: %u, Label-Block Offset: %u, Label Base %u",
- bgp_vpn_rd_print(pptr),
- EXTRACT_16BITS(pptr+8),
- EXTRACT_16BITS(pptr+10),
- EXTRACT_24BITS(pptr+12)>>4); /* the label is offsetted by 4 bits so lets shift it right */
- UPDATE_BUF_BUFLEN(buf, buflen, strlen);
- pptr+=15;
- tlen-=15;
+ /* Old and new L2VPN NLRI share AFI/SAFI
+ * -> Assume a 12 Byte-length NLRI is auto-discovery-only
+ * and > 17 as old format. Complain for the middle case
+ */
+ if (plen==12) {
+ /* assume AD-only with RD, BGPNH */
+ TCHECK2(pptr[0],12);
+ buf[0]='\0';
+ strlen=snprintf(buf, buflen, "RD: %s, BGPNH: %s",
+ bgp_vpn_rd_print(pptr),
+ /* need something like getname() here */
+ getname(pptr+8)
+ );
+ UPDATE_BUF_BUFLEN(buf, buflen, strlen);
+ pptr+=12;
+ tlen-=12;
+ return plen;
+ } else if (plen>17) {
+ /* assume old format */
+ /* RD, ID, LBLKOFF, LBLBASE */
- /* ok now the variable part - lets read out TLVs*/
- while (tlen>0) {
- if (tlen < 3)
- return -1;
- TCHECK2(pptr[0], 3);
- tlv_type=*pptr++;
- tlv_len=EXTRACT_16BITS(pptr);
- ttlv_len=tlv_len;
- pptr+=2;
+ TCHECK2(pptr[0],15);
+ buf[0]='\0';
+ strlen=snprintf(buf, buflen, "RD: %s, CE-ID: %u, Label-Block Offset: %u, Label Base %u",
+ bgp_vpn_rd_print(pptr),
+ EXTRACT_16BITS(pptr+8),
+ EXTRACT_16BITS(pptr+10),
+ EXTRACT_24BITS(pptr+12)>>4); /* the label is offsetted by 4 bits so lets shift it right */
+ UPDATE_BUF_BUFLEN(buf, buflen, strlen);
+ pptr+=15;
+ tlen-=15;
- switch(tlv_type) {
- case 1:
- if (buflen!=0) {
- strlen=snprintf(buf,buflen, "\n\t\tcircuit status vector (%u) length: %u: 0x",
- tlv_type,
- tlv_len);
- UPDATE_BUF_BUFLEN(buf, buflen, strlen);
- }
- ttlv_len=ttlv_len/8+1; /* how many bytes do we need to read ? */
- while (ttlv_len>0) {
- TCHECK(pptr[0]);
- if (buflen!=0) {
- strlen=snprintf(buf,buflen, "%02x",*pptr++);
- UPDATE_BUF_BUFLEN(buf, buflen, strlen);
- }
- ttlv_len--;
- }
- break;
- default:
- if (buflen!=0) {
- strlen=snprintf(buf,buflen, "\n\t\tunknown TLV #%u, length: %u",
- tlv_type,
- tlv_len);
- UPDATE_BUF_BUFLEN(buf, buflen, strlen);
- }
- break;
- }
- tlen-=(tlv_len<<3); /* the tlv-length is expressed in bits so lets shift it right */
+ /* ok now the variable part - lets read out TLVs*/
+ while (tlen>0) {
+ if (tlen < 3)
+ return -1;
+ TCHECK2(pptr[0], 3);
+ tlv_type=*pptr++;
+ tlv_len=EXTRACT_16BITS(pptr);
+ ttlv_len=tlv_len;
+ pptr+=2;
+
+ switch(tlv_type) {
+ case 1:
+ if (buflen!=0) {
+ strlen=snprintf(buf,buflen, "\n\t\tcircuit status vector (%u) length: %u: 0x",
+ tlv_type,
+ tlv_len);
+ UPDATE_BUF_BUFLEN(buf, buflen, strlen);
+ }
+ ttlv_len=ttlv_len/8+1; /* how many bytes do we need to read ? */
+ while (ttlv_len>0) {
+ TCHECK(pptr[0]);
+ if (buflen!=0) {
+ strlen=snprintf(buf,buflen, "%02x",*pptr++);
+ UPDATE_BUF_BUFLEN(buf, buflen, strlen);
+ }
+ ttlv_len--;
+ }
+ break;
+ default:
+ if (buflen!=0) {
+ strlen=snprintf(buf,buflen, "\n\t\tunknown TLV #%u, length: %u",
+ tlv_type,
+ tlv_len);
+ UPDATE_BUF_BUFLEN(buf, buflen, strlen);
+ }
+ break;
+ }
+ tlen-=(tlv_len<<3); /* the tlv-length is expressed in bits so lets shift it right */
+ }
+ return plen+2;
+
+ } else {
+ /* complain bitterly ? */
+ /* fall through */
+ goto trunc;
}
- return plen+2;
trunc:
return -2;
@@ -696,37 +1048,46 @@
#ifdef INET6
int
-decode_prefix6(const u_char *pd, char *buf, u_int buflen)
+decode_prefix6(const u_char *pd, u_int itemlen, char *buf, u_int buflen)
{
struct in6_addr addr;
- u_int plen;
+ u_int plen, plenbytes;
TCHECK(pd[0]);
+ ITEMCHECK(1);
plen = pd[0];
if (128 < plen)
return -1;
+ itemlen -= 1;
memset(&addr, 0, sizeof(addr));
- TCHECK2(pd[1], (plen + 7) / 8);
- memcpy(&addr, &pd[1], (plen + 7) / 8);
+ plenbytes = (plen + 7) / 8;
+ TCHECK2(pd[1], plenbytes);
+ ITEMCHECK(plenbytes);
+ memcpy(&addr, &pd[1], plenbytes);
if (plen % 8) {
- addr.s6_addr[(plen + 7) / 8 - 1] &=
+ addr.s6_addr[plenbytes - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
snprintf(buf, buflen, "%s/%d", getname6((u_char *)&addr), plen);
- return 1 + (plen + 7) / 8;
+ return 1 + plenbytes;
trunc:
return -2;
+
+badtlv:
+ return -3;
}
static int
-decode_labeled_prefix6(const u_char *pptr, char *buf, u_int buflen)
+decode_labeled_prefix6(const u_char *pptr, u_int itemlen, char *buf, u_int buflen)
{
struct in6_addr addr;
- u_int plen;
+ u_int plen, plenbytes;
- TCHECK(pptr[0]);
+ /* prefix length and label = 4 bytes */
+ TCHECK2(pptr[0], 4);
+ ITEMCHECK(4);
plen = pptr[0]; /* get prefix length */
if (24 > plen)
@@ -736,12 +1097,14 @@
if (128 < plen)
return -1;
+ itemlen -= 4;
memset(&addr, 0, sizeof(addr));
- TCHECK2(pptr[4], (plen + 7) / 8);
- memcpy(&addr, &pptr[4], (plen + 7) / 8);
+ plenbytes = (plen + 7) / 8;
+ TCHECK2(pptr[4], plenbytes);
+ memcpy(&addr, &pptr[4], plenbytes);
if (plen % 8) {
- addr.s6_addr[(plen + 7) / 8 - 1] &=
+ addr.s6_addr[plenbytes - 1] &=
((0xff00 >> (plen % 8)) & 0xff);
}
/* the label may get offsetted by 4 bits so lets shift it right */
@@ -751,10 +1114,13 @@
EXTRACT_24BITS(pptr+1)>>4,
((pptr[3]&1)==0) ? "(BOGUS: Bottom of Stack NOT set!)" : "(bottom)" );
- return 4 + (plen + 7) / 8;
+ return 4 + plenbytes;
trunc:
return -2;
+
+badtlv:
+ return -3;
}
static int
@@ -863,9 +1229,66 @@
return -2;
}
+/*
+ * bgp_attr_get_as_size
+ *
+ * Try to find the size of the ASs encoded in an as-path. It is not obvious, as
+ * both Old speakers that do not support 4 byte AS, and the new speakers that do
+ * support, exchange AS-Path with the same path-attribute type value 0x02.
+ */
static int
-bgp_attr_print(const struct bgp_attr *attr, const u_char *pptr, int len)
+bgp_attr_get_as_size (u_int8_t bgpa_type, const u_char *pptr, int len)
{
+ const u_char *tptr = pptr;
+
+ /*
+ * If the path attribute is the optional AS4 path type, then we already
+ * know, that ASs must be encoded in 4 byte format.
+ */
+ if (bgpa_type == BGPTYPE_AS4_PATH) {
+ return 4;
+ }
+
+ /*
+ * Let us assume that ASs are of 2 bytes in size, and check if the AS-Path
+ * TLV is good. If not, ask the caller to try with AS encoded as 4 bytes
+ * each.
+ */
+ while (tptr < pptr + len) {
+ TCHECK(tptr[0]);
+
+ /*
+ * If we do not find a valid segment type, our guess might be wrong.
+ */
+ if (tptr[0] < BGP_AS_SEG_TYPE_MIN || tptr[0] > BGP_AS_SEG_TYPE_MAX) {
+ goto trunc;
+ }
+ TCHECK(tptr[1]);
+ tptr += 2 + tptr[1] * 2;
+ }
+
+ /*
+ * If we correctly reached end of the AS path attribute data content,
+ * then most likely ASs were indeed encoded as 2 bytes.
+ */
+ if (tptr == pptr + len) {
+ return 2;
+ }
+
+trunc:
+
+ /*
+ * We can come here, either we did not have enough data, or if we
+ * try to decode 4 byte ASs in 2 byte format. Either way, return 4,
+ * so that calller can try to decode each AS as of 4 bytes. If indeed
+ * there was not enough data, it will crib and end the parse anyways.
+ */
+ return 4;
+}
+
+static int
+bgp_attr_print(u_int atype, const u_char *pptr, u_int len)
+{
int i;
u_int16_t af;
u_int8_t safi, snpa, nhlen;
@@ -874,15 +1297,16 @@
u_int32_t i;
} bw;
int advance;
- int tlen;
+ u_int tlen;
const u_char *tptr;
char buf[MAXHOSTNAMELEN + 100];
char tokbuf[TOKBUFSIZE];
+ int as_size;
tptr = pptr;
tlen=len;
- switch (attr->bgpa_type) {
+ switch (atype) {
case BGPTYPE_ORIGIN:
if (len != 1)
printf("invalid len");
@@ -895,6 +1319,11 @@
}
break;
+
+ /*
+ * Process AS4 byte path and AS2 byte path attributes here.
+ */
+ case BGPTYPE_AS4_PATH:
case BGPTYPE_AS_PATH:
if (len % 2) {
printf("invalid len");
@@ -905,14 +1334,28 @@
break;
}
+ /*
+ * BGP updates exchanged between New speakers that support 4
+ * byte AS, ASs are always encoded in 4 bytes. There is no
+ * definitive way to find this, just by the packet's
+ * contents. So, check for packet's TLV's sanity assuming
+ * 2 bytes first, and it does not pass, assume that ASs are
+ * encoded in 4 bytes format and move on.
+ */
+ as_size = bgp_attr_get_as_size(atype, pptr, len);
+
while (tptr < pptr + len) {
TCHECK(tptr[0]);
printf("%s", tok2strbuf(bgp_as_path_segment_open_values,
"?", tptr[0],
tokbuf, sizeof(tokbuf)));
- for (i = 0; i < tptr[1] * 2; i += 2) {
- TCHECK2(tptr[2 + i], 2);
- printf("%u ", EXTRACT_16BITS(&tptr[2 + i]));
+ for (i = 0; i < tptr[1] * as_size; i += as_size) {
+ TCHECK2(tptr[2 + i], as_size);
+ printf("%s ",
+ as_printf(astostr, sizeof(astostr),
+ as_size == 2 ?
+ EXTRACT_16BITS(&tptr[2 + i]) :
+ EXTRACT_32BITS(&tptr[2 + i])));
}
TCHECK(tptr[0]);
printf("%s", tok2strbuf(bgp_as_path_segment_close_values,
@@ -919,7 +1362,7 @@
"?", tptr[0],
tokbuf, sizeof(tokbuf)));
TCHECK(tptr[1]);
- tptr += 2 + tptr[1] * 2;
+ tptr += 2 + tptr[1] * as_size;
}
break;
case BGPTYPE_NEXT_HOP:
@@ -943,14 +1386,36 @@
if (len != 0)
printf("invalid len");
break;
- case BGPTYPE_AGGREGATOR:
- if (len != 6) {
+ case BGPTYPE_AGGREGATOR:
+
+ /*
+ * Depending on the AS encoded is of 2 bytes or of 4 bytes,
+ * the length of this PA can be either 6 bytes or 8 bytes.
+ */
+ if (len != 6 && len != 8) {
+ printf("invalid len");
+ break;
+ }
+ TCHECK2(tptr[0], len);
+ if (len == 6) {
+ printf(" AS #%s, origin %s",
+ as_printf(astostr, sizeof(astostr), EXTRACT_16BITS(tptr)),
+ getname(tptr + 2));
+ } else {
+ printf(" AS #%s, origin %s",
+ as_printf(astostr, sizeof(astostr),
+ EXTRACT_32BITS(tptr)), getname(tptr + 4));
+ }
+ break;
+ case BGPTYPE_AGGREGATOR4:
+ if (len != 8) {
printf("invalid len");
break;
}
- TCHECK2(tptr[0], 6);
- printf(" AS #%u, origin %s", EXTRACT_16BITS(tptr),
- getname(tptr + 2));
+ TCHECK2(tptr[0], 8);
+ printf(" AS #%s, origin %s",
+ as_printf(astostr, sizeof(astostr), EXTRACT_32BITS(tptr)),
+ getname(tptr + 4));
break;
case BGPTYPE_COMMUNITIES:
if (len % 4) {
@@ -1027,12 +1492,13 @@
case (AFNUM_INET<<8 | SAFNUM_VPNUNICAST):
case (AFNUM_INET<<8 | SAFNUM_VPNMULTICAST):
case (AFNUM_INET<<8 | SAFNUM_VPNUNIMULTICAST):
+ case (AFNUM_INET<<8 | SAFNUM_MULTICAST_VPN):
+ case (AFNUM_INET<<8 | SAFNUM_MDT):
#ifdef INET6
case (AFNUM_INET6<<8 | SAFNUM_UNICAST):
case (AFNUM_INET6<<8 | SAFNUM_MULTICAST):
case (AFNUM_INET6<<8 | SAFNUM_UNIMULTICAST):
case (AFNUM_INET6<<8 | SAFNUM_LABUNICAST):
- case (AFNUM_INET6<<8 | SAFNUM_RT_ROUTING_INFO):
case (AFNUM_INET6<<8 | SAFNUM_VPNUNICAST):
case (AFNUM_INET6<<8 | SAFNUM_VPNMULTICAST):
case (AFNUM_INET6<<8 | SAFNUM_VPNUNIMULTICAST):
@@ -1065,8 +1531,12 @@
tptr++;
if (tlen) {
+ int nnh = 0;
printf("\n\t nexthop: ");
while (tlen > 0) {
+ if ( nnh++ > 0 ) {
+ printf( ", " );
+ }
switch(af<<8 | safi) {
case (AFNUM_INET<<8 | SAFNUM_UNICAST):
case (AFNUM_INET<<8 | SAFNUM_MULTICAST):
@@ -1073,7 +1543,9 @@
case (AFNUM_INET<<8 | SAFNUM_UNIMULTICAST):
case (AFNUM_INET<<8 | SAFNUM_LABUNICAST):
case (AFNUM_INET<<8 | SAFNUM_RT_ROUTING_INFO):
- if (tlen < (int)sizeof(struct in_addr)) {
+ case (AFNUM_INET<<8 | SAFNUM_MULTICAST_VPN):
+ case (AFNUM_INET<<8 | SAFNUM_MDT):
+ if (tlen < (int)sizeof(struct in_addr)) {
printf("invalid len");
tlen = 0;
} else {
@@ -1103,7 +1575,6 @@
case (AFNUM_INET6<<8 | SAFNUM_MULTICAST):
case (AFNUM_INET6<<8 | SAFNUM_UNIMULTICAST):
case (AFNUM_INET6<<8 | SAFNUM_LABUNICAST):
- case (AFNUM_INET6<<8 | SAFNUM_RT_ROUTING_INFO):
if (tlen < (int)sizeof(struct in6_addr)) {
printf("invalid len");
tlen = 0;
@@ -1211,20 +1682,24 @@
case (AFNUM_INET<<8 | SAFNUM_UNICAST):
case (AFNUM_INET<<8 | SAFNUM_MULTICAST):
case (AFNUM_INET<<8 | SAFNUM_UNIMULTICAST):
- advance = decode_prefix4(tptr, buf, sizeof(buf));
+ advance = decode_prefix4(tptr, len, buf, sizeof(buf));
if (advance == -1)
printf("\n\t (illegal prefix length)");
else if (advance == -2)
goto trunc;
+ else if (advance == -3)
+ break; /* bytes left, but not enough */
else
printf("\n\t %s", buf);
break;
case (AFNUM_INET<<8 | SAFNUM_LABUNICAST):
- advance = decode_labeled_prefix4(tptr, buf, sizeof(buf));
+ advance = decode_labeled_prefix4(tptr, len, buf, sizeof(buf));
if (advance == -1)
printf("\n\t (illegal prefix length)");
else if (advance == -2)
goto trunc;
+ else if (advance == -3)
+ break; /* bytes left, but not enough */
else
printf("\n\t %s", buf);
break;
@@ -1248,24 +1723,48 @@
else
printf("\n\t %s", buf);
break;
+ case (AFNUM_INET<<8 | SAFNUM_MULTICAST_VPN): /* fall through */
+ case (AFNUM_INET6<<8 | SAFNUM_MULTICAST_VPN):
+ advance = decode_multicast_vpn(tptr, buf, sizeof(buf));
+ if (advance == -1)
+ printf("\n\t (illegal prefix length)");
+ else if (advance == -2)
+ goto trunc;
+ else
+ printf("\n\t %s", buf);
+ break;
+
+ case (AFNUM_INET<<8 | SAFNUM_MDT):
+ advance = decode_mdt_vpn_nlri(tptr, buf, sizeof(buf));
+ if (advance == -1)
+ printf("\n\t (illegal prefix length)");
+ else if (advance == -2)
+ goto trunc;
+ else
+ printf("\n\t %s", buf);
+ break;
#ifdef INET6
case (AFNUM_INET6<<8 | SAFNUM_UNICAST):
case (AFNUM_INET6<<8 | SAFNUM_MULTICAST):
case (AFNUM_INET6<<8 | SAFNUM_UNIMULTICAST):
- advance = decode_prefix6(tptr, buf, sizeof(buf));
+ advance = decode_prefix6(tptr, len, buf, sizeof(buf));
if (advance == -1)
printf("\n\t (illegal prefix length)");
else if (advance == -2)
goto trunc;
+ else if (advance == -3)
+ break; /* bytes left, but not enough */
else
printf("\n\t %s", buf);
break;
case (AFNUM_INET6<<8 | SAFNUM_LABUNICAST):
- advance = decode_labeled_prefix6(tptr, buf, sizeof(buf));
+ advance = decode_labeled_prefix6(tptr, len, buf, sizeof(buf));
if (advance == -1)
printf("\n\t (illegal prefix length)");
else if (advance == -2)
goto trunc;
+ else if (advance == -3)
+ break; /* bytes left, but not enough */
else
printf("\n\t %s", buf);
break;
@@ -1280,15 +1779,6 @@
else
printf("\n\t %s", buf);
break;
- case (AFNUM_INET6<<8 | SAFNUM_RT_ROUTING_INFO):
- advance = decode_rt_routing_info(tptr, buf, sizeof(buf));
- if (advance == -1)
- printf("\n\t (illegal prefix length)");
- else if (advance == -2)
- goto trunc;
- else
- printf("\n\t %s", buf);
- break;
#endif
case (AFNUM_VPLS<<8 | SAFNUM_VPLS):
case (AFNUM_L2VPN<<8 | SAFNUM_VPNUNICAST):
@@ -1364,20 +1854,24 @@
case (AFNUM_INET<<8 | SAFNUM_UNICAST):
case (AFNUM_INET<<8 | SAFNUM_MULTICAST):
case (AFNUM_INET<<8 | SAFNUM_UNIMULTICAST):
- advance = decode_prefix4(tptr, buf, sizeof(buf));
+ advance = decode_prefix4(tptr, len, buf, sizeof(buf));
if (advance == -1)
printf("\n\t (illegal prefix length)");
else if (advance == -2)
goto trunc;
+ else if (advance == -3)
+ break; /* bytes left, but not enough */
else
printf("\n\t %s", buf);
break;
case (AFNUM_INET<<8 | SAFNUM_LABUNICAST):
- advance = decode_labeled_prefix4(tptr, buf, sizeof(buf));
+ advance = decode_labeled_prefix4(tptr, len, buf, sizeof(buf));
if (advance == -1)
printf("\n\t (illegal prefix length)");
else if (advance == -2)
goto trunc;
+ else if (advance == -3)
+ break; /* bytes left, but not enough */
else
printf("\n\t %s", buf);
break;
@@ -1396,20 +1890,24 @@
case (AFNUM_INET6<<8 | SAFNUM_UNICAST):
case (AFNUM_INET6<<8 | SAFNUM_MULTICAST):
case (AFNUM_INET6<<8 | SAFNUM_UNIMULTICAST):
- advance = decode_prefix6(tptr, buf, sizeof(buf));
+ advance = decode_prefix6(tptr, len, buf, sizeof(buf));
if (advance == -1)
printf("\n\t (illegal prefix length)");
else if (advance == -2)
goto trunc;
+ else if (advance == -3)
+ break; /* bytes left, but not enough */
else
printf("\n\t %s", buf);
break;
case (AFNUM_INET6<<8 | SAFNUM_LABUNICAST):
- advance = decode_labeled_prefix6(tptr, buf, sizeof(buf));
+ advance = decode_labeled_prefix6(tptr, len, buf, sizeof(buf));
if (advance == -1)
printf("\n\t (illegal prefix length)");
else if (advance == -2)
goto trunc;
+ else if (advance == -3)
+ break; /* bytes left, but not enough */
else
printf("\n\t %s", buf);
break;
@@ -1459,6 +1957,25 @@
else
printf("\n\t %s", buf);
break;
+ case (AFNUM_INET<<8 | SAFNUM_MDT):
+ advance = decode_mdt_vpn_nlri(tptr, buf, sizeof(buf));
+ if (advance == -1)
+ printf("\n\t (illegal prefix length)");
+ else if (advance == -2)
+ goto trunc;
+ else
+ printf("\n\t %s", buf);
+ break;
+ case (AFNUM_INET<<8 | SAFNUM_MULTICAST_VPN): /* fall through */
+ case (AFNUM_INET6<<8 | SAFNUM_MULTICAST_VPN):
+ advance = decode_multicast_vpn(tptr, buf, sizeof(buf));
+ if (advance == -1)
+ printf("\n\t (illegal prefix length)");
+ else if (advance == -2)
+ goto trunc;
+ else
+ printf("\n\t %s", buf);
+ break;
default:
TCHECK2(*(tptr-3),tlen);
printf("no AFI %u / SAFI %u decoder",af,safi);
@@ -1495,12 +2012,16 @@
switch(extd_comm) {
case BGP_EXT_COM_RT_0:
case BGP_EXT_COM_RO_0:
- printf(": %u:%s",
+ case BGP_EXT_COM_L2VPN_RT_0:
+ printf(": %u:%u (= %s)",
EXTRACT_16BITS(tptr+2),
+ EXTRACT_32BITS(tptr+4),
getname(tptr+4));
break;
case BGP_EXT_COM_RT_1:
case BGP_EXT_COM_RO_1:
+ case BGP_EXT_COM_L2VPN_RT_1:
+ case BGP_EXT_COM_VRF_RT_IMP:
printf(": %s:%u",
getname(tptr+2),
EXTRACT_16BITS(tptr+6));
@@ -1507,20 +2028,15 @@
break;
case BGP_EXT_COM_RT_2:
case BGP_EXT_COM_RO_2:
- printf(": %u:%u",
- EXTRACT_32BITS(tptr+2),
- EXTRACT_16BITS(tptr+6));
- break;
+ printf(": %s:%u",
+ as_printf(astostr, sizeof(astostr),
+ EXTRACT_32BITS(tptr+2)), EXTRACT_16BITS(tptr+6));
+ break;
case BGP_EXT_COM_LINKBAND:
bw.i = EXTRACT_32BITS(tptr+2);
printf(": bandwidth: %.3f Mbps",
bw.f*8/1000000);
break;
- case BGP_EXT_COM_CISCO_MCAST:
- printf(": AS %u, group %s",
- EXTRACT_16BITS(tptr+2),
- getname(tptr+4));
- break;
case BGP_EXT_COM_VPN_ORIGIN:
case BGP_EXT_COM_VPN_ORIGIN2:
case BGP_EXT_COM_VPN_ORIGIN3:
@@ -1549,6 +2065,9 @@
*(tptr+3),
EXTRACT_16BITS(tptr+4));
break;
+ case BGP_EXT_COM_SOURCE_AS:
+ printf(": AS %u", EXTRACT_16BITS(tptr+2));
+ break;
default:
TCHECK2(*tptr,8);
print_unknown_data(tptr,"\n\t ",8);
@@ -1559,41 +2078,110 @@
}
break;
+ case BGPTYPE_PMSI_TUNNEL:
+ {
+ u_int8_t tunnel_type, flags;
+
+ tunnel_type = *(tptr+1);
+ flags = *tptr;
+ tlen = len;
+
+ TCHECK2(tptr[0], 5);
+ printf("\n\t Tunnel-type %s (%u), Flags [%s], MPLS Label %u",
+ tok2str(bgp_pmsi_tunnel_values, "Unknown", tunnel_type),
+ tunnel_type,
+ bittok2str(bgp_pmsi_flag_values, "none", flags),
+ EXTRACT_24BITS(tptr+2)>>4);
+
+ tptr +=5;
+ tlen -= 5;
+
+ switch (tunnel_type) {
+ case BGP_PMSI_TUNNEL_PIM_SM: /* fall through */
+ case BGP_PMSI_TUNNEL_PIM_BIDIR:
+ TCHECK2(tptr[0], 8);
+ printf("\n\t Sender %s, P-Group %s",
+ ipaddr_string(tptr),
+ ipaddr_string(tptr+4));
+ break;
+
+ case BGP_PMSI_TUNNEL_PIM_SSM:
+ TCHECK2(tptr[0], 8);
+ printf("\n\t Root-Node %s, P-Group %s",
+ ipaddr_string(tptr),
+ ipaddr_string(tptr+4));
+ break;
+ case BGP_PMSI_TUNNEL_INGRESS:
+ TCHECK2(tptr[0], 4);
+ printf("\n\t Tunnel-Endpoint %s",
+ ipaddr_string(tptr));
+ break;
+ case BGP_PMSI_TUNNEL_LDP_P2MP: /* fall through */
+ case BGP_PMSI_TUNNEL_LDP_MP2MP:
+ TCHECK2(tptr[0], 8);
+ printf("\n\t Root-Node %s, LSP-ID 0x%08x",
+ ipaddr_string(tptr),
+ EXTRACT_32BITS(tptr+4));
+ break;
+ case BGP_PMSI_TUNNEL_RSVP_P2MP:
+ TCHECK2(tptr[0], 8);
+ printf("\n\t Extended-Tunnel-ID %s, P2MP-ID 0x%08x",
+ ipaddr_string(tptr),
+ EXTRACT_32BITS(tptr+4));
+ break;
+ default:
+ if (vflag <= 1) {
+ print_unknown_data(tptr,"\n\t ",tlen);
+ }
+ }
+ break;
+ }
case BGPTYPE_ATTR_SET:
TCHECK2(tptr[0], 4);
- printf("\n\t Origin AS: %u", EXTRACT_32BITS(tptr));
- tptr+=4;
+ if (len < 4)
+ goto trunc;
+ printf("\n\t Origin AS: %s",
+ as_printf(astostr, sizeof(astostr), EXTRACT_32BITS(tptr)));
+ tptr+=4;
len -=4;
- while (len >= 2 ) {
- int alen;
- struct bgp_attr bgpa;
+ while (len) {
+ u_int aflags, atype, alenlen, alen;
- TCHECK2(tptr[0], sizeof(bgpa));
- memcpy(&bgpa, tptr, sizeof(bgpa));
- alen = bgp_attr_len(&bgpa);
- tptr += bgp_attr_off(&bgpa);
- len -= bgp_attr_off(&bgpa);
+ TCHECK2(tptr[0], 2);
+ if (len < 2)
+ goto trunc;
+ aflags = *tptr;
+ atype = *(tptr + 1);
+ tptr += 2;
+ len -= 2;
+ alenlen = bgp_attr_lenlen(aflags, tptr);
+ TCHECK2(tptr[0], alenlen);
+ if (len < alenlen)
+ goto trunc;
+ alen = bgp_attr_len(aflags, tptr);
+ tptr += alenlen;
+ len -= alenlen;
printf("\n\t %s (%u), length: %u",
tok2strbuf(bgp_attr_values,
- "Unknown Attribute", bgpa.bgpa_type,
- tokbuf, sizeof(tokbuf)),
- bgpa.bgpa_type,
+ "Unknown Attribute", atype,
+ tokbuf, sizeof(tokbuf)),
+ atype,
alen);
- if (bgpa.bgpa_flags) {
+ if (aflags) {
printf(", Flags [%s%s%s%s",
- bgpa.bgpa_flags & 0x80 ? "O" : "",
- bgpa.bgpa_flags & 0x40 ? "T" : "",
- bgpa.bgpa_flags & 0x20 ? "P" : "",
- bgpa.bgpa_flags & 0x10 ? "E" : "");
- if (bgpa.bgpa_flags & 0xf)
- printf("+%x", bgpa.bgpa_flags & 0xf);
+ aflags & 0x80 ? "O" : "",
+ aflags & 0x40 ? "T" : "",
+ aflags & 0x20 ? "P" : "",
+ aflags & 0x10 ? "E" : "");
+ if (aflags & 0xf)
+ printf("+%x", aflags & 0xf);
printf("]: ");
}
/* FIXME check for recursion */
- if (!bgp_attr_print(&bgpa, tptr, alen))
+ if (!bgp_attr_print(atype, tptr, alen))
return 0;
tptr += alen;
len -= alen;
@@ -1603,7 +2191,7 @@
default:
TCHECK2(*pptr,len);
- printf("\n\t no Attribute %u decoder",attr->bgpa_type); /* we have no decoder for the attribute */
+ printf("\n\t no Attribute %u decoder",atype); /* we have no decoder for the attribute */
if (vflag <= 1)
print_unknown_data(pptr,"\n\t ",len);
break;
@@ -1619,20 +2207,104 @@
}
static void
+bgp_capabilities_print(const u_char *opt, int caps_len)
+{
+ char tokbuf[TOKBUFSIZE];
+ char tokbuf2[TOKBUFSIZE];
+ int cap_type, cap_len, tcap_len, cap_offset;
+ int i = 0;
+
+ while (i < caps_len) {
+ TCHECK2(opt[i], BGP_CAP_HEADER_SIZE);
+ cap_type=opt[i];
+ cap_len=opt[i+1];
+ tcap_len=cap_len;
+ printf("\n\t %s (%u), length: %u",
+ tok2strbuf(bgp_capcode_values, "Unknown",
+ cap_type, tokbuf, sizeof(tokbuf)),
+ cap_type,
+ cap_len);
+ TCHECK2(opt[i+2], cap_len);
+ switch (cap_type) {
+ case BGP_CAPCODE_MP:
+ printf("\n\t\tAFI %s (%u), SAFI %s (%u)",
+ tok2strbuf(af_values, "Unknown",
+ EXTRACT_16BITS(opt+i+2),
+ tokbuf, sizeof(tokbuf)),
+ EXTRACT_16BITS(opt+i+2),
+ tok2strbuf(bgp_safi_values, "Unknown",
+ opt[i+5],
+ tokbuf, sizeof(tokbuf)),
+ opt[i+5]);
+ break;
+ case BGP_CAPCODE_RESTART:
+ printf("\n\t\tRestart Flags: [%s], Restart Time %us",
+ ((opt[i+2])&0x80) ? "R" : "none",
+ EXTRACT_16BITS(opt+i+2)&0xfff);
+ tcap_len-=2;
+ cap_offset=4;
+ while(tcap_len>=4) {
+ printf("\n\t\t AFI %s (%u), SAFI %s (%u), Forwarding state preserved: %s",
+ tok2strbuf(af_values,"Unknown",
+ EXTRACT_16BITS(opt+i+cap_offset),
+ tokbuf, sizeof(tokbuf)),
+ EXTRACT_16BITS(opt+i+cap_offset),
+ tok2strbuf(bgp_safi_values,"Unknown",
+ opt[i+cap_offset+2],
+ tokbuf2, sizeof(tokbuf2)),
+ opt[i+cap_offset+2],
+ ((opt[i+cap_offset+3])&0x80) ? "yes" : "no" );
+ tcap_len-=4;
+ cap_offset+=4;
+ }
+ break;
+ case BGP_CAPCODE_RR:
+ case BGP_CAPCODE_RR_CISCO:
+ break;
+ case BGP_CAPCODE_AS_NEW:
+
+ /*
+ * Extract the 4 byte AS number encoded.
+ */
+ if (cap_len == 4) {
+ printf("\n\t\t 4 Byte AS %s",
+ as_printf(astostr, sizeof(astostr),
+ EXTRACT_32BITS(opt + i + 2)));
+ }
+ break;
+ default:
+ printf("\n\t\tno decoder for Capability %u",
+ cap_type);
+ if (vflag <= 1)
+ print_unknown_data(&opt[i+2],"\n\t\t",cap_len);
+ break;
+ }
+ if (vflag > 1 && cap_len > 0) {
+ print_unknown_data(&opt[i+2],"\n\t\t",cap_len);
+ }
+ i += BGP_CAP_HEADER_SIZE + cap_len;
+ }
+ return;
+
+trunc:
+ printf("[|BGP]");
+}
+
+static void
bgp_open_print(const u_char *dat, int length)
{
struct bgp_open bgpo;
struct bgp_opt bgpopt;
const u_char *opt;
- int i,cap_type,cap_len,tcap_len,cap_offset;
+ int i;
char tokbuf[TOKBUFSIZE];
- char tokbuf2[TOKBUFSIZE];
TCHECK2(dat[0], BGP_OPEN_SIZE);
memcpy(&bgpo, dat, BGP_OPEN_SIZE);
printf("\n\t Version %d, ", bgpo.bgpo_version);
- printf("my AS %u, ", ntohs(bgpo.bgpo_myas));
+ printf("my AS %s, ",
+ as_printf(astostr, sizeof(astostr), ntohs(bgpo.bgpo_myas)));
printf("Holdtime %us, ", ntohs(bgpo.bgpo_holdtime));
printf("ID %s", getname((u_char *)&bgpo.bgpo_id));
printf("\n\t Optional parameters, length: %u", bgpo.bgpo_optlen);
@@ -1650,84 +2322,31 @@
TCHECK2(opt[i], BGP_OPT_SIZE);
memcpy(&bgpopt, &opt[i], BGP_OPT_SIZE);
if (i + 2 + bgpopt.bgpopt_len > bgpo.bgpo_optlen) {
- printf("\n\t Option %d, length: %u", bgpopt.bgpopt_type, bgpopt.bgpopt_len);
+ printf("\n\t Option %d, length: %u", bgpopt.bgpopt_type, bgpopt.bgpopt_len);
break;
}
printf("\n\t Option %s (%u), length: %u",
- tok2strbuf(bgp_opt_values,"Unknown",
+ tok2strbuf(bgp_opt_values,"Unknown",
bgpopt.bgpopt_type,
tokbuf, sizeof(tokbuf)),
- bgpopt.bgpopt_type,
- bgpopt.bgpopt_len);
+ bgpopt.bgpopt_type,
+ bgpopt.bgpopt_len);
- /* now lets decode the options we know*/
- switch(bgpopt.bgpopt_type) {
- case BGP_OPT_CAP:
- cap_type=opt[i+BGP_OPT_SIZE];
- cap_len=opt[i+BGP_OPT_SIZE+1];
- tcap_len=cap_len;
- printf("\n\t %s (%u), length: %u",
- tok2strbuf(bgp_capcode_values, "Unknown",
- cap_type, tokbuf, sizeof(tokbuf)),
- cap_type,
- cap_len);
- switch(cap_type) {
- case BGP_CAPCODE_MP:
- printf("\n\t\tAFI %s (%u), SAFI %s (%u)",
- tok2strbuf(af_values, "Unknown",
- EXTRACT_16BITS(opt+i+BGP_OPT_SIZE+2),
- tokbuf, sizeof(tokbuf)),
- EXTRACT_16BITS(opt+i+BGP_OPT_SIZE+2),
- tok2strbuf(bgp_safi_values, "Unknown",
- opt[i+BGP_OPT_SIZE+5],
- tokbuf, sizeof(tokbuf)),
- opt[i+BGP_OPT_SIZE+5]);
- break;
- case BGP_CAPCODE_RESTART:
- printf("\n\t\tRestart Flags: [%s], Restart Time %us",
- ((opt[i+BGP_OPT_SIZE+2])&0x80) ? "R" : "none",
- EXTRACT_16BITS(opt+i+BGP_OPT_SIZE+2)&0xfff);
- tcap_len-=2;
- cap_offset=4;
- while(tcap_len>=4) {
- printf("\n\t\t AFI %s (%u), SAFI %s (%u), Forwarding state preserved: %s",
- tok2strbuf(af_values,"Unknown",
- EXTRACT_16BITS(opt+i+BGP_OPT_SIZE+cap_offset),
- tokbuf, sizeof(tokbuf)),
- EXTRACT_16BITS(opt+i+BGP_OPT_SIZE+cap_offset),
- tok2strbuf(bgp_safi_values,"Unknown",
- opt[i+BGP_OPT_SIZE+cap_offset+2],
- tokbuf2, sizeof(tokbuf2)),
- opt[i+BGP_OPT_SIZE+cap_offset+2],
- ((opt[i+BGP_OPT_SIZE+cap_offset+3])&0x80) ? "yes" : "no" );
- tcap_len-=4;
- cap_offset+=4;
- }
- break;
- case BGP_CAPCODE_RR:
- case BGP_CAPCODE_RR_CISCO:
- break;
- default:
- TCHECK2(opt[i+BGP_OPT_SIZE+2],cap_len);
- printf("\n\t\tno decoder for Capability %u",
- cap_type);
- if (vflag <= 1)
- print_unknown_data(&opt[i+BGP_OPT_SIZE+2],"\n\t\t",cap_len);
- break;
- }
- if (vflag > 1) {
- TCHECK2(opt[i+BGP_OPT_SIZE+2],cap_len);
- print_unknown_data(&opt[i+BGP_OPT_SIZE+2],"\n\t\t",cap_len);
- }
- break;
- case BGP_OPT_AUTH:
- default:
- printf("\n\t no decoder for option %u",
- bgpopt.bgpopt_type);
- break;
- }
+ /* now let's decode the options we know*/
+ switch(bgpopt.bgpopt_type) {
+ case BGP_OPT_CAP:
+ bgp_capabilities_print(&opt[i+BGP_OPT_SIZE],
+ bgpopt.bgpopt_len);
+ break;
+
+ case BGP_OPT_AUTH:
+ default:
+ printf("\n\t no decoder for option %u",
+ bgpopt.bgpopt_type);
+ break;
+ }
i += BGP_OPT_SIZE + bgpopt.bgpopt_len;
}
return;
@@ -1739,55 +2358,80 @@
bgp_update_print(const u_char *dat, int length)
{
struct bgp bgp;
- struct bgp_attr bgpa;
const u_char *p;
+ int withdrawn_routes_len;
int len;
int i;
char tokbuf[TOKBUFSIZE];
+#ifndef INET6
+ char buf[MAXHOSTNAMELEN + 100];
+ int wpfx;
+#endif
TCHECK2(dat[0], BGP_SIZE);
+ if (length < BGP_SIZE)
+ goto trunc;
memcpy(&bgp, dat, BGP_SIZE);
p = dat + BGP_SIZE; /*XXX*/
+ length -= BGP_SIZE;
/* Unfeasible routes */
- len = EXTRACT_16BITS(p);
- if (len) {
+ TCHECK2(p[0], 2);
+ if (length < 2)
+ goto trunc;
+ withdrawn_routes_len = EXTRACT_16BITS(p);
+ p += 2;
+ length -= 2;
+ if (withdrawn_routes_len) {
/*
* Without keeping state from the original NLRI message,
* it's not possible to tell if this a v4 or v6 route,
* so only try to decode it if we're not v6 enabled.
*/
+ TCHECK2(p[0], withdrawn_routes_len);
+ if (length < withdrawn_routes_len)
+ goto trunc;
#ifdef INET6
- printf("\n\t Withdrawn routes: %d bytes", len);
+ printf("\n\t Withdrawn routes: %d bytes", withdrawn_routes_len);
+ p += withdrawn_routes_len;
+ length -= withdrawn_routes_len;
#else
- char buf[MAXHOSTNAMELEN + 100];
- int wpfx;
+ if (withdrawn_routes_len < 2)
+ goto trunc;
+ length -= 2;
+ withdrawn_routes_len -= 2;
- TCHECK2(p[2], len);
- i = 2;
printf("\n\t Withdrawn routes:");
- while(i < 2 + len) {
- wpfx = decode_prefix4(&p[i], buf, sizeof(buf));
+ while(withdrawn_routes_len > 0) {
+ wpfx = decode_prefix4(p, withdrawn_routes_len, buf, sizeof(buf));
if (wpfx == -1) {
printf("\n\t (illegal prefix length)");
break;
} else if (wpfx == -2)
goto trunc;
+ else if (wpfx == -3)
+ goto trunc; /* bytes left, but not enough */
else {
- i += wpfx;
printf("\n\t %s", buf);
+ p += wpfx;
+ length -= wpfx;
+ withdrawn_routes_len -= wpfx;
}
}
#endif
}
- p += 2 + len;
TCHECK2(p[0], 2);
+ if (length < 2)
+ goto trunc;
len = EXTRACT_16BITS(p);
+ p += 2;
+ length -= 2;
- if (len == 0 && length == BGP_UPDATE_MINSIZE) {
+ if (withdrawn_routes_len == 0 && len == 0 && length == 0) {
+ /* No withdrawn routes, no path attributes, no NLRI */
printf("\n\t End-of-Rib Marker (empty NLRI)");
return;
}
@@ -1794,52 +2438,83 @@
if (len) {
/* do something more useful!*/
- i = 2;
- while (i < 2 + len) {
- int alen, aoff;
+ while (len) {
+ int aflags, atype, alenlen, alen;
- TCHECK2(p[i], sizeof(bgpa));
- memcpy(&bgpa, &p[i], sizeof(bgpa));
- alen = bgp_attr_len(&bgpa);
- aoff = bgp_attr_off(&bgpa);
+ TCHECK2(p[0], 2);
+ if (len < 2)
+ goto trunc;
+ if (length < 2)
+ goto trunc;
+ aflags = *p;
+ atype = *(p + 1);
+ p += 2;
+ len -= 2;
+ length -= 2;
+ alenlen = bgp_attr_lenlen(aflags, p);
+ TCHECK2(p[0], alenlen);
+ if (len < alenlen)
+ goto trunc;
+ if (length < alenlen)
+ goto trunc;
+ alen = bgp_attr_len(aflags, p);
+ p += alenlen;
+ len -= alenlen;
+ length -= alenlen;
- printf("\n\t %s (%u), length: %u",
+ printf("\n\t %s (%u), length: %u",
tok2strbuf(bgp_attr_values, "Unknown Attribute",
- bgpa.bgpa_type,
+ atype,
tokbuf, sizeof(tokbuf)),
- bgpa.bgpa_type,
+ atype,
alen);
- if (bgpa.bgpa_flags) {
+ if (aflags) {
printf(", Flags [%s%s%s%s",
- bgpa.bgpa_flags & 0x80 ? "O" : "",
- bgpa.bgpa_flags & 0x40 ? "T" : "",
- bgpa.bgpa_flags & 0x20 ? "P" : "",
- bgpa.bgpa_flags & 0x10 ? "E" : "");
- if (bgpa.bgpa_flags & 0xf)
- printf("+%x", bgpa.bgpa_flags & 0xf);
+ aflags & 0x80 ? "O" : "",
+ aflags & 0x40 ? "T" : "",
+ aflags & 0x20 ? "P" : "",
+ aflags & 0x10 ? "E" : "");
+ if (aflags & 0xf)
+ printf("+%x", aflags & 0xf);
printf("]: ");
}
- if (!bgp_attr_print(&bgpa, &p[i + aoff], alen))
+ if (len < alen)
goto trunc;
- i += aoff + alen;
+ if (length < alen)
+ goto trunc;
+ if (!bgp_attr_print(atype, p, alen))
+ goto trunc;
+ p += alen;
+ len -= alen;
+ length -= alen;
}
}
- p += 2 + len;
- if (dat + length > p) {
+ if (length) {
+ /*
+ * XXX - what if they're using the "Advertisement of
+ * Multiple Paths in BGP" feature:
+ *
+ * https://datatracker.ietf.org/doc/draft-ietf-idr-add-paths/
+ *
+ * http://tools.ietf.org/html/draft-ietf-idr-add-paths-06
+ */
printf("\n\t Updated routes:");
- while (dat + length > p) {
+ while (length) {
char buf[MAXHOSTNAMELEN + 100];
- i = decode_prefix4(p, buf, sizeof(buf));
+ i = decode_prefix4(p, length, buf, sizeof(buf));
if (i == -1) {
printf("\n\t (illegal prefix length)");
break;
} else if (i == -2)
goto trunc;
+ else if (i == -3)
+ goto trunc; /* bytes left, but not enough */
else {
printf("\n\t %s", buf);
p += i;
+ length -= i;
}
}
}
@@ -2077,3 +2752,10 @@
trunc:
printf(" [|BGP]");
}
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 4
+ * End:
+ */
Modified: trunk/contrib/tcpdump/print-bootp.c
===================================================================
--- trunk/contrib/tcpdump/print-bootp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-bootp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -20,11 +20,11 @@
*
* Format and print bootp packets.
*
- * $FreeBSD: src/contrib/tcpdump/print-bootp.c,v 1.11.10.1 2007/10/19 03:03:58 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-bootp.c 214478 2010-10-28 19:06:17Z rpaulo $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-bootp.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.89 2008-04-22 09:45:08 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -354,9 +354,13 @@
{ 0, NULL }
};
-#define AGENT_SUBOPTION_CIRCUIT_ID 1
+#define AGENT_SUBOPTION_CIRCUIT_ID 1 /* RFC 3046 */
+#define AGENT_SUBOPTION_REMOTE_ID 2 /* RFC 3046 */
+#define AGENT_SUBOPTION_SUBSCRIBER_ID 6 /* RFC 3993 */
static struct tok agent_suboption_values[] = {
{ AGENT_SUBOPTION_CIRCUIT_ID, "Circuit-ID" },
+ { AGENT_SUBOPTION_REMOTE_ID, "Remote-ID" },
+ { AGENT_SUBOPTION_SUBSCRIBER_ID, "Subscriber-ID" },
{ 0, NULL }
};
@@ -583,8 +587,6 @@
if (len < 1) {
printf("ERROR: option %u len %u < 1 bytes",
TAG_NETBIOS_NODE, len);
- bp += len;
- len = 0;
break;
}
tag = *bp++;
@@ -597,8 +599,6 @@
if (len < 1) {
printf("ERROR: option %u len %u < 1 bytes",
TAG_OPT_OVERLOAD, len);
- bp += len;
- len = 0;
break;
}
tag = *bp++;
@@ -638,8 +638,6 @@
if (len < 1) {
printf("ERROR: option %u len %u < 1 bytes",
TAG_CLIENT_ID, len);
- bp += len;
- len = 0;
break;
}
type = *bp++;
@@ -688,9 +686,11 @@
suboptlen);
switch (subopt) {
- case AGENT_SUBOPTION_CIRCUIT_ID:
- fn_printn(bp, suboptlen, NULL);
- break;
+ case AGENT_SUBOPTION_CIRCUIT_ID: /* fall through */
+ case AGENT_SUBOPTION_REMOTE_ID:
+ case AGENT_SUBOPTION_SUBSCRIBER_ID:
+ fn_printn(bp, suboptlen, NULL);
+ break;
default:
print_unknown_data(bp, "\n\t\t", suboptlen);
Added: trunk/contrib/tcpdump/print-bt.c
===================================================================
--- trunk/contrib/tcpdump/print-bt.c (rev 0)
+++ trunk/contrib/tcpdump/print-bt.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2007
+ * paolo.abeni at email.it 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 Paolo Abeni.''
+ * The name of author 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.
+ */
+
+#ifndef lint
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/print-bt.c,v 1.2 2008-09-25 21:45:50 guy Exp $";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <pcap.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "interface.h"
+#include "extract.h"
+#include "addrtoname.h"
+
+#if defined(DLT_BLUETOOTH_HCI_H4_WITH_PHDR) && defined(HAVE_PCAP_BLUETOOTH_H)
+#include <pcap/bluetooth.h>
+
+#define BT_HDRLEN sizeof(pcap_bluetooth_h4_header)
+/*
+ * This is the top level routine of the printer. 'p' points
+ * to the bluetooth header of the packet, 'h->ts' is the timestamp,
+ * 'h->len' is the length of the packet off the wire, and 'h->caplen'
+ * is the number of bytes actually captured.
+ */
+u_int
+bt_if_print(const struct pcap_pkthdr *h, const u_char *p)
+{
+ u_int length = h->len;
+ u_int caplen = h->caplen;
+ const pcap_bluetooth_h4_header* hdr = (const pcap_bluetooth_h4_header*)p;
+
+ if (caplen < BT_HDRLEN) {
+ printf("[|bt]");
+ return (BT_HDRLEN);
+ }
+ caplen -= BT_HDRLEN;
+ length -= BT_HDRLEN;
+ p += BT_HDRLEN;
+ if (eflag)
+ (void)printf("hci length %d, direction %s, ", length, (EXTRACT_32BITS(&hdr->direction)&0x1)?"in":"out");
+
+ if (!suppress_default_print)
+ default_print(p, caplen);
+
+ return (BT_HDRLEN);
+}
+#endif
+
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 8
+ * End:
+ */
Property changes on: trunk/contrib/tcpdump/print-bt.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/contrib/tcpdump/print-carp.c
===================================================================
--- trunk/contrib/tcpdump/print-carp.c (rev 0)
+++ trunk/contrib/tcpdump/print-carp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,88 @@
+/* $OpenBSD: print-carp.c,v 1.6 2009/10/27 23:59:55 deraadt Exp $ */
+
+/*
+ * Copyright (c) 2000 William C. Fenner.
+ * All rights reserved.
+ *
+ * Kevin Steves <ks at hp.se> July 2000
+ * Modified to:
+ * - print version, type string and packet length
+ * - print IP address count if > 1 (-v)
+ * - verify checksum (-v)
+ * - print authentication string (-v)
+ *
+ * Copyright (c) 2011 Advanced Computing Technologies
+ * George V. Neille-Neil
+ *
+ * Modified to:
+ * - work correctly with CARP
+ * - compile into the latest tcpdump
+ * - print out the counter
+ *
+ * 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 William C. Fenner 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.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include <netinet/in.h>
+
+#include "interface.h"
+#include "extract.h"
+#include "addrtoname.h"
+
+void
+carp_print(register const u_char *bp, register u_int len, int ttl)
+{
+ int version, type;
+ const char *type_s;
+
+ TCHECK(bp[0]);
+ version = (bp[0] & 0xf0) >> 4;
+ type = bp[0] & 0x0f;
+ if (type == 1)
+ type_s = "advertise";
+ else
+ type_s = "unknown";
+ printf("CARPv%d-%s %d: ", version, type_s, len);
+ if (ttl != 255)
+ printf("[ttl=%d!] ", ttl);
+ if (version != 2 || type != 1)
+ return;
+ TCHECK(bp[2]);
+ TCHECK(bp[5]);
+ printf("vhid=%d advbase=%d advskew=%d authlen=%d ",
+ bp[1], bp[5], bp[2], bp[3]);
+ if (vflag) {
+ struct cksum_vec vec[1];
+ vec[0].ptr = (const u_int8_t *)bp;
+ vec[0].len = len;
+ if (TTEST2(bp[0], len) && in_cksum(vec, 1))
+ printf(" (bad carp cksum %x!)",
+ EXTRACT_16BITS(&bp[6]));
+ }
+ printf("counter=%" PRIu64, EXTRACT_64BITS(&bp[8]));
+
+ return;
+trunc:
+ printf("[|carp]");
+}
Property changes on: trunk/contrib/tcpdump/print-carp.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-cdp.c
===================================================================
--- trunk/contrib/tcpdump/print-cdp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-cdp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -26,7 +26,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-cdp.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-cdp.c,v 1.25 2004-10-07 14:53:11 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -124,15 +124,16 @@
tok2str(cdp_tlv_values,"unknown field type", type),
type,
len,
- len>1 ? "s" : ""); /* plural */
+ PLURAL_SUFFIX(len)); /* plural */
switch (type) {
case 0x01: /* Device-ID */
if (!vflag)
- printf(", Device-ID '%.*s'", len, tptr);
- else
- printf("'%.*s'", len, tptr);
+ printf(", Device-ID ");
+ printf("'");
+ fn_printn(tptr, len, NULL);
+ printf("'");
break;
case 0x02: /* Address */
if (cdp_print_addr(tptr, len) < 0)
@@ -139,7 +140,9 @@
goto trunc;
break;
case 0x03: /* Port-ID */
- printf("'%.*s'", len, tptr);
+ printf("'");
+ fn_printn(tptr, len, NULL);
+ printf("'");
break;
case 0x04: /* Capabilities */
printf("(0x%08x): %s",
@@ -156,7 +159,9 @@
}
break;
case 0x06: /* Platform */
- printf("'%.*s'", len, tptr);
+ printf("'");
+ fn_printn(tptr, len, NULL);
+ printf("'");
break;
case 0x07: /* Prefixes */
if (cdp_print_prefixes(tptr, len) < 0)
@@ -165,7 +170,9 @@
case 0x08: /* Protocol Hello Option - not documented */
break;
case 0x09: /* VTP Mgmt Domain - not documented */
- printf("'%.*s'", len,tptr);
+ printf("'");
+ fn_printn(tptr, len, NULL);
+ printf("'");
break;
case 0x0a: /* Native VLAN ID - not documented */
printf("%d",EXTRACT_16BITS(tptr));
@@ -195,7 +202,9 @@
printf("0x%02x", *(tptr));
break;
case 0x14: /* System Name - not documented */
- printf("'%.*s'", len, tptr);
+ printf("'");
+ fn_printn(tptr, len, NULL);
+ printf("'");
break;
case 0x16: /* System Object ID - not documented */
if (cdp_print_addr(tptr, len) < 0)
@@ -202,7 +211,11 @@
goto trunc;
break;
case 0x17: /* Physical Location - not documented */
- printf("0x%02x/%.*s", *(tptr), len - 1, tptr + 1 );
+ printf("0x%02x", *(tptr));
+ if (len > 1) {
+ printf("/");
+ fn_printn(tptr + 1, len - 1, NULL);
+ }
break;
default:
print_unknown_data(tptr,"\n\t ",len);
Added: trunk/contrib/tcpdump/print-cfm.c
===================================================================
--- trunk/contrib/tcpdump/print-cfm.c (rev 0)
+++ trunk/contrib/tcpdump/print-cfm.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,645 @@
+/*
+ * Copyright (c) 1998-2006 The TCPDUMP project
+ *
+ * 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.
+ *
+ * Support for the IEEE Connectivity Fault Management Protocols as per 802.1ag.
+ *
+ * Original code by Hannes Gredler (hannes at juniper.net)
+ */
+
+#ifndef lint
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/print-cfm.c,v 1.5 2007-07-24 16:01:42 hannes Exp $";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "interface.h"
+#include "extract.h"
+#include "ether.h"
+#include "addrtoname.h"
+#include "oui.h"
+#include "af.h"
+
+/*
+ * Prototypes
+ */
+const char * cfm_egress_id_string(register const u_char *);
+int cfm_mgmt_addr_print(register const u_char *);
+
+struct cfm_common_header_t {
+ u_int8_t mdlevel_version;
+ u_int8_t opcode;
+ u_int8_t flags;
+ u_int8_t first_tlv_offset;
+};
+
+#define CFM_VERSION 0
+#define CFM_EXTRACT_VERSION(x) (((x)&0x1f))
+#define CFM_EXTRACT_MD_LEVEL(x) (((x)&0xe0)>>5)
+
+#define CFM_OPCODE_CCM 1
+#define CFM_OPCODE_LBR 2
+#define CFM_OPCODE_LBM 3
+#define CFM_OPCODE_LTR 4
+#define CFM_OPCODE_LTM 5
+
+static const struct tok cfm_opcode_values[] = {
+ { CFM_OPCODE_CCM, "Continouity Check Message"},
+ { CFM_OPCODE_LBR, "Loopback Reply"},
+ { CFM_OPCODE_LBM, "Loopback Message"},
+ { CFM_OPCODE_LTR, "Linktrace Reply"},
+ { CFM_OPCODE_LTM, "Linktrace Message"},
+ { 0, NULL}
+};
+
+/*
+ * Message Formats.
+ */
+struct cfm_ccm_t {
+ u_int8_t sequence[4];
+ u_int8_t ma_epi[2];
+ u_int8_t md_nameformat;
+ u_int8_t md_namelength;
+ u_int8_t md_name[46]; /* md name and short ma name */
+ u_int8_t reserved_itu[16];
+ u_int8_t reserved[6];
+};
+
+/*
+ * Timer Bases for the CCM Interval field.
+ * Expressed in units of seconds.
+ */
+const float ccm_interval_base[8] = {0, 0.003333, 0.01, 0.1, 1, 10, 60, 600};
+#define CCM_INTERVAL_MIN_MULTIPLIER 3.25
+#define CCM_INTERVAL_MAX_MULTIPLIER 3.5
+
+#define CFM_CCM_RDI_FLAG 0x80
+#define CFM_EXTRACT_CCM_INTERVAL(x) (((x)&0x07))
+
+#define CFM_CCM_MD_FORMAT_8021 0
+#define CFM_CCM_MD_FORMAT_NONE 1
+#define CFM_CCM_MD_FORMAT_DNS 2
+#define CFM_CCM_MD_FORMAT_MAC 3
+#define CFM_CCM_MD_FORMAT_CHAR 4
+
+static const struct tok cfm_md_nameformat_values[] = {
+ { CFM_CCM_MD_FORMAT_8021, "IEEE 802.1"},
+ { CFM_CCM_MD_FORMAT_NONE, "No MD Name present"},
+ { CFM_CCM_MD_FORMAT_DNS, "DNS string"},
+ { CFM_CCM_MD_FORMAT_MAC, "MAC + 16Bit Integer"},
+ { CFM_CCM_MD_FORMAT_CHAR, "Character string"},
+ { 0, NULL}
+};
+
+#define CFM_CCM_MA_FORMAT_8021 0
+#define CFM_CCM_MA_FORMAT_VID 1
+#define CFM_CCM_MA_FORMAT_CHAR 2
+#define CFM_CCM_MA_FORMAT_INT 3
+#define CFM_CCM_MA_FORMAT_VPN 4
+
+static const struct tok cfm_ma_nameformat_values[] = {
+ { CFM_CCM_MA_FORMAT_8021, "IEEE 802.1"},
+ { CFM_CCM_MA_FORMAT_VID, "Primary VID"},
+ { CFM_CCM_MA_FORMAT_CHAR, "Character string"},
+ { CFM_CCM_MA_FORMAT_INT, "16Bit Integer"},
+ { CFM_CCM_MA_FORMAT_VPN, "RFC2685 VPN-ID"},
+ { 0, NULL}
+};
+
+struct cfm_lbm_t {
+ u_int8_t transaction_id[4];
+ u_int8_t reserved[4];
+};
+
+struct cfm_ltm_t {
+ u_int8_t transaction_id[4];
+ u_int8_t egress_id[8];
+ u_int8_t ttl;
+ u_int8_t original_mac[ETHER_ADDR_LEN];
+ u_int8_t target_mac[ETHER_ADDR_LEN];
+ u_int8_t reserved[3];
+};
+
+static const struct tok cfm_ltm_flag_values[] = {
+ { 0x80, "Use Forwarding-DB only"},
+ { 0, NULL}
+};
+
+struct cfm_ltr_t {
+ u_int8_t transaction_id[4];
+ u_int8_t last_egress_id[8];
+ u_int8_t next_egress_id[8];
+ u_int8_t ttl;
+ u_int8_t replay_action;
+ u_int8_t reserved[6];
+};
+
+static const struct tok cfm_ltr_flag_values[] = {
+ { 0x80, "Forwarded"},
+ { 0x40, "Terminal MEP"},
+ { 0, NULL}
+};
+
+static const struct tok cfm_ltr_replay_action_values[] = {
+ { 1, "Exact Match"},
+ { 2, "Filtering DB"},
+ { 3, "MIP CCM DB"},
+ { 0, NULL}
+};
+
+
+#define CFM_TLV_END 0
+#define CFM_TLV_SENDER_ID 1
+#define CFM_TLV_PORT_STATUS 2
+#define CFM_TLV_INTERFACE_STATUS 3
+#define CFM_TLV_DATA 4
+#define CFM_TLV_REPLY_INGRESS 5
+#define CFM_TLV_REPLY_EGRESS 6
+#define CFM_TLV_PRIVATE 31
+
+static const struct tok cfm_tlv_values[] = {
+ { CFM_TLV_END, "End"},
+ { CFM_TLV_SENDER_ID, "Sender ID"},
+ { CFM_TLV_PORT_STATUS, "Port status"},
+ { CFM_TLV_INTERFACE_STATUS, "Interface status"},
+ { CFM_TLV_DATA, "Data"},
+ { CFM_TLV_REPLY_INGRESS, "Reply Ingress"},
+ { CFM_TLV_REPLY_EGRESS, "Reply Egress"},
+ { CFM_TLV_PRIVATE, "Organization Specific"},
+ { 0, NULL}
+};
+
+/*
+ * TLVs
+ */
+
+struct cfm_tlv_header_t {
+ u_int8_t type;
+ u_int8_t length[2];
+};
+
+/* FIXME define TLV formats */
+
+static const struct tok cfm_tlv_port_status_values[] = {
+ { 1, "Blocked"},
+ { 2, "Up"},
+ { 0, NULL}
+};
+
+static const struct tok cfm_tlv_interface_status_values[] = {
+ { 1, "Up"},
+ { 2, "Down"},
+ { 3, "Testing"},
+ { 5, "Dormant"},
+ { 6, "not present"},
+ { 7, "lower Layer down"},
+ { 0, NULL}
+};
+
+#define CFM_CHASSIS_ID_CHASSIS_COMPONENT 1
+#define CFM_CHASSIS_ID_INTERFACE_ALIAS 2
+#define CFM_CHASSIS_ID_PORT_COMPONENT 3
+#define CFM_CHASSIS_ID_MAC_ADDRESS 4
+#define CFM_CHASSIS_ID_NETWORK_ADDRESS 5
+#define CFM_CHASSIS_ID_INTERFACE_NAME 6
+#define CFM_CHASSIS_ID_LOCAL 7
+
+static const struct tok cfm_tlv_senderid_chassisid_values[] = {
+ { 0, "Reserved"},
+ { CFM_CHASSIS_ID_CHASSIS_COMPONENT, "Chassis component"},
+ { CFM_CHASSIS_ID_INTERFACE_ALIAS, "Interface alias"},
+ { CFM_CHASSIS_ID_PORT_COMPONENT, "Port component"},
+ { CFM_CHASSIS_ID_MAC_ADDRESS, "MAC address"},
+ { CFM_CHASSIS_ID_NETWORK_ADDRESS, "Network address"},
+ { CFM_CHASSIS_ID_INTERFACE_NAME, "Interface name"},
+ { CFM_CHASSIS_ID_LOCAL, "Locally assigned"},
+ { 0, NULL}
+};
+
+
+int
+cfm_mgmt_addr_print(register const u_char *tptr) {
+
+ u_int mgmt_addr_type;
+ u_int hexdump = FALSE;
+
+ /*
+ * Altough AFIs are tpically 2 octects wide,
+ * 802.1ab specifies that this field width
+ * is only once octet
+ */
+ mgmt_addr_type = *tptr;
+ printf("\n\t Management Address Type %s (%u)",
+ tok2str(af_values, "Unknown", mgmt_addr_type),
+ mgmt_addr_type);
+
+ /*
+ * Resolve the passed in Address.
+ */
+ switch(mgmt_addr_type) {
+ case AFNUM_INET:
+ printf(", %s", ipaddr_string(tptr + 1));
+ break;
+
+#ifdef INET6
+ case AFNUM_INET6:
+ printf(", %s", ip6addr_string(tptr + 1));
+ break;
+#endif
+
+ default:
+ hexdump = TRUE;
+ break;
+ }
+
+ return hexdump;
+}
+
+/*
+ * The egress-ID string is a 16-Bit string plus a MAC address.
+ */
+const char *
+cfm_egress_id_string(register const u_char *tptr) {
+ static char egress_id_buffer[80];
+
+ snprintf(egress_id_buffer, sizeof(egress_id_buffer),
+ "MAC %0x4x-%s",
+ EXTRACT_16BITS(tptr),
+ etheraddr_string(tptr+2));
+
+ return egress_id_buffer;
+}
+
+void
+cfm_print(register const u_char *pptr, register u_int length) {
+
+ const struct cfm_common_header_t *cfm_common_header;
+ const struct cfm_tlv_header_t *cfm_tlv_header;
+ const u_int8_t *tptr, *tlv_ptr, *ma_name, *ma_nameformat, *ma_namelength;
+ u_int hexdump, tlen, cfm_tlv_len, cfm_tlv_type, ccm_interval;
+
+
+ union {
+ const struct cfm_ccm_t *cfm_ccm;
+ const struct cfm_lbm_t *cfm_lbm;
+ const struct cfm_ltm_t *cfm_ltm;
+ const struct cfm_ltr_t *cfm_ltr;
+ } msg_ptr;
+
+ tptr=pptr;
+ cfm_common_header = (const struct cfm_common_header_t *)pptr;
+ TCHECK(*cfm_common_header);
+
+ /*
+ * Sanity checking of the header.
+ */
+ if (CFM_EXTRACT_VERSION(cfm_common_header->mdlevel_version) != CFM_VERSION) {
+ printf("CFMv%u not supported, length %u",
+ CFM_EXTRACT_VERSION(cfm_common_header->mdlevel_version), length);
+ return;
+ }
+
+ printf("CFMv%u %s, MD Level %u, length %u",
+ CFM_EXTRACT_VERSION(cfm_common_header->mdlevel_version),
+ tok2str(cfm_opcode_values, "unknown (%u)", cfm_common_header->opcode),
+ CFM_EXTRACT_MD_LEVEL(cfm_common_header->mdlevel_version),
+ length);
+
+ /*
+ * In non-verbose mode just print the opcode and md-level.
+ */
+ if (vflag < 1) {
+ return;
+ }
+
+ printf("\n\tFirst TLV offset %u", cfm_common_header->first_tlv_offset);
+
+ tptr += sizeof(const struct cfm_common_header_t);
+ tlen = length - sizeof(struct cfm_common_header_t);
+
+ switch (cfm_common_header->opcode) {
+ case CFM_OPCODE_CCM:
+ msg_ptr.cfm_ccm = (const struct cfm_ccm_t *)tptr;
+
+ ccm_interval = CFM_EXTRACT_CCM_INTERVAL(cfm_common_header->flags);
+ printf(", Flags [CCM Interval %u%s]",
+ ccm_interval,
+ cfm_common_header->flags & CFM_CCM_RDI_FLAG ?
+ ", RDI" : "");
+
+ /*
+ * Resolve the CCM interval field.
+ */
+ if (ccm_interval) {
+ printf("\n\t CCM Interval %.3fs"
+ ", min CCM Lifetime %.3fs, max CCM Lifetime %.3fs",
+ ccm_interval_base[ccm_interval],
+ ccm_interval_base[ccm_interval] * CCM_INTERVAL_MIN_MULTIPLIER,
+ ccm_interval_base[ccm_interval] * CCM_INTERVAL_MAX_MULTIPLIER);
+ }
+
+ printf("\n\t Sequence Number 0x%08x, MA-End-Point-ID 0x%04x",
+ EXTRACT_32BITS(msg_ptr.cfm_ccm->sequence),
+ EXTRACT_16BITS(msg_ptr.cfm_ccm->ma_epi));
+
+
+ /*
+ * Resolve the MD fields.
+ */
+ printf("\n\t MD Name Format %s (%u), MD Name length %u",
+ tok2str(cfm_md_nameformat_values, "Unknown",
+ msg_ptr.cfm_ccm->md_nameformat),
+ msg_ptr.cfm_ccm->md_nameformat,
+ msg_ptr.cfm_ccm->md_namelength);
+
+ if (msg_ptr.cfm_ccm->md_nameformat != CFM_CCM_MD_FORMAT_NONE) {
+ printf("\n\t MD Name: ");
+ switch (msg_ptr.cfm_ccm->md_nameformat) {
+ case CFM_CCM_MD_FORMAT_DNS:
+ case CFM_CCM_MD_FORMAT_CHAR:
+ safeputs((const char *)msg_ptr.cfm_ccm->md_name, msg_ptr.cfm_ccm->md_namelength);
+ break;
+
+ case CFM_CCM_MD_FORMAT_MAC:
+ printf("\n\t MAC %s", etheraddr_string(
+ msg_ptr.cfm_ccm->md_name));
+ break;
+
+ /* FIXME add printers for those MD formats - hexdump for now */
+ case CFM_CCM_MA_FORMAT_8021:
+ default:
+ print_unknown_data(msg_ptr.cfm_ccm->md_name, "\n\t ",
+ msg_ptr.cfm_ccm->md_namelength);
+ }
+ }
+
+
+ /*
+ * Resolve the MA fields.
+ */
+ ma_nameformat = msg_ptr.cfm_ccm->md_name + msg_ptr.cfm_ccm->md_namelength;
+ ma_namelength = msg_ptr.cfm_ccm->md_name + msg_ptr.cfm_ccm->md_namelength + 1;
+ ma_name = msg_ptr.cfm_ccm->md_name + msg_ptr.cfm_ccm->md_namelength + 2;
+
+ printf("\n\t MA Name-Format %s (%u), MA name length %u",
+ tok2str(cfm_ma_nameformat_values, "Unknown",
+ *ma_nameformat),
+ *ma_nameformat,
+ *ma_namelength);
+
+ printf("\n\t MA Name: ");
+ switch (*ma_nameformat) {
+ case CFM_CCM_MA_FORMAT_CHAR:
+ safeputs((const char *)ma_name, *ma_namelength);
+ break;
+
+ /* FIXME add printers for those MA formats - hexdump for now */
+ case CFM_CCM_MA_FORMAT_8021:
+ case CFM_CCM_MA_FORMAT_VID:
+ case CFM_CCM_MA_FORMAT_INT:
+ case CFM_CCM_MA_FORMAT_VPN:
+ default:
+ print_unknown_data(ma_name, "\n\t ", *ma_namelength);
+ }
+ break;
+
+ case CFM_OPCODE_LTM:
+ msg_ptr.cfm_ltm = (const struct cfm_ltm_t *)tptr;
+
+ printf(", Flags [%s]",
+ bittok2str(cfm_ltm_flag_values, "none", cfm_common_header->flags));
+
+ printf("\n\t Transaction-ID 0x%08x, Egress-ID %s, ttl %u",
+ EXTRACT_32BITS(msg_ptr.cfm_ltm->transaction_id),
+ cfm_egress_id_string(msg_ptr.cfm_ltm->egress_id),
+ msg_ptr.cfm_ltm->ttl);
+
+ printf("\n\t Original-MAC %s, Target-MAC %s",
+ etheraddr_string(msg_ptr.cfm_ltm->original_mac),
+ etheraddr_string(msg_ptr.cfm_ltm->target_mac));
+ break;
+
+ case CFM_OPCODE_LTR:
+ msg_ptr.cfm_ltr = (const struct cfm_ltr_t *)tptr;
+
+ printf(", Flags [%s]",
+ bittok2str(cfm_ltr_flag_values, "none", cfm_common_header->flags));
+
+ printf("\n\t Transaction-ID 0x%08x, Last-Egress-ID %s",
+ EXTRACT_32BITS(msg_ptr.cfm_ltr->transaction_id),
+ cfm_egress_id_string(msg_ptr.cfm_ltr->last_egress_id));
+
+ printf("\n\t Next-Egress-ID %s, ttl %u",
+ cfm_egress_id_string(msg_ptr.cfm_ltr->next_egress_id),
+ msg_ptr.cfm_ltr->ttl);
+
+ printf("\n\t Replay-Action %s (%u)",
+ tok2str(cfm_ltr_replay_action_values,
+ "Unknown",
+ msg_ptr.cfm_ltr->replay_action),
+ msg_ptr.cfm_ltr->replay_action);
+ break;
+
+ /*
+ * No message decoder yet.
+ * Hexdump everything up until the start of the TLVs
+ */
+ case CFM_OPCODE_LBR:
+ case CFM_OPCODE_LBM:
+ default:
+ if (tlen > cfm_common_header->first_tlv_offset) {
+ print_unknown_data(tptr, "\n\t ",
+ tlen - cfm_common_header->first_tlv_offset);
+ }
+ break;
+ }
+
+ /*
+ * Sanity check for not walking off.
+ */
+ if (tlen <= cfm_common_header->first_tlv_offset) {
+ return;
+ }
+
+ tptr += cfm_common_header->first_tlv_offset;
+ tlen -= cfm_common_header->first_tlv_offset;
+
+ while (tlen > 0) {
+ cfm_tlv_header = (const struct cfm_tlv_header_t *)tptr;
+
+ /* Enough to read the tlv type ? */
+ TCHECK2(*tptr, 1);
+ cfm_tlv_type=cfm_tlv_header->type;
+
+ if (cfm_tlv_type != CFM_TLV_END) {
+ /* did we capture enough for fully decoding the object header ? */
+ TCHECK2(*tptr, sizeof(struct cfm_tlv_header_t));
+ cfm_tlv_len=EXTRACT_16BITS(&cfm_tlv_header->length);
+ } else {
+ cfm_tlv_len = 0;
+ }
+
+ printf("\n\t%s TLV (0x%02x), length %u",
+ tok2str(cfm_tlv_values, "Unknown", cfm_tlv_type),
+ cfm_tlv_type,
+ cfm_tlv_len);
+
+ /* sanity check for not walking off and infinite loop check. */
+ if ((cfm_tlv_type != CFM_TLV_END) &&
+ ((cfm_tlv_len + sizeof(struct cfm_tlv_header_t) > tlen) ||
+ (!cfm_tlv_len))) {
+ print_unknown_data(tptr,"\n\t ",tlen);
+ return;
+ }
+
+ tptr += sizeof(struct cfm_tlv_header_t);
+ tlen -= sizeof(struct cfm_tlv_header_t);
+ tlv_ptr = tptr;
+
+ /* did we capture enough for fully decoding the object ? */
+ if (cfm_tlv_type != CFM_TLV_END) {
+ TCHECK2(*tptr, cfm_tlv_len);
+ }
+ hexdump = FALSE;
+
+ switch(cfm_tlv_type) {
+ case CFM_TLV_END:
+ /* we are done - bail out */
+ return;
+
+ case CFM_TLV_PORT_STATUS:
+ printf(", Status: %s (%u)",
+ tok2str(cfm_tlv_port_status_values, "Unknown", *tptr),
+ *tptr);
+ break;
+
+ case CFM_TLV_INTERFACE_STATUS:
+ printf(", Status: %s (%u)",
+ tok2str(cfm_tlv_interface_status_values, "Unknown", *tptr),
+ *tptr);
+ break;
+
+ case CFM_TLV_PRIVATE:
+ printf(", Vendor: %s (%u), Sub-Type %u",
+ tok2str(oui_values,"Unknown", EXTRACT_24BITS(tptr)),
+ EXTRACT_24BITS(tptr),
+ *(tptr+3));
+ hexdump = TRUE;
+ break;
+
+ case CFM_TLV_SENDER_ID:
+ {
+ u_int chassis_id_type, chassis_id_length;
+ u_int mgmt_addr_length;
+
+ /*
+ * Check if there is a Chassis-ID.
+ */
+ chassis_id_length = *tptr;
+ if (chassis_id_length > tlen) {
+ hexdump = TRUE;
+ break;
+ }
+
+ tptr++;
+ tlen--;
+
+ if (chassis_id_length) {
+ chassis_id_type = *tptr;
+ printf("\n\t Chassis-ID Type %s (%u), Chassis-ID length %u",
+ tok2str(cfm_tlv_senderid_chassisid_values,
+ "Unknown",
+ chassis_id_type),
+ chassis_id_type,
+ chassis_id_length);
+
+ switch (chassis_id_type) {
+ case CFM_CHASSIS_ID_MAC_ADDRESS:
+ printf("\n\t MAC %s", etheraddr_string(tptr+1));
+ break;
+
+ case CFM_CHASSIS_ID_NETWORK_ADDRESS:
+ hexdump |= cfm_mgmt_addr_print(tptr);
+ break;
+
+ case CFM_CHASSIS_ID_INTERFACE_NAME: /* fall through */
+ case CFM_CHASSIS_ID_INTERFACE_ALIAS:
+ case CFM_CHASSIS_ID_LOCAL:
+ case CFM_CHASSIS_ID_CHASSIS_COMPONENT:
+ case CFM_CHASSIS_ID_PORT_COMPONENT:
+ safeputs((const char *)tptr+1, chassis_id_length);
+ break;
+
+ default:
+ hexdump = TRUE;
+ break;
+ }
+ }
+
+ tptr += chassis_id_length;
+ tlen -= chassis_id_length;
+
+ /*
+ * Check if there is a Management Address.
+ */
+ mgmt_addr_length = *tptr;
+ if (mgmt_addr_length > tlen) {
+ hexdump = TRUE;
+ break;
+ }
+
+ tptr++;
+ tlen--;
+
+ if (mgmt_addr_length) {
+ hexdump |= cfm_mgmt_addr_print(tptr);
+ }
+
+ tptr += mgmt_addr_length;
+ tlen -= mgmt_addr_length;
+
+ }
+ break;
+
+ /*
+ * FIXME those are the defined TLVs that lack a decoder
+ * you are welcome to contribute code ;-)
+ */
+
+ case CFM_TLV_DATA:
+ case CFM_TLV_REPLY_INGRESS:
+ case CFM_TLV_REPLY_EGRESS:
+ default:
+ hexdump = TRUE;
+ break;
+ }
+ /* do we want to see an additional hexdump ? */
+ if (hexdump || vflag > 1)
+ print_unknown_data(tlv_ptr, "\n\t ", cfm_tlv_len);
+
+ tptr+=cfm_tlv_len;
+ tlen-=cfm_tlv_len;
+ }
+ return;
+trunc:
+ printf("\n\t\t packet exceeded snapshot");
+}
Property changes on: trunk/contrib/tcpdump/print-cfm.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-chdlc.c
===================================================================
--- trunk/contrib/tcpdump/print-chdlc.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-chdlc.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-chdlc.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.43 2005-11-29 08:56:19 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -85,7 +85,7 @@
break;
#ifdef INET6
case ETHERTYPE_IPV6:
- ip6_print(p, length);
+ ip6_print(gndo, p, length);
break;
#endif
case CHDLC_TYPE_SLARP:
Modified: trunk/contrib/tcpdump/print-cip.c
===================================================================
--- trunk/contrib/tcpdump/print-cip.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-cip.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -22,7 +22,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-cip.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.26 2005-07-07 01:22:17 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-cnfp.c
===================================================================
--- trunk/contrib/tcpdump/print-cnfp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-cnfp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -34,7 +34,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-cnfp.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-cnfp.c,v 1.17 2005-04-20 20:53:18 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-dccp.c
===================================================================
--- trunk/contrib/tcpdump/print-dccp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-dccp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -9,7 +9,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-dccp.c,v 1.1.1.1 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-dccp.c,v 1.8 2007-11-09 00:44:09 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -60,76 +60,28 @@
"check data checksum",
};
+static inline u_int dccp_csum_coverage(const struct dccp_hdr* dh, u_int len)
+{
+ u_int cov;
+
+ if (DCCPH_CSCOV(dh) == 0)
+ return len;
+ cov = (dh->dccph_doff + DCCPH_CSCOV(dh) - 1) * sizeof(u_int32_t);
+ return (cov > len)? len : cov;
+}
+
static int dccp_cksum(const struct ip *ip,
const struct dccp_hdr *dh, u_int len)
{
- union phu {
- struct phdr {
- u_int32_t src;
- u_int32_t dst;
- u_char mbz;
- u_char proto;
- u_int16_t len;
- } ph;
- u_int16_t pa[6];
- } phu;
- const u_int16_t *sp;
-
- /* pseudo-header.. */
- phu.ph.mbz = 0;
- phu.ph.len = htons(len);
- phu.ph.proto = IPPROTO_DCCP;
- memcpy(&phu.ph.src, &ip->ip_src.s_addr, sizeof(u_int32_t));
- if (IP_HL(ip) == 5)
- memcpy(&phu.ph.dst, &ip->ip_dst.s_addr, sizeof(u_int32_t));
- else
- phu.ph.dst = ip_finddst(ip);
-
- sp = &phu.pa[0];
- return in_cksum((u_short *)dh, len, sp[0]+sp[1]+sp[2]+sp[3]+sp[4]+sp[5]);
+ return nextproto4_cksum(ip, (const u_int8_t *)(void *)dh,
+ dccp_csum_coverage(dh, len), IPPROTO_DCCP);
}
#ifdef INET6
static int dccp6_cksum(const struct ip6_hdr *ip6, const struct dccp_hdr *dh, u_int len)
{
- size_t i;
- const u_int16_t *sp;
- u_int32_t sum;
- union {
- struct {
- struct in6_addr ph_src;
- struct in6_addr ph_dst;
- u_int32_t ph_len;
- u_int8_t ph_zero[3];
- u_int8_t ph_nxt;
- } ph;
- u_int16_t pa[20];
- } phu;
-
- /* pseudo-header */
- memset(&phu, 0, sizeof(phu));
- phu.ph.ph_src = ip6->ip6_src;
- phu.ph.ph_dst = ip6->ip6_dst;
- phu.ph.ph_len = htonl(len);
- phu.ph.ph_nxt = IPPROTO_DCCP;
-
- sum = 0;
- for (i = 0; i < sizeof(phu.pa) / sizeof(phu.pa[0]); i++)
- sum += phu.pa[i];
-
- sp = (const u_int16_t *)dh;
-
- for (i = 0; i < (len & ~1); i += 2)
- sum += *sp++;
-
- if (len & 1)
- sum += htons((*(const u_int8_t *)sp) << 8);
-
- while (sum > 0xffff)
- sum = (sum & 0xffff) + (sum >> 16);
- sum = ~sum & 0xffff;
-
- return (sum);
+ return nextproto6_cksum(ip6, (const u_int8_t *)(void *)dh,
+ dccp_csum_coverage(dh, len), IPPROTO_DCCP);
}
#endif
@@ -279,32 +231,21 @@
}
/* checksum calculation */
+ if (vflag && TTEST2(bp[0], len)) {
+ u_int16_t sum = 0, dccp_sum;
+
+ dccp_sum = EXTRACT_16BITS(&dh->dccph_checksum);
+ (void)printf("cksum 0x%04x ", dccp_sum);
+ if (IP_V(ip) == 4)
+ sum = dccp_cksum(ip, dh, len);
#ifdef INET6
- if (ip6) {
- if (ip6->ip6_plen && vflag) {
- u_int16_t sum, dccp_sum;
-
+ else if (IP_V(ip) == 6)
sum = dccp6_cksum(ip6, dh, len);
- dccp_sum = EXTRACT_16BITS(&dh->dccph_checksum);
- printf("cksum 0x%04x", dccp_sum);
- if (sum != 0) {
- (void)printf(" (incorrect (-> 0x%04x), ",in_cksum_shouldbe(dccp_sum, sum));
- } else
- (void)printf(" (correct), ");
- }
- } else
-#endif /* INET6 */
- if (vflag)
- {
- u_int16_t sum, dccp_sum;
-
- sum = dccp_cksum(ip, dh, len);
- dccp_sum = EXTRACT_16BITS(&dh->dccph_checksum);
- printf("cksum 0x%04x", dccp_sum);
- if (sum != 0) {
- (void)printf(" (incorrect (-> 0x%04x), ",in_cksum_shouldbe(dccp_sum, sum));
- } else
- (void)printf(" (correct), ");
+#endif
+ if (sum != 0)
+ (void)printf("(incorrect -> 0x%04x), ",in_cksum_shouldbe(dccp_sum, sum));
+ else
+ (void)printf("(correct), ");
}
switch (DCCPH_TYPE(dh)) {
@@ -407,9 +348,6 @@
static int dccp_print_option(const u_char *option)
{
u_int8_t optlen, i;
- u_int32_t *ts;
- u_int16_t *var16;
- u_int32_t *var32;
TCHECK(*option);
@@ -483,22 +421,17 @@
for (i = 0; i < optlen -2; i ++) printf("%02x", *(option +2 + i));
break;
case 41:
- ts = (u_int32_t *)(option + 2);
- printf("timestamp %u", (u_int32_t)ntohl(*ts));
+ printf("timestamp %u", EXTRACT_32BITS(option + 2));
break;
case 42:
- ts = (u_int32_t *)(option + 2);
- printf("timestamp_echo %u", (u_int32_t)ntohl(*ts));
+ printf("timestamp_echo %u", EXTRACT_32BITS(option + 2));
break;
case 43:
printf("elapsed_time ");
- if (optlen == 6){
- ts = (u_int32_t *)(option + 2);
- printf("%u", (u_int32_t)ntohl(*ts));
- } else {
- var16 = (u_int16_t *)(option + 2);
- printf("%u", ntohs(*var16));
- }
+ if (optlen == 6)
+ printf("%u", EXTRACT_32BITS(option + 2));
+ else
+ printf("%u", EXTRACT_16BITS(option + 2));
break;
case 44:
printf("data_checksum ");
@@ -509,12 +442,10 @@
printf("CCID option %d",*option);
switch (optlen) {
case 4:
- var16 = (u_int16_t *)(option + 2);
- printf(" %u",ntohs(*var16));
+ printf(" %u", EXTRACT_16BITS(option + 2));
break;
case 6:
- var32 = (u_int32_t *)(option + 2);
- printf(" %u",(u_int32_t)ntohl(*var32));
+ printf(" %u", EXTRACT_32BITS(option + 2));
break;
default:
break;
Modified: trunk/contrib/tcpdump/print-decnet.c
===================================================================
--- trunk/contrib/tcpdump/print-decnet.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-decnet.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-decnet.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-decnet.c,v 1.39 2005-05-06 02:16:26 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-dhcp6.c
===================================================================
--- trunk/contrib/tcpdump/print-dhcp6.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-dhcp6.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -29,18 +29,19 @@
/*
* RFC3315: DHCPv6
* supported DHCPv6 options:
- * RFC3319,
- * RFC3633,
- * RFC3646,
- * RFC3898,
- * RFC4075,
- * RFC4242,
- * RFC4280,
+ * RFC3319: Session Initiation Protocol (SIP) Servers options,
+ * RFC3633: IPv6 Prefix options,
+ * RFC3646: DNS Configuration options,
+ * RFC3898: Network Information Service (NIS) Configuration options,
+ * RFC4075: Simple Network Time Protocol (SNTP) Configuration option,
+ * RFC4242: Information Refresh Time option,
+ * RFC4280: Broadcast and Multicast Control Servers options,
+ * RFC6334: Dual-Stack Lite option,
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-dhcp6.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-dhcp6.c,v 1.37 2008-02-06 10:26:09 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -80,6 +81,8 @@
#define DH6_INFORM_REQ 11
#define DH6_RELAY_FORW 12
#define DH6_RELAY_REPLY 13
+#define DH6_LEASEQUERY 14
+#define DH6_LQ_REPLY 15
/* DHCP6 base packet format */
struct dhcp6 {
@@ -130,6 +133,10 @@
# define DH6OPT_STCODE_NOTONLINK 4
# define DH6OPT_STCODE_USEMULTICAST 5
# define DH6OPT_STCODE_NOPREFIXAVAIL 6
+# define DH6OPT_STCODE_UNKNOWNQUERYTYPE 7
+# define DH6OPT_STCODE_MALFORMEDQUERY 8
+# define DH6OPT_STCODE_NOTCONFIGURED 9
+# define DH6OPT_STCODE_NOTALLOWED 10
#define DH6OPT_RAPID_COMMIT 14
#define DH6OPT_USER_CLASS 15
#define DH6OPT_VENDOR_CLASS 16
@@ -155,6 +162,16 @@
#define DH6OPT_REMOTE_ID 37
#define DH6OPT_SUBSCRIBER_ID 38
#define DH6OPT_CLIENT_FQDN 39
+#define DH6OPT_PANA_AGENT 40
+#define DH6OPT_NEW_POSIX_TIMEZONE 41
+#define DH6OPT_NEW_TZDB_TIMEZONE 42
+#define DH6OPT_ERO 43
+#define DH6OPT_LQ_QUERY 44
+#define DH6OPT_CLIENT_DATA 45
+#define DH6OPT_CLT_TIME 46
+#define DH6OPT_LQ_RELAY_DATA 47
+#define DH6OPT_LQ_CLIENT_LINK 48
+#define DH6OPT_AFTR_NAME 64
struct dhcp6opt {
u_int16_t dh6opt_type;
@@ -162,41 +179,6 @@
/* type-dependent data follows */
};
-struct dhcp6_ia {
- u_int16_t dh6opt_ia_type;
- u_int16_t dh6opt_ia_len;
- u_int32_t dh6opt_ia_iaid;
- u_int32_t dh6opt_ia_t1;
- u_int32_t dh6opt_ia_t2;
-};
-
-struct dhcp6_ia_addr {
- u_int16_t dh6opt_ia_addr_type;
- u_int16_t dh6opt_ia_addr_len;
- struct in6_addr dh6opt_ia_addr_addr;
- u_int32_t dh6opt_ia_addr_pltime;
- u_int32_t dh6opt_ia_addr_vltime;
-} __attribute__ ((__packed__));
-
-struct dhcp6_ia_prefix {
- u_int16_t dh6opt_ia_prefix_type;
- u_int16_t dh6opt_ia_prefix_len;
- u_int32_t dh6opt_ia_prefix_pltime;
- u_int32_t dh6opt_ia_prefix_vltime;
- u_int8_t dh6opt_ia_prefix_plen;
- struct in6_addr dh6opt_ia_prefix_addr;
-} __attribute__ ((__packed__));
-
-struct dhcp6_auth {
- u_int16_t dh6opt_auth_type;
- u_int16_t dh6opt_auth_len;
- u_int8_t dh6opt_auth_proto;
- u_int8_t dh6opt_auth_alg;
- u_int8_t dh6opt_auth_rdm;
- u_int8_t dh6opt_auth_rdinfo[8];
- /* authentication information follows */
-} __attribute__ ((__packed__));
-
static const char *
dhcp6opt_name(int type)
{
@@ -203,13 +185,13 @@
static char genstr[sizeof("opt_65535") + 1]; /* XXX thread unsafe */
if (type > 65535)
- return "INVALID option";
+ return "INVALID-option";
switch(type) {
case DH6OPT_CLIENTID:
- return "client ID";
+ return "client-ID";
case DH6OPT_SERVERID:
- return "server ID";
+ return "server-ID";
case DH6OPT_IA_NA:
return "IA_NA";
case DH6OPT_IA_TA:
@@ -217,69 +199,89 @@
case DH6OPT_IA_ADDR:
return "IA_ADDR";
case DH6OPT_ORO:
- return "option request";
+ return "option-request";
case DH6OPT_PREFERENCE:
return "preference";
case DH6OPT_ELAPSED_TIME:
- return "elapsed time";
+ return "elapsed-time";
case DH6OPT_RELAY_MSG:
- return "relay message";
+ return "relay-message";
case DH6OPT_AUTH:
return "authentication";
case DH6OPT_UNICAST:
- return "server unicast";
+ return "server-unicast";
case DH6OPT_STATUS_CODE:
- return "status code";
+ return "status-code";
case DH6OPT_RAPID_COMMIT:
- return "rapid commit";
+ return "rapid-commit";
case DH6OPT_USER_CLASS:
- return "user class";
+ return "user-class";
case DH6OPT_VENDOR_CLASS:
- return "vendor class";
+ return "vendor-class";
case DH6OPT_VENDOR_OPTS:
- return "vendor-specific info";
+ return "vendor-specific-info";
case DH6OPT_INTERFACE_ID:
- return "interface ID";
+ return "interface-ID";
case DH6OPT_RECONF_MSG:
- return "reconfigure message";
+ return "reconfigure-message";
case DH6OPT_RECONF_ACCEPT:
- return "reconfigure accept";
+ return "reconfigure-accept";
case DH6OPT_SIP_SERVER_D:
- return "SIP servers domain";
+ return "SIP-servers-domain";
case DH6OPT_SIP_SERVER_A:
- return "SIP servers address";
+ return "SIP-servers-address";
case DH6OPT_DNS:
- return "DNS";
+ return "DNS-server";
case DH6OPT_DNSNAME:
- return "DNS name";
+ return "DNS-search-list";
case DH6OPT_IA_PD:
return "IA_PD";
case DH6OPT_IA_PD_PREFIX:
- return "IA_PD prefix";
+ return "IA_PD-prefix";
case DH6OPT_NTP_SERVERS:
- return "NTP Server";
+ return "NTP-server";
case DH6OPT_LIFETIME:
return "lifetime";
case DH6OPT_NIS_SERVERS:
- return "NIS server";
+ return "NIS-server";
case DH6OPT_NISP_SERVERS:
- return "NIS+ server";
+ return "NIS+-server";
case DH6OPT_NIS_NAME:
- return "NIS domain name";
+ return "NIS-domain-name";
case DH6OPT_NISP_NAME:
- return "NIS+ domain name";
+ return "NIS+-domain-name";
case DH6OPT_BCMCS_SERVER_D:
- return "BCMCS domain name";
+ return "BCMCS-domain-name";
case DH6OPT_BCMCS_SERVER_A:
- return "BCMCS server";
+ return "BCMCS-server";
case DH6OPT_GEOCONF_CIVIC:
- return "Geoconf Civic";
+ return "Geoconf-Civic";
case DH6OPT_REMOTE_ID:
- return "Remote ID";
+ return "Remote-ID";
case DH6OPT_SUBSCRIBER_ID:
- return "Subscriber ID";
+ return "Subscriber-ID";
case DH6OPT_CLIENT_FQDN:
- return "Client FQDN";
+ return "Client-FQDN";
+ case DH6OPT_PANA_AGENT:
+ return "PANA-agent";
+ case DH6OPT_NEW_POSIX_TIMEZONE:
+ return "POSIX-timezone";
+ case DH6OPT_NEW_TZDB_TIMEZONE:
+ return "POSIX-tz-database";
+ case DH6OPT_ERO:
+ return "Echo-request-option";
+ case DH6OPT_LQ_QUERY:
+ return "Lease-query";
+ case DH6OPT_CLIENT_DATA:
+ return "LQ-client-data";
+ case DH6OPT_CLT_TIME:
+ return "Clt-time";
+ case DH6OPT_LQ_RELAY_DATA:
+ return "LQ-relay-data";
+ case DH6OPT_LQ_CLIENT_LINK:
+ return "LQ-client-link";
+ case DH6OPT_AFTR_NAME:
+ return "AFTR-Name";
default:
snprintf(genstr, sizeof(genstr), "opt_%d", type);
return(genstr);
@@ -309,6 +311,14 @@
return "use multicast";
case DH6OPT_STCODE_NOPREFIXAVAIL:
return "no prefixes";
+ case DH6OPT_STCODE_UNKNOWNQUERYTYPE:
+ return "unknown query type";
+ case DH6OPT_STCODE_MALFORMEDQUERY:
+ return "malformed query";
+ case DH6OPT_STCODE_NOTCONFIGURED:
+ return "not configured";
+ case DH6OPT_STCODE_NOTALLOWED:
+ return "not allowed";
default:
snprintf(genstr, sizeof(genstr), "code%d", code);
return(genstr);
@@ -323,12 +333,7 @@
size_t i;
u_int16_t opttype;
size_t optlen;
- u_int16_t val16;
- u_int32_t val32;
- struct dhcp6_ia ia;
- struct dhcp6_ia_prefix ia_prefix;
- struct dhcp6_ia_addr ia_addr;
- struct dhcp6_auth authopt;
+ u_int8_t auth_proto;
u_int authinfolen, authrealmlen;
if (cp == ep)
@@ -337,6 +342,7 @@
if (ep < cp + sizeof(*dh6o))
goto trunc;
dh6o = (struct dhcp6opt *)cp;
+ TCHECK(*dh6o);
optlen = EXTRACT_16BITS(&dh6o->dh6opt_len);
if (ep < cp + sizeof(*dh6o) + optlen)
goto trunc;
@@ -397,29 +403,24 @@
}
break;
case DH6OPT_IA_ADDR:
- if (optlen < sizeof(ia_addr) - 4) {
+ if (optlen < 24) {
+ /*(*/
printf(" ?)");
break;
}
- memcpy(&ia_addr, (u_char *)dh6o, sizeof(ia_addr));
- printf(" %s",
- ip6addr_string(&ia_addr.dh6opt_ia_addr_addr));
- ia_addr.dh6opt_ia_addr_pltime =
- ntohl(ia_addr.dh6opt_ia_addr_pltime);
- ia_addr.dh6opt_ia_addr_vltime =
- ntohl(ia_addr.dh6opt_ia_addr_vltime);
- printf(" pltime:%lu vltime:%lu",
- (unsigned long)ia_addr.dh6opt_ia_addr_pltime,
- (unsigned long)ia_addr.dh6opt_ia_addr_vltime);
- if (optlen > sizeof(ia_addr) - 4) {
+ tp = (u_char *)(dh6o + 1);
+ printf(" %s", ip6addr_string(&tp[0]));
+ printf(" pltime:%u vltime:%u",
+ EXTRACT_32BITS(&tp[16]),
+ EXTRACT_32BITS(&tp[20]));
+ if (optlen > 24) {
/* there are sub-options */
- dhcp6opt_print((u_char *)dh6o +
- sizeof(ia_addr),
- (u_char *)(dh6o + 1) + optlen);
+ dhcp6opt_print(tp + 24, tp + optlen);
}
printf(")");
break;
case DH6OPT_ORO:
+ case DH6OPT_ERO:
if (optlen % 2) {
printf(" ?)");
break;
@@ -426,10 +427,8 @@
}
tp = (u_char *)(dh6o + 1);
for (i = 0; i < optlen; i += 2) {
- u_int16_t opt;
-
- memcpy(&opt, &tp[i], sizeof(opt));
- printf(" %s", dhcp6opt_name(ntohs(opt)));
+ printf(" %s",
+ dhcp6opt_name(EXTRACT_16BITS(&tp[i])));
}
printf(")");
break;
@@ -438,7 +437,8 @@
printf(" ?)");
break;
}
- printf(" %d)", *((u_char *)(dh6o + 1) + 1));
+ tp = (u_char *)(dh6o + 1);
+ printf(" %d)", *tp);
break;
case DH6OPT_ELAPSED_TIME:
if (optlen != 2) {
@@ -445,22 +445,23 @@
printf(" ?)");
break;
}
- memcpy(&val16, dh6o + 1, sizeof(val16));
- val16 = ntohs(val16);
- printf(" %d)", (int)val16);
+ tp = (u_char *)(dh6o + 1);
+ printf(" %d)", EXTRACT_16BITS(tp));
break;
case DH6OPT_RELAY_MSG:
printf(" (");
- dhcp6_print((const u_char *)(dh6o + 1), optlen);
+ tp = (u_char *)(dh6o + 1);
+ dhcp6_print(tp, optlen);
printf(")");
break;
case DH6OPT_AUTH:
- if (optlen < sizeof(authopt) - sizeof(*dh6o)) {
+ if (optlen < 11) {
printf(" ?)");
break;
}
- memcpy(&authopt, dh6o, sizeof(authopt));
- switch (authopt.dh6opt_auth_proto) {
+ tp = (u_char *)(dh6o + 1);
+ auth_proto = *tp;
+ switch (auth_proto) {
case DH6OPT_AUTHPROTO_DELAYED:
printf(" proto: delayed");
break;
@@ -468,37 +469,36 @@
printf(" proto: reconfigure");
break;
default:
- printf(" proto: %d",
- authopt.dh6opt_auth_proto);
+ printf(" proto: %d", auth_proto);
break;
}
- switch (authopt.dh6opt_auth_alg) {
+ tp++;
+ switch (*tp) {
case DH6OPT_AUTHALG_HMACMD5:
/* XXX: may depend on the protocol */
printf(", alg: HMAC-MD5");
break;
default:
- printf(", alg: %d", authopt.dh6opt_auth_alg);
+ printf(", alg: %d", *tp);
break;
}
- switch (authopt.dh6opt_auth_rdm) {
+ tp++;
+ switch (*tp) {
case DH6OPT_AUTHRDM_MONOCOUNTER:
printf(", RDM: mono");
break;
default:
- printf(", RDM: %d", authopt.dh6opt_auth_rdm);
+ printf(", RDM: %d", *tp);
break;
}
- tp = (u_char *)&authopt.dh6opt_auth_rdinfo;
+ tp++;
printf(", RD:");
- for (i = 0; i < 4; i++, tp += sizeof(val16))
+ for (i = 0; i < 4; i++, tp += 2)
printf(" %04x", EXTRACT_16BITS(tp));
/* protocol dependent part */
- tp = (u_char *)dh6o + sizeof(authopt);
- authinfolen =
- optlen + sizeof(*dh6o) - sizeof(authopt);
- switch (authopt.dh6opt_auth_proto) {
+ authinfolen = optlen - 11;
+ switch (auth_proto) {
case DH6OPT_AUTHPROTO_DELAYED:
if (authinfolen == 0)
break;
@@ -549,12 +549,16 @@
printf(")");
break;
case DH6OPT_INTERFACE_ID:
+ case DH6OPT_SUBSCRIBER_ID:
/*
* Since we cannot predict the encoding, print hex dump
* at most 10 characters.
*/
+ tp = (u_char *)(dh6o + 1);
+ printf(" ");
for (i = 0; i < optlen && i < 10; i++)
- printf("%02x", ((u_char *)(dh6o + 1))[i]);
+ printf("%02x", tp[i]);
+ printf("...)");
break;
case DH6OPT_RECONF_MSG:
tp = (u_char *)(dh6o + 1);
@@ -579,6 +583,8 @@
case DH6OPT_NIS_SERVERS:
case DH6OPT_NISP_SERVERS:
case DH6OPT_BCMCS_SERVER_A:
+ case DH6OPT_PANA_AGENT:
+ case DH6OPT_LQ_CLIENT_LINK:
if (optlen % 16) {
printf(" ?)");
break;
@@ -593,64 +599,148 @@
printf(" ?)");
break;
}
- memcpy(&val16, (u_char *)(dh6o + 1), sizeof(val16));
- val16 = ntohs(val16);
- printf(" %s)", dhcp6stcode(val16));
+ tp = (u_char *)(dh6o + 1);
+ printf(" %s)", dhcp6stcode(EXTRACT_16BITS(&tp[0])));
break;
case DH6OPT_IA_NA:
case DH6OPT_IA_PD:
- if (optlen < sizeof(ia) - 4) {
+ if (optlen < 12) {
printf(" ?)");
break;
}
- memcpy(&ia, (u_char *)dh6o, sizeof(ia));
- ia.dh6opt_ia_iaid = ntohl(ia.dh6opt_ia_iaid);
- ia.dh6opt_ia_t1 = ntohl(ia.dh6opt_ia_t1);
- ia.dh6opt_ia_t2 = ntohl(ia.dh6opt_ia_t2);
- printf(" IAID:%lu T1:%lu T2:%lu",
- (unsigned long)ia.dh6opt_ia_iaid,
- (unsigned long)ia.dh6opt_ia_t1,
- (unsigned long)ia.dh6opt_ia_t2);
- if (optlen > sizeof(ia) - 4) {
+ tp = (u_char *)(dh6o + 1);
+ printf(" IAID:%u T1:%u T2:%u",
+ EXTRACT_32BITS(&tp[0]),
+ EXTRACT_32BITS(&tp[4]),
+ EXTRACT_32BITS(&tp[8]));
+ if (optlen > 12) {
/* there are sub-options */
- dhcp6opt_print((u_char *)dh6o + sizeof(ia),
- (u_char *)(dh6o + 1) + optlen);
+ dhcp6opt_print(tp + 12, tp + optlen);
}
printf(")");
break;
+ case DH6OPT_IA_TA:
+ if (optlen < 4) {
+ printf(" ?)");
+ break;
+ }
+ tp = (u_char *)(dh6o + 1);
+ printf(" IAID:%u", EXTRACT_32BITS(tp));
+ if (optlen > 4) {
+ /* there are sub-options */
+ dhcp6opt_print(tp + 4, tp + optlen);
+ }
+ printf(")");
+ break;
case DH6OPT_IA_PD_PREFIX:
- if (optlen < sizeof(ia_prefix) - 4) {
+ if (optlen < 25) {
printf(" ?)");
break;
}
- memcpy(&ia_prefix, (u_char *)dh6o, sizeof(ia_prefix));
- printf(" %s/%d",
- ip6addr_string(&ia_prefix.dh6opt_ia_prefix_addr),
- ia_prefix.dh6opt_ia_prefix_plen);
- ia_prefix.dh6opt_ia_prefix_pltime =
- ntohl(ia_prefix.dh6opt_ia_prefix_pltime);
- ia_prefix.dh6opt_ia_prefix_vltime =
- ntohl(ia_prefix.dh6opt_ia_prefix_vltime);
- printf(" pltime:%lu vltime:%lu",
- (unsigned long)ia_prefix.dh6opt_ia_prefix_pltime,
- (unsigned long)ia_prefix.dh6opt_ia_prefix_vltime);
- if (optlen > sizeof(ia_prefix) - 4) {
+ tp = (u_char *)(dh6o + 1);
+ printf(" %s/%d", ip6addr_string(&tp[9]), tp[8]);
+ printf(" pltime:%u vltime:%u",
+ EXTRACT_32BITS(&tp[0]),
+ EXTRACT_32BITS(&tp[4]));
+ if (optlen > 25) {
/* there are sub-options */
- dhcp6opt_print((u_char *)dh6o +
- sizeof(ia_prefix),
- (u_char *)(dh6o + 1) + optlen);
+ dhcp6opt_print(tp + 25, tp + optlen);
}
printf(")");
break;
case DH6OPT_LIFETIME:
+ case DH6OPT_CLT_TIME:
if (optlen != 4) {
printf(" ?)");
break;
}
- memcpy(&val32, dh6o + 1, sizeof(val32));
- val32 = ntohl(val32);
- printf(" %d)", (int)val32);
+ tp = (u_char *)(dh6o + 1);
+ printf(" %d)", EXTRACT_32BITS(tp));
break;
+ case DH6OPT_REMOTE_ID:
+ if (optlen < 4) {
+ printf(" ?)");
+ break;
+ }
+ tp = (u_char *)(dh6o + 1);
+ printf(" %d ", EXTRACT_32BITS(tp));
+ /*
+ * Print hex dump first 10 characters.
+ */
+ for (i = 4; i < optlen && i < 14; i++)
+ printf("%02x", tp[i]);
+ printf("...)");
+ break;
+ case DH6OPT_LQ_QUERY:
+ if (optlen < 17) {
+ printf(" ?)");
+ break;
+ }
+ tp = (u_char *)(dh6o + 1);
+ switch (*tp) {
+ case 1:
+ printf(" by-address");
+ break;
+ case 2:
+ printf(" by-clientID");
+ break;
+ default:
+ printf(" type_%d", (int)*tp);
+ break;
+ }
+ printf(" %s", ip6addr_string(&tp[1]));
+ if (optlen > 17) {
+ /* there are query-options */
+ dhcp6opt_print(tp + 17, tp + optlen);
+ }
+ printf(")");
+ break;
+ case DH6OPT_CLIENT_DATA:
+ tp = (u_char *)(dh6o + 1);
+ if (optlen > 0) {
+ /* there are encapsulated options */
+ dhcp6opt_print(tp, tp + optlen);
+ }
+ printf(")");
+ break;
+ case DH6OPT_LQ_RELAY_DATA:
+ if (optlen < 16) {
+ printf(" ?)");
+ break;
+ }
+ tp = (u_char *)(dh6o + 1);
+ printf(" %s ", ip6addr_string(&tp[0]));
+ /*
+ * Print hex dump first 10 characters.
+ */
+ for (i = 16; i < optlen && i < 26; i++)
+ printf("%02x", tp[i]);
+ printf("...)");
+ break;
+ case DH6OPT_AFTR_NAME:
+ if (optlen < 3) {
+ printf(" ?)");
+ break;
+ }
+ tp = (u_char *)(dh6o + 1);
+ int remain_len = optlen;
+ printf(" ");
+ /* Encoding is described in section 3.1 of RFC 1035 */
+ int label_len; /* Label length */
+ while (remain_len && *tp) {
+ label_len = *tp++;
+ if (label_len < remain_len - 1) {
+ printf("%.*s", label_len, tp);
+ tp += label_len;
+ remain_len -= (label_len + 1);
+ if(*tp) printf(".");
+ } else {
+ printf(" ?");
+ break;
+ }
+ }
+ printf(")");
+ break;
default:
printf(")");
break;
@@ -725,6 +815,12 @@
case DH6_RELAY_REPLY:
name= "relay-reply";
break;
+ case DH6_LEASEQUERY:
+ name= "leasequery";
+ break;
+ case DH6_LQ_REPLY:
+ name= "leasequery-reply";
+ break;
default:
name = NULL;
break;
Modified: trunk/contrib/tcpdump/print-domain.c
===================================================================
--- trunk/contrib/tcpdump/print-domain.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-domain.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,12 +18,12 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-domain.c,v 1.12.10.1 2007/10/19 03:03:58 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-domain.c 252283 2013-06-27 00:37:59Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-domain.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.98 2007-12-09 01:40:32 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -146,7 +146,7 @@
return(i);
}
-static const u_char *
+const u_char *
ns_nprint(register const u_char *cp, register const u_char *bp)
{
register u_int i, l;
@@ -389,13 +389,22 @@
printf(" (Cache flush)");
}
- /* ignore ttl */
- cp += 2;
- /* if T_OPT, save opt_flags */
- if (typ == T_OPT)
+ if (typ == T_OPT) {
+ /* get opt flags */
+ cp += 2;
opt_flags = EXTRACT_16BITS(cp);
- /* ignore rest of ttl */
- cp += 2;
+ /* ignore rest of ttl field */
+ cp += 2;
+ } else if (vflag > 2) {
+ /* print ttl */
+ printf(" [");
+ relts_print(EXTRACT_32BITS(cp));
+ printf("]");
+ cp += 4;
+ } else {
+ /* ignore ttl */
+ cp += 4;
+ }
len = EXTRACT_16BITS(cp);
cp += 2;
@@ -410,7 +419,7 @@
case T_A:
if (!TTEST2(*cp, sizeof(struct in_addr)))
return(NULL);
- printf(" %s", ipaddr_string(cp));
+ printf(" %s", intoa(htonl(EXTRACT_32BITS(cp))));
break;
case T_NS:
@@ -477,15 +486,24 @@
#ifdef INET6
case T_AAAA:
+ {
+ struct in6_addr addr;
+ char ntop_buf[INET6_ADDRSTRLEN];
+
if (!TTEST2(*cp, sizeof(struct in6_addr)))
return(NULL);
- printf(" %s", ip6addr_string(cp));
+ memcpy(&addr, cp, sizeof(struct in6_addr));
+ printf(" %s",
+ inet_ntop(AF_INET6, &addr, ntop_buf, sizeof(ntop_buf)));
+
break;
+ }
case T_A6:
{
struct in6_addr a;
int pbit, pbyte;
+ char ntop_buf[INET6_ADDRSTRLEN];
if (!TTEST2(*cp, 1))
return(NULL);
@@ -499,7 +517,8 @@
return(NULL);
memset(&a, 0, sizeof(a));
memcpy(&a.s6_addr[pbyte], cp + 1, sizeof(a) - pbyte);
- printf(" %u %s", pbit, ip6addr_string(&a));
+ printf(" %u %s", pbit,
+ inet_ntop(AF_INET6, &a, ntop_buf, sizeof(ntop_buf)));
}
if (pbit > 0) {
putchar(' ');
Added: trunk/contrib/tcpdump/print-dtp.c
===================================================================
--- trunk/contrib/tcpdump/print-dtp.c (rev 0)
+++ trunk/contrib/tcpdump/print-dtp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 1998-2007 The TCPDUMP project
+ *
+ * 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.
+ *
+ * Dynamic Trunk Protocol (DTP)
+ *
+ * Original code by Carles Kishimoto <carles.kishimoto at gmail.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include "interface.h"
+#include "addrtoname.h"
+#include "extract.h"
+#include "nlpid.h"
+
+#define DTP_HEADER_LEN 1
+#define DTP_DOMAIN_TLV 0x0001
+#define DTP_STATUS_TLV 0x0002
+#define DTP_DTP_TYPE_TLV 0x0003
+#define DTP_NEIGHBOR_TLV 0x0004
+
+static struct tok dtp_tlv_values[] = {
+ { DTP_DOMAIN_TLV, "Domain TLV"},
+ { DTP_STATUS_TLV, "Status TLV"},
+ { DTP_DTP_TYPE_TLV, "DTP type TLV"},
+ { DTP_NEIGHBOR_TLV, "Neighbor TLV"},
+ { 0, NULL}
+};
+
+void
+dtp_print (const u_char *pptr, u_int length)
+{
+ int type, len;
+ const u_char *tptr;
+
+ if (length < DTP_HEADER_LEN)
+ goto trunc;
+
+ tptr = pptr;
+
+ if (!TTEST2(*tptr, DTP_HEADER_LEN))
+ goto trunc;
+
+ printf("DTPv%u, length %u",
+ (*tptr),
+ length);
+
+ /*
+ * In non-verbose mode, just print version.
+ */
+ if (vflag < 1) {
+ return;
+ }
+
+ tptr += DTP_HEADER_LEN;
+
+ while (tptr < (pptr+length)) {
+
+ if (!TTEST2(*tptr, 4))
+ goto trunc;
+
+ type = EXTRACT_16BITS(tptr);
+ len = EXTRACT_16BITS(tptr+2);
+
+ /* infinite loop check */
+ if (type == 0 || len == 0) {
+ return;
+ }
+
+ printf("\n\t%s (0x%04x) TLV, length %u",
+ tok2str(dtp_tlv_values, "Unknown", type),
+ type, len);
+
+ switch (type) {
+ case DTP_DOMAIN_TLV:
+ printf(", %s", tptr+4);
+ break;
+
+ case DTP_STATUS_TLV:
+ case DTP_DTP_TYPE_TLV:
+ printf(", 0x%x", *(tptr+4));
+ break;
+
+ case DTP_NEIGHBOR_TLV:
+ printf(", %s", etheraddr_string(tptr+4));
+ break;
+
+ default:
+ break;
+ }
+ tptr += len;
+ }
+
+ return;
+
+ trunc:
+ printf("[|dtp]");
+}
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 4
+ * End:
+ */
Property changes on: trunk/contrib/tcpdump/print-dtp.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-dvmrp.c
===================================================================
--- trunk/contrib/tcpdump/print-dvmrp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-dvmrp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-dvmrp.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-dvmrp.c,v 1.27 2003-11-19 09:42:04 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-eap.c
===================================================================
--- trunk/contrib/tcpdump/print-eap.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-eap.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -17,12 +17,13 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * Format and print bootp packets.
+ * Format and print EAP packets.
+ *
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-eap.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-eap.c,v 1.5 2007-10-04 16:41:33 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -35,37 +36,272 @@
#include <string.h>
#include "netdissect.h"
+#include "interface.h"
#include "addrtoname.h"
#include "extract.h"
#include "ether.h"
+#define EAP_FRAME_TYPE_PACKET 0
+#define EAP_FRAME_TYPE_START 1
+#define EAP_FRAME_TYPE_LOGOFF 2
+#define EAP_FRAME_TYPE_KEY 3
+#define EAP_FRAME_TYPE_ENCAP_ASF_ALERT 4
+
+struct eap_frame_t {
+ unsigned char version;
+ unsigned char type;
+ unsigned char length[2];
+};
+
+static const struct tok eap_frame_type_values[] = {
+ { EAP_FRAME_TYPE_PACKET, "EAP packet" },
+ { EAP_FRAME_TYPE_START, "EAPOL start" },
+ { EAP_FRAME_TYPE_LOGOFF, "EAPOL logoff" },
+ { EAP_FRAME_TYPE_KEY, "EAPOL key" },
+ { EAP_FRAME_TYPE_ENCAP_ASF_ALERT, "Encapsulated ASF alert" },
+ { 0, NULL}
+};
+
+/* RFC 3748 */
struct eap_packet_t {
- unsigned char code;
- unsigned char id;
- unsigned char length[2];
- unsigned char data[1];
+ unsigned char code;
+ unsigned char id;
+ unsigned char length[2];
};
+#define EAP_REQUEST 1
+#define EAP_RESPONSE 2
+#define EAP_SUCCESS 3
+#define EAP_FAILURE 4
+
+static const struct tok eap_code_values[] = {
+ { EAP_REQUEST, "Request" },
+ { EAP_RESPONSE, "Response" },
+ { EAP_SUCCESS, "Success" },
+ { EAP_FAILURE, "Failure" },
+ { 0, NULL}
+};
+
+#define EAP_TYPE_NO_PROPOSED 0
+#define EAP_TYPE_IDENTITY 1
+#define EAP_TYPE_NOTIFICATION 2
+#define EAP_TYPE_NAK 3
+#define EAP_TYPE_MD5_CHALLENGE 4
+#define EAP_TYPE_OTP 5
+#define EAP_TYPE_GTC 6
+#define EAP_TYPE_TLS 13 /* RFC 2716 */
+#define EAP_TYPE_SIM 18 /* RFC 4186 */
+#define EAP_TYPE_TTLS 21 /* draft-funk-eap-ttls-v0-01.txt */
+#define EAP_TYPE_AKA 23 /* RFC 4187 */
+#define EAP_TYPE_FAST 43 /* RFC 4851 */
+#define EAP_TYPE_EXPANDED_TYPES 254
+#define EAP_TYPE_EXPERIMENTAL 255
+
+static const struct tok eap_type_values[] = {
+ { EAP_TYPE_NO_PROPOSED, "No proposed" },
+ { EAP_TYPE_IDENTITY, "Identity" },
+ { EAP_TYPE_NOTIFICATION, "Notification" },
+ { EAP_TYPE_NAK, "Nak" },
+ { EAP_TYPE_MD5_CHALLENGE, "MD5-challenge" },
+ { EAP_TYPE_OTP, "OTP" },
+ { EAP_TYPE_GTC, "GTC" },
+ { EAP_TYPE_TLS, "TLS" },
+ { EAP_TYPE_SIM, "SIM" },
+ { EAP_TYPE_TTLS, "TTLS" },
+ { EAP_TYPE_AKA, "AKA" },
+ { EAP_TYPE_FAST, "FAST" },
+ { EAP_TYPE_EXPANDED_TYPES, "Expanded types" },
+ { EAP_TYPE_EXPERIMENTAL, "Experimental" },
+ { 0, NULL}
+};
+
+#define EAP_TLS_EXTRACT_BIT_L(x) (((x)&0x80)>>7)
+
+/* RFC 2716 - EAP TLS bits */
+#define EAP_TLS_FLAGS_LEN_INCLUDED (1 << 7)
+#define EAP_TLS_FLAGS_MORE_FRAGMENTS (1 << 6)
+#define EAP_TLS_FLAGS_START (1 << 5)
+
+static const struct tok eap_tls_flags_values[] = {
+ { EAP_TLS_FLAGS_LEN_INCLUDED, "L bit" },
+ { EAP_TLS_FLAGS_MORE_FRAGMENTS, "More fragments bit"},
+ { EAP_TLS_FLAGS_START, "Start bit"},
+ { 0, NULL}
+};
+
+#define EAP_TTLS_VERSION(x) ((x)&0x07)
+
+/* EAP-AKA and EAP-SIM - RFC 4187 */
+#define EAP_AKA_CHALLENGE 1
+#define EAP_AKA_AUTH_REJECT 2
+#define EAP_AKA_SYNC_FAILURE 4
+#define EAP_AKA_IDENTITY 5
+#define EAP_SIM_START 10
+#define EAP_SIM_CHALLENGE 11
+#define EAP_AKA_NOTIFICATION 12
+#define EAP_AKA_REAUTH 13
+#define EAP_AKA_CLIENT_ERROR 14
+
+static const struct tok eap_aka_subtype_values[] = {
+ { EAP_AKA_CHALLENGE, "Challenge" },
+ { EAP_AKA_AUTH_REJECT, "Auth reject" },
+ { EAP_AKA_SYNC_FAILURE, "Sync failure" },
+ { EAP_AKA_IDENTITY, "Identity" },
+ { EAP_SIM_START, "Start" },
+ { EAP_SIM_CHALLENGE, "Challenge" },
+ { EAP_AKA_NOTIFICATION, "Notification" },
+ { EAP_AKA_REAUTH, "Reauth" },
+ { EAP_AKA_CLIENT_ERROR, "Client error" },
+ { 0, NULL}
+};
+
/*
- * Print bootp requests
+ * Print EAP requests / responses
*/
void
-eap_print(netdissect_options *ndo,
- register const u_char *cp,
- u_int length _U_)
+eap_print(netdissect_options *ndo _U_,
+ register const u_char *cp,
+ u_int length _U_)
{
- const struct eap_packet_t *eap;
+ const struct eap_frame_t *eap;
+ const u_char *tptr;
+ u_int tlen, type, subtype;
+ int count=0, len;
+
+ tptr = cp;
+ tlen = length;
+ eap = (const struct eap_frame_t *)cp;
+ TCHECK(*eap);
- eap = (const struct eap_packet_t *)cp;
- ND_TCHECK(eap->data);
+ /* in non-verbose mode just lets print the basic info */
+ if (vflag < 1) {
+ printf("%s (%u) v%u, len %u",
+ tok2str(eap_frame_type_values, "unknown", eap->type),
+ eap->type,
+ eap->version,
+ EXTRACT_16BITS(eap->length));
+ return;
+ }
+
+ printf("%s (%u) v%u, len %u",
+ tok2str(eap_frame_type_values, "unknown", eap->type),
+ eap->type,
+ eap->version,
+ EXTRACT_16BITS(eap->length));
- ND_PRINT((ndo, "EAP code=%u id=%u length=%u ",
- eap->code, eap->id, (eap->length[0]<<8) + eap->length[1]));
+ tptr += sizeof(const struct eap_frame_t);
+ tlen -= sizeof(const struct eap_frame_t);
- if (!ndo->ndo_vflag)
- return;
+ switch (eap->type) {
+ case EAP_FRAME_TYPE_PACKET:
+ type = *(tptr);
+ len = EXTRACT_16BITS(tptr+2);
+ printf(", %s (%u), id %u, len %u",
+ tok2str(eap_code_values, "unknown", type),
+ type,
+ *(tptr+1),
+ len);
-trunc:
- ;
+ if (!TTEST2(*tptr, len))
+ goto trunc;
+
+ if (type <= 2) { /* For EAP_REQUEST and EAP_RESPONSE only */
+ subtype = *(tptr+4);
+ printf("\n\t\t Type %s (%u)",
+ tok2str(eap_type_values, "unknown", *(tptr+4)),
+ *(tptr+4));
+
+ switch (subtype) {
+ case EAP_TYPE_IDENTITY:
+ if (len - 5 > 0) {
+ printf(", Identity: ");
+ safeputs((const char *)tptr+5, len-5);
+ }
+ break;
+
+ case EAP_TYPE_NOTIFICATION:
+ if (len - 5 > 0) {
+ printf(", Notification: ");
+ safeputs((const char *)tptr+5, len-5);
+ }
+ break;
+
+ case EAP_TYPE_NAK:
+ count = 5;
+
+ /*
+ * one or more octets indicating
+ * the desired authentication
+ * type one octet per type
+ */
+ while (count < len) {
+ printf(" %s (%u),",
+ tok2str(eap_type_values, "unknown", *(tptr+count)),
+ *(tptr+count));
+ count++;
+ }
+ break;
+
+ case EAP_TYPE_TTLS:
+ printf(" TTLSv%u",
+ EAP_TTLS_VERSION(*(tptr+5))); /* fall through */
+ case EAP_TYPE_TLS:
+ printf(" flags [%s] 0x%02x,",
+ bittok2str(eap_tls_flags_values, "none", *(tptr+5)),
+ *(tptr+5));
+
+ if (EAP_TLS_EXTRACT_BIT_L(*(tptr+5))) {
+ printf(" len %u", EXTRACT_32BITS(tptr+6));
+ }
+ break;
+
+ case EAP_TYPE_FAST:
+ printf(" FASTv%u",
+ EAP_TTLS_VERSION(*(tptr+5)));
+ printf(" flags [%s] 0x%02x,",
+ bittok2str(eap_tls_flags_values, "none", *(tptr+5)),
+ *(tptr+5));
+
+ if (EAP_TLS_EXTRACT_BIT_L(*(tptr+5))) {
+ printf(" len %u", EXTRACT_32BITS(tptr+6));
+ }
+
+ /* FIXME - TLV attributes follow */
+ break;
+
+ case EAP_TYPE_AKA:
+ case EAP_TYPE_SIM:
+ printf(" subtype [%s] 0x%02x,",
+ tok2str(eap_aka_subtype_values, "unknown", *(tptr+5)),
+ *(tptr+5));
+
+ /* FIXME - TLV attributes follow */
+ break;
+
+ case EAP_TYPE_MD5_CHALLENGE:
+ case EAP_TYPE_OTP:
+ case EAP_TYPE_GTC:
+ case EAP_TYPE_EXPANDED_TYPES:
+ case EAP_TYPE_EXPERIMENTAL:
+ default:
+ break;
+ }
+ }
+ break;
+
+ case EAP_FRAME_TYPE_LOGOFF:
+ case EAP_FRAME_TYPE_ENCAP_ASF_ALERT:
+ default:
+ break;
+ }
+ return;
+
+ trunc:
+ printf("\n\t[|EAP]");
}
+/*
+ * Local Variables:
+ * c-basic-offset: 4
+ * End:
+ */
Modified: trunk/contrib/tcpdump/print-egp.c
===================================================================
--- trunk/contrib/tcpdump/print-egp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-egp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -20,7 +20,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-egp.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-egp.c,v 1.38 2006-02-11 22:13:24 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -226,13 +226,23 @@
printf("[|egp]");
return;
}
- (void)printf("egp: ");
+ if (!vflag) {
+ printf("EGPv%u, AS %u, seq %u, length %u",
+ egp->egp_version,
+ EXTRACT_16BITS(&egp->egp_as),
+ EXTRACT_16BITS(&egp->egp_sequence),
+ length);
+ return;
+ } else
+ printf("EGPv%u, length %u",
+ egp->egp_version,
+ length);
+
if (egp->egp_version != EGP_VERSION) {
printf("[version %d]", egp->egp_version);
return;
}
- printf("as:%d seq:%d", EXTRACT_16BITS(&egp->egp_as), EXTRACT_16BITS(&egp->egp_sequence));
type = egp->egp_type;
code = egp->egp_code;
Modified: trunk/contrib/tcpdump/print-eigrp.c
===================================================================
--- trunk/contrib/tcpdump/print-eigrp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-eigrp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -16,7 +16,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-eigrp.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-eigrp.c,v 1.7 2005-05-06 02:53:26 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -280,7 +280,7 @@
if (eigrp_tlv_len < sizeof(struct eigrp_tlv_header) ||
eigrp_tlv_len > tlen) {
- print_unknown_data(tptr+sizeof(sizeof(struct eigrp_tlv_header)),"\n\t ",tlen);
+ print_unknown_data(tptr+sizeof(struct eigrp_tlv_header),"\n\t ",tlen);
return;
}
@@ -468,7 +468,7 @@
}
/* do we want to see an additionally hexdump ? */
if (vflag > 1)
- print_unknown_data(tptr+sizeof(sizeof(struct eigrp_tlv_header)),"\n\t ",
+ print_unknown_data(tptr+sizeof(struct eigrp_tlv_header),"\n\t ",
eigrp_tlv_len-sizeof(struct eigrp_tlv_header));
tptr+=eigrp_tlv_len;
Modified: trunk/contrib/tcpdump/print-enc.c
===================================================================
--- trunk/contrib/tcpdump/print-enc.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-enc.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-enc.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-enc.c,v 1.6 2008-11-18 07:35:32 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -35,6 +35,7 @@
#include <pcap.h>
#include "interface.h"
+#include "extract.h"
#include "addrtoname.h"
#include "enc.h"
@@ -67,11 +68,22 @@
ENC_PRINT_TYPE(flags, M_AUTH, "authentic");
ENC_PRINT_TYPE(flags, M_CONF, "confidential");
/* ENC_PRINT_TYPE(flags, M_TUNNEL, "tunnel"); */
- printf("SPI 0x%08x: ", (u_int32_t)ntohl(hdr->spi));
+ printf("SPI 0x%08x: ", EXTRACT_32BITS(&hdr->spi));
length -= ENC_HDRLEN;
- /* XXX - use the address family */
- ip_print(gndo, p + ENC_HDRLEN, length);
+ caplen -= ENC_HDRLEN;
+ p += ENC_HDRLEN;
+
+ switch (hdr->af) {
+ case AF_INET:
+ ip_print(gndo, p, length);
+ break;
+#ifdef INET6
+ case AF_INET6:
+ ip6_print(gndo, p, length);
+ break;
+#endif /*INET6*/
+ }
out:
return (ENC_HDRLEN);
Modified: trunk/contrib/tcpdump/print-esp.c
===================================================================
--- trunk/contrib/tcpdump/print-esp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-esp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-esp.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.58 2007-12-07 00:03:07 mcr Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -71,14 +71,72 @@
struct sa_list {
struct sa_list *next;
struct sockaddr_storage daddr;
- u_int32_t spi;
+ u_int32_t spi; /* if == 0, then IKEv2 */
+ int initiator;
+ u_char spii[8]; /* for IKEv2 */
+ u_char spir[8];
const EVP_CIPHER *evp;
int ivlen;
int authlen;
+ u_char authsecret[256];
+ int authsecret_len;
u_char secret[256]; /* is that big enough for all secrets? */
int secretlen;
};
+/*
+ * this will adjust ndo_packetp and ndo_snapend to new buffer!
+ */
+int esp_print_decrypt_buffer_by_ikev2(netdissect_options *ndo,
+ int initiator,
+ u_char spii[8], u_char spir[8],
+ u_char *buf, u_char *end)
+{
+ struct sa_list *sa;
+ u_char *iv;
+ int len;
+ EVP_CIPHER_CTX ctx;
+
+ /* initiator arg is any non-zero value */
+ if(initiator) initiator=1;
+
+ /* see if we can find the SA, and if so, decode it */
+ for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) {
+ if (sa->spi == 0
+ && initiator == sa->initiator
+ && memcmp(spii, sa->spii, 8) == 0
+ && memcmp(spir, sa->spir, 8) == 0)
+ break;
+ }
+
+ if(sa == NULL) return 0;
+ if(sa->evp == NULL) return 0;
+
+ /*
+ * remove authenticator, and see if we still have something to
+ * work with
+ */
+ end = end - sa->authlen;
+ iv = buf;
+ buf = buf + sa->ivlen;
+ len = end-buf;
+
+ if(end <= buf) return 0;
+
+ memset(&ctx, 0, sizeof(ctx));
+ if (EVP_CipherInit(&ctx, sa->evp, sa->secret, NULL, 0) < 0)
+ (*ndo->ndo_warning)(ndo, "espkey init failed");
+ EVP_CipherInit(&ctx, NULL, NULL, iv, 0);
+ EVP_Cipher(&ctx, buf, buf, len);
+ EVP_CIPHER_CTX_cleanup(&ctx);
+
+ ndo->ndo_packetp = buf;
+ ndo->ndo_snapend = end;
+
+ return 1;
+
+}
+
static void esp_print_addsa(netdissect_options *ndo,
struct sa_list *sa, int sa_def)
{
@@ -123,13 +181,193 @@
}
/*
+ * returns size of binary, 0 on failure.
+ */
+static
+int espprint_decode_hex(netdissect_options *ndo,
+ u_char *binbuf, unsigned int binbuf_len,
+ char *hex)
+{
+ unsigned int len;
+ int i;
+
+ len = strlen(hex) / 2;
+
+ if (len > binbuf_len) {
+ (*ndo->ndo_warning)(ndo, "secret is too big: %d\n", len);
+ return 0;
+ }
+
+ i = 0;
+ while (hex[0] != '\0' && hex[1]!='\0') {
+ binbuf[i] = hex2byte(ndo, hex);
+ hex += 2;
+ i++;
+ }
+
+ return i;
+}
+
+/*
* decode the form: SPINUM at IP <tab> ALGONAME:0xsecret
+ */
+
+static int
+espprint_decode_encalgo(netdissect_options *ndo,
+ char *decode, struct sa_list *sa)
+{
+ int len;
+ size_t i;
+ const EVP_CIPHER *evp;
+ int authlen = 0;
+ char *colon, *p;
+
+ colon = strchr(decode, ':');
+ if (colon == NULL) {
+ (*ndo->ndo_warning)(ndo, "failed to decode espsecret: %s\n", decode);
+ return 0;
+ }
+ *colon = '\0';
+
+ len = colon - decode;
+ if (strlen(decode) > strlen("-hmac96") &&
+ !strcmp(decode + strlen(decode) - strlen("-hmac96"),
+ "-hmac96")) {
+ p = strstr(decode, "-hmac96");
+ *p = '\0';
+ authlen = 12;
+ }
+ if (strlen(decode) > strlen("-cbc") &&
+ !strcmp(decode + strlen(decode) - strlen("-cbc"), "-cbc")) {
+ p = strstr(decode, "-cbc");
+ *p = '\0';
+ }
+ evp = EVP_get_cipherbyname(decode);
+
+ if (!evp) {
+ (*ndo->ndo_warning)(ndo, "failed to find cipher algo %s\n", decode);
+ sa->evp = NULL;
+ sa->authlen = 0;
+ sa->ivlen = 0;
+ return 0;
+ }
+
+ sa->evp = evp;
+ sa->authlen = authlen;
+ sa->ivlen = EVP_CIPHER_iv_length(evp);
+
+ colon++;
+ if (colon[0] == '0' && colon[1] == 'x') {
+ /* decode some hex! */
+
+ colon += 2;
+ sa->secretlen = espprint_decode_hex(ndo, sa->secret, sizeof(sa->secret), colon);
+ if(sa->secretlen == 0) return 0;
+ } else {
+ i = strlen(colon);
+
+ if (i < sizeof(sa->secret)) {
+ memcpy(sa->secret, colon, i);
+ sa->secretlen = i;
+ } else {
+ memcpy(sa->secret, colon, sizeof(sa->secret));
+ sa->secretlen = sizeof(sa->secret);
+ }
+ }
+
+ return 1;
+}
+
+/*
+ * for the moment, ignore the auth algorith, just hard code the authenticator
+ * length. Need to research how openssl looks up HMAC stuff.
+ */
+static int
+espprint_decode_authalgo(netdissect_options *ndo,
+ char *decode, struct sa_list *sa)
+{
+ char *colon;
+
+ colon = strchr(decode, ':');
+ if (colon == NULL) {
+ (*ndo->ndo_warning)(ndo, "failed to decode espsecret: %s\n", decode);
+ return 0;
+ }
+ *colon = '\0';
+
+ if(strcasecmp(colon,"sha1") == 0 ||
+ strcasecmp(colon,"md5") == 0) {
+ sa->authlen = 12;
+ }
+ return 1;
+}
+
+static void esp_print_decode_ikeline(netdissect_options *ndo, char *line,
+ const char *file, int lineno)
+{
+ /* it's an IKEv2 secret, store it instead */
+ struct sa_list sa1;
+
+ char *init;
+ char *icookie, *rcookie;
+ int ilen, rlen;
+ char *authkey;
+ char *enckey;
+
+ init = strsep(&line, " \t");
+ icookie = strsep(&line, " \t");
+ rcookie = strsep(&line, " \t");
+ authkey = strsep(&line, " \t");
+ enckey = strsep(&line, " \t");
+
+ /* if any fields are missing */
+ if(!init || !icookie || !rcookie || !authkey || !enckey) {
+ (*ndo->ndo_warning)(ndo, "print_esp: failed to find all fields for ikev2 at %s:%u",
+ file, lineno);
+
+ return;
+ }
+
+ ilen = strlen(icookie);
+ rlen = strlen(rcookie);
+
+ if((init[0]!='I' && init[0]!='R')
+ || icookie[0]!='0' || icookie[1]!='x'
+ || rcookie[0]!='0' || rcookie[1]!='x'
+ || ilen!=18
+ || rlen!=18) {
+ (*ndo->ndo_warning)(ndo, "print_esp: line %s:%u improperly formatted.",
+ file, lineno);
+
+ (*ndo->ndo_warning)(ndo, "init=%s icookie=%s(%u) rcookie=%s(%u)",
+ init, icookie, ilen, rcookie, rlen);
+
+ return;
+ }
+
+ sa1.spi = 0;
+ sa1.initiator = (init[0] == 'I');
+ if(espprint_decode_hex(ndo, sa1.spii, sizeof(sa1.spii), icookie+2)!=8)
+ return;
+
+ if(espprint_decode_hex(ndo, sa1.spir, sizeof(sa1.spir), rcookie+2)!=8)
+ return;
+
+ if(!espprint_decode_encalgo(ndo, enckey, &sa1)) return;
+
+ if(!espprint_decode_authalgo(ndo, authkey, &sa1)) return;
+
+ esp_print_addsa(ndo, &sa1, FALSE);
+}
+
+/*
*
* special form: file /name
* causes us to go read from this file instead.
*
*/
-static void esp_print_decode_onesecret(netdissect_options *ndo, char *line)
+static void esp_print_decode_onesecret(netdissect_options *ndo, char *line,
+ const char *file, int lineno)
{
struct sa_list sa1;
int sa_def;
@@ -155,15 +393,18 @@
/* open file and read it */
FILE *secretfile;
char fileline[1024];
+ int lineno=0;
char *nl;
+ char *filename = line;
- secretfile = fopen(line, FOPEN_READ_TXT);
+ secretfile = fopen(filename, FOPEN_READ_TXT);
if (secretfile == NULL) {
- perror(line);
+ perror(filename);
exit(3);
}
while (fgets(fileline, sizeof(fileline)-1, secretfile) != NULL) {
+ lineno++;
/* remove newline from the line */
nl = strchr(fileline, '\n');
if (nl)
@@ -171,7 +412,7 @@
if (fileline[0] == '#') continue;
if (fileline[0] == '\0') continue;
- esp_print_decode_onesecret(ndo, fileline);
+ esp_print_decode_onesecret(ndo, fileline, filename, lineno);
}
fclose(secretfile);
@@ -178,7 +419,13 @@
return;
}
+ if (spikey && strcasecmp(spikey, "ikev2") == 0) {
+ esp_print_decode_ikeline(ndo, line, file, lineno);
+ return;
+ }
+
if (spikey) {
+
char *spistr, *foo;
u_int32_t spino;
struct sockaddr_in *sin;
@@ -185,17 +432,17 @@
#ifdef INET6
struct sockaddr_in6 *sin6;
#endif
-
+
spistr = strsep(&spikey, "@");
-
+
spino = strtoul(spistr, &foo, 0);
if (spistr == foo || !spikey) {
(*ndo->ndo_warning)(ndo, "print_esp: failed to decode spi# %s\n", foo);
return;
}
-
+
sa1.spi = spino;
-
+
sin = (struct sockaddr_in *)&sa1.daddr;
#ifdef INET6
sin6 = (struct sockaddr_in6 *)&sa1.daddr;
@@ -206,122 +453,63 @@
sin6->sin6_family = AF_INET6;
} else
#endif
- if (inet_pton(AF_INET, spikey, &sin->sin_addr) == 1) {
+ if (inet_pton(AF_INET, spikey, &sin->sin_addr) == 1) {
#ifdef HAVE_SOCKADDR_SA_LEN
- sin->sin_len = sizeof(struct sockaddr_in);
+ sin->sin_len = sizeof(struct sockaddr_in);
#endif
- sin->sin_family = AF_INET;
- } else {
- (*ndo->ndo_warning)(ndo, "print_esp: can not decode IP# %s\n", spikey);
- return;
- }
+ sin->sin_family = AF_INET;
+ } else {
+ (*ndo->ndo_warning)(ndo, "print_esp: can not decode IP# %s\n", spikey);
+ return;
+ }
}
if (decode) {
- char *colon, *p;
- u_char espsecret_key[256];
- int len;
- size_t i;
- const EVP_CIPHER *evp;
- int authlen = 0;
-
/* skip any blank spaces */
while (isspace((unsigned char)*decode))
decode++;
-
- colon = strchr(decode, ':');
- if (colon == NULL) {
- (*ndo->ndo_warning)(ndo, "failed to decode espsecret: %s\n", decode);
+
+ if(!espprint_decode_encalgo(ndo, decode, &sa1)) {
return;
}
- *colon = '\0';
-
- len = colon - decode;
- if (strlen(decode) > strlen("-hmac96") &&
- !strcmp(decode + strlen(decode) - strlen("-hmac96"),
- "-hmac96")) {
- p = strstr(decode, "-hmac96");
- *p = '\0';
- authlen = 12;
- }
- if (strlen(decode) > strlen("-cbc") &&
- !strcmp(decode + strlen(decode) - strlen("-cbc"), "-cbc")) {
- p = strstr(decode, "-cbc");
- *p = '\0';
- }
- evp = EVP_get_cipherbyname(decode);
- if (!evp) {
- (*ndo->ndo_warning)(ndo, "failed to find cipher algo %s\n", decode);
- sa1.evp = NULL;
- sa1.authlen = 0;
- sa1.ivlen = 0;
- return;
- }
-
- sa1.evp = evp;
- sa1.authlen = authlen;
- sa1.ivlen = EVP_CIPHER_iv_length(evp);
-
- colon++;
- if (colon[0] == '0' && colon[1] == 'x') {
- /* decode some hex! */
- colon += 2;
- len = strlen(colon) / 2;
-
- if (len > 256) {
- (*ndo->ndo_warning)(ndo, "secret is too big: %d\n", len);
- return;
- }
-
- i = 0;
- while (colon[0] != '\0' && colon[1]!='\0') {
- espsecret_key[i] = hex2byte(ndo, colon);
- colon += 2;
- i++;
- }
-
- memcpy(sa1.secret, espsecret_key, i);
- sa1.secretlen = i;
- } else {
- i = strlen(colon);
-
- if (i < sizeof(sa1.secret)) {
- memcpy(sa1.secret, colon, i);
- sa1.secretlen = i;
- } else {
- memcpy(sa1.secret, colon, sizeof(sa1.secret));
- sa1.secretlen = sizeof(sa1.secret);
- }
- }
}
esp_print_addsa(ndo, &sa1, sa_def);
}
-static void esp_print_decodesecret(netdissect_options *ndo)
+static void esp_init(netdissect_options *ndo _U_)
{
+
+ OpenSSL_add_all_algorithms();
+ EVP_add_cipher_alias(SN_des_ede3_cbc, "3des");
+}
+
+void esp_print_decodesecret(netdissect_options *ndo)
+{
char *line;
char *p;
+ static int initialized = 0;
+ if (!initialized) {
+ esp_init(ndo);
+ initialized = 1;
+ }
+
p = ndo->ndo_espsecret;
- while (ndo->ndo_espsecret && ndo->ndo_espsecret[0] != '\0') {
+ while (p && p[0] != '\0') {
/* pick out the first line or first thing until a comma */
- if ((line = strsep(&ndo->ndo_espsecret, "\n,")) == NULL) {
- line = ndo->ndo_espsecret;
- ndo->ndo_espsecret = NULL;
+ if ((line = strsep(&p, "\n,")) == NULL) {
+ line = p;
+ p = NULL;
}
- esp_print_decode_onesecret(ndo, line);
+ esp_print_decode_onesecret(ndo, line, "cmdline", 0);
}
+
+ ndo->ndo_espsecret = NULL;
}
-static void esp_init(netdissect_options *ndo _U_)
-{
-
- OpenSSL_add_all_algorithms();
- EVP_add_cipher_alias(SN_des_ede3_cbc, "3des");
-}
#endif
int
@@ -359,7 +547,6 @@
u_char *p;
EVP_CIPHER_CTX ctx;
int blocksz;
- static int initialized = 0;
#endif
esp = (struct newesp *)bp;
@@ -367,11 +554,6 @@
#ifdef HAVE_LIBCRYPTO
secret = NULL;
advance = 0;
-
- if (!initialized) {
- esp_init(ndo);
- initialized = 1;
- }
#endif
#if 0
@@ -418,7 +600,7 @@
/* see if we can find the SA, and if so, decode it */
for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) {
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&sa->daddr;
- if (sa->spi == ntohl(esp->esp_spi) &&
+ if (sa->spi == EXTRACT_32BITS(&esp->esp_spi) &&
sin6->sin6_family == AF_INET6 &&
memcmp(&sin6->sin6_addr, &ip6->ip6_dst,
sizeof(struct in6_addr)) == 0) {
@@ -436,7 +618,7 @@
/* see if we can find the SA, and if so, decode it */
for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) {
struct sockaddr_in *sin = (struct sockaddr_in *)&sa->daddr;
- if (sa->spi == ntohl(esp->esp_spi) &&
+ if (sa->spi == EXTRACT_32BITS(&esp->esp_spi) &&
sin->sin_family == AF_INET &&
sin->sin_addr.s_addr == ip->ip_dst.s_addr) {
break;
@@ -481,6 +663,7 @@
p = ivoff;
EVP_CipherInit(&ctx, NULL, NULL, p, 0);
EVP_Cipher(&ctx, p + ivlen, p + ivlen, ep - (p + ivlen));
+ EVP_CIPHER_CTX_cleanup(&ctx);
advance = ivoff - (u_char *)esp + ivlen;
} else
advance = sizeof(struct newesp);
Modified: trunk/contrib/tcpdump/print-ether.c
===================================================================
--- trunk/contrib/tcpdump/print-ether.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ether.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,13 +18,14 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-ether.c,v 1.17.2.1 2007/10/19 03:03:58 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-ether.c 252283 2013-06-27 00:37:59Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ether.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.106 2008-02-06 10:47:53 guy Exp $ (LBL)";
#endif
+#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -35,9 +36,9 @@
#include <pcap.h>
#include "interface.h"
+#include "extract.h"
#include "addrtoname.h"
#include "ethertype.h"
-
#include "ether.h"
const struct tok ethertype_values[] = {
@@ -46,6 +47,9 @@
{ ETHERTYPE_MPLS_MULTI, "MPLS multicast" },
{ ETHERTYPE_IPV6, "IPv6" },
{ ETHERTYPE_8021Q, "802.1Q" },
+ { ETHERTYPE_8021Q9100, "802.1Q-9100" },
+ { ETHERTYPE_8021QinQ, "802.1Q-QinQ" },
+ { ETHERTYPE_8021Q9200, "802.1Q-9200" },
{ ETHERTYPE_VMAN, "VMAN" },
{ ETHERTYPE_PUP, "PUP" },
{ ETHERTYPE_ARP, "ARP"},
@@ -58,6 +62,7 @@
{ ETHERTYPE_DN, "DN" },
{ ETHERTYPE_LAT, "LAT" },
{ ETHERTYPE_SCA, "SCA" },
+ { ETHERTYPE_TEB, "TEB" },
{ ETHERTYPE_LANBRIDGE, "Lanbridge" },
{ ETHERTYPE_DECDNS, "DEC DNS" },
{ ETHERTYPE_DECDTS, "DEC DTS" },
@@ -67,58 +72,82 @@
{ ETHERTYPE_AARP, "Appletalk ARP" },
{ ETHERTYPE_IPX, "IPX" },
{ ETHERTYPE_PPP, "PPP" },
+ { ETHERTYPE_MPCP, "MPCP" },
{ ETHERTYPE_SLOW, "Slow Protocols" },
{ ETHERTYPE_PPPOED, "PPPoE D" },
{ ETHERTYPE_PPPOES, "PPPoE S" },
{ ETHERTYPE_EAPOL, "EAPOL" },
+ { ETHERTYPE_RRCP, "RRCP" },
+ { ETHERTYPE_MS_NLB_HB, "MS NLB heartbeat" },
{ ETHERTYPE_JUMBO, "Jumbo" },
{ ETHERTYPE_LOOPBACK, "Loopback" },
{ ETHERTYPE_ISO, "OSI" },
{ ETHERTYPE_GRE_ISO, "GRE-OSI" },
+ { ETHERTYPE_CFM_OLD, "CFM (old)" },
+ { ETHERTYPE_CFM, "CFM" },
+ { ETHERTYPE_LLDP, "LLDP" },
+ { ETHERTYPE_TIPC, "TIPC"},
{ 0, NULL}
};
static inline void
-ether_hdr_print(register const u_char *bp, u_int length)
+ether_hdr_print(netdissect_options *ndo,
+ const u_char *bp, u_int length)
{
register const struct ether_header *ep;
+ u_int16_t ether_type;
+
ep = (const struct ether_header *)bp;
- (void)printf("%s > %s",
+ (void)ND_PRINT((ndo, "%s > %s",
etheraddr_string(ESRC(ep)),
- etheraddr_string(EDST(ep)));
+ etheraddr_string(EDST(ep))));
- if (!qflag) {
- if (ntohs(ep->ether_type) <= ETHERMTU)
- (void)printf(", 802.3");
+ ether_type = EXTRACT_16BITS(&ep->ether_type);
+ if (!ndo->ndo_qflag) {
+ if (ether_type <= ETHERMTU)
+ (void)ND_PRINT((ndo, ", 802.3"));
else
- (void)printf(", ethertype %s (0x%04x)",
- tok2str(ethertype_values,"Unknown", ntohs(ep->ether_type)),
- ntohs(ep->ether_type));
+ (void)ND_PRINT((ndo, ", ethertype %s (0x%04x)",
+ tok2str(ethertype_values,"Unknown", ether_type),
+ ether_type));
} else {
- if (ntohs(ep->ether_type) <= ETHERMTU)
- (void)printf(", 802.3");
+ if (ether_type <= ETHERMTU)
+ (void)ND_PRINT((ndo, ", 802.3"));
else
- (void)printf(", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", ntohs(ep->ether_type)));
+ (void)ND_PRINT((ndo, ", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", ether_type)));
}
- (void)printf(", length %u: ", length);
+ (void)ND_PRINT((ndo, ", length %u: ", length));
}
+/*
+ * Print an Ethernet frame.
+ * This might be encapsulated within another frame; we might be passed
+ * a pointer to a function that can print header information for that
+ * frame's protocol, and an argument to pass to that function.
+ */
void
-ether_print(const u_char *p, u_int length, u_int caplen)
+ether_print(netdissect_options *ndo,
+ const u_char *p, u_int length, u_int caplen,
+ void (*print_encap_header)(netdissect_options *ndo, const u_char *), const u_char *encap_header_arg)
{
struct ether_header *ep;
+ u_int orig_length;
u_short ether_type;
u_short extracted_ether_type;
- if (caplen < ETHER_HDRLEN) {
- printf("[|ether]");
+ if (caplen < ETHER_HDRLEN || length < ETHER_HDRLEN) {
+ ND_PRINT((ndo, "[|ether]"));
return;
}
- if (eflag)
- ether_hdr_print(p, length);
+ if (ndo->ndo_eflag) {
+ if (print_encap_header != NULL)
+ (*print_encap_header)(ndo, encap_header_arg);
+ ether_hdr_print(ndo, p, length);
+ }
+ orig_length = length;
length -= ETHER_HDRLEN;
caplen -= ETHER_HDRLEN;
@@ -125,8 +154,9 @@
ep = (struct ether_header *)p;
p += ETHER_HDRLEN;
- ether_type = ntohs(ep->ether_type);
+ ether_type = EXTRACT_16BITS(&ep->ether_type);
+recurse:
/*
* Is it (gag) an 802.3 encapsulation?
*/
@@ -135,21 +165,79 @@
if (llc_print(p, length, caplen, ESRC(ep), EDST(ep),
&extracted_ether_type) == 0) {
/* ether_type not known, print raw packet */
- if (!eflag)
- ether_hdr_print((u_char *)ep, length + ETHER_HDRLEN);
+ if (!ndo->ndo_eflag) {
+ if (print_encap_header != NULL)
+ (*print_encap_header)(ndo, encap_header_arg);
+ ether_hdr_print(ndo, (u_char *)ep, orig_length);
+ }
- if (!suppress_default_print)
- default_print(p, caplen);
+ if (!ndo->ndo_suppress_default_print)
+ ndo->ndo_default_print(ndo, p, caplen);
}
- } else if (ether_encap_print(ether_type, p, length, caplen,
- &extracted_ether_type) == 0) {
- /* ether_type not known, print raw packet */
- if (!eflag)
- ether_hdr_print((u_char *)ep, length + ETHER_HDRLEN);
+ } else if (ether_type == ETHERTYPE_8021Q ||
+ ether_type == ETHERTYPE_8021Q9100 ||
+ ether_type == ETHERTYPE_8021Q9200 ||
+ ether_type == ETHERTYPE_8021QinQ) {
+ /*
+ * Print VLAN information, and then go back and process
+ * the enclosed type field.
+ */
+ if (caplen < 4 || length < 4) {
+ ND_PRINT((ndo, "[|vlan]"));
+ return;
+ }
+ if (ndo->ndo_eflag) {
+ u_int16_t tag = EXTRACT_16BITS(p);
- if (!suppress_default_print)
- default_print(p, caplen);
- }
+ ND_PRINT((ndo, "vlan %u, p %u%s, ",
+ tag & 0xfff,
+ tag >> 13,
+ (tag & 0x1000) ? ", CFI" : ""));
+ }
+
+ ether_type = EXTRACT_16BITS(p + 2);
+ if (ndo->ndo_eflag && ether_type > ETHERMTU)
+ ND_PRINT((ndo, "ethertype %s, ", tok2str(ethertype_values,"0x%04x", ether_type)));
+ p += 4;
+ length -= 4;
+ caplen -= 4;
+ goto recurse;
+ } else if (ether_type == ETHERTYPE_JUMBO) {
+ /*
+ * Alteon jumbo frames.
+ * See
+ *
+ * http://tools.ietf.org/html/draft-ietf-isis-ext-eth-01
+ *
+ * which indicates that, following the type field,
+ * there's an LLC header and payload.
+ */
+ /* Try to print the LLC-layer header & higher layers */
+ if (llc_print(p, length, caplen, ESRC(ep), EDST(ep),
+ &extracted_ether_type) == 0) {
+ /* ether_type not known, print raw packet */
+ if (!ndo->ndo_eflag) {
+ if (print_encap_header != NULL)
+ (*print_encap_header)(ndo, encap_header_arg);
+ ether_hdr_print(ndo, (u_char *)ep, orig_length);
+ }
+
+ if (!ndo->ndo_suppress_default_print)
+ ndo->ndo_default_print(ndo, p, caplen);
+ }
+ } else {
+ if (ethertype_print(ndo, ether_type, p, length, caplen) == 0) {
+ /* ether_type not known, print raw packet */
+ if (!ndo->ndo_eflag) {
+ if (print_encap_header != NULL)
+ (*print_encap_header)(ndo, encap_header_arg);
+ ether_hdr_print(ndo, (u_char *)ep, orig_length);
+ }
+
+ if (!ndo->ndo_suppress_default_print)
+ ndo->ndo_default_print(ndo, p, caplen);
+ }
+ }
}
/*
@@ -159,129 +247,121 @@
* is the number of bytes actually captured.
*/
u_int
-ether_if_print(const struct pcap_pkthdr *h, const u_char *p)
+ether_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
+ const u_char *p)
{
- ether_print(p, h->len, h->caplen);
+ ether_print(ndo, p, h->len, h->caplen, NULL, NULL);
return (ETHER_HDRLEN);
}
/*
- * Prints the packet encapsulated in an Ethernet data segment
- * (or an equivalent encapsulation), given the Ethernet type code.
+ * This is the top level routine of the printer. 'p' points
+ * to the ether header of the packet, 'h->ts' is the timestamp,
+ * 'h->len' is the length of the packet off the wire, and 'h->caplen'
+ * is the number of bytes actually captured.
*
- * Returns non-zero if it can do so, zero if the ethertype is unknown.
+ * This is for DLT_NETANALYZER, which has a 4-byte pseudo-header
+ * before the Ethernet header.
+ */
+u_int
+netanalyzer_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h,
+ const u_char *p)
+{
+ /*
+ * Fail if we don't have enough data for the Hilscher pseudo-header.
+ */
+ if (h->len < 4 || h->caplen < 4) {
+ printf("[|netanalyzer]");
+ return (h->caplen);
+ }
+
+ /* Skip the pseudo-header. */
+ ether_print(ndo, p + 4, h->len - 4, h->caplen - 4, NULL, NULL);
+
+ return (4 + ETHER_HDRLEN);
+}
+
+/*
+ * This is the top level routine of the printer. 'p' points
+ * to the ether header of the packet, 'h->ts' is the timestamp,
+ * 'h->len' is the length of the packet off the wire, and 'h->caplen'
+ * is the number of bytes actually captured.
*
- * The Ethernet type code is passed through a pointer; if it was
- * ETHERTYPE_8021Q, it gets updated to be the Ethernet type of
- * the 802.1Q payload, for the benefit of lower layers that might
- * want to know what it is.
+ * This is for DLT_NETANALYZER_TRANSPARENT, which has a 4-byte
+ * pseudo-header, a 7-byte Ethernet preamble, and a 1-byte Ethernet SOF
+ * before the Ethernet header.
*/
+u_int
+netanalyzer_transparent_if_print(netdissect_options *ndo,
+ const struct pcap_pkthdr *h,
+ const u_char *p)
+{
+ /*
+ * Fail if we don't have enough data for the Hilscher pseudo-header,
+ * preamble, and SOF.
+ */
+ if (h->len < 12 || h->caplen < 12) {
+ printf("[|netanalyzer-transparent]");
+ return (h->caplen);
+ }
+ /* Skip the pseudo-header, preamble, and SOF. */
+ ether_print(ndo, p + 12, h->len - 12, h->caplen - 12, NULL, NULL);
+
+ return (12 + ETHER_HDRLEN);
+}
+
+/*
+ * Prints the packet payload, given an Ethernet type code for the payload's
+ * protocol.
+ *
+ * Returns non-zero if it can do so, zero if the ethertype is unknown.
+ */
+
int
-ether_encap_print(u_short ether_type, const u_char *p,
- u_int length, u_int caplen, u_short *extracted_ether_type)
+ethertype_print(netdissect_options *ndo,
+ u_short ether_type, const u_char *p,
+ u_int length, u_int caplen)
{
- recurse:
- *extracted_ether_type = ether_type;
-
switch (ether_type) {
case ETHERTYPE_IP:
- ip_print(gndo, p, length);
+ ip_print(ndo, p, length);
return (1);
#ifdef INET6
case ETHERTYPE_IPV6:
- ip6_print(p, length);
+ ip6_print(ndo, p, length);
return (1);
#endif /*INET6*/
case ETHERTYPE_ARP:
case ETHERTYPE_REVARP:
- arp_print(gndo, p, length, caplen);
+ arp_print(ndo, p, length, caplen);
return (1);
case ETHERTYPE_DN:
- decnet_print(p, length, caplen);
+ decnet_print(/*ndo,*/p, length, caplen);
return (1);
case ETHERTYPE_ATALK:
- if (vflag)
+ if (ndo->ndo_vflag)
fputs("et1 ", stdout);
- atalk_print(p, length);
+ atalk_print(/*ndo,*/p, length);
return (1);
case ETHERTYPE_AARP:
- aarp_print(p, length);
+ aarp_print(/*ndo,*/p, length);
return (1);
case ETHERTYPE_IPX:
- printf("(NOV-ETHII) ");
- ipx_print(p, length);
+ ND_PRINT((ndo, "(NOV-ETHII) "));
+ ipx_print(/*ndo,*/p, length);
return (1);
- case ETHERTYPE_8021Q:
- if (eflag)
- printf("vlan %u, p %u%s, ",
- ntohs(*(u_int16_t *)p) & 0xfff,
- ntohs(*(u_int16_t *)p) >> 13,
- (ntohs(*(u_int16_t *)p) & 0x1000) ? ", CFI" : "");
-
- ether_type = ntohs(*(u_int16_t *)(p + 2));
- p += 4;
- length -= 4;
- caplen -= 4;
-
- if (ether_type > ETHERMTU) {
- if (eflag)
- printf("ethertype %s, ",
- tok2str(ethertype_values,"0x%04x", ether_type));
- goto recurse;
- }
-
- *extracted_ether_type = 0;
-
- if (llc_print(p, length, caplen, p - 18, p - 12,
- extracted_ether_type) == 0) {
- ether_hdr_print(p - 18, length + 4);
-
- if (!suppress_default_print) {
- default_print(p - 18, caplen + 4);
- }
- }
-
-
- return (1);
-
- case ETHERTYPE_JUMBO:
- ether_type = ntohs(*(u_int16_t *)(p));
- p += 2;
- length -= 2;
- caplen -= 2;
-
- if (ether_type > ETHERMTU) {
- if (eflag)
- printf("ethertype %s, ",
- tok2str(ethertype_values,"0x%04x", ether_type));
- goto recurse;
- }
-
- *extracted_ether_type = 0;
-
- if (llc_print(p, length, caplen, p - 16, p - 10,
- extracted_ether_type) == 0) {
- ether_hdr_print(p - 16, length + 2);
-
- if (!suppress_default_print) {
- default_print(p - 16, caplen + 2);
- }
- }
-
- return (1);
-
case ETHERTYPE_ISO:
- isoclns_print(p+1, length-1, length-1);
+ isoclns_print(/*ndo,*/p+1, length-1, length-1);
return(1);
case ETHERTYPE_PPPOED:
@@ -288,32 +368,57 @@
case ETHERTYPE_PPPOES:
case ETHERTYPE_PPPOED2:
case ETHERTYPE_PPPOES2:
- pppoe_print(p, length);
+ pppoe_print(/*ndo,*/p, length);
return (1);
case ETHERTYPE_EAPOL:
- eap_print(gndo, p, length);
+ eap_print(ndo, p, length);
return (1);
+ case ETHERTYPE_RRCP:
+ rrcp_print(ndo, p - 14 , length + 14);
+ return (1);
+
case ETHERTYPE_PPP:
if (length) {
printf(": ");
- ppp_print(p, length);
+ ppp_print(/*ndo,*/p, length);
}
return (1);
+ case ETHERTYPE_MPCP:
+ mpcp_print(/*ndo,*/p, length);
+ return (1);
+
case ETHERTYPE_SLOW:
- slow_print(p, length);
+ slow_print(/*ndo,*/p, length);
return (1);
+ case ETHERTYPE_CFM:
+ case ETHERTYPE_CFM_OLD:
+ cfm_print(/*ndo,*/p, length);
+ return (1);
+
+ case ETHERTYPE_LLDP:
+ lldp_print(/*ndo,*/p, length);
+ return (1);
+
case ETHERTYPE_LOOPBACK:
return (1);
case ETHERTYPE_MPLS:
case ETHERTYPE_MPLS_MULTI:
- mpls_print(p, length);
+ mpls_print(/*ndo,*/p, length);
return (1);
+ case ETHERTYPE_TIPC:
+ tipc_print(ndo, p, length, caplen);
+ return (1);
+
+ case ETHERTYPE_MS_NLB_HB:
+ msnlb_print(ndo, p, length);
+ return (1);
+
case ETHERTYPE_LAT:
case ETHERTYPE_SCA:
case ETHERTYPE_MOPRC:
Modified: trunk/contrib/tcpdump/print-fddi.c
===================================================================
--- trunk/contrib/tcpdump/print-fddi.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-fddi.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,12 +18,12 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-fddi.c,v 1.11.2.1 2007/10/19 03:03:58 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-fddi.c 190207 2009-03-21 18:30:25Z rpaulo $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-fddi.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.66 2005-11-13 12:12:41 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Added: trunk/contrib/tcpdump/print-forces.c
===================================================================
--- trunk/contrib/tcpdump/print-forces.c (rev 0)
+++ trunk/contrib/tcpdump/print-forces.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,1055 @@
+/*
+ * 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.
+ *
+ * Copyright (c) 2009 Mojatatu Networks, Inc
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "interface.h"
+#include "extract.h"
+
+#include "forces.h"
+
+#define RESLEN 4
+
+int
+prestlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk _U_, int indent)
+{
+ const struct forces_tlv *tlv = (struct forces_tlv *)pptr;
+ register const u_char *tdp = (u_char *) TLV_DATA(tlv);
+ struct res_val *r = (struct res_val *)tdp;
+ u_int dlen;
+
+ /*
+ * pdatacnt_print() has ensured that len (the TLV length)
+ * >= TLV_HDRL.
+ */
+ dlen = len - TLV_HDRL;
+ if (dlen != RESLEN) {
+ printf("illegal RESULT-TLV: %d bytes!\n", dlen);
+ return -1;
+ }
+
+ TCHECK(*r);
+ if (r->result >= 0x18 && r->result <= 0xFE) {
+ printf("illegal reserved result code: 0x%x!\n", r->result);
+ return -1;
+ }
+
+ if (vflag >= 3) {
+ char *ib = indent_pr(indent, 0);
+ printf("%s Result: %s (code 0x%x)\n", ib,
+ tok2str(ForCES_errs, NULL, r->result), r->result);
+ }
+ return 0;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+int
+fdatatlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk _U_, int indent)
+{
+ const struct forces_tlv *tlv = (struct forces_tlv *)pptr;
+ u_int rlen;
+ register const u_char *tdp = (u_char *) TLV_DATA(tlv);
+ u_int16_t type;
+
+ /*
+ * pdatacnt_print() or pkeyitlv_print() has ensured that len
+ * (the TLV length) >= TLV_HDRL.
+ */
+ rlen = len - TLV_HDRL;
+ TCHECK(*tlv);
+ type = EXTRACT_16BITS(&tlv->type);
+ if (type != F_TLV_FULD) {
+ printf("Error: expecting FULLDATA!\n");
+ return -1;
+ }
+
+ if (vflag >= 3) {
+ char *ib = indent_pr(indent + 2, 1);
+ printf("%s[", &ib[1]);
+ hex_print_with_offset(ib, tdp, rlen, 0);
+ printf("\n%s]\n", &ib[1]);
+ }
+ return 0;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+int
+sdatailv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk _U_, int indent)
+{
+ u_int rlen;
+ const struct forces_ilv *ilv = (struct forces_ilv *)pptr;
+ int invilv;
+
+ if (len < ILV_HDRL) {
+ printf("Error: BAD SPARSEDATA-TLV!\n");
+ return -1;
+ }
+ rlen = len;
+ indent += 1;
+ while (rlen != 0) {
+ char *ib = indent_pr(indent, 1);
+ register const u_char *tdp = (u_char *) ILV_DATA(ilv);
+ TCHECK(*ilv);
+ invilv = ilv_valid(ilv, rlen);
+ if (invilv) {
+ printf("%s[", &ib[1]);
+ hex_print_with_offset(ib, tdp, rlen, 0);
+ printf("\n%s]\n", &ib[1]);
+ return -1;
+ }
+ if (vflag >= 3) {
+ int ilvl = EXTRACT_32BITS(&ilv->length);
+ printf("\n%s ILV: type %x length %d\n", &ib[1],
+ EXTRACT_32BITS(&ilv->type), ilvl);
+ hex_print_with_offset("\t\t[", tdp, ilvl-ILV_HDRL, 0);
+ }
+
+ ilv = GO_NXT_ILV(ilv, rlen);
+ }
+
+ return 0;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+int
+sdatatlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent)
+{
+ const struct forces_tlv *tlv = (struct forces_tlv *)pptr;
+ u_int rlen;
+ register const u_char *tdp = (u_char *) TLV_DATA(tlv);
+ u_int16_t type;
+
+ /*
+ * pdatacnt_print() has ensured that len (the TLV length)
+ * >= TLV_HDRL.
+ */
+ rlen = len - TLV_HDRL;
+ TCHECK(*tlv);
+ type = EXTRACT_16BITS(&tlv->type);
+ if (type != F_TLV_SPAD) {
+ printf("Error: expecting SPARSEDATA!\n");
+ return -1;
+ }
+
+ return sdatailv_print(tdp, rlen, op_msk, indent);
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+int
+pkeyitlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent)
+{
+ const struct forces_tlv *tlv = (struct forces_tlv *)pptr;
+ register const u_char *tdp = (u_char *) TLV_DATA(tlv);
+ register const u_char *dp = tdp + 4;
+ const struct forces_tlv *kdtlv = (struct forces_tlv *)dp;
+ u_int32_t id;
+ char *ib = indent_pr(indent, 0);
+ u_int16_t type, tll;
+ int invtlv;
+
+ TCHECK(*tdp);
+ id = EXTRACT_32BITS(tdp);
+ printf("%sKeyinfo: Key 0x%x\n", ib, id);
+ TCHECK(*kdtlv);
+ type = EXTRACT_16BITS(&kdtlv->type);
+ invtlv = tlv_valid(kdtlv, len);
+
+ if (invtlv) {
+ printf("%s TLV type 0x%x len %d\n",
+ tok2str(ForCES_TLV_err, NULL, invtlv), type,
+ EXTRACT_16BITS(&kdtlv->length));
+ return -1;
+ }
+ /*
+ * At this point, tlv_valid() has ensured that the TLV
+ * length is large enough but not too large (it doesn't
+ * go past the end of the containing TLV).
+ */
+ tll = EXTRACT_16BITS(&kdtlv->length);
+ dp = (u_char *) TLV_DATA(kdtlv);
+ return fdatatlv_print(dp, tll, op_msk, indent);
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+int
+pdatacnt_print(register const u_char * pptr, register u_int len,
+ u_int16_t IDcnt, u_int16_t op_msk, int indent)
+{
+ u_int i;
+ u_int32_t id;
+ char *ib = indent_pr(indent, 0);
+
+ for (i = 0; i < IDcnt; i++) {
+ TCHECK2(*pptr, 4);
+ if (len < 4)
+ goto trunc;
+ id = EXTRACT_32BITS(pptr);
+ if (vflag >= 3)
+ printf("%s ID#%02u: %d\n", ib, i + 1, id);
+ len -= 4;
+ pptr += 4;
+ }
+ if (len) {
+ const struct forces_tlv *pdtlv = (struct forces_tlv *)pptr;
+ u_int16_t type;
+ u_int16_t tll;
+ int pad = 0;
+ u_int aln;
+ int invtlv;
+
+ TCHECK(*pdtlv);
+ type = EXTRACT_16BITS(&pdtlv->type);
+ invtlv = tlv_valid(pdtlv, len);
+ if (invtlv) {
+ printf
+ ("%s Outstanding bytes %d for TLV type 0x%x TLV len %d\n",
+ tok2str(ForCES_TLV_err, NULL, invtlv), len, type,
+ EXTRACT_16BITS(&pdtlv->length));
+ goto pd_err;
+ }
+ /*
+ * At this point, tlv_valid() has ensured that the TLV
+ * length is large enough but not too large (it doesn't
+ * go past the end of the containing TLV).
+ */
+ tll = EXTRACT_16BITS(&pdtlv->length) - TLV_HDRL;
+ aln = F_ALN_LEN(EXTRACT_16BITS(&pdtlv->length));
+ if (aln > EXTRACT_16BITS(&pdtlv->length)) {
+ if (aln > len) {
+ printf
+ ("Invalid padded pathdata TLV type 0x%x len %d missing %d pad bytes\n",
+ type, EXTRACT_16BITS(&pdtlv->length), aln - len);
+ } else {
+ pad = aln - EXTRACT_16BITS(&pdtlv->length);
+ }
+ }
+ if (pd_valid(type)) {
+ const struct pdata_ops *ops = get_forces_pd(type);
+
+ if (vflag >= 3 && ops->v != F_TLV_PDAT) {
+ if (pad)
+ printf
+ ("%s %s (Length %d DataLen %d pad %d Bytes)\n",
+ ib, ops->s, EXTRACT_16BITS(&pdtlv->length),
+ tll, pad);
+ else
+ printf
+ ("%s %s (Length %d DataLen %d Bytes)\n",
+ ib, ops->s, EXTRACT_16BITS(&pdtlv->length),
+ tll);
+ }
+
+ chk_op_type(type, op_msk, ops->op_msk);
+
+ if (ops->print((const u_char *)pdtlv,
+ tll + pad + TLV_HDRL, op_msk,
+ indent + 2) == -1)
+ return -1;
+ len -= (TLV_HDRL + pad + tll);
+ } else {
+ printf("Invalid path data content type 0x%x len %d\n",
+ type, EXTRACT_16BITS(&pdtlv->length));
+pd_err:
+ if (EXTRACT_16BITS(&pdtlv->length)) {
+ hex_print_with_offset("Bad Data val\n\t [",
+ pptr, len, 0);
+ printf("]\n");
+
+ return -1;
+ }
+ }
+ }
+ return len;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+int
+pdata_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent)
+{
+ const struct pathdata_h *pdh = (struct pathdata_h *)pptr;
+ char *ib = indent_pr(indent, 0);
+ u_int minsize = 0;
+ int more_pd = 0;
+ u_int16_t idcnt = 0;
+
+ TCHECK(*pdh);
+ if (len < sizeof(struct pathdata_h))
+ goto trunc;
+ if (vflag >= 3) {
+ printf("\n%sPathdata: Flags 0x%x ID count %d\n",
+ ib, EXTRACT_16BITS(&pdh->pflags), EXTRACT_16BITS(&pdh->pIDcnt));
+ }
+
+ if (EXTRACT_16BITS(&pdh->pflags) & F_SELKEY) {
+ op_msk |= B_KEYIN;
+ }
+ pptr += sizeof(struct pathdata_h);
+ len -= sizeof(struct pathdata_h);
+ idcnt = EXTRACT_16BITS(&pdh->pIDcnt);
+ minsize = idcnt * 4;
+ if (len < minsize) {
+ printf("\t\t\ttruncated IDs expected %uB got %uB\n", minsize,
+ len);
+ hex_print_with_offset("\t\t\tID Data[", pptr, len, 0);
+ printf("]\n");
+ return -1;
+ }
+ more_pd = pdatacnt_print(pptr, len, idcnt, op_msk, indent);
+ if (more_pd > 0) {
+ int consumed = len - more_pd;
+ pptr += consumed;
+ len = more_pd;
+ /* XXX: Argh, recurse some more */
+ return recpdoptlv_print(pptr, len, op_msk, indent+1);
+ } else
+ return 0;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+int
+genoptlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent)
+{
+ const struct forces_tlv *pdtlv = (struct forces_tlv *)pptr;
+ u_int16_t type;
+ int tll;
+ int invtlv;
+ char *ib = indent_pr(indent, 0);
+
+ TCHECK(*pdtlv);
+ type = EXTRACT_16BITS(&pdtlv->type);
+ tll = EXTRACT_16BITS(&pdtlv->length) - TLV_HDRL;
+ invtlv = tlv_valid(pdtlv, len);
+ printf("genoptlvprint - %s TLV type 0x%x len %d\n",
+ tok2str(ForCES_TLV, NULL, type), type, EXTRACT_16BITS(&pdtlv->length));
+ if (!invtlv) {
+ /*
+ * At this point, tlv_valid() has ensured that the TLV
+ * length is large enough but not too large (it doesn't
+ * go past the end of the containing TLV).
+ */
+ register const u_char *dp = (u_char *) TLV_DATA(pdtlv);
+ if (!ttlv_valid(type)) {
+ printf("%s TLV type 0x%x len %d\n",
+ tok2str(ForCES_TLV_err, NULL, invtlv), type,
+ EXTRACT_16BITS(&pdtlv->length));
+ return -1;
+ }
+ if (vflag >= 3)
+ printf("%s%s, length %d (data length %d Bytes)",
+ ib, tok2str(ForCES_TLV, NULL, type),
+ EXTRACT_16BITS(&pdtlv->length), tll);
+
+ return pdata_print(dp, tll, op_msk, indent + 1);
+ } else {
+ printf("\t\t\tInvalid ForCES TLV type=%x", type);
+ return -1;
+ }
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+int
+recpdoptlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent)
+{
+ const struct forces_tlv *pdtlv = (struct forces_tlv *)pptr;
+ int tll;
+ int invtlv;
+ u_int16_t type;
+ register const u_char *dp;
+ char *ib;
+
+ while (len != 0) {
+ TCHECK(*pdtlv);
+ invtlv = tlv_valid(pdtlv, len);
+ if (invtlv) {
+ break;
+ }
+
+ /*
+ * At this point, tlv_valid() has ensured that the TLV
+ * length is large enough but not too large (it doesn't
+ * go past the end of the containing TLV).
+ */
+ ib = indent_pr(indent, 0);
+ type = EXTRACT_16BITS(&pdtlv->type);
+ dp = (u_char *) TLV_DATA(pdtlv);
+ tll = EXTRACT_16BITS(&pdtlv->length) - TLV_HDRL;
+
+ if (vflag >= 3)
+ printf
+ ("%s%s, length %d (data encapsulated %d Bytes)",
+ ib, tok2str(ForCES_TLV, NULL, type),
+ EXTRACT_16BITS(&pdtlv->length),
+ EXTRACT_16BITS(&pdtlv->length) - TLV_HDRL);
+
+ if (pdata_print(dp, tll, op_msk, indent + 1) == -1)
+ return -1;
+ pdtlv = GO_NXT_TLV(pdtlv, len);
+ }
+
+ if (len) {
+ printf
+ ("\n\t\tMessy PATHDATA TLV header, type (0x%x)\n\t\texcess of %d Bytes ",
+ EXTRACT_16BITS(&pdtlv->type), len - EXTRACT_16BITS(&pdtlv->length));
+ return -1;
+ }
+
+ return 0;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+int
+invoptlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk _U_, int indent)
+{
+ char *ib = indent_pr(indent, 1);
+
+ if (vflag >= 3) {
+ printf("%sData[", &ib[1]);
+ hex_print_with_offset(ib, pptr, len, 0);
+ printf("%s]\n", ib);
+ }
+ return -1;
+}
+
+int otlv_print(const struct forces_tlv *otlv, u_int16_t op_msk _U_, int indent)
+{
+ int rc = 0;
+ register const u_char *dp = (u_char *) TLV_DATA(otlv);
+ u_int16_t type;
+ int tll;
+ char *ib = indent_pr(indent, 0);
+ const struct optlv_h *ops;
+
+ /*
+ * lfbselect_print() has ensured that EXTRACT_16BITS(&otlv->length)
+ * >= TLV_HDRL.
+ */
+ TCHECK(*otlv);
+ type = EXTRACT_16BITS(&otlv->type);
+ tll = EXTRACT_16BITS(&otlv->length) - TLV_HDRL;
+ ops = get_forces_optlv_h(type);
+ if (vflag >= 3) {
+ printf("%sOper TLV %s(0x%x) length %d\n", ib, ops->s, type,
+ EXTRACT_16BITS(&otlv->length));
+ }
+ /* empty TLVs like COMMIT and TRCOMMIT are empty, we stop here .. */
+ if (!ops->flags & ZERO_TTLV) {
+ if (tll != 0) /* instead of "if (tll)" - for readability .. */
+ printf("%s: Illegal - MUST be empty\n", ops->s);
+ return rc;
+ }
+ /* rest of ops must at least have 12B {pathinfo} */
+ if (tll < OP_MIN_SIZ) {
+ printf("\t\tOper TLV %s(0x%x) length %d\n", ops->s, type,
+ EXTRACT_16BITS(&otlv->length));
+ printf("\t\tTruncated data size %d minimum required %d\n", tll,
+ OP_MIN_SIZ);
+ return invoptlv_print(dp, tll, ops->op_msk, indent);
+
+ }
+
+ rc = ops->print(dp, tll, ops->op_msk, indent + 1);
+ return rc;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+#define ASTDLN 4
+#define ASTMCD 255
+int
+asttlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk _U_, int indent)
+{
+ u_int32_t rescode;
+ u_int dlen;
+ char *ib = indent_pr(indent, 0);
+
+ /*
+ * forces_type_print() has ensured that len (the TLV length)
+ * >= TLV_HDRL.
+ */
+ dlen = len - TLV_HDRL;
+ if (dlen != ASTDLN) {
+ printf("illegal ASTresult-TLV: %d bytes!\n", dlen);
+ return -1;
+ }
+ TCHECK2(*pptr, 4);
+ rescode = EXTRACT_32BITS(pptr);
+ if (rescode > ASTMCD) {
+ printf("illegal ASTresult result code: %d!\n", rescode);
+ return -1;
+ }
+
+ if (vflag >= 3) {
+ printf("Teardown reason:\n%s", ib);
+ switch (rescode) {
+ case 0:
+ printf("Normal Teardown");
+ break;
+ case 1:
+ printf("Loss of Heartbeats");
+ break;
+ case 2:
+ printf("Out of bandwidth");
+ break;
+ case 3:
+ printf("Out of Memory");
+ break;
+ case 4:
+ printf("Application Crash");
+ break;
+ default:
+ printf("Unknown Teardown reason");
+ break;
+ }
+ printf("(%x)\n%s", rescode, ib);
+ }
+ return 0;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+#define ASRDLN 4
+#define ASRMCD 3
+int
+asrtlv_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk _U_, int indent)
+{
+ u_int32_t rescode;
+ u_int dlen;
+ char *ib = indent_pr(indent, 0);
+
+ /*
+ * forces_type_print() has ensured that len (the TLV length)
+ * >= TLV_HDRL.
+ */
+ dlen = len - TLV_HDRL;
+ if (dlen != ASRDLN) { /* id, instance, oper tlv */
+ printf("illegal ASRresult-TLV: %d bytes!\n", dlen);
+ return -1;
+ }
+ TCHECK2(*pptr, 4);
+ rescode = EXTRACT_32BITS(pptr);
+
+ if (rescode > ASRMCD) {
+ printf("illegal ASRresult result code: %d!\n", rescode);
+ return -1;
+ }
+
+ if (vflag >= 3) {
+ printf("\n%s", ib);
+ switch (rescode) {
+ case 0:
+ printf("Success ");
+ break;
+ case 1:
+ printf("FE ID invalid ");
+ break;
+ case 2:
+ printf("permission denied ");
+ break;
+ default:
+ printf("Unknown ");
+ break;
+ }
+ printf("(%x)\n%s", rescode, ib);
+ }
+ return 0;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+/*
+ * XXX - not used.
+ */
+int
+gentltlv_print(register const u_char * pptr _U_, register u_int len,
+ u_int16_t op_msk _U_, int indent _U_)
+{
+ u_int dlen = len - TLV_HDRL;
+
+ if (dlen < 4) { /* at least 32 bits must exist */
+ printf("truncated TLV: %d bytes missing! ", 4 - dlen);
+ return -1;
+ }
+ return 0;
+}
+
+#define RD_MIN 8
+int
+print_metailv(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk _U_, int indent)
+{
+ u_int dlen;
+ u_int rlen;
+ char *ib = indent_pr(indent, 0);
+ /* XXX: check header length */
+ const struct forces_ilv *ilv = (struct forces_ilv *)pptr;
+
+ /*
+ * print_metatlv() has ensured that len (what remains in the
+ * ILV) >= ILV_HDRL.
+ */
+ dlen = len - ILV_HDRL;
+ rlen = dlen;
+ TCHECK(*ilv);
+ printf("\n%sMetaID 0x%x length %d\n", ib, EXTRACT_32BITS(&ilv->type),
+ EXTRACT_32BITS(&ilv->length));
+ hex_print_with_offset("\n\t\t\t\t[", ILV_DATA(ilv), rlen, 0);
+ return 0;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+int
+print_metatlv(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk _U_, int indent)
+{
+ u_int dlen;
+ char *ib = indent_pr(indent, 0);
+ u_int rlen;
+ const struct forces_ilv *ilv = (struct forces_ilv *)pptr;
+ int invilv;
+
+ /*
+ * redirect_print() has ensured that len (what remains in the
+ * TLV) >= TLV_HDRL.
+ */
+ dlen = len - TLV_HDRL;
+ rlen = dlen;
+ printf("\n%s METADATA\n", ib);
+ while (rlen != 0) {
+ TCHECK(*ilv);
+ invilv = ilv_valid(ilv, rlen);
+ if (invilv)
+ break;
+
+ /*
+ * At this point, ilv_valid() has ensured that the ILV
+ * length is large enough but not too large (it doesn't
+ * go past the end of the containing TLV).
+ */
+ print_metailv((u_char *) ilv, rlen, 0, indent + 1);
+
+ ilv = GO_NXT_ILV(ilv, rlen);
+ }
+
+ return 0;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+/*
+*/
+int
+print_reddata(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk _U_, int indent _U_)
+{
+ u_int dlen;
+ u_int rlen;
+ int invtlv;
+ const struct forces_tlv *tlv = (struct forces_tlv *)pptr;
+
+ /*
+ * redirect_print() has ensured that len (what remains in the
+ * TLV) >= TLV_HDRL.
+ */
+ dlen = len - TLV_HDRL;
+ printf("\n\t\t Redirect DATA\n");
+ if (dlen <= RD_MIN) {
+ printf("\n\t\ttruncated Redirect data: %d bytes missing! ",
+ RD_MIN - dlen);
+ return -1;
+ }
+
+ rlen = dlen;
+ TCHECK(*tlv);
+ invtlv = tlv_valid(tlv, rlen);
+
+ if (invtlv) {
+ printf("Redir data type 0x%x len %d\n", EXTRACT_16BITS(&tlv->type),
+ EXTRACT_16BITS(&tlv->length));
+ return -1;
+ }
+
+ /*
+ * At this point, tlv_valid() has ensured that the TLV
+ * length is large enough but not too large (it doesn't
+ * go past the end of the containing TLV).
+ */
+ rlen -= TLV_HDRL;
+ hex_print_with_offset("\n\t\t\t[", TLV_DATA(tlv), rlen, 0);
+ return 0;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+int
+redirect_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk _U_, int indent)
+{
+ const struct forces_tlv *tlv = (struct forces_tlv *)pptr;
+ u_int dlen;
+ u_int rlen;
+ int invtlv;
+
+ /*
+ * forces_type_print() has ensured that len (the TLV length)
+ * >= TLV_HDRL.
+ */
+ dlen = len - TLV_HDRL;
+ if (dlen <= RD_MIN) {
+ printf("\n\t\ttruncated Redirect TLV: %d bytes missing! ",
+ RD_MIN - dlen);
+ return -1;
+ }
+
+ rlen = dlen;
+ indent += 1;
+ while (rlen != 0) {
+ TCHECK(*tlv);
+ invtlv = tlv_valid(tlv, rlen);
+ if (invtlv)
+ break;
+
+ /*
+ * At this point, tlv_valid() has ensured that the TLV
+ * length is large enough but not too large (it doesn't
+ * go past the end of the containing TLV).
+ */
+ if (EXTRACT_16BITS(&tlv->type) == F_TLV_METD) {
+ print_metatlv((u_char *) TLV_DATA(tlv), rlen, 0, indent);
+ } else if ((EXTRACT_16BITS(&tlv->type) == F_TLV_REDD)) {
+ print_reddata((u_char *) TLV_DATA(tlv), rlen, 0, indent);
+ } else {
+ printf("Unknown REDIRECT TLV 0x%x len %d\n",
+ EXTRACT_16BITS(&tlv->type), EXTRACT_16BITS(&tlv->length));
+ }
+
+ tlv = GO_NXT_TLV(tlv, rlen);
+ }
+
+ if (rlen) {
+ printf
+ ("\n\t\tMessy Redirect TLV header, type (0x%x)\n\t\texcess of %d Bytes ",
+ EXTRACT_16BITS(&tlv->type), rlen - EXTRACT_16BITS(&tlv->length));
+ return -1;
+ }
+
+ return 0;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+#define OP_OFF 8
+#define OP_MIN 12
+
+int
+lfbselect_print(register const u_char * pptr, register u_int len,
+ u_int16_t op_msk, int indent)
+{
+ const struct forces_lfbsh *lfbs;
+ const struct forces_tlv *otlv;
+ char *ib = indent_pr(indent, 0);
+ u_int dlen;
+ u_int rlen;
+ int invtlv;
+
+ /*
+ * forces_type_print() has ensured that len (the TLV length)
+ * >= TLV_HDRL.
+ */
+ dlen = len - TLV_HDRL;
+ if (dlen <= OP_MIN) { /* id, instance, oper tlv header .. */
+ printf("\n\t\ttruncated lfb selector: %d bytes missing! ",
+ OP_MIN - dlen);
+ return -1;
+ }
+
+ /*
+ * At this point, we know that dlen > OP_MIN; OP_OFF < OP_MIN, so
+ * we also know that it's > OP_OFF.
+ */
+ rlen = dlen - OP_OFF;
+
+ lfbs = (const struct forces_lfbsh *)pptr;
+ TCHECK(*lfbs);
+ if (vflag >= 3) {
+ printf("\n%s%s(Classid %x) instance %x\n",
+ ib, tok2str(ForCES_LFBs, NULL, EXTRACT_32BITS(&lfbs->class)),
+ EXTRACT_32BITS(&lfbs->class),
+ EXTRACT_32BITS(&lfbs->instance));
+ }
+
+ otlv = (struct forces_tlv *)(lfbs + 1);
+
+ indent += 1;
+ while (rlen != 0) {
+ TCHECK(*otlv);
+ invtlv = tlv_valid(otlv, rlen);
+ if (invtlv)
+ break;
+
+ /*
+ * At this point, tlv_valid() has ensured that the TLV
+ * length is large enough but not too large (it doesn't
+ * go past the end of the containing TLV).
+ */
+ if (op_valid(EXTRACT_16BITS(&otlv->type), op_msk)) {
+ otlv_print(otlv, 0, indent);
+ } else {
+ if (vflag < 3)
+ printf("\n");
+ printf
+ ("\t\tINValid oper-TLV type 0x%x length %d for this ForCES message\n",
+ EXTRACT_16BITS(&otlv->type), EXTRACT_16BITS(&otlv->length));
+ invoptlv_print((u_char *)otlv, rlen, 0, indent);
+ }
+ otlv = GO_NXT_TLV(otlv, rlen);
+ }
+
+ if (rlen) {
+ printf
+ ("\n\t\tMessy oper TLV header, type (0x%x)\n\t\texcess of %d Bytes ",
+ EXTRACT_16BITS(&otlv->type), rlen - EXTRACT_16BITS(&otlv->length));
+ return -1;
+ }
+
+ return 0;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+int
+forces_type_print(register const u_char * pptr, const struct forcesh *fhdr _U_,
+ register u_int mlen, const struct tom_h *tops)
+{
+ const struct forces_tlv *tltlv;
+ u_int rlen;
+ int invtlv;
+ int rc = 0;
+ int ttlv = 0;
+
+ /*
+ * forces_print() has already checked that mlen >= ForCES_HDRL
+ * by calling ForCES_HLN_VALID().
+ */
+ rlen = mlen - ForCES_HDRL;
+
+ if (rlen > TLV_HLN) {
+ if (tops->flags & ZERO_TTLV) {
+ printf("<0x%x>Illegal Top level TLV!\n", tops->flags);
+ return -1;
+ }
+ } else {
+ if (tops->flags & ZERO_MORE_TTLV)
+ return 0;
+ if (tops->flags & ONE_MORE_TTLV) {
+ printf("\tTop level TLV Data missing!\n");
+ return -1;
+ }
+ }
+
+ if (tops->flags & ZERO_TTLV) {
+ return 0;
+ }
+
+ ttlv = tops->flags >> 4;
+ tltlv = GET_TOP_TLV(pptr);
+
+ /*XXX: 15 top level tlvs will probably be fine
+ You are nuts if you send more ;-> */
+ while (rlen != 0) {
+ TCHECK(*tltlv);
+ invtlv = tlv_valid(tltlv, rlen);
+ if (invtlv)
+ break;
+
+ /*
+ * At this point, tlv_valid() has ensured that the TLV
+ * length is large enough but not too large (it doesn't
+ * go past the end of the packet).
+ */
+ if (!ttlv_valid(EXTRACT_16BITS(&tltlv->type))) {
+ printf("\n\tInvalid ForCES Top TLV type=0x%x",
+ EXTRACT_16BITS(&tltlv->type));
+ return -1;
+ }
+
+ if (vflag >= 3)
+ printf("\t%s, length %d (data length %d Bytes)",
+ tok2str(ForCES_TLV, NULL, EXTRACT_16BITS(&tltlv->type)),
+ EXTRACT_16BITS(&tltlv->length),
+ EXTRACT_16BITS(&tltlv->length) - TLV_HDRL);
+
+ rc = tops->print((u_char *) TLV_DATA(tltlv),
+ EXTRACT_16BITS(&tltlv->length), tops->op_msk, 9);
+ if (rc < 0) {
+ return -1;
+ }
+ tltlv = GO_NXT_TLV(tltlv, rlen);
+ ttlv--;
+ if (ttlv <= 0)
+ break;
+ }
+ /*
+ * XXX - if ttlv != 0, does that mean that the packet was too
+ * short, and didn't have *enough* TLVs in it?
+ */
+ if (rlen) {
+ printf("\tMess TopTLV header: min %u, total %d advertised %d ",
+ TLV_HDRL, rlen, EXTRACT_16BITS(&tltlv->length));
+ return -1;
+ }
+
+ return 0;
+
+trunc:
+ fputs("[|forces]", stdout);
+ return -1;
+}
+
+void forces_print(register const u_char * pptr, register u_int len)
+{
+ const struct forcesh *fhdr;
+ u_int mlen;
+ u_int32_t flg_raw;
+ const struct tom_h *tops;
+ int rc = 0;
+
+ fhdr = (const struct forcesh *)pptr;
+ TCHECK(*fhdr);
+ if (!tom_valid(fhdr->fm_tom)) {
+ printf("Invalid ForCES message type %d\n", fhdr->fm_tom);
+ goto error;
+ }
+
+ mlen = ForCES_BLN(fhdr);
+
+ tops = get_forces_tom(fhdr->fm_tom);
+ if (tops->v == TOM_RSVD) {
+ printf("\n\tUnknown ForCES message type=0x%x", fhdr->fm_tom);
+ goto error;
+ }
+
+ printf("\n\tForCES %s ", tops->s);
+ if (!ForCES_HLN_VALID(mlen, len)) {
+ printf
+ ("Illegal ForCES pkt len - min %u, total recvd %d, advertised %d ",
+ ForCES_HDRL, len, ForCES_BLN(fhdr));
+ goto error;
+ }
+
+ TCHECK2(*(pptr + 20), 4);
+ flg_raw = EXTRACT_32BITS(pptr + 20);
+ if (vflag >= 1) {
+ printf("\n\tForCES Version %d len %uB flags 0x%08x ",
+ ForCES_V(fhdr), mlen, flg_raw);
+ printf("\n\tSrcID 0x%x(%s) DstID 0x%x(%s) Correlator 0x%" PRIx64,
+ ForCES_SID(fhdr), ForCES_node(ForCES_SID(fhdr)),
+ ForCES_DID(fhdr), ForCES_node(ForCES_DID(fhdr)),
+ EXTRACT_64BITS(fhdr->fm_cor));
+
+ }
+ if (vflag >= 2) {
+ printf
+ ("\n\tForCES flags:\n\t %s(0x%x), prio=%d, %s(0x%x),\n\t %s(0x%x), %s(0x%x)\n",
+ ForCES_ACKp(ForCES_ACK(fhdr)), ForCES_ACK(fhdr),
+ ForCES_PRI(fhdr),
+ ForCES_EMp(ForCES_EM(fhdr)), ForCES_EM(fhdr),
+ ForCES_ATp(ForCES_AT(fhdr)), ForCES_AT(fhdr),
+ ForCES_TPp(ForCES_TP(fhdr)), ForCES_TP(fhdr));
+ printf
+ ("\t Extra flags: rsv(b5-7) 0x%x rsv(b13-31) 0x%x\n",
+ ForCES_RS1(fhdr), ForCES_RS2(fhdr));
+ }
+ rc = forces_type_print(pptr, fhdr, mlen, tops);
+ if (rc < 0) {
+error:
+ hex_print_with_offset("\n\t[", pptr, len, 0);
+ printf("\n\t]");
+ return;
+ }
+
+ if (vflag >= 4) {
+ printf("\n\t Raw ForCES message\n\t [");
+ hex_print_with_offset("\n\t ", pptr, len, 0);
+ printf("\n\t ]");
+ }
+ printf("\n");
+ return;
+
+trunc:
+ fputs("[|forces]", stdout);
+}
Property changes on: trunk/contrib/tcpdump/print-forces.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-fr.c
===================================================================
--- trunk/contrib/tcpdump/print-fr.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-fr.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,12 +18,12 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-fr.c,v 1.7.2.1 2007/10/19 03:03:58 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-fr.c 236192 2012-05-28 19:13:21Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#)$Header: /home/cvs/src/contrib/tcpdump/print-fr.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#)$Header: /tcpdump/master/tcpdump/print-fr.c,v 1.51 2006-06-23 22:20:32 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -102,7 +102,7 @@
/* Finds out Q.922 address length, DLCI and flags. Returns 0 on success
* save the flags dep. on address length
*/
-static int parse_q922_addr(const u_char *p, u_int *dlci, u_int *sdlcore,
+static int parse_q922_addr(const u_char *p, u_int *dlci,
u_int *addr_len, u_int8_t *flags)
{
if ((p[0] & FR_EA_BIT))
@@ -132,14 +132,26 @@
flags[3] = p[0] & 0x02;
- if (p[0] & 0x02)
- *sdlcore = p[0] >> 2;
- else
- *dlci = (*dlci << 6) | (p[0] >> 2);
+ *dlci = (*dlci << 6) | (p[0] >> 2);
return 0;
}
+char *q922_string(const u_char *p) {
+
+ static u_int dlci, addr_len;
+ static u_int8_t flags[4];
+ static char buffer[sizeof("DLCI xxxxxxxxxx")];
+ memset(buffer, 0, sizeof(buffer));
+
+ if (parse_q922_addr(p, &dlci, &addr_len, flags) == 0){
+ snprintf(buffer, sizeof(buffer), "DLCI %u", dlci);
+ }
+
+ return buffer;
+}
+
+
/* Frame Relay packet structure, with flags and CRC removed
+---------------------------+
@@ -224,13 +236,12 @@
{
u_int16_t extracted_ethertype;
u_int dlci;
- u_int sdlcore;
u_int addr_len;
u_int16_t nlpid;
u_int hdr_len;
u_int8_t flags[4];
- if (parse_q922_addr(p, &dlci, &sdlcore, &addr_len, flags)) {
+ if (parse_q922_addr(p, &dlci, &addr_len, flags)) {
printf("Q.922, invalid address");
return 0;
}
@@ -247,11 +258,10 @@
if (eflag)
fr_hdr_print(length, addr_len, dlci, flags, extracted_ethertype);
- if (ether_encap_print(extracted_ethertype,
+ if (ethertype_print(gndo, extracted_ethertype,
p+addr_len+ETHERTYPE_LEN,
length-addr_len-ETHERTYPE_LEN,
- length-addr_len-ETHERTYPE_LEN,
- &extracted_ethertype) == 0)
+ length-addr_len-ETHERTYPE_LEN) == 0)
/* ether_type not known, probably it wasn't one */
printf("UI %02x! ", p[addr_len]);
else
@@ -278,7 +288,7 @@
#ifdef INET6
case NLPID_IP6:
- ip6_print(p, length);
+ ip6_print(gndo, p, length);
break;
#endif
case NLPID_CLNP:
@@ -288,7 +298,7 @@
break;
case NLPID_SNAP:
- if (snap_print(p, length, length, &extracted_ethertype, 0) == 0) {
+ if (snap_print(p, length, length, 0) == 0) {
/* ether_type not known, print raw packet */
if (!eflag)
fr_hdr_print(length + hdr_len, hdr_len,
@@ -732,8 +742,9 @@
codeset = p[2]&0x0f; /* extract the codeset */
- if (p[2] == MSG_ANSI_LOCKING_SHIFT)
- is_ansi = 1;
+ if (p[2] == MSG_ANSI_LOCKING_SHIFT) {
+ is_ansi = 1;
+ }
printf("%s", eflag ? "" : "Q.933, ");
@@ -740,18 +751,21 @@
/* printing out header part */
printf("%s, codeset %u", is_ansi ? "ANSI" : "CCITT", codeset);
- if (p[0])
- printf(", Call Ref: 0x%02x", p[0]);
+ if (p[0]) {
+ printf(", Call Ref: 0x%02x", p[0]);
+ }
+ if (vflag) {
+ printf(", %s (0x%02x), length %u",
+ tok2str(fr_q933_msg_values,
+ "unknown message", p[1]),
+ p[1],
+ length);
+ } else {
+ printf(", %s",
+ tok2str(fr_q933_msg_values,
+ "unknown message 0x%02x", p[1]));
+ }
- if (vflag)
- printf(", %s (0x%02x), length %u",
- tok2str(fr_q933_msg_values,"unknown message",p[1]),
- p[1],
- length);
- else
- printf(", %s",
- tok2str(fr_q933_msg_values,"unknown message 0x%02x",p[1]));
-
olen = length; /* preserve the original length for non verbose mode */
if (length < (u_int)(2 - is_ansi)) {
@@ -758,49 +772,57 @@
printf("[|q.933]");
return;
}
- length -= 2 - is_ansi;
+ length -= 2 + is_ansi;
ptemp += 2 + is_ansi;
/* Loop through the rest of IE */
- while (length > sizeof(struct ie_tlv_header_t )) {
+ while (length > sizeof(struct ie_tlv_header_t)) {
ie_p = (struct ie_tlv_header_t *)ptemp;
- if (length < sizeof(struct ie_tlv_header_t ) ||
- length < sizeof(struct ie_tlv_header_t ) + ie_p->ie_len) {
- if (vflag) /* not bark if there is just a trailer */
+ if (length < sizeof(struct ie_tlv_header_t) ||
+ length < sizeof(struct ie_tlv_header_t) + ie_p->ie_len) {
+ if (vflag) { /* not bark if there is just a trailer */
printf("\n[|q.933]");
- else
+ } else {
printf(", length %u",olen);
+ }
return;
}
/* lets do the full IE parsing only in verbose mode
* however some IEs (DLCI Status, Link Verify)
- * are also intereststing in non-verbose mode */
- if (vflag)
+ * are also interestting in non-verbose mode */
+ if (vflag) {
printf("\n\t%s IE (0x%02x), length %u: ",
- tok2str(fr_q933_ie_codesets[codeset],"unknown",ie_p->ie_type),
+ tok2str(fr_q933_ie_codesets[codeset],
+ "unknown", ie_p->ie_type),
ie_p->ie_type,
ie_p->ie_len);
-
+ }
+
/* sanity check */
- if (ie_p->ie_type == 0 || ie_p->ie_len == 0)
+ if (ie_p->ie_type == 0 || ie_p->ie_len == 0) {
return;
+ }
- if (fr_q933_print_ie_codeset[codeset] != NULL)
+ if (fr_q933_print_ie_codeset[codeset] != NULL) {
ie_is_known = fr_q933_print_ie_codeset[codeset](ie_p, ptemp);
-
- if (vflag >= 1 && !ie_is_known)
+ }
+
+ if (vflag >= 1 && !ie_is_known) {
print_unknown_data(ptemp+2,"\n\t",ie_p->ie_len);
+ }
/* do we want to see a hexdump of the IE ? */
- if (vflag> 1 && ie_is_known)
+ if (vflag> 1 && ie_is_known) {
print_unknown_data(ptemp+2,"\n\t ",ie_p->ie_len);
+ }
length = length - ie_p->ie_len - 2;
ptemp = ptemp + ie_p->ie_len + 2;
}
- if (!vflag)
+ if (!vflag) {
printf(", length %u",olen);
+ }
}
static int
@@ -812,24 +834,27 @@
case FR_LMI_ANSI_REPORT_TYPE_IE: /* fall through */
case FR_LMI_CCITT_REPORT_TYPE_IE:
- if (vflag)
+ if (vflag) {
printf("%s (%u)",
tok2str(fr_lmi_report_type_ie_values,"unknown",p[2]),
p[2]);
+ }
return 1;
case FR_LMI_ANSI_LINK_VERIFY_IE: /* fall through */
case FR_LMI_CCITT_LINK_VERIFY_IE:
case FR_LMI_ANSI_LINK_VERIFY_IE_91:
- if (!vflag)
+ if (!vflag) {
printf(", ");
+ }
printf("TX Seq: %3d, RX Seq: %3d", p[2], p[3]);
return 1;
case FR_LMI_ANSI_PVC_STATUS_IE: /* fall through */
case FR_LMI_CCITT_PVC_STATUS_IE:
- if (!vflag)
+ if (!vflag) {
printf(", ");
+ }
/* now parse the DLCI information element. */
if ((ie_p->ie_len < 3) ||
(p[2] & 0x80) ||
@@ -838,14 +863,17 @@
((ie_p->ie_len == 5) && ((p[3] & 0x80) || (p[4] & 0x80) ||
!(p[5] & 0x80))) ||
(ie_p->ie_len > 5) ||
- !(p[ie_p->ie_len + 1] & 0x80))
+ !(p[ie_p->ie_len + 1] & 0x80)) {
printf("Invalid DLCI IE");
+ }
dlci = ((p[2] & 0x3F) << 4) | ((p[3] & 0x78) >> 3);
- if (ie_p->ie_len == 4)
+ if (ie_p->ie_len == 4) {
dlci = (dlci << 6) | ((p[4] & 0x7E) >> 1);
- else if (ie_p->ie_len == 5)
+ }
+ else if (ie_p->ie_len == 5) {
dlci = (dlci << 13) | (p[4] & 0x7F) | ((p[5] & 0x7E) >> 1);
+ }
printf("DLCI %u: status %s%s", dlci,
p[ie_p->ie_len + 1] & 0x8 ? "New, " : "",
Modified: trunk/contrib/tcpdump/print-frag6.c
===================================================================
--- trunk/contrib/tcpdump/print-frag6.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-frag6.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-frag6.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-frag6.c,v 1.20 2005-04-20 22:33:06 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-gre.c
===================================================================
--- trunk/contrib/tcpdump/print-gre.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-gre.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -38,7 +38,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-gre.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-gre.c,v 1.28 2005-04-06 21:32:39 mcr Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -210,7 +210,7 @@
break;
#ifdef INET6
case ETHERTYPE_IPV6:
- ip6_print(bp, len);
+ ip6_print(gndo, bp, len);
break;
#endif
case ETHERTYPE_MPLS:
@@ -225,6 +225,9 @@
case ETHERTYPE_GRE_ISO:
isoclns_print(bp, len, len);
break;
+ case ETHERTYPE_TEB:
+ ether_print(gndo, bp, len, len, NULL, NULL);
+ break;
default:
printf("gre-proto-0x%x", prot);
}
Modified: trunk/contrib/tcpdump/print-hsrp.c
===================================================================
--- trunk/contrib/tcpdump/print-hsrp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-hsrp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -31,7 +31,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-hsrp.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-hsrp.c,v 1.10 2005-05-06 07:56:52 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-icmp.c
===================================================================
--- trunk/contrib/tcpdump/print-icmp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-icmp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,12 +18,12 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-icmp.c,v 1.11.10.1 2007/10/19 03:03:58 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-icmp.c 236192 2012-05-28 19:13:21Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-icmp.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-icmp.c,v 1.87 2007-09-13 17:42:31 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -348,6 +348,7 @@
const struct icmp_mpls_ext_object_header_t *icmp_mpls_ext_object_header;
u_int hlen, dport, mtu, obj_tlen, obj_class_num, obj_ctype;
char buf[MAXHOSTNAMELEN + 100];
+ struct cksum_vec vec[1];
dp = (struct icmp *)bp;
ext_dp = (struct icmp_ext_t *)bp;
@@ -414,7 +415,7 @@
case ICMP_UNREACH_NEEDFRAG:
{
register const struct mtu_discovery *mp;
- mp = (struct mtu_discovery *)&dp->icmp_void;
+ mp = (struct mtu_discovery *)(u_char *)&dp->icmp_void;
mtu = EXTRACT_16BITS(&mp->nexthopmtu);
if (mtu) {
(void)snprintf(buf, sizeof(buf),
@@ -562,8 +563,11 @@
(void)printf("ICMP %s, length %u", str, plen);
if (vflag && !fragmented) { /* don't attempt checksumming if this is a frag */
u_int16_t sum, icmp_sum;
+ struct cksum_vec vec[1];
if (TTEST2(*bp, plen)) {
- sum = in_cksum((u_short*)dp, plen, 0);
+ vec[0].ptr = (const u_int8_t *)(void *)dp;
+ vec[0].len = plen;
+ sum = in_cksum(vec, 1);
if (sum != 0) {
icmp_sum = EXTRACT_16BITS(&dp->icmp_cksum);
(void)printf(" (wrong icmp cksum %x (->%x)!)",
@@ -600,10 +604,12 @@
* to check if an extension header is present. This is expedient,
* however not all implementations set the length field proper.
*/
- if (!ext_dp->icmp_length &&
- in_cksum((const u_short *)&ext_dp->icmp_ext_version_res,
- plen - ICMP_EXTD_MINLEN, 0)) {
- return;
+ if (!ext_dp->icmp_length) {
+ vec[0].ptr = (const u_int8_t *)(void *)&ext_dp->icmp_ext_version_res;
+ vec[0].len = plen - ICMP_EXTD_MINLEN;
+ if (in_cksum(vec, 1)) {
+ return;
+ }
}
printf("\n\tMPLS extension v%u",
@@ -619,10 +625,11 @@
}
hlen = plen - ICMP_EXTD_MINLEN;
+ vec[0].ptr = (const u_int8_t *)(void *)&ext_dp->icmp_ext_version_res;
+ vec[0].len = hlen;
printf(", checksum 0x%04x (%scorrect), length %u",
EXTRACT_16BITS(ext_dp->icmp_ext_checksum),
- in_cksum((const u_short *)&ext_dp->icmp_ext_version_res,
- plen - ICMP_EXTD_MINLEN, 0) ? "in" : "",
+ in_cksum(vec, 1) ? "in" : "",
hlen);
hlen -= 4; /* subtract common header size */
Modified: trunk/contrib/tcpdump/print-icmp6.c
===================================================================
--- trunk/contrib/tcpdump/print-icmp6.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-icmp6.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-icmp6.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.86 2008-02-05 19:36:13 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -62,6 +62,9 @@
#define abs(a) ((0 < (a)) ? (a) : -(a))
#endif
+/* inline the various RPL definitions */
+#define ND_RPL_MESSAGE 0x9B
+
static struct tok icmp6_type_values[] = {
{ ICMP6_DST_UNREACH, "destination unreachable"},
{ ICMP6_PACKET_TOO_BIG, "packet too big"},
@@ -91,6 +94,7 @@
{ ICMP6_NI_REPLY, "node information reply"},
{ MLD6_MTRACE, "mtrace message"},
{ MLD6_MTRACE_RESP, "mtrace response"},
+ { ND_RPL_MESSAGE, "RPL"},
{ 0, NULL }
};
@@ -131,6 +135,8 @@
{ ND_OPT_PREFIX_INFORMATION, "prefix info"},
{ ND_OPT_REDIRECTED_HEADER, "redirected header"},
{ ND_OPT_MTU, "mtu"},
+ { ND_OPT_RDNSS, "rdnss"},
+ { ND_OPT_DNSSL, "dnssl"},
{ ND_OPT_ADVINTERVAL, "advertisement interval"},
{ ND_OPT_HOMEAGENT_INFO, "homeagent information"},
{ ND_OPT_ROUTE_INFO, "route info"},
@@ -169,7 +175,7 @@
if (v == (u_int32_t)~0UL)
return "infinity";
else {
- snprintf(buf, sizeof(buf), "%u", v);
+ snprintf(buf, sizeof(buf), "%us", v);
return buf;
}
}
@@ -192,48 +198,110 @@
static int icmp6_cksum(const struct ip6_hdr *ip6, const struct icmp6_hdr *icp,
u_int len)
{
- size_t i;
- register const u_int16_t *sp;
- u_int32_t sum;
- union {
- struct {
- struct in6_addr ph_src;
- struct in6_addr ph_dst;
- u_int32_t ph_len;
- u_int8_t ph_zero[3];
- u_int8_t ph_nxt;
- } ph;
- u_int16_t pa[20];
- } phu;
+ return (nextproto6_cksum(ip6, (const u_int8_t *)(void *)icp, len,
+ IPPROTO_ICMPV6));
+}
- /* pseudo-header */
- memset(&phu, 0, sizeof(phu));
- phu.ph.ph_src = ip6->ip6_src;
- phu.ph.ph_dst = ip6->ip6_dst;
- phu.ph.ph_len = htonl(len);
- phu.ph.ph_nxt = IPPROTO_ICMPV6;
+enum ND_RPL_CODE {
+ ND_RPL_DIS =0x00,
+ ND_RPL_DIO =0x01,
+ ND_RPL_DAO =0x02,
+ ND_RPL_DAO_ACK=0x03,
+ ND_RPL_SDIS =0x80,
+ ND_RPL_SDIO =0x81,
+ ND_RPL_SDAO =0x82,
+ ND_RPL_SDAO_ACK=0x83,
+ ND_RPL_SCC =0x8A,
+};
- sum = 0;
- for (i = 0; i < sizeof(phu.pa) / sizeof(phu.pa[0]); i++)
- sum += phu.pa[i];
+enum ND_RPL_DIO_FLAGS {
+ ND_RPL_DIO_GROUNDED = 0x80,
+ ND_RPL_DIO_DATRIG = 0x40,
+ ND_RPL_DIO_DASUPPORT= 0x20,
+ ND_RPL_DIO_RES4 = 0x10,
+ ND_RPL_DIO_RES3 = 0x08,
+ ND_RPL_DIO_PRF_MASK = 0x07, /* 3-bit preference */
+};
- sp = (const u_int16_t *)icp;
+struct nd_rpl_dio {
+ u_int8_t rpl_flags;
+ u_int8_t rpl_seq;
+ u_int8_t rpl_instanceid;
+ u_int8_t rpl_dagrank;
+ u_int8_t rpl_dagid[16];
+};
- for (i = 0; i < (len & ~1); i += 2)
- sum += *sp++;
+static void
+rpl_print(netdissect_options *ndo,
+ const struct icmp6_hdr *hdr,
+ const u_char *bp, u_int length _U_)
+{
+ struct nd_rpl_dio *dio = (struct nd_rpl_dio *)bp;
+ int secured = hdr->icmp6_code & 0x80;
+ int basecode= hdr->icmp6_code & 0x7f;
- if (len & 1)
- sum += htons((*(const u_int8_t *)sp) << 8);
+ ND_TCHECK(dio->rpl_dagid);
- while (sum > 0xffff)
- sum = (sum & 0xffff) + (sum >> 16);
- sum = ~sum & 0xffff;
-
- return (sum);
+ if(secured) {
+ ND_PRINT((ndo, ", (SEC)"));
+ } else {
+ ND_PRINT((ndo, ", (CLR)"));
+ }
+
+ switch(basecode) {
+ case ND_RPL_DIS:
+ ND_PRINT((ndo, "DODAG Information Solicitation"));
+ if(ndo->ndo_vflag) {
+ }
+ break;
+ case ND_RPL_DIO:
+ ND_PRINT((ndo, "DODAG Information Object"));
+ if(ndo->ndo_vflag) {
+ char dagid[65];
+ char *d = dagid;
+ int i;
+ for(i=0;i<16;i++) {
+ if(isprint(dio->rpl_dagid[i])) {
+ *d++ = dio->rpl_dagid[i];
+ } else {
+ int cnt=snprintf(d,4,"0x%02x",
+ dio->rpl_dagid[i]);
+ d += cnt;
+ }
+ }
+ *d++ = '\0';
+ ND_PRINT((ndo, " [seq:%u,instance:%u,rank:%u,dagid:%s]",
+ dio->rpl_seq,
+ dio->rpl_instanceid,
+ dio->rpl_dagrank,
+ dagid));
+ }
+ break;
+ case ND_RPL_DAO:
+ ND_PRINT((ndo, "Destination Advertisement Object"));
+ if(ndo->ndo_vflag) {
+ }
+ break;
+ case ND_RPL_DAO_ACK:
+ ND_PRINT((ndo, "Destination Advertisement Object Ack"));
+ if(ndo->ndo_vflag) {
+ }
+ break;
+ default:
+ ND_PRINT((ndo, "RPL message, unknown code %u",hdr->icmp6_code));
+ break;
+ }
+ return;
+trunc:
+ ND_PRINT((ndo," [|truncated]"));
+ return;
+
}
+
void
-icmp6_print(const u_char *bp, u_int length, const u_char *bp2, int fragmented)
+icmp6_print(netdissect_options *ndo,
+ const u_char *bp, u_int length, const u_char *bp2, int fragmented)
{
const struct icmp6_hdr *dp;
const struct ip6_hdr *ip;
@@ -252,12 +320,15 @@
TCHECK(dp->icmp6_cksum);
if (vflag && !fragmented) {
- int sum = dp->icmp6_cksum;
+ u_int16_t sum, udp_sum;
if (TTEST2(bp[0], length)) {
+ udp_sum = EXTRACT_16BITS(&dp->icmp6_cksum);
sum = icmp6_cksum(ip, dp, length);
if (sum != 0)
- (void)printf("[bad icmp6 cksum %x!] ", sum);
+ (void)printf("[bad icmp6 cksum 0x%04x -> 0x%04x!] ",
+ udp_sum,
+ in_cksum_shouldbe(udp_sum, sum));
else
(void)printf("[icmp6 sum ok] ");
}
@@ -266,14 +337,13 @@
printf("ICMP6, %s", tok2str(icmp6_type_values,"unknown icmp6 type (%u)",dp->icmp6_type));
/* display cosmetics: print the packet length for printer that use the vflag now */
- if (vflag && (dp->icmp6_type ==
- ND_ROUTER_SOLICIT ||
- ND_ROUTER_ADVERT ||
- ND_NEIGHBOR_ADVERT ||
- ND_NEIGHBOR_SOLICIT ||
- ND_REDIRECT ||
- ICMP6_HADISCOV_REPLY ||
- ICMP6_MOBILEPREFIX_ADVERT ))
+ if (vflag && (dp->icmp6_type == ND_ROUTER_SOLICIT ||
+ dp->icmp6_type == ND_ROUTER_ADVERT ||
+ dp->icmp6_type == ND_NEIGHBOR_ADVERT ||
+ dp->icmp6_type == ND_NEIGHBOR_SOLICIT ||
+ dp->icmp6_type == ND_REDIRECT ||
+ dp->icmp6_type == ICMP6_HADISCOV_REPLY ||
+ dp->icmp6_type == ICMP6_MOBILEPREFIX_ADVERT ))
printf(", length %u", length);
switch (dp->icmp6_type) {
@@ -370,7 +440,7 @@
if (length == MLD_MINLEN) {
mld6_print((const u_char *)dp);
} else if (length >= MLDV2_MINLEN) {
- printf("v2 ");
+ printf(" v2");
mldv2_query_print((const u_char *)dp, length);
} else {
printf(" unknown-version (len %u) ", length);
@@ -505,6 +575,9 @@
length - MPADVLEN);
}
break;
+ case ND_RPL_MESSAGE:
+ rpl_print(ndo, dp, &dp->icmp6_data8[0], length);
+ break;
default:
printf(", length %u", length);
if (vflag <= 1)
@@ -600,12 +673,15 @@
const struct nd_opt_prefix_info *opp;
const struct icmp6_opts_redirect *opr;
const struct nd_opt_mtu *opm;
+ const struct nd_opt_rdnss *oprd;
+ const struct nd_opt_dnssl *opds;
const struct nd_opt_advinterval *opa;
const struct nd_opt_homeagent_info *oph;
const struct nd_opt_route_info *opri;
- const u_char *cp, *ep;
+ const u_char *cp, *ep, *domp;
struct in6_addr in6, *in6p;
size_t l;
+ u_int i;
#define ECHECK(var) if ((u_char *)&(var) > ep - sizeof(var)) return
@@ -644,13 +720,13 @@
case ND_OPT_PREFIX_INFORMATION:
opp = (struct nd_opt_prefix_info *)op;
TCHECK(opp->nd_opt_pi_prefix);
- printf("%s/%u%s, Flags [%s], valid time %ss",
+ printf("%s/%u%s, Flags [%s], valid time %s",
ip6addr_string(&opp->nd_opt_pi_prefix),
opp->nd_opt_pi_prefix_len,
(op->nd_opt_len != 4) ? "badlen" : "",
bittok2str(icmp6_opt_pi_flag_values, "none", opp->nd_opt_pi_flags_reserved),
get_lifetime(EXTRACT_32BITS(&opp->nd_opt_pi_valid_time)));
- printf(", pref. time %ss", get_lifetime(EXTRACT_32BITS(&opp->nd_opt_pi_preferred_time)));
+ printf(", pref. time %s", get_lifetime(EXTRACT_32BITS(&opp->nd_opt_pi_preferred_time)));
break;
case ND_OPT_REDIRECTED_HEADER:
opr = (struct icmp6_opts_redirect *)op;
@@ -664,10 +740,33 @@
EXTRACT_32BITS(&opm->nd_opt_mtu_mtu),
(op->nd_opt_len != 1) ? "bad option length" : "" );
break;
+ case ND_OPT_RDNSS:
+ oprd = (struct nd_opt_rdnss *)op;
+ l = (op->nd_opt_len - 1) / 2;
+ printf(" lifetime %us,",
+ EXTRACT_32BITS(&oprd->nd_opt_rdnss_lifetime));
+ for (i = 0; i < l; i++) {
+ TCHECK(oprd->nd_opt_rdnss_addr[i]);
+ printf(" addr: %s",
+ ip6addr_string(&oprd->nd_opt_rdnss_addr[i]));
+ }
+ break;
+ case ND_OPT_DNSSL:
+ opds = (struct nd_opt_dnssl *)op;
+ printf(" lifetime %us, domain(s):",
+ EXTRACT_32BITS(&opds->nd_opt_dnssl_lifetime));
+ domp = cp + 8; /* domain names, variable-sized, RFC1035-encoded */
+ while (domp < cp + (op->nd_opt_len << 3) && *domp != '\0')
+ {
+ printf (" ");
+ if ((domp = ns_nprint (domp, bp)) == NULL)
+ goto trunc;
+ }
+ break;
case ND_OPT_ADVINTERVAL:
opa = (struct nd_opt_advinterval *)op;
TCHECK(opa->nd_opt_adv_interval);
- printf(" %us", EXTRACT_32BITS(&opa->nd_opt_adv_interval));
+ printf(" %ums", EXTRACT_32BITS(&opa->nd_opt_adv_interval));
break;
case ND_OPT_HOMEAGENT_INFO:
oph = (struct nd_opt_homeagent_info *)op;
@@ -753,7 +852,7 @@
}
TCHECK(icp->icmp6_data16[1]);
- ngroups = ntohs(icp->icmp6_data16[1]);
+ ngroups = EXTRACT_16BITS(&icp->icmp6_data16[1]);
printf(", %d group record(s)", ngroups);
if (vflag > 0) {
/* Print the group records */
@@ -812,7 +911,7 @@
return;
}
TCHECK(icp->icmp6_data16[0]);
- mrc = ntohs(icp->icmp6_data16[0]);
+ mrc = EXTRACT_16BITS(&icp->icmp6_data16[0]);
if (mrc < 32768) {
mrt = mrc;
} else {
@@ -841,7 +940,7 @@
}
TCHECK2(bp[26], 2);
- nsrcs = ntohs(*(u_short *)&bp[26]);
+ nsrcs = EXTRACT_16BITS(&bp[26]);
if (nsrcs > 0) {
if (len < 28 + nsrcs * sizeof(struct in6_addr))
printf(" [invalid number of sources]");
@@ -863,7 +962,7 @@
return;
}
-void
+static void
dnsname_print(const u_char *cp, const u_char *ep)
{
int i;
@@ -1192,9 +1291,9 @@
F(ICMP6_RR_FLAGS_PREVDONE, "P"));
}
printf("seg=%u,", rr6->rr_segnum);
- printf("maxdelay=%u", rr6->rr_maxdelay);
+ printf("maxdelay=%u", EXTRACT_16BITS(&rr6->rr_maxdelay));
if (rr6->rr_reserved)
- printf("rsvd=0x%x", EXTRACT_16BITS(&rr6->rr_reserved));
+ printf("rsvd=0x%x", EXTRACT_32BITS(&rr6->rr_reserved));
/*[*/
printf("]");
#undef F
Modified: trunk/contrib/tcpdump/print-igmp.c
===================================================================
--- trunk/contrib/tcpdump/print-igmp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-igmp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-igmp.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-igmp.c,v 1.15 2004-03-24 00:59:16 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -227,7 +227,11 @@
}
if (mrc != 100) {
(void)printf(" [max resp time ");
- relts_print(mrt);
+ if (mrt < 600) {
+ (void)printf("%.1fs", mrt * 0.1);
+ } else {
+ relts_print(mrt / 10);
+ }
(void)printf("]");
}
TCHECK2(bp[4], 4);
@@ -259,6 +263,8 @@
void
igmp_print(register const u_char *bp, register u_int len)
{
+ struct cksum_vec vec[1];
+
if (qflag) {
(void)printf("igmp");
return;
@@ -327,7 +333,9 @@
if (vflag && TTEST2(bp[0], len)) {
/* Check the IGMP checksum */
- if (in_cksum((const u_short*)bp, len, 0))
+ vec[0].ptr = bp;
+ vec[0].len = len;
+ if (in_cksum(vec, 1))
printf(" bad igmp cksum %x!", EXTRACT_16BITS(&bp[2]));
}
return;
Modified: trunk/contrib/tcpdump/print-igrp.c
===================================================================
--- trunk/contrib/tcpdump/print-igrp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-igrp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-igrp.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-igrp.c,v 1.21 2005-04-20 21:01:56 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-ip.c
===================================================================
--- trunk/contrib/tcpdump/print-ip.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ip.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,12 +18,12 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-ip.c,v 1.14.2.1 2007/10/19 03:03:59 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-ip.c 252283 2013-06-27 00:37:59Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ip.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.159 2007-09-14 01:29:28 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -89,7 +89,7 @@
* This is used for UDP and TCP pseudo-header in the checksum
* calculation.
*/
-u_int32_t
+static u_int32_t
ip_finddst(const struct ip *ip)
{
int length;
@@ -131,6 +131,39 @@
return retval;
}
+/*
+ * Compute a V4-style checksum by building a pseudoheader.
+ */
+int
+nextproto4_cksum(const struct ip *ip, const u_int8_t *data,
+ u_int len, u_int next_proto)
+{
+ struct phdr {
+ u_int32_t src;
+ u_int32_t dst;
+ u_char mbz;
+ u_char proto;
+ u_int16_t len;
+ } ph;
+ struct cksum_vec vec[2];
+
+ /* pseudo-header.. */
+ ph.len = htons((u_int16_t)len);
+ ph.mbz = 0;
+ ph.proto = next_proto;
+ memcpy(&ph.src, &ip->ip_src.s_addr, sizeof(u_int32_t));
+ if (IP_HL(ip) == 5)
+ memcpy(&ph.dst, &ip->ip_dst.s_addr, sizeof(u_int32_t));
+ else
+ ph.dst = ip_finddst(ip);
+
+ vec[0].ptr = (const u_int8_t *)(void *)&ph;
+ vec[0].len = sizeof(ph);
+ vec[1].ptr = data;
+ vec[1].len = len;
+ return (in_cksum(vec, 2));
+}
+
static void
ip_printts(register const u_char *cp, u_int length)
{
@@ -270,92 +303,6 @@
printf("[|ip]");
}
-/*
- * compute an IP header checksum.
- * don't modifiy the packet.
- */
-u_short
-in_cksum(const u_short *addr, register u_int len, int csum)
-{
- int nleft = len;
- const u_short *w = addr;
- u_short answer;
- int sum = csum;
-
- /*
- * Our algorithm is simple, using a 32 bit accumulator (sum),
- * we add sequential 16 bit words to it, and at the end, fold
- * back all the carry bits from the top 16 bits into the lower
- * 16 bits.
- */
- while (nleft > 1) {
- sum += *w++;
- nleft -= 2;
- }
- if (nleft == 1)
- sum += htons(*(u_char *)w<<8);
-
- /*
- * add back carry outs from top 16 bits to low 16 bits
- */
- sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */
- sum += (sum >> 16); /* add carry */
- answer = ~sum; /* truncate to 16 bits */
- return (answer);
-}
-
-/*
- * Given the host-byte-order value of the checksum field in a packet
- * header, and the network-byte-order computed checksum of the data
- * that the checksum covers (including the checksum itself), compute
- * what the checksum field *should* have been.
- */
-u_int16_t
-in_cksum_shouldbe(u_int16_t sum, u_int16_t computed_sum)
-{
- u_int32_t shouldbe;
-
- /*
- * The value that should have gone into the checksum field
- * is the negative of the value gotten by summing up everything
- * *but* the checksum field.
- *
- * We can compute that by subtracting the value of the checksum
- * field from the sum of all the data in the packet, and then
- * computing the negative of that value.
- *
- * "sum" is the value of the checksum field, and "computed_sum"
- * is the negative of the sum of all the data in the packets,
- * so that's -(-computed_sum - sum), or (sum + computed_sum).
- *
- * All the arithmetic in question is one's complement, so the
- * addition must include an end-around carry; we do this by
- * doing the arithmetic in 32 bits (with no sign-extension),
- * and then adding the upper 16 bits of the sum, which contain
- * the carry, to the lower 16 bits of the sum, and then do it
- * again in case *that* sum produced a carry.
- *
- * As RFC 1071 notes, the checksum can be computed without
- * byte-swapping the 16-bit words; summing 16-bit words
- * on a big-endian machine gives a big-endian checksum, which
- * can be directly stuffed into the big-endian checksum fields
- * in protocol headers, and summing words on a little-endian
- * machine gives a little-endian checksum, which must be
- * byte-swapped before being stuffed into a big-endian checksum
- * field.
- *
- * "computed_sum" is a network-byte-order value, so we must put
- * it in host byte order before subtracting it from the
- * host-byte-order value from the header; the adjusted checksum
- * will be in host byte order, which is what we'll return.
- */
- shouldbe = sum;
- shouldbe += ntohs(computed_sum);
- shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16);
- shouldbe = (shouldbe & 0xFFFF) + (shouldbe >> 16);
- return shouldbe;
-}
-
#define IP_RES 0x8000
static struct tok ip_frag_values[] = {
@@ -378,6 +325,7 @@
struct ip_print_demux_state *ipds)
{
struct protoent *proto;
+ struct cksum_vec vec[1];
again:
switch (ipds->nh) {
@@ -404,7 +352,7 @@
ipds->nh = enh & 0xff;
goto again;
}
-
+
case IPPROTO_IPCOMP:
{
int enh;
@@ -424,25 +372,25 @@
case IPPROTO_DCCP:
dccp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len);
break;
-
+
case IPPROTO_TCP:
/* pass on the MF bit plus the offset to detect fragments */
tcp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
ipds->off & (IP_MF|IP_OFFMASK));
break;
-
+
case IPPROTO_UDP:
/* pass on the MF bit plus the offset to detect fragments */
udp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
ipds->off & (IP_MF|IP_OFFMASK));
break;
-
+
case IPPROTO_ICMP:
/* pass on the MF bit plus the offset to detect fragments */
icmp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
ipds->off & (IP_MF|IP_OFFMASK));
break;
-
+
case IPPROTO_PIGP:
/*
* XXX - the current IANA protocol number assignments
@@ -459,11 +407,11 @@
*/
igrp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip);
break;
-
+
case IPPROTO_EIGRP:
eigrp_print(ipds->cp, ipds->len);
break;
-
+
case IPPROTO_ND:
ND_PRINT((ndo, " nd %d", ipds->len));
break;
@@ -482,17 +430,17 @@
case IPPROTO_IPV4:
/* DVMRP multicast tunnel (ip-in-ip encapsulation) */
- ip_print(gndo, ipds->cp, ipds->len);
+ ip_print(ndo, ipds->cp, ipds->len);
if (! vflag) {
ND_PRINT((ndo, " (ipip-proto-4)"));
return;
}
break;
-
+
#ifdef INET6
case IPPROTO_IPV6:
/* ip6-in-ip encapsulation */
- ip6_print(ipds->cp, ipds->len);
+ ip6_print(ndo, ipds->cp, ipds->len);
break;
#endif /*INET6*/
@@ -510,11 +458,25 @@
break;
case IPPROTO_PIM:
- pim_print(ipds->cp, ipds->len);
+ vec[0].ptr = ipds->cp;
+ vec[0].len = ipds->len;
+ pim_print(ipds->cp, ipds->len, in_cksum(vec, 1));
break;
case IPPROTO_VRRP:
- vrrp_print(ipds->cp, ipds->len, ipds->ip->ip_ttl);
+ if (packettype == PT_CARP) {
+ if (vflag)
+ (void)printf("carp %s > %s: ",
+ ipaddr_string(&ipds->ip->ip_src),
+ ipaddr_string(&ipds->ip->ip_dst));
+ carp_print(ipds->cp, ipds->len, ipds->ip->ip_ttl);
+ } else {
+ if (vflag)
+ (void)printf("vrrp %s > %s: ",
+ ipaddr_string(&ipds->ip->ip_src),
+ ipaddr_string(&ipds->ip->ip_dst));
+ vrrp_print(ipds->cp, ipds->len, ipds->ip->ip_ttl);
+ }
break;
case IPPROTO_PGM:
@@ -521,8 +483,12 @@
pgm_print(ipds->cp, ipds->len, (const u_char *)ipds->ip);
break;
+ case IPPROTO_PFSYNC:
+ pfsync_ip_print(ipds->cp, ipds->len);
+ break;
+
default:
- if ((proto = getprotobynumber(ipds->nh)) != NULL)
+ if (ndo->ndo_nflag==0 && (proto = getprotobynumber(ipds->nh)) != NULL)
ND_PRINT((ndo, " %s", proto->p_name));
else
ND_PRINT((ndo, " ip-proto-%d", ipds->nh));
@@ -530,7 +496,7 @@
break;
}
}
-
+
void
ip_print_inner(netdissect_options *ndo,
const u_char *bp,
@@ -562,6 +528,7 @@
struct ip_print_demux_state *ipds=&ipd;
const u_char *ipend;
u_int hlen;
+ struct cksum_vec vec[1];
u_int16_t sum, ip_sum;
struct protoent *proto;
@@ -574,7 +541,7 @@
else if (!eflag)
printf("IP ");
- if ((u_char *)(ipds->ip + 1) > snapend) {
+ if ((u_char *)(ipds->ip + 1) > ndo->ndo_snapend) {
printf("[|ip]");
return;
}
@@ -612,8 +579,8 @@
* Cut off the snapshot length to the end of the IP payload.
*/
ipend = bp + ipds->len;
- if (ipend < snapend)
- snapend = ipend;
+ if (ipend < ndo->ndo_snapend)
+ ndo->ndo_snapend = ipend;
ipds->len -= hlen;
@@ -636,7 +603,7 @@
}
if (ipds->ip->ip_ttl >= 1)
- (void)printf(", ttl %u", ipds->ip->ip_ttl);
+ (void)printf(", ttl %u", ipds->ip->ip_ttl);
/*
* for the firewall guys, print id, offset.
@@ -659,8 +626,10 @@
printf(")");
}
- if ((u_char *)ipds->ip + hlen <= snapend) {
- sum = in_cksum((const u_short *)ipds->ip, hlen, 0);
+ if (!Kflag && (u_char *)ipds->ip + hlen <= ndo->ndo_snapend) {
+ vec[0].ptr = (const u_int8_t *)(void *)ipds->ip;
+ vec[0].len = hlen;
+ sum = in_cksum(vec, 1);
if (sum != 0) {
ip_sum = EXTRACT_16BITS(&ipds->ip->ip_sum);
(void)printf(", bad cksum %x (->%x)!", ip_sum,
@@ -668,7 +637,7 @@
}
}
- printf(") ");
+ printf(")\n ");
}
/*
@@ -698,11 +667,11 @@
if (ipds->off & 0x1fff) {
(void)printf("%s > %s:", ipaddr_string(&ipds->ip->ip_src),
ipaddr_string(&ipds->ip->ip_dst));
- if ((proto = getprotobynumber(ipds->ip->ip_p)) != NULL)
+ if (!ndo->ndo_nflag && (proto = getprotobynumber(ipds->ip->ip_p)) != NULL)
(void)printf(" %s", proto->p_name);
else
(void)printf(" ip-proto-%d", ipds->ip->ip_p);
- }
+ }
}
}
@@ -723,7 +692,7 @@
return;
#ifdef INET6
case 6:
- ip6_print (bp, length);
+ ip6_print (gndo, bp, length);
return;
#endif
default:
Modified: trunk/contrib/tcpdump/print-ip6.c
===================================================================
--- trunk/contrib/tcpdump/print-ip6.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ip6.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,12 +18,12 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-ip6.c,v 1.8.2.1 2007/10/19 03:03:59 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-ip6.c 236192 2012-05-28 19:13:21Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ip6.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.52 2007-09-21 07:05:33 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -38,6 +38,7 @@
#include <stdlib.h>
#include <string.h>
+#include "netdissect.h"
#include "interface.h"
#include "addrtoname.h"
#include "extract.h"
@@ -46,10 +47,41 @@
#include "ipproto.h"
/*
+ * Compute a V6-style checksum by building a pseudoheader.
+ */
+int
+nextproto6_cksum(const struct ip6_hdr *ip6, const u_int8_t *data,
+ u_int len, u_int next_proto)
+{
+ struct {
+ struct in6_addr ph_src;
+ struct in6_addr ph_dst;
+ u_int32_t ph_len;
+ u_int8_t ph_zero[3];
+ u_int8_t ph_nxt;
+ } ph;
+ struct cksum_vec vec[2];
+
+ /* pseudo-header */
+ memset(&ph, 0, sizeof(ph));
+ ph.ph_src = ip6->ip6_src;
+ ph.ph_dst = ip6->ip6_dst;
+ ph.ph_len = htonl(len);
+ ph.ph_nxt = next_proto;
+
+ vec[0].ptr = (const u_int8_t *)(void *)&ph;
+ vec[0].len = sizeof(ph);
+ vec[1].ptr = data;
+ vec[1].len = len;
+
+ return in_cksum(vec, 2);
+}
+
+/*
* print an IP6 datagram.
*/
void
-ip6_print(register const u_char *bp, register u_int length)
+ip6_print(netdissect_options *ndo, const u_char *bp, u_int length)
{
register const struct ip6_hdr *ip6;
register int advance;
@@ -65,41 +97,41 @@
TCHECK(*ip6);
if (length < sizeof (struct ip6_hdr)) {
- (void)printf("truncated-ip6 %u", length);
+ (void)ND_PRINT((ndo, "truncated-ip6 %u", length));
return;
}
- if (!eflag)
- printf("IP6 ");
+ if (!ndo->ndo_eflag)
+ ND_PRINT((ndo, "IP6 "));
payload_len = EXTRACT_16BITS(&ip6->ip6_plen);
len = payload_len + sizeof(struct ip6_hdr);
if (length < len)
- (void)printf("truncated-ip6 - %u bytes missing!",
- len - length);
+ (void)ND_PRINT((ndo, "truncated-ip6 - %u bytes missing!",
+ len - length));
- if (vflag) {
+ if (ndo->ndo_vflag) {
flow = EXTRACT_32BITS(&ip6->ip6_flow);
- printf("(");
+ ND_PRINT((ndo, "("));
#if 0
/* rfc1883 */
if (flow & 0x0f000000)
- (void)printf("pri 0x%02x, ", (flow & 0x0f000000) >> 24);
+ (void)ND_PRINT((ndo, "pri 0x%02x, ", (flow & 0x0f000000) >> 24));
if (flow & 0x00ffffff)
- (void)printf("flowlabel 0x%06x, ", flow & 0x00ffffff);
+ (void)ND_PRINT((ndo, "flowlabel 0x%06x, ", flow & 0x00ffffff));
#else
/* RFC 2460 */
if (flow & 0x0ff00000)
- (void)printf("class 0x%02x, ", (flow & 0x0ff00000) >> 20);
+ (void)ND_PRINT((ndo, "class 0x%02x, ", (flow & 0x0ff00000) >> 20));
if (flow & 0x000fffff)
- (void)printf("flowlabel 0x%05x, ", flow & 0x000fffff);
+ (void)ND_PRINT((ndo, "flowlabel 0x%05x, ", flow & 0x000fffff));
#endif
- (void)printf("hlim %u, next-header %s (%u) payload length: %u) ",
+ (void)ND_PRINT((ndo, "hlim %u, next-header %s (%u) payload length: %u) ",
ip6->ip6_hlim,
tok2str(ipproto_values,"unknown",ip6->ip6_nxt),
ip6->ip6_nxt,
- payload_len);
+ payload_len));
}
/*
@@ -106,13 +138,13 @@
* Cut off the snapshot length to the end of the IP payload.
*/
ipend = bp + len;
- if (ipend < snapend)
- snapend = ipend;
+ if (ipend < ndo->ndo_snapend)
+ ndo->ndo_snapend = ipend;
cp = (const u_char *)ip6;
advance = sizeof(struct ip6_hdr);
nh = ip6->ip6_nxt;
- while (cp < snapend && advance > 0) {
+ while (cp < ndo->ndo_snapend && advance > 0) {
cp += advance;
len -= advance;
@@ -119,8 +151,8 @@
if (cp == (const u_char *)(ip6 + 1) &&
nh != IPPROTO_TCP && nh != IPPROTO_UDP &&
nh != IPPROTO_DCCP && nh != IPPROTO_SCTP) {
- (void)printf("%s > %s: ", ip6addr_string(&ip6->ip6_src),
- ip6addr_string(&ip6->ip6_dst));
+ (void)ND_PRINT((ndo, "%s > %s: ", ip6addr_string(&ip6->ip6_src),
+ ip6addr_string(&ip6->ip6_dst)));
}
switch (nh) {
@@ -134,7 +166,7 @@
break;
case IPPROTO_FRAGMENT:
advance = frag6_print(cp, (const u_char *)ip6);
- if (snapend <= cp + advance)
+ if (ndo->ndo_snapend <= cp + advance)
return;
nh = *cp;
fragmented = 1;
@@ -172,7 +204,7 @@
udp_print(cp, len, (const u_char *)ip6, fragmented);
return;
case IPPROTO_ICMPV6:
- icmp6_print(cp, len, (const u_char *)ip6, fragmented);
+ icmp6_print(ndo, cp, len, (const u_char *)ip6, fragmented);
return;
case IPPROTO_AH:
advance = ah_print(cp);
@@ -181,7 +213,7 @@
case IPPROTO_ESP:
{
int enh, padlen;
- advance = esp_print(gndo, cp, len, (const u_char *)ip6, &enh, &padlen);
+ advance = esp_print(ndo, cp, len, (const u_char *)ip6, &enh, &padlen);
nh = enh & 0xff;
len -= padlen;
break;
@@ -195,7 +227,8 @@
}
case IPPROTO_PIM:
- pim_print(cp, len);
+ pim_print(cp, len, nextproto6_cksum(ip6, cp, len,
+ IPPROTO_PIM));
return;
case IPPROTO_OSPF:
@@ -203,11 +236,11 @@
return;
case IPPROTO_IPV6:
- ip6_print(cp, len);
+ ip6_print(ndo, cp, len);
return;
case IPPROTO_IPV4:
- ip_print(gndo, cp, len);
+ ip_print(ndo, cp, len);
return;
case IPPROTO_PGM:
@@ -223,11 +256,11 @@
return;
case IPPROTO_NONE:
- (void)printf("no next header");
+ (void)ND_PRINT((ndo, "no next header"));
return;
default:
- (void)printf("ip-proto-%d %d", nh, len);
+ (void)ND_PRINT((ndo, "ip-proto-%d %d", nh, len));
return;
}
}
@@ -234,7 +267,7 @@
return;
trunc:
- (void)printf("[|ip6]");
+ (void)ND_PRINT((ndo, "[|ip6]"));
}
#endif /* INET6 */
Modified: trunk/contrib/tcpdump/print-ip6opts.c
===================================================================
--- trunk/contrib/tcpdump/print-ip6opts.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ip6opts.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -33,7 +33,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ip6opts.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ip6opts.c,v 1.18 2005-04-20 22:18:50 guy Exp $";
#endif
#ifdef INET6
@@ -141,6 +141,8 @@
int i;
int optlen = 0;
+ if (len == 0)
+ return;
for (i = 0; i < len; i += optlen) {
if (bp[i] == IP6OPT_PAD1)
optlen = 1;
@@ -271,10 +273,11 @@
printf("(type %d: trunc)", bp[i]);
goto trunc;
}
- printf("(opt_type 0x%02x: len=%d) ", bp[i], bp[i + 1]);
+ printf("(opt_type 0x%02x: len=%d)", bp[i], bp[i + 1]);
break;
}
}
+ printf(" ");
#if 0
end:
Modified: trunk/contrib/tcpdump/print-ipcomp.c
===================================================================
--- trunk/contrib/tcpdump/print-ipcomp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ipcomp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ipcomp.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ipcomp.c,v 1.20 2003-11-19 00:36:08 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-ipfc.c
===================================================================
--- trunk/contrib/tcpdump/print-ipfc.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ipfc.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ipfc.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ipfc.c,v 1.9 2005-11-13 12:12:42 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Added: trunk/contrib/tcpdump/print-ipnet.c
===================================================================
--- trunk/contrib/tcpdump/print-ipnet.c (rev 0)
+++ trunk/contrib/tcpdump/print-ipnet.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,109 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <pcap.h>
+
+#include "netdissect.h"
+#include "interface.h"
+#include "addrtoname.h"
+#include "ipnet.h"
+
+#ifdef DLT_IPNET
+
+const struct tok ipnet_values[] = {
+ { IPH_AF_INET, "IPv4" },
+ { IPH_AF_INET6, "IPv6" },
+ { 0, NULL }
+};
+
+static inline void
+ipnet_hdr_print(struct netdissect_options *ndo, const u_char *bp, u_int length)
+{
+ const ipnet_hdr_t *hdr;
+ hdr = (const ipnet_hdr_t *)bp;
+
+ ND_PRINT((ndo, "%d > %d", hdr->iph_zsrc, hdr->iph_zdst));
+
+ if (!ndo->ndo_qflag) {
+ ND_PRINT((ndo,", family %s (%d)",
+ tok2str(ipnet_values, "Unknown",
+ hdr->iph_family),
+ hdr->iph_family));
+ } else {
+ ND_PRINT((ndo,", %s",
+ tok2str(ipnet_values,
+ "Unknown Ethertype (0x%04x)",
+ hdr->iph_family)));
+ }
+
+ ND_PRINT((ndo, ", length %u: ", length));
+}
+
+static void
+ipnet_print(struct netdissect_options *ndo, const u_char *p, u_int length, u_int caplen)
+{
+ ipnet_hdr_t *hdr;
+
+ if (caplen < sizeof(ipnet_hdr_t)) {
+ ND_PRINT((ndo, "[|ipnet]"));
+ return;
+ }
+
+ if (ndo->ndo_eflag)
+ ipnet_hdr_print(ndo, p, length);
+
+ length -= sizeof(ipnet_hdr_t);
+ caplen -= sizeof(ipnet_hdr_t);
+ hdr = (ipnet_hdr_t *)p;
+ p += sizeof(ipnet_hdr_t);
+
+ switch (hdr->iph_family) {
+
+ case IPH_AF_INET:
+ ip_print(ndo, p, length);
+ break;
+
+#ifdef INET6
+ case IPH_AF_INET6:
+ ip6_print(ndo, p, length);
+ break;
+#endif /*INET6*/
+
+ default:
+ if (!ndo->ndo_eflag)
+ ipnet_hdr_print(ndo, (u_char *)hdr,
+ length + sizeof(ipnet_hdr_t));
+
+ if (!ndo->ndo_suppress_default_print)
+ ndo->ndo_default_print(ndo, p, caplen);
+ break;
+ }
+}
+
+/*
+ * This is the top level routine of the printer. 'p' points
+ * to the ether header of the packet, 'h->ts' is the timestamp,
+ * 'h->len' is the length of the packet off the wire, and 'h->caplen'
+ * is the number of bytes actually captured.
+ */
+u_int
+ipnet_if_print(struct netdissect_options *ndo,
+ const struct pcap_pkthdr *h, const u_char *p)
+{
+ ipnet_print(ndo, p, h->len, h->caplen);
+
+ return (sizeof(ipnet_hdr_t));
+}
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 8
+ * End:
+ */
+
+#endif /* DLT_IPNET */
Property changes on: trunk/contrib/tcpdump/print-ipnet.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-ipx.c
===================================================================
--- trunk/contrib/tcpdump/print-ipx.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ipx.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,12 +21,12 @@
* Format and print Novell IPX packets.
* Contributed by Brad Parker (brad at fcr.com).
*
- * $FreeBSD: src/contrib/tcpdump/print-ipx.c,v 1.10 2006/09/04 20:25:04 sam Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-ipx.c 236192 2012-05-28 19:13:21Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ipx.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ipx.c,v 1.42 2005-05-06 08:26:44 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -198,7 +198,7 @@
(void)printf("ipx-rip-req");
if (length > 0) {
TCHECK(ipx[3]);
- (void)printf(" %u/%d.%d", EXTRACT_32BITS(&ipx[0]),
+ (void)printf(" %08x/%d.%d", EXTRACT_32BITS(&ipx[0]),
EXTRACT_16BITS(&ipx[2]), EXTRACT_16BITS(&ipx[3]));
}
break;
@@ -206,7 +206,7 @@
(void)printf("ipx-rip-resp");
for (i = 0; i < 50 && length > 0; i++) {
TCHECK(ipx[3]);
- (void)printf(" %u/%d.%d", EXTRACT_32BITS(&ipx[0]),
+ (void)printf(" %08x/%d.%d", EXTRACT_32BITS(&ipx[0]),
EXTRACT_16BITS(&ipx[2]), EXTRACT_16BITS(&ipx[3]));
ipx += 4;
Modified: trunk/contrib/tcpdump/print-isakmp.c
===================================================================
--- trunk/contrib/tcpdump/print-isakmp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-isakmp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -30,9 +30,10 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-isakmp.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-isakmp.c,v 1.61 2008-02-05 19:34:25 guy Exp $ (LBL)";
#endif
+#define NETDISSECT_REWORKED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -59,39 +60,75 @@
#define sockaddr_storage sockaddr
#endif
-static const u_char *isakmp_sa_print(const struct isakmp_gen *,
- u_int, const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_p_print(const struct isakmp_gen *,
- u_int, const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_t_print(const struct isakmp_gen *,
- u_int, const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_ke_print(const struct isakmp_gen *,
- u_int, const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_id_print(const struct isakmp_gen *,
- u_int, const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_cert_print(const struct isakmp_gen *,
- u_int, const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_cr_print(const struct isakmp_gen *,
- u_int, const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_sig_print(const struct isakmp_gen *,
- u_int, const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_hash_print(const struct isakmp_gen *,
- u_int, const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_nonce_print(const struct isakmp_gen *,
- u_int, const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_n_print(const struct isakmp_gen *,
- u_int, const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_d_print(const struct isakmp_gen *,
- u_int, const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_vid_print(const struct isakmp_gen *,
- u_int, const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_sub0_print(u_char, const struct isakmp_gen *,
+#define DECLARE_PRINTER(func) static const u_char *ike##func##_print( \
+ netdissect_options *ndo, u_char tpay, \
+ const struct isakmp_gen *ext, \
+ u_int item_len, \
+ const u_char *end_pointer, \
+ u_int32_t phase,\
+ u_int32_t doi0, \
+ u_int32_t proto0, int depth)
+
+DECLARE_PRINTER(v1_sa);
+DECLARE_PRINTER(v1_p);
+DECLARE_PRINTER(v1_t);
+DECLARE_PRINTER(v1_ke);
+DECLARE_PRINTER(v1_id);
+DECLARE_PRINTER(v1_cert);
+DECLARE_PRINTER(v1_cr);
+DECLARE_PRINTER(v1_sig);
+DECLARE_PRINTER(v1_hash);
+DECLARE_PRINTER(v1_nonce);
+DECLARE_PRINTER(v1_n);
+DECLARE_PRINTER(v1_d);
+DECLARE_PRINTER(v1_vid);
+
+DECLARE_PRINTER(v2_sa);
+DECLARE_PRINTER(v2_ke);
+DECLARE_PRINTER(v2_ID);
+DECLARE_PRINTER(v2_cert);
+DECLARE_PRINTER(v2_cr);
+DECLARE_PRINTER(v2_auth);
+DECLARE_PRINTER(v2_nonce);
+DECLARE_PRINTER(v2_n);
+DECLARE_PRINTER(v2_d);
+DECLARE_PRINTER(v2_vid);
+DECLARE_PRINTER(v2_TS);
+DECLARE_PRINTER(v2_cp);
+DECLARE_PRINTER(v2_eap);
+
+static const u_char *ikev2_e_print(netdissect_options *ndo,
+ struct isakmp *base,
+ u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len,
+ const u_char *end_pointer,
+ u_int32_t phase,
+ u_int32_t doi0,
+ u_int32_t proto0, int depth);
+
+
+static const u_char *ike_sub0_print(netdissect_options *ndo,u_char, const struct isakmp_gen *,
const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
-static const u_char *isakmp_sub_print(u_char, const struct isakmp_gen *,
+static const u_char *ikev1_sub_print(netdissect_options *ndo,u_char, const struct isakmp_gen *,
const u_char *, u_int32_t, u_int32_t, u_int32_t, int);
+
+static const u_char *ikev2_sub_print(netdissect_options *ndo,
+ struct isakmp *base,
+ u_char np, const struct isakmp_gen *ext,
+ const u_char *ep, u_int32_t phase,
+ u_int32_t doi, u_int32_t proto,
+ int depth);
+
+
static char *numstr(int);
static void safememcpy(void *, const void *, size_t);
+static void
+ikev1_print(netdissect_options *ndo,
+ const u_char *bp, u_int length,
+ const u_char *bp2, struct isakmp *base);
+
#define MAXINITIATORS 20
int ninitiator = 0;
struct {
@@ -107,36 +144,73 @@
/* isakmp->np */
static const char *npstr[] = {
- "none", "sa", "p", "t", "ke", "id", "cert", "cr", "hash",
- "sig", "nonce", "n", "d", "vid"
+ "none", "sa", "p", "t", "ke", "id", "cert", "cr", "hash", /* 0 - 8 */
+ "sig", "nonce", "n", "d", "vid", /* 9 - 13 */
+ "pay14", "pay15", "pay16", "pay17", "pay18", /* 14- 18 */
+ "pay19", "pay20", "pay21", "pay22", "pay23", /* 19- 23 */
+ "pay24", "pay25", "pay26", "pay27", "pay28", /* 24- 28 */
+ "pay29", "pay30", "pay31", "pay32", /* 29- 32 */
+ "v2sa", "v2ke", "v2IDi", "v2IDr", "v2cert",/* 33- 37 */
+ "v2cr", "v2auth","v2nonce", "v2n", "v2d", /* 38- 42 */
+ "v2vid", "v2TSi", "v2TSr", "v2e", "v2cp", /* 43- 47 */
+ "v2eap", /* 48 */
+
};
/* isakmp->np */
-static const u_char *(*npfunc[])(const struct isakmp_gen *, u_int,
- const u_char *, u_int32_t, u_int32_t, u_int32_t, int) = {
+static const u_char *(*npfunc[])(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len,
+ const u_char *end_pointer,
+ u_int32_t phase,
+ u_int32_t doi0,
+ u_int32_t proto0, int depth) = {
NULL,
- isakmp_sa_print,
- isakmp_p_print,
- isakmp_t_print,
- isakmp_ke_print,
- isakmp_id_print,
- isakmp_cert_print,
- isakmp_cr_print,
- isakmp_hash_print,
- isakmp_sig_print,
- isakmp_nonce_print,
- isakmp_n_print,
- isakmp_d_print,
- isakmp_vid_print,
+ ikev1_sa_print,
+ ikev1_p_print,
+ ikev1_t_print,
+ ikev1_ke_print,
+ ikev1_id_print,
+ ikev1_cert_print,
+ ikev1_cr_print,
+ ikev1_hash_print,
+ ikev1_sig_print,
+ ikev1_nonce_print,
+ ikev1_n_print,
+ ikev1_d_print,
+ ikev1_vid_print, /* 13 */
+ NULL, NULL, NULL, NULL, NULL, /* 14- 18 */
+ NULL, NULL, NULL, NULL, NULL, /* 19- 23 */
+ NULL, NULL, NULL, NULL, NULL, /* 24- 28 */
+ NULL, NULL, NULL, NULL, /* 29- 32 */
+ ikev2_sa_print, /* 33 */
+ ikev2_ke_print, /* 34 */
+ ikev2_ID_print, /* 35 */
+ ikev2_ID_print, /* 36 */
+ ikev2_cert_print, /* 37 */
+ ikev2_cr_print, /* 38 */
+ ikev2_auth_print, /* 39 */
+ ikev2_nonce_print, /* 40 */
+ ikev2_n_print, /* 41 */
+ ikev2_d_print, /* 42 */
+ ikev2_vid_print, /* 43 */
+ ikev2_TS_print, /* 44 */
+ ikev2_TS_print, /* 45 */
+ NULL, /* ikev2_e_print,*/ /* 46 - special */
+ ikev2_cp_print, /* 47 */
+ ikev2_eap_print, /* 48 */
};
/* isakmp->etype */
static const char *etypestr[] = {
- "none", "base", "ident", "auth", "agg", "inf", NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- "oakley-quick", "oakley-newgroup",
+/* IKEv1 exchange types */
+ "none", "base", "ident", "auth", "agg", "inf", NULL, NULL, /* 0-7 */
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8-15 */
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 16-23 */
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 24-31 */
+ "oakley-quick", "oakley-newgroup", /* 32-33 */
+/* IKEv2 exchange types */
+ "ikev2_init", "ikev2_auth", "child_sa", "inf2" /* 34-37 */
};
#define STR_OR_ID(x, tab) \
@@ -145,6 +219,13 @@
#define NPSTR(x) STR_OR_ID(x, npstr)
#define ETYPESTR(x) STR_OR_ID(x, etypestr)
+#define CHECKLEN(p, np) \
+ if (ep < (u_char *)(p)) { \
+ ND_PRINT((ndo," [|%s]", NPSTR(np))); \
+ goto done; \
+ }
+
+
#define NPFUNC(x) \
(((x) < sizeof(npfunc)/sizeof(npfunc[0]) && npfunc[(x)]) \
? npfunc[(x)] : NULL)
@@ -321,22 +402,62 @@
return 0;
}
-static int
-rawprint(caddr_t loc, size_t len)
+static void
+hexprint(netdissect_options *ndo, caddr_t loc, size_t len)
{
- static u_char *p;
+ u_char *p;
size_t i;
- TCHECK2(*loc, len);
-
p = (u_char *)loc;
for (i = 0; i < len; i++)
- printf("%02x", p[i] & 0xff);
+ ND_PRINT((ndo,"%02x", p[i] & 0xff));
+}
+
+static int
+rawprint(netdissect_options *ndo, caddr_t loc, size_t len)
+{
+ ND_TCHECK2(*loc, len);
+
+ hexprint(ndo, loc, len);
return 1;
trunc:
return 0;
}
+
+/*
+ * returns false if we run out of data buffer
+ */
+static int ike_show_somedata(struct netdissect_options *ndo,
+ const u_char *cp, const u_char *ep)
+{
+ /* there is too much data, just show some of it */
+ const u_char *end = ep - 20;
+ int elen = 20;
+ int len = ep - cp;
+ if(len > 10) {
+ len = 10;
+ }
+
+ /* really shouldn't happen because of above */
+ if(end < cp + len) {
+ end = cp+len;
+ elen = ep - end;
+ }
+
+ ND_PRINT((ndo," data=("));
+ if(!rawprint(ndo, (caddr_t)(cp), len)) goto trunc;
+ ND_PRINT((ndo, "..."));
+ if(elen) {
+ if(!rawprint(ndo, (caddr_t)(end), elen)) goto trunc;
+ }
+ ND_PRINT((ndo,")"));
+ return 1;
+
+trunc:
+ return 0;
+}
+
struct attrmap {
const char *type;
u_int nvalue;
@@ -344,8 +465,9 @@
};
static const u_char *
-isakmp_attrmap_print(const u_char *p, const u_char *ep,
- const struct attrmap *map, size_t nmap)
+ikev1_attrmap_print(netdissect_options *ndo,
+ const u_char *p, const u_char *ep,
+ const struct attrmap *map, size_t nmap)
{
u_int16_t *q;
int totlen;
@@ -357,33 +479,33 @@
else
totlen = 4 + EXTRACT_16BITS(&q[1]);
if (ep < p + totlen) {
- printf("[|attr]");
+ ND_PRINT((ndo,"[|attr]"));
return ep + 1;
}
- printf("(");
+ ND_PRINT((ndo,"("));
t = EXTRACT_16BITS(&q[0]) & 0x7fff;
if (map && t < nmap && map[t].type)
- printf("type=%s ", map[t].type);
+ ND_PRINT((ndo,"type=%s ", map[t].type));
else
- printf("type=#%d ", t);
+ ND_PRINT((ndo,"type=#%d ", t));
if (p[0] & 0x80) {
- printf("value=");
+ ND_PRINT((ndo,"value="));
v = EXTRACT_16BITS(&q[1]);
if (map && t < nmap && v < map[t].nvalue && map[t].value[v])
- printf("%s", map[t].value[v]);
+ ND_PRINT((ndo,"%s", map[t].value[v]));
else
- rawprint((caddr_t)&q[1], 2);
+ rawprint(ndo, (caddr_t)&q[1], 2);
} else {
- printf("len=%d value=", EXTRACT_16BITS(&q[1]));
- rawprint((caddr_t)&p[4], EXTRACT_16BITS(&q[1]));
+ ND_PRINT((ndo,"len=%d value=", EXTRACT_16BITS(&q[1])));
+ rawprint(ndo, (caddr_t)&p[4], EXTRACT_16BITS(&q[1]));
}
- printf(")");
+ ND_PRINT((ndo,")"));
return p + totlen;
}
static const u_char *
-isakmp_attr_print(const u_char *p, const u_char *ep)
+ikev1_attr_print(netdissect_options *ndo, const u_char *p, const u_char *ep)
{
u_int16_t *q;
int totlen;
@@ -395,129 +517,166 @@
else
totlen = 4 + EXTRACT_16BITS(&q[1]);
if (ep < p + totlen) {
- printf("[|attr]");
+ ND_PRINT((ndo,"[|attr]"));
return ep + 1;
}
- printf("(");
+ ND_PRINT((ndo,"("));
t = EXTRACT_16BITS(&q[0]) & 0x7fff;
- printf("type=#%d ", t);
+ ND_PRINT((ndo,"type=#%d ", t));
if (p[0] & 0x80) {
- printf("value=");
+ ND_PRINT((ndo,"value="));
t = q[1];
- rawprint((caddr_t)&q[1], 2);
+ rawprint(ndo, (caddr_t)&q[1], 2);
} else {
- printf("len=%d value=", EXTRACT_16BITS(&q[1]));
- rawprint((caddr_t)&p[2], EXTRACT_16BITS(&q[1]));
+ ND_PRINT((ndo,"len=%d value=", EXTRACT_16BITS(&q[1])));
+ rawprint(ndo, (caddr_t)&p[2], EXTRACT_16BITS(&q[1]));
}
- printf(")");
+ ND_PRINT((ndo,")"));
return p + totlen;
}
static const u_char *
-isakmp_sa_print(const struct isakmp_gen *ext,
+ikev1_sa_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext,
u_int item_len _U_,
const u_char *ep, u_int32_t phase, u_int32_t doi0 _U_,
u_int32_t proto0, int depth)
{
- const struct isakmp_pl_sa *p;
- struct isakmp_pl_sa sa;
+ const struct ikev1_pl_sa *p;
+ struct ikev1_pl_sa sa;
const u_int32_t *q;
u_int32_t doi, sit, ident;
const u_char *cp, *np;
int t;
- printf("%s:", NPSTR(ISAKMP_NPTYPE_SA));
+ ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_SA)));
- p = (struct isakmp_pl_sa *)ext;
- TCHECK(*p);
+ p = (struct ikev1_pl_sa *)ext;
+ ND_TCHECK(*p);
safememcpy(&sa, ext, sizeof(sa));
doi = ntohl(sa.doi);
sit = ntohl(sa.sit);
if (doi != 1) {
- printf(" doi=%d", doi);
- printf(" situation=%u", (u_int32_t)ntohl(sa.sit));
+ ND_PRINT((ndo," doi=%d", doi));
+ ND_PRINT((ndo," situation=%u", (u_int32_t)ntohl(sa.sit)));
return (u_char *)(p + 1);
}
- printf(" doi=ipsec");
+ ND_PRINT((ndo," doi=ipsec"));
q = (u_int32_t *)&sa.sit;
- printf(" situation=");
+ ND_PRINT((ndo," situation="));
t = 0;
if (sit & 0x01) {
- printf("identity");
+ ND_PRINT((ndo,"identity"));
t++;
}
if (sit & 0x02) {
- printf("%ssecrecy", t ? "+" : "");
+ ND_PRINT((ndo,"%ssecrecy", t ? "+" : ""));
t++;
}
if (sit & 0x04)
- printf("%sintegrity", t ? "+" : "");
+ ND_PRINT((ndo,"%sintegrity", t ? "+" : ""));
np = (u_char *)ext + sizeof(sa);
if (sit != 0x01) {
- TCHECK2(*(ext + 1), sizeof(ident));
+ ND_TCHECK2(*(ext + 1), sizeof(ident));
safememcpy(&ident, ext + 1, sizeof(ident));
- printf(" ident=%u", (u_int32_t)ntohl(ident));
+ ND_PRINT((ndo," ident=%u", (u_int32_t)ntohl(ident)));
np += sizeof(ident);
}
ext = (struct isakmp_gen *)np;
- TCHECK(*ext);
+ ND_TCHECK(*ext);
- cp = isakmp_sub_print(ISAKMP_NPTYPE_P, ext, ep, phase, doi, proto0,
+ cp = ikev1_sub_print(ndo, ISAKMP_NPTYPE_P, ext, ep, phase, doi, proto0,
depth);
return cp;
trunc:
- printf(" [|%s]", NPSTR(ISAKMP_NPTYPE_SA));
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_SA)));
return NULL;
}
static const u_char *
-isakmp_p_print(const struct isakmp_gen *ext, u_int item_len _U_,
+ikev1_p_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext, u_int item_len _U_,
const u_char *ep, u_int32_t phase, u_int32_t doi0,
u_int32_t proto0 _U_, int depth)
{
- const struct isakmp_pl_p *p;
- struct isakmp_pl_p prop;
+ const struct ikev1_pl_p *p;
+ struct ikev1_pl_p prop;
const u_char *cp;
- printf("%s:", NPSTR(ISAKMP_NPTYPE_P));
+ ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_P)));
- p = (struct isakmp_pl_p *)ext;
- TCHECK(*p);
+ p = (struct ikev1_pl_p *)ext;
+ ND_TCHECK(*p);
safememcpy(&prop, ext, sizeof(prop));
- printf(" #%d protoid=%s transform=%d",
- prop.p_no, PROTOIDSTR(prop.prot_id), prop.num_t);
+ ND_PRINT((ndo," #%d protoid=%s transform=%d",
+ prop.p_no, PROTOIDSTR(prop.prot_id), prop.num_t));
if (prop.spi_size) {
- printf(" spi=");
- if (!rawprint((caddr_t)(p + 1), prop.spi_size))
+ ND_PRINT((ndo," spi="));
+ if (!rawprint(ndo, (caddr_t)(p + 1), prop.spi_size))
goto trunc;
}
ext = (struct isakmp_gen *)((u_char *)(p + 1) + prop.spi_size);
- TCHECK(*ext);
-
- cp = isakmp_sub_print(ISAKMP_NPTYPE_T, ext, ep, phase, doi0,
- prop.prot_id, depth);
-
+ ND_TCHECK(*ext);
+
+ cp = ikev1_sub_print(ndo, ISAKMP_NPTYPE_T, ext, ep, phase, doi0,
+ prop.prot_id, depth);
+
return cp;
trunc:
- printf(" [|%s]", NPSTR(ISAKMP_NPTYPE_P));
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_P)));
return NULL;
}
-static const char *isakmp_p_map[] = {
+static const char *ikev1_p_map[] = {
NULL, "ike",
};
+static const char *ikev2_t_type_map[]={
+ NULL, "encr", "prf", "integ", "dh", "esn"
+};
+
static const char *ah_p_map[] = {
NULL, "(reserved)", "md5", "sha", "1des",
"sha2-256", "sha2-384", "sha2-512",
};
+static const char *prf_p_map[] = {
+ NULL, "hmac-md5", "hmac-sha", "hmac-tiger",
+ "aes128_xcbc"
+};
+
+static const char *integ_p_map[] = {
+ NULL, "hmac-md5", "hmac-sha", "dec-mac",
+ "kpdk-md5", "aes-xcbc"
+};
+
+static const char *esn_p_map[] = {
+ "no-esn", "esn"
+};
+
+static const char *dh_p_map[] = {
+ NULL, "modp768",
+ "modp1024", /* group 2 */
+ "EC2N 2^155", /* group 3 */
+ "EC2N 2^185", /* group 4 */
+ "modp1536", /* group 5 */
+ "iana-grp06", "iana-grp07", /* reserved */
+ "iana-grp08", "iana-grp09",
+ "iana-grp10", "iana-grp11",
+ "iana-grp12", "iana-grp13",
+ "modp2048", /* group 14 */
+ "modp3072", /* group 15 */
+ "modp4096", /* group 16 */
+ "modp6144", /* group 17 */
+ "modp8192", /* group 18 */
+};
+
static const char *esp_p_map[] = {
NULL, "1des-iv64", "1des", "3des", "rc5", "idea", "cast",
"blowfish", "3idea", "1des-iv32", "rc4", "null", "aes"
@@ -531,8 +690,21 @@
{ NULL, 0, { NULL } },
{ "lifetype", 3, { NULL, "sec", "kb", }, },
{ "life", 0, { NULL } },
- { "group desc", 5, { NULL, "modp768", "modp1024", "EC2N 2^155",
- "EC2N 2^185", }, },
+ { "group desc", 18, { NULL, "modp768",
+ "modp1024", /* group 2 */
+ "EC2N 2^155", /* group 3 */
+ "EC2N 2^185", /* group 4 */
+ "modp1536", /* group 5 */
+ "iana-grp06", "iana-grp07", /* reserved */
+ "iana-grp08", "iana-grp09",
+ "iana-grp10", "iana-grp11",
+ "iana-grp12", "iana-grp13",
+ "modp2048", /* group 14 */
+ "modp3072", /* group 15 */
+ "modp4096", /* group 16 */
+ "modp6144", /* group 17 */
+ "modp8192", /* group 18 */
+ }, },
{ "enc mode", 3, { NULL, "tunnel", "transport", }, },
{ "auth", 5, { NULL, "hmac-md5", "hmac-sha1", "1des-mac", "keyed", }, },
{ "keylen", 0, { NULL } },
@@ -541,6 +713,17 @@
{ "privalg", 0, { NULL } },
};
+const struct attrmap encr_t_map[] = {
+ { NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 0, 1 */
+ { NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 2, 3 */
+ { NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 4, 5 */
+ { NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 6, 7 */
+ { NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 8, 9 */
+ { NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 10,11*/
+ { NULL, 0, { NULL } }, { NULL, 0, { NULL } }, /* 12,13*/
+ { "keylen", 14, { NULL }},
+};
+
const struct attrmap oakley_t_map[] = {
{ NULL, 0, { NULL } },
{ "enc", 8, { NULL, "1des", "idea", "blowfish", "rc5",
@@ -549,8 +732,21 @@
"sha2-256", "sha2-384", "sha2-512", }, },
{ "auth", 6, { NULL, "preshared", "dss", "rsa sig", "rsa enc",
"rsa enc revised", }, },
- { "group desc", 5, { NULL, "modp768", "modp1024", "EC2N 2^155",
- "EC2N 2^185", }, },
+ { "group desc", 18, { NULL, "modp768",
+ "modp1024", /* group 2 */
+ "EC2N 2^155", /* group 3 */
+ "EC2N 2^185", /* group 4 */
+ "modp1536", /* group 5 */
+ "iana-grp06", "iana-grp07", /* reserved */
+ "iana-grp08", "iana-grp09",
+ "iana-grp10", "iana-grp11",
+ "iana-grp12", "iana-grp13",
+ "modp2048", /* group 14 */
+ "modp3072", /* group 15 */
+ "modp4096", /* group 16 */
+ "modp6144", /* group 17 */
+ "modp8192", /* group 18 */
+ }, },
{ "group type", 4, { NULL, "MODP", "ECP", "EC2N", }, },
{ "group prime", 0, { NULL } },
{ "group gen1", 0, { NULL } },
@@ -566,12 +762,13 @@
};
static const u_char *
-isakmp_t_print(const struct isakmp_gen *ext, u_int item_len,
- const u_char *ep, u_int32_t phase _U_, u_int32_t doi _U_,
- u_int32_t proto, int depth _U_)
+ikev1_t_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext, u_int item_len,
+ const u_char *ep, u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto, int depth _U_)
{
- const struct isakmp_pl_t *p;
- struct isakmp_pl_t t;
+ const struct ikev1_pl_t *p;
+ struct ikev1_pl_t t;
const u_char *cp;
const char *idstr;
const struct attrmap *map;
@@ -578,15 +775,15 @@
size_t nmap;
const u_char *ep2;
- printf("%s:", NPSTR(ISAKMP_NPTYPE_T));
+ ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_T)));
- p = (struct isakmp_pl_t *)ext;
- TCHECK(*p);
+ p = (struct ikev1_pl_t *)ext;
+ ND_TCHECK(*p);
safememcpy(&t, ext, sizeof(t));
switch (proto) {
case 1:
- idstr = STR_OR_ID(t.t_id, isakmp_p_map);
+ idstr = STR_OR_ID(t.t_id, ikev1_p_map);
map = oakley_t_map;
nmap = sizeof(oakley_t_map)/sizeof(oakley_t_map[0]);
break;
@@ -613,57 +810,59 @@
}
if (idstr)
- printf(" #%d id=%s ", t.t_no, idstr);
+ ND_PRINT((ndo," #%d id=%s ", t.t_no, idstr));
else
- printf(" #%d id=%d ", t.t_no, t.t_id);
+ ND_PRINT((ndo," #%d id=%d ", t.t_no, t.t_id));
cp = (u_char *)(p + 1);
ep2 = (u_char *)p + item_len;
while (cp < ep && cp < ep2) {
if (map && nmap) {
- cp = isakmp_attrmap_print(cp, (ep < ep2) ? ep : ep2,
+ cp = ikev1_attrmap_print(ndo, cp, (ep < ep2) ? ep : ep2,
map, nmap);
} else
- cp = isakmp_attr_print(cp, (ep < ep2) ? ep : ep2);
+ cp = ikev1_attr_print(ndo, cp, (ep < ep2) ? ep : ep2);
}
if (ep < ep2)
- printf("...");
+ ND_PRINT((ndo,"..."));
return cp;
trunc:
- printf(" [|%s]", NPSTR(ISAKMP_NPTYPE_T));
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_T)));
return NULL;
}
static const u_char *
-isakmp_ke_print(const struct isakmp_gen *ext, u_int item_len _U_,
- const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_,
- u_int32_t proto _U_, int depth _U_)
+ikev1_ke_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext, u_int item_len _U_,
+ const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
{
struct isakmp_gen e;
- printf("%s:", NPSTR(ISAKMP_NPTYPE_KE));
+ ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_KE)));
- TCHECK(*ext);
+ ND_TCHECK(*ext);
safememcpy(&e, ext, sizeof(e));
- printf(" key len=%d", ntohs(e.len) - 4);
- if (2 < vflag && 4 < ntohs(e.len)) {
- printf(" ");
- if (!rawprint((caddr_t)(ext + 1), ntohs(e.len) - 4))
+ ND_PRINT((ndo," key len=%d", ntohs(e.len) - 4));
+ if (2 < ndo->ndo_vflag && 4 < ntohs(e.len)) {
+ ND_PRINT((ndo," "));
+ if (!rawprint(ndo, (caddr_t)(ext + 1), ntohs(e.len) - 4))
goto trunc;
}
return (u_char *)ext + ntohs(e.len);
trunc:
- printf(" [|%s]", NPSTR(ISAKMP_NPTYPE_KE));
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_KE)));
return NULL;
}
static const u_char *
-isakmp_id_print(const struct isakmp_gen *ext, u_int item_len _U_,
- const u_char *ep _U_, u_int32_t phase, u_int32_t doi _U_,
- u_int32_t proto _U_, int depth _U_)
+ikev1_id_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext, u_int item_len _U_,
+ const u_char *ep _U_, u_int32_t phase, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
{
#define USE_IPSECDOI_IN_PHASE1 1
- const struct isakmp_pl_id *p;
- struct isakmp_pl_id id;
+ const struct ikev1_pl_id *p;
+ struct ikev1_pl_id id;
static const char *idtypestr[] = {
"IPv4", "IPv4net", "IPv6", "IPv6net",
};
@@ -675,10 +874,10 @@
int len;
const u_char *data;
- printf("%s:", NPSTR(ISAKMP_NPTYPE_ID));
+ ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_ID)));
- p = (struct isakmp_pl_id *)ext;
- TCHECK(*p);
+ p = (struct ikev1_pl_id *)ext;
+ ND_TCHECK(*p);
safememcpy(&id, ext, sizeof(id));
if (sizeof(*p) < item_len) {
data = (u_char *)(p + 1);
@@ -689,7 +888,7 @@
}
#if 0 /*debug*/
- printf(" [phase=%d doi=%d proto=%d]", phase, doi, proto);
+ ND_PRINT((ndo," [phase=%d doi=%d proto=%d]", phase, doi, proto));
#endif
switch (phase) {
#ifndef USE_IPSECDOI_IN_PHASE1
@@ -696,9 +895,9 @@
case 1:
#endif
default:
- printf(" idtype=%s", STR_OR_ID(id.d.id_type, idtypestr));
- printf(" doi_data=%u",
- (u_int32_t)(ntohl(id.d.doi_data) & 0xffffff));
+ ND_PRINT((ndo," idtype=%s", STR_OR_ID(id.d.id_type, idtypestr)));
+ ND_PRINT((ndo," doi_data=%u",
+ (u_int32_t)(ntohl(id.d.doi_data) & 0xffffff)));
break;
#ifdef USE_IPSECDOI_IN_PHASE1
@@ -711,9 +910,9 @@
struct protoent *pe;
p = (struct ipsecdoi_id *)ext;
- TCHECK(*p);
+ ND_TCHECK(*p);
safememcpy(&id, ext, sizeof(id));
- printf(" idtype=%s", STR_OR_ID(id.type, ipsecidtypestr));
+ ND_PRINT((ndo," idtype=%s", STR_OR_ID(id.type, ipsecidtypestr)));
if (id.proto_id) {
#ifndef WIN32
setprotoent(1);
@@ -720,26 +919,26 @@
#endif /* WIN32 */
pe = getprotobynumber(id.proto_id);
if (pe)
- printf(" protoid=%s", pe->p_name);
+ ND_PRINT((ndo," protoid=%s", pe->p_name));
#ifndef WIN32
endprotoent();
#endif /* WIN32 */
} else {
/* it DOES NOT mean IPPROTO_IP! */
- printf(" protoid=%s", "0");
+ ND_PRINT((ndo," protoid=%s", "0"));
}
- printf(" port=%d", ntohs(id.port));
+ ND_PRINT((ndo," port=%d", ntohs(id.port)));
if (!len)
break;
if (data == NULL)
goto trunc;
- TCHECK2(*data, len);
+ ND_TCHECK2(*data, len);
switch (id.type) {
case IPSECDOI_ID_IPV4_ADDR:
if (len < 4)
- printf(" len=%d [bad: < 4]", len);
+ ND_PRINT((ndo," len=%d [bad: < 4]", len));
else
- printf(" len=%d %s", len, ipaddr_string(data));
+ ND_PRINT((ndo," len=%d %s", len, ipaddr_string(data)));
len = 0;
break;
case IPSECDOI_ID_FQDN:
@@ -746,7 +945,7 @@
case IPSECDOI_ID_USER_FQDN:
{
int i;
- printf(" len=%d ", len);
+ ND_PRINT((ndo," len=%d ", len));
for (i = 0; i < len; i++)
safeputchar(data[i]);
len = 0;
@@ -756,12 +955,12 @@
{
const u_char *mask;
if (len < 8)
- printf(" len=%d [bad: < 8]", len);
+ ND_PRINT((ndo," len=%d [bad: < 8]", len));
else {
mask = data + sizeof(struct in_addr);
- printf(" len=%d %s/%u.%u.%u.%u", len,
- ipaddr_string(data),
- mask[0], mask[1], mask[2], mask[3]);
+ ND_PRINT((ndo," len=%d %s/%u.%u.%u.%u", len,
+ ipaddr_string(data),
+ mask[0], mask[1], mask[2], mask[3]));
}
len = 0;
break;
@@ -769,9 +968,9 @@
#ifdef INET6
case IPSECDOI_ID_IPV6_ADDR:
if (len < 16)
- printf(" len=%d [bad: < 16]", len);
+ ND_PRINT((ndo," len=%d [bad: < 16]", len));
else
- printf(" len=%d %s", len, ip6addr_string(data));
+ ND_PRINT((ndo," len=%d %s", len, ip6addr_string(data)));
len = 0;
break;
case IPSECDOI_ID_IPV6_ADDR_SUBNET:
@@ -778,13 +977,13 @@
{
const u_int32_t *mask;
if (len < 20)
- printf(" len=%d [bad: < 20]", len);
+ ND_PRINT((ndo," len=%d [bad: < 20]", len));
else {
mask = (u_int32_t *)(data + sizeof(struct in6_addr));
/*XXX*/
- printf(" len=%d %s/0x%08x%08x%08x%08x", len,
- ip6addr_string(data),
- mask[0], mask[1], mask[2], mask[3]);
+ ND_PRINT((ndo," len=%d %s/0x%08x%08x%08x%08x", len,
+ ip6addr_string(data),
+ mask[0], mask[1], mask[2], mask[3]));
}
len = 0;
break;
@@ -792,11 +991,11 @@
#endif /*INET6*/
case IPSECDOI_ID_IPV4_ADDR_RANGE:
if (len < 8)
- printf(" len=%d [bad: < 8]", len);
+ ND_PRINT((ndo," len=%d [bad: < 8]", len));
else {
- printf(" len=%d %s-%s", len,
- ipaddr_string(data),
- ipaddr_string(data + sizeof(struct in_addr)));
+ ND_PRINT((ndo," len=%d %s-%s", len,
+ ipaddr_string(data),
+ ipaddr_string(data + sizeof(struct in_addr))));
}
len = 0;
break;
@@ -803,11 +1002,11 @@
#ifdef INET6
case IPSECDOI_ID_IPV6_ADDR_RANGE:
if (len < 32)
- printf(" len=%d [bad: < 32]", len);
+ ND_PRINT((ndo," len=%d [bad: < 32]", len));
else {
- printf(" len=%d %s-%s", len,
- ip6addr_string(data),
- ip6addr_string(data + sizeof(struct in6_addr)));
+ ND_PRINT((ndo," len=%d %s-%s", len,
+ ip6addr_string(data),
+ ip6addr_string(data + sizeof(struct in6_addr))));
}
len = 0;
break;
@@ -821,27 +1020,28 @@
}
}
if (data && len) {
- printf(" len=%d", len);
- if (2 < vflag) {
- printf(" ");
- if (!rawprint((caddr_t)data, len))
+ ND_PRINT((ndo," len=%d", len));
+ if (2 < ndo->ndo_vflag) {
+ ND_PRINT((ndo," "));
+ if (!rawprint(ndo, (caddr_t)data, len))
goto trunc;
}
}
return (u_char *)ext + item_len;
trunc:
- printf(" [|%s]", NPSTR(ISAKMP_NPTYPE_ID));
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_ID)));
return NULL;
}
static const u_char *
-isakmp_cert_print(const struct isakmp_gen *ext, u_int item_len _U_,
- const u_char *ep _U_, u_int32_t phase _U_,
- u_int32_t doi0 _U_,
- u_int32_t proto0 _U_, int depth _U_)
+ikev1_cert_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext, u_int item_len _U_,
+ const u_char *ep _U_, u_int32_t phase _U_,
+ u_int32_t doi0 _U_,
+ u_int32_t proto0 _U_, int depth _U_)
{
- const struct isakmp_pl_cert *p;
- struct isakmp_pl_cert cert;
+ const struct ikev1_pl_cert *p;
+ struct ikev1_pl_cert cert;
static const char *certstr[] = {
"none", "pkcs7", "pgp", "dns",
"x509sign", "x509ke", "kerberos", "crl",
@@ -848,31 +1048,32 @@
"arl", "spki", "x509attr",
};
- printf("%s:", NPSTR(ISAKMP_NPTYPE_CERT));
+ ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_CERT)));
- p = (struct isakmp_pl_cert *)ext;
- TCHECK(*p);
+ p = (struct ikev1_pl_cert *)ext;
+ ND_TCHECK(*p);
safememcpy(&cert, ext, sizeof(cert));
- printf(" len=%d", item_len - 4);
- printf(" type=%s", STR_OR_ID((cert.encode), certstr));
- if (2 < vflag && 4 < item_len) {
- printf(" ");
- if (!rawprint((caddr_t)(ext + 1), item_len - 4))
+ ND_PRINT((ndo," len=%d", item_len - 4));
+ ND_PRINT((ndo," type=%s", STR_OR_ID((cert.encode), certstr)));
+ if (2 < ndo->ndo_vflag && 4 < item_len) {
+ ND_PRINT((ndo," "));
+ if (!rawprint(ndo, (caddr_t)(ext + 1), item_len - 4))
goto trunc;
}
return (u_char *)ext + item_len;
trunc:
- printf(" [|%s]", NPSTR(ISAKMP_NPTYPE_CERT));
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_CERT)));
return NULL;
}
static const u_char *
-isakmp_cr_print(const struct isakmp_gen *ext, u_int item_len _U_,
- const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi0 _U_,
- u_int32_t proto0 _U_, int depth _U_)
+ikev1_cr_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext, u_int item_len _U_,
+ const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi0 _U_,
+ u_int32_t proto0 _U_, int depth _U_)
{
- const struct isakmp_pl_cert *p;
- struct isakmp_pl_cert cert;
+ const struct ikev1_pl_cert *p;
+ struct ikev1_pl_cert cert;
static const char *certstr[] = {
"none", "pkcs7", "pgp", "dns",
"x509sign", "x509ke", "kerberos", "crl",
@@ -879,101 +1080,109 @@
"arl", "spki", "x509attr",
};
- printf("%s:", NPSTR(ISAKMP_NPTYPE_CR));
+ ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_CR)));
- p = (struct isakmp_pl_cert *)ext;
- TCHECK(*p);
+ p = (struct ikev1_pl_cert *)ext;
+ ND_TCHECK(*p);
safememcpy(&cert, ext, sizeof(cert));
- printf(" len=%d", item_len - 4);
- printf(" type=%s", STR_OR_ID((cert.encode), certstr));
- if (2 < vflag && 4 < item_len) {
- printf(" ");
- if (!rawprint((caddr_t)(ext + 1), item_len - 4))
+ ND_PRINT((ndo," len=%d", item_len - 4));
+ ND_PRINT((ndo," type=%s", STR_OR_ID((cert.encode), certstr)));
+ if (2 < ndo->ndo_vflag && 4 < item_len) {
+ ND_PRINT((ndo," "));
+ if (!rawprint(ndo, (caddr_t)(ext + 1), item_len - 4))
goto trunc;
}
return (u_char *)ext + item_len;
trunc:
- printf(" [|%s]", NPSTR(ISAKMP_NPTYPE_CR));
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_CR)));
return NULL;
}
static const u_char *
-isakmp_hash_print(const struct isakmp_gen *ext, u_int item_len _U_,
- const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_,
- u_int32_t proto _U_, int depth _U_)
+ikev1_hash_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext, u_int item_len _U_,
+ const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
{
struct isakmp_gen e;
- printf("%s:", NPSTR(ISAKMP_NPTYPE_HASH));
+ ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_HASH)));
- TCHECK(*ext);
+ ND_TCHECK(*ext);
safememcpy(&e, ext, sizeof(e));
- printf(" len=%d", ntohs(e.len) - 4);
- if (2 < vflag && 4 < ntohs(e.len)) {
- printf(" ");
- if (!rawprint((caddr_t)(ext + 1), ntohs(e.len) - 4))
+ ND_PRINT((ndo," len=%d", ntohs(e.len) - 4));
+ if (2 < ndo->ndo_vflag && 4 < ntohs(e.len)) {
+ ND_PRINT((ndo," "));
+ if (!rawprint(ndo, (caddr_t)(ext + 1), ntohs(e.len) - 4))
goto trunc;
}
return (u_char *)ext + ntohs(e.len);
trunc:
- printf(" [|%s]", NPSTR(ISAKMP_NPTYPE_HASH));
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_HASH)));
return NULL;
}
static const u_char *
-isakmp_sig_print(const struct isakmp_gen *ext, u_int item_len _U_,
- const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_,
- u_int32_t proto _U_, int depth _U_)
+ikev1_sig_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext, u_int item_len _U_,
+ const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
{
struct isakmp_gen e;
- printf("%s:", NPSTR(ISAKMP_NPTYPE_SIG));
+ ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_SIG)));
- TCHECK(*ext);
+ ND_TCHECK(*ext);
safememcpy(&e, ext, sizeof(e));
- printf(" len=%d", ntohs(e.len) - 4);
- if (2 < vflag && 4 < ntohs(e.len)) {
- printf(" ");
- if (!rawprint((caddr_t)(ext + 1), ntohs(e.len) - 4))
+ ND_PRINT((ndo," len=%d", ntohs(e.len) - 4));
+ if (2 < ndo->ndo_vflag && 4 < ntohs(e.len)) {
+ ND_PRINT((ndo," "));
+ if (!rawprint(ndo, (caddr_t)(ext + 1), ntohs(e.len) - 4))
goto trunc;
}
return (u_char *)ext + ntohs(e.len);
trunc:
- printf(" [|%s]", NPSTR(ISAKMP_NPTYPE_SIG));
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_SIG)));
return NULL;
}
static const u_char *
-isakmp_nonce_print(const struct isakmp_gen *ext,
- u_int item_len _U_,
- const u_char *ep _U_,
- u_int32_t phase _U_, u_int32_t doi _U_,
- u_int32_t proto _U_, int depth _U_)
+ikev1_nonce_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_,
+ const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
{
struct isakmp_gen e;
- printf("%s:", NPSTR(ISAKMP_NPTYPE_NONCE));
+ ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_NONCE)));
- TCHECK(*ext);
+ ND_TCHECK(*ext);
safememcpy(&e, ext, sizeof(e));
- printf(" n len=%d", ntohs(e.len) - 4);
- if (2 < vflag && 4 < ntohs(e.len)) {
- printf(" ");
- if (!rawprint((caddr_t)(ext + 1), ntohs(e.len) - 4))
+ ND_PRINT((ndo," n len=%d", ntohs(e.len) - 4));
+ if (2 < ndo->ndo_vflag && 4 < ntohs(e.len)) {
+ ND_PRINT((ndo," "));
+ if (!rawprint(ndo, (caddr_t)(ext + 1), ntohs(e.len) - 4))
goto trunc;
+ } else if (1 < ndo->ndo_vflag && 4 < ntohs(e.len)) {
+ ND_PRINT((ndo," "));
+ if (!ike_show_somedata(ndo, (u_char *)(caddr_t)(ext + 1), ep))
+ goto trunc;
}
return (u_char *)ext + ntohs(e.len);
trunc:
- printf(" [|%s]", NPSTR(ISAKMP_NPTYPE_NONCE));
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_NONCE)));
return NULL;
}
static const u_char *
-isakmp_n_print(const struct isakmp_gen *ext, u_int item_len,
- const u_char *ep, u_int32_t phase, u_int32_t doi0 _U_,
- u_int32_t proto0 _U_, int depth)
+ikev1_n_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext, u_int item_len,
+ const u_char *ep, u_int32_t phase, u_int32_t doi0 _U_,
+ u_int32_t proto0 _U_, int depth)
{
- struct isakmp_pl_n *p, n;
+ struct ikev1_pl_n *p, n;
const u_char *cp;
u_char *ep2;
u_int32_t doi;
@@ -1024,47 +1233,47 @@
#define IPSEC_NOTIFY_STATUS_STR(x) \
STR_OR_ID((u_int)((x) - 24576), ipsec_notify_status_str)
- printf("%s:", NPSTR(ISAKMP_NPTYPE_N));
+ ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_N)));
- p = (struct isakmp_pl_n *)ext;
- TCHECK(*p);
+ p = (struct ikev1_pl_n *)ext;
+ ND_TCHECK(*p);
safememcpy(&n, ext, sizeof(n));
doi = ntohl(n.doi);
proto = n.prot_id;
if (doi != 1) {
- printf(" doi=%d", doi);
- printf(" proto=%d", proto);
+ ND_PRINT((ndo," doi=%d", doi));
+ ND_PRINT((ndo," proto=%d", proto));
if (ntohs(n.type) < 8192)
- printf(" type=%s", NOTIFY_ERROR_STR(ntohs(n.type)));
+ ND_PRINT((ndo," type=%s", NOTIFY_ERROR_STR(ntohs(n.type))));
else if (ntohs(n.type) < 16384)
- printf(" type=%s", numstr(ntohs(n.type)));
+ ND_PRINT((ndo," type=%s", numstr(ntohs(n.type))));
else if (ntohs(n.type) < 24576)
- printf(" type=%s", NOTIFY_STATUS_STR(ntohs(n.type)));
+ ND_PRINT((ndo," type=%s", NOTIFY_STATUS_STR(ntohs(n.type))));
else
- printf(" type=%s", numstr(ntohs(n.type)));
+ ND_PRINT((ndo," type=%s", numstr(ntohs(n.type))));
if (n.spi_size) {
- printf(" spi=");
- if (!rawprint((caddr_t)(p + 1), n.spi_size))
+ ND_PRINT((ndo," spi="));
+ if (!rawprint(ndo, (caddr_t)(p + 1), n.spi_size))
goto trunc;
}
return (u_char *)(p + 1) + n.spi_size;
}
- printf(" doi=ipsec");
- printf(" proto=%s", PROTOIDSTR(proto));
+ ND_PRINT((ndo," doi=ipsec"));
+ ND_PRINT((ndo," proto=%s", PROTOIDSTR(proto)));
if (ntohs(n.type) < 8192)
- printf(" type=%s", NOTIFY_ERROR_STR(ntohs(n.type)));
+ ND_PRINT((ndo," type=%s", NOTIFY_ERROR_STR(ntohs(n.type))));
else if (ntohs(n.type) < 16384)
- printf(" type=%s", IPSEC_NOTIFY_ERROR_STR(ntohs(n.type)));
+ ND_PRINT((ndo," type=%s", IPSEC_NOTIFY_ERROR_STR(ntohs(n.type))));
else if (ntohs(n.type) < 24576)
- printf(" type=%s", NOTIFY_STATUS_STR(ntohs(n.type)));
+ ND_PRINT((ndo," type=%s", NOTIFY_STATUS_STR(ntohs(n.type))));
else if (ntohs(n.type) < 32768)
- printf(" type=%s", IPSEC_NOTIFY_STATUS_STR(ntohs(n.type)));
+ ND_PRINT((ndo," type=%s", IPSEC_NOTIFY_STATUS_STR(ntohs(n.type))));
else
- printf(" type=%s", numstr(ntohs(n.type)));
+ ND_PRINT((ndo," type=%s", numstr(ntohs(n.type))));
if (n.spi_size) {
- printf(" spi=");
- if (!rawprint((caddr_t)(p + 1), n.spi_size))
+ ND_PRINT((ndo," spi="));
+ if (!rawprint(ndo, (caddr_t)(p + 1), n.spi_size))
goto trunc;
}
@@ -1072,7 +1281,7 @@
ep2 = (u_char *)p + item_len;
if (cp < ep) {
- printf(" orig=(");
+ ND_PRINT((ndo," orig=("));
switch (ntohs(n.type)) {
case IPSECDOI_NTYPE_RESPONDER_LIFETIME:
{
@@ -1079,112 +1288,843 @@
const struct attrmap *map = oakley_t_map;
size_t nmap = sizeof(oakley_t_map)/sizeof(oakley_t_map[0]);
while (cp < ep && cp < ep2) {
- cp = isakmp_attrmap_print(cp,
+ cp = ikev1_attrmap_print(ndo, cp,
(ep < ep2) ? ep : ep2, map, nmap);
}
break;
}
case IPSECDOI_NTYPE_REPLAY_STATUS:
- printf("replay detection %sabled",
- (*(u_int32_t *)cp) ? "en" : "dis");
+ ND_PRINT((ndo,"replay detection %sabled",
+ (*(u_int32_t *)cp) ? "en" : "dis"));
break;
case ISAKMP_NTYPE_NO_PROPOSAL_CHOSEN:
- if (isakmp_sub_print(ISAKMP_NPTYPE_SA,
- (struct isakmp_gen *)cp, ep, phase, doi, proto,
- depth) == NULL)
+ if (ikev1_sub_print(ndo, ISAKMP_NPTYPE_SA,
+ (struct isakmp_gen *)cp, ep, phase, doi, proto,
+ depth) == NULL)
return NULL;
break;
default:
/* NULL is dummy */
- isakmp_print(gndo, cp,
+ isakmp_print(ndo, cp,
item_len - sizeof(*p) - n.spi_size,
NULL);
}
- printf(")");
+ ND_PRINT((ndo,")"));
}
return (u_char *)ext + item_len;
trunc:
- printf(" [|%s]", NPSTR(ISAKMP_NPTYPE_N));
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_N)));
return NULL;
}
static const u_char *
-isakmp_d_print(const struct isakmp_gen *ext, u_int item_len _U_,
- const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi0 _U_,
- u_int32_t proto0 _U_, int depth _U_)
+ikev1_d_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext, u_int item_len _U_,
+ const u_char *ep _U_, u_int32_t phase _U_, u_int32_t doi0 _U_,
+ u_int32_t proto0 _U_, int depth _U_)
{
- const struct isakmp_pl_d *p;
- struct isakmp_pl_d d;
+ const struct ikev1_pl_d *p;
+ struct ikev1_pl_d d;
const u_int8_t *q;
u_int32_t doi;
u_int32_t proto;
int i;
- printf("%s:", NPSTR(ISAKMP_NPTYPE_D));
+ ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_D)));
- p = (struct isakmp_pl_d *)ext;
- TCHECK(*p);
+ p = (struct ikev1_pl_d *)ext;
+ ND_TCHECK(*p);
safememcpy(&d, ext, sizeof(d));
doi = ntohl(d.doi);
proto = d.prot_id;
if (doi != 1) {
- printf(" doi=%u", doi);
- printf(" proto=%u", proto);
+ ND_PRINT((ndo," doi=%u", doi));
+ ND_PRINT((ndo," proto=%u", proto));
} else {
- printf(" doi=ipsec");
- printf(" proto=%s", PROTOIDSTR(proto));
+ ND_PRINT((ndo," doi=ipsec"));
+ ND_PRINT((ndo," proto=%s", PROTOIDSTR(proto)));
}
- printf(" spilen=%u", d.spi_size);
- printf(" nspi=%u", ntohs(d.num_spi));
- printf(" spi=");
+ ND_PRINT((ndo," spilen=%u", d.spi_size));
+ ND_PRINT((ndo," nspi=%u", ntohs(d.num_spi)));
+ ND_PRINT((ndo," spi="));
q = (u_int8_t *)(p + 1);
for (i = 0; i < ntohs(d.num_spi); i++) {
if (i != 0)
- printf(",");
- if (!rawprint((caddr_t)q, d.spi_size))
+ ND_PRINT((ndo,","));
+ if (!rawprint(ndo, (caddr_t)q, d.spi_size))
goto trunc;
q += d.spi_size;
}
return q;
trunc:
- printf(" [|%s]", NPSTR(ISAKMP_NPTYPE_D));
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_D)));
return NULL;
}
static const u_char *
-isakmp_vid_print(const struct isakmp_gen *ext,
- u_int item_len _U_, const u_char *ep _U_,
- u_int32_t phase _U_, u_int32_t doi _U_,
- u_int32_t proto _U_, int depth _U_)
+ikev1_vid_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
{
struct isakmp_gen e;
- printf("%s:", NPSTR(ISAKMP_NPTYPE_VID));
+ ND_PRINT((ndo,"%s:", NPSTR(ISAKMP_NPTYPE_VID)));
- TCHECK(*ext);
+ ND_TCHECK(*ext);
safememcpy(&e, ext, sizeof(e));
- printf(" len=%d", ntohs(e.len) - 4);
- if (2 < vflag && 4 < ntohs(e.len)) {
- printf(" ");
- if (!rawprint((caddr_t)(ext + 1), ntohs(e.len) - 4))
+ ND_PRINT((ndo," len=%d", ntohs(e.len) - 4));
+ if (2 < ndo->ndo_vflag && 4 < ntohs(e.len)) {
+ ND_PRINT((ndo," "));
+ if (!rawprint(ndo, (caddr_t)(ext + 1), ntohs(e.len) - 4))
goto trunc;
}
return (u_char *)ext + ntohs(e.len);
trunc:
- printf(" [|%s]", NPSTR(ISAKMP_NPTYPE_VID));
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_VID)));
return NULL;
}
+/************************************************************/
+/* */
+/* IKE v2 - rfc4306 - dissector */
+/* */
+/************************************************************/
+
+static void
+ikev2_pay_print(netdissect_options *ndo, const char *payname, int critical)
+{
+ ND_PRINT((ndo,"%s%s:", payname, critical&0x80 ? "[C]" : ""));
+}
+
static const u_char *
-isakmp_sub0_print(u_char np, const struct isakmp_gen *ext, const u_char *ep,
- u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
+ikev2_gen_print(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext)
{
+ struct isakmp_gen e;
+
+ ND_TCHECK(*ext);
+ safememcpy(&e, ext, sizeof(e));
+ ikev2_pay_print(ndo, NPSTR(tpay), e.critical);
+
+ ND_PRINT((ndo," len=%d", ntohs(e.len) - 4));
+ if (2 < ndo->ndo_vflag && 4 < ntohs(e.len)) {
+ ND_PRINT((ndo," "));
+ if (!rawprint(ndo, (caddr_t)(ext + 1), ntohs(e.len) - 4))
+ goto trunc;
+ }
+ return (u_char *)ext + ntohs(e.len);
+trunc:
+ ND_PRINT((ndo," [|%s]", NPSTR(tpay)));
+ return NULL;
+}
+
+static const u_char *
+ikev2_t_print(netdissect_options *ndo, u_char tpay _U_, int pcount,
+ const struct isakmp_gen *ext, u_int item_len,
+ const u_char *ep, u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
+ const struct ikev2_t *p;
+ struct ikev2_t t;
+ u_int16_t t_id;
const u_char *cp;
+ const char *idstr;
+ const struct attrmap *map;
+ size_t nmap;
+ const u_char *ep2;
+
+ p = (struct ikev2_t *)ext;
+ ND_TCHECK(*p);
+ safememcpy(&t, ext, sizeof(t));
+ ikev2_pay_print(ndo, NPSTR(ISAKMP_NPTYPE_T), t.h.critical);
+
+ t_id = ntohs(t.t_id);
+
+ map = NULL;
+ nmap = 0;
+
+ switch (t.t_type) {
+ case IV2_T_ENCR:
+ idstr = STR_OR_ID(t_id, esp_p_map);
+ map = encr_t_map;
+ nmap = sizeof(encr_t_map)/sizeof(encr_t_map[0]);
+ break;
+
+ case IV2_T_PRF:
+ idstr = STR_OR_ID(t_id, prf_p_map);
+ break;
+
+ case IV2_T_INTEG:
+ idstr = STR_OR_ID(t_id, integ_p_map);
+ break;
+
+ case IV2_T_DH:
+ idstr = STR_OR_ID(t_id, dh_p_map);
+ break;
+
+ case IV2_T_ESN:
+ idstr = STR_OR_ID(t_id, esn_p_map);
+ break;
+
+ default:
+ idstr = NULL;
+ break;
+ }
+
+ if (idstr)
+ ND_PRINT((ndo," #%u type=%s id=%s ", pcount,
+ STR_OR_ID(t.t_type, ikev2_t_type_map),
+ idstr));
+ else
+ ND_PRINT((ndo," #%u type=%s id=%u ", pcount,
+ STR_OR_ID(t.t_type, ikev2_t_type_map),
+ t.t_id));
+ cp = (u_char *)(p + 1);
+ ep2 = (u_char *)p + item_len;
+ while (cp < ep && cp < ep2) {
+ if (map && nmap) {
+ cp = ikev1_attrmap_print(ndo, cp, (ep < ep2) ? ep : ep2,
+ map, nmap);
+ } else
+ cp = ikev1_attr_print(ndo, cp, (ep < ep2) ? ep : ep2);
+ }
+ if (ep < ep2)
+ ND_PRINT((ndo,"..."));
+ return cp;
+trunc:
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_T)));
+ return NULL;
+}
+
+static const u_char *
+ikev2_p_print(netdissect_options *ndo, u_char tpay _U_, int pcount _U_,
+ const struct isakmp_gen *ext, u_int item_len _U_,
+ const u_char *ep, u_int32_t phase, u_int32_t doi0,
+ u_int32_t proto0 _U_, int depth)
+{
+ const struct ikev2_p *p;
+ struct ikev2_p prop;
+ const u_char *cp;
+
+ p = (struct ikev2_p *)ext;
+ ND_TCHECK(*p);
+ safememcpy(&prop, ext, sizeof(prop));
+ ikev2_pay_print(ndo, NPSTR(ISAKMP_NPTYPE_P), prop.h.critical);
+
+ ND_PRINT((ndo," #%u protoid=%s transform=%d len=%u",
+ prop.p_no, PROTOIDSTR(prop.prot_id),
+ prop.num_t, ntohs(prop.h.len)));
+ if (prop.spi_size) {
+ ND_PRINT((ndo," spi="));
+ if (!rawprint(ndo, (caddr_t)(p + 1), prop.spi_size))
+ goto trunc;
+ }
+
+ ext = (struct isakmp_gen *)((u_char *)(p + 1) + prop.spi_size);
+ ND_TCHECK(*ext);
+
+ cp = ikev2_sub_print(ndo, NULL, ISAKMP_NPTYPE_T, ext, ep, phase, doi0,
+ prop.prot_id, depth);
+
+ return cp;
+trunc:
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_P)));
+ return NULL;
+}
+
+static const u_char *
+ikev2_sa_print(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext1,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
struct isakmp_gen e;
+ int osa_length, sa_length;
+
+ ND_TCHECK(*ext1);
+ safememcpy(&e, ext1, sizeof(e));
+ ikev2_pay_print(ndo, "sa", e.critical);
+
+ osa_length= ntohs(e.len);
+ sa_length = osa_length - 4;
+ ND_PRINT((ndo," len=%d", sa_length));
+
+ ikev2_sub_print(ndo, NULL, ISAKMP_NPTYPE_P,
+ ext1+1, ep,
+ 0, 0, 0, depth);
+
+ return (u_char *)ext1 + osa_length;
+trunc:
+ ND_PRINT((ndo," [|%s]", NPSTR(tpay)));
+ return NULL;
+}
+
+static const u_char *
+ikev2_ke_print(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
+ struct ikev2_ke ke;
+ struct ikev2_ke *k;
+
+ k = (struct ikev2_ke *)ext;
+ ND_TCHECK(*ext);
+ safememcpy(&ke, ext, sizeof(ke));
+ ikev2_pay_print(ndo, NPSTR(tpay), ke.h.critical);
+
+ ND_PRINT((ndo," len=%u group=%s", ntohs(ke.h.len) - 8,
+ STR_OR_ID(ntohs(ke.ke_group), dh_p_map)));
+
+ if (2 < ndo->ndo_vflag && 8 < ntohs(ke.h.len)) {
+ ND_PRINT((ndo," "));
+ if (!rawprint(ndo, (caddr_t)(k + 1), ntohs(ke.h.len) - 8))
+ goto trunc;
+ }
+ return (u_char *)ext + ntohs(ke.h.len);
+trunc:
+ ND_PRINT((ndo," [|%s]", NPSTR(tpay)));
+ return NULL;
+}
+
+static const u_char *
+ikev2_ID_print(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
+ struct ikev2_id id;
+ int id_len, idtype_len, i;
+ unsigned int dumpascii, dumphex;
+ unsigned char *typedata;
+
+ ND_TCHECK(*ext);
+ safememcpy(&id, ext, sizeof(id));
+ ikev2_pay_print(ndo, NPSTR(tpay), id.h.critical);
+
+ id_len = ntohs(id.h.len);
+
+ ND_PRINT((ndo," len=%d", id_len - 4));
+ if (2 < ndo->ndo_vflag && 4 < id_len) {
+ ND_PRINT((ndo," "));
+ if (!rawprint(ndo, (caddr_t)(ext + 1), id_len - 4))
+ goto trunc;
+ }
+
+ idtype_len =id_len - sizeof(struct ikev2_id);
+ dumpascii = 0;
+ dumphex = 0;
+ typedata = (unsigned char *)(ext)+sizeof(struct ikev2_id);
+
+ switch(id.type) {
+ case ID_IPV4_ADDR:
+ ND_PRINT((ndo, " ipv4:"));
+ dumphex=1;
+ break;
+ case ID_FQDN:
+ ND_PRINT((ndo, " fqdn:"));
+ dumpascii=1;
+ break;
+ case ID_RFC822_ADDR:
+ ND_PRINT((ndo, " rfc822:"));
+ dumpascii=1;
+ break;
+ case ID_IPV6_ADDR:
+ ND_PRINT((ndo, " ipv6:"));
+ dumphex=1;
+ break;
+ case ID_DER_ASN1_DN:
+ ND_PRINT((ndo, " dn:"));
+ dumphex=1;
+ break;
+ case ID_DER_ASN1_GN:
+ ND_PRINT((ndo, " gn:"));
+ dumphex=1;
+ break;
+ case ID_KEY_ID:
+ ND_PRINT((ndo, " keyid:"));
+ dumphex=1;
+ break;
+ }
+
+ if(dumpascii) {
+ ND_TCHECK2(*typedata, idtype_len);
+ for(i=0; i<idtype_len; i++) {
+ if(isprint(typedata[i])) {
+ ND_PRINT((ndo, "%c", typedata[i]));
+ } else {
+ ND_PRINT((ndo, "."));
+ }
+ }
+ }
+ if(dumphex) {
+ if (!rawprint(ndo, (caddr_t)typedata, idtype_len))
+ goto trunc;
+ }
+
+ return (u_char *)ext + id_len;
+trunc:
+ ND_PRINT((ndo," [|%s]", NPSTR(tpay)));
+ return NULL;
+}
+
+static const u_char *
+ikev2_cert_print(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
+ return ikev2_gen_print(ndo, tpay, ext);
+}
+
+static const u_char *
+ikev2_cr_print(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
+ return ikev2_gen_print(ndo, tpay, ext);
+}
+
+static const u_char *
+ikev2_auth_print(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
+ struct ikev2_auth a;
+ const char *v2_auth[]={ "invalid", "rsasig",
+ "shared-secret", "dsssig" };
+ u_char *authdata = (u_char*)ext + sizeof(a);
+ unsigned int len;
+
+ ND_TCHECK(*ext);
+ safememcpy(&a, ext, sizeof(a));
+ ikev2_pay_print(ndo, NPSTR(tpay), a.h.critical);
+ len = ntohs(a.h.len);
+
+ ND_PRINT((ndo," len=%d method=%s", len-4,
+ STR_OR_ID(a.auth_method, v2_auth)));
+
+ if (1 < ndo->ndo_vflag && 4 < len) {
+ ND_PRINT((ndo," authdata=("));
+ if (!rawprint(ndo, (caddr_t)authdata, len - sizeof(a)))
+ goto trunc;
+ ND_PRINT((ndo,") "));
+ } else if(ndo->ndo_vflag && 4 < len) {
+ if(!ike_show_somedata(ndo, authdata, ep)) goto trunc;
+ }
+
+ return (u_char *)ext + len;
+trunc:
+ ND_PRINT((ndo," [|%s]", NPSTR(tpay)));
+ return NULL;
+}
+
+static const u_char *
+ikev2_nonce_print(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
+ struct isakmp_gen e;
+
+ ND_TCHECK(*ext);
+ safememcpy(&e, ext, sizeof(e));
+ ikev2_pay_print(ndo, "nonce", e.critical);
+
+ ND_PRINT((ndo," len=%d", ntohs(e.len) - 4));
+ if (1 < ndo->ndo_vflag && 4 < ntohs(e.len)) {
+ ND_PRINT((ndo," nonce=("));
+ if (!rawprint(ndo, (caddr_t)(ext + 1), ntohs(e.len) - 4))
+ goto trunc;
+ ND_PRINT((ndo,") "));
+ } else if(ndo->ndo_vflag && 4 < ntohs(e.len)) {
+ if(!ike_show_somedata(ndo, (const u_char *)(ext+1), ep)) goto trunc;
+ }
+
+ return (u_char *)ext + ntohs(e.len);
+trunc:
+ ND_PRINT((ndo," [|%s]", NPSTR(tpay)));
+ return NULL;
+}
+
+/* notify payloads */
+static const u_char *
+ikev2_n_print(netdissect_options *ndo, u_char tpay _U_,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
+ struct ikev2_n *p, n;
+ const u_char *cp;
+ u_char *ep2;
+ u_char showspi, showdata, showsomedata;
+ const char *notify_name;
+ u_int32_t type;
+
+ p = (struct ikev2_n *)ext;
+ ND_TCHECK(*p);
+ safememcpy(&n, ext, sizeof(n));
+ ikev2_pay_print(ndo, NPSTR(ISAKMP_NPTYPE_N), n.h.critical);
+
+ showspi = 1;
+ showdata = 0;
+ showsomedata=0;
+ notify_name=NULL;
+
+ ND_PRINT((ndo," prot_id=%s", PROTOIDSTR(n.prot_id)));
+
+ type = ntohs(n.type);
+
+ /* notify space is annoying sparse */
+ switch(type) {
+ case IV2_NOTIFY_UNSUPPORTED_CRITICAL_PAYLOAD:
+ notify_name = "unsupported_critical_payload";
+ showspi = 0;
+ break;
+
+ case IV2_NOTIFY_INVALID_IKE_SPI:
+ notify_name = "invalid_ike_spi";
+ showspi = 1;
+ break;
+
+ case IV2_NOTIFY_INVALID_MAJOR_VERSION:
+ notify_name = "invalid_major_version";
+ showspi = 0;
+ break;
+
+ case IV2_NOTIFY_INVALID_SYNTAX:
+ notify_name = "invalid_syntax";
+ showspi = 1;
+ break;
+
+ case IV2_NOTIFY_INVALID_MESSAGE_ID:
+ notify_name = "invalid_message_id";
+ showspi = 1;
+ break;
+
+ case IV2_NOTIFY_INVALID_SPI:
+ notify_name = "invalid_spi";
+ showspi = 1;
+ break;
+
+ case IV2_NOTIFY_NO_PROPOSAL_CHOSEN:
+ notify_name = "no_protocol_chosen";
+ showspi = 1;
+ break;
+
+ case IV2_NOTIFY_INVALID_KE_PAYLOAD:
+ notify_name = "invalid_ke_payload";
+ showspi = 1;
+ break;
+
+ case IV2_NOTIFY_AUTHENTICATION_FAILED:
+ notify_name = "authentication_failed";
+ showspi = 1;
+ break;
+
+ case IV2_NOTIFY_SINGLE_PAIR_REQUIRED:
+ notify_name = "single_pair_required";
+ showspi = 1;
+ break;
+
+ case IV2_NOTIFY_NO_ADDITIONAL_SAS:
+ notify_name = "no_additional_sas";
+ showspi = 0;
+ break;
+
+ case IV2_NOTIFY_INTERNAL_ADDRESS_FAILURE:
+ notify_name = "internal_address_failure";
+ showspi = 0;
+ break;
+
+ case IV2_NOTIFY_FAILED_CP_REQUIRED:
+ notify_name = "failed:cp_required";
+ showspi = 0;
+ break;
+
+ case IV2_NOTIFY_INVALID_SELECTORS:
+ notify_name = "invalid_selectors";
+ showspi = 0;
+ break;
+
+ case IV2_NOTIFY_INITIAL_CONTACT:
+ notify_name = "initial_contact";
+ showspi = 0;
+ break;
+
+ case IV2_NOTIFY_SET_WINDOW_SIZE:
+ notify_name = "set_window_size";
+ showspi = 0;
+ break;
+
+ case IV2_NOTIFY_ADDITIONAL_TS_POSSIBLE:
+ notify_name = "additional_ts_possible";
+ showspi = 0;
+ break;
+
+ case IV2_NOTIFY_IPCOMP_SUPPORTED:
+ notify_name = "ipcomp_supported";
+ showspi = 0;
+ break;
+
+ case IV2_NOTIFY_NAT_DETECTION_SOURCE_IP:
+ notify_name = "nat_detection_source_ip";
+ showspi = 1;
+ break;
+
+ case IV2_NOTIFY_NAT_DETECTION_DESTINATION_IP:
+ notify_name = "nat_detection_destination_ip";
+ showspi = 1;
+ break;
+
+ case IV2_NOTIFY_COOKIE:
+ notify_name = "cookie";
+ showspi = 1;
+ showsomedata= 1;
+ showdata= 0;
+ break;
+
+ case IV2_NOTIFY_USE_TRANSPORT_MODE:
+ notify_name = "use_transport_mode";
+ showspi = 0;
+ break;
+
+ case IV2_NOTIFY_HTTP_CERT_LOOKUP_SUPPORTED:
+ notify_name = "http_cert_lookup_supported";
+ showspi = 0;
+ break;
+
+ case IV2_NOTIFY_REKEY_SA:
+ notify_name = "rekey_sa";
+ showspi = 1;
+ break;
+
+ case IV2_NOTIFY_ESP_TFC_PADDING_NOT_SUPPORTED:
+ notify_name = "tfc_padding_not_supported";
+ showspi = 0;
+ break;
+
+ case IV2_NOTIFY_NON_FIRST_FRAGMENTS_ALSO:
+ notify_name = "non_first_fragment_also";
+ showspi = 0;
+ break;
+
+ default:
+ if (type < 8192) {
+ notify_name="error";
+ } else if(type < 16384) {
+ notify_name="private-error";
+ } else if(type < 40960) {
+ notify_name="status";
+ } else {
+ notify_name="private-status";
+ }
+ }
+
+ if(notify_name) {
+ ND_PRINT((ndo," type=%u(%s)", type, notify_name));
+ }
+
+
+ if (showspi && n.spi_size) {
+ ND_PRINT((ndo," spi="));
+ if (!rawprint(ndo, (caddr_t)(p + 1), n.spi_size))
+ goto trunc;
+ }
+
+ cp = (u_char *)(p + 1) + n.spi_size;
+ ep2 = (u_char *)p + item_len;
+
+ if(3 < ndo->ndo_vflag) {
+ showdata = 1;
+ }
+
+ if ((showdata || (showsomedata && ep-cp < 30)) && cp < ep) {
+ ND_PRINT((ndo," data=("));
+ if (!rawprint(ndo, (caddr_t)(cp), ep - cp))
+ goto trunc;
+
+ ND_PRINT((ndo,")"));
+
+ } else if(showsomedata && cp < ep) {
+ if(!ike_show_somedata(ndo, cp, ep)) goto trunc;
+ }
+
+ return (u_char *)ext + item_len;
+trunc:
+ ND_PRINT((ndo," [|%s]", NPSTR(ISAKMP_NPTYPE_N)));
+ return NULL;
+}
+
+static const u_char *
+ikev2_d_print(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
+ return ikev2_gen_print(ndo, tpay, ext);
+}
+
+static const u_char *
+ikev2_vid_print(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
+ struct isakmp_gen e;
+ const u_char *vid;
+ int i, len;
+
+ ND_TCHECK(*ext);
+ safememcpy(&e, ext, sizeof(e));
+ ikev2_pay_print(ndo, NPSTR(tpay), e.critical);
+ ND_PRINT((ndo," len=%d vid=", ntohs(e.len) - 4));
+
+ vid = (const u_char *)(ext+1);
+ len = ntohs(e.len) - 4;
+ ND_TCHECK2(*vid, len);
+ for(i=0; i<len; i++) {
+ if(isprint(vid[i])) ND_PRINT((ndo, "%c", vid[i]));
+ else ND_PRINT((ndo, "."));
+ }
+ if (2 < ndo->ndo_vflag && 4 < len) {
+ ND_PRINT((ndo," "));
+ if (!rawprint(ndo, (caddr_t)(ext + 1), ntohs(e.len) - 4))
+ goto trunc;
+ }
+ return (u_char *)ext + ntohs(e.len);
+trunc:
+ ND_PRINT((ndo," [|%s]", NPSTR(tpay)));
+ return NULL;
+}
+
+static const u_char *
+ikev2_TS_print(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
+ return ikev2_gen_print(ndo, tpay, ext);
+}
+
+static const u_char *
+ikev2_e_print(netdissect_options *ndo,
+#ifndef HAVE_LIBCRYPTO
+ _U_
+#endif
+ struct isakmp *base,
+ u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+#ifndef HAVE_LIBCRYPTO
+ _U_
+#endif
+ u_int32_t phase,
+#ifndef HAVE_LIBCRYPTO
+ _U_
+#endif
+ u_int32_t doi,
+#ifndef HAVE_LIBCRYPTO
+ _U_
+#endif
+ u_int32_t proto,
+#ifndef HAVE_LIBCRYPTO
+ _U_
+#endif
+ int depth)
+{
+ struct isakmp_gen e;
+ u_char *dat;
+ volatile int dlen;
+
+ ND_TCHECK(*ext);
+ safememcpy(&e, ext, sizeof(e));
+ ikev2_pay_print(ndo, NPSTR(tpay), e.critical);
+
+ dlen = ntohs(e.len)-4;
+
+ ND_PRINT((ndo," len=%d", dlen));
+ if (2 < ndo->ndo_vflag && 4 < dlen) {
+ ND_PRINT((ndo," "));
+ if (!rawprint(ndo, (caddr_t)(ext + 1), dlen))
+ goto trunc;
+ }
+
+ dat = (u_char *)(ext+1);
+ ND_TCHECK2(*dat, dlen);
+
+#ifdef HAVE_LIBCRYPTO
+ /* try to decypt it! */
+ if(esp_print_decrypt_buffer_by_ikev2(ndo,
+ base->flags & ISAKMP_FLAG_I,
+ base->i_ck, base->r_ck,
+ dat, dat+dlen)) {
+
+ ext = (const struct isakmp_gen *)ndo->ndo_packetp;
+
+ /* got it decrypted, print stuff inside. */
+ ikev2_sub_print(ndo, base, e.np, ext, ndo->ndo_snapend,
+ phase, doi, proto, depth+1);
+ }
+#endif
+
+
+ /* always return NULL, because E must be at end, and NP refers
+ * to what was inside.
+ */
+ return NULL;
+trunc:
+ ND_PRINT((ndo," [|%s]", NPSTR(tpay)));
+ return NULL;
+}
+
+static const u_char *
+ikev2_cp_print(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
+ return ikev2_gen_print(ndo, tpay, ext);
+}
+
+static const u_char *
+ikev2_eap_print(netdissect_options *ndo, u_char tpay,
+ const struct isakmp_gen *ext,
+ u_int item_len _U_, const u_char *ep _U_,
+ u_int32_t phase _U_, u_int32_t doi _U_,
+ u_int32_t proto _U_, int depth _U_)
+{
+ return ikev2_gen_print(ndo, tpay, ext);
+}
+
+static const u_char *
+ike_sub0_print(netdissect_options *ndo,
+ u_char np, const struct isakmp_gen *ext, const u_char *ep,
+
+ u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
+{
+ const u_char *cp;
+ struct isakmp_gen e;
u_int item_len;
cp = (u_char *)ext;
- TCHECK(*ext);
+ ND_TCHECK(*ext);
safememcpy(&e, ext, sizeof(e));
/*
@@ -1202,21 +2142,22 @@
* XXX - what if item_len is too short, or too long,
* for this payload type?
*/
- cp = (*npfunc[np])(ext, item_len, ep, phase, doi, proto, depth);
+ cp = (*npfunc[np])(ndo, np, ext, item_len, ep, phase, doi, proto, depth);
} else {
- printf("%s", NPSTR(np));
+ ND_PRINT((ndo,"%s", NPSTR(np)));
cp += item_len;
}
return cp;
trunc:
- printf(" [|isakmp]");
+ ND_PRINT((ndo," [|isakmp]"));
return NULL;
}
static const u_char *
-isakmp_sub_print(u_char np, const struct isakmp_gen *ext, const u_char *ep,
- u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
+ikev1_sub_print(netdissect_options *ndo,
+ u_char np, const struct isakmp_gen *ext, const u_char *ep,
+ u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
{
const u_char *cp;
int i;
@@ -1225,19 +2166,19 @@
cp = (const u_char *)ext;
while (np) {
- TCHECK(*ext);
+ ND_TCHECK(*ext);
safememcpy(&e, ext, sizeof(e));
- TCHECK2(*ext, ntohs(e.len));
+ ND_TCHECK2(*ext, ntohs(e.len));
depth++;
- printf("\n");
+ ND_PRINT((ndo,"\n"));
for (i = 0; i < depth; i++)
- printf(" ");
- printf("(");
- cp = isakmp_sub0_print(np, ext, ep, phase, doi, proto, depth);
- printf(")");
+ ND_PRINT((ndo," "));
+ ND_PRINT((ndo,"("));
+ cp = ike_sub0_print(ndo, np, ext, ep, phase, doi, proto, depth);
+ ND_PRINT((ndo,")"));
depth--;
if (cp == NULL) {
@@ -1250,7 +2191,7 @@
}
return cp;
trunc:
- printf(" [|%s]", NPSTR(np));
+ ND_PRINT((ndo," [|%s]", NPSTR(np)));
return NULL;
}
@@ -1273,121 +2214,301 @@
memcpy(p, q, l);
}
-void
-isakmp_print(netdissect_options *ndo,
- const u_char *bp, u_int length,
- const u_char *bp2)
+static void
+ikev1_print(netdissect_options *ndo,
+ const u_char *bp, u_int length,
+ const u_char *bp2, struct isakmp *base)
{
const struct isakmp *p;
- struct isakmp base;
const u_char *ep;
u_char np;
int i;
int phase;
- int major, minor;
-
+
p = (const struct isakmp *)bp;
ep = ndo->ndo_snapend;
-
- if ((struct isakmp *)ep < p + 1) {
- printf("[|isakmp]");
- return;
- }
-
- safememcpy(&base, p, sizeof(base));
-
- printf("isakmp");
- if (vflag) {
- major = (base.vers & ISAKMP_VERS_MAJOR)
- >> ISAKMP_VERS_MAJOR_SHIFT;
- minor = (base.vers & ISAKMP_VERS_MINOR)
- >> ISAKMP_VERS_MINOR_SHIFT;
- printf(" %d.%d", major, minor);
- }
-
- if (vflag) {
- printf(" msgid ");
- rawprint((caddr_t)&base.msgid, sizeof(base.msgid));
- }
-
- if (1 < vflag) {
- printf(" cookie ");
- rawprint((caddr_t)&base.i_ck, sizeof(base.i_ck));
- printf("->");
- rawprint((caddr_t)&base.r_ck, sizeof(base.r_ck));
- }
- printf(":");
-
- phase = (*(u_int32_t *)base.msgid == 0) ? 1 : 2;
+
+ phase = (*(u_int32_t *)base->msgid == 0) ? 1 : 2;
if (phase == 1)
- printf(" phase %d", phase);
+ ND_PRINT((ndo," phase %d", phase));
else
- printf(" phase %d/others", phase);
-
- i = cookie_find(&base.i_ck);
+ ND_PRINT((ndo," phase %d/others", phase));
+
+ i = cookie_find(&base->i_ck);
if (i < 0) {
- if (iszero((u_char *)&base.r_ck, sizeof(base.r_ck))) {
+ if (iszero((u_char *)&base->r_ck, sizeof(base->r_ck))) {
/* the first packet */
- printf(" I");
+ ND_PRINT((ndo," I"));
if (bp2)
- cookie_record(&base.i_ck, bp2);
+ cookie_record(&base->i_ck, bp2);
} else
- printf(" ?");
+ ND_PRINT((ndo," ?"));
} else {
if (bp2 && cookie_isinitiator(i, bp2))
- printf(" I");
+ ND_PRINT((ndo," I"));
else if (bp2 && cookie_isresponder(i, bp2))
- printf(" R");
+ ND_PRINT((ndo," R"));
else
- printf(" ?");
+ ND_PRINT((ndo," ?"));
}
+
+ ND_PRINT((ndo," %s", ETYPESTR(base->etype)));
+ if (base->flags) {
+ ND_PRINT((ndo,"[%s%s]", base->flags & ISAKMP_FLAG_E ? "E" : "",
+ base->flags & ISAKMP_FLAG_C ? "C" : ""));
+ }
+
+ if (ndo->ndo_vflag) {
+ const struct isakmp_gen *ext;
+ int nparen;
+
+ ND_PRINT((ndo,":"));
+
+ /* regardless of phase... */
+ if (base->flags & ISAKMP_FLAG_E) {
+ /*
+ * encrypted, nothing we can do right now.
+ * we hope to decrypt the packet in the future...
+ */
+ ND_PRINT((ndo," [encrypted %s]", NPSTR(base->np)));
+ goto done;
+ }
+
+ nparen = 0;
+ CHECKLEN(p + 1, base->np);
+ np = base->np;
+ ext = (struct isakmp_gen *)(p + 1);
+ ikev1_sub_print(ndo, np, ext, ep, phase, 0, 0, 0);
+ }
+
+done:
+ if (ndo->ndo_vflag) {
+ if (ntohl(base->len) != length) {
+ ND_PRINT((ndo," (len mismatch: isakmp %u/ip %u)",
+ (u_int32_t)ntohl(base->len), length));
+ }
+ }
+}
- printf(" %s", ETYPESTR(base.etype));
- if (base.flags) {
- printf("[%s%s]", base.flags & ISAKMP_FLAG_E ? "E" : "",
- base.flags & ISAKMP_FLAG_C ? "C" : "");
+static const u_char *
+ikev2_sub0_print(netdissect_options *ndo, struct isakmp *base,
+ u_char np, int pcount,
+ const struct isakmp_gen *ext, const u_char *ep,
+ u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
+{
+ const u_char *cp;
+ struct isakmp_gen e;
+ u_int item_len;
+
+ cp = (u_char *)ext;
+ ND_TCHECK(*ext);
+ safememcpy(&e, ext, sizeof(e));
+
+ /*
+ * Since we can't have a payload length of less than 4 bytes,
+ * we need to bail out here if the generic header is nonsensical
+ * or truncated, otherwise we could loop forever processing
+ * zero-length items or otherwise misdissect the packet.
+ */
+ item_len = ntohs(e.len);
+ if (item_len <= 4)
+ return NULL;
+
+ if(np == ISAKMP_NPTYPE_P) {
+ cp = ikev2_p_print(ndo, np, pcount, ext, item_len,
+ ep, phase, doi, proto, depth);
+ } else if(np == ISAKMP_NPTYPE_T) {
+ cp = ikev2_t_print(ndo, np, pcount, ext, item_len,
+ ep, phase, doi, proto, depth);
+ } else if(np == ISAKMP_NPTYPE_v2E) {
+ cp = ikev2_e_print(ndo, base, np, ext, item_len,
+ ep, phase, doi, proto, depth);
+ } else if (NPFUNC(np)) {
+ /*
+ * XXX - what if item_len is too short, or too long,
+ * for this payload type?
+ */
+ cp = (*npfunc[np])(ndo, np, /*pcount,*/ ext, item_len,
+ ep, phase, doi, proto, depth);
+ } else {
+ ND_PRINT((ndo,"%s", NPSTR(np)));
+ cp += item_len;
}
- if (vflag) {
+ return cp;
+trunc:
+ ND_PRINT((ndo," [|isakmp]"));
+ return NULL;
+}
+
+static const u_char *
+ikev2_sub_print(netdissect_options *ndo,
+ struct isakmp *base,
+ u_char np, const struct isakmp_gen *ext, const u_char *ep,
+ u_int32_t phase, u_int32_t doi, u_int32_t proto, int depth)
+{
+ const u_char *cp;
+ int i;
+ int pcount;
+ struct isakmp_gen e;
+
+ cp = (const u_char *)ext;
+ pcount = 0;
+ while (np) {
+ pcount++;
+ ND_TCHECK(*ext);
+
+ safememcpy(&e, ext, sizeof(e));
+
+ ND_TCHECK2(*ext, ntohs(e.len));
+
+ depth++;
+ ND_PRINT((ndo,"\n"));
+ for (i = 0; i < depth; i++)
+ ND_PRINT((ndo," "));
+ ND_PRINT((ndo,"("));
+ cp = ikev2_sub0_print(ndo, base, np, pcount,
+ ext, ep, phase, doi, proto, depth);
+ ND_PRINT((ndo,")"));
+ depth--;
+
+ if (cp == NULL) {
+ /* Zero-length subitem */
+ return NULL;
+ }
+
+ np = e.np;
+ ext = (struct isakmp_gen *)cp;
+ }
+ return cp;
+trunc:
+ ND_PRINT((ndo," [|%s]", NPSTR(np)));
+ return NULL;
+}
+
+static void
+ikev2_print(netdissect_options *ndo,
+ const u_char *bp, u_int length,
+ const u_char *bp2 _U_, struct isakmp *base)
+{
+ const struct isakmp *p;
+ const u_char *ep;
+ u_char np;
+ int phase;
+
+ p = (const struct isakmp *)bp;
+ ep = ndo->ndo_snapend;
+
+ phase = (*(u_int32_t *)base->msgid == 0) ? 1 : 2;
+ if (phase == 1)
+ ND_PRINT((ndo, " parent_sa"));
+ else
+ ND_PRINT((ndo, " child_sa "));
+
+ ND_PRINT((ndo, " %s", ETYPESTR(base->etype)));
+ if (base->flags) {
+ ND_PRINT((ndo, "[%s%s%s]",
+ base->flags & ISAKMP_FLAG_I ? "I" : "",
+ base->flags & ISAKMP_FLAG_V ? "V" : "",
+ base->flags & ISAKMP_FLAG_R ? "R" : ""));
+ }
+
+ if (ndo->ndo_vflag) {
const struct isakmp_gen *ext;
int nparen;
-#define CHECKLEN(p, np) \
- if (ep < (u_char *)(p)) { \
- printf(" [|%s]", NPSTR(np)); \
- goto done; \
- }
+ ND_PRINT((ndo, ":"));
- printf(":");
-
/* regardless of phase... */
- if (base.flags & ISAKMP_FLAG_E) {
+ if (base->flags & ISAKMP_FLAG_E) {
/*
* encrypted, nothing we can do right now.
* we hope to decrypt the packet in the future...
*/
- printf(" [encrypted %s]", NPSTR(base.np));
+ ND_PRINT((ndo, " [encrypted %s]", NPSTR(base->np)));
goto done;
}
nparen = 0;
- CHECKLEN(p + 1, base.np)
+ CHECKLEN(p + 1, base->np)
- np = base.np;
+ np = base->np;
ext = (struct isakmp_gen *)(p + 1);
- isakmp_sub_print(np, ext, ep, phase, 0, 0, 0);
+ ikev2_sub_print(ndo, base, np, ext, ep, phase, 0, 0, 0);
}
done:
- if (vflag) {
- if (ntohl(base.len) != length) {
- printf(" (len mismatch: isakmp %u/ip %u)",
- (u_int32_t)ntohl(base.len), length);
+ if (ndo->ndo_vflag) {
+ if (ntohl(base->len) != length) {
+ ND_PRINT((ndo, " (len mismatch: isakmp %u/ip %u)",
+ (u_int32_t)ntohl(base->len), length));
}
}
}
void
+isakmp_print(netdissect_options *ndo,
+ const u_char *bp, u_int length,
+ const u_char *bp2)
+{
+ const struct isakmp *p;
+ struct isakmp base;
+ const u_char *ep;
+ int major, minor;
+
+#ifdef HAVE_LIBCRYPTO
+ /* initialize SAs */
+ if (ndo->ndo_sa_list_head == NULL) {
+ if (ndo->ndo_espsecret)
+ esp_print_decodesecret(ndo);
+ }
+#endif
+
+ p = (const struct isakmp *)bp;
+ ep = ndo->ndo_snapend;
+
+ if ((struct isakmp *)ep < p + 1) {
+ ND_PRINT((ndo,"[|isakmp]"));
+ return;
+ }
+
+ safememcpy(&base, p, sizeof(base));
+
+ ND_PRINT((ndo,"isakmp"));
+ major = (base.vers & ISAKMP_VERS_MAJOR)
+ >> ISAKMP_VERS_MAJOR_SHIFT;
+ minor = (base.vers & ISAKMP_VERS_MINOR)
+ >> ISAKMP_VERS_MINOR_SHIFT;
+
+ if (ndo->ndo_vflag) {
+ ND_PRINT((ndo," %d.%d", major, minor));
+ }
+
+ if (ndo->ndo_vflag) {
+ ND_PRINT((ndo," msgid "));
+ hexprint(ndo, (caddr_t)&base.msgid, sizeof(base.msgid));
+ }
+
+ if (1 < ndo->ndo_vflag) {
+ ND_PRINT((ndo," cookie "));
+ hexprint(ndo, (caddr_t)&base.i_ck, sizeof(base.i_ck));
+ ND_PRINT((ndo,"->"));
+ hexprint(ndo, (caddr_t)&base.r_ck, sizeof(base.r_ck));
+ }
+ ND_PRINT((ndo,":"));
+
+ switch(major) {
+ case IKEv1_MAJOR_VERSION:
+ ikev1_print(ndo, bp, length, bp2, &base);
+ break;
+
+ case IKEv2_MAJOR_VERSION:
+ ikev2_print(ndo, bp, length, bp2, &base);
+ break;
+ }
+}
+
+void
isakmp_rfc3948_print(netdissect_options *ndo,
const u_char *bp, u_int length,
const u_char *bp2)
@@ -1403,7 +2524,7 @@
if(length < 4) {
goto trunc;
}
-
+
/*
* see if this is an IKE packet
*/
@@ -1433,7 +2554,7 @@
}
trunc:
- printf("[|isakmp]");
+ ND_PRINT((ndo,"[|isakmp]"));
return;
}
Modified: trunk/contrib/tcpdump/print-isoclns.c
===================================================================
--- trunk/contrib/tcpdump/print-isoclns.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-isoclns.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -23,12 +23,12 @@
* Extensively modified by Hannes Gredler (hannes at juniper.net) for more
* complete IS-IS & CLNP support.
*
- * $FreeBSD: src/contrib/tcpdump/print-isoclns.c,v 1.16.2.1 2007/10/19 03:03:59 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-isoclns.c 252283 2013-06-27 00:37:59Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-isoclns.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.165 2008-08-16 13:38:15 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -48,10 +48,8 @@
#include "extract.h"
#include "gmpls.h"
#include "oui.h"
+#include "signature.h"
-#define IPV4 1 /* AFI value */
-#define IPV6 2 /* AFI value */
-
/*
* IS-IS is defined in ISO 10589. Look there for protocol definitions.
*/
@@ -130,6 +128,8 @@
#define ISIS_TLV_EXTD_IP_REACH 135 /* draft-ietf-isis-traffic-05 */
#define ISIS_TLV_HOSTNAME 137 /* rfc2763 */
#define ISIS_TLV_SHARED_RISK_GROUP 138 /* draft-ietf-isis-gmpls-extensions */
+#define ISIS_TLV_MT_PORT_CAP 143 /* rfc6165 */
+#define ISIS_TLV_MT_CAPABILITY 144 /* rfc6329 */
#define ISIS_TLV_NORTEL_PRIVATE1 176
#define ISIS_TLV_NORTEL_PRIVATE2 177
#define ISIS_TLV_RESTART_SIGNALING 211 /* rfc3847 */
@@ -174,6 +174,8 @@
{ ISIS_TLV_TE_ROUTER_ID, "Traffic Engineering Router ID"},
{ ISIS_TLV_EXTD_IP_REACH, "Extended IPv4 Reachability"},
{ ISIS_TLV_SHARED_RISK_GROUP, "Shared Risk Link Group"},
+ { ISIS_TLV_MT_PORT_CAP, "Multi-Topology-Aware Port Capability"},
+ { ISIS_TLV_MT_CAPABILITY, "Multi-Topology Capability"},
{ ISIS_TLV_NORTEL_PRIVATE1, "Nortel Proprietary"},
{ ISIS_TLV_NORTEL_PRIVATE2, "Nortel Proprietary"},
{ ISIS_TLV_HOSTNAME, "Hostname"},
@@ -340,7 +342,7 @@
};
#define ISIS_SUBTLV_EXT_IS_REACH_ADMIN_GROUP 3 /* draft-ietf-isis-traffic-05 */
-#define ISIS_SUBTLV_EXT_IS_REACH_LINK_LOCAL_REMOTE_ID 4 /* draft-ietf-isis-gmpls-extensions */
+#define ISIS_SUBTLV_EXT_IS_REACH_LINK_LOCAL_REMOTE_ID 4 /* rfc4205 */
#define ISIS_SUBTLV_EXT_IS_REACH_LINK_REMOTE_ID 5 /* draft-ietf-isis-traffic-05 */
#define ISIS_SUBTLV_EXT_IS_REACH_IPV4_INTF_ADDR 6 /* draft-ietf-isis-traffic-05 */
#define ISIS_SUBTLV_EXT_IS_REACH_IPV4_NEIGHBOR_ADDR 8 /* draft-ietf-isis-traffic-05 */
@@ -349,10 +351,13 @@
#define ISIS_SUBTLV_EXT_IS_REACH_UNRESERVED_BW 11 /* rfc4124 */
#define ISIS_SUBTLV_EXT_IS_REACH_BW_CONSTRAINTS_OLD 12 /* draft-ietf-tewg-diff-te-proto-06 */
#define ISIS_SUBTLV_EXT_IS_REACH_TE_METRIC 18 /* draft-ietf-isis-traffic-05 */
-#define ISIS_SUBTLV_EXT_IS_REACH_LINK_PROTECTION_TYPE 20 /* draft-ietf-isis-gmpls-extensions */
-#define ISIS_SUBTLV_EXT_IS_REACH_INTF_SW_CAP_DESCR 21 /* draft-ietf-isis-gmpls-extensions */
+#define ISIS_SUBTLV_EXT_IS_REACH_LINK_ATTRIBUTE 19 /* draft-ietf-isis-link-attr-01 */
+#define ISIS_SUBTLV_EXT_IS_REACH_LINK_PROTECTION_TYPE 20 /* rfc4205 */
+#define ISIS_SUBTLV_EXT_IS_REACH_INTF_SW_CAP_DESCR 21 /* rfc4205 */
#define ISIS_SUBTLV_EXT_IS_REACH_BW_CONSTRAINTS 22 /* rfc4124 */
+#define ISIS_SUBTLV_SPB_METRIC 29 /* rfc6329 */
+
static struct tok isis_ext_is_reach_subtlv_values[] = {
{ ISIS_SUBTLV_EXT_IS_REACH_ADMIN_GROUP, "Administrative groups" },
{ ISIS_SUBTLV_EXT_IS_REACH_LINK_LOCAL_REMOTE_ID, "Link Local/Remote Identifier" },
@@ -363,10 +368,12 @@
{ ISIS_SUBTLV_EXT_IS_REACH_RESERVABLE_BW, "Reservable link bandwidth" },
{ ISIS_SUBTLV_EXT_IS_REACH_UNRESERVED_BW, "Unreserved bandwidth" },
{ ISIS_SUBTLV_EXT_IS_REACH_TE_METRIC, "Traffic Engineering Metric" },
+ { ISIS_SUBTLV_EXT_IS_REACH_LINK_ATTRIBUTE, "Link Attribute" },
{ ISIS_SUBTLV_EXT_IS_REACH_LINK_PROTECTION_TYPE, "Link Protection Type" },
{ ISIS_SUBTLV_EXT_IS_REACH_INTF_SW_CAP_DESCR, "Interface Switching Capability" },
{ ISIS_SUBTLV_EXT_IS_REACH_BW_CONSTRAINTS_OLD, "Bandwidth Constraints (old)" },
{ ISIS_SUBTLV_EXT_IS_REACH_BW_CONSTRAINTS, "Bandwidth Constraints" },
+ { ISIS_SUBTLV_SPB_METRIC, "SPB Metric" },
{ 250, "Reserved for cisco specific extensions" },
{ 251, "Reserved for cisco specific extensions" },
{ 252, "Reserved for cisco specific extensions" },
@@ -387,7 +394,15 @@
{ 0, NULL }
};
+static struct tok isis_subtlv_link_attribute_values[] = {
+ { 0x01, "Local Protection Available" },
+ { 0x02, "Link excluded from local protection path" },
+ { 0x04, "Local maintenance required"},
+ { 0, NULL }
+};
+
#define ISIS_SUBTLV_AUTH_SIMPLE 1
+#define ISIS_SUBTLV_AUTH_GENERIC 3 /* rfc 5310 */
#define ISIS_SUBTLV_AUTH_MD5 54
#define ISIS_SUBTLV_AUTH_MD5_LEN 16
#define ISIS_SUBTLV_AUTH_PRIVATE 255
@@ -394,6 +409,7 @@
static struct tok isis_subtlv_auth_values[] = {
{ ISIS_SUBTLV_AUTH_SIMPLE, "simple text password"},
+ { ISIS_SUBTLV_AUTH_GENERIC, "Generic Crypto key-id"},
{ ISIS_SUBTLV_AUTH_MD5, "HMAC-MD5 password"},
{ ISIS_SUBTLV_AUTH_PRIVATE, "Routing Domain private password"},
{ 0, NULL }
@@ -410,6 +426,53 @@
{ 0, NULL}
};
+#define ISIS_SUBTLV_SPB_MCID 4
+#define ISIS_SUBTLV_SPB_DIGEST 5
+#define ISIS_SUBTLV_SPB_BVID 6
+
+#define ISIS_SUBTLV_SPB_INSTANCE 1
+#define ISIS_SUBTLV_SPBM_SI 3
+
+#define ISIS_SPB_MCID_LEN 51
+#define ISIS_SUBTLV_SPB_MCID_MIN_LEN 102
+#define ISIS_SUBTLV_SPB_DIGEST_MIN_LEN 33
+#define ISIS_SUBTLV_SPB_BVID_MIN_LEN 6
+#define ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN 19
+#define ISIS_SUBTLV_SPB_INSTANCE_VLAN_TUPLE_LEN 8
+
+static struct tok isis_mt_port_cap_subtlv_values[] = {
+ { ISIS_SUBTLV_SPB_MCID, "SPB MCID" },
+ { ISIS_SUBTLV_SPB_DIGEST, "SPB Digest" },
+ { ISIS_SUBTLV_SPB_BVID, "SPB BVID" },
+ { 0, NULL }
+};
+
+static struct tok isis_mt_capability_subtlv_values[] = {
+ { ISIS_SUBTLV_SPB_INSTANCE, "SPB Instance" },
+ { ISIS_SUBTLV_SPBM_SI, "SPBM Service Identifier and Unicast Address" },
+ { 0, NULL }
+};
+
+struct isis_spb_mcid {
+ u_int8_t format_id;
+ u_int8_t name[32];
+ u_int8_t revision_lvl[2];
+ u_int8_t digest[16];
+};
+
+struct isis_subtlv_spb_mcid {
+ struct isis_spb_mcid mcid;
+ struct isis_spb_mcid aux_mcid;
+};
+
+struct isis_subtlv_spb_instance {
+ u_int8_t cist_root_id[8];
+ u_int8_t cist_external_root_path_cost[4];
+ u_int8_t bridge_priority[2];
+ u_int8_t spsourceid[4];
+ u_int8_t no_of_trees;
+};
+
#define CLNP_SEGMENT_PART 0x80
#define CLNP_MORE_SEGMENTS 0x40
#define CLNP_REQUEST_ER 0x20
@@ -434,8 +497,8 @@
#define ISIS_MASK_MTFLAGS(x) ((x)&0xf000)
static struct tok isis_mt_flag_values[] = {
- { 0x4000, "sub-TLVs present"},
- { 0x8000, "ATT bit set"},
+ { 0x4000, "ATT bit set"},
+ { 0x8000, "Overload bit set"},
{ 0, NULL}
};
@@ -504,7 +567,8 @@
u_int8_t neighbor_extd_local_circuit_id[4];
};
-static int osi_cksum(const u_int8_t *, u_int);
+static void osi_print_cksum(const u_int8_t *pptr, u_int16_t checksum,
+ u_int checksum_offset, u_int length);
static int clnp_print(const u_int8_t *, u_int);
static void esis_print(const u_int8_t *, u_int);
static int isis_print(const u_int8_t *, u_int);
@@ -610,10 +674,6 @@
void isoclns_print(const u_int8_t *p, u_int length, u_int caplen)
{
- const struct isis_common_header *header;
-
- header = (const struct isis_common_header *)p;
-
if (caplen <= 1) { /* enough bytes on the wire ? */
printf("|OSI");
return;
@@ -656,7 +716,7 @@
#ifdef INET6
case NLPID_IP6:
- ip6_print(p+1, length-1);
+ ip6_print(gndo, p+1, length-1);
break;
#endif
@@ -767,7 +827,7 @@
}
printf("%slength %u",eflag ? "" : ", ",length);
- printf("\n\t%s PDU, hlen: %u, v: %u, lifetime: %u.%us, Segment PDU length: %u, checksum: 0x%04x ",
+ printf("\n\t%s PDU, hlen: %u, v: %u, lifetime: %u.%us, Segment PDU length: %u, checksum: 0x%04x",
tok2str(clnp_pdu_values, "unknown (%u)",clnp_pdu_type),
clnp_header->length_indicator,
clnp_header->version,
@@ -776,10 +836,8 @@
EXTRACT_16BITS(clnp_header->segment_length),
EXTRACT_16BITS(clnp_header->cksum));
- /* do not attempt to verify the checksum if it is zero */
- if (EXTRACT_16BITS(clnp_header->cksum) == 0)
- printf("(unverified)");
- else printf("(%s)", osi_cksum(optr, clnp_header->length_indicator) ? "incorrect" : "correct");
+ osi_print_cksum(optr, EXTRACT_16BITS(clnp_header->cksum), 7,
+ clnp_header->length_indicator);
printf("\n\tFlags [%s]",
bittok2str(clnp_flag_values,"none",clnp_flags));
@@ -1033,13 +1091,10 @@
esis_pdu_type);
printf(", v: %u%s", esis_header->version, esis_header->version == ESIS_VERSION ? "" : "unsupported" );
- printf(", checksum: 0x%04x ", EXTRACT_16BITS(esis_header->cksum));
- /* do not attempt to verify the checksum if it is zero */
- if (EXTRACT_16BITS(esis_header->cksum) == 0)
- printf("(unverified)");
- else
- printf("(%s)", osi_cksum(pptr, li) ? "incorrect" : "correct");
+ printf(", checksum: 0x%04x", EXTRACT_16BITS(esis_header->cksum));
+ osi_print_cksum(pptr, EXTRACT_16BITS(esis_header->cksum), 7, li);
+
printf(", holding time: %us, length indicator: %u",EXTRACT_16BITS(esis_header->holdtime),li);
if (vflag > 1)
@@ -1176,15 +1231,15 @@
}
/* now walk the options */
- while (li >= 2) {
+ while (li != 0) {
u_int op, opli;
const u_int8_t *tptr;
- TCHECK2(*pptr, 2);
if (li < 2) {
printf(", bad opts/li");
return;
}
+ TCHECK2(*pptr, 2);
op = *pptr++;
opli = *pptr++;
li -= 2;
@@ -1203,8 +1258,11 @@
switch (op) {
case ESIS_OPTION_ES_CONF_TIME:
- TCHECK2(*pptr, 2);
- printf("%us", EXTRACT_16BITS(tptr));
+ if (opli == 2) {
+ TCHECK2(*pptr, 2);
+ printf("%us", EXTRACT_16BITS(tptr));
+ } else
+ printf("(bad length)");
break;
case ESIS_OPTION_PROTOCOLS:
@@ -1245,6 +1303,258 @@
return;
}
+
+static void
+isis_print_mcid (const struct isis_spb_mcid *mcid)
+{
+ int i;
+
+ printf( "ID: %d, Name: ", mcid->format_id);
+
+ for(i=0; i<32; i++)
+ {
+ printf("%c", mcid->name[i]);
+ if(mcid->name[i] == '\0')
+ break;
+ }
+
+ printf("\n\t Lvl: %d",
+ EXTRACT_16BITS(mcid->revision_lvl));
+
+ printf( ", Digest: ");
+
+ for(i=0;i<16;i++)
+ printf("%.2x ",mcid->digest[i]);
+}
+
+static int
+isis_print_mt_port_cap_subtlv (const u_int8_t *tptr, int len)
+{
+ int stlv_type, stlv_len;
+ const struct isis_subtlv_spb_mcid *subtlv_spb_mcid;
+ int i;
+
+ while (len > 0)
+ {
+ stlv_type = *(tptr++);
+ stlv_len = *(tptr++);
+
+ /* first lets see if we know the subTLVs name*/
+ printf("\n\t %s subTLV #%u, length: %u",
+ tok2str(isis_mt_port_cap_subtlv_values, "unknown", stlv_type),
+ stlv_type,
+ stlv_len);
+
+ /*len -= TLV_TYPE_LEN_OFFSET;*/
+ len = len -2;
+
+ switch (stlv_type)
+ {
+ case ISIS_SUBTLV_SPB_MCID:
+ {
+ if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_MCID_MIN_LEN))
+ goto trunctlv;
+
+ subtlv_spb_mcid = (struct isis_subtlv_spb_mcid *)tptr;
+
+ printf( "\n\t MCID: ");
+ isis_print_mcid (&(subtlv_spb_mcid->mcid));
+
+ /*tptr += SPB_MCID_MIN_LEN;
+ len -= SPB_MCID_MIN_LEN; */
+
+ printf( "\n\t AUX-MCID: ");
+ isis_print_mcid (&(subtlv_spb_mcid->aux_mcid));
+
+ /*tptr += SPB_MCID_MIN_LEN;
+ len -= SPB_MCID_MIN_LEN; */
+ tptr = tptr + sizeof(struct isis_subtlv_spb_mcid);
+ len = len - sizeof(struct isis_subtlv_spb_mcid);
+
+ break;
+ }
+
+ case ISIS_SUBTLV_SPB_DIGEST:
+ {
+ if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_DIGEST_MIN_LEN))
+ goto trunctlv;
+
+ printf ("\n\t RES: %d V: %d A: %d D: %d",
+ (*(tptr) >> 5), (((*tptr)>> 4) & 0x01),
+ ((*(tptr) >> 2) & 0x03), ((*tptr) & 0x03));
+
+ tptr++;
+
+ printf( "\n\t Digest: ");
+
+ for(i=1;i<=8; i++)
+ {
+ printf("%08x ", EXTRACT_32BITS(tptr));
+ if (i%4 == 0 && i != 8)
+ printf("\n\t ");
+ tptr = tptr + 4;
+ }
+
+ len = len - ISIS_SUBTLV_SPB_DIGEST_MIN_LEN;
+
+ break;
+ }
+
+ case ISIS_SUBTLV_SPB_BVID:
+ {
+ if (!TTEST2(*(tptr), stlv_len))
+ goto trunctlv;
+
+ while (len)
+ {
+ if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_BVID_MIN_LEN))
+ goto trunctlv;
+
+ printf("\n\t ECT: %08x",
+ EXTRACT_32BITS(tptr));
+
+ tptr = tptr+4;
+
+ printf(" BVID: %d, U:%01x M:%01x ",
+ (EXTRACT_16BITS (tptr) >> 4) ,
+ (EXTRACT_16BITS (tptr) >> 3) & 0x01,
+ (EXTRACT_16BITS (tptr) >> 2) & 0x01);
+
+ tptr = tptr + 2;
+ len = len - ISIS_SUBTLV_SPB_BVID_MIN_LEN;
+ }
+
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
+
+ return 0;
+
+ trunctlv:
+ printf("\n\t\t packet exceeded snapshot");
+ return(1);
+}
+
+static int
+isis_print_mt_capability_subtlv (const u_int8_t *tptr, int len)
+{
+ int stlv_type, stlv_len, tmp;
+
+ while (len > 0)
+ {
+ stlv_type = *(tptr++);
+ stlv_len = *(tptr++);
+
+ /* first lets see if we know the subTLVs name*/
+ printf("\n\t %s subTLV #%u, length: %u",
+ tok2str(isis_mt_capability_subtlv_values, "unknown", stlv_type),
+ stlv_type,
+ stlv_len);
+
+ len = len - 2;
+
+ switch (stlv_type)
+ {
+ case ISIS_SUBTLV_SPB_INSTANCE:
+
+ if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN))
+ goto trunctlv;
+
+ printf("\n\t CIST Root-ID: %08x", EXTRACT_32BITS(tptr));
+ tptr = tptr+4;
+ printf(" %08x", EXTRACT_32BITS(tptr));
+ tptr = tptr+4;
+ printf(", Path Cost: %08x", EXTRACT_32BITS(tptr));
+ tptr = tptr+4;
+ printf(", Prio: %d", EXTRACT_16BITS(tptr));
+ tptr = tptr + 2;
+ printf("\n\t RES: %d",
+ EXTRACT_16BITS(tptr) >> 5);
+ printf(", V: %d",
+ (EXTRACT_16BITS(tptr) >> 4) & 0x0001);
+ printf(", SPSource-ID: %d",
+ (EXTRACT_32BITS(tptr) & 0x000fffff));
+ tptr = tptr+4;
+ printf(", No of Trees: %x", *(tptr));
+
+ tmp = *(tptr++);
+
+ len = len - ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN;
+
+ while (tmp)
+ {
+ if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_INSTANCE_VLAN_TUPLE_LEN))
+ goto trunctlv;
+
+ printf ("\n\t U:%d, M:%d, A:%d, RES:%d",
+ *(tptr) >> 7, (*(tptr) >> 6) & 0x01,
+ (*(tptr) >> 5) & 0x01, (*(tptr) & 0x1f));
+
+ tptr++;
+
+ printf (", ECT: %08x", EXTRACT_32BITS(tptr));
+
+ tptr = tptr + 4;
+
+ printf (", BVID: %d, SPVID: %d",
+ (EXTRACT_24BITS(tptr) >> 12) & 0x000fff,
+ EXTRACT_24BITS(tptr) & 0x000fff);
+
+ tptr = tptr + 3;
+ len = len - ISIS_SUBTLV_SPB_INSTANCE_VLAN_TUPLE_LEN;
+ tmp--;
+ }
+
+ break;
+
+ case ISIS_SUBTLV_SPBM_SI:
+
+ if (!TTEST2(*(tptr), 6))
+ goto trunctlv;
+
+ printf("\n\t BMAC: %08x", EXTRACT_32BITS(tptr));
+ tptr = tptr+4;
+ printf("%04x", EXTRACT_16BITS(tptr));
+ tptr = tptr+2;
+
+ printf (", RES: %d, VID: %d", EXTRACT_16BITS(tptr) >> 12,
+ (EXTRACT_16BITS(tptr)) & 0x0fff);
+
+ tptr = tptr+2;
+ len = len - 8;
+ stlv_len = stlv_len - 8;
+
+ while (stlv_len)
+ {
+ printf("\n\t T: %d, R: %d, RES: %d, ISID: %d",
+ (EXTRACT_32BITS(tptr) >> 31),
+ (EXTRACT_32BITS(tptr) >> 30) & 0x01,
+ (EXTRACT_32BITS(tptr) >> 24) & 0x03f,
+ (EXTRACT_32BITS(tptr)) & 0x0ffffff);
+
+ tptr = tptr + 4;
+ len = len - 4;
+ stlv_len = stlv_len - 4;
+ }
+
+ break;
+
+ default:
+ break;
+ }
+ }
+ return 0;
+
+ trunctlv:
+ printf("\n\t\t packet exceeded snapshot");
+ return(1);
+}
+
+
/* shared routine for printing system, node and lsp-ids */
static char *
isis_print_id(const u_int8_t *cp, int id_len)
@@ -1413,7 +1723,7 @@
static int
isis_print_is_reach_subtlv (const u_int8_t *tptr,u_int subt,u_int subl,const char *ident) {
- u_int te_class,priority_level;
+ u_int te_class,priority_level,gmpls_switch_cap;
union { /* int to float conversion buffer for several subTLVs */
float f;
u_int32_t i;
@@ -1437,7 +1747,7 @@
case ISIS_SUBTLV_EXT_IS_REACH_LINK_REMOTE_ID:
if (subl >= 4) {
printf(", 0x%08x", EXTRACT_32BITS(tptr));
- if (subl == 8) /* draft-ietf-isis-gmpls-extensions */
+ if (subl == 8) /* rfc4205 */
printf(", 0x%08x", EXTRACT_32BITS(tptr+4));
}
break;
@@ -1486,6 +1796,15 @@
if (subl >= 3)
printf(", %u", EXTRACT_24BITS(tptr));
break;
+ case ISIS_SUBTLV_EXT_IS_REACH_LINK_ATTRIBUTE:
+ if (subl == 2) {
+ printf(", [ %s ] (0x%04x)",
+ bittok2str(isis_subtlv_link_attribute_values,
+ "Unknown",
+ EXTRACT_16BITS(tptr)),
+ EXTRACT_16BITS(tptr));
+ }
+ break;
case ISIS_SUBTLV_EXT_IS_REACH_LINK_PROTECTION_TYPE:
if (subl >= 2) {
printf(", %s, Priority %u",
@@ -1493,11 +1812,20 @@
*(tptr+1));
}
break;
+ case ISIS_SUBTLV_SPB_METRIC:
+ if (subl >= 6) {
+ printf (", LM: %u", EXTRACT_24BITS(tptr));
+ tptr=tptr+3;
+ printf (", P: %u", *(tptr));
+ printf (", P-ID: %u", EXTRACT_16BITS(++tptr));
+ }
+ break;
case ISIS_SUBTLV_EXT_IS_REACH_INTF_SW_CAP_DESCR:
if (subl >= 36) {
+ gmpls_switch_cap = *tptr;
printf("%s Interface Switching Capability:%s",
ident,
- tok2str(gmpls_switch_cap_values, "Unknown", *(tptr)));
+ tok2str(gmpls_switch_cap_values, "Unknown", gmpls_switch_cap));
printf(", LSP Encoding: %s",
tok2str(gmpls_encoding_values, "Unknown", *(tptr+1)));
tptr+=4;
@@ -1511,12 +1839,29 @@
tptr+=4;
}
subl-=36;
- /* there is some optional stuff left to decode but this is as of yet
- not specified so just lets hexdump what is left */
- if(subl>0){
- if(!print_unknown_data(tptr,"\n\t\t ",
- subl))
+ switch (gmpls_switch_cap) {
+ case GMPLS_PSC1:
+ case GMPLS_PSC2:
+ case GMPLS_PSC3:
+ case GMPLS_PSC4:
+ bw.i = EXTRACT_32BITS(tptr);
+ printf("%s Min LSP Bandwidth: %.3f Mbps", ident, bw.f*8/1000000);
+ printf("%s Interface MTU: %u", ident, EXTRACT_16BITS(tptr+4));
+ break;
+ case GMPLS_TSC:
+ bw.i = EXTRACT_32BITS(tptr);
+ printf("%s Min LSP Bandwidth: %.3f Mbps", ident, bw.f*8/1000000);
+ printf("%s Indication %s", ident,
+ tok2str(gmpls_switch_cap_tsc_indication_values, "Unknown (%u)", *(tptr+4)));
+ break;
+ default:
+ /* there is some optional stuff left to decode but this is as of yet
+ not specified so just lets hexdump what is left */
+ if(subl>0){
+ if(!print_unknown_data(tptr,"\n\t\t ",
+ subl))
return(0);
+ }
}
}
break;
@@ -1631,7 +1976,7 @@
processed=4;
tptr+=4;
- if (afi == IPV4) {
+ if (afi == AF_INET) {
if (!TTEST2(*tptr, 1)) /* fetch status byte */
return (0);
status_byte=*(tptr++);
@@ -1644,7 +1989,7 @@
}
processed++;
#ifdef INET6
- } else if (afi == IPV6) {
+ } else if (afi == AF_INET6) {
if (!TTEST2(*tptr, 1)) /* fetch status & prefix_len byte */
return (0);
status_byte=*(tptr++);
@@ -1669,13 +2014,13 @@
tptr+=byte_length;
processed+=byte_length;
- if (afi == IPV4)
+ if (afi == AF_INET)
printf("%sIPv4 prefix: %15s/%u",
ident,
ipaddr_string(prefix),
bit_length);
#ifdef INET6
- if (afi == IPV6)
+ if (afi == AF_INET6)
printf("%sIPv6 prefix: %s/%u",
ident,
ip6addr_string(prefix),
@@ -1686,17 +2031,20 @@
ISIS_MASK_TLV_EXTD_IP_UPDOWN(status_byte) ? "down" : "up",
metric);
- if (afi == IPV4 && ISIS_MASK_TLV_EXTD_IP_SUBTLV(status_byte))
+ if (afi == AF_INET && ISIS_MASK_TLV_EXTD_IP_SUBTLV(status_byte))
printf(", sub-TLVs present");
#ifdef INET6
- if (afi == IPV6)
+ if (afi == AF_INET6)
printf(", %s%s",
ISIS_MASK_TLV_EXTD_IP6_IE(status_byte) ? "External" : "Internal",
ISIS_MASK_TLV_EXTD_IP6_SUBTLV(status_byte) ? ", sub-TLVs present" : "");
#endif
- if ((ISIS_MASK_TLV_EXTD_IP_SUBTLV(status_byte) && afi == IPV4) ||
- (ISIS_MASK_TLV_EXTD_IP6_SUBTLV(status_byte) && afi == IPV6)) {
+ if ((afi == AF_INET && ISIS_MASK_TLV_EXTD_IP_SUBTLV(status_byte))
+#ifdef INET6
+ || (afi == AF_INET6 && ISIS_MASK_TLV_EXTD_IP6_SUBTLV(status_byte))
+#endif
+ ) {
/* assume that one prefix can hold more
than one subTLV - therefore the first byte must reflect
the aggregate bytecount of the subTLVs for this prefix
@@ -1734,7 +2082,7 @@
const struct isis_iih_lan_header *header_iih_lan;
const struct isis_iih_ptp_header *header_iih_ptp;
- const struct isis_lsp_header *header_lsp;
+ struct isis_lsp_header *header_lsp;
const struct isis_csnp_header *header_csnp;
const struct isis_psnp_header *header_psnp;
@@ -1746,18 +2094,20 @@
u_int8_t pdu_type, max_area, id_length, tlv_type, tlv_len, tmp, alen, lan_alen, prefix_len;
u_int8_t ext_is_len, ext_ip_len, mt_len;
const u_int8_t *optr, *pptr, *tptr;
- u_short packet_len,pdu_len;
+ u_short packet_len,pdu_len, key_id;
u_int i,vendor_id;
+ int sigcheck;
packet_len=length;
optr = p; /* initialize the _o_riginal pointer to the packet start -
- need it for parsing the checksum TLV */
+ need it for parsing the checksum TLV and authentication
+ TLV verification */
isis_header = (const struct isis_common_header *)p;
TCHECK(*isis_header);
pptr = p+(ISIS_COMMON_HEADER_SIZE);
header_iih_lan = (const struct isis_iih_lan_header *)pptr;
header_iih_ptp = (const struct isis_iih_ptp_header *)pptr;
- header_lsp = (const struct isis_lsp_header *)pptr;
+ header_lsp = (struct isis_lsp_header *)pptr;
header_csnp = (const struct isis_csnp_header *)pptr;
header_psnp = (const struct isis_psnp_header *)pptr;
@@ -1979,16 +2329,19 @@
EXTRACT_16BITS(header_lsp->remaining_lifetime),
EXTRACT_16BITS(header_lsp->checksum));
- /* if this is a purge do not attempt to verify the checksum */
- if ( EXTRACT_16BITS(header_lsp->remaining_lifetime) == 0 &&
- EXTRACT_16BITS(header_lsp->checksum) == 0)
- printf(" (purged)");
- else
- /* verify the checksum -
- * checking starts at the lsp-id field at byte position [12]
- * hence the length needs to be reduced by 12 bytes */
- printf(" (%s)", (osi_cksum((u_int8_t *)header_lsp->lsp_id, length-12)) ? "incorrect" : "correct");
+ osi_print_cksum((u_int8_t *)header_lsp->lsp_id,
+ EXTRACT_16BITS(header_lsp->checksum), 12, length-12);
+
+ /*
+ * Clear checksum and lifetime prior to signature verification.
+ */
+ header_lsp->checksum[0] = 0;
+ header_lsp->checksum[1] = 0;
+ header_lsp->remaining_lifetime[0] = 0;
+ header_lsp->remaining_lifetime[1] = 0;
+
+
printf(", PDU length: %u, Flags: [ %s",
pdu_len,
ISIS_MASK_LSP_OL_BIT(header_lsp->typeblock) ? "Overload bit set, " : "");
@@ -2164,13 +2517,12 @@
break;
case ISIS_TLV_MT_IS_REACH:
+ mt_len = isis_print_mtid(tptr, "\n\t ");
+ if (mt_len == 0) /* did something go wrong ? */
+ goto trunctlv;
+ tptr+=mt_len;
+ tmp-=mt_len;
while (tmp >= 2+NODE_ID_LEN+3+1) {
- mt_len = isis_print_mtid(tptr, "\n\t ");
- if (mt_len == 0) /* did something go wrong ? */
- goto trunctlv;
- tptr+=mt_len;
- tmp-=mt_len;
-
ext_is_len = isis_print_ext_is_reach(tptr,"\n\t ",tlv_type);
if (ext_is_len == 0) /* did something go wrong ? */
goto trunctlv;
@@ -2240,7 +2592,7 @@
case ISIS_TLV_EXTD_IP_REACH:
while (tmp>0) {
- ext_ip_len = isis_print_extd_ip_reach(tptr, "\n\t ", IPV4);
+ ext_ip_len = isis_print_extd_ip_reach(tptr, "\n\t ", AF_INET);
if (ext_ip_len == 0) /* did something go wrong ? */
goto trunctlv;
tptr+=ext_ip_len;
@@ -2257,7 +2609,7 @@
tmp-=mt_len;
while (tmp>0) {
- ext_ip_len = isis_print_extd_ip_reach(tptr, "\n\t ", IPV4);
+ ext_ip_len = isis_print_extd_ip_reach(tptr, "\n\t ", AF_INET);
if (ext_ip_len == 0) /* did something go wrong ? */
goto trunctlv;
tptr+=ext_ip_len;
@@ -2268,7 +2620,7 @@
#ifdef INET6
case ISIS_TLV_IP6_REACH:
while (tmp>0) {
- ext_ip_len = isis_print_extd_ip_reach(tptr, "\n\t ", IPV6);
+ ext_ip_len = isis_print_extd_ip_reach(tptr, "\n\t ", AF_INET6);
if (ext_ip_len == 0) /* did something go wrong ? */
goto trunctlv;
tptr+=ext_ip_len;
@@ -2285,7 +2637,7 @@
tmp-=mt_len;
while (tmp>0) {
- ext_ip_len = isis_print_extd_ip_reach(tptr, "\n\t ", IPV6);
+ ext_ip_len = isis_print_extd_ip_reach(tptr, "\n\t ", AF_INET6);
if (ext_ip_len == 0) /* did something go wrong ? */
goto trunctlv;
tptr+=ext_ip_len;
@@ -2331,7 +2683,25 @@
}
if (tlv_len != ISIS_SUBTLV_AUTH_MD5_LEN+1)
printf(", (malformed subTLV) ");
+
+#ifdef HAVE_LIBCRYPTO
+ sigcheck = signature_verify(optr, length,
+ (unsigned char *)tptr + 1);
+#else
+ sigcheck = CANT_CHECK_SIGNATURE;
+#endif
+ printf(" (%s)", tok2str(signature_check_values, "Unknown", sigcheck));
+
break;
+ case ISIS_SUBTLV_AUTH_GENERIC:
+ key_id = EXTRACT_16BITS((tptr+1));
+ printf("%u, password: ", key_id);
+ for(i=1 + sizeof(u_int16_t);i<tlv_len;i++) {
+ if (!TTEST2(*(tptr+i), 1))
+ goto trunctlv;
+ printf("%02x",*(tptr+i));
+ }
+ break;
case ISIS_SUBTLV_AUTH_PRIVATE:
default:
if(!print_unknown_data(tptr+1,"\n\t\t ",tlv_len-1))
@@ -2391,6 +2761,42 @@
}
break;
+ case ISIS_TLV_MT_PORT_CAP:
+ {
+ if (!TTEST2(*(tptr), 2))
+ goto trunctlv;
+
+ printf("\n\t RES: %d, MTID(s): %d",
+ (EXTRACT_16BITS (tptr) >> 12),
+ (EXTRACT_16BITS (tptr) & 0x0fff));
+
+ tmp = tmp-2;
+ tptr = tptr+2;
+
+ if (tmp)
+ isis_print_mt_port_cap_subtlv (tptr, tmp);
+
+ break;
+ }
+
+ case ISIS_TLV_MT_CAPABILITY:
+
+ if (!TTEST2(*(tptr), 2))
+ goto trunctlv;
+
+ printf("\n\t O: %d, RES: %d, MTID(s): %d",
+ (EXTRACT_16BITS(tptr) >> 15) & 0x01,
+ (EXTRACT_16BITS(tptr) >> 12) & 0x07,
+ EXTRACT_16BITS(tptr) & 0x0fff);
+
+ tmp = tmp-2;
+ tptr = tptr+2;
+
+ if (tmp)
+ isis_print_mt_capability_subtlv (tptr, tmp);
+
+ break;
+
case ISIS_TLV_TE_ROUTER_ID:
if (!TTEST2(*pptr, sizeof(struct in_addr)))
goto trunctlv;
@@ -2490,9 +2896,7 @@
* to avoid conflicts the checksum TLV is zeroed.
* see rfc3358 for details
*/
- if (EXTRACT_16BITS(tptr) == 0)
- printf("(unverified)");
- else printf("(%s)", osi_cksum(optr, length) ? "incorrect" : "correct");
+ osi_print_cksum(optr, EXTRACT_16BITS(tptr), tptr-optr, length);
break;
case ISIS_TLV_MT_SUPPORTED:
@@ -2684,25 +3088,25 @@
return(1);
}
-/*
- * Verify the checksum. See 8473-1, Appendix C, section C.4.
- */
-
-static int
-osi_cksum(const u_int8_t *tptr, u_int len)
+static void
+osi_print_cksum (const u_int8_t *pptr, u_int16_t checksum,
+ u_int checksum_offset, u_int length)
{
- int32_t c0 = 0, c1 = 0;
+ u_int16_t calculated_checksum;
- while ((int)--len >= 0) {
- c0 += *tptr++;
- c0 %= 255;
- c1 += c0;
- c1 %= 255;
- }
- return (c0 | c1);
+ /* do not attempt to verify the checksum if it is zero */
+ if (!checksum) {
+ printf("(unverified)");
+ } else {
+ calculated_checksum = create_osi_cksum(pptr, checksum_offset, length);
+ if (checksum == calculated_checksum) {
+ printf(" (correct)");
+ } else {
+ printf(" (incorrect should be 0x%04x)", calculated_checksum);
+ }
+ }
}
-
/*
* Local Variables:
* c-style: whitesmith
Modified: trunk/contrib/tcpdump/print-juniper.c
===================================================================
--- trunk/contrib/tcpdump/print-juniper.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-juniper.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,3 +1,5 @@
+/* NetBSD: print-juniper.c,v 1.2 2007/07/24 11:53:45 drochner Exp */
+
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code
@@ -15,7 +17,9 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-juniper.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-juniper.c,v 1.34 2007-08-29 02:31:44 mcr Exp $ (LBL)";
+#else
+__RCSID("NetBSD: print-juniper.c,v 1.3 2007/07/25 06:31:32 dogcow Exp ");
#endif
#ifdef HAVE_CONFIG_H
@@ -40,6 +44,8 @@
#define JUNIPER_BPF_IN 1 /* Incoming packet */
#define JUNIPER_BPF_PKT_IN 0x1 /* Incoming packet */
#define JUNIPER_BPF_NO_L2 0x2 /* L2 header stripped */
+#define JUNIPER_BPF_IIF 0x4 /* IIF is valid */
+#define JUNIPER_BPF_FILTER 0x40 /* BPF filtering is supported */
#define JUNIPER_BPF_EXT 0x80 /* extensions present */
#define JUNIPER_MGC_NUMBER 0x4d4743 /* = "MGC" */
@@ -74,6 +80,291 @@
{ 0, NULL}
};
+/* codepoints for encoding extensions to a .pcap file */
+enum {
+ JUNIPER_EXT_TLV_IFD_IDX = 1,
+ JUNIPER_EXT_TLV_IFD_NAME = 2,
+ JUNIPER_EXT_TLV_IFD_MEDIATYPE = 3,
+ JUNIPER_EXT_TLV_IFL_IDX = 4,
+ JUNIPER_EXT_TLV_IFL_UNIT = 5,
+ JUNIPER_EXT_TLV_IFL_ENCAPS = 6,
+ JUNIPER_EXT_TLV_TTP_IFD_MEDIATYPE = 7,
+ JUNIPER_EXT_TLV_TTP_IFL_ENCAPS = 8
+};
+
+/* 1 byte type and 1-byte length */
+#define JUNIPER_EXT_TLV_OVERHEAD 2
+
+struct tok jnx_ext_tlv_values[] = {
+ { JUNIPER_EXT_TLV_IFD_IDX, "Device Interface Index" },
+ { JUNIPER_EXT_TLV_IFD_NAME,"Device Interface Name" },
+ { JUNIPER_EXT_TLV_IFD_MEDIATYPE, "Device Media Type" },
+ { JUNIPER_EXT_TLV_IFL_IDX, "Logical Interface Index" },
+ { JUNIPER_EXT_TLV_IFL_UNIT,"Logical Unit Number" },
+ { JUNIPER_EXT_TLV_IFL_ENCAPS, "Logical Interface Encapsulation" },
+ { JUNIPER_EXT_TLV_TTP_IFD_MEDIATYPE, "TTP derived Device Media Type" },
+ { JUNIPER_EXT_TLV_TTP_IFL_ENCAPS, "TTP derived Logical Interface Encapsulation" },
+ { 0, NULL }
+};
+
+struct tok jnx_flag_values[] = {
+ { JUNIPER_BPF_EXT, "Ext" },
+ { JUNIPER_BPF_FILTER, "Filter" },
+ { JUNIPER_BPF_IIF, "IIF" },
+ { JUNIPER_BPF_NO_L2, "no-L2" },
+ { JUNIPER_BPF_PKT_IN, "In" },
+ { 0, NULL }
+};
+
+#define JUNIPER_IFML_ETHER 1
+#define JUNIPER_IFML_FDDI 2
+#define JUNIPER_IFML_TOKENRING 3
+#define JUNIPER_IFML_PPP 4
+#define JUNIPER_IFML_FRAMERELAY 5
+#define JUNIPER_IFML_CISCOHDLC 6
+#define JUNIPER_IFML_SMDSDXI 7
+#define JUNIPER_IFML_ATMPVC 8
+#define JUNIPER_IFML_PPP_CCC 9
+#define JUNIPER_IFML_FRAMERELAY_CCC 10
+#define JUNIPER_IFML_IPIP 11
+#define JUNIPER_IFML_GRE 12
+#define JUNIPER_IFML_PIM 13
+#define JUNIPER_IFML_PIMD 14
+#define JUNIPER_IFML_CISCOHDLC_CCC 15
+#define JUNIPER_IFML_VLAN_CCC 16
+#define JUNIPER_IFML_MLPPP 17
+#define JUNIPER_IFML_MLFR 18
+#define JUNIPER_IFML_ML 19
+#define JUNIPER_IFML_LSI 20
+#define JUNIPER_IFML_DFE 21
+#define JUNIPER_IFML_ATM_CELLRELAY_CCC 22
+#define JUNIPER_IFML_CRYPTO 23
+#define JUNIPER_IFML_GGSN 24
+#define JUNIPER_IFML_LSI_PPP 25
+#define JUNIPER_IFML_LSI_CISCOHDLC 26
+#define JUNIPER_IFML_PPP_TCC 27
+#define JUNIPER_IFML_FRAMERELAY_TCC 28
+#define JUNIPER_IFML_CISCOHDLC_TCC 29
+#define JUNIPER_IFML_ETHERNET_CCC 30
+#define JUNIPER_IFML_VT 31
+#define JUNIPER_IFML_EXTENDED_VLAN_CCC 32
+#define JUNIPER_IFML_ETHER_OVER_ATM 33
+#define JUNIPER_IFML_MONITOR 34
+#define JUNIPER_IFML_ETHERNET_TCC 35
+#define JUNIPER_IFML_VLAN_TCC 36
+#define JUNIPER_IFML_EXTENDED_VLAN_TCC 37
+#define JUNIPER_IFML_CONTROLLER 38
+#define JUNIPER_IFML_MFR 39
+#define JUNIPER_IFML_LS 40
+#define JUNIPER_IFML_ETHERNET_VPLS 41
+#define JUNIPER_IFML_ETHERNET_VLAN_VPLS 42
+#define JUNIPER_IFML_ETHERNET_EXTENDED_VLAN_VPLS 43
+#define JUNIPER_IFML_LT 44
+#define JUNIPER_IFML_SERVICES 45
+#define JUNIPER_IFML_ETHER_VPLS_OVER_ATM 46
+#define JUNIPER_IFML_FR_PORT_CCC 47
+#define JUNIPER_IFML_FRAMERELAY_EXT_CCC 48
+#define JUNIPER_IFML_FRAMERELAY_EXT_TCC 49
+#define JUNIPER_IFML_FRAMERELAY_FLEX 50
+#define JUNIPER_IFML_GGSNI 51
+#define JUNIPER_IFML_ETHERNET_FLEX 52
+#define JUNIPER_IFML_COLLECTOR 53
+#define JUNIPER_IFML_AGGREGATOR 54
+#define JUNIPER_IFML_LAPD 55
+#define JUNIPER_IFML_PPPOE 56
+#define JUNIPER_IFML_PPP_SUBORDINATE 57
+#define JUNIPER_IFML_CISCOHDLC_SUBORDINATE 58
+#define JUNIPER_IFML_DFC 59
+#define JUNIPER_IFML_PICPEER 60
+
+struct tok juniper_ifmt_values[] = {
+ { JUNIPER_IFML_ETHER, "Ethernet" },
+ { JUNIPER_IFML_FDDI, "FDDI" },
+ { JUNIPER_IFML_TOKENRING, "Token-Ring" },
+ { JUNIPER_IFML_PPP, "PPP" },
+ { JUNIPER_IFML_PPP_SUBORDINATE, "PPP-Subordinate" },
+ { JUNIPER_IFML_FRAMERELAY, "Frame-Relay" },
+ { JUNIPER_IFML_CISCOHDLC, "Cisco-HDLC" },
+ { JUNIPER_IFML_SMDSDXI, "SMDS-DXI" },
+ { JUNIPER_IFML_ATMPVC, "ATM-PVC" },
+ { JUNIPER_IFML_PPP_CCC, "PPP-CCC" },
+ { JUNIPER_IFML_FRAMERELAY_CCC, "Frame-Relay-CCC" },
+ { JUNIPER_IFML_FRAMERELAY_EXT_CCC, "Extended FR-CCC" },
+ { JUNIPER_IFML_IPIP, "IP-over-IP" },
+ { JUNIPER_IFML_GRE, "GRE" },
+ { JUNIPER_IFML_PIM, "PIM-Encapsulator" },
+ { JUNIPER_IFML_PIMD, "PIM-Decapsulator" },
+ { JUNIPER_IFML_CISCOHDLC_CCC, "Cisco-HDLC-CCC" },
+ { JUNIPER_IFML_VLAN_CCC, "VLAN-CCC" },
+ { JUNIPER_IFML_EXTENDED_VLAN_CCC, "Extended-VLAN-CCC" },
+ { JUNIPER_IFML_MLPPP, "Multilink-PPP" },
+ { JUNIPER_IFML_MLFR, "Multilink-FR" },
+ { JUNIPER_IFML_MFR, "Multilink-FR-UNI-NNI" },
+ { JUNIPER_IFML_ML, "Multilink" },
+ { JUNIPER_IFML_LS, "LinkService" },
+ { JUNIPER_IFML_LSI, "LSI" },
+ { JUNIPER_IFML_ATM_CELLRELAY_CCC, "ATM-CCC-Cell-Relay" },
+ { JUNIPER_IFML_CRYPTO, "IPSEC-over-IP" },
+ { JUNIPER_IFML_GGSN, "GGSN" },
+ { JUNIPER_IFML_PPP_TCC, "PPP-TCC" },
+ { JUNIPER_IFML_FRAMERELAY_TCC, "Frame-Relay-TCC" },
+ { JUNIPER_IFML_FRAMERELAY_EXT_TCC, "Extended FR-TCC" },
+ { JUNIPER_IFML_CISCOHDLC_TCC, "Cisco-HDLC-TCC" },
+ { JUNIPER_IFML_ETHERNET_CCC, "Ethernet-CCC" },
+ { JUNIPER_IFML_VT, "VPN-Loopback-tunnel" },
+ { JUNIPER_IFML_ETHER_OVER_ATM, "Ethernet-over-ATM" },
+ { JUNIPER_IFML_ETHER_VPLS_OVER_ATM, "Ethernet-VPLS-over-ATM" },
+ { JUNIPER_IFML_MONITOR, "Monitor" },
+ { JUNIPER_IFML_ETHERNET_TCC, "Ethernet-TCC" },
+ { JUNIPER_IFML_VLAN_TCC, "VLAN-TCC" },
+ { JUNIPER_IFML_EXTENDED_VLAN_TCC, "Extended-VLAN-TCC" },
+ { JUNIPER_IFML_CONTROLLER, "Controller" },
+ { JUNIPER_IFML_ETHERNET_VPLS, "VPLS" },
+ { JUNIPER_IFML_ETHERNET_VLAN_VPLS, "VLAN-VPLS" },
+ { JUNIPER_IFML_ETHERNET_EXTENDED_VLAN_VPLS, "Extended-VLAN-VPLS" },
+ { JUNIPER_IFML_LT, "Logical-tunnel" },
+ { JUNIPER_IFML_SERVICES, "General-Services" },
+ { JUNIPER_IFML_PPPOE, "PPPoE" },
+ { JUNIPER_IFML_ETHERNET_FLEX, "Flexible-Ethernet-Services" },
+ { JUNIPER_IFML_FRAMERELAY_FLEX, "Flexible-FrameRelay" },
+ { JUNIPER_IFML_COLLECTOR, "Flow-collection" },
+ { JUNIPER_IFML_PICPEER, "PIC Peer" },
+ { JUNIPER_IFML_DFC, "Dynamic-Flow-Capture" },
+ {0, NULL}
+};
+
+#define JUNIPER_IFLE_ATM_SNAP 2
+#define JUNIPER_IFLE_ATM_NLPID 3
+#define JUNIPER_IFLE_ATM_VCMUX 4
+#define JUNIPER_IFLE_ATM_LLC 5
+#define JUNIPER_IFLE_ATM_PPP_VCMUX 6
+#define JUNIPER_IFLE_ATM_PPP_LLC 7
+#define JUNIPER_IFLE_ATM_PPP_FUNI 8
+#define JUNIPER_IFLE_ATM_CCC 9
+#define JUNIPER_IFLE_FR_NLPID 10
+#define JUNIPER_IFLE_FR_SNAP 11
+#define JUNIPER_IFLE_FR_PPP 12
+#define JUNIPER_IFLE_FR_CCC 13
+#define JUNIPER_IFLE_ENET2 14
+#define JUNIPER_IFLE_IEEE8023_SNAP 15
+#define JUNIPER_IFLE_IEEE8023_LLC 16
+#define JUNIPER_IFLE_PPP 17
+#define JUNIPER_IFLE_CISCOHDLC 18
+#define JUNIPER_IFLE_PPP_CCC 19
+#define JUNIPER_IFLE_IPIP_NULL 20
+#define JUNIPER_IFLE_PIM_NULL 21
+#define JUNIPER_IFLE_GRE_NULL 22
+#define JUNIPER_IFLE_GRE_PPP 23
+#define JUNIPER_IFLE_PIMD_DECAPS 24
+#define JUNIPER_IFLE_CISCOHDLC_CCC 25
+#define JUNIPER_IFLE_ATM_CISCO_NLPID 26
+#define JUNIPER_IFLE_VLAN_CCC 27
+#define JUNIPER_IFLE_MLPPP 28
+#define JUNIPER_IFLE_MLFR 29
+#define JUNIPER_IFLE_LSI_NULL 30
+#define JUNIPER_IFLE_AGGREGATE_UNUSED 31
+#define JUNIPER_IFLE_ATM_CELLRELAY_CCC 32
+#define JUNIPER_IFLE_CRYPTO 33
+#define JUNIPER_IFLE_GGSN 34
+#define JUNIPER_IFLE_ATM_TCC 35
+#define JUNIPER_IFLE_FR_TCC 36
+#define JUNIPER_IFLE_PPP_TCC 37
+#define JUNIPER_IFLE_CISCOHDLC_TCC 38
+#define JUNIPER_IFLE_ETHERNET_CCC 39
+#define JUNIPER_IFLE_VT 40
+#define JUNIPER_IFLE_ATM_EOA_LLC 41
+#define JUNIPER_IFLE_EXTENDED_VLAN_CCC 42
+#define JUNIPER_IFLE_ATM_SNAP_TCC 43
+#define JUNIPER_IFLE_MONITOR 44
+#define JUNIPER_IFLE_ETHERNET_TCC 45
+#define JUNIPER_IFLE_VLAN_TCC 46
+#define JUNIPER_IFLE_EXTENDED_VLAN_TCC 47
+#define JUNIPER_IFLE_MFR 48
+#define JUNIPER_IFLE_ETHERNET_VPLS 49
+#define JUNIPER_IFLE_ETHERNET_VLAN_VPLS 50
+#define JUNIPER_IFLE_ETHERNET_EXTENDED_VLAN_VPLS 51
+#define JUNIPER_IFLE_SERVICES 52
+#define JUNIPER_IFLE_ATM_ETHER_VPLS_ATM_LLC 53
+#define JUNIPER_IFLE_FR_PORT_CCC 54
+#define JUNIPER_IFLE_ATM_MLPPP_LLC 55
+#define JUNIPER_IFLE_ATM_EOA_CCC 56
+#define JUNIPER_IFLE_LT_VLAN 57
+#define JUNIPER_IFLE_COLLECTOR 58
+#define JUNIPER_IFLE_AGGREGATOR 59
+#define JUNIPER_IFLE_LAPD 60
+#define JUNIPER_IFLE_ATM_PPPOE_LLC 61
+#define JUNIPER_IFLE_ETHERNET_PPPOE 62
+#define JUNIPER_IFLE_PPPOE 63
+#define JUNIPER_IFLE_PPP_SUBORDINATE 64
+#define JUNIPER_IFLE_CISCOHDLC_SUBORDINATE 65
+#define JUNIPER_IFLE_DFC 66
+#define JUNIPER_IFLE_PICPEER 67
+
+struct tok juniper_ifle_values[] = {
+ { JUNIPER_IFLE_AGGREGATOR, "Aggregator" },
+ { JUNIPER_IFLE_ATM_CCC, "CCC over ATM" },
+ { JUNIPER_IFLE_ATM_CELLRELAY_CCC, "ATM CCC Cell Relay" },
+ { JUNIPER_IFLE_ATM_CISCO_NLPID, "CISCO compatible NLPID" },
+ { JUNIPER_IFLE_ATM_EOA_CCC, "Ethernet over ATM CCC" },
+ { JUNIPER_IFLE_ATM_EOA_LLC, "Ethernet over ATM LLC" },
+ { JUNIPER_IFLE_ATM_ETHER_VPLS_ATM_LLC, "Ethernet VPLS over ATM LLC" },
+ { JUNIPER_IFLE_ATM_LLC, "ATM LLC" },
+ { JUNIPER_IFLE_ATM_MLPPP_LLC, "MLPPP over ATM LLC" },
+ { JUNIPER_IFLE_ATM_NLPID, "ATM NLPID" },
+ { JUNIPER_IFLE_ATM_PPPOE_LLC, "PPPoE over ATM LLC" },
+ { JUNIPER_IFLE_ATM_PPP_FUNI, "PPP over FUNI" },
+ { JUNIPER_IFLE_ATM_PPP_LLC, "PPP over ATM LLC" },
+ { JUNIPER_IFLE_ATM_PPP_VCMUX, "PPP over ATM VCMUX" },
+ { JUNIPER_IFLE_ATM_SNAP, "ATM SNAP" },
+ { JUNIPER_IFLE_ATM_SNAP_TCC, "ATM SNAP TCC" },
+ { JUNIPER_IFLE_ATM_TCC, "ATM VCMUX TCC" },
+ { JUNIPER_IFLE_ATM_VCMUX, "ATM VCMUX" },
+ { JUNIPER_IFLE_CISCOHDLC, "C-HDLC" },
+ { JUNIPER_IFLE_CISCOHDLC_CCC, "C-HDLC CCC" },
+ { JUNIPER_IFLE_CISCOHDLC_SUBORDINATE, "C-HDLC via dialer" },
+ { JUNIPER_IFLE_CISCOHDLC_TCC, "C-HDLC TCC" },
+ { JUNIPER_IFLE_COLLECTOR, "Collector" },
+ { JUNIPER_IFLE_CRYPTO, "Crypto" },
+ { JUNIPER_IFLE_ENET2, "Ethernet" },
+ { JUNIPER_IFLE_ETHERNET_CCC, "Ethernet CCC" },
+ { JUNIPER_IFLE_ETHERNET_EXTENDED_VLAN_VPLS, "Extended VLAN VPLS" },
+ { JUNIPER_IFLE_ETHERNET_PPPOE, "PPPoE over Ethernet" },
+ { JUNIPER_IFLE_ETHERNET_TCC, "Ethernet TCC" },
+ { JUNIPER_IFLE_ETHERNET_VLAN_VPLS, "VLAN VPLS" },
+ { JUNIPER_IFLE_ETHERNET_VPLS, "VPLS" },
+ { JUNIPER_IFLE_EXTENDED_VLAN_CCC, "Extended VLAN CCC" },
+ { JUNIPER_IFLE_EXTENDED_VLAN_TCC, "Extended VLAN TCC" },
+ { JUNIPER_IFLE_FR_CCC, "FR CCC" },
+ { JUNIPER_IFLE_FR_NLPID, "FR NLPID" },
+ { JUNIPER_IFLE_FR_PORT_CCC, "FR CCC" },
+ { JUNIPER_IFLE_FR_PPP, "FR PPP" },
+ { JUNIPER_IFLE_FR_SNAP, "FR SNAP" },
+ { JUNIPER_IFLE_FR_TCC, "FR TCC" },
+ { JUNIPER_IFLE_GGSN, "GGSN" },
+ { JUNIPER_IFLE_GRE_NULL, "GRE NULL" },
+ { JUNIPER_IFLE_GRE_PPP, "PPP over GRE" },
+ { JUNIPER_IFLE_IPIP_NULL, "IPIP" },
+ { JUNIPER_IFLE_LAPD, "LAPD" },
+ { JUNIPER_IFLE_LSI_NULL, "LSI Null" },
+ { JUNIPER_IFLE_LT_VLAN, "LT VLAN" },
+ { JUNIPER_IFLE_MFR, "MFR" },
+ { JUNIPER_IFLE_MLFR, "MLFR" },
+ { JUNIPER_IFLE_MLPPP, "MLPPP" },
+ { JUNIPER_IFLE_MONITOR, "Monitor" },
+ { JUNIPER_IFLE_PIMD_DECAPS, "PIMd" },
+ { JUNIPER_IFLE_PIM_NULL, "PIM Null" },
+ { JUNIPER_IFLE_PPP, "PPP" },
+ { JUNIPER_IFLE_PPPOE, "PPPoE" },
+ { JUNIPER_IFLE_PPP_CCC, "PPP CCC" },
+ { JUNIPER_IFLE_PPP_SUBORDINATE, "" },
+ { JUNIPER_IFLE_PPP_TCC, "PPP TCC" },
+ { JUNIPER_IFLE_SERVICES, "General Services" },
+ { JUNIPER_IFLE_VLAN_CCC, "VLAN CCC" },
+ { JUNIPER_IFLE_VLAN_TCC, "VLAN TCC" },
+ { JUNIPER_IFLE_VT, "VT" },
+ {0, NULL}
+};
+
struct juniper_cookie_table_t {
u_int32_t pictype; /* pic type */
u_int8_t cookie_len; /* cookie len */
@@ -128,6 +419,7 @@
u_int8_t cookie[8];
u_int8_t bundle;
u_int16_t proto;
+ u_int8_t flags;
};
#define LS_COOKIE_ID 0x54
@@ -156,6 +448,7 @@
int ip_heuristic_guess(register const u_char *, u_int);
int juniper_ppp_heuristic_guess(register const u_char *, u_int);
+int juniper_read_tlv_value(const u_char *, u_int, u_int);
static int juniper_parse_header (const u_char *, const struct pcap_pkthdr *, struct juniper_l2info_t *);
#ifdef DLT_JUNIPER_GGSN
@@ -178,13 +471,14 @@
return l2info.header_len;
p+=l2info.header_len;
- gh = (struct juniper_ggsn_header *)p;
+ gh = (struct juniper_ggsn_header *)&l2info.cookie;
- if (eflag)
+ if (eflag) {
printf("proto %s (%u), vlan %u: ",
tok2str(juniper_protocol_values,"Unknown",gh->proto),
gh->proto,
EXTRACT_16BITS(&gh->vlan_id[0]));
+ }
switch (gh->proto) {
case JUNIPER_PROTO_IPV4:
@@ -192,7 +486,7 @@
break;
#ifdef INET6
case JUNIPER_PROTO_IPV6:
- ip6_print(p, l2info.length);
+ ip6_print(gndo, p, l2info.length);
break;
#endif /* INET6 */
default:
@@ -256,8 +550,8 @@
tok2str(juniper_ipsec_type_values,"Unknown",ih->type),
ih->type,
EXTRACT_32BITS(&ih->spi),
- ipaddr_string(EXTRACT_32BITS(&ih->src_ip)),
- ipaddr_string(EXTRACT_32BITS(&ih->dst_ip)),
+ ipaddr_string(&ih->src_ip),
+ ipaddr_string(&ih->dst_ip),
l2info.length);
} else {
printf("ES SA, index %u, ttl %u type %s (%u), length %u\n",
@@ -353,7 +647,7 @@
p+=l2info.header_len;
/* this DLT contains nothing but raw ethernet frames */
- ether_print(p, l2info.length, l2info.caplen);
+ ether_print(gndo, p, l2info.length, l2info.caplen, NULL, NULL);
return l2info.header_len;
}
#endif
@@ -370,7 +664,7 @@
p+=l2info.header_len;
/* this DLT contains nothing but raw Ethernet frames */
- ether_print(p, l2info.length, l2info.caplen);
+ ether_print(gndo, p, l2info.length, l2info.caplen, NULL, NULL);
return l2info.header_len;
}
#endif
@@ -442,11 +736,10 @@
extracted_ethertype = EXTRACT_16BITS(p);
/* this DLT contains nothing but raw PPPoE frames,
* prepended with a type field*/
- if (ether_encap_print(extracted_ethertype,
+ if (ethertype_print(gndo, extracted_ethertype,
p+ETHERTYPE_LEN,
l2info.length-ETHERTYPE_LEN,
- l2info.caplen-ETHERTYPE_LEN,
- &extracted_ethertype) == 0)
+ l2info.caplen-ETHERTYPE_LEN) == 0)
/* ether_type not known, probably it wasn't one */
printf("unknown ethertype 0x%04x", extracted_ethertype);
@@ -486,7 +779,7 @@
return l2info.header_len;
#ifdef INET6
case JUNIPER_LSQ_L3_PROTO_IPV6:
- ip6_print(p,l2info.length);
+ ip6_print(gndo, p,l2info.length);
return l2info.header_len;
#endif
case JUNIPER_LSQ_L3_PROTO_MPLS:
@@ -541,7 +834,7 @@
return l2info.header_len;
#ifdef INET6
case JUNIPER_LSQ_L3_PROTO_IPV6:
- ip6_print(p,l2info.length);
+ ip6_print(gndo, p,l2info.length);
return l2info.header_len;
#endif
case JUNIPER_LSQ_L3_PROTO_MPLS:
@@ -694,7 +987,7 @@
if (l2info.direction != JUNIPER_BPF_PKT_IN && /* ether-over-1483 encaps ? */
(EXTRACT_32BITS(l2info.cookie) & ATM2_GAP_COUNT_MASK)) {
- ether_print(p, l2info.length, l2info.caplen);
+ ether_print(gndo, p, l2info.length, l2info.caplen, NULL, NULL);
return l2info.header_len;
}
@@ -780,7 +1073,7 @@
case 0x6d:
case 0x6e:
case 0x6f:
- ip6_print(p, length);
+ ip6_print(gndo, p, length);
break;
#endif
default:
@@ -790,15 +1083,64 @@
return 1; /* we printed an v4/v6 packet */
}
+int
+juniper_read_tlv_value(const u_char *p, u_int tlv_type, u_int tlv_len) {
+
+ int tlv_value;
+
+ /* TLVs < 128 are little endian encoded */
+ if (tlv_type < 128) {
+ switch (tlv_len) {
+ case 1:
+ tlv_value = *p;
+ break;
+ case 2:
+ tlv_value = EXTRACT_LE_16BITS(p);
+ break;
+ case 3:
+ tlv_value = EXTRACT_LE_24BITS(p);
+ break;
+ case 4:
+ tlv_value = EXTRACT_LE_32BITS(p);
+ break;
+ default:
+ tlv_value = -1;
+ break;
+ }
+ } else {
+ /* TLVs >= 128 are big endian encoded */
+ switch (tlv_len) {
+ case 1:
+ tlv_value = *p;
+ break;
+ case 2:
+ tlv_value = EXTRACT_16BITS(p);
+ break;
+ case 3:
+ tlv_value = EXTRACT_24BITS(p);
+ break;
+ case 4:
+ tlv_value = EXTRACT_32BITS(p);
+ break;
+ default:
+ tlv_value = -1;
+ break;
+ }
+ }
+ return tlv_value;
+}
+
static int
juniper_parse_header (const u_char *p, const struct pcap_pkthdr *h, struct juniper_l2info_t *l2info) {
struct juniper_cookie_table_t *lp = juniper_cookie_table;
- u_int idx, offset;
-#ifdef DLT_JUNIPER_ATM2
+ u_int idx, jnx_ext_len, jnx_header_len = 0;
+ u_int8_t tlv_type,tlv_len;
u_int32_t control_word;
-#endif
+ int tlv_value;
+ const u_char *tptr;
+
l2info->header_len = 0;
l2info->cookie_len = 0;
l2info->proto = 0;
@@ -806,9 +1148,10 @@
l2info->length = h->len;
l2info->caplen = h->caplen;
+ TCHECK2(p[0],4);
+ l2info->flags = p[3];
l2info->direction = p[3]&JUNIPER_BPF_PKT_IN;
- TCHECK2(p[0],4);
if (EXTRACT_24BITS(p) != JUNIPER_MGC_NUMBER) { /* magic number found ? */
printf("no magic-number found!");
return 0;
@@ -817,15 +1160,92 @@
if (eflag) /* print direction */
printf("%3s ",tok2str(juniper_direction_values,"---",l2info->direction));
+ /* magic number + flags */
+ jnx_header_len = 4;
+
+ if (vflag>1)
+ printf("\n\tJuniper PCAP Flags [%s]",
+ bittok2str(jnx_flag_values, "none", l2info->flags));
+
/* extensions present ? - calculate how much bytes to skip */
- if ((p[3] & JUNIPER_BPF_EXT ) == JUNIPER_BPF_EXT ) {
- offset = 6 + EXTRACT_16BITS(p+4);
- if (eflag>1)
- printf("ext-len %u, ",EXTRACT_16BITS(p+4));
- } else
- offset = 4;
+ if ((l2info->flags & JUNIPER_BPF_EXT ) == JUNIPER_BPF_EXT ) {
- if ((p[3] & JUNIPER_BPF_NO_L2 ) == JUNIPER_BPF_NO_L2 ) {
+ tptr = p+jnx_header_len;
+
+ /* ok to read extension length ? */
+ TCHECK2(tptr[0], 2);
+ jnx_ext_len = EXTRACT_16BITS(tptr);
+ jnx_header_len += 2;
+ tptr +=2;
+
+ /* nail up the total length -
+ * just in case something goes wrong
+ * with TLV parsing */
+ jnx_header_len += jnx_ext_len;
+
+ if (vflag>1)
+ printf(", PCAP Extension(s) total length %u",
+ jnx_ext_len);
+
+ TCHECK2(tptr[0], jnx_ext_len);
+ while (jnx_ext_len > JUNIPER_EXT_TLV_OVERHEAD) {
+ tlv_type = *(tptr++);
+ tlv_len = *(tptr++);
+ tlv_value = 0;
+
+ /* sanity check */
+ if (tlv_type == 0 || tlv_len == 0)
+ break;
+
+ if (vflag>1)
+ printf("\n\t %s Extension TLV #%u, length %u, value ",
+ tok2str(jnx_ext_tlv_values,"Unknown",tlv_type),
+ tlv_type,
+ tlv_len);
+
+ tlv_value = juniper_read_tlv_value(tptr, tlv_type, tlv_len);
+ switch (tlv_type) {
+ case JUNIPER_EXT_TLV_IFD_NAME:
+ /* FIXME */
+ break;
+ case JUNIPER_EXT_TLV_IFD_MEDIATYPE:
+ case JUNIPER_EXT_TLV_TTP_IFD_MEDIATYPE:
+ if (tlv_value != -1) {
+ if (vflag>1)
+ printf("%s (%u)",
+ tok2str(juniper_ifmt_values, "Unknown", tlv_value),
+ tlv_value);
+ }
+ break;
+ case JUNIPER_EXT_TLV_IFL_ENCAPS:
+ case JUNIPER_EXT_TLV_TTP_IFL_ENCAPS:
+ if (tlv_value != -1) {
+ if (vflag>1)
+ printf("%s (%u)",
+ tok2str(juniper_ifle_values, "Unknown", tlv_value),
+ tlv_value);
+ }
+ break;
+ case JUNIPER_EXT_TLV_IFL_IDX: /* fall through */
+ case JUNIPER_EXT_TLV_IFL_UNIT:
+ case JUNIPER_EXT_TLV_IFD_IDX:
+ default:
+ if (tlv_value != -1) {
+ if (vflag>1)
+ printf("%u",tlv_value);
+ }
+ break;
+ }
+
+ tptr+=tlv_len;
+ jnx_ext_len -= tlv_len+JUNIPER_EXT_TLV_OVERHEAD;
+ }
+
+ if (vflag>1)
+ printf("\n\t-----original packet-----\n\t");
+ }
+
+ if ((l2info->flags & JUNIPER_BPF_NO_L2 ) == JUNIPER_BPF_NO_L2 ) {
if (eflag)
printf("no-L2-hdr, ");
@@ -833,15 +1253,15 @@
* perform the v4/v6 heuristics
* to figure out what it is
*/
- TCHECK2(p[offset+4],1);
- if(ip_heuristic_guess(p+offset+4,l2info->length-(offset+4)) == 0)
+ TCHECK2(p[jnx_header_len+4],1);
+ if(ip_heuristic_guess(p+jnx_header_len+4,l2info->length-(jnx_header_len+4)) == 0)
printf("no IP-hdr found!");
- l2info->header_len=offset+4;
+ l2info->header_len=jnx_header_len+4;
return 0; /* stop parsing the output further */
}
- l2info->header_len = offset;
+ l2info->header_len = jnx_header_len;
p+=l2info->header_len;
l2info->length -= l2info->header_len;
l2info->caplen -= l2info->header_len;
@@ -988,6 +1408,10 @@
}
break;
#endif
+#ifdef DLT_JUNIPER_GGSN
+ case DLT_JUNIPER_GGSN:
+ break;
+#endif
#ifdef DLT_JUNIPER_ATM1
case DLT_JUNIPER_ATM1:
break;
Modified: trunk/contrib/tcpdump/print-krb.c
===================================================================
--- trunk/contrib/tcpdump/print-krb.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-krb.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-krb.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-krb.c,v 1.23 2003-11-16 09:36:26 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-l2tp.c
===================================================================
--- trunk/contrib/tcpdump/print-l2tp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-l2tp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-l2tp.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-l2tp.c,v 1.20 2006-06-23 02:03:09 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -606,7 +606,7 @@
void
l2tp_print(const u_char *dat, u_int length)
{
- const u_int16_t *ptr = (u_int16_t *)dat;
+ const u_char *ptr = dat;
u_int cnt = 0; /* total octets consumed */
u_int16_t pad;
int flag_t, flag_l, flag_s, flag_o;
@@ -614,7 +614,7 @@
flag_t = flag_l = flag_s = flag_o = FALSE;
- TCHECK(*ptr); /* Flags & Version */
+ TCHECK2(*ptr, 2); /* Flags & Version */
if ((EXTRACT_16BITS(ptr) & L2TP_VERSION_MASK) == L2TP_VERSION_L2TP) {
printf(" l2tp:");
} else if ((EXTRACT_16BITS(ptr) & L2TP_VERSION_MASK) == L2TP_VERSION_L2F) {
@@ -646,37 +646,42 @@
printf("P");
printf("]");
- ptr++;
+ ptr += 2;
cnt += 2;
if (flag_l) {
- TCHECK(*ptr); /* Length */
- l2tp_len = EXTRACT_16BITS(ptr); ptr++;
+ TCHECK2(*ptr, 2); /* Length */
+ l2tp_len = EXTRACT_16BITS(ptr);
+ ptr += 2;
cnt += 2;
} else {
l2tp_len = 0;
}
- TCHECK(*ptr); /* Tunnel ID */
- printf("(%u/", EXTRACT_16BITS(ptr)); ptr++;
+ TCHECK2(*ptr, 2); /* Tunnel ID */
+ printf("(%u/", EXTRACT_16BITS(ptr));
+ ptr += 2;
cnt += 2;
- TCHECK(*ptr); /* Session ID */
- printf("%u)", EXTRACT_16BITS(ptr)); ptr++;
+ TCHECK2(*ptr, 2); /* Session ID */
+ printf("%u)", EXTRACT_16BITS(ptr));
+ ptr += 2;
cnt += 2;
if (flag_s) {
- TCHECK(*ptr); /* Ns */
- printf("Ns=%u,", EXTRACT_16BITS(ptr)); ptr++;
+ TCHECK2(*ptr, 2); /* Ns */
+ printf("Ns=%u,", EXTRACT_16BITS(ptr));
+ ptr += 2;
cnt += 2;
- TCHECK(*ptr); /* Nr */
- printf("Nr=%u", EXTRACT_16BITS(ptr)); ptr++;
+ TCHECK2(*ptr, 2); /* Nr */
+ printf("Nr=%u", EXTRACT_16BITS(ptr));
+ ptr += 2;
cnt += 2;
}
if (flag_o) {
- TCHECK(*ptr); /* Offset Size */
- pad = EXTRACT_16BITS(ptr); ptr++;
- ptr += pad / sizeof(*ptr);
+ TCHECK2(*ptr, 2); /* Offset Size */
+ pad = EXTRACT_16BITS(ptr);
+ ptr += (2 + pad);
cnt += (2 + pad);
}
@@ -699,11 +704,11 @@
if (length - cnt == 0) {
printf(" ZLB");
} else {
- l2tp_avp_print((u_char *)ptr, length - cnt);
+ l2tp_avp_print(ptr, length - cnt);
}
} else {
printf(" {");
- ppp_print((u_char *)ptr, length - cnt);
+ ppp_print(ptr, length - cnt);
printf("}");
}
Modified: trunk/contrib/tcpdump/print-lane.c
===================================================================
--- trunk/contrib/tcpdump/print-lane.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-lane.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -22,7 +22,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-lane.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.25 2005-11-13 12:12:42 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -60,25 +60,10 @@
{ 0, NULL }
};
-static inline void
-lane_hdr_print(register const u_char *bp, int length)
+static void
+lane_hdr_print(netdissect_options *ndo, const u_char *bp)
{
- register const struct lecdatahdr_8023 *ep;
-
- ep = (const struct lecdatahdr_8023 *)bp;
- if (qflag)
- (void)printf("lecid:%x %s %s %d: ",
- EXTRACT_16BITS(&ep->le_header),
- etheraddr_string(ep->h_source),
- etheraddr_string(ep->h_dest),
- length);
- else
- (void)printf("lecid:%x %s %s %s %d: ",
- EXTRACT_16BITS(&ep->le_header),
- etheraddr_string(ep->h_source),
- etheraddr_string(ep->h_dest),
- etherproto_string(ep->h_type),
- length);
+ (void)ND_PRINT((ndo, "lecid:%x ", EXTRACT_16BITS(bp)));
}
/*
@@ -93,9 +78,6 @@
lane_print(const u_char *p, u_int length, u_int caplen)
{
struct lane_controlhdr *lec;
- struct lecdatahdr_8023 *ep;
- u_short ether_type;
- u_short extracted_ethertype;
if (caplen < sizeof(struct lane_controlhdr)) {
printf("[|lane]");
@@ -113,49 +95,18 @@
return;
}
- if (caplen < sizeof(struct lecdatahdr_8023)) {
- printf("[|lane]");
- return;
- }
-
- if (eflag)
- lane_hdr_print(p, length);
-
/*
- * Go past the LANE header.
+ * Go past the LE header.
*/
- length -= sizeof(struct lecdatahdr_8023);
- caplen -= sizeof(struct lecdatahdr_8023);
- ep = (struct lecdatahdr_8023 *)p;
- p += sizeof(struct lecdatahdr_8023);
+ length -= 2;
+ caplen -= 2;
+ p += 2;
- ether_type = EXTRACT_16BITS(&ep->h_type);
-
/*
- * Is it (gag) an 802.3 encapsulation?
+ * Now print the encapsulated frame, under the assumption
+ * that it's an Ethernet frame.
*/
- if (ether_type <= ETHERMTU) {
- /* Try to print the LLC-layer header & higher layers */
- if (llc_print(p, length, caplen, ep->h_source, ep->h_dest,
- &extracted_ethertype) == 0) {
- /* ether_type not known, print raw packet */
- if (!eflag)
- lane_hdr_print((u_char *)ep, length + sizeof(*ep));
- if (extracted_ethertype) {
- printf("(LLC %s) ",
- etherproto_string(htons(extracted_ethertype)));
- }
- if (!suppress_default_print)
- default_print(p, caplen);
- }
- } else if (ether_encap_print(ether_type, p, length, caplen,
- &extracted_ethertype) == 0) {
- /* ether_type not known, print raw packet */
- if (!eflag)
- lane_hdr_print((u_char *)ep, length + sizeof(*ep));
- if (!suppress_default_print)
- default_print(p, caplen);
- }
+ ether_print(gndo, p, length, caplen, lane_hdr_print, p - 2);
}
u_int
Modified: trunk/contrib/tcpdump/print-ldp.c
===================================================================
--- trunk/contrib/tcpdump/print-ldp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ldp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -16,7 +16,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ldp.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ldp.c,v 1.20 2006-06-23 02:03:09 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -33,9 +33,9 @@
#include "decode_prefix.h"
#include "extract.h"
#include "addrtoname.h"
-#include "af.h"
#include "l2vpn.h"
+#include "af.h"
/*
* ldp common header
@@ -131,6 +131,7 @@
#define LDP_TLV_FEC 0x0100
#define LDP_TLV_ADDRESS_LIST 0x0101
+#define LDP_TLV_ADDRESS_LIST_AFNUM_LEN 2
#define LDP_TLV_HOP_COUNT 0x0103
#define LDP_TLV_PATH_VECTOR 0x0104
#define LDP_TLV_GENERIC_LABEL 0x0200
@@ -149,6 +150,7 @@
#define LDP_TLV_FR_SESSION_PARM 0x0502
#define LDP_TLV_FT_SESSION 0x0503
#define LDP_TLV_LABEL_REQUEST_MSG_ID 0x0600
+#define LDP_TLV_MTU 0x0601 /* rfc 3988 */
static const struct tok ldp_tlv_values[] = {
{ LDP_TLV_FEC, "FEC" },
@@ -171,6 +173,7 @@
{ LDP_TLV_FR_SESSION_PARM, "Frame-Relay Session Parameters" },
{ LDP_TLV_FT_SESSION, "Fault-Tolerant Session Parameters" },
{ LDP_TLV_LABEL_REQUEST_MSG_ID, "Label Request Message ID" },
+ { LDP_TLV_MTU, "MTU" },
{ 0, NULL}
};
@@ -177,7 +180,7 @@
#define LDP_FEC_WILDCARD 0x01
#define LDP_FEC_PREFIX 0x02
#define LDP_FEC_HOSTADDRESS 0x03
-/* From draft-martini-l2circuit-trans-mpls-13.txt */
+/* From RFC 4906; should probably be updated to RFC 4447 (e.g., VC -> PW) */
#define LDP_FEC_MARTINI_VC 0x80
static const struct tok ldp_fec_values[] = {
@@ -215,8 +218,6 @@
{ 0, NULL}
};
-#define AFNUM_LEN 2
-
int ldp_msg_print(register const u_char *);
int ldp_tlv_print(register const u_char *);
@@ -237,6 +238,9 @@
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
+#define TLV_TCHECK(minlen) \
+ TCHECK2(*tptr, minlen); if (tlv_tlen < minlen) goto badtlv;
+
int
ldp_tlv_print(register const u_char *tptr) {
@@ -272,6 +276,7 @@
switch(tlv_type) {
case LDP_TLV_COMMON_HELLO:
+ TLV_TCHECK(4);
printf("\n\t Hold Time: %us, Flags: [%s Hello%s]",
EXTRACT_16BITS(tptr),
(EXTRACT_16BITS(tptr+2)&0x8000) ? "Targeted" : "Link",
@@ -279,43 +284,54 @@
break;
case LDP_TLV_IPV4_TRANSPORT_ADDR:
+ TLV_TCHECK(4);
printf("\n\t IPv4 Transport Address: %s", ipaddr_string(tptr));
break;
#ifdef INET6
case LDP_TLV_IPV6_TRANSPORT_ADDR:
+ TLV_TCHECK(16);
printf("\n\t IPv6 Transport Address: %s", ip6addr_string(tptr));
break;
#endif
case LDP_TLV_CONFIG_SEQ_NUMBER:
+ TLV_TCHECK(4);
printf("\n\t Sequence Number: %u", EXTRACT_32BITS(tptr));
break;
case LDP_TLV_ADDRESS_LIST:
+ TLV_TCHECK(LDP_TLV_ADDRESS_LIST_AFNUM_LEN);
af = EXTRACT_16BITS(tptr);
- tptr+=AFNUM_LEN;
- tlv_tlen -= AFNUM_LEN;
- printf("\n\t Address Family: ");
- if (af == AFNUM_INET) {
- printf("IPv4, addresses:");
+ tptr+=LDP_TLV_ADDRESS_LIST_AFNUM_LEN;
+ tlv_tlen -= LDP_TLV_ADDRESS_LIST_AFNUM_LEN;
+ printf("\n\t Address Family: %s, addresses",
+ tok2str(af_values, "Unknown (%u)", af));
+ switch (af) {
+ case AFNUM_INET:
while(tlv_tlen >= sizeof(struct in_addr)) {
+ TCHECK2(*tptr, sizeof(struct in_addr));
printf(" %s",ipaddr_string(tptr));
tlv_tlen-=sizeof(struct in_addr);
tptr+=sizeof(struct in_addr);
}
- }
+ break;
#ifdef INET6
- else if (af == AFNUM_INET6) {
- printf("IPv6, addresses:");
+ case AFNUM_INET6:
while(tlv_tlen >= sizeof(struct in6_addr)) {
+ TCHECK2(*tptr, sizeof(struct in6_addr));
printf(" %s",ip6addr_string(tptr));
tlv_tlen-=sizeof(struct in6_addr);
tptr+=sizeof(struct in6_addr);
}
- }
+ break;
#endif
+ default:
+ /* unknown AF */
+ break;
+ }
break;
case LDP_TLV_COMMON_SESSION:
+ TLV_TCHECK(8);
printf("\n\t Version: %u, Keepalive: %us, Flags: [Downstream %s, Loop Detection %s]",
EXTRACT_16BITS(tptr), EXTRACT_16BITS(tptr+2),
(EXTRACT_16BITS(tptr+6)&0x8000) ? "On Demand" : "Unsolicited",
@@ -324,6 +340,7 @@
break;
case LDP_TLV_FEC:
+ TLV_TCHECK(1);
fec_type = *tptr;
printf("\n\t %s FEC (0x%02x)",
tok2str(ldp_fec_values, "Unknown", fec_type),
@@ -330,31 +347,65 @@
fec_type);
tptr+=1;
+ tlv_tlen-=1;
switch(fec_type) {
case LDP_FEC_WILDCARD:
break;
case LDP_FEC_PREFIX:
+ TLV_TCHECK(2);
af = EXTRACT_16BITS(tptr);
- tptr+=2;
+ tptr+=LDP_TLV_ADDRESS_LIST_AFNUM_LEN;
+ tlv_tlen-=LDP_TLV_ADDRESS_LIST_AFNUM_LEN;
if (af == AFNUM_INET) {
- i=decode_prefix4(tptr,buf,sizeof(buf));
- printf(": IPv4 prefix %s",buf);
+ i=decode_prefix4(tptr,tlv_tlen,buf,sizeof(buf));
+ if (i == -2)
+ goto trunc;
+ if (i == -3)
+ printf(": IPv4 prefix (goes past end of TLV)");
+ else if (i == -1)
+ printf(": IPv4 prefix (invalid length)");
+ else
+ printf(": IPv4 prefix %s",buf);
}
#ifdef INET6
else if (af == AFNUM_INET6) {
- i=decode_prefix6(tptr,buf,sizeof(buf));
- printf(": IPv6 prefix %s",buf);
+ i=decode_prefix6(tptr,tlv_tlen,buf,sizeof(buf));
+ if (i == -2)
+ goto trunc;
+ if (i == -3)
+ printf(": IPv4 prefix (goes past end of TLV)");
+ else if (i == -1)
+ printf(": IPv6 prefix (invalid length)");
+ else
+ printf(": IPv6 prefix %s",buf);
}
#endif
+ else
+ printf(": Address family %u prefix", af);
break;
case LDP_FEC_HOSTADDRESS:
break;
case LDP_FEC_MARTINI_VC:
- if (!TTEST2(*tptr, 11))
- goto trunc;
+ /*
+ * According to RFC 4908, the VC info Length field can be zero,
+ * in which case not only are there no interface parameters,
+ * there's no VC ID.
+ */
+ TLV_TCHECK(7);
vc_info_len = *(tptr+2);
+ if (vc_info_len == 0) {
+ printf(": %s, %scontrol word, group-ID %u, VC-info-length: %u",
+ tok2str(l2vpn_encaps_values, "Unknown", EXTRACT_16BITS(tptr)&0x7fff),
+ EXTRACT_16BITS(tptr)&0x8000 ? "" : "no ",
+ EXTRACT_32BITS(tptr+3),
+ vc_info_len);
+ break;
+ }
+
+ /* Make sure we have the VC ID as well */
+ TLV_TCHECK(11);
printf(": %s, %scontrol word, group-ID %u, VC-ID %u, VC-info-length: %u",
tok2str(l2vpn_encaps_values, "Unknown", EXTRACT_16BITS(tptr)&0x7fff),
EXTRACT_16BITS(tptr)&0x8000 ? "" : "no ",
@@ -361,13 +412,14 @@
EXTRACT_32BITS(tptr+3),
EXTRACT_32BITS(tptr+7),
vc_info_len);
+ if (vc_info_len < 4)
+ goto trunc; /* minimum 4, for the VC ID */
+ vc_info_len -= 4; /* subtract out the VC ID, giving the length of the interface parameters */
- if (vc_info_len == 0) /* infinite loop protection */
- break;
-
+ /* Skip past the fixed information and the VC ID */
tptr+=11;
- if (!TTEST2(*tptr, vc_info_len))
- goto trunc;
+ tlv_tlen-=11;
+ TLV_TCHECK(vc_info_len);
while (vc_info_len > 2) {
vc_info_tlv_type = *tptr;
@@ -416,10 +468,12 @@
break;
case LDP_TLV_GENERIC_LABEL:
+ TLV_TCHECK(4);
printf("\n\t Label: %u", EXTRACT_32BITS(tptr) & 0xfffff);
break;
case LDP_TLV_STATUS:
+ TLV_TCHECK(8);
ui = EXTRACT_32BITS(tptr);
tptr+=4;
printf("\n\t Status: 0x%02x, Flags: [%s and %s forward]",
@@ -433,6 +487,7 @@
break;
case LDP_TLV_FT_SESSION:
+ TLV_TCHECK(8);
ft_flags = EXTRACT_16BITS(tptr);
printf("\n\t Flags: [%sReconnect, %sSave State, %sAll-Label Protection, %s Checkpoint, %sRe-Learn State]",
ft_flags&0x8000 ? "" : "No ",
@@ -450,7 +505,12 @@
printf(", Recovery Time: %ums", ui);
break;
+ case LDP_TLV_MTU:
+ TLV_TCHECK(2);
+ printf("\n\t MTU: %u", EXTRACT_16BITS(tptr));
+ break;
+
/*
* FIXME those are the defined TLVs that lack a decoder
* you are welcome to contribute code ;-)
@@ -477,6 +537,10 @@
trunc:
printf("\n\t\t packet exceeded snapshot");
return 0;
+
+badtlv:
+ printf("\n\t\t TLV contents go past end of TLV");
+ return(tlv_len+4); /* Type & Length fields not included */
}
void
@@ -537,8 +601,7 @@
while(tlen>0) {
/* did we capture enough for fully decoding the msg header ? */
- if (!TTEST2(*tptr, sizeof(struct ldp_msg_header)))
- goto trunc;
+ TCHECK2(*tptr, sizeof(struct ldp_msg_header));
ldp_msg_header = (const struct ldp_msg_header *)tptr;
msg_len=EXTRACT_16BITS(ldp_msg_header->length);
@@ -561,8 +624,7 @@
msg_tlen=msg_len-sizeof(struct ldp_msg_header)+4; /* Type & Length fields not included */
/* did we capture enough for fully decoding the message ? */
- if (!TTEST2(*tptr, msg_len))
- goto trunc;
+ TCHECK2(*tptr, msg_len);
hexdump=FALSE;
switch(msg_type) {
@@ -600,7 +662,7 @@
}
/* do we want to see an additionally hexdump ? */
if (vflag > 1 || hexdump==TRUE)
- print_unknown_data(tptr+sizeof(sizeof(struct ldp_msg_header)),"\n\t ",
+ print_unknown_data(tptr+sizeof(struct ldp_msg_header),"\n\t ",
msg_len);
tptr += msg_len+4;
Modified: trunk/contrib/tcpdump/print-llc.c
===================================================================
--- trunk/contrib/tcpdump/print-llc.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-llc.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,12 +21,12 @@
* Code by Matt Thomas, Digital Equipment Corporation
* with an awful lot of hacking by Jeffrey Mogul, DECWRL
*
- * $FreeBSD: src/contrib/tcpdump/print-llc.c,v 1.12.2.1 2007/10/19 03:03:59 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-llc.c 236192 2012-05-28 19:13:21Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-llc.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-llc.c,v 1.75 2007-04-13 09:43:11 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -107,6 +107,8 @@
{ PID_CISCO_CDP, "CDP" },
{ PID_CISCO_VTP, "VTP" },
{ PID_CISCO_DTP, "DTP" },
+ { PID_CISCO_UDLD, "UDLD" },
+ { PID_CISCO_PVST, "PVST" },
{ 0, NULL }
};
@@ -309,8 +311,7 @@
* Does anybody ever bridge one form of LAN traffic
* over a networking type that uses 802.2 LLC?
*/
- ret = snap_print(p+3, length-3, caplen-3, extracted_ethertype,
- 2);
+ ret = snap_print(p+3, length-3, caplen-3, 2);
if (ret)
return (ret);
}
@@ -378,8 +379,7 @@
}
int
-snap_print(const u_char *p, u_int length, u_int caplen,
- u_short *extracted_ethertype, u_int bridge_pad)
+snap_print(const u_char *p, u_int length, u_int caplen, u_int bridge_pad)
{
u_int32_t orgcode;
register u_short et;
@@ -419,8 +419,7 @@
* Cisco hardware; the protocol ID is
* an Ethernet protocol type.
*/
- ret = ether_encap_print(et, p, length, caplen,
- extracted_ethertype);
+ ret = ethertype_print(gndo, et, p, length, caplen);
if (ret)
return (ret);
break;
@@ -435,8 +434,7 @@
* but used 0x000000 and an Ethernet
* packet type for AARP packets.
*/
- ret = ether_encap_print(et, p, length, caplen,
- extracted_ethertype);
+ ret = ethertype_print(gndo, et, p, length, caplen);
if (ret)
return (ret);
}
@@ -443,11 +441,25 @@
break;
case OUI_CISCO:
- if (et == PID_CISCO_CDP) {
- cdp_print(p, length, caplen);
- return (1);
- }
- break;
+ switch (et) {
+ case PID_CISCO_CDP:
+ cdp_print(p, length, caplen);
+ return (1);
+ case PID_CISCO_DTP:
+ dtp_print(p, length);
+ return (1);
+ case PID_CISCO_UDLD:
+ udld_print(p, length);
+ return (1);
+ case PID_CISCO_VTP:
+ vtp_print(p, length);
+ return (1);
+ case PID_CISCO_PVST:
+ stp_print(p, length);
+ return (1);
+ default:
+ break;
+ }
case OUI_RFC2684:
switch (et) {
@@ -469,7 +481,7 @@
/*
* What remains is an Ethernet packet.
*/
- ether_print(p, length, caplen);
+ ether_print(gndo, p, length, caplen, NULL, NULL);
return (1);
case PID_RFC2684_802_5_FCS:
Added: trunk/contrib/tcpdump/print-lldp.c
===================================================================
--- trunk/contrib/tcpdump/print-lldp.c (rev 0)
+++ trunk/contrib/tcpdump/print-lldp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,1413 @@
+/*
+ * Copyright (c) 1998-2007 The TCPDUMP project
+ *
+ * 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.
+ *
+ * support for the IEEE Link Discovery Protocol as per 802.1AB
+ *
+ * Original code by Hannes Gredler (hannes at juniper.net)
+ * IEEE and TIA extensions by Carles Kishimoto <carles.kishimoto at gmail.com>
+ * DCBX extensions by Kaladhar Musunuru <kaladharm at sourceforge.net>
+ */
+
+#ifndef lint
+static const char rcsid[] _U_ =
+"@(#) $Header: /tcpdump/master/tcpdump/print-lldp.c,v 1.10 2008-03-20 09:30:56 hannes Exp $";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "interface.h"
+#include "extract.h"
+#include "addrtoname.h"
+#include "af.h"
+#include "oui.h"
+
+#define LLDP_EXTRACT_TYPE(x) (((x)&0xfe00)>>9)
+#define LLDP_EXTRACT_LEN(x) ((x)&0x01ff)
+
+/*
+ * TLV type codes
+ */
+#define LLDP_END_TLV 0
+#define LLDP_CHASSIS_ID_TLV 1
+#define LLDP_PORT_ID_TLV 2
+#define LLDP_TTL_TLV 3
+#define LLDP_PORT_DESCR_TLV 4
+#define LLDP_SYSTEM_NAME_TLV 5
+#define LLDP_SYSTEM_DESCR_TLV 6
+#define LLDP_SYSTEM_CAP_TLV 7
+#define LLDP_MGMT_ADDR_TLV 8
+#define LLDP_PRIVATE_TLV 127
+
+static const struct tok lldp_tlv_values[] = {
+ { LLDP_END_TLV, "End" },
+ { LLDP_CHASSIS_ID_TLV, "Chassis ID" },
+ { LLDP_PORT_ID_TLV, "Port ID" },
+ { LLDP_TTL_TLV, "Time to Live" },
+ { LLDP_PORT_DESCR_TLV, "Port Description" },
+ { LLDP_SYSTEM_NAME_TLV, "System Name" },
+ { LLDP_SYSTEM_DESCR_TLV, "System Description" },
+ { LLDP_SYSTEM_CAP_TLV, "System Capabilities" },
+ { LLDP_MGMT_ADDR_TLV, "Management Address" },
+ { LLDP_PRIVATE_TLV, "Organization specific" },
+ { 0, NULL}
+};
+
+/*
+ * Chassis ID subtypes
+ */
+#define LLDP_CHASSIS_CHASSIS_COMP_SUBTYPE 1
+#define LLDP_CHASSIS_INTF_ALIAS_SUBTYPE 2
+#define LLDP_CHASSIS_PORT_COMP_SUBTYPE 3
+#define LLDP_CHASSIS_MAC_ADDR_SUBTYPE 4
+#define LLDP_CHASSIS_NETWORK_ADDR_SUBTYPE 5
+#define LLDP_CHASSIS_INTF_NAME_SUBTYPE 6
+#define LLDP_CHASSIS_LOCAL_SUBTYPE 7
+
+static const struct tok lldp_chassis_subtype_values[] = {
+ { LLDP_CHASSIS_CHASSIS_COMP_SUBTYPE, "Chassis component"},
+ { LLDP_CHASSIS_INTF_ALIAS_SUBTYPE, "Interface alias"},
+ { LLDP_CHASSIS_PORT_COMP_SUBTYPE, "Port component"},
+ { LLDP_CHASSIS_MAC_ADDR_SUBTYPE, "MAC address"},
+ { LLDP_CHASSIS_NETWORK_ADDR_SUBTYPE, "Network address"},
+ { LLDP_CHASSIS_INTF_NAME_SUBTYPE, "Interface name"},
+ { LLDP_CHASSIS_LOCAL_SUBTYPE, "Local"},
+ { 0, NULL}
+};
+
+/*
+ * Port ID subtypes
+ */
+#define LLDP_PORT_INTF_ALIAS_SUBTYPE 1
+#define LLDP_PORT_PORT_COMP_SUBTYPE 2
+#define LLDP_PORT_MAC_ADDR_SUBTYPE 3
+#define LLDP_PORT_NETWORK_ADDR_SUBTYPE 4
+#define LLDP_PORT_INTF_NAME_SUBTYPE 5
+#define LLDP_PORT_AGENT_CIRC_ID_SUBTYPE 6
+#define LLDP_PORT_LOCAL_SUBTYPE 7
+
+static const struct tok lldp_port_subtype_values[] = {
+ { LLDP_PORT_INTF_ALIAS_SUBTYPE, "Interface alias"},
+ { LLDP_PORT_PORT_COMP_SUBTYPE, "Port component"},
+ { LLDP_PORT_MAC_ADDR_SUBTYPE, "MAC address"},
+ { LLDP_PORT_NETWORK_ADDR_SUBTYPE, "Network Address"},
+ { LLDP_PORT_INTF_NAME_SUBTYPE, "Interface Name"},
+ { LLDP_PORT_AGENT_CIRC_ID_SUBTYPE, "Agent circuit ID"},
+ { LLDP_PORT_LOCAL_SUBTYPE, "Local"},
+ { 0, NULL}
+};
+
+/*
+ * System Capabilities
+ */
+#define LLDP_CAP_OTHER (1 << 0)
+#define LLDP_CAP_REPEATER (1 << 1)
+#define LLDP_CAP_BRIDGE (1 << 2)
+#define LLDP_CAP_WLAN_AP (1 << 3)
+#define LLDP_CAP_ROUTER (1 << 4)
+#define LLDP_CAP_PHONE (1 << 5)
+#define LLDP_CAP_DOCSIS (1 << 6)
+#define LLDP_CAP_STATION_ONLY (1 << 7)
+
+static const struct tok lldp_cap_values[] = {
+ { LLDP_CAP_OTHER, "Other"},
+ { LLDP_CAP_REPEATER, "Repeater"},
+ { LLDP_CAP_BRIDGE, "Bridge"},
+ { LLDP_CAP_WLAN_AP, "WLAN AP"},
+ { LLDP_CAP_ROUTER, "Router"},
+ { LLDP_CAP_PHONE, "Telephone"},
+ { LLDP_CAP_DOCSIS, "Docsis"},
+ { LLDP_CAP_STATION_ONLY, "Station Only"},
+ { 0, NULL}
+};
+
+#define LLDP_PRIVATE_8021_SUBTYPE_PORT_VLAN_ID 1
+#define LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_VLAN_ID 2
+#define LLDP_PRIVATE_8021_SUBTYPE_VLAN_NAME 3
+#define LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_IDENTITY 4
+
+static const struct tok lldp_8021_subtype_values[] = {
+ { LLDP_PRIVATE_8021_SUBTYPE_PORT_VLAN_ID, "Port VLAN Id"},
+ { LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_VLAN_ID, "Port and Protocol VLAN ID"},
+ { LLDP_PRIVATE_8021_SUBTYPE_VLAN_NAME, "VLAN name"},
+ { LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_IDENTITY, "Protocol Identity"},
+ { 0, NULL}
+};
+
+#define LLDP_8021_PORT_PROTOCOL_VLAN_SUPPORT (1 << 1)
+#define LLDP_8021_PORT_PROTOCOL_VLAN_STATUS (1 << 2)
+
+static const struct tok lldp_8021_port_protocol_id_values[] = {
+ { LLDP_8021_PORT_PROTOCOL_VLAN_SUPPORT, "supported"},
+ { LLDP_8021_PORT_PROTOCOL_VLAN_STATUS, "enabled"},
+ { 0, NULL}
+};
+
+#define LLDP_PRIVATE_8023_SUBTYPE_MACPHY 1
+#define LLDP_PRIVATE_8023_SUBTYPE_MDIPOWER 2
+#define LLDP_PRIVATE_8023_SUBTYPE_LINKAGGR 3
+#define LLDP_PRIVATE_8023_SUBTYPE_MTU 4
+
+static const struct tok lldp_8023_subtype_values[] = {
+ { LLDP_PRIVATE_8023_SUBTYPE_MACPHY, "MAC/PHY configuration/status"},
+ { LLDP_PRIVATE_8023_SUBTYPE_MDIPOWER, "Power via MDI"},
+ { LLDP_PRIVATE_8023_SUBTYPE_LINKAGGR, "Link aggregation"},
+ { LLDP_PRIVATE_8023_SUBTYPE_MTU, "Max frame size"},
+ { 0, NULL}
+};
+
+#define LLDP_PRIVATE_TIA_SUBTYPE_CAPABILITIES 1
+#define LLDP_PRIVATE_TIA_SUBTYPE_NETWORK_POLICY 2
+#define LLDP_PRIVATE_TIA_SUBTYPE_LOCAL_ID 3
+#define LLDP_PRIVATE_TIA_SUBTYPE_EXTENDED_POWER_MDI 4
+#define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_HARDWARE_REV 5
+#define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_FIRMWARE_REV 6
+#define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SOFTWARE_REV 7
+#define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SERIAL_NUMBER 8
+#define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MANUFACTURER_NAME 9
+#define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MODEL_NAME 10
+#define LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_ASSET_ID 11
+
+static const struct tok lldp_tia_subtype_values[] = {
+ { LLDP_PRIVATE_TIA_SUBTYPE_CAPABILITIES, "LLDP-MED Capabilities" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_NETWORK_POLICY, "Network policy" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_LOCAL_ID, "Location identification" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_EXTENDED_POWER_MDI, "Extended power-via-MDI" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_HARDWARE_REV, "Inventory - hardware revision" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_FIRMWARE_REV, "Inventory - firmware revision" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SOFTWARE_REV, "Inventory - software revision" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SERIAL_NUMBER, "Inventory - serial number" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MANUFACTURER_NAME, "Inventory - manufacturer name" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MODEL_NAME, "Inventory - model name" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_ASSET_ID, "Inventory - asset ID" },
+ { 0, NULL}
+};
+
+#define LLDP_PRIVATE_TIA_LOCATION_ALTITUDE_METERS 1
+#define LLDP_PRIVATE_TIA_LOCATION_ALTITUDE_FLOORS 2
+
+static const struct tok lldp_tia_location_altitude_type_values[] = {
+ { LLDP_PRIVATE_TIA_LOCATION_ALTITUDE_METERS, "meters"},
+ { LLDP_PRIVATE_TIA_LOCATION_ALTITUDE_FLOORS, "floors"},
+ { 0, NULL}
+};
+
+/* ANSI/TIA-1057 - Annex B */
+#define LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A1 1
+#define LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A2 2
+#define LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A3 3
+#define LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A4 4
+#define LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A5 5
+#define LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A6 6
+
+static const struct tok lldp_tia_location_lci_catype_values[] = {
+ { LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A1, "national subdivisions (state,canton,region,province,prefecture)"},
+ { LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A2, "county, parish, gun, district"},
+ { LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A3, "city, township, shi"},
+ { LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A4, "city division, borough, city district, ward chou"},
+ { LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A5, "neighborhood, block"},
+ { LLDP_PRIVATE_TIA_LOCATION_LCI_CATYPE_A6, "street"},
+ { 0, NULL}
+};
+
+static const struct tok lldp_tia_location_lci_what_values[] = {
+ { 0, "location of DHCP server"},
+ { 1, "location of the network element believed to be closest to the client"},
+ { 2, "location of the client"},
+ { 0, NULL}
+};
+
+/*
+ * From RFC 3636 - dot3MauType
+ */
+#define LLDP_MAU_TYPE_UNKNOWN 0
+#define LLDP_MAU_TYPE_AUI 1
+#define LLDP_MAU_TYPE_10BASE_5 2
+#define LLDP_MAU_TYPE_FOIRL 3
+#define LLDP_MAU_TYPE_10BASE_2 4
+#define LLDP_MAU_TYPE_10BASE_T 5
+#define LLDP_MAU_TYPE_10BASE_FP 6
+#define LLDP_MAU_TYPE_10BASE_FB 7
+#define LLDP_MAU_TYPE_10BASE_FL 8
+#define LLDP_MAU_TYPE_10BROAD36 9
+#define LLDP_MAU_TYPE_10BASE_T_HD 10
+#define LLDP_MAU_TYPE_10BASE_T_FD 11
+#define LLDP_MAU_TYPE_10BASE_FL_HD 12
+#define LLDP_MAU_TYPE_10BASE_FL_FD 13
+#define LLDP_MAU_TYPE_100BASE_T4 14
+#define LLDP_MAU_TYPE_100BASE_TX_HD 15
+#define LLDP_MAU_TYPE_100BASE_TX_FD 16
+#define LLDP_MAU_TYPE_100BASE_FX_HD 17
+#define LLDP_MAU_TYPE_100BASE_FX_FD 18
+#define LLDP_MAU_TYPE_100BASE_T2_HD 19
+#define LLDP_MAU_TYPE_100BASE_T2_FD 20
+#define LLDP_MAU_TYPE_1000BASE_X_HD 21
+#define LLDP_MAU_TYPE_1000BASE_X_FD 22
+#define LLDP_MAU_TYPE_1000BASE_LX_HD 23
+#define LLDP_MAU_TYPE_1000BASE_LX_FD 24
+#define LLDP_MAU_TYPE_1000BASE_SX_HD 25
+#define LLDP_MAU_TYPE_1000BASE_SX_FD 26
+#define LLDP_MAU_TYPE_1000BASE_CX_HD 27
+#define LLDP_MAU_TYPE_1000BASE_CX_FD 28
+#define LLDP_MAU_TYPE_1000BASE_T_HD 29
+#define LLDP_MAU_TYPE_1000BASE_T_FD 30
+#define LLDP_MAU_TYPE_10GBASE_X 31
+#define LLDP_MAU_TYPE_10GBASE_LX4 32
+#define LLDP_MAU_TYPE_10GBASE_R 33
+#define LLDP_MAU_TYPE_10GBASE_ER 34
+#define LLDP_MAU_TYPE_10GBASE_LR 35
+#define LLDP_MAU_TYPE_10GBASE_SR 36
+#define LLDP_MAU_TYPE_10GBASE_W 37
+#define LLDP_MAU_TYPE_10GBASE_EW 38
+#define LLDP_MAU_TYPE_10GBASE_LW 39
+#define LLDP_MAU_TYPE_10GBASE_SW 40
+
+static const struct tok lldp_mau_types_values[] = {
+ { LLDP_MAU_TYPE_UNKNOWN, "Unknown"},
+ { LLDP_MAU_TYPE_AUI, "AUI"},
+ { LLDP_MAU_TYPE_10BASE_5, "10BASE_5"},
+ { LLDP_MAU_TYPE_FOIRL, "FOIRL"},
+ { LLDP_MAU_TYPE_10BASE_2, "10BASE2"},
+ { LLDP_MAU_TYPE_10BASE_T, "10BASET duplex mode unknown"},
+ { LLDP_MAU_TYPE_10BASE_FP, "10BASEFP"},
+ { LLDP_MAU_TYPE_10BASE_FB, "10BASEFB"},
+ { LLDP_MAU_TYPE_10BASE_FL, "10BASEFL duplex mode unknown"},
+ { LLDP_MAU_TYPE_10BROAD36, "10BROAD36"},
+ { LLDP_MAU_TYPE_10BASE_T_HD, "10BASET hdx"},
+ { LLDP_MAU_TYPE_10BASE_T_FD, "10BASET fdx"},
+ { LLDP_MAU_TYPE_10BASE_FL_HD, "10BASEFL hdx"},
+ { LLDP_MAU_TYPE_10BASE_FL_FD, "10BASEFL fdx"},
+ { LLDP_MAU_TYPE_100BASE_T4, "100BASET4"},
+ { LLDP_MAU_TYPE_100BASE_TX_HD, "100BASETX hdx"},
+ { LLDP_MAU_TYPE_100BASE_TX_FD, "100BASETX fdx"},
+ { LLDP_MAU_TYPE_100BASE_FX_HD, "100BASEFX hdx"},
+ { LLDP_MAU_TYPE_100BASE_FX_FD, "100BASEFX fdx"},
+ { LLDP_MAU_TYPE_100BASE_T2_HD, "100BASET2 hdx"},
+ { LLDP_MAU_TYPE_100BASE_T2_FD, "100BASET2 fdx"},
+ { LLDP_MAU_TYPE_1000BASE_X_HD, "1000BASEX hdx"},
+ { LLDP_MAU_TYPE_1000BASE_X_FD, "1000BASEX fdx"},
+ { LLDP_MAU_TYPE_1000BASE_LX_HD, "1000BASELX hdx"},
+ { LLDP_MAU_TYPE_1000BASE_LX_FD, "1000BASELX fdx"},
+ { LLDP_MAU_TYPE_1000BASE_SX_HD, "1000BASESX hdx"},
+ { LLDP_MAU_TYPE_1000BASE_SX_FD, "1000BASESX fdx"},
+ { LLDP_MAU_TYPE_1000BASE_CX_HD, "1000BASECX hdx"},
+ { LLDP_MAU_TYPE_1000BASE_CX_FD, "1000BASECX fdx"},
+ { LLDP_MAU_TYPE_1000BASE_T_HD, "1000BASET hdx"},
+ { LLDP_MAU_TYPE_1000BASE_T_FD, "1000BASET fdx"},
+ { LLDP_MAU_TYPE_10GBASE_X, "10GBASEX"},
+ { LLDP_MAU_TYPE_10GBASE_LX4, "10GBASELX4"},
+ { LLDP_MAU_TYPE_10GBASE_R, "10GBASER"},
+ { LLDP_MAU_TYPE_10GBASE_ER, "10GBASEER"},
+ { LLDP_MAU_TYPE_10GBASE_LR, "10GBASELR"},
+ { LLDP_MAU_TYPE_10GBASE_SR, "10GBASESR"},
+ { LLDP_MAU_TYPE_10GBASE_W, "10GBASEW"},
+ { LLDP_MAU_TYPE_10GBASE_EW, "10GBASEEW"},
+ { LLDP_MAU_TYPE_10GBASE_LW, "10GBASELW"},
+ { LLDP_MAU_TYPE_10GBASE_SW, "10GBASESW"},
+ { 0, NULL}
+};
+
+#define LLDP_8023_AUTONEGOTIATION_SUPPORT (1 << 0)
+#define LLDP_8023_AUTONEGOTIATION_STATUS (1 << 1)
+
+static const struct tok lldp_8023_autonegotiation_values[] = {
+ { LLDP_8023_AUTONEGOTIATION_SUPPORT, "supported"},
+ { LLDP_8023_AUTONEGOTIATION_STATUS, "enabled"},
+ { 0, NULL}
+};
+
+#define LLDP_TIA_CAPABILITY_MED (1 << 0)
+#define LLDP_TIA_CAPABILITY_NETWORK_POLICY (1 << 1)
+#define LLDP_TIA_CAPABILITY_LOCATION_IDENTIFICATION (1 << 2)
+#define LLDP_TIA_CAPABILITY_EXTENDED_POWER_MDI_PSE (1 << 3)
+#define LLDP_TIA_CAPABILITY_EXTENDED_POWER_MDI_PD (1 << 4)
+#define LLDP_TIA_CAPABILITY_INVENTORY (1 << 5)
+
+static const struct tok lldp_tia_capabilities_values[] = {
+ { LLDP_TIA_CAPABILITY_MED, "LLDP-MED capabilities"},
+ { LLDP_TIA_CAPABILITY_NETWORK_POLICY, "network policy"},
+ { LLDP_TIA_CAPABILITY_LOCATION_IDENTIFICATION, "location identification"},
+ { LLDP_TIA_CAPABILITY_EXTENDED_POWER_MDI_PSE, "extended power via MDI-PSE"},
+ { LLDP_TIA_CAPABILITY_EXTENDED_POWER_MDI_PD, "extended power via MDI-PD"},
+ { LLDP_TIA_CAPABILITY_INVENTORY, "Inventory"},
+ { 0, NULL}
+};
+
+#define LLDP_TIA_DEVICE_TYPE_ENDPOINT_CLASS_1 1
+#define LLDP_TIA_DEVICE_TYPE_ENDPOINT_CLASS_2 2
+#define LLDP_TIA_DEVICE_TYPE_ENDPOINT_CLASS_3 3
+#define LLDP_TIA_DEVICE_TYPE_NETWORK_CONNECTIVITY 4
+
+static const struct tok lldp_tia_device_type_values[] = {
+ { LLDP_TIA_DEVICE_TYPE_ENDPOINT_CLASS_1, "endpoint class 1"},
+ { LLDP_TIA_DEVICE_TYPE_ENDPOINT_CLASS_2, "endpoint class 2"},
+ { LLDP_TIA_DEVICE_TYPE_ENDPOINT_CLASS_3, "endpoint class 3"},
+ { LLDP_TIA_DEVICE_TYPE_NETWORK_CONNECTIVITY, "network connectivity"},
+ { 0, NULL}
+};
+
+#define LLDP_TIA_APPLICATION_TYPE_VOICE 1
+#define LLDP_TIA_APPLICATION_TYPE_VOICE_SIGNALING 2
+#define LLDP_TIA_APPLICATION_TYPE_GUEST_VOICE 3
+#define LLDP_TIA_APPLICATION_TYPE_GUEST_VOICE_SIGNALING 4
+#define LLDP_TIA_APPLICATION_TYPE_SOFTPHONE_VOICE 5
+#define LLDP_TIA_APPLICATION_TYPE_VIDEO_CONFERENCING 6
+#define LLDP_TIA_APPLICATION_TYPE_STREAMING_VIDEO 7
+#define LLDP_TIA_APPLICATION_TYPE_VIDEO_SIGNALING 8
+
+static const struct tok lldp_tia_application_type_values[] = {
+ { LLDP_TIA_APPLICATION_TYPE_VOICE, "voice"},
+ { LLDP_TIA_APPLICATION_TYPE_VOICE_SIGNALING, "voice signaling"},
+ { LLDP_TIA_APPLICATION_TYPE_GUEST_VOICE, "guest voice"},
+ { LLDP_TIA_APPLICATION_TYPE_GUEST_VOICE_SIGNALING, "guest voice signaling"},
+ { LLDP_TIA_APPLICATION_TYPE_SOFTPHONE_VOICE, "softphone voice"},
+ { LLDP_TIA_APPLICATION_TYPE_VIDEO_CONFERENCING, "video conferencing"},
+ { LLDP_TIA_APPLICATION_TYPE_STREAMING_VIDEO, "streaming video"},
+ { LLDP_TIA_APPLICATION_TYPE_VIDEO_SIGNALING, "video signaling"},
+ { 0, NULL}
+};
+
+#define LLDP_TIA_NETWORK_POLICY_X_BIT (1 << 5)
+#define LLDP_TIA_NETWORK_POLICY_T_BIT (1 << 6)
+#define LLDP_TIA_NETWORK_POLICY_U_BIT (1 << 7)
+
+static const struct tok lldp_tia_network_policy_bits_values[] = {
+ { LLDP_TIA_NETWORK_POLICY_U_BIT, "Unknown"},
+ { LLDP_TIA_NETWORK_POLICY_T_BIT, "Tagged"},
+ { LLDP_TIA_NETWORK_POLICY_X_BIT, "reserved"},
+ { 0, NULL}
+};
+
+#define LLDP_EXTRACT_NETWORK_POLICY_VLAN(x) (((x)&0x1ffe)>>1)
+#define LLDP_EXTRACT_NETWORK_POLICY_L2_PRIORITY(x) (((x)&0x01ff)>>6)
+#define LLDP_EXTRACT_NETWORK_POLICY_DSCP(x) ((x)&0x003f)
+
+#define LLDP_TIA_LOCATION_DATA_FORMAT_COORDINATE_BASED 1
+#define LLDP_TIA_LOCATION_DATA_FORMAT_CIVIC_ADDRESS 2
+#define LLDP_TIA_LOCATION_DATA_FORMAT_ECS_ELIN 3
+
+static const struct tok lldp_tia_location_data_format_values[] = {
+ { LLDP_TIA_LOCATION_DATA_FORMAT_COORDINATE_BASED, "coordinate-based LCI"},
+ { LLDP_TIA_LOCATION_DATA_FORMAT_CIVIC_ADDRESS, "civic address LCI"},
+ { LLDP_TIA_LOCATION_DATA_FORMAT_ECS_ELIN, "ECS ELIN"},
+ { 0, NULL}
+};
+
+#define LLDP_TIA_LOCATION_DATUM_WGS_84 1
+#define LLDP_TIA_LOCATION_DATUM_NAD_83_NAVD_88 2
+#define LLDP_TIA_LOCATION_DATUM_NAD_83_MLLW 3
+
+static const struct tok lldp_tia_location_datum_type_values[] = {
+ { LLDP_TIA_LOCATION_DATUM_WGS_84, "World Geodesic System 1984"},
+ { LLDP_TIA_LOCATION_DATUM_NAD_83_NAVD_88, "North American Datum 1983 (NAVD88)"},
+ { LLDP_TIA_LOCATION_DATUM_NAD_83_MLLW, "North American Datum 1983 (MLLW)"},
+ { 0, NULL}
+};
+
+#define LLDP_TIA_POWER_SOURCE_PSE 1
+#define LLDP_TIA_POWER_SOURCE_LOCAL 2
+#define LLDP_TIA_POWER_SOURCE_PSE_AND_LOCAL 3
+
+static const struct tok lldp_tia_power_source_values[] = {
+ { LLDP_TIA_POWER_SOURCE_PSE, "PSE - primary power source"},
+ { LLDP_TIA_POWER_SOURCE_LOCAL, "local - backup power source"},
+ { LLDP_TIA_POWER_SOURCE_PSE_AND_LOCAL, "PSE+local - reserved"},
+ { 0, NULL}
+};
+
+#define LLDP_TIA_POWER_PRIORITY_CRITICAL 1
+#define LLDP_TIA_POWER_PRIORITY_HIGH 2
+#define LLDP_TIA_POWER_PRIORITY_LOW 3
+
+static const struct tok lldp_tia_power_priority_values[] = {
+ { LLDP_TIA_POWER_PRIORITY_CRITICAL, "critical"},
+ { LLDP_TIA_POWER_PRIORITY_HIGH, "high"},
+ { LLDP_TIA_POWER_PRIORITY_LOW, "low"},
+ { 0, NULL}
+};
+
+#define LLDP_TIA_POWER_VAL_MAX 1024
+
+static const struct tok lldp_tia_inventory_values[] = {
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_HARDWARE_REV, "Hardware revision" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_FIRMWARE_REV, "Firmware revision" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SOFTWARE_REV, "Software revision" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SERIAL_NUMBER, "Serial number" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MANUFACTURER_NAME, "Manufacturer name" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MODEL_NAME, "Model name" },
+ { LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_ASSET_ID, "Asset ID" },
+ { 0, NULL}
+};
+
+/*
+ * From RFC 3636 - ifMauAutoNegCapAdvertisedBits
+ */
+#define LLDP_MAU_PMD_OTHER (1 << 15)
+#define LLDP_MAU_PMD_10BASE_T (1 << 14)
+#define LLDP_MAU_PMD_10BASE_T_FD (1 << 13)
+#define LLDP_MAU_PMD_100BASE_T4 (1 << 12)
+#define LLDP_MAU_PMD_100BASE_TX (1 << 11)
+#define LLDP_MAU_PMD_100BASE_TX_FD (1 << 10)
+#define LLDP_MAU_PMD_100BASE_T2 (1 << 9)
+#define LLDP_MAU_PMD_100BASE_T2_FD (1 << 8)
+#define LLDP_MAU_PMD_FDXPAUSE (1 << 7)
+#define LLDP_MAU_PMD_FDXAPAUSE (1 << 6)
+#define LLDP_MAU_PMD_FDXSPAUSE (1 << 5)
+#define LLDP_MAU_PMD_FDXBPAUSE (1 << 4)
+#define LLDP_MAU_PMD_1000BASE_X (1 << 3)
+#define LLDP_MAU_PMD_1000BASE_X_FD (1 << 2)
+#define LLDP_MAU_PMD_1000BASE_T (1 << 1)
+#define LLDP_MAU_PMD_1000BASE_T_FD (1 << 0)
+
+static const struct tok lldp_pmd_capability_values[] = {
+ { LLDP_MAU_PMD_10BASE_T, "10BASE-T hdx"},
+ { LLDP_MAU_PMD_10BASE_T_FD, "10BASE-T fdx"},
+ { LLDP_MAU_PMD_100BASE_T4, "100BASE-T4"},
+ { LLDP_MAU_PMD_100BASE_TX, "100BASE-TX hdx"},
+ { LLDP_MAU_PMD_100BASE_TX_FD, "100BASE-TX fdx"},
+ { LLDP_MAU_PMD_100BASE_T2, "100BASE-T2 hdx"},
+ { LLDP_MAU_PMD_100BASE_T2_FD, "100BASE-T2 fdx"},
+ { LLDP_MAU_PMD_FDXPAUSE, "Pause for fdx links"},
+ { LLDP_MAU_PMD_FDXAPAUSE, "Asym PAUSE for fdx"},
+ { LLDP_MAU_PMD_FDXSPAUSE, "Sym PAUSE for fdx"},
+ { LLDP_MAU_PMD_FDXBPAUSE, "Asym and Sym PAUSE for fdx"},
+ { LLDP_MAU_PMD_1000BASE_X, "1000BASE-{X LX SX CX} hdx"},
+ { LLDP_MAU_PMD_1000BASE_X_FD, "1000BASE-{X LX SX CX} fdx"},
+ { LLDP_MAU_PMD_1000BASE_T, "1000BASE-T hdx"},
+ { LLDP_MAU_PMD_1000BASE_T_FD, "1000BASE-T fdx"},
+ { 0, NULL}
+};
+
+#define LLDP_MDI_PORT_CLASS (1 << 0)
+#define LLDP_MDI_POWER_SUPPORT (1 << 1)
+#define LLDP_MDI_POWER_STATE (1 << 2)
+#define LLDP_MDI_PAIR_CONTROL_ABILITY (1 << 3)
+
+static const struct tok lldp_mdi_values[] = {
+ { LLDP_MDI_PORT_CLASS, "PSE"},
+ { LLDP_MDI_POWER_SUPPORT, "supported"},
+ { LLDP_MDI_POWER_STATE, "enabled"},
+ { LLDP_MDI_PAIR_CONTROL_ABILITY, "can be controlled"},
+ { 0, NULL}
+};
+
+#define LLDP_MDI_PSE_PORT_POWER_PAIRS_SIGNAL 1
+#define LLDP_MDI_PSE_PORT_POWER_PAIRS_SPARE 2
+
+static const struct tok lldp_mdi_power_pairs_values[] = {
+ { LLDP_MDI_PSE_PORT_POWER_PAIRS_SIGNAL, "signal"},
+ { LLDP_MDI_PSE_PORT_POWER_PAIRS_SPARE, "spare"},
+ { 0, NULL}
+};
+
+#define LLDP_MDI_POWER_CLASS0 1
+#define LLDP_MDI_POWER_CLASS1 2
+#define LLDP_MDI_POWER_CLASS2 3
+#define LLDP_MDI_POWER_CLASS3 4
+#define LLDP_MDI_POWER_CLASS4 5
+
+static const struct tok lldp_mdi_power_class_values[] = {
+ { LLDP_MDI_POWER_CLASS0, "class0"},
+ { LLDP_MDI_POWER_CLASS1, "class1"},
+ { LLDP_MDI_POWER_CLASS2, "class2"},
+ { LLDP_MDI_POWER_CLASS3, "class3"},
+ { LLDP_MDI_POWER_CLASS4, "class4"},
+ { 0, NULL}
+};
+
+#define LLDP_AGGREGATION_CAPABILTIY (1 << 0)
+#define LLDP_AGGREGATION_STATUS (1 << 1)
+
+static const struct tok lldp_aggregation_values[] = {
+ { LLDP_AGGREGATION_CAPABILTIY, "supported"},
+ { LLDP_AGGREGATION_STATUS, "enabled"},
+ { 0, NULL}
+};
+
+/*
+ * DCBX protocol subtypes.
+ */
+#define LLDP_DCBX_SUBTYPE_1 1
+#define LLDP_DCBX_SUBTYPE_2 2
+
+static const struct tok lldp_dcbx_subtype_values[] = {
+ { LLDP_DCBX_SUBTYPE_1, "DCB Capability Exchange Protocol Rev 1" },
+ { LLDP_DCBX_SUBTYPE_2, "DCB Capability Exchange Protocol Rev 1.01" },
+ { 0, NULL}
+};
+
+#define LLDP_DCBX_CONTROL_TLV 1
+#define LLDP_DCBX_PRIORITY_GROUPS_TLV 2
+#define LLDP_DCBX_PRIORITY_FLOW_CONTROL_TLV 3
+#define LLDP_DCBX_APPLICATION_TLV 4
+
+/*
+ * Interface numbering subtypes.
+ */
+#define LLDP_INTF_NUMB_IFX_SUBTYPE 2
+#define LLDP_INTF_NUMB_SYSPORT_SUBTYPE 3
+
+static const struct tok lldp_intf_numb_subtype_values[] = {
+ { LLDP_INTF_NUMB_IFX_SUBTYPE, "Interface Index" },
+ { LLDP_INTF_NUMB_SYSPORT_SUBTYPE, "System Port Number" },
+ { 0, NULL}
+};
+
+#define LLDP_INTF_NUM_LEN 5
+
+/*
+ * Print IEEE 802.1 private extensions. (802.1AB annex E)
+ */
+static int
+lldp_private_8021_print(const u_char *tptr, u_int tlv_len)
+{
+ int subtype, hexdump = FALSE;
+ u_int sublen;
+
+ if (tlv_len < 4) {
+ return hexdump;
+ }
+ subtype = *(tptr+3);
+
+ printf("\n\t %s Subtype (%u)",
+ tok2str(lldp_8021_subtype_values, "unknown", subtype),
+ subtype);
+
+ switch (subtype) {
+ case LLDP_PRIVATE_8021_SUBTYPE_PORT_VLAN_ID:
+ if (tlv_len < 6) {
+ return hexdump;
+ }
+ printf("\n\t port vlan id (PVID): %u",
+ EXTRACT_16BITS(tptr+4));
+ break;
+ case LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_VLAN_ID:
+ if (tlv_len < 7) {
+ return hexdump;
+ }
+ printf("\n\t port and protocol vlan id (PPVID): %u, flags [%s] (0x%02x)",
+ EXTRACT_16BITS(tptr+5),
+ bittok2str(lldp_8021_port_protocol_id_values, "none", *(tptr+4)),
+ *(tptr+4));
+ break;
+ case LLDP_PRIVATE_8021_SUBTYPE_VLAN_NAME:
+ if (tlv_len < 6) {
+ return hexdump;
+ }
+ printf("\n\t vlan id (VID): %u",
+ EXTRACT_16BITS(tptr+4));
+ if (tlv_len < 7) {
+ return hexdump;
+ }
+ sublen = *(tptr+6);
+ if (tlv_len < 7+sublen) {
+ return hexdump;
+ }
+ printf("\n\t vlan name: ");
+ safeputs((const char *)tptr+7, sublen);
+ break;
+ case LLDP_PRIVATE_8021_SUBTYPE_PROTOCOL_IDENTITY:
+ if (tlv_len < 5) {
+ return hexdump;
+ }
+ sublen = *(tptr+4);
+ if (tlv_len < 5+sublen) {
+ return hexdump;
+ }
+ printf("\n\t protocol identity: ");
+ safeputs((const char *)tptr+5, sublen);
+ break;
+
+ default:
+ hexdump = TRUE;
+ break;
+ }
+
+ return hexdump;
+}
+
+/*
+ * Print IEEE 802.3 private extensions. (802.3bc)
+ */
+static int
+lldp_private_8023_print(const u_char *tptr, u_int tlv_len)
+{
+ int subtype, hexdump = FALSE;
+
+ if (tlv_len < 4) {
+ return hexdump;
+ }
+ subtype = *(tptr+3);
+
+ printf("\n\t %s Subtype (%u)",
+ tok2str(lldp_8023_subtype_values, "unknown", subtype),
+ subtype);
+
+ switch (subtype) {
+ case LLDP_PRIVATE_8023_SUBTYPE_MACPHY:
+ if (tlv_len < 9) {
+ return hexdump;
+ }
+ printf("\n\t autonegotiation [%s] (0x%02x)",
+ bittok2str(lldp_8023_autonegotiation_values, "none", *(tptr+4)),
+ *(tptr+4));
+ printf("\n\t PMD autoneg capability [%s] (0x%04x)",
+ bittok2str(lldp_pmd_capability_values,"unknown", EXTRACT_16BITS(tptr+5)),
+ EXTRACT_16BITS(tptr+5));
+ printf("\n\t MAU type %s (0x%04x)",
+ tok2str(lldp_mau_types_values, "unknown", EXTRACT_16BITS(tptr+7)),
+ EXTRACT_16BITS(tptr+7));
+ break;
+
+ case LLDP_PRIVATE_8023_SUBTYPE_MDIPOWER:
+ if (tlv_len < 7) {
+ return hexdump;
+ }
+ printf("\n\t MDI power support [%s], power pair %s, power class %s",
+ bittok2str(lldp_mdi_values, "none", *(tptr+4)),
+ tok2str(lldp_mdi_power_pairs_values, "unknown", *(tptr+5)),
+ tok2str(lldp_mdi_power_class_values, "unknown", *(tptr+6)));
+ break;
+
+ case LLDP_PRIVATE_8023_SUBTYPE_LINKAGGR:
+ if (tlv_len < 9) {
+ return hexdump;
+ }
+ printf("\n\t aggregation status [%s], aggregation port ID %u",
+ bittok2str(lldp_aggregation_values, "none", *(tptr+4)),
+ EXTRACT_32BITS(tptr+5));
+ break;
+
+ case LLDP_PRIVATE_8023_SUBTYPE_MTU:
+ printf("\n\t MTU size %u", EXTRACT_16BITS(tptr+4));
+ break;
+
+ default:
+ hexdump = TRUE;
+ break;
+ }
+
+ return hexdump;
+}
+
+/*
+ * Extract 34bits of latitude/longitude coordinates.
+ */
+static u_int64_t
+lldp_extract_latlon(const u_char *tptr)
+{
+ u_int64_t latlon;
+
+ latlon = *tptr & 0x3;
+ latlon = (latlon << 32) | EXTRACT_32BITS(tptr+1);
+
+ return latlon;
+}
+
+/*
+ * Print private TIA extensions.
+ */
+static int
+lldp_private_tia_print(const u_char *tptr, u_int tlv_len)
+{
+ int subtype, hexdump = FALSE;
+ u_int8_t location_format;
+ u_int16_t power_val;
+ u_int lci_len;
+ u_int8_t ca_type, ca_len;
+
+ if (tlv_len < 4) {
+ return hexdump;
+ }
+ subtype = *(tptr+3);
+
+ printf("\n\t %s Subtype (%u)",
+ tok2str(lldp_tia_subtype_values, "unknown", subtype),
+ subtype);
+
+ switch (subtype) {
+ case LLDP_PRIVATE_TIA_SUBTYPE_CAPABILITIES:
+ if (tlv_len < 7) {
+ return hexdump;
+ }
+ printf("\n\t Media capabilities [%s] (0x%04x)",
+ bittok2str(lldp_tia_capabilities_values, "none",
+ EXTRACT_16BITS(tptr+4)), EXTRACT_16BITS(tptr+4));
+ printf("\n\t Device type [%s] (0x%02x)",
+ tok2str(lldp_tia_device_type_values, "unknown", *(tptr+6)),
+ *(tptr+6));
+ break;
+
+ case LLDP_PRIVATE_TIA_SUBTYPE_NETWORK_POLICY:
+ if (tlv_len < 8) {
+ return hexdump;
+ }
+ printf("\n\t Application type [%s] (0x%02x)",
+ tok2str(lldp_tia_application_type_values, "none", *(tptr+4)),
+ *(tptr+4));
+ printf(", Flags [%s]", bittok2str(
+ lldp_tia_network_policy_bits_values, "none", *(tptr+5)));
+ printf("\n\t Vlan id %u",
+ LLDP_EXTRACT_NETWORK_POLICY_VLAN(EXTRACT_16BITS(tptr+5)));
+ printf(", L2 priority %u",
+ LLDP_EXTRACT_NETWORK_POLICY_L2_PRIORITY(EXTRACT_16BITS(tptr+6)));
+ printf(", DSCP value %u",
+ LLDP_EXTRACT_NETWORK_POLICY_DSCP(EXTRACT_16BITS(tptr+6)));
+ break;
+
+ case LLDP_PRIVATE_TIA_SUBTYPE_LOCAL_ID:
+ if (tlv_len < 5) {
+ return hexdump;
+ }
+ location_format = *(tptr+4);
+ printf("\n\t Location data format %s (0x%02x)",
+ tok2str(lldp_tia_location_data_format_values, "unknown", location_format),
+ location_format);
+
+ switch (location_format) {
+ case LLDP_TIA_LOCATION_DATA_FORMAT_COORDINATE_BASED:
+ if (tlv_len < 21) {
+ return hexdump;
+ }
+ printf("\n\t Latitude resolution %u, latitude value %" PRIu64,
+ (*(tptr+5)>>2), lldp_extract_latlon(tptr+5));
+ printf("\n\t Longitude resolution %u, longitude value %" PRIu64,
+ (*(tptr+10)>>2), lldp_extract_latlon(tptr+10));
+ printf("\n\t Altitude type %s (%u)",
+ tok2str(lldp_tia_location_altitude_type_values, "unknown",(*(tptr+15)>>4)),
+ (*(tptr+15)>>4));
+ printf("\n\t Altitude resolution %u, altitude value 0x%x",
+ (EXTRACT_16BITS(tptr+15)>>6)&0x3f,
+ ((EXTRACT_32BITS(tptr+16)&0x3fffffff)));
+ printf("\n\t Datum %s (0x%02x)",
+ tok2str(lldp_tia_location_datum_type_values, "unknown", *(tptr+20)),
+ *(tptr+20));
+ break;
+
+ case LLDP_TIA_LOCATION_DATA_FORMAT_CIVIC_ADDRESS:
+ if (tlv_len < 6) {
+ return hexdump;
+ }
+ lci_len = *(tptr+5);
+ if (lci_len < 3) {
+ return hexdump;
+ }
+ if (tlv_len < 7+lci_len) {
+ return hexdump;
+ }
+ printf("\n\t LCI length %u, LCI what %s (0x%02x), Country-code ",
+ lci_len,
+ tok2str(lldp_tia_location_lci_what_values, "unknown", *(tptr+6)),
+ *(tptr+6));
+
+ /* Country code */
+ safeputs((const char *)(tptr+7), 2);
+
+ lci_len = lci_len-3;
+ tptr = tptr + 9;
+
+ /* Decode each civic address element */
+ while (lci_len > 0) {
+ if (lci_len < 2) {
+ return hexdump;
+ }
+ ca_type = *(tptr);
+ ca_len = *(tptr+1);
+
+ tptr += 2;
+ lci_len -= 2;
+
+ printf("\n\t CA type \'%s\' (%u), length %u: ",
+ tok2str(lldp_tia_location_lci_catype_values, "unknown", ca_type),
+ ca_type, ca_len);
+
+ /* basic sanity check */
+ if ( ca_type == 0 || ca_len == 0) {
+ return hexdump;
+ }
+ if (lci_len < ca_len) {
+ return hexdump;
+ }
+
+ safeputs((const char *)tptr, ca_len);
+ tptr += ca_len;
+ lci_len -= ca_len;
+ }
+ break;
+
+ case LLDP_TIA_LOCATION_DATA_FORMAT_ECS_ELIN:
+ printf("\n\t ECS ELIN id ");
+ safeputs((const char *)tptr+5, tlv_len-5);
+ break;
+
+ default:
+ printf("\n\t Location ID ");
+ print_unknown_data(tptr+5, "\n\t ", tlv_len-5);
+ }
+ break;
+
+ case LLDP_PRIVATE_TIA_SUBTYPE_EXTENDED_POWER_MDI:
+ if (tlv_len < 7) {
+ return hexdump;
+ }
+ printf("\n\t Power type [%s]",
+ (*(tptr+4)&0xC0>>6) ? "PD device" : "PSE device");
+ printf(", Power source [%s]",
+ tok2str(lldp_tia_power_source_values, "none", (*(tptr+4)&0x30)>>4));
+ printf("\n\t Power priority [%s] (0x%02x)",
+ tok2str(lldp_tia_power_priority_values, "none", *(tptr+4)&0x0f),
+ *(tptr+4)&0x0f);
+ power_val = EXTRACT_16BITS(tptr+5);
+ if (power_val < LLDP_TIA_POWER_VAL_MAX) {
+ printf(", Power %.1f Watts", ((float)power_val)/10);
+ } else {
+ printf(", Power %u (Reserved)", power_val);
+ }
+ break;
+
+ case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_HARDWARE_REV:
+ case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_FIRMWARE_REV:
+ case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SOFTWARE_REV:
+ case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_SERIAL_NUMBER:
+ case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MANUFACTURER_NAME:
+ case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_MODEL_NAME:
+ case LLDP_PRIVATE_TIA_SUBTYPE_INVENTORY_ASSET_ID:
+ printf("\n\t %s ",
+ tok2str(lldp_tia_inventory_values, "unknown", subtype));
+ safeputs((const char *)tptr+4, tlv_len-4);
+ break;
+
+ default:
+ hexdump = TRUE;
+ break;
+ }
+
+ return hexdump;
+}
+
+/*
+ * Print DCBX Protocol fields (V 1.01).
+ */
+static int
+lldp_private_dcbx_print(const u_char *pptr, u_int len)
+{
+ int subtype, hexdump = FALSE;
+ u_int8_t tval;
+ u_int16_t tlv;
+ u_int32_t i, pgval, uval;
+ u_int tlen, tlv_type, tlv_len;
+ const u_char *tptr, *mptr;
+
+ if (len < 4) {
+ return hexdump;
+ }
+ subtype = *(pptr+3);
+
+ printf("\n\t %s Subtype (%u)",
+ tok2str(lldp_dcbx_subtype_values, "unknown", subtype),
+ subtype);
+
+ /* by passing old version */
+ if (subtype == LLDP_DCBX_SUBTYPE_1)
+ return TRUE;
+
+ tptr = pptr + 4;
+ tlen = len - 4;
+
+ while (tlen >= sizeof(tlv)) {
+
+ TCHECK2(*tptr, sizeof(tlv));
+
+ tlv = EXTRACT_16BITS(tptr);
+
+ tlv_type = LLDP_EXTRACT_TYPE(tlv);
+ tlv_len = LLDP_EXTRACT_LEN(tlv);
+ hexdump = FALSE;
+
+ tlen -= sizeof(tlv);
+ tptr += sizeof(tlv);
+
+ /* loop check */
+ if (!tlv_type || !tlv_len) {
+ break;
+ }
+
+ TCHECK2(*tptr, tlv_len);
+ if (tlen < tlv_len) {
+ goto trunc;
+ }
+
+ /* decode every tlv */
+ switch (tlv_type) {
+ case LLDP_DCBX_CONTROL_TLV:
+ if (tlv_len < 10) {
+ goto trunc;
+ }
+ printf("\n\t Control - Protocol Control (type 0x%x, length %d)",
+ LLDP_DCBX_CONTROL_TLV, tlv_len);
+ printf("\n\t Oper_Version: %d", *tptr);
+ printf("\n\t Max_Version: %d", *(tptr+1));
+ printf("\n\t Sequence Number: %d", EXTRACT_32BITS(tptr+2));
+ printf("\n\t Acknowledgement Number: %d",
+ EXTRACT_32BITS(tptr+6));
+ break;
+ case LLDP_DCBX_PRIORITY_GROUPS_TLV:
+ if (tlv_len < 17) {
+ goto trunc;
+ }
+ printf("\n\t Feature - Priority Group (type 0x%x, length %d)",
+ LLDP_DCBX_PRIORITY_GROUPS_TLV, tlv_len);
+ printf("\n\t Oper_Version: %d", *tptr);
+ printf("\n\t Max_Version: %d", *(tptr+1));
+ printf("\n\t Info block(0x%02X): ", *(tptr+2));
+ tval = *(tptr+2);
+ printf("Enable bit: %d, Willing bit: %d, Error Bit: %d",
+ (tval & 0x80) ? 1 : 0, (tval & 0x40) ? 1 : 0,
+ (tval & 0x20) ? 1 : 0);
+ printf("\n\t SubType: %d", *(tptr+3));
+ printf("\n\t Priority Allocation");
+
+ pgval = EXTRACT_32BITS(tptr+4);
+ for (i = 0; i <= 7; i++) {
+ tval = *(tptr+4+(i/2));
+ printf("\n\t PgId_%d: %d",
+ i, (pgval >> (28-4*i)) & 0xF);
+ }
+ printf("\n\t Priority Group Allocation");
+ for (i = 0; i <= 7; i++)
+ printf("\n\t Pg percentage[%d]: %d", i, *(tptr+8+i));
+ printf("\n\t NumTCsSupported: %d", *(tptr+8+8));
+ break;
+ case LLDP_DCBX_PRIORITY_FLOW_CONTROL_TLV:
+ if (tlv_len < 6) {
+ goto trunc;
+ }
+ printf("\n\t Feature - Priority Flow Control");
+ printf(" (type 0x%x, length %d)",
+ LLDP_DCBX_PRIORITY_FLOW_CONTROL_TLV, tlv_len);
+ printf("\n\t Oper_Version: %d", *tptr);
+ printf("\n\t Max_Version: %d", *(tptr+1));
+ printf("\n\t Info block(0x%02X): ", *(tptr+2));
+ tval = *(tptr+2);
+ printf("Enable bit: %d, Willing bit: %d, Error Bit: %d",
+ (tval & 0x80) ? 1 : 0, (tval & 0x40) ? 1 : 0,
+ (tval & 0x20) ? 1 : 0);
+ printf("\n\t SubType: %d", *(tptr+3));
+ tval = *(tptr+4);
+ printf("\n\t PFC Config (0x%02X)", *(tptr+4));
+ for (i = 0; i <= 7; i++)
+ printf("\n\t Priority Bit %d: %s",
+ i, (tval & (1 << i)) ? "Enabled" : "Disabled");
+ printf("\n\t NumTCPFCSupported: %d", *(tptr+5));
+ break;
+ case LLDP_DCBX_APPLICATION_TLV:
+ if (tlv_len < 4) {
+ goto trunc;
+ }
+ printf("\n\t Feature - Application (type 0x%x, length %d)",
+ LLDP_DCBX_APPLICATION_TLV, tlv_len);
+ printf("\n\t Oper_Version: %d", *tptr);
+ printf("\n\t Max_Version: %d", *(tptr+1));
+ printf("\n\t Info block(0x%02X): ", *(tptr+2));
+ tval = *(tptr+2);
+ printf("Enable bit: %d, Willing bit: %d, Error Bit: %d",
+ (tval & 0x80) ? 1 : 0, (tval & 0x40) ? 1 : 0,
+ (tval & 0x20) ? 1 : 0);
+ printf("\n\t SubType: %d", *(tptr+3));
+ tval = tlv_len - 4;
+ mptr = tptr + 4;
+ while (tval >= 6) {
+ printf("\n\t Application Value");
+ printf("\n\t Application Protocol ID: 0x%04x",
+ EXTRACT_16BITS(mptr));
+ uval = EXTRACT_24BITS(mptr+2);
+ printf("\n\t SF (0x%x) Application Protocol ID is %s",
+ (uval >> 22),
+ (uval >> 22) ? "Socket Number" : "L2 EtherType");
+ printf("\n\t OUI: 0x%06x", uval & 0x3fffff);
+ printf("\n\t User Priority Map: 0x%02x", *(mptr+5));
+ tval = tval - 6;
+ mptr = mptr + 6;
+ }
+ break;
+ default:
+ hexdump = TRUE;
+ break;
+ }
+
+ /* do we also want to see a hex dump ? */
+ if (vflag > 1 || (vflag && hexdump)) {
+ print_unknown_data(tptr,"\n\t ", tlv_len);
+ }
+
+ tlen -= tlv_len;
+ tptr += tlv_len;
+ }
+
+ trunc:
+ return hexdump;
+}
+
+static char *
+lldp_network_addr_print(const u_char *tptr, u_int len) {
+
+ u_int8_t af;
+ static char buf[BUFSIZE];
+ const char * (*pfunc)(const u_char *);
+
+ if (len < 1)
+ return NULL;
+ len--;
+ af = *tptr;
+ switch (af) {
+ case AFNUM_INET:
+ if (len < 4)
+ return NULL;
+ pfunc = getname;
+ break;
+#ifdef INET6
+ case AFNUM_INET6:
+ if (len < 16)
+ return NULL;
+ pfunc = getname6;
+ break;
+#endif
+ case AFNUM_802:
+ if (len < 6)
+ return NULL;
+ pfunc = etheraddr_string;
+ break;
+ default:
+ pfunc = NULL;
+ break;
+ }
+
+ if (!pfunc) {
+ snprintf(buf, sizeof(buf), "AFI %s (%u), no AF printer !",
+ tok2str(af_values, "Unknown", af), af);
+ } else {
+ snprintf(buf, sizeof(buf), "AFI %s (%u): %s",
+ tok2str(af_values, "Unknown", af), af, (*pfunc)(tptr+1));
+ }
+
+ return buf;
+}
+
+static int
+lldp_mgmt_addr_tlv_print(const u_char *pptr, u_int len) {
+
+ u_int8_t mgmt_addr_len, intf_num_subtype, oid_len;
+ const u_char *tptr;
+ u_int tlen;
+ char *mgmt_addr;
+
+ tlen = len;
+ tptr = pptr;
+
+ if (tlen < 1) {
+ return 0;
+ }
+ mgmt_addr_len = *tptr++;
+ tlen--;
+
+ if (tlen < mgmt_addr_len) {
+ return 0;
+ }
+
+ mgmt_addr = lldp_network_addr_print(tptr, mgmt_addr_len);
+ if (mgmt_addr == NULL) {
+ return 0;
+ }
+ printf("\n\t Management Address length %u, %s",
+ mgmt_addr_len, mgmt_addr);
+ tptr += mgmt_addr_len;
+ tlen -= mgmt_addr_len;
+
+ if (tlen < LLDP_INTF_NUM_LEN) {
+ return 0;
+ }
+
+ intf_num_subtype = *tptr;
+ printf("\n\t %s Interface Numbering (%u): %u",
+ tok2str(lldp_intf_numb_subtype_values, "Unknown", intf_num_subtype),
+ intf_num_subtype,
+ EXTRACT_32BITS(tptr+1));
+
+ tptr += LLDP_INTF_NUM_LEN;
+ tlen -= LLDP_INTF_NUM_LEN;
+
+ /*
+ * The OID is optional.
+ */
+ if (tlen) {
+ oid_len = *tptr;
+
+ if (tlen < oid_len) {
+ return 0;
+ }
+ if (oid_len) {
+ printf("\n\t OID length %u", oid_len);
+ safeputs((const char *)tptr+1, oid_len);
+ }
+ }
+
+ return 1;
+}
+
+void
+lldp_print(register const u_char *pptr, register u_int len) {
+
+ u_int8_t subtype;
+ u_int16_t tlv, cap, ena_cap;
+ u_int oui, tlen, hexdump, tlv_type, tlv_len;
+ const u_char *tptr;
+ char *network_addr;
+
+ tptr = pptr;
+ tlen = len;
+
+ printf("LLDP, length %u", len);
+
+ while (tlen >= sizeof(tlv)) {
+
+ TCHECK2(*tptr, sizeof(tlv));
+
+ tlv = EXTRACT_16BITS(tptr);
+
+ tlv_type = LLDP_EXTRACT_TYPE(tlv);
+ tlv_len = LLDP_EXTRACT_LEN(tlv);
+ hexdump = FALSE;
+
+ tlen -= sizeof(tlv);
+ tptr += sizeof(tlv);
+
+ if (vflag) {
+ printf("\n\t%s TLV (%u), length %u",
+ tok2str(lldp_tlv_values, "Unknown", tlv_type),
+ tlv_type, tlv_len);
+ }
+
+ /* infinite loop check */
+ if (!tlv_type || !tlv_len) {
+ break;
+ }
+
+ TCHECK2(*tptr, tlv_len);
+ if (tlen < tlv_len) {
+ goto trunc;
+ }
+
+ switch (tlv_type) {
+
+ case LLDP_CHASSIS_ID_TLV:
+ if (vflag) {
+ if (tlv_len < 2) {
+ goto trunc;
+ }
+ subtype = *tptr;
+ printf("\n\t Subtype %s (%u): ",
+ tok2str(lldp_chassis_subtype_values, "Unknown", subtype),
+ subtype);
+
+ switch (subtype) {
+ case LLDP_CHASSIS_MAC_ADDR_SUBTYPE:
+ if (tlv_len < 1+6) {
+ goto trunc;
+ }
+ printf("%s", etheraddr_string(tptr+1));
+ break;
+
+ case LLDP_CHASSIS_INTF_NAME_SUBTYPE: /* fall through */
+ case LLDP_CHASSIS_LOCAL_SUBTYPE:
+ case LLDP_CHASSIS_CHASSIS_COMP_SUBTYPE:
+ case LLDP_CHASSIS_INTF_ALIAS_SUBTYPE:
+ case LLDP_CHASSIS_PORT_COMP_SUBTYPE:
+ safeputs((const char *)tptr+1, tlv_len-1);
+ break;
+
+ case LLDP_CHASSIS_NETWORK_ADDR_SUBTYPE:
+ network_addr = lldp_network_addr_print(tptr+1, tlv_len-1);
+ if (network_addr == NULL) {
+ goto trunc;
+ }
+ printf("%s", network_addr);
+ break;
+
+ default:
+ hexdump = TRUE;
+ break;
+ }
+ }
+ break;
+
+ case LLDP_PORT_ID_TLV:
+ if (vflag) {
+ if (tlv_len < 2) {
+ goto trunc;
+ }
+ subtype = *tptr;
+ printf("\n\t Subtype %s (%u): ",
+ tok2str(lldp_port_subtype_values, "Unknown", subtype),
+ subtype);
+
+ switch (subtype) {
+ case LLDP_PORT_MAC_ADDR_SUBTYPE:
+ if (tlv_len < 1+6) {
+ goto trunc;
+ }
+ printf("%s", etheraddr_string(tptr+1));
+ break;
+
+ case LLDP_PORT_INTF_NAME_SUBTYPE: /* fall through */
+ case LLDP_PORT_LOCAL_SUBTYPE:
+ case LLDP_PORT_AGENT_CIRC_ID_SUBTYPE:
+ case LLDP_PORT_INTF_ALIAS_SUBTYPE:
+ case LLDP_PORT_PORT_COMP_SUBTYPE:
+ safeputs((const char *)tptr+1, tlv_len-1);
+ break;
+
+ case LLDP_PORT_NETWORK_ADDR_SUBTYPE:
+ network_addr = lldp_network_addr_print(tptr+1, tlv_len-1);
+ if (network_addr == NULL) {
+ goto trunc;
+ }
+ printf("%s", network_addr);
+ break;
+
+ default:
+ hexdump = TRUE;
+ break;
+ }
+ }
+ break;
+
+ case LLDP_TTL_TLV:
+ if (vflag) {
+ if (tlv_len < 2) {
+ goto trunc;
+ }
+ printf(": TTL %us", EXTRACT_16BITS(tptr));
+ }
+ break;
+
+ case LLDP_PORT_DESCR_TLV:
+ if (vflag) {
+ printf(": ");
+ safeputs((const char *)tptr, tlv_len);
+ }
+ break;
+
+ case LLDP_SYSTEM_NAME_TLV:
+ /*
+ * The system name is also print in non-verbose mode
+ * similar to the CDP printer.
+ */
+ printf(": ");
+ safeputs((const char *)tptr, tlv_len);
+ break;
+
+ case LLDP_SYSTEM_DESCR_TLV:
+ if (vflag) {
+ printf("\n\t ");
+ safeputs((const char *)tptr, tlv_len);
+ }
+ break;
+
+ case LLDP_SYSTEM_CAP_TLV:
+ if (vflag) {
+ /*
+ * XXX - IEEE Std 802.1AB-2009 says the first octet
+ * if a chassis ID subtype, with the system
+ * capabilities and enabled capabilities following
+ * it.
+ */
+ if (tlv_len < 4) {
+ goto trunc;
+ }
+ cap = EXTRACT_16BITS(tptr);
+ ena_cap = EXTRACT_16BITS(tptr+2);
+ printf("\n\t System Capabilities [%s] (0x%04x)",
+ bittok2str(lldp_cap_values, "none", cap), cap);
+ printf("\n\t Enabled Capabilities [%s] (0x%04x)",
+ bittok2str(lldp_cap_values, "none", ena_cap), ena_cap);
+ }
+ break;
+
+ case LLDP_MGMT_ADDR_TLV:
+ if (vflag) {
+ if (!lldp_mgmt_addr_tlv_print(tptr, tlv_len)) {
+ goto trunc;
+ }
+ }
+ break;
+
+ case LLDP_PRIVATE_TLV:
+ if (vflag) {
+ if (tlv_len < 3) {
+ goto trunc;
+ }
+ oui = EXTRACT_24BITS(tptr);
+ printf(": OUI %s (0x%06x)", tok2str(oui_values, "Unknown", oui), oui);
+
+ switch (oui) {
+ case OUI_IEEE_8021_PRIVATE:
+ hexdump = lldp_private_8021_print(tptr, tlv_len);
+ break;
+ case OUI_IEEE_8023_PRIVATE:
+ hexdump = lldp_private_8023_print(tptr, tlv_len);
+ break;
+ case OUI_TIA:
+ hexdump = lldp_private_tia_print(tptr, tlv_len);
+ break;
+ case OUI_DCBX:
+ hexdump = lldp_private_dcbx_print(tptr, tlv_len);
+ break;
+ default:
+ hexdump = TRUE;
+ break;
+ }
+ }
+ break;
+
+ default:
+ hexdump = TRUE;
+ break;
+ }
+
+ /* do we also want to see a hex dump ? */
+ if (vflag > 1 || (vflag && hexdump)) {
+ print_unknown_data(tptr,"\n\t ", tlv_len);
+ }
+
+ tlen -= tlv_len;
+ tptr += tlv_len;
+ }
+ return;
+ trunc:
+ printf("\n\t[|LLDP]");
+}
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 4
+ * End:
+ */
Property changes on: trunk/contrib/tcpdump/print-lldp.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-lmp.c
===================================================================
--- trunk/contrib/tcpdump/print-lmp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-lmp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -10,6 +10,8 @@
* LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE.
*
+ * Support for the Link Management Protocol as per rfc 4204.
+ *
* Original code by Hannes Gredler (hannes at juniper.net)
* Support for LMP service discovery extensions (defined by UNI 1.0) added
* by Manu Pathak (mapathak at cisco.com), May 2005
@@ -17,7 +19,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-lmp.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-lmp.c,v 1.11 2007-08-02 17:32:49 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -91,21 +93,21 @@
};
static const struct tok lmp_obj_begin_verify_error_values[] = {
- { 0x01, "\n\t\tLink Verification Procedure Not supported"},
- { 0x02, "\n\t\tUnwilling to verify"},
- { 0x04, "\n\t\tUnsupported verification transport mechanism"},
- { 0x08, "\n\t\tLink_Id configuration error"},
- { 0x10, "\n\t\tUnknown object c-type"},
+ { 0x01, "Link Verification Procedure Not supported"},
+ { 0x02, "Unwilling to verify"},
+ { 0x04, "Unsupported verification transport mechanism"},
+ { 0x08, "Link-Id configuration error"},
+ { 0x10, "Unknown object c-type"},
{ 0, NULL}
};
static const struct tok lmp_obj_link_summary_error_values[] = {
- { 0x01, "\n\t\tUnacceptable non-negotiable LINK_SUMMARY parameters"},
- { 0x02, "\n\t\tRenegotiate LINK_SUMMARY parameters"},
- { 0x04, "\n\t\tInvalid TE-LINK Object"},
- { 0x08, "\n\t\tInvalid DATA-LINK Object"},
- { 0x10, "\n\t\tUnknown TE-LINK Object c-type"},
- { 0x20, "\n\t\tUnknown DATA-LINK Object c-type"},
+ { 0x01, "Unacceptable non-negotiable LINK-SUMMARY parameters"},
+ { 0x02, "Renegotiate LINK-SUMMARY parameters"},
+ { 0x04, "Invalid TE-LINK Object"},
+ { 0x08, "Invalid DATA-LINK Object"},
+ { 0x10, "Unknown TE-LINK Object c-type"},
+ { 0x20, "Unknown DATA-LINK Object c-type"},
{ 0, NULL}
};
@@ -532,7 +534,7 @@
case LMP_OBJ_HELLO:
switch(lmp_obj_ctype) {
case LMP_CTYPE_HELLO:
- printf("\n\t TxSeqNum: %u\n\t RcvSeqNum: %u",
+ printf("\n\t Tx Seq: %u, Rx Seq: %u",
EXTRACT_32BITS(obj_tptr),
EXTRACT_32BITS(obj_tptr+4));
break;
@@ -869,7 +871,7 @@
}
/* do we want to see an additionally hexdump ? */
if (vflag > 1 || hexdump==TRUE)
- print_unknown_data(tptr+sizeof(sizeof(struct lmp_object_header)),"\n\t ",
+ print_unknown_data(tptr+sizeof(struct lmp_object_header),"\n\t ",
lmp_obj_len-sizeof(struct lmp_object_header));
tptr+=lmp_obj_len;
Modified: trunk/contrib/tcpdump/print-lspping.c
===================================================================
--- trunk/contrib/tcpdump/print-lspping.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-lspping.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -15,7 +15,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-lspping.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-lspping.c,v 1.20 2008-01-28 14:20:43 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -34,6 +34,7 @@
#include "bgp.h"
#include "l2vpn.h"
+#include "oui.h"
/*
* LSPPING common header
@@ -134,7 +135,11 @@
#define LSPPING_TLV_TARGET_FEC_STACK 1
#define LSPPING_TLV_DOWNSTREAM_MAPPING 2
#define LSPPING_TLV_PAD 3
-#define LSPPING_TLV_ERROR_CODE 4
+#define LSPPING_TLV_VENDOR_ENTERPRISE 5
+#define LSPPING_TLV_VENDOR_ENTERPRISE_LEN 4
+#define LSPPING_TLV_INTERFACE_LABEL_STACK 7
+#define LSPPING_TLV_ERROR_CODE 9
+#define LSPPING_TLV_REPLY_TOS_BYTE 10
#define LSPPING_TLV_BFD_DISCRIMINATOR 15 /* draft-ietf-bfd-mpls-02 */
#define LSPPING_TLV_BFD_DISCRIMINATOR_LEN 4
#define LSPPING_TLV_VENDOR_PRIVATE 0xfc00
@@ -144,8 +149,11 @@
{ LSPPING_TLV_DOWNSTREAM_MAPPING, "Downstream Mapping" },
{ LSPPING_TLV_PAD, "Pad" },
{ LSPPING_TLV_ERROR_CODE, "Error Code" },
+ { LSPPING_TLV_VENDOR_ENTERPRISE, "Vendor Enterprise Code" },
+ { LSPPING_TLV_INTERFACE_LABEL_STACK, "Interface Label Stack" },
+ { LSPPING_TLV_REPLY_TOS_BYTE, "Reply TOS Byte" },
{ LSPPING_TLV_BFD_DISCRIMINATOR, "BFD Discriminator" },
- { LSPPING_TLV_VENDOR_PRIVATE, "Vendor Enterprise Code" },
+ { LSPPING_TLV_VENDOR_PRIVATE, "Vendor Private Code" },
{ 0, NULL}
};
@@ -566,6 +574,7 @@
tlen-=sizeof(const struct lspping_common_header);
while(tlen>(int)sizeof(struct lspping_tlv_header)) {
+
/* did we capture enough for fully decoding the tlv header ? */
if (!TTEST2(*tptr, sizeof(struct lspping_tlv_header)))
goto trunc;
@@ -574,10 +583,11 @@
lspping_tlv_type=EXTRACT_16BITS(lspping_tlv_header->type);
lspping_tlv_len=EXTRACT_16BITS(lspping_tlv_header->length);
- if (lspping_tlv_len == 0)
+ /* some little sanity checking */
+ if (lspping_tlv_type == 0 || lspping_tlv_len == 0)
return;
- if(lspping_tlv_len % 4 || lspping_tlv_len < 4) { /* aligned to four octet boundary */
+ if(lspping_tlv_len < 4) {
printf("\n\t ERROR: TLV %u bogus size %u",lspping_tlv_type,lspping_tlv_len);
return;
}
@@ -839,11 +849,24 @@
goto trunc;
printf("\n\t BFD Discriminator 0x%08x", EXTRACT_32BITS(tptr));
break;
+
+ case LSPPING_TLV_VENDOR_ENTERPRISE:
+ {
+ u_int32_t vendor_id;
+
+ if (!TTEST2(*tptr, LSPPING_TLV_VENDOR_ENTERPRISE_LEN))
+ goto trunc;
+ vendor_id = EXTRACT_32BITS(tlv_tptr);
+ printf("\n\t Vendor: %s (0x%04x)",
+ tok2str(smi_values, "Unknown", vendor_id),
+ vendor_id);
+ }
+ break;
+
/*
* FIXME those are the defined TLVs that lack a decoder
* you are welcome to contribute code ;-)
*/
-
case LSPPING_TLV_PAD:
case LSPPING_TLV_ERROR_CODE:
case LSPPING_TLV_VENDOR_PRIVATE:
@@ -855,9 +878,15 @@
}
/* do we want to see an additionally tlv hexdump ? */
if (vflag > 1 || tlv_hexdump==TRUE)
- print_unknown_data(tptr+sizeof(sizeof(struct lspping_tlv_header)),"\n\t ",
+ print_unknown_data(tptr+sizeof(struct lspping_tlv_header),"\n\t ",
lspping_tlv_len);
+
+ /* All TLVs are aligned to four octet boundary */
+ if (lspping_tlv_len % 4) {
+ lspping_tlv_len += (4 - lspping_tlv_len % 4);
+ }
+
tptr+=lspping_tlv_len+sizeof(struct lspping_tlv_header);
tlen-=lspping_tlv_len+sizeof(struct lspping_tlv_header);
}
Added: trunk/contrib/tcpdump/print-lwapp.c
===================================================================
--- trunk/contrib/tcpdump/print-lwapp.c (rev 0)
+++ trunk/contrib/tcpdump/print-lwapp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,359 @@
+/*
+ * Copyright (c) 1998-2007 The TCPDUMP project
+ *
+ * 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.
+ *
+ * Support for the Light Weight Access Point Protocol as per draft-ohara-capwap-lwapp-04
+ *
+ * Original code by Carles Kishimoto <carles.kishimoto at gmail.com>
+ */
+
+#ifndef lint
+static const char rcsid[] _U_ =
+"@(#) $Header: /tcpdump/master/tcpdump/print-lwapp.c,v 1.1 2007-07-24 16:07:30 hannes Exp $";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "interface.h"
+#include "extract.h"
+#include "addrtoname.h"
+
+/*
+ * LWAPP transport (common) header
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |VER| RID |C|F|L| Frag ID | Length |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Status/WLANs | Payload... |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ */
+
+struct lwapp_transport_header {
+ u_int8_t version;
+ u_int8_t frag_id;
+ u_int8_t length[2];
+ u_int16_t status;
+};
+
+/*
+ * LWAPP control header
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Message Type | Seq Num | Msg Element Length |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Session ID |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Msg Element [0..N] |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+
+struct lwapp_control_header {
+ u_int8_t msg_type;
+ u_int8_t seq_num;
+ u_int8_t len[2];
+ u_int8_t session_id[4];
+};
+
+#define LWAPP_VERSION 0
+#define LWAPP_EXTRACT_VERSION(x) (((x)&0xC0)>>6)
+#define LWAPP_EXTRACT_RID(x) (((x)&0x38)>>3)
+#define LWAPP_EXTRACT_CONTROL_BIT(x) (((x)&0x04)>>2)
+
+static const struct tok lwapp_header_bits_values[] = {
+ { 0x01, "Last Fragment Bit"},
+ { 0x02, "Fragment Bit"},
+ { 0x04, "Control Bit"},
+ { 0, NULL}
+};
+
+#define LWAPP_MSGTYPE_DISCOVERY_REQUEST 1
+#define LWAPP_MSGTYPE_DISCOVERY_RESPONSE 2
+#define LWAPP_MSGTYPE_JOIN_REQUEST 3
+#define LWAPP_MSGTYPE_JOIN_RESPONSE 4
+#define LWAPP_MSGTYPE_JOIN_ACK 5
+#define LWAPP_MSGTYPE_JOIN_CONFIRM 6
+#define LWAPP_MSGTYPE_CONFIGURE_REQUEST 10
+#define LWAPP_MSGTYPE_CONFIGURE_RESPONSE 11
+#define LWAPP_MSGTYPE_CONF_UPDATE_REQUEST 12
+#define LWAPP_MSGTYPE_CONF_UPDATE_RESPONSE 13
+#define LWAPP_MSGTYPE_WTP_EVENT_REQUEST 14
+#define LWAPP_MSGTYPE_WTP_EVENT_RESPONSE 15
+#define LWAPP_MSGTYPE_CHANGE_STATE_EVENT_REQUEST 16
+#define LWAPP_MSGTYPE_CHANGE_STATE_EVENT_RESPONSE 17
+#define LWAPP_MSGTYPE_ECHO_REQUEST 22
+#define LWAPP_MSGTYPE_ECHO_RESPONSE 23
+#define LWAPP_MSGTYPE_IMAGE_DATA_REQUEST 24
+#define LWAPP_MSGTYPE_IMAGE_DATA_RESPONSE 25
+#define LWAPP_MSGTYPE_RESET_REQUEST 26
+#define LWAPP_MSGTYPE_RESET_RESPONSE 27
+#define LWAPP_MSGTYPE_KEY_UPDATE_REQUEST 30
+#define LWAPP_MSGTYPE_KEY_UPDATE_RESPONSE 31
+#define LWAPP_MSGTYPE_PRIMARY_DISCOVERY_REQUEST 32
+#define LWAPP_MSGTYPE_PRIMARY_DISCOVERY_RESPONSE 33
+#define LWAPP_MSGTYPE_DATA_TRANSFER_REQUEST 34
+#define LWAPP_MSGTYPE_DATA_TRANSFER_RESPONSE 35
+#define LWAPP_MSGTYPE_CLEAR_CONFIG_INDICATION 36
+#define LWAPP_MSGTYPE_WLAN_CONFIG_REQUEST 37
+#define LWAPP_MSGTYPE_WLAN_CONFIG_RESPONSE 38
+#define LWAPP_MSGTYPE_MOBILE_CONFIG_REQUEST 39
+#define LWAPP_MSGTYPE_MOBILE_CONFIG_RESPONSE 40
+
+static const struct tok lwapp_msg_type_values[] = {
+ { LWAPP_MSGTYPE_DISCOVERY_REQUEST, "Discovery req"},
+ { LWAPP_MSGTYPE_DISCOVERY_RESPONSE, "Discovery resp"},
+ { LWAPP_MSGTYPE_JOIN_REQUEST, "Join req"},
+ { LWAPP_MSGTYPE_JOIN_RESPONSE, "Join resp"},
+ { LWAPP_MSGTYPE_JOIN_ACK, "Join ack"},
+ { LWAPP_MSGTYPE_JOIN_CONFIRM, "Join confirm"},
+ { LWAPP_MSGTYPE_CONFIGURE_REQUEST, "Configure req"},
+ { LWAPP_MSGTYPE_CONFIGURE_RESPONSE, "Configure resp"},
+ { LWAPP_MSGTYPE_CONF_UPDATE_REQUEST, "Update req"},
+ { LWAPP_MSGTYPE_CONF_UPDATE_RESPONSE, "Update resp"},
+ { LWAPP_MSGTYPE_WTP_EVENT_REQUEST, "WTP event req"},
+ { LWAPP_MSGTYPE_WTP_EVENT_RESPONSE, "WTP event resp"},
+ { LWAPP_MSGTYPE_CHANGE_STATE_EVENT_REQUEST, "Change state event req"},
+ { LWAPP_MSGTYPE_CHANGE_STATE_EVENT_RESPONSE, "Change state event resp"},
+ { LWAPP_MSGTYPE_ECHO_REQUEST, "Echo req"},
+ { LWAPP_MSGTYPE_ECHO_RESPONSE, "Echo resp"},
+ { LWAPP_MSGTYPE_IMAGE_DATA_REQUEST, "Image data req"},
+ { LWAPP_MSGTYPE_IMAGE_DATA_RESPONSE, "Image data resp"},
+ { LWAPP_MSGTYPE_RESET_REQUEST, "Channel status req"},
+ { LWAPP_MSGTYPE_RESET_RESPONSE, "Channel status resp"},
+ { LWAPP_MSGTYPE_KEY_UPDATE_REQUEST, "Key update req"},
+ { LWAPP_MSGTYPE_KEY_UPDATE_RESPONSE, "Key update resp"},
+ { LWAPP_MSGTYPE_PRIMARY_DISCOVERY_REQUEST, "Primary discovery req"},
+ { LWAPP_MSGTYPE_PRIMARY_DISCOVERY_RESPONSE, "Primary discovery resp"},
+ { LWAPP_MSGTYPE_DATA_TRANSFER_REQUEST, "Data transfer req"},
+ { LWAPP_MSGTYPE_DATA_TRANSFER_RESPONSE, "Data transfer resp"},
+ { LWAPP_MSGTYPE_CLEAR_CONFIG_INDICATION, "Clear config ind"},
+ { LWAPP_MSGTYPE_WLAN_CONFIG_REQUEST, "Wlan config req"},
+ { LWAPP_MSGTYPE_WLAN_CONFIG_RESPONSE, "Wlan config resp"},
+ { LWAPP_MSGTYPE_MOBILE_CONFIG_REQUEST, "Mobile config req"},
+ { LWAPP_MSGTYPE_MOBILE_CONFIG_RESPONSE, "Mobile config resp"},
+ { 0, NULL}
+};
+
+/*
+ * LWAPP message elements
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Type | Length | Value ... |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+struct lwapp_message_header {
+ u_int8_t type;
+ u_int8_t length[2];
+};
+
+void
+lwapp_control_print(const u_char *pptr, u_int len, int has_ap_ident) {
+
+ const struct lwapp_transport_header *lwapp_trans_header;
+ const struct lwapp_control_header *lwapp_control_header;
+ const u_char *tptr;
+ int tlen;
+ int msg_tlen;
+
+ tptr=pptr;
+
+ if (has_ap_ident) {
+ /* check if enough bytes for AP identity */
+ if (!TTEST2(*tptr, 6))
+ goto trunc;
+ lwapp_trans_header = (const struct lwapp_transport_header *)(pptr+6);
+ } else {
+ lwapp_trans_header = (const struct lwapp_transport_header *)pptr;
+ }
+ TCHECK(*lwapp_trans_header);
+
+ /*
+ * Sanity checking of the header.
+ */
+ if (LWAPP_EXTRACT_VERSION(lwapp_trans_header->version) != LWAPP_VERSION) {
+ printf("LWAPP version %u packet not supported",
+ LWAPP_EXTRACT_VERSION(lwapp_trans_header->version));
+ return;
+ }
+
+ /* non-verbose */
+ if (vflag < 1) {
+ printf("LWAPPv%u, %s frame, Flags [%s], length %u",
+ LWAPP_EXTRACT_VERSION(lwapp_trans_header->version),
+ LWAPP_EXTRACT_CONTROL_BIT(lwapp_trans_header->version) ? "Control" : "Data",
+ bittok2str(lwapp_header_bits_values,"none",(lwapp_trans_header->version)&0x07),
+ len);
+ return;
+ }
+
+ /* ok they seem to want to know everything - lets fully decode it */
+ tlen=EXTRACT_16BITS(lwapp_trans_header->length);
+
+ printf("LWAPPv%u, %s frame, Radio-id %u, Flags [%s], Frag-id %u, length %u",
+ LWAPP_EXTRACT_VERSION(lwapp_trans_header->version),
+ LWAPP_EXTRACT_CONTROL_BIT(lwapp_trans_header->version) ? "Control" : "Data",
+ LWAPP_EXTRACT_RID(lwapp_trans_header->version),
+ bittok2str(lwapp_header_bits_values,"none",(lwapp_trans_header->version)&0x07),
+ lwapp_trans_header->frag_id,
+ tlen);
+
+ if (has_ap_ident) {
+ printf("\n\tAP identity: %s",
+ etheraddr_string(tptr));
+ tptr+=sizeof(const struct lwapp_transport_header)+6;
+ } else {
+ tptr+=sizeof(const struct lwapp_transport_header);
+ }
+
+ while(tlen>0) {
+
+ /* did we capture enough for fully decoding the object header ? */
+ if (!TTEST2(*tptr, sizeof(struct lwapp_control_header)))
+ goto trunc;
+
+ lwapp_control_header = (const struct lwapp_control_header *)tptr;
+ msg_tlen = EXTRACT_16BITS(lwapp_control_header->len);
+
+ /* print message header */
+ printf("\n\t Msg type: %s (%u), Seqnum: %u, Msg len: %d, Session: 0x%08x",
+ tok2str(lwapp_msg_type_values,"Unknown",lwapp_control_header->msg_type),
+ lwapp_control_header->msg_type,
+ lwapp_control_header->seq_num,
+ msg_tlen,
+ EXTRACT_32BITS(lwapp_control_header->session_id));
+
+ /* did we capture enough for fully decoding the message */
+ if (!TTEST2(*tptr, msg_tlen))
+ goto trunc;
+
+ /* XXX - Decode sub messages for each message */
+ switch(lwapp_control_header->msg_type) {
+ case LWAPP_MSGTYPE_DISCOVERY_REQUEST:
+ case LWAPP_MSGTYPE_DISCOVERY_RESPONSE:
+ case LWAPP_MSGTYPE_JOIN_REQUEST:
+ case LWAPP_MSGTYPE_JOIN_RESPONSE:
+ case LWAPP_MSGTYPE_JOIN_ACK:
+ case LWAPP_MSGTYPE_JOIN_CONFIRM:
+ case LWAPP_MSGTYPE_CONFIGURE_REQUEST:
+ case LWAPP_MSGTYPE_CONFIGURE_RESPONSE:
+ case LWAPP_MSGTYPE_CONF_UPDATE_REQUEST:
+ case LWAPP_MSGTYPE_CONF_UPDATE_RESPONSE:
+ case LWAPP_MSGTYPE_WTP_EVENT_REQUEST:
+ case LWAPP_MSGTYPE_WTP_EVENT_RESPONSE:
+ case LWAPP_MSGTYPE_CHANGE_STATE_EVENT_REQUEST:
+ case LWAPP_MSGTYPE_CHANGE_STATE_EVENT_RESPONSE:
+ case LWAPP_MSGTYPE_ECHO_REQUEST:
+ case LWAPP_MSGTYPE_ECHO_RESPONSE:
+ case LWAPP_MSGTYPE_IMAGE_DATA_REQUEST:
+ case LWAPP_MSGTYPE_IMAGE_DATA_RESPONSE:
+ case LWAPP_MSGTYPE_RESET_REQUEST:
+ case LWAPP_MSGTYPE_RESET_RESPONSE:
+ case LWAPP_MSGTYPE_KEY_UPDATE_REQUEST:
+ case LWAPP_MSGTYPE_KEY_UPDATE_RESPONSE:
+ case LWAPP_MSGTYPE_PRIMARY_DISCOVERY_REQUEST:
+ case LWAPP_MSGTYPE_PRIMARY_DISCOVERY_RESPONSE:
+ case LWAPP_MSGTYPE_DATA_TRANSFER_REQUEST:
+ case LWAPP_MSGTYPE_DATA_TRANSFER_RESPONSE:
+ case LWAPP_MSGTYPE_CLEAR_CONFIG_INDICATION:
+ case LWAPP_MSGTYPE_WLAN_CONFIG_REQUEST:
+ case LWAPP_MSGTYPE_WLAN_CONFIG_RESPONSE:
+ case LWAPP_MSGTYPE_MOBILE_CONFIG_REQUEST:
+ case LWAPP_MSGTYPE_MOBILE_CONFIG_RESPONSE:
+ default:
+ break;
+ }
+
+ tptr += sizeof(struct lwapp_control_header) + msg_tlen;
+ tlen -= sizeof(struct lwapp_control_header) + msg_tlen;
+ }
+ return;
+
+ trunc:
+ printf("\n\t\t packet exceeded snapshot");
+}
+
+void
+lwapp_data_print(const u_char *pptr, u_int len) {
+
+ const struct lwapp_transport_header *lwapp_trans_header;
+ const u_char *tptr;
+ int tlen;
+
+ tptr=pptr;
+
+ /* check if enough bytes for AP identity */
+ if (!TTEST2(*tptr, 6))
+ goto trunc;
+ lwapp_trans_header = (const struct lwapp_transport_header *)pptr;
+ TCHECK(*lwapp_trans_header);
+
+ /*
+ * Sanity checking of the header.
+ */
+ if (LWAPP_EXTRACT_VERSION(lwapp_trans_header->version) != LWAPP_VERSION) {
+ printf("LWAPP version %u packet not supported",
+ LWAPP_EXTRACT_VERSION(lwapp_trans_header->version));
+ return;
+ }
+
+ /* non-verbose */
+ if (vflag < 1) {
+ printf("LWAPPv%u, %s frame, Flags [%s], length %u",
+ LWAPP_EXTRACT_VERSION(lwapp_trans_header->version),
+ LWAPP_EXTRACT_CONTROL_BIT(lwapp_trans_header->version) ? "Control" : "Data",
+ bittok2str(lwapp_header_bits_values,"none",(lwapp_trans_header->version)&0x07),
+ len);
+ return;
+ }
+
+ /* ok they seem to want to know everything - lets fully decode it */
+ tlen=EXTRACT_16BITS(lwapp_trans_header->length);
+
+ printf("LWAPPv%u, %s frame, Radio-id %u, Flags [%s], Frag-id %u, length %u",
+ LWAPP_EXTRACT_VERSION(lwapp_trans_header->version),
+ LWAPP_EXTRACT_CONTROL_BIT(lwapp_trans_header->version) ? "Control" : "Data",
+ LWAPP_EXTRACT_RID(lwapp_trans_header->version),
+ bittok2str(lwapp_header_bits_values,"none",(lwapp_trans_header->version)&0x07),
+ lwapp_trans_header->frag_id,
+ tlen);
+
+ tptr+=sizeof(const struct lwapp_transport_header);
+ tlen-=sizeof(const struct lwapp_transport_header);
+
+ /* FIX - An IEEE 802.11 frame follows - hexdump for now */
+ print_unknown_data(tptr, "\n\t", tlen);
+
+ return;
+
+ trunc:
+ printf("\n\t\t packet exceeded snapshot");
+}
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 8
+ * End:
+ */
Property changes on: trunk/contrib/tcpdump/print-lwapp.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-lwres.c
===================================================================
--- trunk/contrib/tcpdump/print-lwres.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-lwres.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -29,7 +29,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-lwres.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-lwres.c,v 1.13 2004-03-24 01:54:29 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-mobile.c
===================================================================
--- trunk/contrib/tcpdump/print-mobile.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-mobile.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -42,7 +42,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-mobile.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-mobile.c,v 1.15 2004-03-24 01:58:14 guy Exp $";
#endif
#include <tcpdump-stdinc.h>
@@ -72,6 +72,7 @@
{
const u_char *cp = bp +8 ;
const struct mobile_ip *mob;
+ struct cksum_vec vec[1];
u_short proto,crc;
u_char osp =0; /* old source address present */
@@ -101,7 +102,9 @@
(void)printf("> %s ",ipaddr_string(&mob->odst));
(void)printf("(oproto=%d)",proto>>8);
}
- if (in_cksum((u_short *)mob, osp ? 12 : 8, 0)!=0) {
+ vec[0].ptr = (const u_int8_t *)(void *)mob;
+ vec[0].len = osp ? 12 : 8;
+ if (in_cksum(vec, 1)!=0) {
(void)printf(" (bad checksum %d)",crc);
}
Modified: trunk/contrib/tcpdump/print-mobility.c
===================================================================
--- trunk/contrib/tcpdump/print-mobility.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-mobility.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -33,7 +33,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-mobility.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-mobility.c,v 1.12 2005-04-20 22:21:00 guy Exp $";
#endif
#ifdef INET6
Added: trunk/contrib/tcpdump/print-mpcp.c
===================================================================
--- trunk/contrib/tcpdump/print-mpcp.c (rev 0)
+++ trunk/contrib/tcpdump/print-mpcp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,274 @@
+/*
+ * Copyright (c) 1998-2006 The TCPDUMP project
+ *
+ * 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.
+ *
+ * support for the IEEE MPCP protocol as per 802.3ah
+ *
+ * Original code by Hannes Gredler (hannes at juniper.net)
+ */
+
+#ifndef lint
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/print-mpcp.c,v 1.2 2006-02-10 17:24:55 hannes Exp $";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "interface.h"
+#include "extract.h"
+#include "addrtoname.h"
+#include "ether.h"
+
+#define MPCP_TIMESTAMP_LEN 4
+#define MPCP_TIMESTAMP_DURATION_LEN 2
+
+struct mpcp_common_header_t {
+ u_int8_t opcode[2];
+ u_int8_t timestamp[MPCP_TIMESTAMP_LEN];
+};
+
+#define MPCP_OPCODE_PAUSE 0x0001
+#define MPCP_OPCODE_GATE 0x0002
+#define MPCP_OPCODE_REPORT 0x0003
+#define MPCP_OPCODE_REG_REQ 0x0004
+#define MPCP_OPCODE_REG 0x0005
+#define MPCP_OPCODE_REG_ACK 0x0006
+
+static const struct tok mpcp_opcode_values[] = {
+ { MPCP_OPCODE_PAUSE, "Pause" },
+ { MPCP_OPCODE_GATE, "Gate" },
+ { MPCP_OPCODE_REPORT, "Report" },
+ { MPCP_OPCODE_REG_REQ, "Register Request" },
+ { MPCP_OPCODE_REG, "Register" },
+ { MPCP_OPCODE_REG_ACK, "Register ACK" },
+ { 0, NULL}
+};
+
+#define MPCP_GRANT_NUMBER_LEN 1
+#define MPCP_GRANT_NUMBER_MASK 0x7
+static const struct tok mpcp_grant_flag_values[] = {
+ { 0x08, "Discovery" },
+ { 0x10, "Force Grant #1" },
+ { 0x20, "Force Grant #2" },
+ { 0x40, "Force Grant #3" },
+ { 0x80, "Force Grant #4" },
+ { 0, NULL}
+};
+
+struct mpcp_grant_t {
+ u_int8_t starttime[MPCP_TIMESTAMP_LEN];
+ u_int8_t duration[MPCP_TIMESTAMP_DURATION_LEN];
+};
+
+struct mpcp_reg_req_t {
+ u_int8_t flags;
+ u_int8_t pending_grants;
+};
+
+
+static const struct tok mpcp_reg_req_flag_values[] = {
+ { 1, "Register" },
+ { 3, "De-Register" },
+ { 0, NULL}
+};
+
+struct mpcp_reg_t {
+ u_int8_t assigned_port[2];
+ u_int8_t flags;
+ u_int8_t sync_time[MPCP_TIMESTAMP_DURATION_LEN];
+ u_int8_t echoed_pending_grants;
+};
+
+static const struct tok mpcp_reg_flag_values[] = {
+ { 1, "Re-Register" },
+ { 2, "De-Register" },
+ { 3, "ACK" },
+ { 4, "NACK" },
+ { 0, NULL}
+};
+
+#define MPCP_REPORT_QUEUESETS_LEN 1
+#define MPCP_REPORT_REPORTBITMAP_LEN 1
+static const struct tok mpcp_report_bitmap_values[] = {
+ { 0x01, "Q0" },
+ { 0x02, "Q1" },
+ { 0x04, "Q2" },
+ { 0x08, "Q3" },
+ { 0x10, "Q4" },
+ { 0x20, "Q5" },
+ { 0x40, "Q6" },
+ { 0x80, "Q7" },
+ { 0, NULL}
+};
+
+struct mpcp_reg_ack_t {
+ u_int8_t flags;
+ u_int8_t echoed_assigned_port[2];
+ u_int8_t echoed_sync_time[MPCP_TIMESTAMP_DURATION_LEN];
+};
+
+static const struct tok mpcp_reg_ack_flag_values[] = {
+ { 0, "NACK" },
+ { 1, "ACK" },
+ { 0, NULL}
+};
+
+void
+mpcp_print(register const u_char *pptr, register u_int length) {
+
+ union {
+ const struct mpcp_common_header_t *common_header;
+ const struct mpcp_grant_t *grant;
+ const struct mpcp_reg_req_t *reg_req;
+ const struct mpcp_reg_t *reg;
+ const struct mpcp_reg_ack_t *reg_ack;
+ } mpcp;
+
+
+ const u_char *tptr;
+ u_int16_t opcode;
+ u_int8_t grant_numbers, grant;
+ u_int8_t queue_sets, queue_set, report_bitmap, report;
+
+ tptr=pptr;
+ mpcp.common_header = (const struct mpcp_common_header_t *)pptr;
+
+ if (!TTEST2(*tptr, sizeof(const struct mpcp_common_header_t)))
+ goto trunc;
+ opcode = EXTRACT_16BITS(mpcp.common_header->opcode);
+ printf("MPCP, Opcode %s", tok2str(mpcp_opcode_values, "Unknown (%u)", opcode));
+ if (opcode != MPCP_OPCODE_PAUSE) {
+ printf(", Timestamp %u ticks", EXTRACT_32BITS(mpcp.common_header->timestamp));
+ }
+ printf(", length %u", length);
+
+ if (!vflag)
+ return;
+
+ tptr += sizeof(const struct mpcp_common_header_t);
+
+ switch (opcode) {
+ case MPCP_OPCODE_PAUSE:
+ break;
+
+ case MPCP_OPCODE_GATE:
+ if (!TTEST2(*tptr, MPCP_GRANT_NUMBER_LEN))
+ goto trunc;
+ grant_numbers = *tptr & MPCP_GRANT_NUMBER_MASK;
+ printf("\n\tGrant Numbers %u, Flags [ %s ]",
+ grant_numbers,
+ bittok2str(mpcp_grant_flag_values,
+ "?",
+ *tptr &~ MPCP_GRANT_NUMBER_MASK));
+ tptr++;
+
+ for (grant = 1; grant <= grant_numbers; grant++) {
+ if (!TTEST2(*tptr, sizeof(const struct mpcp_grant_t)))
+ goto trunc;
+ mpcp.grant = (const struct mpcp_grant_t *)tptr;
+ printf("\n\tGrant #%u, Start-Time %u ticks, duration %u ticks",
+ grant,
+ EXTRACT_32BITS(mpcp.grant->starttime),
+ EXTRACT_16BITS(mpcp.grant->duration));
+ tptr += sizeof(const struct mpcp_grant_t);
+ }
+
+ if (!TTEST2(*tptr, MPCP_TIMESTAMP_DURATION_LEN))
+ goto trunc;
+ printf("\n\tSync-Time %u ticks", EXTRACT_16BITS(tptr));
+ break;
+
+
+ case MPCP_OPCODE_REPORT:
+ if (!TTEST2(*tptr, MPCP_REPORT_QUEUESETS_LEN))
+ goto trunc;
+ queue_sets = *tptr;
+ tptr+=MPCP_REPORT_QUEUESETS_LEN;
+ printf("\n\tTotal Queue-Sets %u", queue_sets);
+
+ for (queue_set = 1; queue_set < queue_sets; queue_set++) {
+ if (!TTEST2(*tptr, MPCP_REPORT_REPORTBITMAP_LEN))
+ goto trunc;
+ report_bitmap = *(tptr);
+ printf("\n\t Queue-Set #%u, Report-Bitmap [ %s ]",
+ queue_sets,
+ bittok2str(mpcp_report_bitmap_values, "Unknown", report_bitmap));
+ tptr++;
+
+ report=1;
+ while (report_bitmap != 0) {
+ if (report_bitmap & 1) {
+ if (!TTEST2(*tptr, MPCP_TIMESTAMP_DURATION_LEN))
+ goto trunc;
+ printf("\n\t Q%u Report, Duration %u ticks",
+ report,
+ EXTRACT_16BITS(tptr));
+ tptr+=MPCP_TIMESTAMP_DURATION_LEN;
+ }
+ report++;
+ report_bitmap = report_bitmap >> 1;
+ }
+ }
+ break;
+
+ case MPCP_OPCODE_REG_REQ:
+ if (!TTEST2(*tptr, sizeof(const struct mpcp_reg_req_t)))
+ goto trunc;
+ mpcp.reg_req = (const struct mpcp_reg_req_t *)tptr;
+ printf("\n\tFlags [ %s ], Pending-Grants %u",
+ bittok2str(mpcp_reg_req_flag_values, "Reserved", mpcp.reg_req->flags),
+ mpcp.reg_req->pending_grants);
+ break;
+
+ case MPCP_OPCODE_REG:
+ if (!TTEST2(*tptr, sizeof(const struct mpcp_reg_t)))
+ goto trunc;
+ mpcp.reg = (const struct mpcp_reg_t *)tptr;
+ printf("\n\tAssigned-Port %u, Flags [ %s ]" \
+ "\n\tSync-Time %u ticks, Echoed-Pending-Grants %u",
+ EXTRACT_16BITS(mpcp.reg->assigned_port),
+ bittok2str(mpcp_reg_flag_values, "Reserved", mpcp.reg->flags),
+ EXTRACT_16BITS(mpcp.reg->sync_time),
+ mpcp.reg->echoed_pending_grants);
+ break;
+
+ case MPCP_OPCODE_REG_ACK:
+ if (!TTEST2(*tptr, sizeof(const struct mpcp_reg_ack_t)))
+ goto trunc;
+ mpcp.reg_ack = (const struct mpcp_reg_ack_t *)tptr;
+ printf("\n\tEchoed-Assigned-Port %u, Flags [ %s ]" \
+ "\n\tEchoed-Sync-Time %u ticks",
+ EXTRACT_16BITS(mpcp.reg_ack->echoed_assigned_port),
+ bittok2str(mpcp_reg_ack_flag_values, "Reserved", mpcp.reg_ack->flags),
+ EXTRACT_16BITS(mpcp.reg_ack->echoed_sync_time));
+ break;
+
+ default:
+ /* unknown opcode - hexdump for now */
+ print_unknown_data(pptr, "\n\t", length);
+ break;
+ }
+
+ return;
+
+trunc:
+ printf("\n\t[|MPCP]");
+}
Property changes on: trunk/contrib/tcpdump/print-mpcp.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-mpls.c
===================================================================
--- trunk/contrib/tcpdump/print-mpls.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-mpls.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -28,7 +28,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-mpls.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-mpls.c,v 1.14 2005-07-05 09:38:19 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -54,6 +54,13 @@
/*15*/ "rsvd",
};
+enum mpls_packet_type {
+ PT_UNKNOWN,
+ PT_IPV4,
+ PT_IPV6,
+ PT_OSI
+};
+
/*
* RFC3032: MPLS label stack encoding
*/
@@ -62,7 +69,8 @@
{
const u_char *p;
u_int32_t label_entry;
- u_int16_t label_stack_depth = 0;
+ u_int16_t label_stack_depth = 0;
+ enum mpls_packet_type pt = PT_UNKNOWN;
p = bp;
printf("MPLS");
@@ -70,9 +78,9 @@
TCHECK2(*p, sizeof(label_entry));
label_entry = EXTRACT_32BITS(p);
printf("%s(label %u",
- label_stack_depth ? "\n\t" : " ",
- MPLS_LABEL(label_entry));
- label_stack_depth++;
+ (label_stack_depth && vflag) ? "\n\t" : " ",
+ MPLS_LABEL(label_entry));
+ label_stack_depth++;
if (vflag &&
MPLS_LABEL(label_entry) < sizeof(mpls_labelname) / sizeof(mpls_labelname[0]))
printf(" (%s)", mpls_labelname[MPLS_LABEL(label_entry)]);
@@ -84,97 +92,127 @@
p += sizeof(label_entry);
} while (!MPLS_STACK(label_entry));
+ /*
+ * Try to figure out the packet type.
+ */
switch (MPLS_LABEL(label_entry)) {
+
case 0: /* IPv4 explicit NULL label */
- case 3: /* IPv4 implicit NULL label */
- if (vflag>0) {
- printf("\n\t");
- ip_print(gndo, p, length - (p - bp));
- }
- else printf(", IP, length: %u",length);
+ case 3: /* IPv4 implicit NULL label */
+ pt = PT_IPV4;
break;
-#ifdef INET6
+
case 2: /* IPv6 explicit NULL label */
- if (vflag>0) {
- printf("\n\t");
- ip6_print(p, length - (p - bp));
- }
- else printf(", IPv6, length: %u",length);
+ pt = PT_IPV6;
break;
-#endif
+
default:
/*
* Generally there's no indication of protocol in MPLS label
- * encoding, however draft-hsmit-isis-aal5mux-00.txt describes
- * a technique that looks at the first payload byte if the BOS (bottom of stack)
- * bit is set and tries to determine the network layer protocol
- * 0x45-0x4f is IPv4
- * 0x60-0x6f is IPv6
- * 0x81-0x83 is OSI (CLNP,ES-IS,IS-IS)
- * this technique is sometimes known as NULL encapsulation
- * and decoding is particularly useful for control-plane traffic [BGP]
- * which cisco by default sends MPLS encapsulated
+ * encoding.
+ *
+ * However, draft-hsmit-isis-aal5mux-00.txt describes a
+ * technique for encapsulating IS-IS and IP traffic on the
+ * same ATM virtual circuit; you look at the first payload
+ * byte to determine the network layer protocol, based on
+ * the fact that
+ *
+ * 1) the first byte of an IP header is 0x45-0x4f
+ * for IPv4 and 0x60-0x6f for IPv6;
+ *
+ * 2) the first byte of an OSI CLNP packet is 0x81,
+ * the first byte of an OSI ES-IS packet is 0x82,
+ * and the first byte of an OSI IS-IS packet is
+ * 0x83;
+ *
+ * so the network layer protocol can be inferred from the
+ * first byte of the packet, if the protocol is one of the
+ * ones listed above.
+ *
+ * Cisco sends control-plane traffic MPLS-encapsulated in
+ * this fashion.
*/
+ switch(*p) {
- if (MPLS_STACK(label_entry)) { /* only do this if the stack bit is set */
- switch(*p) {
- case 0x45:
- case 0x46:
- case 0x47:
- case 0x48:
- case 0x49:
- case 0x4a:
- case 0x4b:
- case 0x4c:
- case 0x4d:
- case 0x4e:
- case 0x4f:
- if (vflag>0) {
- printf("\n\t");
- ip_print(gndo, p, length - (p - bp));
- }
- else printf(", IP, length: %u",length);
- break;
+ case 0x45:
+ case 0x46:
+ case 0x47:
+ case 0x48:
+ case 0x49:
+ case 0x4a:
+ case 0x4b:
+ case 0x4c:
+ case 0x4d:
+ case 0x4e:
+ case 0x4f:
+ pt = PT_IPV4;
+ break;
+
+ case 0x60:
+ case 0x61:
+ case 0x62:
+ case 0x63:
+ case 0x64:
+ case 0x65:
+ case 0x66:
+ case 0x67:
+ case 0x68:
+ case 0x69:
+ case 0x6a:
+ case 0x6b:
+ case 0x6c:
+ case 0x6d:
+ case 0x6e:
+ case 0x6f:
+ pt = PT_IPV6;
+ break;
+
+ case 0x81:
+ case 0x82:
+ case 0x83:
+ pt = PT_OSI;
+ break;
+
+ default:
+ /* ok bail out - we did not figure out what it is*/
+ break;
+ }
+ }
+
+ /*
+ * Print the payload.
+ */
+ if (pt == PT_UNKNOWN) {
+ if (!suppress_default_print)
+ default_print(p, length - (p - bp));
+ return;
+ }
+ if (vflag)
+ printf("\n\t");
+ else
+ printf(" ");
+ switch (pt) {
+
+ case PT_IPV4:
+ ip_print(gndo, p, length - (p - bp));
+ break;
+
+ case PT_IPV6:
#ifdef INET6
- case 0x60:
- case 0x61:
- case 0x62:
- case 0x63:
- case 0x64:
- case 0x65:
- case 0x66:
- case 0x67:
- case 0x68:
- case 0x69:
- case 0x6a:
- case 0x6b:
- case 0x6c:
- case 0x6d:
- case 0x6e:
- case 0x6f:
- if (vflag>0) {
- printf("\n\t");
- ip6_print(p, length - (p - bp));
- }
- else printf(", IPv6, length: %u",length);
- break;
+ ip6_print(gndo, p, length - (p - bp));
+#else
+ printf("IPv6, length: %u", length);
#endif
- case 0x81:
- case 0x82:
- case 0x83:
- if (vflag>0) {
- printf("\n\t");
- isoclns_print(p, length - (p - bp), length - (p - bp));
- }
- else printf(", OSI, length: %u",length);
- break;
- default:
- /* ok bail out - we did not figure out what it is*/
- break;
- }
- }
- return;
+ break;
+
+ case PT_OSI:
+ isoclns_print(p, length - (p - bp), length - (p - bp));
+ break;
+
+ default:
+ break;
}
+ return;
trunc:
printf("[|MPLS]");
Modified: trunk/contrib/tcpdump/print-msdp.c
===================================================================
--- trunk/contrib/tcpdump/print-msdp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-msdp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -17,7 +17,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-msdp.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-msdp.c,v 1.7 2005-04-06 21:32:41 mcr Exp $";
#endif
#ifdef HAVE_CONFIG_H
Added: trunk/contrib/tcpdump/print-msnlb.c
===================================================================
--- trunk/contrib/tcpdump/print-msnlb.c (rev 0)
+++ trunk/contrib/tcpdump/print-msnlb.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2013 Romain Francoise <romain at orebokech.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include "netdissect.h"
+#include "addrtoname.h"
+#include "extract.h"
+
+struct msnlb_heartbeat_pkt {
+ u_int32_t unknown1;
+ u_int32_t unknown2;
+ u_int32_t host_prio; /* little-endian */
+ u_int32_t virtual_ip;
+ u_int32_t host_ip;
+ /* the protocol is undocumented so we ignore the rest */
+};
+
+void
+msnlb_print(netdissect_options *ndo, const u_char *bp, u_int length)
+{
+ const struct msnlb_heartbeat_pkt *hb;
+
+ hb = (struct msnlb_heartbeat_pkt *)bp;
+ ND_TCHECK(*hb);
+
+ ND_PRINT((ndo, "MS NLB heartbeat, host priority: %u,",
+ EXTRACT_LE_32BITS(&(hb->host_prio))));
+ ND_PRINT((ndo, " cluster IP: %s,", ipaddr_string(&(hb->virtual_ip))));
+ ND_PRINT((ndo, " host IP: %s", ipaddr_string(&(hb->host_ip))));
+ return;
+trunc:
+ ND_PRINT((ndo, "[|MS NLB]"));
+}
Property changes on: trunk/contrib/tcpdump/print-msnlb.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-netbios.c
===================================================================
--- trunk/contrib/tcpdump/print-netbios.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-netbios.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -24,7 +24,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-netbios.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-netbios.c,v 1.20 2003-11-16 09:36:29 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-nfs.c
===================================================================
--- trunk/contrib/tcpdump/print-nfs.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-nfs.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,12 +18,12 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-nfs.c,v 1.12.10.1 2007/10/19 03:03:59 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-nfs.c 214478 2010-10-28 19:06:17Z rpaulo $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-nfs.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-nfs.c,v 1.111 2007-12-22 03:08:04 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -51,7 +51,7 @@
#include "rpc_msg.h"
static void nfs_printfh(const u_int32_t *, const u_int);
-static void xid_map_enter(const struct sunrpc_msg *, const u_char *);
+static int xid_map_enter(const struct sunrpc_msg *, const u_char *);
static int32_t xid_map_find(const struct sunrpc_msg *, const u_char *,
u_int32_t *, u_int32_t *);
static void interp_reply(const struct sunrpc_msg *, u_int32_t, u_int32_t, int);
@@ -299,6 +299,7 @@
nfserr = 0; /* assume no error */
rp = (const struct sunrpc_msg *)bp;
+ TCHECK(rp->rm_xid);
if (!nflag) {
strlcpy(srcid, "nfs", sizeof(srcid));
snprintf(dstid, sizeof(dstid), "%u",
@@ -309,6 +310,7 @@
EXTRACT_32BITS(&rp->rm_xid));
}
print_nfsaddr(bp2, srcid, dstid);
+ TCHECK(rp->rm_reply.rp_stat);
reply_stat = EXTRACT_32BITS(&rp->rm_reply.rp_stat);
switch (reply_stat) {
@@ -320,10 +322,12 @@
case SUNRPC_MSG_DENIED:
(void)printf("reply ERR %u: ", length);
+ TCHECK(rp->rm_reply.rp_reject.rj_stat);
rstat = EXTRACT_32BITS(&rp->rm_reply.rp_reject.rj_stat);
switch (rstat) {
case SUNRPC_RPC_MISMATCH:
+ TCHECK(rp->rm_reply.rp_reject.rj_vers.high);
rlow = EXTRACT_32BITS(&rp->rm_reply.rp_reject.rj_vers.low);
rhigh = EXTRACT_32BITS(&rp->rm_reply.rp_reject.rj_vers.high);
(void)printf("RPC Version mismatch (%u-%u)",
@@ -331,6 +335,7 @@
break;
case SUNRPC_AUTH_ERROR:
+ TCHECK(rp->rm_reply.rp_reject.rj_why);
rwhy = EXTRACT_32BITS(&rp->rm_reply.rp_reject.rj_why);
(void)printf("Auth ");
switch (rwhy) {
@@ -386,6 +391,11 @@
reply_stat, length);
break;
}
+ return;
+
+trunc:
+ if (!nfserr)
+ fputs(" [|nfs]", stdout);
}
/*
@@ -500,11 +510,14 @@
nfs_type type;
int v3;
u_int32_t proc;
+ u_int32_t access_flags;
struct nfsv3_sattr sa3;
char srcid[20], dstid[20]; /*fits 32bit*/
nfserr = 0; /* assume no error */
rp = (const struct sunrpc_msg *)bp;
+
+ TCHECK(rp->rm_xid);
if (!nflag) {
snprintf(srcid, sizeof(srcid), "%u",
EXTRACT_32BITS(&rp->rm_xid));
@@ -517,7 +530,8 @@
print_nfsaddr(bp2, srcid, dstid);
(void)printf("%d", length);
- xid_map_enter(rp, bp2); /* record proc number for later on */
+ if (!xid_map_enter(rp, bp2)) /* record proc number for later on */
+ goto trunc;
v3 = (EXTRACT_32BITS(&rp->rm_call.cb_vers) == NFS_VER3);
proc = EXTRACT_32BITS(&rp->rm_call.cb_proc);
@@ -559,7 +573,37 @@
if ((dp = parsereq(rp, length)) != NULL &&
(dp = parsefh(dp, v3)) != NULL) {
TCHECK(dp[0]);
- printf(" %04x", EXTRACT_32BITS(&dp[0]));
+ access_flags = EXTRACT_32BITS(&dp[0]);
+ if (access_flags & ~NFSV3ACCESS_FULL) {
+ /* NFSV3ACCESS definitions aren't up to date */
+ printf(" %04x", access_flags);
+ } else if ((access_flags & NFSV3ACCESS_FULL) == NFSV3ACCESS_FULL) {
+ printf(" NFS_ACCESS_FULL");
+ } else {
+ char separator = ' ';
+ if (access_flags & NFSV3ACCESS_READ) {
+ printf(" NFS_ACCESS_READ");
+ separator = '|';
+ }
+ if (access_flags & NFSV3ACCESS_LOOKUP) {
+ printf("%cNFS_ACCESS_LOOKUP", separator);
+ separator = '|';
+ }
+ if (access_flags & NFSV3ACCESS_MODIFY) {
+ printf("%cNFS_ACCESS_MODIFY", separator);
+ separator = '|';
+ }
+ if (access_flags & NFSV3ACCESS_EXTEND) {
+ printf("%cNFS_ACCESS_EXTEND", separator);
+ separator = '|';
+ }
+ if (access_flags & NFSV3ACCESS_DELETE) {
+ printf("%cNFS_ACCESS_DELETE", separator);
+ separator = '|';
+ }
+ if (access_flags & NFSV3ACCESS_EXECUTE)
+ printf("%cNFS_ACCESS_EXECUTE", separator);
+ }
return;
}
break;
@@ -888,7 +932,7 @@
int xid_map_next = 0;
int xid_map_hint = 0;
-static void
+static int
xid_map_enter(const struct sunrpc_msg *rp, const u_char *bp)
{
struct ip *ip = NULL;
@@ -897,6 +941,8 @@
#endif
struct xid_map_entry *xmep;
+ if (!TTEST(rp->rm_call.cb_vers))
+ return (0);
switch (IP_V((struct ip *)bp)) {
case 4:
ip = (struct ip *)bp;
@@ -907,7 +953,7 @@
break;
#endif
default:
- return;
+ return (1);
}
xmep = &xid_map[xid_map_next];
@@ -930,6 +976,7 @@
#endif
xmep->proc = EXTRACT_32BITS(&rp->rm_call.cb_proc);
xmep->vers = EXTRACT_32BITS(&rp->rm_call.cb_vers);
+ return (1);
}
/*
Modified: trunk/contrib/tcpdump/print-ntp.c
===================================================================
--- trunk/contrib/tcpdump/print-ntp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ntp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -22,12 +22,12 @@
* By Jeffrey Mogul/DECWRL
* loosely based on print-bootp.c
*
- * $FreeBSD: src/contrib/tcpdump/print-ntp.c,v 1.11 2005/07/11 04:14:02 sam Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-ntp.c 252283 2013-06-27 00:37:59Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ntp.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ntp.c,v 1.43 2007-11-30 13:45:10 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -74,6 +74,12 @@
{ 0, NULL }
};
+static struct tok ntp_stratum_values[] = {
+ { UNSPECIFIED, "unspecified" },
+ { PRIM_REF, "primary reference" },
+ { 0, NULL }
+};
+
/*
* Print ntp requests
*/
@@ -108,10 +114,12 @@
leapind);
TCHECK(bp->stratum);
- printf(", Stratum %u", bp->stratum);
+ printf(", Stratum %u (%s)",
+ bp->stratum,
+ tok2str(ntp_stratum_values, (bp->stratum >=2 && bp->stratum<=15) ? "secondary reference" : "reserved", bp->stratum));
TCHECK(bp->ppoll);
- printf(", poll %us", bp->ppoll);
+ printf(", poll %u (%us)", bp->ppoll, 1 << bp->ppoll);
/* Can't TCHECK bp->precision bitfield so bp->distance + 0 instead */
TCHECK2(bp->root_delay, 0);
@@ -176,8 +184,19 @@
fputs("\n\t Originator - Transmit Timestamp: ", stdout);
p_ntp_delta(&(bp->org_timestamp), &(bp->xmt_timestamp));
- /* FIXME key-id, authentication */
-
+ if ( (sizeof(struct ntpdata) - length) == 16) { /* Optional: key-id */
+ TCHECK(bp->key_id);
+ printf("\n\tKey id: %u", bp->key_id);
+ } else if ( (sizeof(struct ntpdata) - length) == 0) { /* Optional: key-id + authentication */
+ TCHECK(bp->key_id);
+ printf("\n\tKey id: %u", bp->key_id);
+ TCHECK2(bp->message_digest, sizeof (bp->message_digest));
+ printf("\n\tAuthentication: %08x%08x%08x%08x",
+ EXTRACT_32BITS(bp->message_digest),
+ EXTRACT_32BITS(bp->message_digest + 4),
+ EXTRACT_32BITS(bp->message_digest + 8),
+ EXTRACT_32BITS(bp->message_digest + 12));
+ }
return;
trunc:
Modified: trunk/contrib/tcpdump/print-null.c
===================================================================
--- trunk/contrib/tcpdump/print-null.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-null.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,12 +18,12 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-null.c,v 1.12.2.1 2007/10/19 03:03:59 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-null.c 236192 2012-05-28 19:13:21Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-null.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.57 2006-03-23 14:58:44 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -38,12 +38,12 @@
#include "interface.h"
#include "addrtoname.h"
-#include "af.h"
#include "ip.h"
#ifdef INET6
#include "ip6.h"
#endif
+#include "af.h"
/*
* The DLT_NULL packet header is 4 bytes long. It contains a host-byte-order
@@ -57,7 +57,6 @@
*/
#define NULL_HDRLEN 4
-
/*
* Byte-swap a 32-bit number.
* ("htonl()" or "ntohl()" won't work - we want to byte-swap even on
@@ -128,7 +127,7 @@
case BSD_AFNUM_INET6_BSD:
case BSD_AFNUM_INET6_FREEBSD:
case BSD_AFNUM_INET6_DARWIN:
- ip6_print(p, length);
+ ip6_print(gndo, p, length);
break;
#endif
Modified: trunk/contrib/tcpdump/print-olsr.c
===================================================================
--- trunk/contrib/tcpdump/print-olsr.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-olsr.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,5 +1,6 @@
/*
* Copyright (c) 1998-2007 The TCPDUMP project
+ * Copyright (c) 2009 Florian Forster
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code
@@ -15,6 +16,7 @@
* Optimized Link State Protocl (OLSR) as per rfc3626
*
* Original code by Hannes Gredler <hannes at juniper.net>
+ * IPv6 additions by Florian Forster <octo at verplant.org>
*/
#ifdef HAVE_CONFIG_H
@@ -28,7 +30,7 @@
#include "interface.h"
#include "addrtoname.h"
-#include "extract.h"
+#include "extract.h"
#include "ip.h"
/*
@@ -88,7 +90,7 @@
{ 0, NULL}
};
-struct olsr_msg {
+struct olsr_msg4 {
u_int8_t msg_type;
u_int8_t vtime;
u_int8_t msg_len[2];
@@ -98,6 +100,16 @@
u_int8_t msg_seq[2];
};
+struct olsr_msg6 {
+ u_int8_t msg_type;
+ u_int8_t vtime;
+ u_int8_t msg_len[2];
+ u_int8_t originator[16];
+ u_int8_t ttl;
+ u_int8_t hopcount;
+ u_int8_t msg_seq[2];
+};
+
struct olsr_hello {
u_int8_t res[2];
u_int8_t htime;
@@ -115,12 +127,17 @@
u_int8_t res[2];
};
-struct olsr_hna {
+struct olsr_hna4 {
u_int8_t network[4];
u_int8_t mask[4];
};
+struct olsr_hna6 {
+ u_int8_t network[16];
+ u_int8_t mask[16];
+};
+
#define OLSR_EXTRACT_LINK_TYPE(link_code) (link_code & 0x3)
#define OLSR_EXTRACT_NEIGHBOR_TYPE(link_code) (link_code >> 2)
@@ -139,7 +156,7 @@
{ 0, NULL}
};
-struct olsr_lq_neighbor {
+struct olsr_lq_neighbor4 {
u_int8_t neighbor[4];
u_int8_t link_quality;
u_int8_t neighbor_link_quality;
@@ -146,6 +163,13 @@
u_int8_t res[2];
};
+struct olsr_lq_neighbor6 {
+ u_int8_t neighbor[16];
+ u_int8_t link_quality;
+ u_int8_t neighbor_link_quality;
+ u_int8_t res[2];
+};
+
/*
* macro to convert the 8-bit mantissa/exponent to a double float
* taken from olsr.org.
@@ -158,13 +182,13 @@
* print a neighbor list with LQ extensions.
*/
static void
-olsr_print_lq_neighbor (const u_char *msg_data, u_int hello_len)
+olsr_print_lq_neighbor4 (const u_char *msg_data, u_int hello_len)
{
- struct olsr_lq_neighbor *lq_neighbor;
+ struct olsr_lq_neighbor4 *lq_neighbor;
- while (hello_len >= sizeof(struct olsr_lq_neighbor)) {
+ while (hello_len >= sizeof(struct olsr_lq_neighbor4)) {
- lq_neighbor = (struct olsr_lq_neighbor *)msg_data;
+ lq_neighbor = (struct olsr_lq_neighbor4 *)msg_data;
printf("\n\t neighbor %s, link-quality %.2lf%%"
", neighbor-link-quality %.2lf%%",
@@ -172,11 +196,33 @@
((double)lq_neighbor->link_quality/2.55),
((double)lq_neighbor->neighbor_link_quality/2.55));
- msg_data += sizeof(struct olsr_lq_neighbor);
- hello_len -= sizeof(struct olsr_lq_neighbor);
+ msg_data += sizeof(struct olsr_lq_neighbor4);
+ hello_len -= sizeof(struct olsr_lq_neighbor4);
}
}
+#if INET6
+static void
+olsr_print_lq_neighbor6 (const u_char *msg_data, u_int hello_len)
+{
+ struct olsr_lq_neighbor6 *lq_neighbor;
+
+ while (hello_len >= sizeof(struct olsr_lq_neighbor6)) {
+
+ lq_neighbor = (struct olsr_lq_neighbor6 *)msg_data;
+
+ printf("\n\t neighbor %s, link-quality %.2lf%%"
+ ", neighbor-link-quality %.2lf%%",
+ ip6addr_string(lq_neighbor->neighbor),
+ ((double)lq_neighbor->link_quality/2.55),
+ ((double)lq_neighbor->neighbor_link_quality/2.55));
+
+ msg_data += sizeof(struct olsr_lq_neighbor6);
+ hello_len -= sizeof(struct olsr_lq_neighbor6);
+ }
+}
+#endif /* INET6 */
+
/*
* print a neighbor list.
*/
@@ -202,23 +248,25 @@
void
-olsr_print (const u_char *pptr, u_int length)
+olsr_print (const u_char *pptr, u_int length, int is_ipv6)
{
union {
const struct olsr_common *common;
- const struct olsr_msg *msg;
+ const struct olsr_msg4 *msg4;
+ const struct olsr_msg6 *msg6;
const struct olsr_hello *hello;
const struct olsr_hello_link *hello_link;
- const struct olsr_lq_neighbor *lq_neighbor;
const struct olsr_tc *tc;
- const struct olsr_hna *hna;
+ const struct olsr_hna4 *hna;
} ptr;
- u_int msg_type, msg_len, msg_tlen, hello_len, prefix;
+ u_int msg_type, msg_len, msg_tlen, hello_len;
+ u_int16_t name_entry_type, name_entry_len;
+ u_int name_entry_padding;
u_int8_t link_type, neighbor_type;
const u_char *tptr, *msg_data;
- tptr = pptr;
+ tptr = pptr;
if (length < sizeof(struct olsr_common)) {
goto trunc;
@@ -225,15 +273,16 @@
}
if (!TTEST2(*tptr, sizeof(struct olsr_common))) {
- goto trunc;
+ goto trunc;
}
ptr.common = (struct olsr_common *)tptr;
length = MIN(length, EXTRACT_16BITS(ptr.common->packet_len));
- printf("OLSR, seq 0x%04x, length %u",
- EXTRACT_16BITS(ptr.common->packet_seq),
- length);
+ printf("OLSRv%i, seq 0x%04x, length %u",
+ (is_ipv6 == 0) ? 4 : 6,
+ EXTRACT_16BITS(ptr.common->packet_seq),
+ length);
tptr += sizeof(struct olsr_common);
@@ -241,41 +290,81 @@
* In non-verbose mode, just print version.
*/
if (vflag < 1) {
- return;
+ return;
}
while (tptr < (pptr+length)) {
+ union
+ {
+ struct olsr_msg4 *v4;
+ struct olsr_msg6 *v6;
+ } msgptr;
+ int msg_len_valid = 0;
- if (!TTEST2(*tptr, sizeof(struct olsr_msg)))
+ if (!TTEST2(*tptr, sizeof(struct olsr_msg4)))
goto trunc;
- ptr.msg = (struct olsr_msg *)tptr;
+#if INET6
+ if (is_ipv6)
+ {
+ msgptr.v6 = (struct olsr_msg6 *) tptr;
+ msg_type = msgptr.v6->msg_type;
+ msg_len = EXTRACT_16BITS(msgptr.v6->msg_len);
+ if ((msg_len >= sizeof (struct olsr_msg6))
+ && (msg_len <= length))
+ msg_len_valid = 1;
- msg_type = ptr.msg->msg_type;
- msg_len = EXTRACT_16BITS(ptr.msg->msg_len);
+ /* infinite loop check */
+ if (msg_type == 0 || msg_len == 0) {
+ return;
+ }
- /* infinite loop check */
- if (msg_type == 0 || msg_len == 0) {
- return;
+ printf("\n\t%s Message (%#04x), originator %s, ttl %u, hop %u"
+ "\n\t vtime %.3lfs, msg-seq 0x%04x, length %u%s",
+ tok2str(olsr_msg_values, "Unknown", msg_type),
+ msg_type, ip6addr_string(msgptr.v6->originator),
+ msgptr.v6->ttl,
+ msgptr.v6->hopcount,
+ ME_TO_DOUBLE(msgptr.v6->vtime),
+ EXTRACT_16BITS(msgptr.v6->msg_seq),
+ msg_len, (msg_len_valid == 0) ? " (invalid)" : "");
+
+ msg_tlen = msg_len - sizeof(struct olsr_msg6);
+ msg_data = tptr + sizeof(struct olsr_msg6);
}
+ else /* (!is_ipv6) */
+#endif /* INET6 */
+ {
+ msgptr.v4 = (struct olsr_msg4 *) tptr;
+ msg_type = msgptr.v4->msg_type;
+ msg_len = EXTRACT_16BITS(msgptr.v4->msg_len);
+ if ((msg_len >= sizeof (struct olsr_msg4))
+ && (msg_len <= length))
+ msg_len_valid = 1;
- printf("\n\t%s Message (%u), originator %s, ttl %u, hop %u"
- "\n\t vtime %.3lfs, msg-seq 0x%04x, length %u",
- tok2str(olsr_msg_values, "Unknown", msg_type),
- msg_type, ipaddr_string(ptr.msg->originator),
- ptr.msg->ttl,
- ptr.msg->hopcount,
- ME_TO_DOUBLE(ptr.msg->vtime),
- EXTRACT_16BITS(ptr.msg->msg_seq),
- msg_len);
+ /* infinite loop check */
+ if (msg_type == 0 || msg_len == 0) {
+ return;
+ }
- msg_tlen = msg_len - sizeof(struct olsr_msg);
- msg_data = tptr + sizeof(struct olsr_msg);
+ printf("\n\t%s Message (%#04x), originator %s, ttl %u, hop %u"
+ "\n\t vtime %.3lfs, msg-seq 0x%04x, length %u%s",
+ tok2str(olsr_msg_values, "Unknown", msg_type),
+ msg_type, ipaddr_string(msgptr.v4->originator),
+ msgptr.v4->ttl,
+ msgptr.v4->hopcount,
+ ME_TO_DOUBLE(msgptr.v4->vtime),
+ EXTRACT_16BITS(msgptr.v4->msg_seq),
+ msg_len, (msg_len_valid == 0) ? " (invalid)" : "");
+ msg_tlen = msg_len - sizeof(struct olsr_msg4);
+ msg_data = tptr + sizeof(struct olsr_msg4);
+ }
+
switch (msg_type) {
case OLSR_HELLO_MSG:
case OLSR_HELLO_LQ_MSG:
- if (!TTEST2(*msg_data, sizeof(struct olsr_hello)))
+ if (!TTEST2(*msg_data, sizeof(struct olsr_hello)))
goto trunc;
ptr.hello = (struct olsr_hello *)msg_data;
@@ -285,11 +374,12 @@
msg_tlen -= sizeof(struct olsr_hello);
while (msg_tlen >= sizeof(struct olsr_hello_link)) {
+ int hello_len_valid = 0;
/*
* link-type.
*/
- if (!TTEST2(*msg_data, sizeof(struct olsr_hello_link)))
+ if (!TTEST2(*msg_data, sizeof(struct olsr_hello_link)))
goto trunc;
ptr.hello_link = (struct olsr_hello_link *)msg_data;
@@ -298,11 +388,19 @@
link_type = OLSR_EXTRACT_LINK_TYPE(ptr.hello_link->link_code);
neighbor_type = OLSR_EXTRACT_NEIGHBOR_TYPE(ptr.hello_link->link_code);
- printf("\n\t link-type %s, neighbor-type %s, len %u",
+ if ((hello_len <= msg_tlen)
+ && (hello_len >= sizeof(struct olsr_hello_link)))
+ hello_len_valid = 1;
+
+ printf("\n\t link-type %s, neighbor-type %s, len %u%s",
tok2str(olsr_link_type_values, "Unknown", link_type),
tok2str(olsr_neighbor_type_values, "Unknown", neighbor_type),
- hello_len);
+ hello_len,
+ (hello_len_valid == 0) ? " (invalid)" : "");
+ if (hello_len_valid == 0)
+ break;
+
msg_data += sizeof(struct olsr_hello_link);
msg_tlen -= sizeof(struct olsr_hello_link);
hello_len -= sizeof(struct olsr_hello_link);
@@ -310,7 +408,12 @@
if (msg_type == OLSR_HELLO_MSG) {
olsr_print_neighbor(msg_data, hello_len);
} else {
- olsr_print_lq_neighbor(msg_data, hello_len);
+#if INET6
+ if (is_ipv6)
+ olsr_print_lq_neighbor6(msg_data, hello_len);
+ else
+#endif
+ olsr_print_lq_neighbor4(msg_data, hello_len);
}
msg_data += hello_len;
@@ -320,7 +423,7 @@
case OLSR_TC_MSG:
case OLSR_TC_LQ_MSG:
- if (!TTEST2(*msg_data, sizeof(struct olsr_tc)))
+ if (!TTEST2(*msg_data, sizeof(struct olsr_tc)))
goto trunc;
ptr.tc = (struct olsr_tc *)msg_data;
@@ -332,56 +435,182 @@
if (msg_type == OLSR_TC_MSG) {
olsr_print_neighbor(msg_data, msg_tlen);
} else {
- olsr_print_lq_neighbor(msg_data, msg_tlen);
+#if INET6
+ if (is_ipv6)
+ olsr_print_lq_neighbor6(msg_data, msg_tlen);
+ else
+#endif
+ olsr_print_lq_neighbor4(msg_data, msg_tlen);
}
break;
case OLSR_MID_MSG:
- if (!TTEST2(*msg_data, sizeof(struct in_addr)))
- goto trunc;
+ {
+ size_t addr_size = sizeof(struct in_addr);
- while (msg_tlen >= sizeof(struct in_addr)) {
- printf("\n\t interface address %s", ipaddr_string(msg_data));
- msg_data += sizeof(struct in_addr);
- msg_tlen -= sizeof(struct in_addr);
+#if INET6
+ if (is_ipv6)
+ addr_size = sizeof(struct in6_addr);
+#endif
+
+ while (msg_tlen >= addr_size) {
+ if (!TTEST2(*msg_data, addr_size))
+ goto trunc;
+
+ printf("\n\t interface address %s",
+#if INET6
+ is_ipv6 ? ip6addr_string(msg_data) :
+#endif
+ ipaddr_string(msg_data));
+ msg_data += addr_size;
+ msg_tlen -= addr_size;
}
break;
+ }
case OLSR_HNA_MSG:
- prefix = 1;
- printf("\n\t advertised networks\n\t ");
- while (msg_tlen >= sizeof(struct olsr_hna)) {
- if (!TTEST2(*msg_data, sizeof(struct olsr_hna)))
- goto trunc;
+ printf("\n\t Advertised networks (total %u)",
+ (unsigned int) (msg_tlen / sizeof(struct olsr_hna6)));
+#if INET6
+ if (is_ipv6)
+ {
+ int i = 0;
+ while (msg_tlen >= sizeof(struct olsr_hna6)) {
+ struct olsr_hna6 *hna6;
- ptr.hna = (struct olsr_hna *)msg_data;
+ if (!TTEST2(*msg_data, sizeof(struct olsr_hna6)))
+ goto trunc;
- /* print 4 prefixes per line */
+ hna6 = (struct olsr_hna6 *)msg_data;
- printf("%s/%u%s",
- ipaddr_string(ptr.hna->network),
- mask2plen(EXTRACT_32BITS(ptr.hna->mask)),
- prefix % 4 == 0 ? "\n\t " : " ");
+ printf("\n\t #%i: %s/%u",
+ i, ip6addr_string(hna6->network),
+ mask62plen (hna6->mask));
- msg_data += sizeof(struct olsr_hna);
- msg_tlen -= sizeof(struct olsr_hna);
- prefix ++;
+ msg_data += sizeof(struct olsr_hna6);
+ msg_tlen -= sizeof(struct olsr_hna6);
+ }
}
+ else
+#endif
+ {
+ int col = 0;
+ while (msg_tlen >= sizeof(struct olsr_hna4)) {
+ if (!TTEST2(*msg_data, sizeof(struct olsr_hna4)))
+ goto trunc;
+
+ ptr.hna = (struct olsr_hna4 *)msg_data;
+
+ /* print 4 prefixes per line */
+ if (col == 0)
+ printf ("\n\t ");
+ else
+ printf (", ");
+
+ printf("%s/%u",
+ ipaddr_string(ptr.hna->network),
+ mask2plen(EXTRACT_32BITS(ptr.hna->mask)));
+
+ msg_data += sizeof(struct olsr_hna4);
+ msg_tlen -= sizeof(struct olsr_hna4);
+
+ col = (col + 1) % 4;
+ }
+ }
break;
+ case OLSR_NAMESERVICE_MSG:
+ {
+ u_int name_entries = EXTRACT_16BITS(msg_data+2);
+ u_int addr_size = 4;
+ int name_entries_valid = 0;
+ u_int i;
+
+ if (is_ipv6)
+ addr_size = 16;
+
+ if ((name_entries > 0)
+ && ((name_entries * (4 + addr_size)) <= msg_tlen))
+ name_entries_valid = 1;
+
+ if (msg_tlen < 4)
+ goto trunc;
+ if (!TTEST2(*msg_data, 4))
+ goto trunc;
+
+ printf("\n\t Version %u, Entries %u%s",
+ EXTRACT_16BITS(msg_data),
+ name_entries, (name_entries_valid == 0) ? " (invalid)" : "");
+
+ if (name_entries_valid == 0)
+ break;
+
+ msg_data += 4;
+ msg_tlen -= 4;
+
+ for (i = 0; i < name_entries; i++) {
+ int name_entry_len_valid = 0;
+
+ if (msg_tlen < 4)
+ break;
+ if (!TTEST2(*msg_data, 4))
+ goto trunc;
+
+ name_entry_type = EXTRACT_16BITS(msg_data);
+ name_entry_len = EXTRACT_16BITS(msg_data+2);
+
+ msg_data += 4;
+ msg_tlen -= 4;
+
+ if ((name_entry_len > 0) && ((addr_size + name_entry_len) <= msg_tlen))
+ name_entry_len_valid = 1;
+
+ printf("\n\t #%u: type %#06x, length %u%s",
+ (unsigned int) i, name_entry_type,
+ name_entry_len, (name_entry_len_valid == 0) ? " (invalid)" : "");
+
+ if (name_entry_len_valid == 0)
+ break;
+
+ /* 32-bit alignment */
+ name_entry_padding = 0;
+ if (name_entry_len%4 != 0)
+ name_entry_padding = 4-(name_entry_len%4);
+
+ if (msg_tlen < addr_size + name_entry_len + name_entry_padding)
+ goto trunc;
+
+ if (!TTEST2(*msg_data, addr_size + name_entry_len + name_entry_padding))
+ goto trunc;
+
+#if INET6
+ if (is_ipv6)
+ printf(", address %s, name \"",
+ ip6addr_string(msg_data));
+ else
+#endif
+ printf(", address %s, name \"",
+ ipaddr_string(msg_data));
+ fn_printn(msg_data + addr_size, name_entry_len, NULL);
+ printf("\"");
+
+ msg_data += addr_size + name_entry_len + name_entry_padding;
+ msg_tlen -= addr_size + name_entry_len + name_entry_padding;
+ } /* for (i = 0; i < name_entries; i++) */
+ break;
+ } /* case OLSR_NAMESERVICE_MSG */
+
/*
* FIXME those are the defined messages that lack a decoder
* you are welcome to contribute code ;-)
*/
-
case OLSR_POWERINFO_MSG:
- case OLSR_NAMESERVICE_MSG:
default:
- print_unknown_data(msg_data, "\n\t ", msg_tlen);
+ print_unknown_data(msg_data, "\n\t ", msg_tlen);
break;
- }
+ } /* switch (msg_type) */
tptr += msg_len;
- }
+ } /* while (tptr < (pptr+length)) */
return;
Modified: trunk/contrib/tcpdump/print-ospf.c
===================================================================
--- trunk/contrib/tcpdump/print-ospf.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ospf.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ospf.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.66 2007-10-08 07:53:21 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -44,11 +44,11 @@
#include "ip.h"
static struct tok ospf_option_values[] = {
- { OSPF_OPTION_T, "TOS" },
+ { OSPF_OPTION_T, "MultiTopology" }, /* draft-ietf-ospf-mt-09 */
{ OSPF_OPTION_E, "External" },
{ OSPF_OPTION_MC, "Multicast" },
{ OSPF_OPTION_NP, "NSSA" },
- { OSPF_OPTION_EA, "Advertise External" },
+ { OSPF_OPTION_L, "LLS" },
{ OSPF_OPTION_DC, "Demand Circuit" },
{ OSPF_OPTION_O, "Opaque" },
{ OSPF_OPTION_DN, "Up/Down" },
@@ -98,6 +98,7 @@
{ OSPF_DB_INIT, "Init" },
{ OSPF_DB_MORE, "More" },
{ OSPF_DB_MASTER, "Master" },
+ { OSPF_DB_RESYNC, "OOBResync" },
{ 0, NULL }
};
@@ -172,8 +173,20 @@
{ 0, NULL }
};
-static char tstr[] = " [|ospf]";
+static struct tok ospf_lls_tlv_values[] = {
+ { OSPF_LLS_EO, "Extended Options" },
+ { OSPF_LLS_MD5, "MD5 Authentication" },
+ { 0, NULL }
+};
+static struct tok ospf_lls_eo_options[] = {
+ { OSPF_LLS_EO_LR, "LSDB resync" },
+ { OSPF_LLS_EO_RS, "Restart" },
+ { 0, NULL }
+};
+
+static char tstr[] = " [|ospf2]";
+
#ifdef WIN32
#define inline __inline
#endif /* WIN32 */
@@ -181,7 +194,275 @@
static int ospf_print_lshdr(const struct lsa_hdr *);
static const u_char *ospf_print_lsa(const struct lsa *);
static int ospf_decode_v2(const struct ospfhdr *, const u_char *);
+static int ospf_decode_lls(const struct ospfhdr *, register u_int);
+int
+ospf_print_grace_lsa (const u_int8_t *tptr, u_int ls_length) {
+
+ u_int tlv_type, tlv_length;
+
+
+ while (ls_length > 0) {
+ TCHECK2(*tptr, 4);
+ if (ls_length < 4) {
+ printf("\n\t Remaining LS length %u < 4", ls_length);
+ return -1;
+ }
+ tlv_type = EXTRACT_16BITS(tptr);
+ tlv_length = EXTRACT_16BITS(tptr+2);
+ tptr+=4;
+ ls_length-=4;
+
+ printf("\n\t %s TLV (%u), length %u, value: ",
+ tok2str(lsa_opaque_grace_tlv_values,"unknown",tlv_type),
+ tlv_type,
+ tlv_length);
+
+ if (tlv_length > ls_length) {
+ printf("\n\t Bogus length %u > %u", tlv_length,
+ ls_length);
+ return -1;
+ }
+
+ /* Infinite loop protection. */
+ if (tlv_type == 0 || tlv_length ==0) {
+ return -1;
+ }
+
+ TCHECK2(*tptr, tlv_length);
+ switch(tlv_type) {
+
+ case LS_OPAQUE_GRACE_TLV_PERIOD:
+ if (tlv_length != 4) {
+ printf("\n\t Bogus length %u != 4", tlv_length);
+ return -1;
+ }
+ printf("%us",EXTRACT_32BITS(tptr));
+ break;
+
+ case LS_OPAQUE_GRACE_TLV_REASON:
+ if (tlv_length != 1) {
+ printf("\n\t Bogus length %u != 1", tlv_length);
+ return -1;
+ }
+ printf("%s (%u)",
+ tok2str(lsa_opaque_grace_tlv_reason_values, "Unknown", *tptr),
+ *tptr);
+ break;
+
+ case LS_OPAQUE_GRACE_TLV_INT_ADDRESS:
+ if (tlv_length != 4) {
+ printf("\n\t Bogus length %u != 4", tlv_length);
+ return -1;
+ }
+ printf("%s", ipaddr_string(tptr));
+ break;
+
+ default:
+ if (vflag <= 1) {
+ if(!print_unknown_data(tptr,"\n\t ",tlv_length))
+ return -1;
+ }
+ break;
+
+ }
+ /* in OSPF everything has to be 32-bit aligned, including TLVs */
+ if (tlv_length%4 != 0)
+ tlv_length+=4-(tlv_length%4);
+ ls_length-=tlv_length;
+ tptr+=tlv_length;
+ }
+
+ return 0;
+trunc:
+ return -1;
+}
+
+int
+ospf_print_te_lsa (const u_int8_t *tptr, u_int ls_length) {
+
+ u_int tlv_type, tlv_length, subtlv_type, subtlv_length;
+ u_int priority_level, te_class, count_srlg;
+ union { /* int to float conversion buffer for several subTLVs */
+ float f;
+ u_int32_t i;
+ } bw;
+
+ while (ls_length != 0) {
+ TCHECK2(*tptr, 4);
+ if (ls_length < 4) {
+ printf("\n\t Remaining LS length %u < 4", ls_length);
+ return -1;
+ }
+ tlv_type = EXTRACT_16BITS(tptr);
+ tlv_length = EXTRACT_16BITS(tptr+2);
+ tptr+=4;
+ ls_length-=4;
+
+ printf("\n\t %s TLV (%u), length: %u",
+ tok2str(lsa_opaque_te_tlv_values,"unknown",tlv_type),
+ tlv_type,
+ tlv_length);
+
+ if (tlv_length > ls_length) {
+ printf("\n\t Bogus length %u > %u", tlv_length,
+ ls_length);
+ return -1;
+ }
+
+ /* Infinite loop protection. */
+ if (tlv_type == 0 || tlv_length ==0) {
+ return -1;
+ }
+
+ switch(tlv_type) {
+ case LS_OPAQUE_TE_TLV_LINK:
+ while (tlv_length >= sizeof(subtlv_type) + sizeof(subtlv_length)) {
+ if (tlv_length < 4) {
+ printf("\n\t Remaining TLV length %u < 4",
+ tlv_length);
+ return -1;
+ }
+ TCHECK2(*tptr, 4);
+ subtlv_type = EXTRACT_16BITS(tptr);
+ subtlv_length = EXTRACT_16BITS(tptr+2);
+ tptr+=4;
+ tlv_length-=4;
+
+ printf("\n\t %s subTLV (%u), length: %u",
+ tok2str(lsa_opaque_te_link_tlv_subtlv_values,"unknown",subtlv_type),
+ subtlv_type,
+ subtlv_length);
+
+ TCHECK2(*tptr, subtlv_length);
+ switch(subtlv_type) {
+ case LS_OPAQUE_TE_LINK_SUBTLV_ADMIN_GROUP:
+ printf(", 0x%08x", EXTRACT_32BITS(tptr));
+ break;
+ case LS_OPAQUE_TE_LINK_SUBTLV_LINK_ID:
+ case LS_OPAQUE_TE_LINK_SUBTLV_LINK_LOCAL_REMOTE_ID:
+ printf(", %s (0x%08x)",
+ ipaddr_string(tptr),
+ EXTRACT_32BITS(tptr));
+ if (subtlv_length == 8) /* rfc4203 */
+ printf(", %s (0x%08x)",
+ ipaddr_string(tptr+4),
+ EXTRACT_32BITS(tptr+4));
+ break;
+ case LS_OPAQUE_TE_LINK_SUBTLV_LOCAL_IP:
+ case LS_OPAQUE_TE_LINK_SUBTLV_REMOTE_IP:
+ printf(", %s", ipaddr_string(tptr));
+ break;
+ case LS_OPAQUE_TE_LINK_SUBTLV_MAX_BW:
+ case LS_OPAQUE_TE_LINK_SUBTLV_MAX_RES_BW:
+ bw.i = EXTRACT_32BITS(tptr);
+ printf(", %.3f Mbps", bw.f*8/1000000 );
+ break;
+ case LS_OPAQUE_TE_LINK_SUBTLV_UNRES_BW:
+ for (te_class = 0; te_class < 8; te_class++) {
+ bw.i = EXTRACT_32BITS(tptr+te_class*4);
+ printf("\n\t\tTE-Class %u: %.3f Mbps",
+ te_class,
+ bw.f*8/1000000 );
+ }
+ break;
+ case LS_OPAQUE_TE_LINK_SUBTLV_BW_CONSTRAINTS:
+ printf("\n\t\tBandwidth Constraints Model ID: %s (%u)",
+ tok2str(diffserv_te_bc_values, "unknown", *tptr),
+ *tptr);
+ /* decode BCs until the subTLV ends */
+ for (te_class = 0; te_class < (subtlv_length-4)/4; te_class++) {
+ bw.i = EXTRACT_32BITS(tptr+4+te_class*4);
+ printf("\n\t\t Bandwidth constraint CT%u: %.3f Mbps",
+ te_class,
+ bw.f*8/1000000 );
+ }
+ break;
+ case LS_OPAQUE_TE_LINK_SUBTLV_TE_METRIC:
+ printf(", Metric %u", EXTRACT_32BITS(tptr));
+ break;
+ case LS_OPAQUE_TE_LINK_SUBTLV_LINK_PROTECTION_TYPE:
+ printf(", %s, Priority %u",
+ bittok2str(gmpls_link_prot_values, "none", *tptr),
+ *(tptr+1));
+ break;
+ case LS_OPAQUE_TE_LINK_SUBTLV_INTF_SW_CAP_DESCR:
+ printf("\n\t\tInterface Switching Capability: %s",
+ tok2str(gmpls_switch_cap_values, "Unknown", *(tptr)));
+ printf("\n\t\tLSP Encoding: %s\n\t\tMax LSP Bandwidth:",
+ tok2str(gmpls_encoding_values, "Unknown", *(tptr+1)));
+ for (priority_level = 0; priority_level < 8; priority_level++) {
+ bw.i = EXTRACT_32BITS(tptr+4+(priority_level*4));
+ printf("\n\t\t priority level %d: %.3f Mbps",
+ priority_level,
+ bw.f*8/1000000 );
+ }
+ break;
+ case LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE:
+ printf(", %s (%u)",
+ tok2str(lsa_opaque_te_tlv_link_type_sub_tlv_values,"unknown",*tptr),
+ *tptr);
+ break;
+
+ case LS_OPAQUE_TE_LINK_SUBTLV_SHARED_RISK_GROUP:
+ count_srlg = subtlv_length / 4;
+ if (count_srlg != 0)
+ printf("\n\t\t Shared risk group: ");
+ while (count_srlg > 0) {
+ bw.i = EXTRACT_32BITS(tptr);
+ printf("%d",bw.i);
+ tptr+=4;
+ count_srlg--;
+ if (count_srlg > 0)
+ printf(", ");
+ }
+ break;
+
+ default:
+ if (vflag <= 1) {
+ if(!print_unknown_data(tptr,"\n\t\t",subtlv_length))
+ return -1;
+ }
+ break;
+ }
+ /* in OSPF everything has to be 32-bit aligned, including subTLVs */
+ if (subtlv_length%4 != 0)
+ subtlv_length+=4-(subtlv_length%4);
+
+ tlv_length-=subtlv_length;
+ tptr+=subtlv_length;
+
+ }
+ break;
+
+ case LS_OPAQUE_TE_TLV_ROUTER:
+ if (tlv_length < 4) {
+ printf("\n\t TLV length %u < 4", tlv_length);
+ return -1;
+ }
+ TCHECK2(*tptr, 4);
+ printf(", %s", ipaddr_string(tptr));
+ break;
+
+ default:
+ if (vflag <= 1) {
+ if(!print_unknown_data(tptr,"\n\t ",tlv_length))
+ return -1;
+ }
+ break;
+ }
+ /* in OSPF everything has to be 32-bit aligned, including TLVs */
+ if (tlv_length%4 != 0)
+ tlv_length+=4-(tlv_length%4);
+ ls_length-=tlv_length;
+ tptr+=tlv_length;
+ }
+ return 0;
+trunc:
+ return -1;
+}
+
+
static int
ospf_print_lshdr(register const struct lsa_hdr *lshp)
{
@@ -190,13 +471,13 @@
TCHECK(lshp->ls_length);
ls_length = EXTRACT_16BITS(&lshp->ls_length);
if (ls_length < sizeof(struct lsa_hdr)) {
- printf("\n\t Bogus length %u < %lu", ls_length,
+ printf("\n\t Bogus length %u < header (%lu)", ls_length,
(unsigned long)sizeof(struct lsa_hdr));
return(-1);
}
TCHECK(lshp->ls_seq); /* XXX - ls_length check checked this */
- printf("\n\t Advertising Router: %s, seq 0x%08x, age %us, length: %u",
+ printf("\n\t Advertising Router %s, seq 0x%08x, age %us, length %u",
ipaddr_string(&lshp->ls_router),
EXTRACT_32BITS(&lshp->ls_seq),
EXTRACT_16BITS(&lshp->ls_age),
@@ -208,7 +489,7 @@
case LS_TYPE_OPAQUE_LL:
case LS_TYPE_OPAQUE_AL:
case LS_TYPE_OPAQUE_DW:
- printf("\n\t %s LSA (%d), Opaque-Type: %s LSA (%u), Opaque-ID: %u",
+ printf("\n\t %s LSA (%d), Opaque-Type %s LSA (%u), Opaque-ID %u",
tok2str(lsa_values,"unknown",lshp->ls_type),
lshp->ls_type,
@@ -238,7 +519,42 @@
return (-1);
}
+/* draft-ietf-ospf-mt-09 */
+static struct tok ospf_topology_values[] = {
+ { 0, "default " },
+ { 1, "multicast " },
+ { 2, "management " },
+ { 0, NULL }
+};
+
/*
+ * Print all the per-topology metrics.
+ */
+static void
+ospf_print_tos_metrics(const union un_tos *tos)
+{
+ int metric_count;
+ int toscount;
+
+ toscount = tos->link.link_tos_count+1;
+ metric_count = 0;
+
+ /*
+ * All but the first metric contain a valid topology id.
+ */
+ while (toscount) {
+ printf("\n\t\ttopology %s(%u), metric %u",
+ tok2str(ospf_topology_values, "",
+ metric_count ? tos->metrics.tos_type : 0),
+ metric_count ? tos->metrics.tos_type : 0,
+ EXTRACT_16BITS(&tos->metrics.tos_metric));
+ metric_count++;
+ tos++;
+ toscount--;
+ }
+}
+
+/*
* Print a single link state advertisement. If truncated or if LSA length
* field is less than the length of the LSA header, return NULl, else
* return pointer to data past end of LSA.
@@ -248,19 +564,13 @@
{
register const u_int8_t *ls_end;
register const struct rlalink *rlp;
- register const struct tos_metric *tosp;
register const struct in_addr *ap;
register const struct aslametric *almp;
register const struct mcla *mcp;
register const u_int32_t *lp;
- register int j, k, tlv_type, tlv_length, subtlv_type, subtlv_length, priority_level, te_class;
+ register int j, tlv_type, tlv_length, topology;
register int ls_length;
const u_int8_t *tptr;
- int count_srlg;
- union { /* int to float conversion buffer for several subTLVs */
- float f;
- u_int32_t i;
- } bw;
tptr = (u_int8_t *)lsap->lsa_un.un_unknown; /* squelch compiler warnings */
ls_length = ospf_print_lshdr(&lsap->ls_hdr);
@@ -281,7 +591,7 @@
rlp = lsap->lsa_un.un_rla.rla_link;
while (j--) {
TCHECK(*rlp);
- switch (rlp->link_type) {
+ switch (rlp->un_tos.link.link_type) {
case RLA_TYPE_VIRTUAL:
printf("\n\t Virtual Link: Neighbor Router-ID: %s, Interface Address: %s",
@@ -309,20 +619,14 @@
default:
printf("\n\t Unknown Router Link Type (%u)",
- rlp->link_type);
+ rlp->un_tos.link.link_type);
return (ls_end);
}
- printf(", tos 0, metric: %d", EXTRACT_16BITS(&rlp->link_tos0metric));
- tosp = (struct tos_metric *)
- ((sizeof rlp->link_tos0metric) + (u_char *) rlp);
- for (k = 0; k < (int) rlp->link_toscount; ++k, ++tosp) {
- TCHECK(*tosp);
- printf(", tos %d, metric: %d",
- tosp->tos_type,
- EXTRACT_16BITS(&tosp->tos_metric));
- }
+
+ ospf_print_tos_metrics(&rlp->un_tos);
+
rlp = (struct rlalink *)((u_char *)(rlp + 1) +
- ((rlp->link_toscount) * sizeof(*tosp)));
+ ((rlp->un_tos.link.link_tos_count) * sizeof(union un_tos)));
}
break;
@@ -344,19 +648,16 @@
ipaddr_string(&lsap->lsa_un.un_sla.sla_mask));
TCHECK(lsap->lsa_un.un_sla.sla_tosmetric);
lp = lsap->lsa_un.un_sla.sla_tosmetric;
- /* suppress tos if its not supported */
- if(!((lsap->ls_hdr.ls_options)&OSPF_OPTION_T)) {
- printf(", metric: %u", EXTRACT_32BITS(lp)&SLA_MASK_METRIC);
- break;
- }
while ((u_char *)lp < ls_end) {
register u_int32_t ul;
TCHECK(*lp);
ul = EXTRACT_32BITS(lp);
- printf(", tos %d metric %d",
- (ul & SLA_MASK_TOS) >> SLA_SHIFT_TOS,
- ul & SLA_MASK_METRIC);
+ topology = (ul & SLA_MASK_TOS) >> SLA_SHIFT_TOS;
+ printf("\n\t\ttopology %s(%u) metric %d",
+ tok2str(ospf_topology_values, "", topology),
+ topology,
+ ul & SLA_MASK_METRIC);
++lp;
}
break;
@@ -364,19 +665,16 @@
case LS_TYPE_SUM_ABR:
TCHECK(lsap->lsa_un.un_sla.sla_tosmetric);
lp = lsap->lsa_un.un_sla.sla_tosmetric;
- /* suppress tos if its not supported */
- if(!((lsap->ls_hdr.ls_options)&OSPF_OPTION_T)) {
- printf(", metric: %u", EXTRACT_32BITS(lp)&SLA_MASK_METRIC);
- break;
- }
while ((u_char *)lp < ls_end) {
register u_int32_t ul;
TCHECK(*lp);
ul = EXTRACT_32BITS(lp);
- printf(", tos %d metric %d",
- (ul & SLA_MASK_TOS) >> SLA_SHIFT_TOS,
- ul & SLA_MASK_METRIC);
+ topology = (ul & SLA_MASK_TOS) >> SLA_SHIFT_TOS;
+ printf("\n\t\ttopology %s(%u) metric %d",
+ tok2str(ospf_topology_values, "", topology),
+ topology,
+ ul & SLA_MASK_METRIC);
++lp;
}
break;
@@ -394,9 +692,11 @@
TCHECK(almp->asla_tosmetric);
ul = EXTRACT_32BITS(&almp->asla_tosmetric);
- printf(", type %d, tos %d metric:",
- (ul & ASLA_FLAG_EXTERNAL) ? 2 : 1,
- (ul & ASLA_MASK_TOS) >> ASLA_SHIFT_TOS);
+ topology = ((ul & ASLA_MASK_TOS) >> ASLA_SHIFT_TOS);
+ printf("\n\t\ttopology %s(%u), type %d, metric",
+ tok2str(ospf_topology_values, "", topology),
+ topology,
+ (ul & ASLA_FLAG_EXTERNAL) ? 2 : 1);
if ((ul & ASLA_MASK_METRIC)==0xffffff)
printf(" infinite");
else
@@ -471,7 +771,6 @@
ls_length);
return(ls_end);
}
- ls_length-=tlv_length;
TCHECK2(*tptr, tlv_length);
switch(tlv_type) {
@@ -492,245 +791,32 @@
}
tptr+=tlv_length;
+ ls_length-=tlv_length;
}
+ break;
+ case LS_OPAQUE_TYPE_GRACE:
+ if (ospf_print_grace_lsa((u_int8_t *)(&lsap->lsa_un.un_grace_tlv.type),
+ ls_length) == -1) {
+ return(ls_end);
+ }
break;
- case LS_OPAQUE_TYPE_GRACE:
- tptr = (u_int8_t *)(&lsap->lsa_un.un_grace_tlv.type);
- while (ls_length != 0) {
- TCHECK2(*tptr, 4);
- if (ls_length < 4) {
- printf("\n\t Remaining LS length %u < 4", ls_length);
- return(ls_end);
- }
- tlv_type = EXTRACT_16BITS(tptr);
- tlv_length = EXTRACT_16BITS(tptr+2);
- tptr+=4;
- ls_length-=4;
-
- printf("\n\t %s TLV (%u), length: %u, value: ",
- tok2str(lsa_opaque_grace_tlv_values,"unknown",tlv_type),
- tlv_type,
- tlv_length);
-
- if (tlv_length > ls_length) {
- printf("\n\t Bogus length %u > %u", tlv_length,
- ls_length);
- return(ls_end);
- }
- ls_length-=tlv_length;
- TCHECK2(*tptr, tlv_length);
- switch(tlv_type) {
-
- case LS_OPAQUE_GRACE_TLV_PERIOD:
- if (tlv_length != 4) {
- printf("\n\t Bogus length %u != 4", tlv_length);
- return(ls_end);
- }
- printf("%us",EXTRACT_32BITS(tptr));
- break;
- case LS_OPAQUE_GRACE_TLV_REASON:
- if (tlv_length != 1) {
- printf("\n\t Bogus length %u != 1", tlv_length);
- return(ls_end);
- }
- printf("%s (%u)",
- tok2str(lsa_opaque_grace_tlv_reason_values, "Unknown", *tptr),
- *tptr);
- break;
- case LS_OPAQUE_GRACE_TLV_INT_ADDRESS:
- if (tlv_length != 4) {
- printf("\n\t Bogus length %u != 4", tlv_length);
- return(ls_end);
- }
- printf("%s", ipaddr_string(tptr));
- break;
- default:
- if (vflag <= 1) {
- if(!print_unknown_data(tptr,"\n\t ",tlv_length))
- return(ls_end);
- }
- break;
-
- }
- tptr+=tlv_length;
+ case LS_OPAQUE_TYPE_TE:
+ if (ospf_print_te_lsa((u_int8_t *)(&lsap->lsa_un.un_te_lsa_tlv.type),
+ ls_length) == -1) {
+ return(ls_end);
}
-
break;
- case LS_OPAQUE_TYPE_TE:
- tptr = (u_int8_t *)(&lsap->lsa_un.un_te_lsa_tlv.type);
- while (ls_length != 0) {
- TCHECK2(*tptr, 4);
- if (ls_length < 4) {
- printf("\n\t Remaining LS length %u < 4", ls_length);
+ default:
+ if (vflag <= 1) {
+ if(!print_unknown_data((u_int8_t *)lsap->lsa_un.un_unknown,
+ "\n\t ", ls_length))
return(ls_end);
- }
- tlv_type = EXTRACT_16BITS(tptr);
- tlv_length = EXTRACT_16BITS(tptr+2);
- tptr+=4;
- ls_length-=4;
-
- printf("\n\t %s TLV (%u), length: %u",
- tok2str(lsa_opaque_te_tlv_values,"unknown",tlv_type),
- tlv_type,
- tlv_length);
-
- if (tlv_length > ls_length) {
- printf("\n\t Bogus length %u > %u", tlv_length,
- ls_length);
- return(ls_end);
- }
- ls_length-=tlv_length;
- switch(tlv_type) {
- case LS_OPAQUE_TE_TLV_LINK:
- while (tlv_length != 0) {
- if (tlv_length < 4) {
- printf("\n\t Remaining TLV length %u < 4",
- tlv_length);
- return(ls_end);
- }
- TCHECK2(*tptr, 4);
- subtlv_type = EXTRACT_16BITS(tptr);
- subtlv_length = EXTRACT_16BITS(tptr+2);
- tptr+=4;
- tlv_length-=4;
-
- printf("\n\t %s subTLV (%u), length: %u",
- tok2str(lsa_opaque_te_link_tlv_subtlv_values,"unknown",subtlv_type),
- subtlv_type,
- subtlv_length);
-
- TCHECK2(*tptr, subtlv_length);
- switch(subtlv_type) {
- case LS_OPAQUE_TE_LINK_SUBTLV_ADMIN_GROUP:
- printf(", 0x%08x", EXTRACT_32BITS(tptr));
- break;
- case LS_OPAQUE_TE_LINK_SUBTLV_LINK_ID:
- case LS_OPAQUE_TE_LINK_SUBTLV_LINK_LOCAL_REMOTE_ID:
- printf(", %s (0x%08x)",
- ipaddr_string(tptr),
- EXTRACT_32BITS(tptr));
- if (subtlv_length == 8) /* draft-ietf-ccamp-ospf-gmpls-extensions */
- printf(", %s (0x%08x)",
- ipaddr_string(tptr+4),
- EXTRACT_32BITS(tptr+4));
- break;
- case LS_OPAQUE_TE_LINK_SUBTLV_LOCAL_IP:
- case LS_OPAQUE_TE_LINK_SUBTLV_REMOTE_IP:
- printf(", %s", ipaddr_string(tptr));
- break;
- case LS_OPAQUE_TE_LINK_SUBTLV_MAX_BW:
- case LS_OPAQUE_TE_LINK_SUBTLV_MAX_RES_BW:
- bw.i = EXTRACT_32BITS(tptr);
- printf(", %.3f Mbps", bw.f*8/1000000 );
- break;
- case LS_OPAQUE_TE_LINK_SUBTLV_UNRES_BW:
- for (te_class = 0; te_class < 8; te_class++) {
- bw.i = EXTRACT_32BITS(tptr+te_class*4);
- printf("\n\t\tTE-Class %u: %.3f Mbps",
- te_class,
- bw.f*8/1000000 );
- }
- break;
- case LS_OPAQUE_TE_LINK_SUBTLV_BW_CONSTRAINTS:
- printf("\n\t\tBandwidth Constraints Model ID: %s (%u)",
- tok2str(diffserv_te_bc_values, "unknown", *tptr),
- *tptr);
- /* decode BCs until the subTLV ends */
- for (te_class = 0; te_class < (subtlv_length-4)/4; te_class++) {
- bw.i = EXTRACT_32BITS(tptr+4+te_class*4);
- printf("\n\t\t Bandwidth constraint CT%u: %.3f Mbps",
- te_class,
- bw.f*8/1000000 );
- }
- break;
- case LS_OPAQUE_TE_LINK_SUBTLV_TE_METRIC:
- printf(", Metric %u", EXTRACT_32BITS(tptr));
- break;
- case LS_OPAQUE_TE_LINK_SUBTLV_LINK_PROTECTION_TYPE:
- printf(", %s, Priority %u",
- bittok2str(gmpls_link_prot_values, "none", *tptr),
- *(tptr+1));
- break;
- case LS_OPAQUE_TE_LINK_SUBTLV_INTF_SW_CAP_DESCR:
- printf("\n\t\tInterface Switching Capability: %s",
- tok2str(gmpls_switch_cap_values, "Unknown", *(tptr)));
- printf("\n\t\tLSP Encoding: %s\n\t\tMax LSP Bandwidth:",
- tok2str(gmpls_encoding_values, "Unknown", *(tptr+1)));
- for (priority_level = 0; priority_level < 8; priority_level++) {
- bw.i = EXTRACT_32BITS(tptr+4+(priority_level*4));
- printf("\n\t\t priority level %d: %.3f Mbps",
- priority_level,
- bw.f*8/1000000 );
- }
- break;
- case LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE:
- printf(", %s (%u)",
- tok2str(lsa_opaque_te_tlv_link_type_sub_tlv_values,"unknown",*tptr),
- *tptr);
- break;
-
- case LS_OPAQUE_TE_LINK_SUBTLV_SHARED_RISK_GROUP:
- count_srlg = subtlv_length / 4;
- if (count_srlg != 0)
- printf("\n\t\t Shared risk group: ");
- while (count_srlg > 0) {
- bw.i = EXTRACT_32BITS(tptr);
- printf("%d",bw.i);
- tptr+=4;
- count_srlg--;
- if (count_srlg > 0)
- printf(", ");
- }
- break;
-
- default:
- if (vflag <= 1) {
- if(!print_unknown_data(tptr,"\n\t\t",subtlv_length))
- return(ls_end);
- }
- break;
- }
- /* in OSPF everything has to be 32-bit aligned, including TLVs */
- if (subtlv_length%4 != 0)
- subtlv_length+=4-(subtlv_length%4);
-
- tlv_length-=subtlv_length;
- tptr+=subtlv_length;
-
- }
- break;
-
- case LS_OPAQUE_TE_TLV_ROUTER:
- if (tlv_length < 4) {
- printf("\n\t TLV length %u < 4", tlv_length);
- return(ls_end);
- }
- TCHECK2(*tptr, 4);
- printf(", %s", ipaddr_string(tptr));
- break;
-
- default:
- if (vflag <= 1) {
- if(!print_unknown_data(tptr,"\n\t ",tlv_length))
- return(ls_end);
- }
- break;
- }
- tptr+=tlv_length;
- }
+ }
break;
- }
- break;
- default:
- if (vflag <= 1) {
- if(!print_unknown_data((u_int8_t *)lsap->lsa_un.un_unknown,
- "\n\t ", ls_length))
- return(ls_end);
- }
- break;
+ }
}
/* do we want to see an additionally hexdump ? */
@@ -746,6 +832,98 @@
}
static int
+ospf_decode_lls(register const struct ospfhdr *op,
+ register u_int length)
+{
+ register const u_char *dptr;
+ register const u_char *dataend;
+ register u_int length2;
+ register u_int16_t lls_type, lls_len;
+ register u_int32_t lls_flags;
+
+ switch (op->ospf_type) {
+
+ case OSPF_TYPE_HELLO:
+ if (!(op->ospf_hello.hello_options & OSPF_OPTION_L))
+ return (0);
+ break;
+
+ case OSPF_TYPE_DD:
+ if (!(op->ospf_db.db_options & OSPF_OPTION_L))
+ return (0);
+ break;
+
+ default:
+ return (0);
+ }
+
+ /* dig deeper if LLS data is available; see RFC4813 */
+ length2 = EXTRACT_16BITS(&op->ospf_len);
+ dptr = (u_char *)op + length2;
+ dataend = (u_char *)op + length;
+
+ if (EXTRACT_16BITS(&op->ospf_authtype) == OSPF_AUTH_MD5) {
+ dptr = dptr + op->ospf_authdata[3];
+ length2 += op->ospf_authdata[3];
+ }
+ if (length2 >= length) {
+ printf("\n\t[LLS truncated]");
+ return (1);
+ }
+ TCHECK2(*dptr, 2);
+ printf("\n\t LLS: checksum: 0x%04x", (u_int)EXTRACT_16BITS(dptr));
+
+ dptr += 2;
+ TCHECK2(*dptr, 2);
+ length2 = EXTRACT_16BITS(dptr);
+ printf(", length: %u", length2);
+
+ dptr += 2;
+ TCHECK(*dptr);
+ while (dptr < dataend) {
+ TCHECK2(*dptr, 2);
+ lls_type = EXTRACT_16BITS(dptr);
+ printf("\n\t %s (%u)",
+ tok2str(ospf_lls_tlv_values,"Unknown TLV",lls_type),
+ lls_type);
+ dptr += 2;
+ TCHECK2(*dptr, 2);
+ lls_len = EXTRACT_16BITS(dptr);
+ printf(", length: %u", lls_len);
+ dptr += 2;
+ switch (lls_type) {
+
+ case OSPF_LLS_EO:
+ if (lls_len != 4) {
+ printf(" [should be 4]");
+ lls_len = 4;
+ }
+ TCHECK2(*dptr, 4);
+ lls_flags = EXTRACT_32BITS(dptr);
+ printf("\n\t Options: 0x%08x [%s]", lls_flags,
+ bittok2str(ospf_lls_eo_options,"?",lls_flags));
+
+ break;
+
+ case OSPF_LLS_MD5:
+ if (lls_len != 20) {
+ printf(" [should be 20]");
+ lls_len = 20;
+ }
+ TCHECK2(*dptr, 4);
+ printf("\n\t Sequence number: 0x%08x", EXTRACT_32BITS(dptr));
+ break;
+ }
+
+ dptr += lls_len;
+ }
+
+ return (0);
+trunc:
+ return (1);
+}
+
+static int
ospf_decode_v2(register const struct ospfhdr *op,
register const u_char *dataend)
{
@@ -765,11 +943,11 @@
break;
case OSPF_TYPE_HELLO:
- printf("\n\tOptions: [%s]",
+ printf("\n\tOptions [%s]",
bittok2str(ospf_option_values,"none",op->ospf_hello.hello_options));
TCHECK(op->ospf_hello.hello_deadint);
- printf("\n\t Hello Timer: %us, Dead Timer %us, Mask: %s, Priority: %u",
+ printf("\n\t Hello Timer %us, Dead Timer %us, Mask %s, Priority %u",
EXTRACT_16BITS(&op->ospf_hello.hello_helloint),
EXTRACT_32BITS(&op->ospf_hello.hello_deadint),
ipaddr_string(&op->ospf_hello.hello_mask),
@@ -797,19 +975,23 @@
case OSPF_TYPE_DD:
TCHECK(op->ospf_db.db_options);
- printf("\n\tOptions: [%s]",
+ printf("\n\tOptions [%s]",
bittok2str(ospf_option_values,"none",op->ospf_db.db_options));
TCHECK(op->ospf_db.db_flags);
- printf(", DD Flags: [%s]",
+ printf(", DD Flags [%s]",
bittok2str(ospf_dd_flag_values,"none",op->ospf_db.db_flags));
+ TCHECK(op->ospf_db.db_ifmtu);
+ if (op->ospf_db.db_ifmtu) {
+ printf(", MTU: %u", EXTRACT_16BITS(&op->ospf_db.db_ifmtu));
+ }
+ TCHECK(op->ospf_db.db_seq);
+ printf(", Sequence: 0x%08x", EXTRACT_32BITS(&op->ospf_db.db_seq));
- if (vflag) {
- /* Print all the LS adv's */
- lshp = op->ospf_db.db_lshdr;
- while (ospf_print_lshdr(lshp) != -1) {
- ++lshp;
- }
- }
+ /* Print all the LS adv's */
+ lshp = op->ospf_db.db_lshdr;
+ while (((u_char *)lshp < dataend) && ospf_print_lshdr(lshp) != -1) {
+ ++lshp;
+ }
break;
case OSPF_TYPE_LS_REQ:
@@ -846,7 +1028,7 @@
lsap = op->ospf_lsu.lsu_lsa;
TCHECK(op->ospf_lsu.lsu_count);
lsa_count_max = EXTRACT_32BITS(&op->ospf_lsu.lsu_count);
- printf(", %d LSA%s",lsa_count_max, lsa_count_max > 1 ? "s" : "");
+ printf(", %d LSA%s",lsa_count_max, PLURAL_SUFFIX(lsa_count_max));
for (lsa_count=1;lsa_count <= lsa_count_max;lsa_count++) {
printf("\n\t LSA #%u",lsa_count);
lsap = (const struct lsa *)ospf_print_lsa(lsap);
@@ -863,7 +1045,6 @@
break;
default:
- printf("v2 type (%d)", op->ospf_type);
break;
}
return (0);
@@ -892,7 +1073,7 @@
/* value. If it's not valid, say so and return */
TCHECK(op->ospf_type);
cp = tok2str(type2str, "unknown LS-type", op->ospf_type);
- printf("OSPFv%u, %s, length: %u",
+ printf("OSPFv%u, %s, length %u",
op->ospf_version,
cp,
length);
@@ -899,18 +1080,23 @@
if (*cp == 'u')
return;
- if(!vflag) /* non verbose - so lets bail out here */
+ if(!vflag) { /* non verbose - so lets bail out here */
return;
+ }
TCHECK(op->ospf_len);
if (length != EXTRACT_16BITS(&op->ospf_len)) {
printf(" [len %d]", EXTRACT_16BITS(&op->ospf_len));
- return;
}
- dataend = bp + length;
+ if (length > EXTRACT_16BITS(&op->ospf_len)) {
+ dataend = bp + EXTRACT_16BITS(&op->ospf_len);
+ } else {
+ dataend = bp + length;
+ }
+
TCHECK(op->ospf_routerid);
- printf("\n\tRouter-ID: %s", ipaddr_string(&op->ospf_routerid));
+ printf("\n\tRouter-ID %s", ipaddr_string(&op->ospf_routerid));
TCHECK(op->ospf_areaid);
if (op->ospf_areaid.s_addr != 0)
@@ -933,7 +1119,7 @@
case OSPF_AUTH_SIMPLE:
printf("\n\tSimple text password: ");
- safeputs(op->ospf_authdata, OSPF_AUTH_SIMPLE_LEN);
+ safeputs((const char *)op->ospf_authdata, OSPF_AUTH_SIMPLE_LEN);
break;
case OSPF_AUTH_MD5:
@@ -954,6 +1140,10 @@
/* ospf version 2 */
if (ospf_decode_v2(op, dataend))
goto trunc;
+ if (length > EXTRACT_16BITS(&op->ospf_len)) {
+ if (ospf_decode_lls(op, length))
+ goto trunc;
+ }
break;
default:
Modified: trunk/contrib/tcpdump/print-ospf6.c
===================================================================
--- trunk/contrib/tcpdump/print-ospf6.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ospf6.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ospf6.c,v 1.1.1.2 2006-02-25 02:34:03 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ospf6.c,v 1.15 2006-09-13 06:31:11 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -39,189 +39,121 @@
#include "addrtoname.h"
#include "extract.h"
+#include "ospf.h"
#include "ospf6.h"
-struct bits {
- u_int32_t bit;
- const char *str;
+static const struct tok ospf6_option_values[] = {
+ { OSPF6_OPTION_V6, "V6" },
+ { OSPF6_OPTION_E, "External" },
+ { OSPF6_OPTION_MC, "Multicast" },
+ { OSPF6_OPTION_N, "NSSA" },
+ { OSPF6_OPTION_R, "Router" },
+ { OSPF6_OPTION_DC, "Demand Circuit" },
+ { 0, NULL }
};
-static const struct bits ospf6_option_bits[] = {
- { OSPF6_OPTION_V6, "V6" },
- { OSPF6_OPTION_E, "E" },
- { OSPF6_OPTION_MC, "MC" },
- { OSPF6_OPTION_N, "N" },
- { OSPF6_OPTION_R, "R" },
- { OSPF6_OPTION_DC, "DC" },
+static const struct tok ospf6_rla_flag_values[] = {
+ { RLA_FLAG_B, "ABR" },
+ { RLA_FLAG_E, "External" },
+ { RLA_FLAG_V, "Virtual-Link Endpoint" },
+ { RLA_FLAG_W, "Wildcard Receiver" },
+ { RLA_FLAG_N, "NSSA Translator" },
{ 0, NULL }
};
-static const struct bits ospf6_rla_flag_bits[] = {
- { RLA_FLAG_B, "B" },
- { RLA_FLAG_E, "E" },
- { RLA_FLAG_V, "V" },
- { RLA_FLAG_W, "W" },
+static const struct tok ospf6_asla_flag_values[] = {
+ { ASLA_FLAG_EXTERNAL, "External Type 2" },
+ { ASLA_FLAG_FWDADDR, "Fforwarding" },
+ { ASLA_FLAG_ROUTETAG, "Tag" },
{ 0, NULL }
};
-static const struct bits ospf6_asla_flag_bits[] = {
- { ASLA_FLAG_EXTERNAL, "E" },
- { ASLA_FLAG_FWDADDR, "F" },
- { ASLA_FLAG_ROUTETAG, "T" },
+static struct tok ospf6_type_values[] = {
+ { OSPF_TYPE_HELLO, "Hello" },
+ { OSPF_TYPE_DD, "Database Description" },
+ { OSPF_TYPE_LS_REQ, "LS-Request" },
+ { OSPF_TYPE_LS_UPDATE, "LS-Update" },
+ { OSPF_TYPE_LS_ACK, "LS-Ack" },
{ 0, NULL }
};
-static struct tok type2str[] = {
- { OSPF_TYPE_UMD, "umd" },
- { OSPF_TYPE_HELLO, "hello" },
- { OSPF_TYPE_DB, "dd" },
- { OSPF_TYPE_LSR, "ls_req" },
- { OSPF_TYPE_LSU, "ls_upd" },
- { OSPF_TYPE_LSA, "ls_ack" },
+static struct tok ospf6_lsa_values[] = {
+ { LS_TYPE_ROUTER, "Router" },
+ { LS_TYPE_NETWORK, "Network" },
+ { LS_TYPE_INTER_AP, "Inter-Area Prefix" },
+ { LS_TYPE_INTER_AR, "Inter-Area Router" },
+ { LS_TYPE_ASE, "External" },
+ { LS_TYPE_GROUP, "Multicast Group" },
+ { LS_TYPE_NSSA, "NSSA" },
+ { LS_TYPE_LINK, "Link" },
+ { LS_TYPE_INTRA_AP, "Intra-Area Prefix" },
+ { LS_TYPE_INTRA_ATE, "Intra-Area TE" },
+ { LS_TYPE_GRACE, "Grace" },
{ 0, NULL }
};
-static char tstr[] = " [|ospf]";
+static struct tok ospf6_ls_scope_values[] = {
+ { LS_SCOPE_LINKLOCAL, "Link Local" },
+ { LS_SCOPE_AREA, "Area Local" },
+ { LS_SCOPE_AS, "Domain Wide" },
+ { 0, NULL }
+};
+static struct tok ospf6_dd_flag_values[] = {
+ { OSPF6_DB_INIT, "Init" },
+ { OSPF6_DB_MORE, "More" },
+ { OSPF6_DB_MASTER, "Master" },
+ { 0, NULL }
+};
+
+static struct tok ospf6_lsa_prefix_option_values[] = {
+ { LSA_PREFIX_OPT_NU, "No Unicast" },
+ { LSA_PREFIX_OPT_LA, "Local address" },
+ { LSA_PREFIX_OPT_MC, "Multicast" },
+ { LSA_PREFIX_OPT_P, "Propagate" },
+ { LSA_PREFIX_OPT_DN, "Down" },
+ { 0, NULL }
+};
+
+static char tstr[] = " [|ospf3]";
+
#ifdef WIN32
#define inline __inline
#endif /* WIN32 */
/* Forwards */
-static inline void ospf6_print_seqage(u_int32_t, time_t);
-static inline void ospf6_print_bits(const struct bits *, u_char);
-static void ospf6_print_ls_type(u_int, const rtrid_t *,
- const rtrid_t *, const char *);
-static int ospf6_print_lshdr(const struct lsa_hdr *);
-static int ospf6_print_lsa(const struct lsa *);
+static void ospf6_print_ls_type(u_int, const rtrid_t *);
+static int ospf6_print_lshdr(const struct lsa6_hdr *);
+static int ospf6_print_lsa(const struct lsa6 *);
static int ospf6_decode_v3(const struct ospf6hdr *, const u_char *);
-static inline void
-ospf6_print_seqage(register u_int32_t seq, register time_t us)
-{
- register time_t sec = us % 60;
- register time_t mins = (us / 60) % 60;
- register time_t hour = us / 3600;
- printf(" S %X age ", seq);
- if (hour)
- printf("%u:%02u:%02u",
- (u_int32_t) hour, (u_int32_t) mins, (u_int32_t) sec);
- else if (mins)
- printf("%u:%02u", (u_int32_t) mins, (u_int32_t) sec);
- else
- printf("%u", (u_int32_t) sec);
-}
-
-
-static inline void
-ospf6_print_bits(register const struct bits *bp, register u_char options)
-{
- register char sep = ' ';
-
- do {
- if (options & bp->bit) {
- printf("%c%s", sep, bp->str);
- sep = '/';
- }
- } while ((++bp)->bit);
-}
-
static void
-ospf6_print_ls_type(register u_int ls_type,
- register const rtrid_t *ls_stateid,
- register const rtrid_t *ls_router, register const char *fmt)
+ospf6_print_ls_type(register u_int ls_type, register const rtrid_t *ls_stateid)
{
- const char *scope;
-
- switch (ls_type & LS_SCOPE_MASK) {
- case LS_SCOPE_LINKLOCAL:
- scope = "linklocal-";
- break;
- case LS_SCOPE_AREA:
- scope = "area-";
- break;
- case LS_SCOPE_AS:
- scope = "AS-";
- break;
- default:
- scope = "";
- break;
- }
-
- switch (ls_type & LS_TYPE_MASK) {
- case LS_TYPE_ROUTER:
- printf(" %srtr %s", scope, ipaddr_string(ls_router));
- break;
-
- case LS_TYPE_NETWORK:
- printf(" %snet dr %s if %s", scope,
- ipaddr_string(ls_router),
- ipaddr_string(ls_stateid));
- break;
-
- case LS_TYPE_INTER_AP:
- printf(" %sinter-area-prefix %s abr %s", scope,
- ipaddr_string(ls_stateid),
- ipaddr_string(ls_router));
- break;
-
- case LS_TYPE_INTER_AR:
- printf(" %sinter-area-router %s rtr %s", scope,
- ipaddr_string(ls_router),
- ipaddr_string(ls_stateid));
- break;
-
- case LS_TYPE_ASE:
- printf(" %sase %s asbr %s", scope,
- ipaddr_string(ls_stateid),
- ipaddr_string(ls_router));
- break;
-
- case LS_TYPE_GROUP:
- printf(" %sgroup %s rtr %s", scope,
- ipaddr_string(ls_stateid),
- ipaddr_string(ls_router));
- break;
-
- case LS_TYPE_TYPE7:
- printf(" %stype7 %s rtr %s", scope,
- ipaddr_string(ls_stateid),
- ipaddr_string(ls_router));
- break;
-
- case LS_TYPE_LINK:
- printf(" %slink %s rtr %s", scope,
- ipaddr_string(ls_stateid),
- ipaddr_string(ls_router));
- break;
-
- case LS_TYPE_INTRA_AP:
- printf(" %sintra-area-prefix %s rtr %s", scope,
- ipaddr_string(ls_stateid),
- ipaddr_string(ls_router));
- break;
-
- default:
- printf(" %s", scope);
- printf(fmt, ls_type);
- break;
- }
-
+ printf("\n\t %s LSA (%d), %s Scope%s, LSA-ID %s",
+ tok2str(ospf6_lsa_values, "Unknown", ls_type & LS_TYPE_MASK),
+ ls_type & LS_TYPE_MASK,
+ tok2str(ospf6_ls_scope_values, "Unknown", ls_type & LS_SCOPE_MASK),
+ ls_type &0x8000 ? ", transitive" : "", /* U-bit */
+ ipaddr_string(ls_stateid));
}
static int
-ospf6_print_lshdr(register const struct lsa_hdr *lshp)
+ospf6_print_lshdr(register const struct lsa6_hdr *lshp)
{
TCHECK(lshp->ls_type);
- printf(" {"); /* } (ctags) */
-
TCHECK(lshp->ls_seq);
- ospf6_print_seqage(EXTRACT_32BITS(&lshp->ls_seq), EXTRACT_16BITS(&lshp->ls_age));
- ospf6_print_ls_type(EXTRACT_16BITS(&lshp->ls_type), &lshp->ls_stateid,
- &lshp->ls_router, "ls_type %d");
+ printf("\n\t Advertising Router %s, seq 0x%08x, age %us, length %u",
+ ipaddr_string(&lshp->ls_router),
+ EXTRACT_32BITS(&lshp->ls_seq),
+ EXTRACT_16BITS(&lshp->ls_age),
+ EXTRACT_16BITS(&lshp->ls_length)-(u_int)sizeof(struct lsa6_hdr));
+
+ ospf6_print_ls_type(EXTRACT_16BITS(&lshp->ls_type), &lshp->ls_stateid);
+
return (0);
trunc:
return (1);
@@ -228,26 +160,36 @@
}
static int
-ospf6_print_lsaprefix(register const struct lsa_prefix *lsapp)
+ospf6_print_lsaprefix(const u_int8_t *tptr, u_int lsa_length)
{
- u_int k;
+ const struct lsa6_prefix *lsapp = (struct lsa6_prefix *)tptr;
+ u_int wordlen;
struct in6_addr prefix;
- TCHECK(*lsapp);
- k = (lsapp->lsa_p_len + 31) / 32;
- if (k * 4 > sizeof(struct in6_addr)) {
- printf("??prefixlen %d??", lsapp->lsa_p_len);
+ if (lsa_length < sizeof (*lsapp) - 4)
goto trunc;
+ lsa_length -= sizeof (*lsapp) - 4;
+ TCHECK2(*lsapp, sizeof (*lsapp) - 4);
+ wordlen = (lsapp->lsa_p_len + 31) / 32;
+ if (wordlen * 4 > sizeof(struct in6_addr)) {
+ printf(" bogus prefixlen /%d", lsapp->lsa_p_len);
+ goto trunc;
}
+ if (lsa_length < wordlen * 4)
+ goto trunc;
+ lsa_length -= wordlen * 4;
+ TCHECK2(lsapp->lsa_p_prefix, wordlen * 4);
memset(&prefix, 0, sizeof(prefix));
- memcpy(&prefix, lsapp->lsa_p_prefix, k * 4);
- printf(" %s/%d", ip6addr_string(&prefix),
+ memcpy(&prefix, lsapp->lsa_p_prefix, wordlen * 4);
+ printf("\n\t\t%s/%d", ip6addr_string(&prefix),
lsapp->lsa_p_len);
- if (lsapp->lsa_p_opt)
- printf("(opt=%x)", lsapp->lsa_p_opt);
- if (lsapp->lsa_p_mbz)
- printf("(mbz=%x)", EXTRACT_16BITS(&lsapp->lsa_p_mbz)); /* XXX */
- return sizeof(*lsapp) - 4 + k * 4;
+ if (lsapp->lsa_p_opt) {
+ printf(", Options [%s]",
+ bittok2str(ospf6_lsa_prefix_option_values,
+ "none", lsapp->lsa_p_opt));
+ }
+ printf(", metric %u", EXTRACT_16BITS(&lsapp->lsa_p_metric));
+ return sizeof(*lsapp) - 4 + wordlen * 4;
trunc:
return -1;
@@ -258,10 +200,9 @@
* Print a single link state advertisement. If truncated return 1, else 0.
*/
static int
-ospf6_print_lsa(register const struct lsa *lsap)
+ospf6_print_lsa(register const struct lsa6 *lsap)
{
- register const u_char *ls_end, *ls_opt;
- register const struct rlalink *rlp;
+ register const struct rlalink6 *rlp;
#if 0
register const struct tos_metric *tosp;
#endif
@@ -271,47 +212,72 @@
register const struct mcla *mcp;
#endif
register const struct llsa *llsap;
- register const struct lsa_prefix *lsapp;
+ register const struct lsa6_prefix *lsapp;
#if 0
register const u_int32_t *lp;
#endif
- register u_int j;
- register int k;
+ register u_int prefixes;
+ register int bytelen;
+ register u_int length, lsa_length;
u_int32_t flags32;
+ const u_int8_t *tptr;
if (ospf6_print_lshdr(&lsap->ls_hdr))
return (1);
TCHECK(lsap->ls_hdr.ls_length);
- ls_end = (u_char *)lsap + EXTRACT_16BITS(&lsap->ls_hdr.ls_length);
+ length = EXTRACT_16BITS(&lsap->ls_hdr.ls_length);
+
+ /*
+ * The LSA length includes the length of the header;
+ * it must have a value that's at least that length.
+ * If it does, find the length of what follows the
+ * header.
+ */
+ if (length < sizeof(struct lsa6_hdr))
+ return (1);
+ lsa_length = length - sizeof(struct lsa6_hdr);
+ tptr = (u_int8_t *)lsap+sizeof(struct lsa6_hdr);
+
switch (EXTRACT_16BITS(&lsap->ls_hdr.ls_type)) {
case LS_TYPE_ROUTER | LS_SCOPE_AREA:
- TCHECK(lsap->lsa_un.un_rla.rla_flags);
- ospf6_print_bits(ospf6_rla_flag_bits,
- lsap->lsa_un.un_rla.rla_flags);
+ if (lsa_length < sizeof (lsap->lsa_un.un_rla.rla_options))
+ return (1);
+ lsa_length -= sizeof (lsap->lsa_un.un_rla.rla_options);
TCHECK(lsap->lsa_un.un_rla.rla_options);
- ospf6_print_bits(ospf6_option_bits,
- EXTRACT_32BITS(&lsap->lsa_un.un_rla.rla_options));
+ printf("\n\t Options [%s]",
+ bittok2str(ospf6_option_values, "none",
+ EXTRACT_32BITS(&lsap->lsa_un.un_rla.rla_options)));
+ printf(", RLA-Flags [%s]",
+ bittok2str(ospf6_rla_flag_values, "none",
+ lsap->lsa_un.un_rla.rla_flags));
- TCHECK(lsap->lsa_un.un_rla.rla_link);
rlp = lsap->lsa_un.un_rla.rla_link;
- while (rlp + sizeof(*rlp) <= (struct rlalink *)ls_end) {
+ while (lsa_length != 0) {
+ if (lsa_length < sizeof (*rlp))
+ return (1);
+ lsa_length -= sizeof (*rlp);
TCHECK(*rlp);
- printf(" {"); /* } (ctags) */
switch (rlp->link_type) {
case RLA_TYPE_VIRTUAL:
- printf(" virt");
- /* Fall through */
+ printf("\n\t Virtual Link: Neighbor Router-ID %s"
+ "\n\t Neighbor Interface-ID %s, Interface %s",
+ ipaddr_string(&rlp->link_nrtid),
+ ipaddr_string(&rlp->link_nifid),
+ ipaddr_string(&rlp->link_ifid));
+ break;
case RLA_TYPE_ROUTER:
- printf(" nbrid %s nbrif %s if %s",
- ipaddr_string(&rlp->link_nrtid),
- ipaddr_string(&rlp->link_nifid),
- ipaddr_string(&rlp->link_ifid));
+ printf("\n\t Neighbor Router-ID %s"
+ "\n\t Neighbor Interface-ID %s, Interface %s",
+ ipaddr_string(&rlp->link_nrtid),
+ ipaddr_string(&rlp->link_nifid),
+ ipaddr_string(&rlp->link_ifid));
break;
case RLA_TYPE_TRANSIT:
- printf(" dr %s drif %s if %s",
+ printf("\n\t Neighbor Network-ID %s"
+ "\n\t Neighbor Interface-ID %s, Interface %s",
ipaddr_string(&rlp->link_nrtid),
ipaddr_string(&rlp->link_nifid),
ipaddr_string(&rlp->link_ifid));
@@ -318,176 +284,190 @@
break;
default:
- /* { (ctags) */
- printf(" ??RouterLinksType 0x%02x?? }",
+ printf("\n\t Unknown Router Links Type 0x%02x",
rlp->link_type);
return (0);
}
- printf(" metric %d", EXTRACT_16BITS(&rlp->link_metric));
- /* { (ctags) */
- printf(" }");
+ printf(", metric %d", EXTRACT_16BITS(&rlp->link_metric));
rlp++;
}
break;
case LS_TYPE_NETWORK | LS_SCOPE_AREA:
+ if (lsa_length < sizeof (lsap->lsa_un.un_nla.nla_options))
+ return (1);
+ lsa_length -= sizeof (lsap->lsa_un.un_nla.nla_options);
TCHECK(lsap->lsa_un.un_nla.nla_options);
- ospf6_print_bits(ospf6_option_bits,
- EXTRACT_32BITS(&lsap->lsa_un.un_nla.nla_options));
- printf(" rtrs");
+ printf("\n\t Options [%s]",
+ bittok2str(ospf6_option_values, "none",
+ EXTRACT_32BITS(&lsap->lsa_un.un_nla.nla_options)));
+
+ printf("\n\t Connected Routers:");
ap = lsap->lsa_un.un_nla.nla_router;
- while ((u_char *)ap < ls_end) {
+ while (lsa_length != 0) {
+ if (lsa_length < sizeof (*ap))
+ return (1);
+ lsa_length -= sizeof (*ap);
TCHECK(*ap);
- printf(" %s", ipaddr_string(ap));
+ printf("\n\t\t%s", ipaddr_string(ap));
++ap;
}
break;
case LS_TYPE_INTER_AP | LS_SCOPE_AREA:
+ if (lsa_length < sizeof (lsap->lsa_un.un_inter_ap.inter_ap_metric))
+ return (1);
+ lsa_length -= sizeof (lsap->lsa_un.un_inter_ap.inter_ap_metric);
TCHECK(lsap->lsa_un.un_inter_ap.inter_ap_metric);
- printf(" metric %u",
+ printf(", metric %u",
EXTRACT_32BITS(&lsap->lsa_un.un_inter_ap.inter_ap_metric) & SLA_MASK_METRIC);
- lsapp = lsap->lsa_un.un_inter_ap.inter_ap_prefix;
- while (lsapp + sizeof(lsapp) <= (struct lsa_prefix *)ls_end) {
- k = ospf6_print_lsaprefix(lsapp);
- if (k)
+
+ tptr = (u_int8_t *)lsap->lsa_un.un_inter_ap.inter_ap_prefix;
+ while (lsa_length != 0) {
+ bytelen = ospf6_print_lsaprefix(tptr, lsa_length);
+ if (bytelen < 0)
goto trunc;
- lsapp = (struct lsa_prefix *)(((u_char *)lsapp) + k);
+ lsa_length -= bytelen;
+ tptr += bytelen;
}
break;
- case LS_SCOPE_AS | LS_TYPE_ASE:
+
+ case LS_TYPE_ASE | LS_SCOPE_AS:
+ if (lsa_length < sizeof (lsap->lsa_un.un_asla.asla_metric))
+ return (1);
+ lsa_length -= sizeof (lsap->lsa_un.un_asla.asla_metric);
TCHECK(lsap->lsa_un.un_asla.asla_metric);
flags32 = EXTRACT_32BITS(&lsap->lsa_un.un_asla.asla_metric);
- ospf6_print_bits(ospf6_asla_flag_bits, flags32);
+ printf("\n\t Flags [%s]",
+ bittok2str(ospf6_asla_flag_values, "none", flags32));
printf(" metric %u",
EXTRACT_32BITS(&lsap->lsa_un.un_asla.asla_metric) &
ASLA_MASK_METRIC);
- lsapp = lsap->lsa_un.un_asla.asla_prefix;
- k = ospf6_print_lsaprefix(lsapp);
- if (k < 0)
+
+ tptr = (u_int8_t *)lsap->lsa_un.un_asla.asla_prefix;
+ lsapp = (struct lsa6_prefix *)tptr;
+ bytelen = ospf6_print_lsaprefix(tptr, lsa_length);
+ if (bytelen < 0)
goto trunc;
- if ((ls_opt = (u_char *)(((u_char *)lsapp) + k)) < ls_end) {
+ lsa_length -= bytelen;
+ tptr += bytelen;
+
+ if ((flags32 & ASLA_FLAG_FWDADDR) != 0) {
struct in6_addr *fwdaddr6;
- if ((flags32 & ASLA_FLAG_FWDADDR) != 0) {
- fwdaddr6 = (struct in6_addr *)ls_opt;
- TCHECK(*fwdaddr6);
- printf(" forward %s",
- ip6addr_string(fwdaddr6));
+ fwdaddr6 = (struct in6_addr *)tptr;
+ if (lsa_length < sizeof (*fwdaddr6))
+ return (1);
+ lsa_length -= sizeof (*fwdaddr6);
+ TCHECK(*fwdaddr6);
+ printf(" forward %s",
+ ip6addr_string(fwdaddr6));
+ tptr += sizeof(*fwdaddr6);
+ }
- ls_opt += sizeof(struct in6_addr);
- }
-
- if ((flags32 & ASLA_FLAG_ROUTETAG) != 0) {
- TCHECK(*(u_int32_t *)ls_opt);
- printf(" tag %s",
- ipaddr_string((u_int32_t *)ls_opt));
-
- ls_opt += sizeof(u_int32_t);
- }
-
- if (lsapp->lsa_p_mbz) {
- TCHECK(*(u_int32_t *)ls_opt);
- printf(" RefLSID: %s",
- ipaddr_string((u_int32_t *)ls_opt));
-
- ls_opt += sizeof(u_int32_t);
- }
+ if ((flags32 & ASLA_FLAG_ROUTETAG) != 0) {
+ if (lsa_length < sizeof (u_int32_t))
+ return (1);
+ lsa_length -= sizeof (u_int32_t);
+ TCHECK(*(u_int32_t *)tptr);
+ printf(" tag %s",
+ ipaddr_string((u_int32_t *)tptr));
+ tptr += sizeof(u_int32_t);
}
- break;
-#if 0
- case LS_TYPE_SUM_ABR:
- TCHECK(lsap->lsa_un.un_sla.sla_tosmetric);
- lp = lsap->lsa_un.un_sla.sla_tosmetric;
- while ((u_char *)lp < ls_end) {
- register u_int32_t ul;
- TCHECK(*lp);
- ul = EXTRACT_32BITS(lp);
- printf(" tos %d metric %d",
- (ul & SLA_MASK_TOS) >> SLA_SHIFT_TOS,
- ul & SLA_MASK_METRIC);
- ++lp;
+ if (lsapp->lsa_p_metric) {
+ if (lsa_length < sizeof (u_int32_t))
+ return (1);
+ lsa_length -= sizeof (u_int32_t);
+ TCHECK(*(u_int32_t *)tptr);
+ printf(" RefLSID: %s",
+ ipaddr_string((u_int32_t *)tptr));
+ tptr += sizeof(u_int32_t);
}
break;
- case LS_TYPE_GROUP:
- /* Multicast extensions as of 23 July 1991 */
- mcp = lsap->lsa_un.un_mcla;
- while ((u_char *)mcp < ls_end) {
- TCHECK(mcp->mcla_vid);
- switch (EXTRACT_32BITS(&mcp->mcla_vtype)) {
-
- case MCLA_VERTEX_ROUTER:
- printf(" rtr rtrid %s",
- ipaddr_string(&mcp->mcla_vid));
- break;
-
- case MCLA_VERTEX_NETWORK:
- printf(" net dr %s",
- ipaddr_string(&mcp->mcla_vid));
- break;
-
- default:
- printf(" ??VertexType %u??",
- EXTRACT_32BITS(&mcp->mcla_vtype));
- break;
- }
- ++mcp;
- }
-#endif
-
case LS_TYPE_LINK:
/* Link LSA */
llsap = &lsap->lsa_un.un_llsa;
- TCHECK(llsap->llsa_options);
- ospf6_print_bits(ospf6_option_bits, EXTRACT_32BITS(&llsap->llsa_options));
- TCHECK(llsap->llsa_nprefix);
- printf(" pri %d lladdr %s npref %d", llsap->llsa_priority,
- ip6addr_string(&llsap->llsa_lladdr),
- EXTRACT_32BITS(&llsap->llsa_nprefix));
- lsapp = llsap->llsa_prefix;
- for (j = 0; j < EXTRACT_32BITS(&llsap->llsa_nprefix); j++) {
- k = ospf6_print_lsaprefix(lsapp);
- if (k)
+ if (lsa_length < sizeof (llsap->llsa_priandopt))
+ return (1);
+ lsa_length -= sizeof (llsap->llsa_priandopt);
+ TCHECK(llsap->llsa_priandopt);
+ printf("\n\t Options [%s]",
+ bittok2str(ospf6_option_values, "none",
+ EXTRACT_32BITS(&llsap->llsa_options)));
+
+ if (lsa_length < sizeof (llsap->llsa_lladdr) + sizeof (llsap->llsa_nprefix))
+ return (1);
+ lsa_length -= sizeof (llsap->llsa_lladdr) + sizeof (llsap->llsa_nprefix);
+ prefixes = EXTRACT_32BITS(&llsap->llsa_nprefix);
+ printf("\n\t Priority %d, Link-local address %s, Prefixes %d:",
+ llsap->llsa_priority,
+ ip6addr_string(&llsap->llsa_lladdr),
+ prefixes);
+
+ tptr = (u_int8_t *)llsap->llsa_prefix;
+ while (prefixes > 0) {
+ bytelen = ospf6_print_lsaprefix(tptr, lsa_length);
+ if (bytelen < 0)
goto trunc;
- lsapp = (struct lsa_prefix *)(((u_char *)lsapp) + k);
+ prefixes--;
+ lsa_length -= bytelen;
+ tptr += bytelen;
}
break;
case LS_TYPE_INTRA_AP | LS_SCOPE_AREA:
/* Intra-Area-Prefix LSA */
+ if (lsa_length < sizeof (lsap->lsa_un.un_intra_ap.intra_ap_rtid))
+ return (1);
+ lsa_length -= sizeof (lsap->lsa_un.un_intra_ap.intra_ap_rtid);
TCHECK(lsap->lsa_un.un_intra_ap.intra_ap_rtid);
ospf6_print_ls_type(
EXTRACT_16BITS(&lsap->lsa_un.un_intra_ap.intra_ap_lstype),
- &lsap->lsa_un.un_intra_ap.intra_ap_lsid,
- &lsap->lsa_un.un_intra_ap.intra_ap_rtid,
- "LinkStateType %d");
+ &lsap->lsa_un.un_intra_ap.intra_ap_lsid);
+
+ if (lsa_length < sizeof (lsap->lsa_un.un_intra_ap.intra_ap_nprefix))
+ return (1);
+ lsa_length -= sizeof (lsap->lsa_un.un_intra_ap.intra_ap_nprefix);
TCHECK(lsap->lsa_un.un_intra_ap.intra_ap_nprefix);
- printf(" npref %d",
- EXTRACT_16BITS(&lsap->lsa_un.un_intra_ap.intra_ap_nprefix));
+ prefixes = EXTRACT_16BITS(&lsap->lsa_un.un_intra_ap.intra_ap_nprefix);
+ printf("\n\t Prefixes %d:", prefixes);
- lsapp = lsap->lsa_un.un_intra_ap.intra_ap_prefix;
- for (j = 0;
- j < EXTRACT_16BITS(&lsap->lsa_un.un_intra_ap.intra_ap_nprefix);
- j++) {
- k = ospf6_print_lsaprefix(lsapp);
- if (k)
+ tptr = (u_int8_t *)lsap->lsa_un.un_intra_ap.intra_ap_prefix;
+ while (prefixes > 0) {
+ bytelen = ospf6_print_lsaprefix(tptr, lsa_length);
+ if (bytelen < 0)
goto trunc;
- lsapp = (struct lsa_prefix *)(((u_char *)lsapp) + k);
+ prefixes--;
+ lsa_length -= bytelen;
+ tptr += bytelen;
}
break;
+ case LS_TYPE_GRACE | LS_SCOPE_LINKLOCAL:
+ if (ospf_print_grace_lsa(tptr, lsa_length) == -1) {
+ return 1;
+ }
+ break;
+
+ case LS_TYPE_INTRA_ATE | LS_SCOPE_LINKLOCAL:
+ if (ospf_print_te_lsa(tptr, lsa_length) == -1) {
+ return 1;
+ }
+ break;
+
default:
- printf(" ??LinkStateType 0x%04x??",
- EXTRACT_16BITS(&lsap->ls_hdr.ls_type));
+ if(!print_unknown_data(tptr,
+ "\n\t ",
+ lsa_length)) {
+ return (1);
+ }
+ break;
}
- /* { (ctags) */
- fputs(" }", stdout);
return (0);
trunc:
- fputs(" }", stdout);
return (1);
}
@@ -496,103 +476,80 @@
register const u_char *dataend)
{
register const rtrid_t *ap;
- register const struct lsr *lsrp;
- register const struct lsa_hdr *lshp;
- register const struct lsa *lsap;
- register char sep;
+ register const struct lsr6 *lsrp;
+ register const struct lsa6_hdr *lshp;
+ register const struct lsa6 *lsap;
register int i;
switch (op->ospf6_type) {
- case OSPF_TYPE_UMD:
- /*
- * Rob Coltun's special monitoring packets;
- * do nothing
- */
- break;
+ case OSPF_TYPE_HELLO:
+ printf("\n\tOptions [%s]",
+ bittok2str(ospf6_option_values, "none",
+ EXTRACT_32BITS(&op->ospf6_hello.hello_options)));
- case OSPF_TYPE_HELLO:
- if (vflag) {
- TCHECK(op->ospf6_hello.hello_deadint);
- ospf6_print_bits(ospf6_option_bits,
- EXTRACT_32BITS(&op->ospf6_hello.hello_options));
- printf(" ifid %s pri %d int %d dead %u",
- ipaddr_string(&op->ospf6_hello.hello_ifid),
- op->ospf6_hello.hello_priority,
- EXTRACT_16BITS(&op->ospf6_hello.hello_helloint),
- EXTRACT_16BITS(&op->ospf6_hello.hello_deadint));
- }
+ TCHECK(op->ospf6_hello.hello_deadint);
+ printf("\n\t Hello Timer %us, Dead Timer %us, Interface-ID %s, Priority %u",
+ EXTRACT_16BITS(&op->ospf6_hello.hello_helloint),
+ EXTRACT_16BITS(&op->ospf6_hello.hello_deadint),
+ ipaddr_string(&op->ospf6_hello.hello_ifid),
+ op->ospf6_hello.hello_priority);
+
TCHECK(op->ospf6_hello.hello_dr);
if (op->ospf6_hello.hello_dr != 0)
- printf(" dr %s",
+ printf("\n\t Designated Router %s",
ipaddr_string(&op->ospf6_hello.hello_dr));
TCHECK(op->ospf6_hello.hello_bdr);
if (op->ospf6_hello.hello_bdr != 0)
- printf(" bdr %s",
+ printf(", Backup Designated Router %s",
ipaddr_string(&op->ospf6_hello.hello_bdr));
if (vflag) {
- printf(" nbrs");
+ printf("\n\t Neighbor List:");
ap = op->ospf6_hello.hello_neighbor;
while ((u_char *)ap < dataend) {
TCHECK(*ap);
- printf(" %s", ipaddr_string(ap));
+ printf("\n\t %s", ipaddr_string(ap));
++ap;
}
}
break; /* HELLO */
- case OSPF_TYPE_DB:
+ case OSPF_TYPE_DD:
TCHECK(op->ospf6_db.db_options);
- ospf6_print_bits(ospf6_option_bits,
- EXTRACT_32BITS(&op->ospf6_db.db_options));
- sep = ' ';
+ printf("\n\tOptions [%s]",
+ bittok2str(ospf6_option_values, "none",
+ EXTRACT_32BITS(&op->ospf6_db.db_options)));
TCHECK(op->ospf6_db.db_flags);
- if (op->ospf6_db.db_flags & OSPF6_DB_INIT) {
- printf("%cI", sep);
- sep = '/';
- }
- if (op->ospf6_db.db_flags & OSPF6_DB_MORE) {
- printf("%cM", sep);
- sep = '/';
- }
- if (op->ospf6_db.db_flags & OSPF6_DB_MASTER) {
- printf("%cMS", sep);
- sep = '/';
- }
+ printf(", DD Flags [%s]",
+ bittok2str(ospf6_dd_flag_values,"none",op->ospf6_db.db_flags));
+
TCHECK(op->ospf6_db.db_seq);
- printf(" mtu %u S %X", EXTRACT_16BITS(&op->ospf6_db.db_mtu),
- EXTRACT_32BITS(&op->ospf6_db.db_seq));
+ printf(", MTU %u, DD-Sequence 0x%08x",
+ EXTRACT_16BITS(&op->ospf6_db.db_mtu),
+ EXTRACT_32BITS(&op->ospf6_db.db_seq));
- if (vflag) {
- /* Print all the LS adv's */
- lshp = op->ospf6_db.db_lshdr;
-
- while (!ospf6_print_lshdr(lshp)) {
- /* { (ctags) */
- printf(" }");
- ++lshp;
- }
- }
+ /* Print all the LS adv's */
+ lshp = op->ospf6_db.db_lshdr;
+ while (!ospf6_print_lshdr(lshp)) {
+ ++lshp;
+ }
break;
- case OSPF_TYPE_LSR:
+ case OSPF_TYPE_LS_REQ:
if (vflag) {
lsrp = op->ospf6_lsr;
while ((u_char *)lsrp < dataend) {
TCHECK(*lsrp);
- printf(" {"); /* } (ctags) */
+ printf("\n\t Advertising Router %s",
+ ipaddr_string(&lsrp->ls_router));
ospf6_print_ls_type(EXTRACT_16BITS(&lsrp->ls_type),
- &lsrp->ls_stateid,
- &lsrp->ls_router,
- "LinkStateType %d");
- /* { (ctags) */
- printf(" }");
+ &lsrp->ls_stateid);
++lsrp;
}
}
break;
- case OSPF_TYPE_LSU:
+ case OSPF_TYPE_LS_UPDATE:
if (vflag) {
lsap = op->ospf6_lsu.lsu_lsa;
TCHECK(op->ospf6_lsu.lsu_count);
@@ -600,7 +557,7 @@
while (i--) {
if (ospf6_print_lsa(lsap))
goto trunc;
- lsap = (struct lsa *)((u_char *)lsap +
+ lsap = (struct lsa6 *)((u_char *)lsap +
EXTRACT_16BITS(&lsap->ls_hdr.ls_length));
}
}
@@ -607,13 +564,11 @@
break;
- case OSPF_TYPE_LSA:
+ case OSPF_TYPE_LS_ACK:
if (vflag) {
lshp = op->ospf6_lsa.lsa_lshdr;
while (!ospf6_print_lshdr(lshp)) {
- /* { (ctags) */
- printf(" }");
++lshp;
}
}
@@ -620,7 +575,6 @@
break;
default:
- printf("v3 type %d", op->ospf6_type);
break;
}
return (0);
@@ -640,11 +594,16 @@
/* If the type is valid translate it, or just print the type */
/* value. If it's not valid, say so and return */
TCHECK(op->ospf6_type);
- cp = tok2str(type2str, "type%d", op->ospf6_type);
- printf("OSPFv%d-%s %d:", op->ospf6_version, cp, length);
- if (*cp == 't')
+ cp = tok2str(ospf6_type_values, "unknown LS-type", op->ospf6_type);
+ printf("OSPFv%u, %s, length %d", op->ospf6_version, cp, length);
+ if (*cp == 'u') {
return;
+ }
+ if(!vflag) { /* non verbose - so lets bail out here */
+ return;
+ }
+
TCHECK(op->ospf6_len);
if (length != EXTRACT_16BITS(&op->ospf6_len)) {
printf(" [len %d]", EXTRACT_16BITS(&op->ospf6_len));
@@ -654,16 +613,16 @@
/* Print the routerid if it is not the same as the source */
TCHECK(op->ospf6_routerid);
- printf(" rtrid %s", ipaddr_string(&op->ospf6_routerid));
+ printf("\n\tRouter-ID %s", ipaddr_string(&op->ospf6_routerid));
TCHECK(op->ospf6_areaid);
if (op->ospf6_areaid != 0)
- printf(" area %s", ipaddr_string(&op->ospf6_areaid));
+ printf(", Area %s", ipaddr_string(&op->ospf6_areaid));
else
- printf(" backbone");
+ printf(", Backbone Area");
TCHECK(op->ospf6_instanceid);
if (op->ospf6_instanceid)
- printf(" instance %u", op->ospf6_instanceid);
+ printf(", Instance %u", op->ospf6_instanceid);
/* Do rest according to version. */
switch (op->ospf6_version) {
Added: trunk/contrib/tcpdump/print-otv.c
===================================================================
--- trunk/contrib/tcpdump/print-otv.c (rev 0)
+++ trunk/contrib/tcpdump/print-otv.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,79 @@
+/*
+ * 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 Francesco Fondelli (francesco dot fondelli, gmail dot com)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "interface.h"
+#include "extract.h"
+#include "addrtoname.h"
+
+#include "udp.h"
+
+/*
+ * OTV header, draft-hasmit-otv-04
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |R|R|R|R|I|R|R|R| Overlay ID |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Instance ID | Reserved |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+
+void
+otv_print(const u_char *bp, u_int len)
+{
+ u_int8_t flags;
+ u_int32_t overlay_id;
+ u_int32_t instance_id;
+
+ if (len < 8) {
+ printf("[|OTV]");
+ return;
+ }
+
+ flags = *bp;
+ bp += 1;
+
+ overlay_id = EXTRACT_24BITS(bp);
+ bp += 3;
+
+ instance_id = EXTRACT_24BITS(bp);
+ bp += 4;
+
+ printf("OTV, ");
+
+ fputs("flags [", stdout);
+ if (flags & 0x08)
+ fputs("I", stdout);
+ else
+ fputs(".", stdout);
+ fputs("] ", stdout);
+
+ printf("(0x%02x), ", flags);
+ printf("overlay %u, ", overlay_id);
+ printf("instance %u\n", instance_id);
+
+ ether_print(gndo, bp, len - 8, len - 8, NULL, NULL);
+ return;
+}
Property changes on: trunk/contrib/tcpdump/print-otv.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-pflog.c
===================================================================
--- trunk/contrib/tcpdump/print-pflog.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-pflog.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-pflog.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.16 2007-09-12 19:36:18 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -31,22 +31,18 @@
#ifndef HAVE_NET_PFVAR_H
#error "No pf headers available"
#endif
-
#include <sys/types.h>
-#ifndef WIN32
#include <sys/socket.h>
-#endif
#include <net/if.h>
#include <net/pfvar.h>
#include <net/if_pflog.h>
-
-
#include <tcpdump-stdinc.h>
#include <stdio.h>
#include <pcap.h>
+#include "extract.h"
#include "interface.h"
#include "addrtoname.h"
@@ -99,8 +95,8 @@
{
u_int32_t rulenr, subrulenr;
- rulenr = ntohl(hdr->rulenr);
- subrulenr = ntohl(hdr->subrulenr);
+ rulenr = EXTRACT_32BITS(&hdr->rulenr);
+ subrulenr = EXTRACT_32BITS(&hdr->subrulenr);
if (subrulenr == (u_int32_t)-1)
printf("rule %u/", rulenr);
else
@@ -166,7 +162,7 @@
#if OPENBSD_AF_INET6 != AF_INET6
case OPENBSD_AF_INET6: /* XXX: read pcap files */
#endif
- ip6_print(p, length);
+ ip6_print(gndo, p, length);
break;
#endif
Added: trunk/contrib/tcpdump/print-pfsync.c
===================================================================
--- trunk/contrib/tcpdump/print-pfsync.c (rev 0)
+++ trunk/contrib/tcpdump/print-pfsync.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,451 @@
+/*
+ * Copyright (c) 2012 Gleb Smirnoff <glebius at FreeBSD.org>
+ * Copyright (c) 2002 Michael Shalayeff
+ * Copyright (c) 2001 Daniel Hartmeier
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE 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 OR HIS RELATIVES 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 MIND, 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.
+ *
+ * $OpenBSD: print-pfsync.c,v 1.38 2012/09/19 13:50:36 mikeb Exp $
+ * $OpenBSD: pf_print_state.c,v 1.11 2012/07/08 17:48:37 lteo Exp $
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <sys/endian.h>
+#include <net/if.h>
+#define TCPSTATES
+#include <net/pfvar.h> /* XXX */
+#include <net/if_pfsync.h>
+#include <netinet/ip.h>
+#include <netinet/tcp_fsm.h>
+
+#include <string.h>
+
+#include "interface.h"
+#include "addrtoname.h"
+
+static void pfsync_print(struct pfsync_header *, const u_char *, u_int);
+static void print_src_dst(const struct pfsync_state_peer *,
+ const struct pfsync_state_peer *, uint8_t);
+static void print_state(struct pfsync_state *);
+
+#ifdef notyet
+void
+pfsync_if_print(u_char *user, const struct pcap_pkthdr *h,
+ register const u_char *p)
+{
+ u_int caplen = h->caplen;
+
+ ts_print(&h->ts);
+
+ if (caplen < PFSYNC_HDRLEN) {
+ printf("[|pfsync]");
+ goto out;
+ }
+
+ pfsync_print((struct pfsync_header *)p,
+ p + sizeof(struct pfsync_header),
+ caplen - sizeof(struct pfsync_header));
+out:
+ if (xflag) {
+ default_print((const u_char *)p, caplen);
+ }
+ putchar('\n');
+}
+#endif /* notyet */
+
+void
+pfsync_ip_print(const u_char *bp, u_int len)
+{
+ struct pfsync_header *hdr = (struct pfsync_header *)bp;
+
+ if (len < PFSYNC_HDRLEN)
+ printf("[|pfsync]");
+ else
+ pfsync_print(hdr, bp + sizeof(struct pfsync_header),
+ len - sizeof(struct pfsync_header));
+}
+
+struct pfsync_actions {
+ const char *name;
+ size_t len;
+ void (*print)(const void *);
+};
+
+static void pfsync_print_clr(const void *);
+static void pfsync_print_state(const void *);
+static void pfsync_print_ins_ack(const void *);
+static void pfsync_print_upd_c(const void *);
+static void pfsync_print_upd_req(const void *);
+static void pfsync_print_del_c(const void *);
+static void pfsync_print_bus(const void *);
+static void pfsync_print_tdb(const void *);
+
+struct pfsync_actions actions[] = {
+ { "clear all", sizeof(struct pfsync_clr), pfsync_print_clr },
+ { "insert", sizeof(struct pfsync_state), pfsync_print_state },
+ { "insert ack", sizeof(struct pfsync_ins_ack), pfsync_print_ins_ack },
+ { "update", sizeof(struct pfsync_ins_ack), pfsync_print_state },
+ { "update compressed", sizeof(struct pfsync_upd_c),
+ pfsync_print_upd_c },
+ { "request uncompressed", sizeof(struct pfsync_upd_req),
+ pfsync_print_upd_req },
+ { "delete", sizeof(struct pfsync_state), pfsync_print_state },
+ { "delete compressed", sizeof(struct pfsync_del_c),
+ pfsync_print_del_c },
+ { "frag insert", 0, NULL },
+ { "frag delete", 0, NULL },
+ { "bulk update status", sizeof(struct pfsync_bus),
+ pfsync_print_bus },
+ { "tdb", 0, pfsync_print_tdb },
+ { "eof", 0, NULL },
+};
+
+static void
+pfsync_print(struct pfsync_header *hdr, const u_char *bp, u_int len)
+{
+ struct pfsync_subheader *subh;
+ int count, plen, i;
+ u_int alen;
+
+ plen = ntohs(hdr->len);
+
+ printf("PFSYNCv%d len %d", hdr->version, plen);
+
+ if (hdr->version != PFSYNC_VERSION)
+ return;
+
+ plen -= sizeof(*hdr);
+
+ while (plen > 0) {
+ if (len < sizeof(*subh))
+ break;
+
+ subh = (struct pfsync_subheader *)bp;
+ bp += sizeof(*subh);
+ len -= sizeof(*subh);
+ plen -= sizeof(*subh);
+
+ if (subh->action >= PFSYNC_ACT_MAX) {
+ printf("\n act UNKNOWN id %d", subh->action);
+ return;
+ }
+
+ count = ntohs(subh->count);
+ printf("\n %s count %d", actions[subh->action].name, count);
+ alen = actions[subh->action].len;
+
+ if (subh->action == PFSYNC_ACT_EOF)
+ return;
+
+ if (actions[subh->action].print == NULL) {
+ printf("\n unimplemented action %hhu", subh->action);
+ return;
+ }
+
+ for (i = 0; i < count; i++) {
+ if (len < alen) {
+ len = 0;
+ break;
+ }
+
+ if (vflag)
+ actions[subh->action].print(bp);
+
+ bp += alen;
+ len -= alen;
+ plen -= alen;
+ }
+ }
+
+ if (plen > 0) {
+ printf("\n ...");
+ return;
+ }
+ if (plen < 0) {
+ printf("\n invalid header length");
+ return;
+ }
+ if (len > 0)
+ printf("\n invalid packet length");
+}
+
+static void
+pfsync_print_clr(const void *bp)
+{
+ const struct pfsync_clr *clr = bp;
+
+ printf("\n\tcreatorid: %08x", htonl(clr->creatorid));
+ if (clr->ifname[0] != '\0')
+ printf(" interface: %s", clr->ifname);
+}
+
+static void
+pfsync_print_state(const void *bp)
+{
+ struct pfsync_state *st = (struct pfsync_state *)bp;
+
+ putchar('\n');
+ print_state(st);
+}
+
+static void
+pfsync_print_ins_ack(const void *bp)
+{
+ const struct pfsync_ins_ack *iack = bp;
+
+ printf("\n\tid: %016jx creatorid: %08x", (uintmax_t )be64toh(iack->id),
+ ntohl(iack->creatorid));
+}
+
+static void
+pfsync_print_upd_c(const void *bp)
+{
+ const struct pfsync_upd_c *u = bp;
+
+ printf("\n\tid: %016jx creatorid: %08x", (uintmax_t )be64toh(u->id),
+ ntohl(u->creatorid));
+ if (vflag > 2) {
+ printf("\n\tTCP? :");
+ print_src_dst(&u->src, &u->dst, IPPROTO_TCP);
+ }
+}
+
+static void
+pfsync_print_upd_req(const void *bp)
+{
+ const struct pfsync_upd_req *ur = bp;
+
+ printf("\n\tid: %016jx creatorid: %08x", (uintmax_t )be64toh(ur->id),
+ ntohl(ur->creatorid));
+}
+
+static void
+pfsync_print_del_c(const void *bp)
+{
+ const struct pfsync_del_c *d = bp;
+
+ printf("\n\tid: %016jx creatorid: %08x", (uintmax_t )be64toh(d->id),
+ ntohl(d->creatorid));
+}
+
+static void
+pfsync_print_bus(const void *bp)
+{
+ const struct pfsync_bus *b = bp;
+ uint32_t endtime;
+ int min, sec;
+ const char *status;
+
+ endtime = ntohl(b->endtime);
+ sec = endtime % 60;
+ endtime /= 60;
+ min = endtime % 60;
+ endtime /= 60;
+
+ switch (b->status) {
+ case PFSYNC_BUS_START:
+ status = "start";
+ break;
+ case PFSYNC_BUS_END:
+ status = "end";
+ break;
+ default:
+ status = "UNKNOWN";
+ break;
+ }
+
+ printf("\n\tcreatorid: %08x age: %.2u:%.2u:%.2u status: %s",
+ htonl(b->creatorid), endtime, min, sec, status);
+}
+
+static void
+pfsync_print_tdb(const void *bp)
+{
+ const struct pfsync_tdb *t = bp;
+
+ printf("\n\tspi: 0x%08x rpl: %ju cur_bytes: %ju",
+ ntohl(t->spi), (uintmax_t )be64toh(t->rpl),
+ (uintmax_t )be64toh(t->cur_bytes));
+}
+
+static void
+print_host(struct pf_addr *addr, uint16_t port, sa_family_t af,
+ const char *proto)
+{
+ char buf[48];
+
+ if (inet_ntop(af, addr, buf, sizeof(buf)) == NULL)
+ printf("?");
+ else
+ printf("%s", buf);
+
+ if (port)
+ printf(".%hu", ntohs(port));
+}
+
+static void
+print_seq(const struct pfsync_state_peer *p)
+{
+ if (p->seqdiff)
+ printf("[%u + %u](+%u)", ntohl(p->seqlo),
+ ntohl(p->seqhi) - ntohl(p->seqlo), ntohl(p->seqdiff));
+ else
+ printf("[%u + %u]", ntohl(p->seqlo),
+ ntohl(p->seqhi) - ntohl(p->seqlo));
+}
+
+static void
+print_src_dst(const struct pfsync_state_peer *src,
+ const struct pfsync_state_peer *dst, uint8_t proto)
+{
+
+ if (proto == IPPROTO_TCP) {
+ if (src->state <= TCPS_TIME_WAIT &&
+ dst->state <= TCPS_TIME_WAIT)
+ printf(" %s:%s", tcpstates[src->state],
+ tcpstates[dst->state]);
+ else if (src->state == PF_TCPS_PROXY_SRC ||
+ dst->state == PF_TCPS_PROXY_SRC)
+ printf(" PROXY:SRC");
+ else if (src->state == PF_TCPS_PROXY_DST ||
+ dst->state == PF_TCPS_PROXY_DST)
+ printf(" PROXY:DST");
+ else
+ printf(" <BAD STATE LEVELS %u:%u>",
+ src->state, dst->state);
+ if (vflag > 1) {
+ printf("\n\t");
+ print_seq(src);
+ if (src->wscale && dst->wscale)
+ printf(" wscale %u",
+ src->wscale & PF_WSCALE_MASK);
+ printf(" ");
+ print_seq(dst);
+ if (src->wscale && dst->wscale)
+ printf(" wscale %u",
+ dst->wscale & PF_WSCALE_MASK);
+ }
+ } else if (proto == IPPROTO_UDP && src->state < PFUDPS_NSTATES &&
+ dst->state < PFUDPS_NSTATES) {
+ const char *states[] = PFUDPS_NAMES;
+
+ printf(" %s:%s", states[src->state], states[dst->state]);
+ } else if (proto != IPPROTO_ICMP && src->state < PFOTHERS_NSTATES &&
+ dst->state < PFOTHERS_NSTATES) {
+ /* XXX ICMP doesn't really have state levels */
+ const char *states[] = PFOTHERS_NAMES;
+
+ printf(" %s:%s", states[src->state], states[dst->state]);
+ } else {
+ printf(" %u:%u", src->state, dst->state);
+ }
+}
+
+static void
+print_state(struct pfsync_state *s)
+{
+ struct pfsync_state_peer *src, *dst;
+ struct pfsync_state_key *sk, *nk;
+ int min, sec;
+
+ if (s->direction == PF_OUT) {
+ src = &s->src;
+ dst = &s->dst;
+ sk = &s->key[PF_SK_STACK];
+ nk = &s->key[PF_SK_WIRE];
+ if (s->proto == IPPROTO_ICMP || s->proto == IPPROTO_ICMPV6)
+ sk->port[0] = nk->port[0];
+ } else {
+ src = &s->dst;
+ dst = &s->src;
+ sk = &s->key[PF_SK_WIRE];
+ nk = &s->key[PF_SK_STACK];
+ if (s->proto == IPPROTO_ICMP || s->proto == IPPROTO_ICMPV6)
+ sk->port[1] = nk->port[1];
+ }
+ printf("\t%s ", s->ifname);
+ printf("proto %u ", s->proto);
+
+ print_host(&nk->addr[1], nk->port[1], s->af, NULL);
+ if (PF_ANEQ(&nk->addr[1], &sk->addr[1], s->af) ||
+ nk->port[1] != sk->port[1]) {
+ printf(" (");
+ print_host(&sk->addr[1], sk->port[1], s->af, NULL);
+ printf(")");
+ }
+ if (s->direction == PF_OUT)
+ printf(" -> ");
+ else
+ printf(" <- ");
+ print_host(&nk->addr[0], nk->port[0], s->af, NULL);
+ if (PF_ANEQ(&nk->addr[0], &sk->addr[0], s->af) ||
+ nk->port[0] != sk->port[0]) {
+ printf(" (");
+ print_host(&sk->addr[0], sk->port[0], s->af, NULL);
+ printf(")");
+ }
+
+ print_src_dst(src, dst, s->proto);
+
+ if (vflag > 1) {
+ uint64_t packets[2];
+ uint64_t bytes[2];
+ uint32_t creation = ntohl(s->creation);
+ uint32_t expire = ntohl(s->expire);
+
+ sec = creation % 60;
+ creation /= 60;
+ min = creation % 60;
+ creation /= 60;
+ printf("\n\tage %.2u:%.2u:%.2u", creation, min, sec);
+ sec = expire % 60;
+ expire /= 60;
+ min = expire % 60;
+ expire /= 60;
+ printf(", expires in %.2u:%.2u:%.2u", expire, min, sec);
+
+ bcopy(s->packets[0], &packets[0], sizeof(uint64_t));
+ bcopy(s->packets[1], &packets[1], sizeof(uint64_t));
+ bcopy(s->bytes[0], &bytes[0], sizeof(uint64_t));
+ bcopy(s->bytes[1], &bytes[1], sizeof(uint64_t));
+ printf(", %ju:%ju pkts, %ju:%ju bytes",
+ be64toh(packets[0]), be64toh(packets[1]),
+ be64toh(bytes[0]), be64toh(bytes[1]));
+ if (s->anchor != ntohl(-1))
+ printf(", anchor %u", ntohl(s->anchor));
+ if (s->rule != ntohl(-1))
+ printf(", rule %u", ntohl(s->rule));
+ }
+ if (vflag > 1) {
+ uint64_t id;
+
+ bcopy(&s->id, &id, sizeof(uint64_t));
+ printf("\n\tid: %016jx creatorid: %08x",
+ (uintmax_t )be64toh(id), ntohl(s->creatorid));
+ }
+}
Property changes on: trunk/contrib/tcpdump/print-pfsync.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-pgm.c
===================================================================
--- trunk/contrib/tcpdump/print-pgm.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-pgm.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -15,7 +15,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-pgm.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pgm.c,v 1.5 2005-06-07 22:05:58 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -72,6 +72,12 @@
/* ... options */
};
+struct pgm_ack {
+ u_int32_t pgma_rx_max_seq;
+ u_int32_t pgma_bitmap;
+ /* ... options */
+};
+
struct pgm_poll {
u_int32_t pgmp_seq;
u_int16_t pgmp_round;
@@ -133,6 +139,9 @@
#define PGM_OPT_RST 0x0F
#define PGM_OPT_CR 0x10
#define PGM_OPT_CRQST 0x11
+
+#define PGM_OPT_PGMCC_DATA 0x12
+#define PGM_OPT_PGMCC_FEEDBACK 0x13
#define PGM_OPT_MASK 0x7f
@@ -446,6 +455,17 @@
break;
}
+ case PGM_ACK: {
+ struct pgm_ack *ack;
+
+ ack = (struct pgm_ack *)(pgm + 1);
+ TCHECK(*ack);
+ (void)printf("ACK seq %u",
+ EXTRACT_32BITS(&ack->pgma_rx_max_seq));
+ bp = (u_char *) (ack + 1);
+ break;
+ }
+
case PGM_SPMR:
(void)printf("SPMR");
break;
@@ -736,6 +756,74 @@
opts_len -= 4;
break;
+ case PGM_OPT_PGMCC_DATA:
+ flags1 = *bp++;
+ flags2 = *bp++;
+ offset = EXTRACT_32BITS(bp);
+ bp += sizeof(u_int32_t);
+ switch (EXTRACT_16BITS(bp)) {
+ case AFI_IP:
+ addr_size = sizeof(struct in_addr);
+ nla_af = AF_INET;
+ break;
+#ifdef INET6
+ case AFI_IP6:
+ addr_size = sizeof(struct in6_addr);
+ nla_af = AF_INET6;
+ break;
+#endif
+ default:
+ goto trunc;
+ break;
+ }
+ bp += (2 * sizeof(u_int16_t));
+ if (opt_len != 12 + addr_size) {
+ (void)printf("[Bad OPT_PGMCC_DATA option, length %u != 12 + address size]", opt_len);
+ return;
+ }
+ TCHECK2(*bp, addr_size);
+ nla = bp;
+ bp += addr_size;
+
+ inet_ntop(nla_af, nla, nla_buf, sizeof(nla_buf));
+ (void)printf(" PGMCC DATA %u %s", offset, (char*)nla);
+ opts_len -= 16;
+ break;
+
+ case PGM_OPT_PGMCC_FEEDBACK:
+ flags1 = *bp++;
+ flags2 = *bp++;
+ offset = EXTRACT_32BITS(bp);
+ bp += sizeof(u_int32_t);
+ switch (EXTRACT_16BITS(bp)) {
+ case AFI_IP:
+ addr_size = sizeof(struct in_addr);
+ nla_af = AF_INET;
+ break;
+#ifdef INET6
+ case AFI_IP6:
+ addr_size = sizeof(struct in6_addr);
+ nla_af = AF_INET6;
+ break;
+#endif
+ default:
+ goto trunc;
+ break;
+ }
+ bp += (2 * sizeof(u_int16_t));
+ if (opt_len != 12 + addr_size) {
+ (void)printf("[Bad OPT_PGMCC_FEEDBACK option, length %u != 12 + address size]", opt_len);
+ return;
+ }
+ TCHECK2(*bp, addr_size);
+ nla = bp;
+ bp += addr_size;
+
+ inet_ntop(nla_af, nla, nla_buf, sizeof(nla_buf));
+ (void)printf(" PGMCC FEEDBACK %u %s", offset, (char*)nla);
+ opts_len -= 16;
+ break;
+
default:
(void)printf(" OPT_%02X [%d] ", opt_type, opt_len);
bp += opt_len;
Modified: trunk/contrib/tcpdump/print-pim.c
===================================================================
--- trunk/contrib/tcpdump/print-pim.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-pim.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,12 +18,12 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-pim.c,v 1.9.2.1 2007/10/19 03:03:59 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-pim.c 242485 2012-11-02 16:57:51Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-pim.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.49 2006-02-13 01:31:35 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -31,8 +31,16 @@
#endif
#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
#include "interface.h"
+#include "addrtoname.h"
+#include "extract.h"
+#include "ip.h"
+
#define PIMV2_TYPE_HELLO 0
#define PIMV2_TYPE_REGISTER 1
#define PIMV2_TYPE_REGISTER_STOP 2
@@ -110,18 +118,8 @@
u_short pim_cksum; /* IP style check sum */
};
+static void pimv2_print(register const u_char *bp, register u_int len, u_int cksum);
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "interface.h"
-#include "addrtoname.h"
-#include "extract.h"
-
-#include "ip.h"
-
-static void pimv2_print(register const u_char *bp, register u_int len);
-
static void
pimv1_join_prune_print(register const u_char *bp, register u_int len)
{
@@ -401,8 +399,12 @@
TCHECK2(bp[0], 6);
(void)printf("%c%s%s/%d", s, bp[0] & 1 ? "!" : "",
ipaddr_string(&bp[2]), bp[1]);
- if (bp[0] & 0xfe)
- (void)printf("[rsvd=0x%02x]", bp[0] & 0xfe);
+ if (bp[0] & 0x02) {
+ (void)printf(" bidir");
+ }
+ if (bp[0] & 0xfc) {
+ (void)printf("[rsvd=0x%02x]", bp[0] & 0xfc);
+ }
s = ',';
bp += 6; len -= 6;
}
@@ -415,7 +417,7 @@
}
void
-pim_print(register const u_char *bp, register u_int len)
+pim_print(register const u_char *bp, register u_int len, u_int cksum)
{
register const u_char *ep;
register struct pim *pim = (struct pim *)bp;
@@ -440,7 +442,7 @@
PIM_VER(pim->pim_typever),
len,
tok2str(pimv2_type_values,"Unknown Type",PIM_TYPE(pim->pim_typever)));
- pimv2_print(bp, len);
+ pimv2_print(bp, len, cksum);
}
break;
default:
@@ -620,7 +622,7 @@
}
static void
-pimv2_print(register const u_char *bp, register u_int len)
+pimv2_print(register const u_char *bp, register u_int len, u_int cksum)
{
register const u_char *ep;
register struct pim *pim = (struct pim *)bp;
@@ -640,9 +642,7 @@
if (EXTRACT_16BITS(&pim->pim_cksum) == 0) {
printf("(unverified)");
} else {
- printf("(%scorrect)",
- TTEST2(bp[0], len) &&
- in_cksum((const u_short*)bp, len, 0) ? "in" : "" );
+ printf("(%scorrect)", TTEST2(bp[0], len) && cksum ? "in" : "" );
}
switch (PIM_TYPE(pim->pim_typever)) {
@@ -669,7 +669,7 @@
case PIMV2_HELLO_OPTION_LANPRUNEDELAY:
if (olen != 4) {
- (void)printf("ERROR: Option Lenght != 4 Bytes (%u)", olen);
+ (void)printf("ERROR: Option Length != 4 Bytes (%u)", olen);
} else {
char t_bit;
u_int16_t lan_delay, override_interval;
@@ -692,7 +692,7 @@
printf("%u", EXTRACT_32BITS(bp));
break;
default:
- printf("ERROR: Option Lenght != 4 Bytes (%u)", olen);
+ printf("ERROR: Option Length != 4 Bytes (%u)", olen);
break;
}
break;
@@ -772,7 +772,7 @@
break;
#ifdef INET6
case 6: /* IPv6 */
- ip6_print(bp, len);
+ ip6_print(gndo, bp, len);
break;
#endif
default:
Added: trunk/contrib/tcpdump/print-ppi.c
===================================================================
--- trunk/contrib/tcpdump/print-ppi.c (rev 0)
+++ trunk/contrib/tcpdump/print-ppi.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,104 @@
+/*
+ * Oracle
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <pcap.h>
+
+#include "netdissect.h"
+#include "interface.h"
+#include "extract.h"
+#include "ppi.h"
+
+#ifdef DLT_PPI
+
+static inline void
+ppi_header_print(struct netdissect_options *ndo, const u_char *bp, u_int length)
+{
+ const ppi_header_t *hdr;
+ u_int32_t dlt;
+ u_int16_t len;
+
+ hdr = (const ppi_header_t *)bp;
+
+ len = EXTRACT_16BITS(&hdr->ppi_len);
+ dlt = EXTRACT_32BITS(&hdr->ppi_dlt);
+
+ if (!ndo->ndo_qflag) {
+ ND_PRINT((ndo,", V.%d DLT %s (%d) len %d", hdr->ppi_ver,
+ pcap_datalink_val_to_name(dlt), dlt,
+ len));
+ } else {
+ ND_PRINT((ndo,", %s", pcap_datalink_val_to_name(dlt)));
+ }
+
+ ND_PRINT((ndo, ", length %u: ", length));
+}
+
+static void
+ppi_print(struct netdissect_options *ndo,
+ const struct pcap_pkthdr *h, const u_char *p)
+{
+ if_ndo_printer ndo_printer;
+ if_printer printer;
+ ppi_header_t *hdr;
+ u_int caplen = h->caplen;
+ u_int length = h->len;
+ u_int32_t dlt;
+
+ if (caplen < sizeof(ppi_header_t)) {
+ ND_PRINT((ndo, "[|ppi]"));
+ return;
+ }
+ hdr = (ppi_header_t *)p;
+ dlt = EXTRACT_32BITS(&hdr->ppi_dlt);
+
+ if (ndo->ndo_eflag)
+ ppi_header_print(ndo, p, length);
+
+ length -= sizeof(ppi_header_t);
+ caplen -= sizeof(ppi_header_t);
+ p += sizeof(ppi_header_t);
+
+ if ((printer = lookup_printer(dlt)) != NULL) {
+ printer(h, p);
+ } else if ((ndo_printer = lookup_ndo_printer(dlt)) != NULL) {
+ ndo_printer(ndo, h, p);
+ } else {
+ if (!ndo->ndo_eflag)
+ ppi_header_print(ndo, (u_char *)hdr,
+ length + sizeof(ppi_header_t));
+
+ if (!ndo->ndo_suppress_default_print)
+ ndo->ndo_default_print(ndo, p, caplen);
+ }
+}
+
+/*
+ * This is the top level routine of the printer. 'p' points
+ * to the ether header of the packet, 'h->ts' is the timestamp,
+ * 'h->len' is the length of the packet off the wire, and 'h->caplen'
+ * is the number of bytes actually captured.
+ */
+u_int
+ppi_if_print(struct netdissect_options *ndo,
+ const struct pcap_pkthdr *h, const u_char *p)
+{
+ ppi_print(ndo, h, p);
+
+ return (sizeof(ppi_header_t));
+}
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 8
+ * End:
+ */
+
+#endif /* DLT_PPI */
Property changes on: trunk/contrib/tcpdump/print-ppi.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-ppp.c
===================================================================
--- trunk/contrib/tcpdump/print-ppp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ppp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
* Extensively modified by Motonori Shindo (mshindo at mshindo.net) for more
* complete PPP support.
*
- * $FreeBSD: src/contrib/tcpdump/print-ppp.c,v 1.16.10.1 2007/10/19 03:03:59 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-ppp.c 236192 2012-05-28 19:13:21Z delphij $
*/
/*
@@ -33,7 +33,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ppp.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.114 2005-12-05 11:35:58 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -1305,11 +1305,11 @@
goto cleanup;
#ifdef INET6
case PPP_IPV6:
- ip6_print(b+1, t - b - 1);
- goto cleanup;
+ ip6_print(gndo, b+1, t - b - 1);
+ goto cleanup;
#endif
default: /* no luck - try next guess */
- break;
+ break;
}
proto = EXTRACT_16BITS(b); /* next guess - load two octets */
@@ -1370,7 +1370,7 @@
#ifdef INET6
case ETHERTYPE_IPV6: /*XXX*/
case PPP_IPV6:
- ip6_print(p, length);
+ ip6_print(gndo, p, length);
break;
#endif
case ETHERTYPE_IPX: /*XXX*/
@@ -1631,7 +1631,7 @@
hdrlength += 1;
} else {
/* Un-compressed protocol field */
- ptype = ntohs(*(u_int16_t *)p);
+ ptype = EXTRACT_16BITS(p);
if (eflag)
printf("%04x ", ptype);
p += 2;
@@ -1651,7 +1651,7 @@
&& ph->phdr_ctl == PPP_CONTROL) {
if (eflag)
printf("%02x %02x ", q[0], q[1]);
- ptype = ntohs(ph->phdr_type);
+ ptype = EXTRACT_16BITS(&ph->phdr_type);
if (eflag && (ptype == PPP_VJC || ptype == PPP_VJNC)) {
printf("%s ", tok2str(ppptype2str,
"proto-#%d", ptype));
@@ -1677,11 +1677,11 @@
p += hdrlength;
switch (ptype) {
case PPP_IP:
- ip_print(p, length);
+ ip_print(gndo, p, length);
break;
#ifdef INET6
case PPP_IPV6:
- ip6_print(p, length);
+ ip6_print(gndo, p, length);
break;
#endif
case PPP_MPLS_UCAST:
@@ -1696,11 +1696,11 @@
p += hdrlength;
switch (ptype) {
case PPP_IP:
- ip_print(p, length);
+ ip_print(gndo, p, length);
break;
#ifdef INET6
case PPP_IPV6:
- ip6_print(p, length);
+ ip6_print(gndo, p, length);
break;
#endif
case PPP_MPLS_UCAST:
@@ -1732,12 +1732,12 @@
break;
#ifdef INET6
case PPP_IPV6:
- ip6_print(p, length);
+ ip6_print(gndo, p, length);
break;
#endif
case PPP_MPLS_UCAST:
case PPP_MPLS_MCAST:
- mpls_print(p, length);
+ mpls_print(gndo, p, length);
break;
default:
printf("%s ", tok2str(ppptype2str, "unknown PPP protocol (0x%04x)", ptype));
Modified: trunk/contrib/tcpdump/print-pppoe.c
===================================================================
--- trunk/contrib/tcpdump/print-pppoe.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-pppoe.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] _U_ =
-"@(#) $Header: /home/cvs/src/contrib/tcpdump/print-pppoe.c,v 1.1.1.2 2006-02-25 02:34:03 laffer1 Exp $ (LBL)";
+"@(#) $Header: /tcpdump/master/tcpdump/print-pppoe.c,v 1.31 2005-04-26 19:48:38 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -70,6 +70,7 @@
PPPOE_AC_COOKIE = 0x0104,
PPPOE_VENDOR = 0x0105,
PPPOE_RELAY_SID = 0x0110,
+ PPPOE_MAX_PAYLOAD = 0x0120,
PPPOE_SERVICE_NAME_ERROR = 0x0201,
PPPOE_AC_SYSTEM_ERROR = 0x0202,
PPPOE_GENERIC_ERROR = 0x0203
@@ -83,6 +84,7 @@
{ PPPOE_AC_COOKIE, "AC-Cookie" },
{ PPPOE_VENDOR, "Vendor-Specific" },
{ PPPOE_RELAY_SID, "Relay-Session-ID" },
+ { PPPOE_MAX_PAYLOAD, "PPP-Max-Payload" },
{ PPPOE_SERVICE_NAME_ERROR, "Service-Name-Error" },
{ PPPOE_AC_SYSTEM_ERROR, "AC-System-Error" },
{ PPPOE_GENERIC_ERROR, "Generic-Error" },
@@ -157,7 +159,7 @@
if (tag_len) {
unsigned isascii = 0, isgarbage = 0;
- const u_char *v = p;
+ const u_char *v;
char tag_str[MAXTAGPRINT];
unsigned tag_str_len = 0;
Modified: trunk/contrib/tcpdump/print-pptp.c
===================================================================
--- trunk/contrib/tcpdump/print-pptp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-pptp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -24,7 +24,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-pptp.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pptp.c,v 1.12 2006-06-23 02:03:09 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-radius.c
===================================================================
--- trunk/contrib/tcpdump/print-radius.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-radius.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -44,7 +44,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "$Id: print-radius.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "$Id: print-radius.c,v 1.28 2005-09-26 01:01:55 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-raw.c
===================================================================
--- trunk/contrib/tcpdump/print-raw.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-raw.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-raw.c,v 1.1.1.2 2006-02-25 02:34:03 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-raw.c,v 1.41 2003-11-16 09:36:34 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-rip.c
===================================================================
--- trunk/contrib/tcpdump/print-rip.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-rip.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-rip.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-rip.c,v 1.59 2006-03-23 14:58:44 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -37,6 +37,8 @@
#include "addrtoname.h"
#include "extract.h" /* must come after interface.h */
+#include "af.h"
+
struct rip {
u_int8_t rip_cmd; /* request/response */
u_int8_t rip_vers; /* protocol version # */
@@ -100,8 +102,8 @@
/* RFC 1058 */
family = EXTRACT_16BITS(&ni->rip_family);
- if (family != AF_INET) {
- printf("\n\t AFI: %u:", family);
+ if (family != BSD_AFNUM_INET && family != 0) {
+ printf("\n\t AFI %s, ", tok2str(bsd_af_values, "Unknown (%u)", family));
print_unknown_data((u_int8_t *)&ni->rip_family,"\n\t ",RIP_ROUTELEN);
return;
}
@@ -111,40 +113,55 @@
/* MBZ fields not zero */
print_unknown_data((u_int8_t *)&ni->rip_family,"\n\t ",RIP_ROUTELEN);
return;
- } /* AF_INET */
+ }
+ if (family == 0) {
+ printf("\n\t AFI 0, %s, metric: %u",
+ ipaddr_string(&ni->rip_dest),
+ EXTRACT_32BITS(&ni->rip_metric));
+ return;
+ } /* BSD_AFNUM_INET */
printf("\n\t %s, metric: %u",
ipaddr_string(&ni->rip_dest),
EXTRACT_32BITS(&ni->rip_metric));
}
-static void
-rip_entry_print_v2(register const struct rip_netinfo *ni)
+static unsigned
+rip_entry_print_v2(register const struct rip_netinfo *ni, const unsigned remaining)
{
- register u_char *p;
register u_short family;
- u_char buf[RIP_AUTHLEN];
family = EXTRACT_16BITS(&ni->rip_family);
- if (family == 0xFFFF) { /* 16 bytes authentication ? */
- if (EXTRACT_16BITS(&ni->rip_tag) == 2) { /* simple text authentication ? */
- memcpy(buf, &ni->rip_dest, sizeof(buf));
- buf[sizeof(buf)-1] = '\0';
- for (p = buf; *p; p++) {
- if (!isprint(*p))
- break;
- }
- printf("\n\t Simple Text Authentication data: %s", buf);
+ if (family == 0xFFFF) { /* variable-sized authentication structures */
+ u_int16_t auth_type = EXTRACT_16BITS(&ni->rip_tag);
+ if (auth_type == 2) {
+ register u_char *p = (u_char *)&ni->rip_dest;
+ u_int i = 0;
+ printf("\n\t Simple Text Authentication data: ");
+ for (; i < RIP_AUTHLEN; p++, i++)
+ putchar (isprint(*p) ? *p : '.');
+ } else if (auth_type == 3) {
+ printf("\n\t Auth header:");
+ printf(" Packet Len %u,", EXTRACT_16BITS((u_int8_t *)ni + 4));
+ printf(" Key-ID %u,", *((u_int8_t *)ni + 6));
+ printf(" Auth Data Len %u,", *((u_int8_t *)ni + 7));
+ printf(" SeqNo %u,", EXTRACT_32BITS(&ni->rip_dest_mask));
+ printf(" MBZ %u,", EXTRACT_32BITS(&ni->rip_router));
+ printf(" MBZ %u", EXTRACT_32BITS(&ni->rip_metric));
+ } else if (auth_type == 1) {
+ printf("\n\t Auth trailer:");
+ print_unknown_data((u_int8_t *)&ni->rip_dest,"\n\t ",remaining);
+ return remaining; /* AT spans till the packet end */
} else {
printf("\n\t Unknown (%u) Authentication data:",
EXTRACT_16BITS(&ni->rip_tag));
- print_unknown_data((u_int8_t *)&ni->rip_dest,"\n\t ",RIP_AUTHLEN);
+ print_unknown_data((u_int8_t *)&ni->rip_dest,"\n\t ",remaining);
}
- } else if (family != AF_INET) {
- printf("\n\t AFI: %u", family);
+ } else if (family != BSD_AFNUM_INET && family != 0) {
+ printf("\n\t AFI %s", tok2str(bsd_af_values, "Unknown (%u)", family));
print_unknown_data((u_int8_t *)&ni->rip_tag,"\n\t ",RIP_ROUTELEN-2);
- return;
- } else { /* AF_INET */
- printf("\n\t AFI: IPv4: %15s/%-2d, tag 0x%04x, metric: %u, next-hop: ",
+ } else { /* BSD_AFNUM_INET or AFI 0 */
+ printf("\n\t AFI %s, %15s/%-2d, tag 0x%04x, metric: %u, next-hop: ",
+ tok2str(bsd_af_values, "%u", family),
ipaddr_string(&ni->rip_dest),
mask2plen(EXTRACT_32BITS(&ni->rip_dest_mask)),
EXTRACT_16BITS(&ni->rip_tag),
@@ -154,6 +171,7 @@
else
printf("self");
}
+ return sizeof (*ni);
}
void
@@ -162,7 +180,6 @@
register const struct rip *rp;
register const struct rip_netinfo *ni;
register u_int i, j;
- register int trunc;
if (snapend < dat) {
printf(" [|rip]");
@@ -210,25 +227,26 @@
return;
switch (rp->rip_cmd) {
+ case RIPCMD_REQUEST:
case RIPCMD_RESPONSE:
j = length / sizeof(*ni);
- printf(", routes: %u",j);
- trunc = (i / sizeof(*ni)) != j;
+ printf(", routes: %u%s", j, rp->rip_vers == 2 ? " or less" : "");
ni = (struct rip_netinfo *)(rp + 1);
for (; i >= sizeof(*ni); ++ni) {
if (rp->rip_vers == 1)
+ {
rip_entry_print_v1(ni);
+ i -= sizeof(*ni);
+ }
else if (rp->rip_vers == 2)
- rip_entry_print_v2(ni);
+ i -= rip_entry_print_v2(ni, i);
else
break;
- i -= sizeof(*ni);
}
- if (trunc)
+ if (i)
printf("[|rip]");
break;
- case RIPCMD_REQUEST:
case RIPCMD_TRACEOFF:
case RIPCMD_POLL:
case RIPCMD_POLLENTRY:
Modified: trunk/contrib/tcpdump/print-ripng.c
===================================================================
--- trunk/contrib/tcpdump/print-ripng.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-ripng.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-ripng.c,v 1.1.1.2 2006-02-25 02:34:03 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ripng.c,v 1.18 2005-01-04 00:15:54 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
Added: trunk/contrib/tcpdump/print-rpki-rtr.c
===================================================================
--- trunk/contrib/tcpdump/print-rpki-rtr.c (rev 0)
+++ trunk/contrib/tcpdump/print-rpki-rtr.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,368 @@
+/*
+ * Copyright (c) 1998-2011 The TCPDUMP project
+ *
+ * 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.
+ *
+ * support for the The RPKI/Router Protocol as RFC6810
+ *
+ * Original code by Hannes Gredler (hannes at juniper.net)
+ */
+
+#ifndef lint
+static const char rcsid[] _U_ =
+"@(#) $Header: /tcpdump/master/tcpdump/print-rpki_rtr.c,v 1.10 2008-03-20 09:30:56 hannes Exp $";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "interface.h"
+#include "extract.h"
+#include "addrtoname.h"
+
+/*
+ * RPKI/Router PDU header
+ *
+ * Here's what the PDU header looks like.
+ * The length does include the version and length fields.
+ */
+typedef struct rpki_rtr_pdu_ {
+ u_char version; /* Version number */
+ u_char pdu_type; /* PDU type */
+ union {
+ u_char session_id[2]; /* Session id */
+ u_char error_code[2]; /* Error code */
+ } u;
+ u_char length[4];
+} rpki_rtr_pdu;
+#define RPKI_RTR_PDU_OVERHEAD (offsetof(rpki_rtr_pdu, rpki_rtr_pdu_msg))
+
+/*
+ * IPv4 Prefix PDU.
+ */
+typedef struct rpki_rtr_pdu_ipv4_prefix_ {
+ rpki_rtr_pdu pdu_header;
+ u_char flags;
+ u_char prefix_length;
+ u_char max_length;
+ u_char zero;
+ u_char prefix[4];
+ u_char as[4];
+} rpki_rtr_pdu_ipv4_prefix;
+
+/*
+ * IPv6 Prefix PDU.
+ */
+typedef struct rpki_rtr_pdu_ipv6_prefix_ {
+ rpki_rtr_pdu pdu_header;
+ u_char flags;
+ u_char prefix_length;
+ u_char max_length;
+ u_char zero;
+ u_char prefix[16];
+ u_char as[4];
+} rpki_rtr_pdu_ipv6_prefix;
+
+/*
+ * Error report PDU.
+ */
+typedef struct rpki_rtr_pdu_error_report_ {
+ rpki_rtr_pdu pdu_header;
+ u_char encapsulated_pdu_length[4]; /* Encapsulated PDU length */
+} rpki_rtr_pdu_error_report;
+
+/*
+ * PDU type codes
+ */
+#define RPKI_RTR_SERIAL_NOTIFY_PDU 0
+#define RPKI_RTR_SERIAL_QUERY_PDU 1
+#define RPKI_RTR_RESET_QUERY_PDU 2
+#define RPKI_RTR_CACHE_RESPONSE_PDU 3
+#define RPKI_RTR_IPV4_PREFIX_PDU 4
+#define RPKI_RTR_IPV6_PREFIX_PDU 6
+#define RPKI_RTR_END_OF_DATA_PDU 7
+#define RPKI_RTR_CACHE_RESET_PDU 8
+#define RPKI_RTR_ERROR_REPORT_PDU 10
+
+static const struct tok rpki_rtr_pdu_values[] = {
+ { RPKI_RTR_SERIAL_NOTIFY_PDU, "Serial Notify" },
+ { RPKI_RTR_SERIAL_QUERY_PDU, "Serial Query" },
+ { RPKI_RTR_RESET_QUERY_PDU, "Reset Query" },
+ { RPKI_RTR_CACHE_RESPONSE_PDU, "Cache Response" },
+ { RPKI_RTR_IPV4_PREFIX_PDU, "IPV4 Prefix" },
+ { RPKI_RTR_IPV6_PREFIX_PDU, "IPV6 Prefix" },
+ { RPKI_RTR_END_OF_DATA_PDU, "End of Data" },
+ { RPKI_RTR_CACHE_RESET_PDU, "Cache Reset" },
+ { RPKI_RTR_ERROR_REPORT_PDU, "Error Report" },
+ { 0, NULL}
+};
+
+static const struct tok rpki_rtr_error_codes[] = {
+ { 0, "Corrupt Data" },
+ { 1, "Internal Error" },
+ { 2, "No Data Available" },
+ { 3, "Invalid Request" },
+ { 4, "Unsupported Protocol Version" },
+ { 5, "Unsupported PDU Type" },
+ { 6, "Withdrawal of Unknown Record" },
+ { 7, "Duplicate Announcement Received" },
+ { 0, NULL}
+};
+
+/*
+ * Build a identation string for a given identation level.
+ * XXX this should be really in util.c
+ */
+static char *
+indent_string (u_int indent)
+{
+ static char buf[20];
+ u_int idx;
+
+ idx = 0;
+ buf[idx] = '\0';
+
+ /*
+ * Does the static buffer fit ?
+ */
+ if (sizeof(buf) < ((indent/8) + (indent %8) + 2)) {
+ return buf;
+ }
+
+ /*
+ * Heading newline.
+ */
+ buf[idx] = '\n';
+ idx++;
+
+ while (indent >= 8) {
+ buf[idx] = '\t';
+ idx++;
+ indent -= 8;
+ }
+
+ while (indent > 0) {
+ buf[idx] = ' ';
+ idx++;
+ indent--;
+ }
+
+ /*
+ * Trailing zero.
+ */
+ buf[idx] = '\0';
+
+ return buf;
+}
+
+/*
+ * Print a single PDU.
+ */
+static void
+rpki_rtr_pdu_print (const u_char *tptr, u_int indent)
+{
+ const rpki_rtr_pdu *pdu_header;
+ u_int pdu_type, pdu_len, hexdump;
+ const u_char *msg;
+
+ pdu_header = (rpki_rtr_pdu *)tptr;
+ pdu_type = pdu_header->pdu_type;
+ pdu_len = EXTRACT_32BITS(pdu_header->length);
+ hexdump = FALSE;
+
+ printf("%sRPKI-RTRv%u, %s PDU (%u), length: %u",
+ indent_string(8),
+ pdu_header->version,
+ tok2str(rpki_rtr_pdu_values, "Unknown", pdu_type),
+ pdu_type, pdu_len);
+
+ switch (pdu_type) {
+
+ /*
+ * The following PDUs share the message format.
+ */
+ case RPKI_RTR_SERIAL_NOTIFY_PDU:
+ case RPKI_RTR_SERIAL_QUERY_PDU:
+ case RPKI_RTR_END_OF_DATA_PDU:
+ msg = (const u_char *)(pdu_header + 1);
+ printf("%sSession ID: 0x%04x, Serial: %u",
+ indent_string(indent+2),
+ EXTRACT_16BITS(pdu_header->u.session_id),
+ EXTRACT_32BITS(msg));
+ break;
+
+ /*
+ * The following PDUs share the message format.
+ */
+ case RPKI_RTR_RESET_QUERY_PDU:
+ case RPKI_RTR_CACHE_RESET_PDU:
+
+ /*
+ * Zero payload PDUs.
+ */
+ break;
+
+ case RPKI_RTR_CACHE_RESPONSE_PDU:
+ printf("%sSession ID: 0x%04x",
+ indent_string(indent+2),
+ EXTRACT_16BITS(pdu_header->u.session_id));
+ break;
+
+ case RPKI_RTR_IPV4_PREFIX_PDU:
+ {
+ rpki_rtr_pdu_ipv4_prefix *pdu;
+
+ pdu = (rpki_rtr_pdu_ipv4_prefix *)tptr;
+ printf("%sIPv4 Prefix %s/%u-%u, origin-as %u, flags 0x%02x",
+ indent_string(indent+2),
+ ipaddr_string(pdu->prefix),
+ pdu->prefix_length, pdu->max_length,
+ EXTRACT_32BITS(pdu->as), pdu->flags);
+ }
+ break;
+
+#ifdef INET6
+ case RPKI_RTR_IPV6_PREFIX_PDU:
+ {
+ rpki_rtr_pdu_ipv6_prefix *pdu;
+
+ pdu = (rpki_rtr_pdu_ipv6_prefix *)tptr;
+ printf("%sIPv6 Prefix %s/%u-%u, origin-as %u, flags 0x%02x",
+ indent_string(indent+2),
+ ip6addr_string(pdu->prefix),
+ pdu->prefix_length, pdu->max_length,
+ EXTRACT_32BITS(pdu->as), pdu->flags);
+ }
+ break;
+#endif
+
+ case RPKI_RTR_ERROR_REPORT_PDU:
+ {
+ rpki_rtr_pdu_error_report *pdu;
+ u_int encapsulated_pdu_length, text_length, tlen, error_code;
+ u_char buf[80];
+
+ pdu = (rpki_rtr_pdu_error_report *)tptr;
+ encapsulated_pdu_length = EXTRACT_32BITS(pdu->encapsulated_pdu_length);
+ tlen = pdu_len;
+
+ error_code = EXTRACT_16BITS(pdu->pdu_header.u.error_code);
+ printf("%sError code: %s (%u), Encapsulated PDU length: %u",
+ indent_string(indent+2),
+ tok2str(rpki_rtr_error_codes, "Unknown", error_code),
+ error_code, encapsulated_pdu_length);
+
+ tptr += sizeof(*pdu);
+ tlen -= sizeof(*pdu);
+
+ /*
+ * Recurse if there is an encapsulated PDU.
+ */
+ if (encapsulated_pdu_length &&
+ (encapsulated_pdu_length <= tlen)) {
+ printf("%s-----encapsulated PDU-----", indent_string(indent+4));
+ rpki_rtr_pdu_print(tptr, indent+2);
+ }
+
+ tptr += encapsulated_pdu_length;
+ tlen -= encapsulated_pdu_length;
+
+ /*
+ * Extract, trail-zero and print the Error message.
+ */
+ text_length = 0;
+ if (tlen > 4) {
+ text_length = EXTRACT_32BITS(tptr);
+ tptr += 4;
+ tlen -= 4;
+ }
+ if (text_length && (text_length <= tlen )) {
+ memcpy(buf, tptr, MIN(sizeof(buf)-1, text_length));
+ buf[text_length] = '\0';
+ printf("%sError text: %s", indent_string(indent+2), buf);
+ }
+ }
+ break;
+
+ default:
+
+ /*
+ * Unknown data, please hexdump.
+ */
+ hexdump = TRUE;
+ }
+
+ /* do we also want to see a hex dump ? */
+ if (vflag > 1 || (vflag && hexdump)) {
+ print_unknown_data(tptr,"\n\t ", pdu_len);
+ }
+}
+
+void
+rpki_rtr_print(register const u_char *pptr, register u_int len) {
+
+ u_int tlen, pdu_type, pdu_len;
+ const u_char *tptr;
+ const rpki_rtr_pdu *pdu_header;
+
+ tptr = pptr;
+ tlen = len;
+
+ if (!vflag) {
+ printf(", RPKI-RTR");
+ return;
+ }
+
+ while (tlen >= sizeof(rpki_rtr_pdu)) {
+
+ TCHECK2(*tptr, sizeof(rpki_rtr_pdu));
+
+ pdu_header = (rpki_rtr_pdu *)tptr;
+ pdu_type = pdu_header->pdu_type;
+ pdu_len = EXTRACT_32BITS(pdu_header->length);
+
+ /* infinite loop check */
+ if (!pdu_type || !pdu_len) {
+ break;
+ }
+
+ TCHECK2(*tptr, pdu_len);
+ if (tlen < pdu_len) {
+ goto trunc;
+ }
+
+ /*
+ * Print the PDU.
+ */
+ rpki_rtr_pdu_print(tptr, 8);
+
+ tlen -= pdu_len;
+ tptr += pdu_len;
+ }
+ return;
+ trunc:
+ printf("\n\t[|RPKI-RTR]");
+}
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 4
+ * End:
+ */
Property changes on: trunk/contrib/tcpdump/print-rpki-rtr.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/contrib/tcpdump/print-rrcp.c
===================================================================
--- trunk/contrib/tcpdump/print-rrcp.c (rev 0)
+++ trunk/contrib/tcpdump/print-rrcp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2007 - Andrey "nording" Chernyak <andrew at nording.ru>
+ *
+ * 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.
+ *
+ * Format and print Realtek Remote Control Protocol (RRCP)
+ * and Realtek Echo Protocol (RRCP-REP) packets.
+ */
+
+#ifndef lint
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/print-rrcp.c,v 1.2 2008-04-11 17:21:34 gianluca Exp $";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include "netdissect.h"
+#include "addrtoname.h"
+#include "extract.h"
+#include "ether.h"
+
+#ifndef ETH_ALEN
+#define ETH_ALEN 6
+#endif
+
+#define RRCP_OPCODE_MASK 0x7F /* 0x00 = hello, 0x01 = get, 0x02 = set */
+#define RRCP_ISREPLY 0x80 /* 0 = request to switch, 0x80 = reply from switch */
+
+#define RRCP_PROTO_OFFSET 0 /* proto - 1 byte, must be 1 */
+#define RRCP_OPCODE_ISREPLY_OFFSET 1 /* opcode and isreply flag - 1 byte */
+#define RRCP_AUTHKEY_OFFSET 2 /* authorization key - 2 bytes, 0x2379 by default */
+
+/* most packets */
+#define RRCP_REG_ADDR_OFFSET 4 /* register address - 2 bytes */
+#define RRCP_REG_DATA_OFFSET 6 /* register data - 4 bytes */
+#define RRCP_COOKIE1_OFFSET 10 /* 4 bytes */
+#define RRCP_COOKIE2_OFFSET 14 /* 4 bytes */
+
+/* hello reply packets */
+#define RRCP_DOWNLINK_PORT_OFFSET 4 /* 1 byte */
+#define RRCP_UPLINK_PORT_OFFSET 5 /* 1 byte */
+#define RRCP_UPLINK_MAC_OFFSET 6 /* 6 byte MAC address */
+#define RRCP_CHIP_ID_OFFSET 12 /* 2 bytes */
+#define RRCP_VENDOR_ID_OFFSET 14 /* 4 bytes */
+
+static const struct tok proto_values[] = {
+ { 1, "RRCP" },
+ { 2, "RRCP-REP" },
+ { 0, NULL }
+};
+
+static const struct tok opcode_values[] = {
+ { 0, "hello" },
+ { 1, "get" },
+ { 2, "set" },
+ { 0, NULL }
+};
+
+/*
+ * Print RRCP requests
+ */
+void
+rrcp_print(netdissect_options *ndo,
+ register const u_char *cp,
+ u_int length _U_)
+{
+ const u_char *rrcp;
+ u_int8_t rrcp_proto;
+ u_int8_t rrcp_opcode;
+ register const struct ether_header *ep;
+ char proto_str[16];
+ char opcode_str[32];
+
+ ep = (const struct ether_header *)cp;
+ rrcp = cp + ETHER_HDRLEN;
+
+ ND_TCHECK(*(rrcp + RRCP_PROTO_OFFSET));
+ rrcp_proto = *(rrcp + RRCP_PROTO_OFFSET);
+ ND_TCHECK(*(rrcp + RRCP_OPCODE_ISREPLY_OFFSET));
+ rrcp_opcode = (*(rrcp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_OPCODE_MASK;
+ ND_PRINT((ndo, "%s > %s, %s %s",
+ etheraddr_string(ESRC(ep)),
+ etheraddr_string(EDST(ep)),
+ tok2strbuf(proto_values,"RRCP-0x%02x",rrcp_proto,proto_str,sizeof(proto_str)),
+ ((*(rrcp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_ISREPLY) ? "reply" : "query"));
+ if (rrcp_proto==1){
+ ND_PRINT((ndo, ": %s",
+ tok2strbuf(opcode_values,"unknown opcode (0x%02x)",rrcp_opcode,opcode_str,sizeof(opcode_str))));
+ }
+ if (rrcp_opcode==1 || rrcp_opcode==2){
+ ND_TCHECK2(*(rrcp + RRCP_REG_ADDR_OFFSET), 6);
+ ND_PRINT((ndo, " addr=0x%04x, data=0x%08x",
+ EXTRACT_LE_16BITS(rrcp + RRCP_REG_ADDR_OFFSET),
+ EXTRACT_LE_32BITS(rrcp + RRCP_REG_DATA_OFFSET)));
+ }
+ if (rrcp_proto==1){
+ ND_TCHECK2(*(rrcp + RRCP_AUTHKEY_OFFSET), 2);
+ ND_PRINT((ndo, ", auth=0x%04x",
+ EXTRACT_16BITS(rrcp + RRCP_AUTHKEY_OFFSET)));
+ }
+ if (rrcp_proto==1 && rrcp_opcode==0 &&
+ ((*(rrcp + RRCP_OPCODE_ISREPLY_OFFSET)) & RRCP_ISREPLY)){
+ ND_TCHECK2(*(rrcp + RRCP_VENDOR_ID_OFFSET), 4);
+ ND_PRINT((ndo, " downlink_port=%d, uplink_port=%d, uplink_mac=%s, vendor_id=%08x ,chip_id=%04x ",
+ *(rrcp + RRCP_DOWNLINK_PORT_OFFSET),
+ *(rrcp + RRCP_UPLINK_PORT_OFFSET),
+ etheraddr_string(rrcp + RRCP_UPLINK_MAC_OFFSET),
+ EXTRACT_32BITS(rrcp + RRCP_VENDOR_ID_OFFSET),
+ EXTRACT_16BITS(rrcp + RRCP_CHIP_ID_OFFSET)));
+ }else if (rrcp_opcode==1 || rrcp_opcode==2 || rrcp_proto==2){
+ ND_TCHECK2(*(rrcp + RRCP_COOKIE2_OFFSET), 4);
+ ND_PRINT((ndo, ", cookie=0x%08x%08x ",
+ EXTRACT_32BITS(rrcp + RRCP_COOKIE2_OFFSET),
+ EXTRACT_32BITS(rrcp + RRCP_COOKIE1_OFFSET)));
+ }
+ if (!ndo->ndo_vflag)
+ return;
+ return;
+
+trunc:
+ ND_PRINT((ndo, "[|rrcp]"));
+}
Property changes on: trunk/contrib/tcpdump/print-rrcp.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-rsvp.c
===================================================================
--- trunk/contrib/tcpdump/print-rsvp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-rsvp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -17,7 +17,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-rsvp.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-rsvp.c,v 1.50 2008-08-16 11:36:20 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -36,6 +36,7 @@
#include "ethertype.h"
#include "gmpls.h"
#include "af.h"
+#include "signature.h"
/*
* RFC 2205 common header
@@ -142,6 +143,7 @@
#define RSVP_OBJ_UPSTREAM_LABEL 35 /* rfc3473 */
#define RSVP_OBJ_LABEL_SET 36 /* rfc3473 */
#define RSVP_OBJ_PROTECTION 37 /* rfc3473 */
+#define RSVP_OBJ_S2L 50 /* rfc4875 */
#define RSVP_OBJ_DETOUR 63 /* draft-ietf-mpls-rsvp-lsp-fastreroute-07 */
#define RSVP_OBJ_CLASSTYPE 66 /* rfc4124 */
#define RSVP_OBJ_CLASSTYPE_OLD 125 /* draft-ietf-tewg-diff-te-proto-07 */
@@ -198,6 +200,7 @@
{ RSVP_OBJ_NOTIFY_REQ, "Notify Request" },
{ RSVP_OBJ_PROTECTION, "Protection" },
{ RSVP_OBJ_ADMIN_STATUS, "Administrative Status" },
+ { RSVP_OBJ_S2L, "Sub-LSP to LSP" },
{ 0, NULL}
};
@@ -210,6 +213,9 @@
#define RSVP_CTYPE_2 2
#define RSVP_CTYPE_3 3
#define RSVP_CTYPE_4 4
+#define RSVP_CTYPE_12 12
+#define RSVP_CTYPE_13 13
+#define RSVP_CTYPE_14 14
/*
* the ctypes are not globally unique so for
@@ -235,13 +241,19 @@
{ 256*RSVP_OBJ_FILTERSPEC+RSVP_CTYPE_IPV6, "IPv6" },
{ 256*RSVP_OBJ_FILTERSPEC+RSVP_CTYPE_3, "IPv6 Flow-label" },
{ 256*RSVP_OBJ_FILTERSPEC+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" },
+ { 256*RSVP_OBJ_FILTERSPEC+RSVP_CTYPE_12, "IPv4 P2MP LSP Tunnel" },
+ { 256*RSVP_OBJ_FILTERSPEC+RSVP_CTYPE_13, "IPv6 P2MP LSP Tunnel" },
{ 256*RSVP_OBJ_SESSION+RSVP_CTYPE_IPV4, "IPv4" },
{ 256*RSVP_OBJ_SESSION+RSVP_CTYPE_IPV6, "IPv6" },
{ 256*RSVP_OBJ_SESSION+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" },
{ 256*RSVP_OBJ_SESSION+RSVP_CTYPE_UNI_IPV4, "UNI IPv4" },
+ { 256*RSVP_OBJ_SESSION+RSVP_CTYPE_13, "IPv4 P2MP LSP Tunnel" },
+ { 256*RSVP_OBJ_SESSION+RSVP_CTYPE_14, "IPv6 P2MP LSP Tunnel" },
{ 256*RSVP_OBJ_SENDER_TEMPLATE+RSVP_CTYPE_IPV4, "IPv4" },
{ 256*RSVP_OBJ_SENDER_TEMPLATE+RSVP_CTYPE_IPV6, "IPv6" },
{ 256*RSVP_OBJ_SENDER_TEMPLATE+RSVP_CTYPE_TUNNEL_IPV4, "Tunnel IPv4" },
+ { 256*RSVP_OBJ_SENDER_TEMPLATE+RSVP_CTYPE_12, "IPv4 P2MP LSP Tunnel" },
+ { 256*RSVP_OBJ_SENDER_TEMPLATE+RSVP_CTYPE_13, "IPv6 P2MP LSP Tunnel" },
{ 256*RSVP_OBJ_MESSAGE_ID+RSVP_CTYPE_1, "1" },
{ 256*RSVP_OBJ_MESSAGE_ID_ACK+RSVP_CTYPE_1, "Message id ack" },
{ 256*RSVP_OBJ_MESSAGE_ID_ACK+RSVP_CTYPE_2, "Message id nack" },
@@ -282,6 +294,8 @@
{ 256*RSVP_OBJ_CLASSTYPE_OLD+RSVP_CTYPE_1, "1" },
{ 256*RSVP_OBJ_LABEL_SET+RSVP_CTYPE_1, "1" },
{ 256*RSVP_OBJ_GENERALIZED_UNI+RSVP_CTYPE_1, "1" },
+ { 256*RSVP_OBJ_S2L+RSVP_CTYPE_IPV4, "IPv4 sub-LSP" },
+ { 256*RSVP_OBJ_S2L+RSVP_CTYPE_IPV6, "IPv6 sub-LSP" },
{ 0, NULL}
};
@@ -316,6 +330,7 @@
#define RSVP_OBJ_XRO_RES 0
#define RSVP_OBJ_XRO_IPV4 1
#define RSVP_OBJ_XRO_IPV6 2
+#define RSVP_OBJ_XRO_LABEL 3
#define RSVP_OBJ_XRO_ASN 32
#define RSVP_OBJ_XRO_MPLS 64
@@ -323,6 +338,7 @@
{ RSVP_OBJ_XRO_RES, "Reserved" },
{ RSVP_OBJ_XRO_IPV4, "IPv4 prefix" },
{ RSVP_OBJ_XRO_IPV6, "IPv6 prefix" },
+ { RSVP_OBJ_XRO_LABEL, "Label" },
{ RSVP_OBJ_XRO_ASN, "Autonomous system number" },
{ RSVP_OBJ_XRO_MPLS, "MPLS label switched path termination" },
{ 0, NULL}
@@ -337,6 +353,12 @@
{ 0, NULL}
};
+/* RFC3209 */
+static const struct tok rsvp_obj_rro_label_flag_values[] = {
+ { 0x01, "Global" },
+ { 0, NULL}
+};
+
static const struct tok rsvp_resstyle_values[] = {
{ 17, "Wildcard Filter" },
{ 10, "Fixed Filter" },
@@ -369,11 +391,11 @@
};
static struct tok rsvp_session_attribute_flag_values[] = {
- { 0x01, "Local Protection desired" },
- { 0x02, "Label Recording desired" },
- { 0x04, "SE Style desired" },
- { 0x08, "Bandwidth protection desired" }, /* draft-ietf-mpls-rsvp-lsp-fastreroute-02.txt */
- { 0x10, "Node protection desired" }, /* draft-ietf-mpls-rsvp-lsp-fastreroute-02.txt */
+ { 0x01, "Local Protection" },
+ { 0x02, "Label Recording" },
+ { 0x04, "SE Style" },
+ { 0x08, "Bandwidth protection" }, /* RFC4090 */
+ { 0x10, "Node protection" }, /* RFC4090 */
{ 0, NULL}
};
@@ -614,7 +636,16 @@
}
static int
-rsvp_obj_print (const u_char *tptr, const char *ident, u_int tlen) {
+rsvp_obj_print (const u_char *pptr
+#ifndef HAVE_LIBCRYPTO
+_U_
+#endif
+, u_int plen
+#ifndef HAVE_LIBCRYPTO
+_U_
+#endif
+, const u_char *tptr,
+ const char *ident, u_int tlen) {
const struct rsvp_object_header *rsvp_obj_header;
const u_char *obj_tptr;
@@ -624,7 +655,7 @@
} obj_ptr;
u_short rsvp_obj_len,rsvp_obj_ctype,obj_tlen,intserv_serv_tlen;
- int hexdump,processed,padbytes,error_code,error_value,i;
+ int hexdump,processed,padbytes,error_code,error_value,i,sigcheck;
union {
float f;
u_int32_t i;
@@ -728,7 +759,30 @@
obj_tlen-=36;
obj_tptr+=36;
break;
+
+ case RSVP_CTYPE_14: /* IPv6 p2mp LSP Tunnel */
+ if (obj_tlen < 26)
+ return -1;
+ printf("%s IPv6 P2MP LSP ID: 0x%08x, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
+ ident,
+ EXTRACT_32BITS(obj_tptr),
+ EXTRACT_16BITS(obj_tptr+6),
+ ip6addr_string(obj_tptr+8));
+ obj_tlen-=26;
+ obj_tptr+=26;
+ break;
#endif
+ case RSVP_CTYPE_13: /* IPv4 p2mp LSP Tunnel */
+ if (obj_tlen < 12)
+ return -1;
+ printf("%s IPv4 P2MP LSP ID: %s, Tunnel ID: 0x%04x, Extended Tunnel ID: %s",
+ ident,
+ ipaddr_string(obj_tptr),
+ EXTRACT_16BITS(obj_tptr+6),
+ ipaddr_string(obj_tptr+8));
+ obj_tlen-=12;
+ obj_tptr+=12;
+ break;
case RSVP_CTYPE_TUNNEL_IPV4:
case RSVP_CTYPE_UNI_IPV4:
if (obj_tlen < 12)
@@ -880,6 +934,20 @@
obj_tlen-=20;
obj_tptr+=20;
break;
+ case RSVP_CTYPE_13: /* IPv6 p2mp LSP tunnel */
+ if (obj_tlen < 40)
+ return-1;
+ printf("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
+ "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
+ ident,
+ ip6addr_string(obj_tptr),
+ EXTRACT_16BITS(obj_tptr+18),
+ ident,
+ ip6addr_string(obj_tptr+20),
+ EXTRACT_16BITS(obj_tptr+38));
+ obj_tlen-=40;
+ obj_tptr+=40;
+ break;
#endif
case RSVP_CTYPE_TUNNEL_IPV4:
if (obj_tlen < 8)
@@ -891,6 +959,20 @@
obj_tlen-=8;
obj_tptr+=8;
break;
+ case RSVP_CTYPE_12: /* IPv4 p2mp LSP tunnel */
+ if (obj_tlen < 16)
+ return-1;
+ printf("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
+ "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
+ ident,
+ ipaddr_string(obj_tptr),
+ EXTRACT_16BITS(obj_tptr+6),
+ ident,
+ ipaddr_string(obj_tptr+8),
+ EXTRACT_16BITS(obj_tptr+12));
+ obj_tlen-=16;
+ obj_tptr+=16;
+ break;
default:
hexdump=TRUE;
}
@@ -999,6 +1081,18 @@
bittok2str(rsvp_obj_rro_flag_values,
"none",
*(obj_tptr+7))); /* rfc3209 says that this field is rsvd. */
+ break;
+ case RSVP_OBJ_XRO_LABEL:
+ printf(", Flags: [%s] (%#x), Class-Type: %s (%u), %u",
+ bittok2str(rsvp_obj_rro_label_flag_values,
+ "none",
+ *(obj_tptr+2)),
+ *(obj_tptr+2),
+ tok2str(rsvp_ctype_values,
+ "Unknown",
+ *(obj_tptr+3) + 256*RSVP_OBJ_RRO),
+ *(obj_tptr+3),
+ EXTRACT_32BITS(obj_tptr+4));
}
obj_tlen-=*(obj_tptr+1);
obj_tptr+=*(obj_tptr+1);
@@ -1055,14 +1149,14 @@
printf("%s Session Name: ", ident);
for (i = 0; i < namelen; i++)
safeputchar(*(obj_tptr+4+i));
- printf("%s Setup Priority: %u, Holding Priority: %u, Flags: [%s]",
+ printf("%s Setup Priority: %u, Holding Priority: %u, Flags: [%s] (%#x)",
ident,
(int)*obj_tptr,
(int)*(obj_tptr+1),
- tok2str(rsvp_session_attribute_flag_values,
+ bittok2str(rsvp_session_attribute_flag_values,
"none",
- *(obj_tptr+2)));
-
+ *(obj_tptr+2)),
+ *(obj_tptr+2));
obj_tlen-=4+*(obj_tptr+3);
obj_tptr+=4+*(obj_tptr+3);
break;
@@ -1306,6 +1400,20 @@
obj_tlen-=20;
obj_tptr+=20;
break;
+ case RSVP_CTYPE_13: /* IPv6 p2mp LSP tunnel */
+ if (obj_tlen < 40)
+ return-1;
+ printf("%s IPv6 Tunnel Sender Address: %s, LSP ID: 0x%04x"
+ "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
+ ident,
+ ip6addr_string(obj_tptr),
+ EXTRACT_16BITS(obj_tptr+18),
+ ident,
+ ip6addr_string(obj_tptr+20),
+ EXTRACT_16BITS(obj_tptr+38));
+ obj_tlen-=40;
+ obj_tptr+=40;
+ break;
#endif
case RSVP_CTYPE_TUNNEL_IPV4:
if (obj_tlen < 8)
@@ -1317,6 +1425,20 @@
obj_tlen-=8;
obj_tptr+=8;
break;
+ case RSVP_CTYPE_12: /* IPv4 p2mp LSP tunnel */
+ if (obj_tlen < 16)
+ return-1;
+ printf("%s IPv4 Tunnel Sender Address: %s, LSP ID: 0x%04x"
+ "%s Sub-Group Originator ID: %s, Sub-Group ID: 0x%04x",
+ ident,
+ ipaddr_string(obj_tptr),
+ EXTRACT_16BITS(obj_tptr+6),
+ ident,
+ ipaddr_string(obj_tptr+8),
+ EXTRACT_16BITS(obj_tptr+12));
+ obj_tlen-=16;
+ obj_tptr+=16;
+ break;
default:
hexdump=TRUE;
}
@@ -1544,12 +1666,21 @@
bittok2str(rsvp_obj_integrity_flag_values,
"none",
obj_ptr.rsvp_obj_integrity->flags));
- printf("%s MD5-sum 0x%08x%08x%08x%08x (unverified)",
+ printf("%s MD5-sum 0x%08x%08x%08x%08x ",
ident,
EXTRACT_32BITS(obj_ptr.rsvp_obj_integrity->digest),
EXTRACT_32BITS(obj_ptr.rsvp_obj_integrity->digest+4),
EXTRACT_32BITS(obj_ptr.rsvp_obj_integrity->digest+8),
EXTRACT_32BITS(obj_ptr.rsvp_obj_integrity->digest+12));
+
+#ifdef HAVE_LIBCRYPTO
+ sigcheck = signature_verify(pptr, plen, (unsigned char *)obj_ptr.\
+ rsvp_obj_integrity->digest);
+#else
+ sigcheck = CANT_CHECK_SIGNATURE;
+#endif
+ printf(" (%s)", tok2str(signature_check_values, "Unknown", sigcheck));
+
obj_tlen+=sizeof(struct rsvp_obj_integrity_t);
obj_tptr+=sizeof(struct rsvp_obj_integrity_t);
break;
@@ -1613,7 +1744,32 @@
break;
}
break;
+ default:
+ hexdump=TRUE;
+ }
+ case RSVP_OBJ_S2L:
+ switch (rsvp_obj_ctype) {
+ case RSVP_CTYPE_IPV4:
+ if (obj_tlen < 4)
+ return-1;
+ printf("%s Sub-LSP destination address: %s",
+ ident, ipaddr_string(obj_tptr));
+
+ obj_tlen-=4;
+ obj_tptr+=4;
+ break;
+#ifdef INET6
+ case RSVP_CTYPE_IPV6:
+ if (obj_tlen < 16)
+ return-1;
+ printf("%s Sub-LSP destination address: %s",
+ ident, ip6addr_string(obj_tptr));
+
+ obj_tlen-=16;
+ obj_tptr+=16;
+ break;
+#endif
default:
hexdump=TRUE;
}
@@ -1634,7 +1790,7 @@
}
/* do we also want to see a hex dump ? */
if (vflag > 1 || hexdump==TRUE)
- print_unknown_data(tptr+sizeof(sizeof(struct rsvp_object_header)),"\n\t ", /* FIXME indentation */
+ print_unknown_data(tptr+sizeof(struct rsvp_object_header),"\n\t ", /* FIXME indentation */
rsvp_obj_len-sizeof(struct rsvp_object_header));
tptr+=rsvp_obj_len;
@@ -1650,13 +1806,13 @@
void
rsvp_print(register const u_char *pptr, register u_int len) {
- const struct rsvp_common_header *rsvp_com_header;
+ struct rsvp_common_header *rsvp_com_header;
const u_char *tptr,*subtptr;
- u_short tlen,subtlen;
+ u_short plen, tlen, subtlen;
tptr=pptr;
- rsvp_com_header = (const struct rsvp_common_header *)pptr;
+ rsvp_com_header = (struct rsvp_common_header *)pptr;
TCHECK(*rsvp_com_header);
/*
@@ -1679,7 +1835,7 @@
/* ok they seem to want to know everything - lets fully decode it */
- tlen=EXTRACT_16BITS(rsvp_com_header->length);
+ plen = tlen = EXTRACT_16BITS(rsvp_com_header->length);
printf("\n\tRSVPv%u %s Message (%u), Flags: [%s], length: %u, ttl: %u, checksum: 0x%04x",
RSVP_EXTRACT_VERSION(rsvp_com_header->version_flags),
@@ -1690,6 +1846,12 @@
rsvp_com_header->ttl,
EXTRACT_16BITS(rsvp_com_header->checksum));
+ /*
+ * Clear checksum prior to signature verification.
+ */
+ rsvp_com_header->checksum[0] = 0;
+ rsvp_com_header->checksum[1] = 0;
+
if (tlen < sizeof(const struct rsvp_common_header)) {
printf("ERROR: common header too short %u < %lu", tlen,
(unsigned long)sizeof(const struct rsvp_common_header));
@@ -1704,7 +1866,7 @@
case RSVP_MSGTYPE_AGGREGATE:
while(tlen > 0) {
subtptr=tptr;
- rsvp_com_header = (const struct rsvp_common_header *)subtptr;
+ rsvp_com_header = (struct rsvp_common_header *)subtptr;
TCHECK(*rsvp_com_header);
/*
@@ -1725,6 +1887,12 @@
subtlen,
rsvp_com_header->ttl,
EXTRACT_16BITS(rsvp_com_header->checksum));
+
+ /*
+ * Clear checksum prior to signature verification.
+ */
+ rsvp_com_header->checksum[0] = 0;
+ rsvp_com_header->checksum[1] = 0;
if (subtlen < sizeof(const struct rsvp_common_header)) {
printf("ERROR: common header too short %u < %lu", subtlen,
@@ -1741,7 +1909,7 @@
subtptr+=sizeof(const struct rsvp_common_header);
subtlen-=sizeof(const struct rsvp_common_header);
- if (rsvp_obj_print(subtptr,"\n\t ", subtlen) == -1)
+ if (rsvp_obj_print(pptr, plen, subtptr,"\n\t ", subtlen) == -1)
return;
tptr+=subtlen+sizeof(const struct rsvp_common_header);
@@ -1761,7 +1929,7 @@
case RSVP_MSGTYPE_HELLO:
case RSVP_MSGTYPE_ACK:
case RSVP_MSGTYPE_SREFRESH:
- if (rsvp_obj_print(tptr,"\n\t ", tlen) == -1)
+ if (rsvp_obj_print(pptr, plen, tptr,"\n\t ", tlen) == -1)
return;
break;
Modified: trunk/contrib/tcpdump/print-rt6.c
===================================================================
--- trunk/contrib/tcpdump/print-rt6.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-rt6.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-rt6.c,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-rt6.c,v 1.27 2005-04-20 22:34:57 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-rx.c
===================================================================
--- trunk/contrib/tcpdump/print-rx.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-rx.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -34,7 +34,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-rx.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-rx.c,v 1.42 2008-07-01 07:44:50 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -118,6 +118,12 @@
{ 162, "dfs-flushcps" },
{ 163, "dfs-symlink" },
{ 220, "residency" },
+ { 65536, "inline-bulk-status" },
+ { 65537, "fetch-data-64" },
+ { 65538, "store-data-64" },
+ { 65539, "give-up-all-cbs" },
+ { 65540, "get-caps" },
+ { 65541, "cb-rx-conn-addr" },
{ 0, NULL },
};
@@ -137,6 +143,9 @@
{ 216, "getcellservdb" },
{ 217, "getlocalcell" },
{ 218, "getcacheconf" },
+ { 65536, "getce64" },
+ { 65537, "getcellbynum" },
+ { 65538, "tellmeaboutyourself" },
{ 0, NULL },
};
@@ -163,6 +172,7 @@
{ 519, "get-host-cps" },
{ 520, "update-entry" },
{ 521, "list-entries" },
+ { 530, "list-super-groups" },
{ 0, NULL },
};
@@ -256,6 +266,9 @@
{ 126, "set-info" },
{ 127, "x-list-partitions" },
{ 128, "forward-multiple" },
+ { 65536, "convert-ro" },
+ { 65537, "get-size" },
+ { 65538, "dump-v2" },
{ 0, NULL },
};
@@ -307,6 +320,8 @@
{ 10003, "vote-getsyncsite" },
{ 10004, "vote-debug" },
{ 10005, "vote-sdebug" },
+ { 10006, "vote-xdebug" },
+ { 10007, "vote-xsdebug" },
{ 20000, "disk-begin" },
{ 20001, "disk-commit" },
{ 20002, "disk-lock" },
@@ -325,7 +340,7 @@
};
#define VOTE_LOW 10000
-#define VOTE_HIGH 10005
+#define VOTE_HIGH 10007
#define DISK_LOW 20000
#define DISK_HIGH 20013
@@ -688,6 +703,13 @@
printf(" %lu", i); \
}
+#define UINT64OUT() { u_int64_t i; \
+ TCHECK2(bp[0], sizeof(u_int64_t)); \
+ i = EXTRACT_64BITS(bp); \
+ bp += sizeof(u_int64_t); \
+ printf(" %" PRIu64, i); \
+ }
+
#define DATEOUT() { time_t t; struct tm *tm; char str[256]; \
TCHECK2(bp[0], sizeof(int32_t)); \
t = (time_t) EXTRACT_32BITS(bp); \
@@ -763,6 +785,17 @@
printf("\""); \
}
+#define DESTSERVEROUT() { unsigned long n1, n2, n3; \
+ TCHECK2(bp[0], sizeof(int32_t) * 3); \
+ n1 = EXTRACT_32BITS(bp); \
+ bp += sizeof(int32_t); \
+ n2 = EXTRACT_32BITS(bp); \
+ bp += sizeof(int32_t); \
+ n3 = EXTRACT_32BITS(bp); \
+ bp += sizeof(int32_t); \
+ printf(" server %d:%d:%d", (int) n1, (int) n2, (int) n3); \
+ }
+
/*
* Handle calls to the AFS file service (fs)
*/
@@ -890,6 +923,7 @@
STROUT(AFSNAMEMAX);
break;
case 155: /* Bulk stat */
+ case 65536: /* Inline bulk stat */
{
unsigned long j;
TCHECK2(bp[0], 4);
@@ -904,6 +938,26 @@
if (j == 0)
printf(" <none!>");
}
+ case 65537: /* Fetch data 64 */
+ FIDOUT();
+ printf(" offset");
+ UINT64OUT();
+ printf(" length");
+ UINT64OUT();
+ break;
+ case 65538: /* Store data 64 */
+ FIDOUT();
+ STOREATTROUT();
+ printf(" offset");
+ UINT64OUT();
+ printf(" length");
+ UINT64OUT();
+ printf(" flen");
+ UINT64OUT();
+ break;
+ case 65541: /* CallBack rx conn address */
+ printf(" addr");
+ UINTOUT();
default:
;
}
@@ -1267,6 +1321,7 @@
case 517: /* List owned */
case 518: /* Get CPS2 */
case 519: /* Get host CPS */
+ case 530: /* List super groups */
printf(" id");
INTOUT();
break;
@@ -1915,13 +1970,176 @@
printf(" vol call %s", tok2str(vol_req, "op#%d", vol_op));
- /*
- * Normally there would be a switch statement here to decode the
- * arguments to the AFS call, but since I don't have access to
- * an AFS server (yet) and I'm not an AFS admin, I can't
- * test any of these calls. Leave this blank for now.
- */
+ bp += sizeof(struct rx_header) + 4;
+ switch (vol_op) {
+ case 100: /* Create volume */
+ printf(" partition");
+ UINTOUT();
+ printf(" name");
+ STROUT(AFSNAMEMAX);
+ printf(" type");
+ UINTOUT();
+ printf(" parent");
+ UINTOUT();
+ break;
+ case 101: /* Delete volume */
+ case 107: /* Get flags */
+ printf(" trans");
+ UINTOUT();
+ break;
+ case 102: /* Restore */
+ printf(" totrans");
+ UINTOUT();
+ printf(" flags");
+ UINTOUT();
+ break;
+ case 103: /* Forward */
+ printf(" fromtrans");
+ UINTOUT();
+ printf(" fromdate");
+ DATEOUT();
+ DESTSERVEROUT();
+ printf(" desttrans");
+ INTOUT();
+ break;
+ case 104: /* End trans */
+ printf(" trans");
+ UINTOUT();
+ break;
+ case 105: /* Clone */
+ printf(" trans");
+ UINTOUT();
+ printf(" purgevol");
+ UINTOUT();
+ printf(" newtype");
+ UINTOUT();
+ printf(" newname");
+ STROUT(AFSNAMEMAX);
+ break;
+ case 106: /* Set flags */
+ printf(" trans");
+ UINTOUT();
+ printf(" flags");
+ UINTOUT();
+ break;
+ case 108: /* Trans create */
+ printf(" vol");
+ UINTOUT();
+ printf(" partition");
+ UINTOUT();
+ printf(" flags");
+ UINTOUT();
+ break;
+ case 109: /* Dump */
+ case 655537: /* Get size */
+ printf(" fromtrans");
+ UINTOUT();
+ printf(" fromdate");
+ DATEOUT();
+ break;
+ case 110: /* Get n-th volume */
+ printf(" index");
+ UINTOUT();
+ break;
+ case 111: /* Set forwarding */
+ printf(" tid");
+ UINTOUT();
+ printf(" newsite");
+ UINTOUT();
+ break;
+ case 112: /* Get name */
+ case 113: /* Get status */
+ printf(" tid");
+ break;
+ case 114: /* Signal restore */
+ printf(" name");
+ STROUT(AFSNAMEMAX);
+ printf(" type");
+ UINTOUT();
+ printf(" pid");
+ UINTOUT();
+ printf(" cloneid");
+ UINTOUT();
+ break;
+ case 116: /* List volumes */
+ printf(" partition");
+ UINTOUT();
+ printf(" flags");
+ UINTOUT();
+ break;
+ case 117: /* Set id types */
+ printf(" tid");
+ UINTOUT();
+ printf(" name");
+ STROUT(AFSNAMEMAX);
+ printf(" type");
+ UINTOUT();
+ printf(" pid");
+ UINTOUT();
+ printf(" clone");
+ UINTOUT();
+ printf(" backup");
+ UINTOUT();
+ break;
+ case 119: /* Partition info */
+ printf(" name");
+ STROUT(AFSNAMEMAX);
+ break;
+ case 120: /* Reclone */
+ printf(" tid");
+ UINTOUT();
+ break;
+ case 121: /* List one volume */
+ case 122: /* Nuke volume */
+ case 124: /* Extended List volumes */
+ case 125: /* Extended List one volume */
+ case 65536: /* Convert RO to RW volume */
+ printf(" partid");
+ UINTOUT();
+ printf(" volid");
+ UINTOUT();
+ break;
+ case 123: /* Set date */
+ printf(" tid");
+ UINTOUT();
+ printf(" date");
+ DATEOUT();
+ break;
+ case 126: /* Set info */
+ printf(" tid");
+ UINTOUT();
+ break;
+ case 128: /* Forward multiple */
+ printf(" fromtrans");
+ UINTOUT();
+ printf(" fromdate");
+ DATEOUT();
+ {
+ unsigned long i, j;
+ TCHECK2(bp[0], 4);
+ j = EXTRACT_32BITS(bp);
+ bp += sizeof(int32_t);
+ for (i = 0; i < j; i++) {
+ DESTSERVEROUT();
+ if (i != j - 1)
+ printf(",");
+ }
+ if (j == 0)
+ printf(" <none!>");
+ }
+ break;
+ case 65538: /* Dump version 2 */
+ printf(" fromtrans");
+ UINTOUT();
+ printf(" fromdate");
+ DATEOUT();
+ printf(" flags");
+ UINTOUT();
+ break;
+ default:
+ ;
+ }
return;
trunc:
@@ -1955,10 +2173,100 @@
* If it was a data packet, interpret the response.
*/
- if (rxh->type == RX_PACKET_TYPE_DATA)
- /* Well, no, not really. Leave this for later */
- ;
- else {
+ if (rxh->type == RX_PACKET_TYPE_DATA) {
+ switch (opcode) {
+ case 100: /* Create volume */
+ printf(" volid");
+ UINTOUT();
+ printf(" trans");
+ UINTOUT();
+ break;
+ case 104: /* End transaction */
+ UINTOUT();
+ break;
+ case 105: /* Clone */
+ printf(" newvol");
+ UINTOUT();
+ break;
+ case 107: /* Get flags */
+ UINTOUT();
+ break;
+ case 108: /* Transaction create */
+ printf(" trans");
+ UINTOUT();
+ break;
+ case 110: /* Get n-th volume */
+ printf(" volume");
+ UINTOUT();
+ printf(" partition");
+ UINTOUT();
+ break;
+ case 112: /* Get name */
+ STROUT(AFSNAMEMAX);
+ break;
+ case 113: /* Get status */
+ printf(" volid");
+ UINTOUT();
+ printf(" nextuniq");
+ UINTOUT();
+ printf(" type");
+ UINTOUT();
+ printf(" parentid");
+ UINTOUT();
+ printf(" clone");
+ UINTOUT();
+ printf(" backup");
+ UINTOUT();
+ printf(" restore");
+ UINTOUT();
+ printf(" maxquota");
+ UINTOUT();
+ printf(" minquota");
+ UINTOUT();
+ printf(" owner");
+ UINTOUT();
+ printf(" create");
+ DATEOUT();
+ printf(" access");
+ DATEOUT();
+ printf(" update");
+ DATEOUT();
+ printf(" expire");
+ DATEOUT();
+ printf(" backup");
+ DATEOUT();
+ printf(" copy");
+ DATEOUT();
+ break;
+ case 115: /* Old list partitions */
+ break;
+ case 116: /* List volumes */
+ case 121: /* List one volume */
+ {
+ unsigned long i, j;
+ TCHECK2(bp[0], 4);
+ j = EXTRACT_32BITS(bp);
+ bp += sizeof(int32_t);
+ for (i = 0; i < j; i++) {
+ printf(" name");
+ VECOUT(32);
+ printf(" volid");
+ UINTOUT();
+ printf(" type");
+ bp += sizeof(int32_t) * 21;
+ if (i != j - 1)
+ printf(",");
+ }
+ if (j == 0)
+ printf(" <none!>");
+ }
+ break;
+
+
+ default:
+ ;
+ }
+ } else {
/*
* Otherwise, just print out the return code
*/
Modified: trunk/contrib/tcpdump/print-sctp.c
===================================================================
--- trunk/contrib/tcpdump/print-sctp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-sctp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -35,7 +35,7 @@
#ifndef lint
static const char rcsid[] _U_ =
-"@(#) $Header: /home/cvs/src/contrib/tcpdump/print-sctp.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (NETLAB/PEL)";
+"@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.21 2007-09-13 18:03:49 guy Exp $ (NETLAB/PEL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -59,6 +59,29 @@
#include "ip6.h"
#endif
+#define CHAN_HP 6704
+#define CHAN_MP 6705
+#define CHAN_LP 6706
+
+struct tok ForCES_channels[] = {
+ { CHAN_HP, "ForCES HP" },
+ { CHAN_MP, "ForCES MP" },
+ { CHAN_LP, "ForCES LP" },
+ { 0, NULL }
+};
+
+static inline int isForCES_port(u_short Port)
+{
+ if (Port == CHAN_HP)
+ return 1;
+ if (Port == CHAN_MP)
+ return 1;
+ if (Port == CHAN_LP)
+ return 1;
+
+ return 0;
+}
+
void sctp_print(const u_char *bp, /* beginning of sctp packet */
const u_char *bp2, /* beginning of enclosing */
u_int sctpPacketLength) /* ip packet */
@@ -74,7 +97,9 @@
const struct sctpChunkDesc *chunkDescPtr;
const void *nextChunk;
const char *sep;
+ int isforces = 0;
+
sctpPktHdr = (const struct sctpHeader*) bp;
endPacketPtr = (const u_char*)sctpPktHdr+sctpPacketLength;
@@ -120,6 +145,15 @@
}
fflush(stdout);
+ if (isForCES_port(sourcePort)) {
+ printf("[%s]", tok2str(ForCES_channels, NULL, sourcePort));
+ isforces = 1;
+ }
+ if (isForCES_port(destPort)) {
+ printf("[%s]", tok2str(ForCES_channels, NULL, destPort));
+ isforces = 1;
+ }
+
if (vflag >= 2)
sep = "\n\t";
else
@@ -193,9 +227,23 @@
printf("[SSEQ %u] ", EXTRACT_16BITS(&dataHdrPtr->sequence));
printf("[PPID 0x%x] ", EXTRACT_32BITS(&dataHdrPtr->payloadtype));
fflush(stdout);
+ if (isforces) {
+ const u_char *payloadPtr;
+ u_int chunksize = sizeof(struct sctpDataPart)+
+ sizeof(struct sctpChunkDesc);
+ payloadPtr = (const u_char *) (dataHdrPtr + 1);
+ if (EXTRACT_16BITS(&chunkDescPtr->chunkLength) <
+ sizeof(struct sctpDataPart)+
+ sizeof(struct sctpChunkDesc)+1) {
+ /* Less than 1 byte of chunk payload */
+ printf("bogus ForCES chunk length %u]",
+ EXTRACT_16BITS(&chunkDescPtr->chunkLength));
+ return;
+ }
- if (vflag >= 2) /* if verbose output is specified */
- { /* at the command line */
+ forces_print(payloadPtr, EXTRACT_16BITS(&chunkDescPtr->chunkLength)- chunksize);
+ } else if (vflag >= 2) { /* if verbose output is specified */
+ /* at the command line */
const u_char *payloadPtr;
printf("[Payload");
@@ -203,16 +251,16 @@
if (!suppress_default_print) {
payloadPtr = (const u_char *) (++dataHdrPtr);
printf(":");
- if (htons(chunkDescPtr->chunkLength) <
+ if (EXTRACT_16BITS(&chunkDescPtr->chunkLength) <
sizeof(struct sctpDataPart)+
sizeof(struct sctpChunkDesc)+1) {
/* Less than 1 byte of chunk payload */
printf("bogus chunk length %u]",
- htons(chunkDescPtr->chunkLength));
+ EXTRACT_16BITS(&chunkDescPtr->chunkLength));
return;
}
default_print(payloadPtr,
- htons(chunkDescPtr->chunkLength) -
+ EXTRACT_16BITS(&chunkDescPtr->chunkLength) -
(sizeof(struct sctpDataPart)+
sizeof(struct sctpChunkDesc)));
} else
Added: trunk/contrib/tcpdump/print-sflow.c
===================================================================
--- trunk/contrib/tcpdump/print-sflow.c (rev 0)
+++ trunk/contrib/tcpdump/print-sflow.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,934 @@
+/*
+ * Copyright (c) 1998-2007 The TCPDUMP project
+ *
+ * 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.
+ *
+ * The SFLOW protocol as per http://www.sflow.org/developers/specifications.php
+ *
+ * Original code by Carles Kishimoto <carles.kishimoto at gmail.com>
+ *
+ * Expansion and refactoring by Rick Jones <rick.jones2 at hp.com>
+ */
+
+#ifndef lint
+static const char rcsid[] _U_ =
+"@(#) $Header: /tcpdump/master/tcpdump/print-sflow.c,v 1.1 2007-08-08 17:20:58 hannes Exp $";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "interface.h"
+#include "extract.h"
+#include "addrtoname.h"
+
+/*
+ * sFlow datagram
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Sflow version (2,4,5) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | IP version (1 for IPv4 | 2 for IPv6) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | IP Address AGENT (4 or 16 bytes) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Sub agent ID |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Datagram sequence number |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Switch uptime in ms |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | num samples in datagram |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ */
+
+struct sflow_datagram_t {
+ u_int8_t version[4];
+ u_int8_t ip_version[4];
+ u_int8_t agent[4];
+ u_int8_t agent_id[4];
+ u_int8_t seqnum[4];
+ u_int8_t uptime[4];
+ u_int8_t samples[4];
+};
+
+struct sflow_sample_header {
+ u_int8_t format[4];
+ u_int8_t len[4];
+};
+
+#define SFLOW_FLOW_SAMPLE 1
+#define SFLOW_COUNTER_SAMPLE 2
+#define SFLOW_EXPANDED_FLOW_SAMPLE 3
+#define SFLOW_EXPANDED_COUNTER_SAMPLE 4
+
+static const struct tok sflow_format_values[] = {
+ { SFLOW_FLOW_SAMPLE, "flow sample" },
+ { SFLOW_COUNTER_SAMPLE, "counter sample" },
+ { SFLOW_EXPANDED_FLOW_SAMPLE, "expanded flow sample" },
+ { SFLOW_EXPANDED_COUNTER_SAMPLE, "expanded counter sample" },
+ { 0, NULL}
+};
+
+struct sflow_flow_sample_t {
+ u_int8_t seqnum[4];
+ u_int8_t typesource[4];
+ u_int8_t rate[4];
+ u_int8_t pool[4];
+ u_int8_t drops[4];
+ u_int8_t in_interface[4];
+ u_int8_t out_interface[4];
+ u_int8_t records[4];
+
+};
+
+struct sflow_expanded_flow_sample_t {
+ u_int8_t seqnum[4];
+ u_int8_t type[4];
+ u_int8_t index[4];
+ u_int8_t rate[4];
+ u_int8_t pool[4];
+ u_int8_t drops[4];
+ u_int8_t in_interface_format[4];
+ u_int8_t in_interface_value[4];
+ u_int8_t out_interface_format[4];
+ u_int8_t out_interface_value[4];
+ u_int8_t records[4];
+};
+
+#define SFLOW_FLOW_RAW_PACKET 1
+#define SFLOW_FLOW_ETHERNET_FRAME 2
+#define SFLOW_FLOW_IPV4_DATA 3
+#define SFLOW_FLOW_IPV6_DATA 4
+#define SFLOW_FLOW_EXTENDED_SWITCH_DATA 1001
+#define SFLOW_FLOW_EXTENDED_ROUTER_DATA 1002
+#define SFLOW_FLOW_EXTENDED_GATEWAY_DATA 1003
+#define SFLOW_FLOW_EXTENDED_USER_DATA 1004
+#define SFLOW_FLOW_EXTENDED_URL_DATA 1005
+#define SFLOW_FLOW_EXTENDED_MPLS_DATA 1006
+#define SFLOW_FLOW_EXTENDED_NAT_DATA 1007
+#define SFLOW_FLOW_EXTENDED_MPLS_TUNNEL 1008
+#define SFLOW_FLOW_EXTENDED_MPLS_VC 1009
+#define SFLOW_FLOW_EXTENDED_MPLS_FEC 1010
+#define SFLOW_FLOW_EXTENDED_MPLS_LVP_FEC 1011
+#define SFLOW_FLOW_EXTENDED_VLAN_TUNNEL 1012
+
+static const struct tok sflow_flow_type_values[] = {
+ { SFLOW_FLOW_RAW_PACKET, "Raw packet"},
+ { SFLOW_FLOW_ETHERNET_FRAME, "Ethernet frame"},
+ { SFLOW_FLOW_IPV4_DATA, "IPv4 Data"},
+ { SFLOW_FLOW_IPV6_DATA, "IPv6 Data"},
+ { SFLOW_FLOW_EXTENDED_SWITCH_DATA, "Extended Switch data"},
+ { SFLOW_FLOW_EXTENDED_ROUTER_DATA, "Extended Router data"},
+ { SFLOW_FLOW_EXTENDED_GATEWAY_DATA, "Extended Gateway data"},
+ { SFLOW_FLOW_EXTENDED_USER_DATA, "Extended User data"},
+ { SFLOW_FLOW_EXTENDED_URL_DATA, "Extended URL data"},
+ { SFLOW_FLOW_EXTENDED_MPLS_DATA, "Extended MPLS data"},
+ { SFLOW_FLOW_EXTENDED_NAT_DATA, "Extended NAT data"},
+ { SFLOW_FLOW_EXTENDED_MPLS_TUNNEL, "Extended MPLS tunnel"},
+ { SFLOW_FLOW_EXTENDED_MPLS_VC, "Extended MPLS VC"},
+ { SFLOW_FLOW_EXTENDED_MPLS_FEC, "Extended MPLS FEC"},
+ { SFLOW_FLOW_EXTENDED_MPLS_LVP_FEC, "Extended MPLS LVP FEC"},
+ { SFLOW_FLOW_EXTENDED_VLAN_TUNNEL, "Extended VLAN Tunnel"},
+ { 0, NULL}
+};
+
+#define SFLOW_HEADER_PROTOCOL_ETHERNET 1
+#define SFLOW_HEADER_PROTOCOL_IPV4 11
+#define SFLOW_HEADER_PROTOCOL_IPV6 12
+
+static const struct tok sflow_flow_raw_protocol_values[] = {
+ { SFLOW_HEADER_PROTOCOL_ETHERNET, "Ethernet"},
+ { SFLOW_HEADER_PROTOCOL_IPV4, "IPv4"},
+ { SFLOW_HEADER_PROTOCOL_IPV6, "IPv6"},
+ { 0, NULL}
+};
+
+struct sflow_expanded_flow_raw_t {
+ u_int8_t protocol[4];
+ u_int8_t length[4];
+ u_int8_t stripped_bytes[4];
+ u_int8_t header_size[4];
+};
+
+struct sflow_ethernet_frame_t {
+ u_int8_t length[4];
+ u_int8_t src_mac[8];
+ u_int8_t dst_mac[8];
+ u_int8_t type[4];
+};
+
+struct sflow_extended_switch_data_t {
+ u_int8_t src_vlan[4];
+ u_int8_t src_pri[4];
+ u_int8_t dst_vlan[4];
+ u_int8_t dst_pri[4];
+};
+
+struct sflow_counter_record_t {
+ u_int8_t format[4];
+ u_int8_t length[4];
+};
+
+struct sflow_flow_record_t {
+ u_int8_t format[4];
+ u_int8_t length[4];
+};
+
+struct sflow_counter_sample_t {
+ u_int8_t seqnum[4];
+ u_int8_t typesource[4];
+ u_int8_t records[4];
+};
+
+struct sflow_expanded_counter_sample_t {
+ u_int8_t seqnum[4];
+ u_int8_t type[4];
+ u_int8_t index[4];
+ u_int8_t records[4];
+};
+
+#define SFLOW_COUNTER_GENERIC 1
+#define SFLOW_COUNTER_ETHERNET 2
+#define SFLOW_COUNTER_TOKEN_RING 3
+#define SFLOW_COUNTER_BASEVG 4
+#define SFLOW_COUNTER_VLAN 5
+#define SFLOW_COUNTER_PROCESSOR 1001
+
+static const struct tok sflow_counter_type_values[] = {
+ { SFLOW_COUNTER_GENERIC, "Generic counter"},
+ { SFLOW_COUNTER_ETHERNET, "Ethernet counter"},
+ { SFLOW_COUNTER_TOKEN_RING, "Token ring counter"},
+ { SFLOW_COUNTER_BASEVG, "100 BaseVG counter"},
+ { SFLOW_COUNTER_VLAN, "Vlan counter"},
+ { SFLOW_COUNTER_PROCESSOR, "Processor counter"},
+ { 0, NULL}
+};
+
+#define SFLOW_IFACE_DIRECTION_UNKNOWN 0
+#define SFLOW_IFACE_DIRECTION_FULLDUPLEX 1
+#define SFLOW_IFACE_DIRECTION_HALFDUPLEX 2
+#define SFLOW_IFACE_DIRECTION_IN 3
+#define SFLOW_IFACE_DIRECTION_OUT 4
+
+static const struct tok sflow_iface_direction_values[] = {
+ { SFLOW_IFACE_DIRECTION_UNKNOWN, "unknown"},
+ { SFLOW_IFACE_DIRECTION_FULLDUPLEX, "full-duplex"},
+ { SFLOW_IFACE_DIRECTION_HALFDUPLEX, "half-duplex"},
+ { SFLOW_IFACE_DIRECTION_IN, "in"},
+ { SFLOW_IFACE_DIRECTION_OUT, "out"},
+ { 0, NULL}
+};
+
+struct sflow_generic_counter_t {
+ u_int8_t ifindex[4];
+ u_int8_t iftype[4];
+ u_int8_t ifspeed[8];
+ u_int8_t ifdirection[4];
+ u_int8_t ifstatus[4];
+ u_int8_t ifinoctets[8];
+ u_int8_t ifinunicastpkts[4];
+ u_int8_t ifinmulticastpkts[4];
+ u_int8_t ifinbroadcastpkts[4];
+ u_int8_t ifindiscards[4];
+ u_int8_t ifinerrors[4];
+ u_int8_t ifinunkownprotos[4];
+ u_int8_t ifoutoctets[8];
+ u_int8_t ifoutunicastpkts[4];
+ u_int8_t ifoutmulticastpkts[4];
+ u_int8_t ifoutbroadcastpkts[4];
+ u_int8_t ifoutdiscards[4];
+ u_int8_t ifouterrors[4];
+ u_int8_t ifpromiscmode[4];
+};
+
+struct sflow_ethernet_counter_t {
+ u_int8_t alignerrors[4];
+ u_int8_t fcserrors[4];
+ u_int8_t single_collision_frames[4];
+ u_int8_t multiple_collision_frames[4];
+ u_int8_t test_errors[4];
+ u_int8_t deferred_transmissions[4];
+ u_int8_t late_collisions[4];
+ u_int8_t excessive_collisions[4];
+ u_int8_t mac_transmit_errors[4];
+ u_int8_t carrier_sense_errors[4];
+ u_int8_t frame_too_longs[4];
+ u_int8_t mac_receive_errors[4];
+ u_int8_t symbol_errors[4];
+};
+
+struct sflow_100basevg_counter_t {
+ u_int8_t in_highpriority_frames[4];
+ u_int8_t in_highpriority_octets[8];
+ u_int8_t in_normpriority_frames[4];
+ u_int8_t in_normpriority_octets[8];
+ u_int8_t in_ipmerrors[4];
+ u_int8_t in_oversized[4];
+ u_int8_t in_data_errors[4];
+ u_int8_t in_null_addressed_frames[4];
+ u_int8_t out_highpriority_frames[4];
+ u_int8_t out_highpriority_octets[8];
+ u_int8_t transitioninto_frames[4];
+ u_int8_t hc_in_highpriority_octets[8];
+ u_int8_t hc_in_normpriority_octets[8];
+ u_int8_t hc_out_highpriority_octets[8];
+};
+
+struct sflow_vlan_counter_t {
+ u_int8_t vlan_id[4];
+ u_int8_t octets[8];
+ u_int8_t unicast_pkt[4];
+ u_int8_t multicast_pkt[4];
+ u_int8_t broadcast_pkt[4];
+ u_int8_t discards[4];
+};
+
+static int
+print_sflow_counter_generic(const u_char *pointer, u_int len) {
+
+ const struct sflow_generic_counter_t *sflow_gen_counter;
+
+ if (len < sizeof(struct sflow_generic_counter_t))
+ return 1;
+
+
+ sflow_gen_counter = (const struct sflow_generic_counter_t *)pointer;
+ printf("\n\t ifindex %u, iftype %u, ifspeed %" PRIu64 ", ifdirection %u (%s)",
+ EXTRACT_32BITS(sflow_gen_counter->ifindex),
+ EXTRACT_32BITS(sflow_gen_counter->iftype),
+ EXTRACT_64BITS(sflow_gen_counter->ifspeed),
+ EXTRACT_32BITS(sflow_gen_counter->ifdirection),
+ tok2str(sflow_iface_direction_values, "Unknown",
+ EXTRACT_32BITS(sflow_gen_counter->ifdirection)));
+ printf("\n\t ifstatus %u, adminstatus: %s, operstatus: %s",
+ EXTRACT_32BITS(sflow_gen_counter->ifstatus),
+ EXTRACT_32BITS(sflow_gen_counter->ifstatus)&1 ? "up" : "down",
+ (EXTRACT_32BITS(sflow_gen_counter->ifstatus)>>1)&1 ? "up" : "down");
+ printf("\n\t In octets %" PRIu64
+ ", unicast pkts %u, multicast pkts %u, broadcast pkts %u, discards %u",
+ EXTRACT_64BITS(sflow_gen_counter->ifinoctets),
+ EXTRACT_32BITS(sflow_gen_counter->ifinunicastpkts),
+ EXTRACT_32BITS(sflow_gen_counter->ifinmulticastpkts),
+ EXTRACT_32BITS(sflow_gen_counter->ifinbroadcastpkts),
+ EXTRACT_32BITS(sflow_gen_counter->ifindiscards));
+ printf("\n\t In errors %u, unknown protos %u",
+ EXTRACT_32BITS(sflow_gen_counter->ifinerrors),
+ EXTRACT_32BITS(sflow_gen_counter->ifinunkownprotos));
+ printf("\n\t Out octets %" PRIu64
+ ", unicast pkts %u, multicast pkts %u, broadcast pkts %u, discards %u",
+ EXTRACT_64BITS(sflow_gen_counter->ifoutoctets),
+ EXTRACT_32BITS(sflow_gen_counter->ifoutunicastpkts),
+ EXTRACT_32BITS(sflow_gen_counter->ifoutmulticastpkts),
+ EXTRACT_32BITS(sflow_gen_counter->ifoutbroadcastpkts),
+ EXTRACT_32BITS(sflow_gen_counter->ifoutdiscards));
+ printf("\n\t Out errors %u, promisc mode %u",
+ EXTRACT_32BITS(sflow_gen_counter->ifouterrors),
+ EXTRACT_32BITS(sflow_gen_counter->ifpromiscmode));
+
+ return 0;
+}
+
+static int
+print_sflow_counter_ethernet(const u_char *pointer, u_int len){
+
+ const struct sflow_ethernet_counter_t *sflow_eth_counter;
+
+ if (len < sizeof(struct sflow_ethernet_counter_t))
+ return 1;
+
+ sflow_eth_counter = (const struct sflow_ethernet_counter_t *)pointer;
+ printf("\n\t align errors %u, fcs errors %u, single collision %u, multiple collision %u, test error %u",
+ EXTRACT_32BITS(sflow_eth_counter->alignerrors),
+ EXTRACT_32BITS(sflow_eth_counter->fcserrors),
+ EXTRACT_32BITS(sflow_eth_counter->single_collision_frames),
+ EXTRACT_32BITS(sflow_eth_counter->multiple_collision_frames),
+ EXTRACT_32BITS(sflow_eth_counter->test_errors));
+ printf("\n\t deferred %u, late collision %u, excessive collision %u, mac trans error %u",
+ EXTRACT_32BITS(sflow_eth_counter->deferred_transmissions),
+ EXTRACT_32BITS(sflow_eth_counter->late_collisions),
+ EXTRACT_32BITS(sflow_eth_counter->excessive_collisions),
+ EXTRACT_32BITS(sflow_eth_counter->mac_transmit_errors));
+ printf("\n\t carrier error %u, frames too long %u, mac receive errors %u, symbol errors %u",
+ EXTRACT_32BITS(sflow_eth_counter->carrier_sense_errors),
+ EXTRACT_32BITS(sflow_eth_counter->frame_too_longs),
+ EXTRACT_32BITS(sflow_eth_counter->mac_receive_errors),
+ EXTRACT_32BITS(sflow_eth_counter->symbol_errors));
+
+ return 0;
+}
+
+static int
+print_sflow_counter_token_ring(const u_char *pointer _U_, u_int len _U_) {
+
+ return 0;
+}
+
+static int
+print_sflow_counter_basevg(const u_char *pointer, u_int len) {
+
+ const struct sflow_100basevg_counter_t *sflow_100basevg_counter;
+
+ if (len < sizeof(struct sflow_100basevg_counter_t))
+ return 1;
+
+ sflow_100basevg_counter = (const struct sflow_100basevg_counter_t *)pointer;
+ printf("\n\t in high prio frames %u, in high prio octets %" PRIu64,
+ EXTRACT_32BITS(sflow_100basevg_counter->in_highpriority_frames),
+ EXTRACT_64BITS(sflow_100basevg_counter->in_highpriority_octets));
+ printf("\n\t in norm prio frames %u, in norm prio octets %" PRIu64,
+ EXTRACT_32BITS(sflow_100basevg_counter->in_normpriority_frames),
+ EXTRACT_64BITS(sflow_100basevg_counter->in_normpriority_octets));
+ printf("\n\t in ipm errors %u, oversized %u, in data errors %u, null addressed frames %u",
+ EXTRACT_32BITS(sflow_100basevg_counter->in_ipmerrors),
+ EXTRACT_32BITS(sflow_100basevg_counter->in_oversized),
+ EXTRACT_32BITS(sflow_100basevg_counter->in_data_errors),
+ EXTRACT_32BITS(sflow_100basevg_counter->in_null_addressed_frames));
+ printf("\n\t out high prio frames %u, out high prio octets %" PRIu64
+ ", trans into frames %u",
+ EXTRACT_32BITS(sflow_100basevg_counter->out_highpriority_frames),
+ EXTRACT_64BITS(sflow_100basevg_counter->out_highpriority_octets),
+ EXTRACT_32BITS(sflow_100basevg_counter->transitioninto_frames));
+ printf("\n\t in hc high prio octets %" PRIu64
+ ", in hc norm prio octets %" PRIu64
+ ", out hc high prio octets %" PRIu64,
+ EXTRACT_64BITS(sflow_100basevg_counter->hc_in_highpriority_octets),
+ EXTRACT_64BITS(sflow_100basevg_counter->hc_in_normpriority_octets),
+ EXTRACT_64BITS(sflow_100basevg_counter->hc_out_highpriority_octets));
+
+ return 0;
+}
+
+static int
+print_sflow_counter_vlan(const u_char *pointer, u_int len) {
+
+ const struct sflow_vlan_counter_t *sflow_vlan_counter;
+
+ if (len < sizeof(struct sflow_vlan_counter_t))
+ return 1;
+
+ sflow_vlan_counter = (const struct sflow_vlan_counter_t *)pointer;
+ printf("\n\t vlan_id %u, octets %" PRIu64
+ ", unicast_pkt %u, multicast_pkt %u, broadcast_pkt %u, discards %u",
+ EXTRACT_32BITS(sflow_vlan_counter->vlan_id),
+ EXTRACT_64BITS(sflow_vlan_counter->octets),
+ EXTRACT_32BITS(sflow_vlan_counter->unicast_pkt),
+ EXTRACT_32BITS(sflow_vlan_counter->multicast_pkt),
+ EXTRACT_32BITS(sflow_vlan_counter->broadcast_pkt),
+ EXTRACT_32BITS(sflow_vlan_counter->discards));
+
+ return 0;
+}
+
+struct sflow_processor_counter_t {
+ u_int8_t five_sec_util[4];
+ u_int8_t one_min_util[4];
+ u_int8_t five_min_util[4];
+ u_int8_t total_memory[8];
+ u_int8_t free_memory[8];
+};
+
+static int
+print_sflow_counter_processor(const u_char *pointer, u_int len) {
+
+ const struct sflow_processor_counter_t *sflow_processor_counter;
+
+ if (len < sizeof(struct sflow_processor_counter_t))
+ return 1;
+
+ sflow_processor_counter = (const struct sflow_processor_counter_t *)pointer;
+ printf("\n\t 5sec %u, 1min %u, 5min %u, total_mem %" PRIu64
+ ", total_mem %" PRIu64,
+ EXTRACT_32BITS(sflow_processor_counter->five_sec_util),
+ EXTRACT_32BITS(sflow_processor_counter->one_min_util),
+ EXTRACT_32BITS(sflow_processor_counter->five_min_util),
+ EXTRACT_64BITS(sflow_processor_counter->total_memory),
+ EXTRACT_64BITS(sflow_processor_counter->free_memory));
+
+ return 0;
+}
+
+static int
+sflow_print_counter_records(const u_char *pointer, u_int len, u_int records) {
+
+ u_int nrecords;
+ const u_char *tptr;
+ u_int tlen;
+ u_int counter_type;
+ u_int counter_len;
+ u_int enterprise;
+ const struct sflow_counter_record_t *sflow_counter_record;
+
+ nrecords = records;
+ tptr = pointer;
+ tlen = len;
+
+ while (nrecords > 0) {
+ /* do we have the "header?" */
+ if (tlen < sizeof(struct sflow_counter_record_t))
+ return 1;
+ sflow_counter_record = (const struct sflow_counter_record_t *)tptr;
+
+ enterprise = EXTRACT_32BITS(sflow_counter_record->format);
+ counter_type = enterprise & 0x0FFF;
+ enterprise = enterprise >> 20;
+ counter_len = EXTRACT_32BITS(sflow_counter_record->length);
+ printf("\n\t enterprise %u, %s (%u) length %u",
+ enterprise,
+ (enterprise == 0) ? tok2str(sflow_counter_type_values,"Unknown",counter_type) : "Unknown",
+ counter_type,
+ counter_len);
+
+ tptr += sizeof(struct sflow_counter_record_t);
+ tlen -= sizeof(struct sflow_counter_record_t);
+
+ if (tlen < counter_len)
+ return 1;
+ if (enterprise == 0) {
+ switch (counter_type) {
+ case SFLOW_COUNTER_GENERIC:
+ if (print_sflow_counter_generic(tptr,tlen))
+ return 1;
+ break;
+ case SFLOW_COUNTER_ETHERNET:
+ if (print_sflow_counter_ethernet(tptr,tlen))
+ return 1;
+ break;
+ case SFLOW_COUNTER_TOKEN_RING:
+ if (print_sflow_counter_token_ring(tptr,tlen))
+ return 1;
+ break;
+ case SFLOW_COUNTER_BASEVG:
+ if (print_sflow_counter_basevg(tptr,tlen))
+ return 1;
+ break;
+ case SFLOW_COUNTER_VLAN:
+ if (print_sflow_counter_vlan(tptr,tlen))
+ return 1;
+ break;
+ case SFLOW_COUNTER_PROCESSOR:
+ if (print_sflow_counter_processor(tptr,tlen))
+ return 1;
+ break;
+ default:
+ if (vflag <= 1)
+ print_unknown_data(tptr, "\n\t\t", counter_len);
+ break;
+ }
+ }
+ tptr += counter_len;
+ tlen -= counter_len;
+ nrecords--;
+
+ }
+
+ return 0;
+}
+
+
+static int
+sflow_print_counter_sample(const u_char *pointer, u_int len) {
+
+ const struct sflow_counter_sample_t *sflow_counter_sample;
+ u_int nrecords;
+ u_int typesource;
+ u_int type;
+ u_int index;
+
+
+ if (len < sizeof(struct sflow_counter_sample_t))
+ return 1;
+
+ sflow_counter_sample = (const struct sflow_counter_sample_t *)pointer;
+
+ typesource = EXTRACT_32BITS(sflow_counter_sample->typesource);
+ nrecords = EXTRACT_32BITS(sflow_counter_sample->records);
+ type = typesource >> 24;
+ index = typesource & 0x0FFF;
+
+ printf(" seqnum %u, type %u, idx %u, records %u",
+ EXTRACT_32BITS(sflow_counter_sample->seqnum),
+ type,
+ index,
+ nrecords);
+
+ return sflow_print_counter_records(pointer + sizeof(struct sflow_counter_sample_t),
+ len - sizeof(struct sflow_counter_sample_t),
+ nrecords);
+
+}
+
+static int
+sflow_print_expanded_counter_sample(const u_char *pointer, u_int len) {
+
+ const struct sflow_expanded_counter_sample_t *sflow_expanded_counter_sample;
+ u_int nrecords;
+
+
+ if (len < sizeof(struct sflow_expanded_counter_sample_t))
+ return 1;
+
+ sflow_expanded_counter_sample = (const struct sflow_expanded_counter_sample_t *)pointer;
+
+ nrecords = EXTRACT_32BITS(sflow_expanded_counter_sample->records);
+
+ printf(" seqnum %u, type %u, idx %u, records %u",
+ EXTRACT_32BITS(sflow_expanded_counter_sample->seqnum),
+ EXTRACT_32BITS(sflow_expanded_counter_sample->type),
+ EXTRACT_32BITS(sflow_expanded_counter_sample->index),
+ nrecords);
+
+ return sflow_print_counter_records(pointer + sizeof(struct sflow_expanded_counter_sample_t),
+ len - sizeof(struct sflow_expanded_counter_sample_t),
+ nrecords);
+
+}
+
+static int
+print_sflow_raw_packet(const u_char *pointer, u_int len) {
+
+ const struct sflow_expanded_flow_raw_t *sflow_flow_raw;
+
+ if (len < sizeof(struct sflow_expanded_flow_raw_t))
+ return 1;
+
+ sflow_flow_raw = (const struct sflow_expanded_flow_raw_t *)pointer;
+ printf("\n\t protocol %s (%u), length %u, stripped bytes %u, header_size %u",
+ tok2str(sflow_flow_raw_protocol_values,"Unknown",EXTRACT_32BITS(sflow_flow_raw->protocol)),
+ EXTRACT_32BITS(sflow_flow_raw->protocol),
+ EXTRACT_32BITS(sflow_flow_raw->length),
+ EXTRACT_32BITS(sflow_flow_raw->stripped_bytes),
+ EXTRACT_32BITS(sflow_flow_raw->header_size));
+
+ /* QUESTION - should we attempt to print the raw header itself?
+ assuming of course there is wnough data present to do so... */
+
+ return 0;
+}
+
+static int
+print_sflow_ethernet_frame(const u_char *pointer, u_int len) {
+
+ const struct sflow_ethernet_frame_t *sflow_ethernet_frame;
+
+ if (len < sizeof(struct sflow_ethernet_frame_t))
+ return 1;
+
+ sflow_ethernet_frame = (const struct sflow_ethernet_frame_t *)pointer;
+
+ printf("\n\t frame len %u, type %u",
+ EXTRACT_32BITS(sflow_ethernet_frame->length),
+ EXTRACT_32BITS(sflow_ethernet_frame->type));
+
+ return 0;
+}
+
+static int
+print_sflow_extended_switch_data(const u_char *pointer, u_int len) {
+
+ const struct sflow_extended_switch_data_t *sflow_extended_sw_data;
+
+ if (len < sizeof(struct sflow_extended_switch_data_t))
+ return 1;
+
+ sflow_extended_sw_data = (const struct sflow_extended_switch_data_t *)pointer;
+ printf("\n\t src vlan %u, src pri %u, dst vlan %u, dst pri %u",
+ EXTRACT_32BITS(sflow_extended_sw_data->src_vlan),
+ EXTRACT_32BITS(sflow_extended_sw_data->src_pri),
+ EXTRACT_32BITS(sflow_extended_sw_data->dst_vlan),
+ EXTRACT_32BITS(sflow_extended_sw_data->dst_pri));
+
+ return 0;
+}
+
+static int
+sflow_print_flow_records(const u_char *pointer, u_int len, u_int records) {
+
+ u_int nrecords;
+ const u_char *tptr;
+ u_int tlen;
+ u_int flow_type;
+ u_int enterprise;
+ u_int flow_len;
+ const struct sflow_flow_record_t *sflow_flow_record;
+
+ nrecords = records;
+ tptr = pointer;
+ tlen = len;
+
+ while (nrecords > 0) {
+ /* do we have the "header?" */
+ if (tlen < sizeof(struct sflow_flow_record_t))
+ return 1;
+
+ sflow_flow_record = (const struct sflow_flow_record_t *)tptr;
+
+ /* so, the funky encoding means we cannot blythly mask-off
+ bits, we must also check the enterprise. */
+
+ enterprise = EXTRACT_32BITS(sflow_flow_record->format);
+ flow_type = enterprise & 0x0FFF;
+ enterprise = enterprise >> 12;
+ flow_len = EXTRACT_32BITS(sflow_flow_record->length);
+ printf("\n\t enterprise %u %s (%u) length %u",
+ enterprise,
+ (enterprise == 0) ? tok2str(sflow_flow_type_values,"Unknown",flow_type) : "Unknown",
+ flow_type,
+ flow_len);
+
+ tptr += sizeof(struct sflow_flow_record_t);
+ tlen -= sizeof(struct sflow_flow_record_t);
+
+ if (tlen < flow_len)
+ return 1;
+
+ if (enterprise == 0) {
+ switch (flow_type) {
+ case SFLOW_FLOW_RAW_PACKET:
+ if (print_sflow_raw_packet(tptr,tlen))
+ return 1;
+ break;
+ case SFLOW_FLOW_EXTENDED_SWITCH_DATA:
+ if (print_sflow_extended_switch_data(tptr,tlen))
+ return 1;
+ break;
+ case SFLOW_FLOW_ETHERNET_FRAME:
+ if (print_sflow_ethernet_frame(tptr,tlen))
+ return 1;
+ break;
+ /* FIXME these need a decoder */
+ case SFLOW_FLOW_IPV4_DATA:
+ case SFLOW_FLOW_IPV6_DATA:
+ case SFLOW_FLOW_EXTENDED_ROUTER_DATA:
+ case SFLOW_FLOW_EXTENDED_GATEWAY_DATA:
+ case SFLOW_FLOW_EXTENDED_USER_DATA:
+ case SFLOW_FLOW_EXTENDED_URL_DATA:
+ case SFLOW_FLOW_EXTENDED_MPLS_DATA:
+ case SFLOW_FLOW_EXTENDED_NAT_DATA:
+ case SFLOW_FLOW_EXTENDED_MPLS_TUNNEL:
+ case SFLOW_FLOW_EXTENDED_MPLS_VC:
+ case SFLOW_FLOW_EXTENDED_MPLS_FEC:
+ case SFLOW_FLOW_EXTENDED_MPLS_LVP_FEC:
+ case SFLOW_FLOW_EXTENDED_VLAN_TUNNEL:
+ break;
+ default:
+ if (vflag <= 1)
+ print_unknown_data(tptr, "\n\t\t", flow_len);
+ break;
+ }
+ }
+ tptr += flow_len;
+ tlen -= flow_len;
+ nrecords--;
+
+ }
+
+ return 0;
+}
+
+static int
+sflow_print_flow_sample(const u_char *pointer, u_int len) {
+
+ const struct sflow_flow_sample_t *sflow_flow_sample;
+ u_int nrecords;
+ u_int typesource;
+ u_int type;
+ u_int index;
+
+ if (len < sizeof(struct sflow_flow_sample_t))
+ return 1;
+
+ sflow_flow_sample = (struct sflow_flow_sample_t *)pointer;
+
+ typesource = EXTRACT_32BITS(sflow_flow_sample->typesource);
+ nrecords = EXTRACT_32BITS(sflow_flow_sample->records);
+ type = typesource >> 24;
+ index = typesource & 0x0FFF;
+
+ printf(" seqnum %u, type %u, idx %u, rate %u, pool %u, drops %u, input %u output %u records %u",
+ EXTRACT_32BITS(sflow_flow_sample->seqnum),
+ type,
+ index,
+ EXTRACT_32BITS(sflow_flow_sample->rate),
+ EXTRACT_32BITS(sflow_flow_sample->pool),
+ EXTRACT_32BITS(sflow_flow_sample->drops),
+ EXTRACT_32BITS(sflow_flow_sample->in_interface),
+ EXTRACT_32BITS(sflow_flow_sample->out_interface),
+ nrecords);
+
+ return sflow_print_flow_records(pointer + sizeof(struct sflow_flow_sample_t),
+ len - sizeof(struct sflow_flow_sample_t),
+ nrecords);
+
+}
+
+static int
+sflow_print_expanded_flow_sample(const u_char *pointer, u_int len) {
+
+ const struct sflow_expanded_flow_sample_t *sflow_expanded_flow_sample;
+ u_int nrecords;
+
+ if (len < sizeof(struct sflow_expanded_flow_sample_t))
+ return 1;
+
+ sflow_expanded_flow_sample = (const struct sflow_expanded_flow_sample_t *)pointer;
+
+ nrecords = EXTRACT_32BITS(sflow_expanded_flow_sample->records);
+
+ printf(" seqnum %u, type %u, idx %u, rate %u, pool %u, drops %u, records %u",
+ EXTRACT_32BITS(sflow_expanded_flow_sample->seqnum),
+ EXTRACT_32BITS(sflow_expanded_flow_sample->type),
+ EXTRACT_32BITS(sflow_expanded_flow_sample->index),
+ EXTRACT_32BITS(sflow_expanded_flow_sample->rate),
+ EXTRACT_32BITS(sflow_expanded_flow_sample->pool),
+ EXTRACT_32BITS(sflow_expanded_flow_sample->drops),
+ EXTRACT_32BITS(sflow_expanded_flow_sample->records));
+
+ return sflow_print_flow_records(pointer + sizeof(struct sflow_expanded_flow_sample_t),
+ len - sizeof(struct sflow_expanded_flow_sample_t),
+ nrecords);
+
+}
+
+void
+sflow_print(const u_char *pptr, u_int len) {
+
+ const struct sflow_datagram_t *sflow_datagram;
+ const struct sflow_sample_header *sflow_sample;
+
+ const u_char *tptr;
+ u_int tlen;
+ u_int32_t sflow_sample_type, sflow_sample_len;
+ u_int32_t nsamples;
+
+
+ tptr = pptr;
+ tlen = len;
+ sflow_datagram = (const struct sflow_datagram_t *)pptr;
+ TCHECK(*sflow_datagram);
+
+ /*
+ * Sanity checking of the header.
+ */
+ if (EXTRACT_32BITS(sflow_datagram->version) != 5) {
+ printf("sFlow version %u packet not supported",
+ EXTRACT_32BITS(sflow_datagram->version));
+ return;
+ }
+
+ if (vflag < 1) {
+ printf("sFlowv%u, %s agent %s, agent-id %u, length %u",
+ EXTRACT_32BITS(sflow_datagram->version),
+ EXTRACT_32BITS(sflow_datagram->ip_version) == 1 ? "IPv4" : "IPv6",
+ ipaddr_string(sflow_datagram->agent),
+ EXTRACT_32BITS(sflow_datagram->samples),
+ len);
+ return;
+ }
+
+ /* ok they seem to want to know everything - lets fully decode it */
+ nsamples=EXTRACT_32BITS(sflow_datagram->samples);
+ printf("sFlowv%u, %s agent %s, agent-id %u, seqnum %u, uptime %u, samples %u, length %u",
+ EXTRACT_32BITS(sflow_datagram->version),
+ EXTRACT_32BITS(sflow_datagram->ip_version) == 1 ? "IPv4" : "IPv6",
+ ipaddr_string(sflow_datagram->agent),
+ EXTRACT_32BITS(sflow_datagram->agent_id),
+ EXTRACT_32BITS(sflow_datagram->seqnum),
+ EXTRACT_32BITS(sflow_datagram->uptime),
+ nsamples,
+ len);
+
+ /* skip Common header */
+ tptr += sizeof(const struct sflow_datagram_t);
+ tlen -= sizeof(const struct sflow_datagram_t);
+
+ while (nsamples > 0 && tlen > 0) {
+ sflow_sample = (const struct sflow_sample_header *)tptr;
+ TCHECK(*sflow_sample);
+
+ sflow_sample_type = (EXTRACT_32BITS(sflow_sample->format)&0x0FFF);
+ sflow_sample_len = EXTRACT_32BITS(sflow_sample->len);
+
+ if (tlen < sizeof(struct sflow_sample_header))
+ goto trunc;
+
+ tptr += sizeof(struct sflow_sample_header);
+ tlen -= sizeof(struct sflow_sample_header);
+
+ printf("\n\t%s (%u), length %u,",
+ tok2str(sflow_format_values, "Unknown", sflow_sample_type),
+ sflow_sample_type,
+ sflow_sample_len);
+
+ /* basic sanity check */
+ if (sflow_sample_type == 0 || sflow_sample_len ==0) {
+ return;
+ }
+
+ if (tlen < sflow_sample_len)
+ goto trunc;
+
+ /* did we capture enough for fully decoding the sample ? */
+ TCHECK2(*tptr, sflow_sample_len);
+
+ switch(sflow_sample_type) {
+ case SFLOW_FLOW_SAMPLE:
+ if (sflow_print_flow_sample(tptr,tlen))
+ goto trunc;
+ break;
+
+ case SFLOW_COUNTER_SAMPLE:
+ if (sflow_print_counter_sample(tptr,tlen))
+ goto trunc;
+ break;
+
+ case SFLOW_EXPANDED_FLOW_SAMPLE:
+ if (sflow_print_expanded_flow_sample(tptr,tlen))
+ goto trunc;
+ break;
+
+ case SFLOW_EXPANDED_COUNTER_SAMPLE:
+ if (sflow_print_expanded_counter_sample(tptr,tlen))
+ goto trunc;
+ break;
+
+ default:
+ if (vflag <= 1)
+ print_unknown_data(tptr, "\n\t ", sflow_sample_len);
+ break;
+ }
+ tptr += sflow_sample_len;
+ tlen -= sflow_sample_len;
+ nsamples--;
+ }
+ return;
+
+ trunc:
+ printf("[|SFLOW]");
+}
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 4
+ * End:
+ */
Property changes on: trunk/contrib/tcpdump/print-sflow.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-sip.c
===================================================================
--- trunk/contrib/tcpdump/print-sip.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-sip.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -15,7 +15,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-sip.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-sip.c,v 1.1 2004-07-27 17:04:20 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -44,6 +44,7 @@
return;
for (idx = 0; idx < len; idx++) {
+ TCHECK2(*(pptr+idx), 2);
if (EXTRACT_16BITS(pptr+idx) != 0x0d0a) { /* linefeed ? */
safeputchar(*(pptr+idx));
} else {
@@ -57,4 +58,7 @@
print_unknown_data(pptr,"\n\t",len);
return;
+
+trunc:
+ printf("[|sip]");
}
Modified: trunk/contrib/tcpdump/print-sl.c
===================================================================
--- trunk/contrib/tcpdump/print-sl.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-sl.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,12 +18,12 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-sl.c,v 1.9 2005/05/29 19:09:27 sam Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-sl.c 236192 2012-05-28 19:13:21Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-sl.c,v 1.1.1.2 2006-02-25 02:34:03 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-sl.c,v 1.65 2005-04-06 21:32:42 mcr Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -75,7 +75,7 @@
break;
#ifdef INET6
case 6:
- ip6_print((u_char *)ip, length);
+ ip6_print(gndo, (u_char *)ip, length);
break;
#endif
default:
Modified: trunk/contrib/tcpdump/print-sll.c
===================================================================
--- trunk/contrib/tcpdump/print-sll.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-sll.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-sll.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-sll.c,v 1.19 2005-11-13 12:12:43 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -85,7 +85,7 @@
/*
* 802.2.
*/
- (void)printf("802.3");
+ (void)printf("802.2");
break;
default:
@@ -142,8 +142,9 @@
caplen -= SLL_HDR_LEN;
p += SLL_HDR_LEN;
- ether_type = ntohs(sllp->sll_protocol);
+ ether_type = EXTRACT_16BITS(&sllp->sll_protocol);
+recurse:
/*
* Is it (gag) an 802.3 encapsulation, or some non-Ethernet
* packet type?
@@ -187,13 +188,43 @@
default_print(p, caplen);
break;
}
- } else if (ether_encap_print(ether_type, p, length, caplen,
- &extracted_ethertype) == 0) {
- /* ether_type not known, print raw packet */
- if (!eflag)
- sll_print(sllp, length + SLL_HDR_LEN);
- if (!suppress_default_print)
- default_print(p, caplen);
+ } else if (ether_type == ETHERTYPE_8021Q) {
+ /*
+ * Print VLAN information, and then go back and process
+ * the enclosed type field.
+ */
+ if (caplen < 4 || length < 4) {
+ printf("[|vlan]");
+ return (SLL_HDR_LEN);
+ }
+ if (eflag) {
+ u_int16_t tag = EXTRACT_16BITS(p);
+
+ printf("vlan %u, p %u%s, ",
+ tag & 0xfff,
+ tag >> 13,
+ (tag & 0x1000) ? ", CFI" : "");
+ }
+
+ ether_type = EXTRACT_16BITS(p + 2);
+ if (ether_type <= ETHERMTU)
+ ether_type = LINUX_SLL_P_802_2;
+ if (!qflag) {
+ (void)printf("ethertype %s, ",
+ tok2str(ethertype_values, "Unknown", ether_type));
+ }
+ p += 4;
+ length -= 4;
+ caplen -= 4;
+ goto recurse;
+ } else {
+ if (ethertype_print(gndo, ether_type, p, length, caplen) == 0) {
+ /* ether_type not known, print raw packet */
+ if (!eflag)
+ sll_print(sllp, length + SLL_HDR_LEN);
+ if (!suppress_default_print)
+ default_print(p, caplen);
+ }
}
return (SLL_HDR_LEN);
Modified: trunk/contrib/tcpdump/print-slow.c
===================================================================
--- trunk/contrib/tcpdump/print-slow.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-slow.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998-2005 The TCPDUMP project
+ * Copyright (c) 1998-2006 The TCPDUMP project
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that: (1) source code
@@ -13,6 +13,7 @@
* FOR A PARTICULAR PURPOSE.
*
* support for the IEEE "slow protocols" LACP, MARKER as per 802.3ad
+ * OAM as per 802.3ah
*
* Original code by Hannes Gredler (hannes at juniper.net)
*/
@@ -19,7 +20,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-slow.c,v 1.1.1.1 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-slow.c,v 1.8 2006-10-12 05:44:33 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -36,8 +37,9 @@
#include "extract.h"
#include "addrtoname.h"
#include "ether.h"
+#include "oui.h"
-struct slow_common_header {
+struct slow_common_header_t {
u_int8_t proto_subtype;
u_int8_t version;
};
@@ -44,6 +46,7 @@
#define SLOW_PROTO_LACP 1
#define SLOW_PROTO_MARKER 2
+#define SLOW_PROTO_OAM 3
#define LACP_VERSION 1
#define MARKER_VERSION 1
@@ -51,9 +54,140 @@
static const struct tok slow_proto_values[] = {
{ SLOW_PROTO_LACP, "LACP" },
{ SLOW_PROTO_MARKER, "MARKER" },
+ { SLOW_PROTO_OAM, "OAM" },
{ 0, NULL}
};
+static const struct tok slow_oam_flag_values[] = {
+ { 0x0001, "Link Fault" },
+ { 0x0002, "Dying Gasp" },
+ { 0x0004, "Critical Event" },
+ { 0x0008, "Local Evaluating" },
+ { 0x0010, "Local Stable" },
+ { 0x0020, "Remote Evaluating" },
+ { 0x0040, "Remote Stable" },
+ { 0, NULL}
+};
+
+#define SLOW_OAM_CODE_INFO 0x00
+#define SLOW_OAM_CODE_EVENT_NOTIF 0x01
+#define SLOW_OAM_CODE_VAR_REQUEST 0x02
+#define SLOW_OAM_CODE_VAR_RESPONSE 0x03
+#define SLOW_OAM_CODE_LOOPBACK_CTRL 0x04
+#define SLOW_OAM_CODE_PRIVATE 0xfe
+
+static const struct tok slow_oam_code_values[] = {
+ { SLOW_OAM_CODE_INFO, "Information" },
+ { SLOW_OAM_CODE_EVENT_NOTIF, "Event Notification" },
+ { SLOW_OAM_CODE_VAR_REQUEST, "Variable Request" },
+ { SLOW_OAM_CODE_VAR_RESPONSE, "Variable Response" },
+ { SLOW_OAM_CODE_LOOPBACK_CTRL, "Loopback Control" },
+ { SLOW_OAM_CODE_PRIVATE, "Vendor Private" },
+ { 0, NULL}
+};
+
+struct slow_oam_info_t {
+ u_int8_t info_type;
+ u_int8_t info_length;
+ u_int8_t oam_version;
+ u_int8_t revision[2];
+ u_int8_t state;
+ u_int8_t oam_config;
+ u_int8_t oam_pdu_config[2];
+ u_int8_t oui[3];
+ u_int8_t vendor_private[4];
+};
+
+#define SLOW_OAM_INFO_TYPE_END_OF_TLV 0x00
+#define SLOW_OAM_INFO_TYPE_LOCAL 0x01
+#define SLOW_OAM_INFO_TYPE_REMOTE 0x02
+#define SLOW_OAM_INFO_TYPE_ORG_SPECIFIC 0xfe
+
+static const struct tok slow_oam_info_type_values[] = {
+ { SLOW_OAM_INFO_TYPE_END_OF_TLV, "End of TLV marker" },
+ { SLOW_OAM_INFO_TYPE_LOCAL, "Local" },
+ { SLOW_OAM_INFO_TYPE_REMOTE, "Remote" },
+ { SLOW_OAM_INFO_TYPE_ORG_SPECIFIC, "Organization specific" },
+ { 0, NULL}
+};
+
+#define OAM_INFO_TYPE_PARSER_MASK 0x3
+static const struct tok slow_oam_info_type_state_parser_values[] = {
+ { 0x00, "forwarding" },
+ { 0x01, "looping back" },
+ { 0x02, "discarding" },
+ { 0x03, "reserved" },
+ { 0, NULL}
+};
+
+#define OAM_INFO_TYPE_MUX_MASK 0x4
+static const struct tok slow_oam_info_type_state_mux_values[] = {
+ { 0x00, "forwarding" },
+ { 0x04, "discarding" },
+ { 0, NULL}
+};
+
+static const struct tok slow_oam_info_type_oam_config_values[] = {
+ { 0x01, "Active" },
+ { 0x02, "Unidirectional" },
+ { 0x04, "Remote-Loopback" },
+ { 0x08, "Link-Events" },
+ { 0x10, "Variable-Retrieval" },
+ { 0, NULL}
+};
+
+/* 11 Bits */
+#define OAM_INFO_TYPE_PDU_SIZE_MASK 0x7ff
+
+#define SLOW_OAM_LINK_EVENT_END_OF_TLV 0x00
+#define SLOW_OAM_LINK_EVENT_ERR_SYM_PER 0x01
+#define SLOW_OAM_LINK_EVENT_ERR_FRM 0x02
+#define SLOW_OAM_LINK_EVENT_ERR_FRM_PER 0x03
+#define SLOW_OAM_LINK_EVENT_ERR_FRM_SUMM 0x04
+#define SLOW_OAM_LINK_EVENT_ORG_SPECIFIC 0xfe
+
+static const struct tok slow_oam_link_event_values[] = {
+ { SLOW_OAM_LINK_EVENT_END_OF_TLV, "End of TLV marker" },
+ { SLOW_OAM_LINK_EVENT_ERR_SYM_PER, "Errored Symbol Period Event" },
+ { SLOW_OAM_LINK_EVENT_ERR_FRM, "Errored Frame Event" },
+ { SLOW_OAM_LINK_EVENT_ERR_FRM_PER, "Errored Frame Period Event" },
+ { SLOW_OAM_LINK_EVENT_ERR_FRM_SUMM, "Errored Frame Seconds Summary Event" },
+ { SLOW_OAM_LINK_EVENT_ORG_SPECIFIC, "Organization specific" },
+ { 0, NULL}
+};
+
+struct slow_oam_link_event_t {
+ u_int8_t event_type;
+ u_int8_t event_length;
+ u_int8_t time_stamp[2];
+ u_int8_t window[8];
+ u_int8_t threshold[8];
+ u_int8_t errors[8];
+ u_int8_t errors_running_total[8];
+ u_int8_t event_running_total[4];
+};
+
+struct slow_oam_variablerequest_t {
+ u_int8_t branch;
+ u_int8_t leaf[2];
+};
+
+struct slow_oam_variableresponse_t {
+ u_int8_t branch;
+ u_int8_t leaf[2];
+ u_int8_t length;
+};
+
+struct slow_oam_loopbackctrl_t {
+ u_int8_t command;
+};
+
+static const struct tok slow_oam_loopbackctrl_cmd_values[] = {
+ { 0x01, "Enable OAM Remote Loopback" },
+ { 0x02, "Disable OAM Remote Loopback" },
+ { 0, NULL}
+};
+
struct tlv_header_t {
u_int8_t type;
u_int8_t length;
@@ -116,51 +250,106 @@
u_int8_t pad[50];
};
+void slow_marker_lacp_print(register const u_char *, register u_int);
+void slow_oam_print(register const u_char *, register u_int);
+
+const struct slow_common_header_t *slow_com_header;
+
void
slow_print(register const u_char *pptr, register u_int len) {
- const struct slow_common_header *slow_com_header;
- const struct tlv_header_t *tlv_header;
- const u_char *tptr,*tlv_tptr;
- u_int tlv_len,tlen,tlv_tlen;
+ int print_version;
- union {
- const struct lacp_marker_tlv_terminator_t *lacp_marker_tlv_terminator;
- const struct lacp_tlv_actor_partner_info_t *lacp_tlv_actor_partner_info;
- const struct lacp_tlv_collector_info_t *lacp_tlv_collector_info;
- const struct marker_tlv_marker_info_t *marker_tlv_marker_info;
- } tlv_ptr;
-
- tptr=pptr;
- slow_com_header = (const struct slow_common_header *)pptr;
+ slow_com_header = (const struct slow_common_header_t *)pptr;
TCHECK(*slow_com_header);
/*
* Sanity checking of the header.
*/
- if (slow_com_header->proto_subtype == SLOW_PROTO_LACP &&
- slow_com_header->version != LACP_VERSION) {
- printf("LACP version %u packet not supported",slow_com_header->version);
- return;
+ switch (slow_com_header->proto_subtype) {
+ case SLOW_PROTO_LACP:
+ if (slow_com_header->version != LACP_VERSION) {
+ printf("LACP version %u packet not supported",slow_com_header->version);
+ return;
+ }
+ print_version = 1;
+ break;
+
+ case SLOW_PROTO_MARKER:
+ if (slow_com_header->version != MARKER_VERSION) {
+ printf("MARKER version %u packet not supported",slow_com_header->version);
+ return;
+ }
+ print_version = 1;
+ break;
+
+ case SLOW_PROTO_OAM: /* fall through */
+ print_version = 0;
+ break;
+
+ default:
+ /* print basic information and exit */
+ print_version = -1;
+ break;
}
- if (slow_com_header->proto_subtype == SLOW_PROTO_MARKER &&
- slow_com_header->version != MARKER_VERSION) {
- printf("MARKER version %u packet not supported",slow_com_header->version);
- return;
+
+ if (print_version) {
+ printf("%sv%u, length %u",
+ tok2str(slow_proto_values, "unknown (%u)",slow_com_header->proto_subtype),
+ slow_com_header->version,
+ len);
+ } else {
+ /* some slow protos don't have a version number in the header */
+ printf("%s, length %u",
+ tok2str(slow_proto_values, "unknown (%u)",slow_com_header->proto_subtype),
+ len);
}
- printf("%sv%u, length: %u",
- tok2str(slow_proto_values, "unknown (%u)",slow_com_header->proto_subtype),
- slow_com_header->version,
- len);
+ /* unrecognized subtype */
+ if (print_version == -1) {
+ print_unknown_data(pptr, "\n\t", len);
+ return;
+ }
if (!vflag)
return;
- /* ok they seem to want to know everything - lets fully decode it */
- tlen=len-sizeof(struct slow_common_header);
- tptr+=sizeof(const struct slow_common_header);
+ switch (slow_com_header->proto_subtype) {
+ default: /* should not happen */
+ break;
+ case SLOW_PROTO_OAM:
+ /* skip proto_subtype */
+ slow_oam_print(pptr+1, len-1);
+ break;
+
+ case SLOW_PROTO_LACP: /* LACP and MARKER share the same semantics */
+ case SLOW_PROTO_MARKER:
+ /* skip slow_common_header */
+ len -= sizeof(const struct slow_common_header_t);
+ pptr += sizeof(const struct slow_common_header_t);
+ slow_marker_lacp_print(pptr, len);
+ break;
+ }
+ return;
+
+trunc:
+ printf("\n\t\t packet exceeded snapshot");
+}
+
+void slow_marker_lacp_print(register const u_char *tptr, register u_int tlen) {
+
+ const struct tlv_header_t *tlv_header;
+ const u_char *tlv_tptr;
+ u_int tlv_len, tlv_tlen;
+
+ union {
+ const struct lacp_marker_tlv_terminator_t *lacp_marker_tlv_terminator;
+ const struct lacp_tlv_actor_partner_info_t *lacp_tlv_actor_partner_info;
+ const struct lacp_tlv_collector_info_t *lacp_tlv_collector_info;
+ const struct marker_tlv_marker_info_t *marker_tlv_marker_info;
+ } tlv_ptr;
+
while(tlen>0) {
/* did we capture enough for fully decoding the tlv header ? */
TCHECK2(*tptr, sizeof(struct tlv_header_t));
@@ -167,7 +356,7 @@
tlv_header = (const struct tlv_header_t *)tptr;
tlv_len = tlv_header->length;
- printf("\n\t%s TLV (0x%02x), length: %u",
+ printf("\n\t%s TLV (0x%02x), length %u",
tok2str(slow_tlv_values,
"Unknown",
(slow_com_header->proto_subtype << 8) + tlv_header->type),
@@ -179,7 +368,7 @@
tlv_header->type != LACP_TLV_TERMINATOR &&
tlv_header->type != MARKER_TLV_TERMINATOR) {
printf("\n\t-----trailing data-----");
- print_unknown_data(tptr+sizeof(sizeof(struct tlv_header_t)),"\n\t ",tlen);
+ print_unknown_data(tptr+sizeof(struct tlv_header_t),"\n\t ",tlen);
return;
}
@@ -250,10 +439,11 @@
print_unknown_data(tlv_tptr,"\n\t ",tlv_tlen);
break;
}
- /* do we want to see an additionally hexdump ? */
- if (vflag > 1)
- print_unknown_data(tptr+sizeof(sizeof(struct tlv_header_t)),"\n\t ",
+ /* do we want to see an additional hexdump ? */
+ if (vflag > 1) {
+ print_unknown_data(tptr+sizeof(struct tlv_header_t),"\n\t ",
tlv_len-sizeof(struct tlv_header_t));
+ }
tptr+=tlv_len;
tlen-=tlv_len;
@@ -262,3 +452,210 @@
trunc:
printf("\n\t\t packet exceeded snapshot");
}
+
+void slow_oam_print(register const u_char *tptr, register u_int tlen) {
+
+ u_int hexdump;
+
+ struct slow_oam_common_header_t {
+ u_int8_t flags[2];
+ u_int8_t code;
+ };
+
+ struct slow_oam_tlv_header_t {
+ u_int8_t type;
+ u_int8_t length;
+ };
+
+ union {
+ const struct slow_oam_common_header_t *slow_oam_common_header;
+ const struct slow_oam_tlv_header_t *slow_oam_tlv_header;
+ } ptr;
+
+ union {
+ const struct slow_oam_info_t *slow_oam_info;
+ const struct slow_oam_link_event_t *slow_oam_link_event;
+ const struct slow_oam_variablerequest_t *slow_oam_variablerequest;
+ const struct slow_oam_variableresponse_t *slow_oam_variableresponse;
+ const struct slow_oam_loopbackctrl_t *slow_oam_loopbackctrl;
+ } tlv;
+
+ ptr.slow_oam_common_header = (struct slow_oam_common_header_t *)tptr;
+ tptr += sizeof(struct slow_oam_common_header_t);
+ tlen -= sizeof(struct slow_oam_common_header_t);
+
+ printf("\n\tCode %s OAM PDU, Flags [%s]",
+ tok2str(slow_oam_code_values, "Unknown (%u)", ptr.slow_oam_common_header->code),
+ bittok2str(slow_oam_flag_values,
+ "none",
+ EXTRACT_16BITS(&ptr.slow_oam_common_header->flags)));
+
+ switch (ptr.slow_oam_common_header->code) {
+ case SLOW_OAM_CODE_INFO:
+ while (tlen > 0) {
+ ptr.slow_oam_tlv_header = (const struct slow_oam_tlv_header_t *)tptr;
+ printf("\n\t %s Information Type (%u), length %u",
+ tok2str(slow_oam_info_type_values, "Reserved",
+ ptr.slow_oam_tlv_header->type),
+ ptr.slow_oam_tlv_header->type,
+ ptr.slow_oam_tlv_header->length);
+
+ hexdump = FALSE;
+ switch (ptr.slow_oam_tlv_header->type) {
+ case SLOW_OAM_INFO_TYPE_END_OF_TLV:
+ if (ptr.slow_oam_tlv_header->length != 0) {
+ printf("\n\t ERROR: illegal length - should be 0");
+ }
+ return;
+
+ case SLOW_OAM_INFO_TYPE_LOCAL: /* identical format - fall through */
+ case SLOW_OAM_INFO_TYPE_REMOTE:
+ tlv.slow_oam_info = (const struct slow_oam_info_t *)tptr;
+
+ if (tlv.slow_oam_info->info_length !=
+ sizeof(struct slow_oam_info_t)) {
+ printf("\n\t ERROR: illegal length - should be %lu",
+ (unsigned long) sizeof(struct slow_oam_info_t));
+ return;
+ }
+
+ printf("\n\t OAM-Version %u, Revision %u",
+ tlv.slow_oam_info->oam_version,
+ EXTRACT_16BITS(&tlv.slow_oam_info->revision));
+
+ printf("\n\t State-Parser-Action %s, State-MUX-Action %s",
+ tok2str(slow_oam_info_type_state_parser_values, "Reserved",
+ tlv.slow_oam_info->state & OAM_INFO_TYPE_PARSER_MASK),
+ tok2str(slow_oam_info_type_state_mux_values, "Reserved",
+ tlv.slow_oam_info->state & OAM_INFO_TYPE_MUX_MASK));
+ printf("\n\t OAM-Config Flags [%s], OAM-PDU-Config max-PDU size %u",
+ bittok2str(slow_oam_info_type_oam_config_values, "none",
+ tlv.slow_oam_info->oam_config),
+ EXTRACT_16BITS(&tlv.slow_oam_info->oam_pdu_config) &
+ OAM_INFO_TYPE_PDU_SIZE_MASK);
+ printf("\n\t OUI %s (0x%06x), Vendor-Private 0x%08x",
+ tok2str(oui_values, "Unknown",
+ EXTRACT_24BITS(&tlv.slow_oam_info->oui)),
+ EXTRACT_24BITS(&tlv.slow_oam_info->oui),
+ EXTRACT_32BITS(&tlv.slow_oam_info->vendor_private));
+ break;
+
+ case SLOW_OAM_INFO_TYPE_ORG_SPECIFIC:
+ hexdump = TRUE;
+ break;
+
+ default:
+ hexdump = TRUE;
+ break;
+ }
+
+ /* infinite loop check */
+ if (!ptr.slow_oam_tlv_header->length) {
+ return;
+ }
+
+ /* do we also want to see a hex dump ? */
+ if (vflag > 1 || hexdump==TRUE) {
+ print_unknown_data(tptr,"\n\t ",
+ ptr.slow_oam_tlv_header->length);
+ }
+
+ tlen -= ptr.slow_oam_tlv_header->length;
+ tptr += ptr.slow_oam_tlv_header->length;
+ }
+ break;
+
+ case SLOW_OAM_CODE_EVENT_NOTIF:
+ while (tlen > 0) {
+ ptr.slow_oam_tlv_header = (const struct slow_oam_tlv_header_t *)tptr;
+ printf("\n\t %s Link Event Type (%u), length %u",
+ tok2str(slow_oam_link_event_values, "Reserved",
+ ptr.slow_oam_tlv_header->type),
+ ptr.slow_oam_tlv_header->type,
+ ptr.slow_oam_tlv_header->length);
+
+ hexdump = FALSE;
+ switch (ptr.slow_oam_tlv_header->type) {
+ case SLOW_OAM_LINK_EVENT_END_OF_TLV:
+ if (ptr.slow_oam_tlv_header->length != 0) {
+ printf("\n\t ERROR: illegal length - should be 0");
+ }
+ return;
+
+ case SLOW_OAM_LINK_EVENT_ERR_SYM_PER: /* identical format - fall through */
+ case SLOW_OAM_LINK_EVENT_ERR_FRM:
+ case SLOW_OAM_LINK_EVENT_ERR_FRM_PER:
+ case SLOW_OAM_LINK_EVENT_ERR_FRM_SUMM:
+ tlv.slow_oam_link_event = (const struct slow_oam_link_event_t *)tptr;
+
+ if (tlv.slow_oam_link_event->event_length !=
+ sizeof(struct slow_oam_link_event_t)) {
+ printf("\n\t ERROR: illegal length - should be %lu",
+ (unsigned long) sizeof(struct slow_oam_link_event_t));
+ return;
+ }
+
+ printf("\n\t Timestamp %u ms, Errored Window %" PRIu64
+ "\n\t Errored Threshold %" PRIu64
+ "\n\t Errors %" PRIu64
+ "\n\t Error Running Total %" PRIu64
+ "\n\t Event Running Total %u",
+ EXTRACT_16BITS(&tlv.slow_oam_link_event->time_stamp)*100,
+ EXTRACT_64BITS(&tlv.slow_oam_link_event->window),
+ EXTRACT_64BITS(&tlv.slow_oam_link_event->threshold),
+ EXTRACT_64BITS(&tlv.slow_oam_link_event->errors),
+ EXTRACT_64BITS(&tlv.slow_oam_link_event->errors_running_total),
+ EXTRACT_32BITS(&tlv.slow_oam_link_event->event_running_total));
+ break;
+
+ case SLOW_OAM_LINK_EVENT_ORG_SPECIFIC:
+ hexdump = TRUE;
+ break;
+
+ default:
+ hexdump = TRUE;
+ break;
+ }
+
+ /* infinite loop check */
+ if (!ptr.slow_oam_tlv_header->length) {
+ return;
+ }
+
+ /* do we also want to see a hex dump ? */
+ if (vflag > 1 || hexdump==TRUE) {
+ print_unknown_data(tptr,"\n\t ",
+ ptr.slow_oam_tlv_header->length);
+ }
+
+ tlen -= ptr.slow_oam_tlv_header->length;
+ tptr += ptr.slow_oam_tlv_header->length;
+ }
+ break;
+
+ case SLOW_OAM_CODE_LOOPBACK_CTRL:
+ tlv.slow_oam_loopbackctrl = (const struct slow_oam_loopbackctrl_t *)tptr;
+ printf("\n\t Command %s (%u)",
+ tok2str(slow_oam_loopbackctrl_cmd_values,
+ "Unknown",
+ tlv.slow_oam_loopbackctrl->command),
+ tlv.slow_oam_loopbackctrl->command);
+ tptr ++;
+ tlen --;
+ break;
+
+ /*
+ * FIXME those are the defined codes that lack a decoder
+ * you are welcome to contribute code ;-)
+ */
+ case SLOW_OAM_CODE_VAR_REQUEST:
+ case SLOW_OAM_CODE_VAR_RESPONSE:
+ case SLOW_OAM_CODE_PRIVATE:
+ default:
+ if (vflag <= 1) {
+ print_unknown_data(tptr,"\n\t ", tlen);
+ }
+ break;
+ }
+ return;
+}
Modified: trunk/contrib/tcpdump/print-smb.c
===================================================================
--- trunk/contrib/tcpdump/print-smb.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-smb.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -12,7 +12,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-smb.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-smb.c,v 1.47 2007-12-09 00:30:47 guy Exp $";
#endif
#include <tcpdump-stdinc.h>
@@ -1244,8 +1244,48 @@
return;
}
+/*
+ * Print an SMB-over-TCP packet received across tcp on port 445
+ */
+void
+smb_tcp_print (const u_char * data, int length)
+{
+ int caplen;
+ u_int smb_len;
+ const u_char *maxbuf;
+ if (length < 4)
+ goto trunc;
+ if (snapend < data)
+ goto trunc;
+ caplen = snapend - data;
+ if (caplen < 4)
+ goto trunc;
+ maxbuf = data + caplen;
+ smb_len = EXTRACT_24BITS(data + 1);
+ length -= 4;
+ caplen -= 4;
+ startbuf = data;
+ data += 4;
+
+ if (smb_len >= 4 && caplen >= 4 && memcmp(data,"\377SMB",4) == 0) {
+ if ((int)smb_len > caplen) {
+ if ((int)smb_len > length)
+ printf("WARNING: Packet is continued in later TCP segments\n");
+ else
+ printf("WARNING: Short packet. Try increasing the snap length by %d\n",
+ smb_len - caplen);
+ }
+ print_smb(data, maxbuf > data + smb_len ? data + smb_len : maxbuf);
+ } else
+ printf("SMB-over-TCP packet:(raw data or continuation?)\n");
+ return;
+trunc:
+ printf("[|SMB]");
+ return;
+}
+
/*
* print a NBT packet received across udp on port 138
*/
@@ -1459,8 +1499,7 @@
break;
if (memcmp(&data[i], "\377SMB", 4) == 0) {
smb_fdata(data, "\n>>> IPX transport ", &data[i], 0);
- if (data != NULL)
- print_smb(&data[i], maxbuf);
+ print_smb(&data[i], maxbuf);
printf("\n");
fflush(stdout);
break;
Modified: trunk/contrib/tcpdump/print-snmp.c
===================================================================
--- trunk/contrib/tcpdump/print-snmp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-snmp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -58,7 +58,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-snmp.c,v 1.1.1.2 2006-02-25 02:34:03 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-snmp.c,v 1.64 2005-05-06 07:56:53 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-stp.c
===================================================================
--- trunk/contrib/tcpdump/print-stp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-stp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -11,7 +11,7 @@
#ifndef lint
static const char rcsid[] _U_ =
-"@(#) $Header: /home/cvs/src/contrib/tcpdump/print-stp.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+"@(#) $Header: /tcpdump/master/tcpdump/print-stp.c,v 1.20 2007-03-18 17:11:46 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -52,11 +52,13 @@
#define STP_PROTO_REGULAR 0x00
#define STP_PROTO_RAPID 0x02
#define STP_PROTO_MSTP 0x03
+#define STP_PROTO_SPB 0x04
struct tok stp_proto_values[] = {
{ STP_PROTO_REGULAR, "802.1d" },
{ STP_PROTO_RAPID, "802.1w" },
{ STP_PROTO_MSTP, "802.1s" },
+ { STP_PROTO_SPB, "802.1aq" },
{ 0, NULL}
};
@@ -164,6 +166,30 @@
* 1 - byte CIST Remaining Hops
* 16 - bytes MSTI information [Max 64 MSTI, each 16 bytes]
*
+ *
+ * SPB BPDU
+ * Ref. IEEE 802.1aq. Section 14
+ *
+ * 2 - bytes Version 4 length
+ * 1 - byte Aux Config Identifier
+ * 32 - bytes Aux Config Name
+ * 2 - bytes Aux Revision level
+ * 16 - bytes Aux Config Digest [MD5]
+ * 1 - byte (1 - 2) Agreement Number
+ * (3 - 4) Discarded Agreement Number
+ * (5) Agreement Valid Flag
+ * (6) Restricted Role Flag
+ * (7 - 8) Unused sent zero
+ * 1 - byte Unused
+ * 1 - byte (1 - 4) Agreement Digest Format Identifier
+ * (5 - 8) Agreement Digest Format Capabilities
+ * 1 - byte (1 - 4) Agreement Digest Convention Identifier
+ * (5 - 8) Agreement Digest Convention Capabilities
+ * 2 - bytes Agreement Digest Edge Count
+ * 8 - byte Reserved Set
+ * 20 - bytes Computed Topology Digest
+ *
+ *
* MSTI Payload
*
* 1 - byte MSTI flag
@@ -172,6 +198,7 @@
* 1 - byte MSTI Bridge Priority
* 1 - byte MSTI Port Priority
* 1 - byte MSTI Remaining Hops
+ *
*/
#define MST_BPDU_MSTI_LENGTH 16
@@ -192,10 +219,24 @@
#define MST_BPDU_MSTI_PORT_PRIO_OFFSET 14
#define MST_BPDU_MSTI_REMAIN_HOPS_OFFSET 15
+#define SPB_BPDU_MIN_LEN 87
+#define SPB_BPDU_CONFIG_NAME_OFFSET 3
+#define SPB_BPDU_CONFIG_REV_OFFSET SPB_BPDU_CONFIG_NAME_OFFSET + 32
+#define SPB_BPDU_CONFIG_DIGEST_OFFSET SPB_BPDU_CONFIG_REV_OFFSET + 2
+#define SPB_BPDU_AGREEMENT_OFFSET SPB_BPDU_CONFIG_DIGEST_OFFSET + 16
+#define SPB_BPDU_AGREEMENT_UNUSED_OFFSET SPB_BPDU_AGREEMENT_OFFSET + 1
+#define SPB_BPDU_AGREEMENT_FORMAT_OFFSET SPB_BPDU_AGREEMENT_UNUSED_OFFSET + 1
+#define SPB_BPDU_AGREEMENT_CON_OFFSET SPB_BPDU_AGREEMENT_FORMAT_OFFSET + 1
+#define SPB_BPDU_AGREEMENT_EDGE_OFFSET SPB_BPDU_AGREEMENT_CON_OFFSET + 1
+#define SPB_BPDU_AGREEMENT_RES1_OFFSET SPB_BPDU_AGREEMENT_EDGE_OFFSET + 2
+#define SPB_BPDU_AGREEMENT_RES2_OFFSET SPB_BPDU_AGREEMENT_RES1_OFFSET + 4
+#define SPB_BPDU_AGREEMENT_DIGEST_OFFSET SPB_BPDU_AGREEMENT_RES2_OFFSET + 4
+
+
static void
stp_print_mstp_bpdu(const struct stp_bpdu_ *stp_bpdu, u_int length)
{
- const u_char *ptr;
+ const u_char *ptr;
u_int16_t v3len;
u_int16_t len;
u_int16_t msti;
@@ -202,8 +243,8 @@
u_int16_t offset;
ptr = (const u_char *)stp_bpdu;
- printf(", CIST Flags [%s]",
- bittok2str(stp_bpdu_flag_values, "none", stp_bpdu->flags));
+ printf(", CIST Flags [%s], length %u",
+ bittok2str(stp_bpdu_flag_values, "none", stp_bpdu->flags), length);
/*
* in non-verbose mode just print the flags. We dont read that much
@@ -213,11 +254,19 @@
return;
}
- printf(", CIST bridge-id %s.%04x, length %u",
- stp_print_bridge_id(ptr + MST_BPDU_CIST_BRIDGE_ID_OFFSET),
- EXTRACT_16BITS(&stp_bpdu->port_id), length);
+ printf("\n\tport-role %s, ",
+ tok2str(rstp_obj_port_role_values, "Unknown",
+ RSTP_EXTRACT_PORT_ROLE(stp_bpdu->flags)));
+ printf("CIST root-id %s, CIST ext-pathcost %u ",
+ stp_print_bridge_id((const u_char *)&stp_bpdu->root_id),
+ EXTRACT_32BITS(&stp_bpdu->root_path_cost));
+ printf("\n\tCIST regional-root-id %s, ",
+ stp_print_bridge_id((const u_char *)&stp_bpdu->bridge_id));
+
+ printf("CIST port-id %04x, ", EXTRACT_16BITS(&stp_bpdu->port_id));
+
printf("\n\tmessage-age %.2fs, max-age %.2fs"
", hello-time %.2fs, forwarding-delay %.2fs",
(float)EXTRACT_16BITS(&stp_bpdu->message_age) / STP_TIME_BASE,
@@ -225,28 +274,24 @@
(float)EXTRACT_16BITS(&stp_bpdu->hello_time) / STP_TIME_BASE,
(float)EXTRACT_16BITS(&stp_bpdu->forward_delay) / STP_TIME_BASE);
- printf("\n\tCIST root-id %s, ext-pathcost %u int-pathcost %u",
- stp_print_bridge_id((const u_char *)&stp_bpdu->root_id),
- EXTRACT_32BITS(&stp_bpdu->root_path_cost),
- EXTRACT_32BITS(ptr + MST_BPDU_CIST_INT_PATH_COST_OFFSET));
+ printf ("\n\tv3len %d, ", EXTRACT_16BITS(ptr + MST_BPDU_VER3_LEN_OFFSET));
+ printf("MCID Name %s, rev %u, "
+ "\n\t\tdigest %08x%08x%08x%08x, ",
+ ptr + MST_BPDU_CONFIG_NAME_OFFSET,
+ EXTRACT_16BITS(ptr + MST_BPDU_CONFIG_NAME_OFFSET + 32),
+ EXTRACT_32BITS(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET),
+ EXTRACT_32BITS(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 4),
+ EXTRACT_32BITS(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 8),
+ EXTRACT_32BITS(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 12));
- printf(", port-role %s",
- tok2str(rstp_obj_port_role_values, "Unknown",
- RSTP_EXTRACT_PORT_ROLE(stp_bpdu->flags)));
+ printf ("CIST int-root-pathcost %u, ",
+ EXTRACT_32BITS(ptr + MST_BPDU_CIST_INT_PATH_COST_OFFSET));
- printf("\n\tCIST regional-root-id %s",
- stp_print_bridge_id((const u_char *)&stp_bpdu->bridge_id));
+ printf("\n\tCIST bridge-id %s, ",
+ stp_print_bridge_id(ptr + MST_BPDU_CIST_BRIDGE_ID_OFFSET));
- printf("\n\tMSTP Configuration Name %s, revision %u, digest %08x%08x%08x%08x",
- ptr + MST_BPDU_CONFIG_NAME_OFFSET,
- EXTRACT_16BITS(ptr + MST_BPDU_CONFIG_NAME_OFFSET + 32),
- EXTRACT_32BITS(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET),
- EXTRACT_32BITS(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 4),
- EXTRACT_32BITS(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 8),
- EXTRACT_32BITS(ptr + MST_BPDU_CONFIG_DIGEST_OFFSET + 12));
+ printf("CIST remaining-hops %d", ptr[MST_BPDU_CIST_REMAIN_HOPS_OFFSET]);
- printf("\n\tCIST remaining-hops %d", ptr[MST_BPDU_CIST_REMAIN_HOPS_OFFSET]);
-
/* Dump all MSTI's */
v3len = EXTRACT_16BITS(ptr + MST_BPDU_VER3_LEN_OFFSET);
if (v3len > MST_BPDU_CONFIG_INFO_LENGTH) {
@@ -275,10 +320,41 @@
offset += MST_BPDU_MSTI_LENGTH;
}
}
+
+ if ((length-offset) >= SPB_BPDU_MIN_LEN)
+ {
+ printf("\n\tv4len %d AUXMCID Name %s, Rev %u, \n\t\tdigest %08x%08x%08x%08x",
+ EXTRACT_16BITS (ptr + offset),
+ ptr + offset + SPB_BPDU_CONFIG_NAME_OFFSET,
+ EXTRACT_16BITS(ptr + offset + SPB_BPDU_CONFIG_REV_OFFSET),
+ EXTRACT_32BITS(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET),
+ EXTRACT_32BITS(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET + 4),
+ EXTRACT_32BITS(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET + 8),
+ EXTRACT_32BITS(ptr + offset + SPB_BPDU_CONFIG_DIGEST_OFFSET + 12));
+
+ printf("\n\tAgreement num %d, Discarded Agreement num %d, Agreement valid-"
+ "flag %d, \n\tRestricted role-flag: %d, Format id %d cap %d, "
+ "Convention id %d cap %d, \n\tEdge count %d, "
+ "Agreement digest %08x%08x%08x%08x%08x\n",
+ ptr[offset + SPB_BPDU_AGREEMENT_OFFSET]>>6,
+ ptr[offset + SPB_BPDU_AGREEMENT_OFFSET]>>4 & 0x3,
+ ptr[offset + SPB_BPDU_AGREEMENT_OFFSET]>>3 & 0x1,
+ ptr[offset + SPB_BPDU_AGREEMENT_OFFSET]>>2 & 0x1,
+ ptr[offset + SPB_BPDU_AGREEMENT_FORMAT_OFFSET]>>4,
+ ptr[offset + SPB_BPDU_AGREEMENT_FORMAT_OFFSET]&0x00ff,
+ ptr[offset + SPB_BPDU_AGREEMENT_CON_OFFSET]>>4,
+ ptr[offset + SPB_BPDU_AGREEMENT_CON_OFFSET]&0x00ff,
+ EXTRACT_16BITS(ptr + offset + SPB_BPDU_AGREEMENT_EDGE_OFFSET),
+ EXTRACT_32BITS(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET),
+ EXTRACT_32BITS(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET)+4,
+ EXTRACT_32BITS(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET)+8,
+ EXTRACT_32BITS(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET)+12,
+ EXTRACT_32BITS(ptr + offset + SPB_BPDU_AGREEMENT_DIGEST_OFFSET)+16);
+ }
}
/*
- * Print 802.1d / 802.1w / 802.1q (mstp) packets.
+ * Print 802.1d / 802.1w / 802.1q (mstp) / 802.1aq (spb) packets.
*/
void
stp_print(const u_char *p, u_int length)
@@ -285,6 +361,7 @@
{
const struct stp_bpdu_ *stp_bpdu;
u_int16_t mstp_len;
+ u_int16_t spb_len;
stp_bpdu = (struct stp_bpdu_*)p;
@@ -304,6 +381,7 @@
case STP_PROTO_REGULAR:
case STP_PROTO_RAPID:
case STP_PROTO_MSTP:
+ case STP_PROTO_SPB:
break;
default:
return;
@@ -326,14 +404,17 @@
goto trunc;
}
stp_print_config_bpdu(stp_bpdu, length);
- } else if (stp_bpdu->protocol_version == STP_PROTO_MSTP) {
+ } else if (stp_bpdu->protocol_version == STP_PROTO_MSTP ||
+ stp_bpdu->protocol_version == STP_PROTO_SPB) {
if (length < STP_BPDU_MSTP_MIN_LEN) {
goto trunc;
}
+
if (stp_bpdu->v1_length != 0) {
/* FIX ME: Emit a message here ? */
goto trunc;
}
+
/* Validate v3 length */
mstp_len = EXTRACT_16BITS(p + MST_BPDU_VER3_LEN_OFFSET);
mstp_len += 2; /* length encoding itself is 2 bytes */
@@ -340,6 +421,18 @@
if (length < (sizeof(struct stp_bpdu_) + mstp_len)) {
goto trunc;
}
+
+ if (stp_bpdu->protocol_version == STP_PROTO_SPB)
+ {
+ /* Validate v4 length */
+ spb_len = EXTRACT_16BITS (p + MST_BPDU_VER3_LEN_OFFSET + mstp_len);
+ spb_len += 2;
+ if (length < (sizeof(struct stp_bpdu_) + mstp_len + spb_len) ||
+ spb_len < SPB_BPDU_MIN_LEN) {
+ goto trunc;
+ }
+ }
+
stp_print_mstp_bpdu(stp_bpdu, length);
}
break;
Modified: trunk/contrib/tcpdump/print-sunatm.c
===================================================================
--- trunk/contrib/tcpdump/print-sunatm.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-sunatm.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -31,7 +31,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-sunatm.c,v 1.1.1.2 2006-02-25 02:34:03 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-sunatm.c,v 1.8 2004-03-17 23:24:38 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-sunrpc.c
===================================================================
--- trunk/contrib/tcpdump/print-sunrpc.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-sunrpc.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,12 +18,12 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-sunrpc.c,v 1.11 2005/07/11 04:14:02 sam Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-sunrpc.c 236192 2012-05-28 19:13:21Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-sunrpc.c,v 1.1.1.2 2006-02-25 02:34:03 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-sunrpc.c,v 1.47 2005-04-27 21:43:48 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -30,14 +30,29 @@
#include "config.h"
#endif
+/*
+ * At least on HP-UX:
+ *
+ * 1) getrpcbynumber() is declared in <netdb.h>, not any of the RPC
+ * header files
+ *
+ * and
+ *
+ * 2) if _XOPEN_SOURCE_EXTENDED is defined, <netdb.h> doesn't declare
+ * it
+ *
+ * so we undefine it.
+ */
+#undef _XOPEN_SOURCE_EXTENDED
+
#include <tcpdump-stdinc.h>
-#ifdef HAVE_GETRPCBYNUMBER
+#if defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H)
#include <rpc/rpc.h>
#ifdef HAVE_RPC_RPCENT_H
#include <rpc/rpcent.h>
#endif /* HAVE_RPC_RPCENT_H */
-#endif /* HAVE_GETRPCBYNUMBER */
+#endif /* defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H) */
#include <stdio.h>
#include <string.h>
@@ -138,7 +153,7 @@
progstr(prog)
u_int32_t prog;
{
-#ifdef HAVE_GETRPCBYNUMBER
+#if defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H)
register struct rpcent *rp;
#endif
static char buf[32];
@@ -146,12 +161,12 @@
if (lastprog != 0 && prog == lastprog)
return (buf);
-#ifdef HAVE_GETRPCBYNUMBER
+#if defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H)
rp = getrpcbynumber(prog);
if (rp == NULL)
#endif
(void) snprintf(buf, sizeof(buf), "#%u", prog);
-#ifdef HAVE_GETRPCBYNUMBER
+#if defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H)
else
strlcpy(buf, rp->r_name, sizeof(buf));
#endif
Modified: trunk/contrib/tcpdump/print-symantec.c
===================================================================
--- trunk/contrib/tcpdump/print-symantec.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-symantec.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-symantec.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-symantec.c,v 1.5 2005-07-07 01:22:21 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -33,6 +33,7 @@
#include <pcap.h>
#include "interface.h"
+#include "extract.h"
#include "addrtoname.h"
#include "ethertype.h"
@@ -52,7 +53,7 @@
sp = (const struct symantec_header *)bp;
- etype = ntohs(sp->ether_type);
+ etype = EXTRACT_16BITS(&sp->ether_type);
if (!qflag) {
if (etype <= ETHERMTU)
(void)printf("invalid ethertype %u", etype);
@@ -83,7 +84,6 @@
u_int caplen = h->caplen;
struct symantec_header *sp;
u_short ether_type;
- u_short extracted_ether_type;
if (caplen < sizeof (struct symantec_header)) {
printf("[|symantec]");
@@ -98,7 +98,7 @@
sp = (struct symantec_header *)p;
p += sizeof (struct symantec_header);
- ether_type = ntohs(sp->ether_type);
+ ether_type = EXTRACT_16BITS(&sp->ether_type);
if (ether_type <= ETHERMTU) {
/* ether_type not known, print raw packet */
@@ -107,8 +107,7 @@
if (!suppress_default_print)
default_print(p, caplen);
- } else if (ether_encap_print(ether_type, p, length, caplen,
- &extracted_ether_type) == 0) {
+ } else if (ethertype_print(gndo, ether_type, p, length, caplen) == 0) {
/* ether_type not known, print raw packet */
if (!eflag)
symantec_hdr_print((u_char *)sp, length + sizeof (struct symantec_header));
Modified: trunk/contrib/tcpdump/print-syslog.c
===================================================================
--- trunk/contrib/tcpdump/print-syslog.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-syslog.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -16,7 +16,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-syslog.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-syslog.c,v 1.1 2004-10-29 11:42:53 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
Property changes on: trunk/contrib/tcpdump/print-syslog.c
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-tcp.c
===================================================================
--- trunk/contrib/tcpdump/print-tcp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-tcp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,3 +1,5 @@
+/* $NetBSD: print-tcp.c,v 1.9 2007/07/26 18:15:12 plunky Exp $ */
+
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved.
@@ -23,7 +25,9 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-tcp.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+"@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.135 2008-11-09 23:35:03 mcr Exp $ (LBL)";
+#else
+__RCSID("$NetBSD: print-tcp.c,v 1.8 2007/07/24 11:53:48 drochner Exp $");
#endif
#ifdef HAVE_CONFIG_H
@@ -54,13 +58,10 @@
#ifdef HAVE_LIBCRYPTO
#include <openssl/md5.h>
+#include <signature.h>
-#define SIGNATURE_VALID 0
-#define SIGNATURE_INVALID 1
-#define CANT_CHECK_SIGNATURE 2
-
static int tcp_verify_signature(const struct ip *ip, const struct tcphdr *tp,
- const u_char *data, int length, const u_char *rcvsig);
+ const u_char *data, int length, const u_char *rcvsig);
#endif
static void print_tcp_rst_data(register const u_char *sp, u_int length);
@@ -70,20 +71,20 @@
struct tha {
#ifndef INET6
- struct in_addr src;
- struct in_addr dst;
+ struct in_addr src;
+ struct in_addr dst;
#else
- struct in6_addr src;
- struct in6_addr dst;
+ struct in6_addr src;
+ struct in6_addr dst;
#endif /*INET6*/
- u_int port;
+ u_int port;
};
struct tcp_seq_hash {
- struct tcp_seq_hash *nxt;
- struct tha addr;
- tcp_seq seq;
- tcp_seq ack;
+ struct tcp_seq_hash *nxt;
+ struct tha addr;
+ tcp_seq seq;
+ tcp_seq ack;
};
#define TSEQ_HASHSIZE 919
@@ -93,605 +94,602 @@
static struct tcp_seq_hash tcp_seq_hash[TSEQ_HASHSIZE];
+struct tok tcp_flag_values[] = {
+ { TH_FIN, "F" },
+ { TH_SYN, "S" },
+ { TH_RST, "R" },
+ { TH_PUSH, "P" },
+ { TH_ACK, "." },
+ { TH_URG, "U" },
+ { TH_ECNECHO, "E" },
+ { TH_CWR, "W" },
+ { 0, NULL }
+};
-#ifndef TELNET_PORT
-#define TELNET_PORT 23
-#endif
-#ifndef BGP_PORT
-#define BGP_PORT 179
-#endif
-#define NETBIOS_SSN_PORT 139
-#ifndef PPTP_PORT
-#define PPTP_PORT 1723
-#endif
-#define BEEP_PORT 10288
-#ifndef NFS_PORT
-#define NFS_PORT 2049
-#endif
-#define MSDP_PORT 639
-#define LDP_PORT 646
+struct tok tcp_option_values[] = {
+ { TCPOPT_EOL, "eol" },
+ { TCPOPT_NOP, "nop" },
+ { TCPOPT_MAXSEG, "mss" },
+ { TCPOPT_WSCALE, "wscale" },
+ { TCPOPT_SACKOK, "sackOK" },
+ { TCPOPT_SACK, "sack" },
+ { TCPOPT_ECHO, "echo" },
+ { TCPOPT_ECHOREPLY, "echoreply" },
+ { TCPOPT_TIMESTAMP, "TS" },
+ { TCPOPT_CC, "cc" },
+ { TCPOPT_CCNEW, "ccnew" },
+ { TCPOPT_CCECHO, "" },
+ { TCPOPT_SIGNATURE, "md5" },
+ { TCPOPT_AUTH, "enhanced auth" },
+ { TCPOPT_UTO, "uto" },
+ { 0, NULL }
+};
static int tcp_cksum(register const struct ip *ip,
register const struct tcphdr *tp,
register u_int len)
{
- union phu {
- struct phdr {
- u_int32_t src;
- u_int32_t dst;
- u_char mbz;
- u_char proto;
- u_int16_t len;
- } ph;
- u_int16_t pa[6];
- } phu;
- const u_int16_t *sp;
-
- /* pseudo-header.. */
- phu.ph.len = htons((u_int16_t)len);
- phu.ph.mbz = 0;
- phu.ph.proto = IPPROTO_TCP;
- memcpy(&phu.ph.src, &ip->ip_src.s_addr, sizeof(u_int32_t));
- if (IP_HL(ip) == 5)
- memcpy(&phu.ph.dst, &ip->ip_dst.s_addr, sizeof(u_int32_t));
- else
- phu.ph.dst = ip_finddst(ip);
-
- sp = &phu.pa[0];
- return in_cksum((u_short *)tp, len,
- sp[0]+sp[1]+sp[2]+sp[3]+sp[4]+sp[5]);
+ return (nextproto4_cksum(ip, (const u_int8_t *)tp, len,
+ IPPROTO_TCP));
}
-#ifdef INET6
-static int tcp6_cksum(const struct ip6_hdr *ip6, const struct tcphdr *tp,
- u_int len)
-{
- size_t i;
- register const u_int16_t *sp;
- u_int32_t sum;
- union {
- struct {
- struct in6_addr ph_src;
- struct in6_addr ph_dst;
- u_int32_t ph_len;
- u_int8_t ph_zero[3];
- u_int8_t ph_nxt;
- } ph;
- u_int16_t pa[20];
- } phu;
-
- /* pseudo-header */
- memset(&phu, 0, sizeof(phu));
- phu.ph.ph_src = ip6->ip6_src;
- phu.ph.ph_dst = ip6->ip6_dst;
- phu.ph.ph_len = htonl(len);
- phu.ph.ph_nxt = IPPROTO_TCP;
-
- sum = 0;
- for (i = 0; i < sizeof(phu.pa) / sizeof(phu.pa[0]); i++)
- sum += phu.pa[i];
-
- sp = (const u_int16_t *)tp;
-
- for (i = 0; i < (len & ~1); i += 2)
- sum += *sp++;
-
- if (len & 1)
- sum += htons((*(const u_int8_t *)sp) << 8);
-
- while (sum > 0xffff)
- sum = (sum & 0xffff) + (sum >> 16);
- sum = ~sum & 0xffff;
-
- return (sum);
-}
-#endif
-
void
tcp_print(register const u_char *bp, register u_int length,
register const u_char *bp2, int fragmented)
{
- register const struct tcphdr *tp;
- register const struct ip *ip;
- register u_char flags;
- register u_int hlen;
- register char ch;
- u_int16_t sport, dport, win, urp;
- u_int32_t seq, ack, thseq, thack;
- int threv;
+ register const struct tcphdr *tp;
+ register const struct ip *ip;
+ register u_char flags;
+ register u_int hlen;
+ register char ch;
+ u_int16_t sport, dport, win, urp;
+ u_int32_t seq, ack, thseq, thack;
+ u_int utoval;
+ int threv;
#ifdef INET6
- register const struct ip6_hdr *ip6;
+ register const struct ip6_hdr *ip6;
#endif
- tp = (struct tcphdr *)bp;
- ip = (struct ip *)bp2;
+ tp = (struct tcphdr *)bp;
+ ip = (struct ip *)bp2;
#ifdef INET6
- if (IP_V(ip) == 6)
- ip6 = (struct ip6_hdr *)bp2;
- else
- ip6 = NULL;
+ if (IP_V(ip) == 6)
+ ip6 = (struct ip6_hdr *)bp2;
+ else
+ ip6 = NULL;
#endif /*INET6*/
- ch = '\0';
- if (!TTEST(tp->th_dport)) {
- (void)printf("%s > %s: [|tcp]",
- ipaddr_string(&ip->ip_src),
- ipaddr_string(&ip->ip_dst));
- return;
- }
+ ch = '\0';
+ if (!TTEST(tp->th_dport)) {
+ (void)printf("%s > %s: [|tcp]",
+ ipaddr_string(&ip->ip_src),
+ ipaddr_string(&ip->ip_dst));
+ return;
+ }
- sport = EXTRACT_16BITS(&tp->th_sport);
- dport = EXTRACT_16BITS(&tp->th_dport);
+ sport = EXTRACT_16BITS(&tp->th_sport);
+ dport = EXTRACT_16BITS(&tp->th_dport);
- hlen = TH_OFF(tp) * 4;
+ hlen = TH_OFF(tp) * 4;
- /*
+ /*
* If data present, header length valid, and NFS port used,
* assume NFS.
* Pass offset of data plus 4 bytes for RPC TCP msg length
* to NFS print routines.
*/
- if (!qflag && hlen >= sizeof(*tp) && hlen <= length) {
- if ((u_char *)tp + 4 + sizeof(struct sunrpc_msg) <= snapend &&
- dport == NFS_PORT) {
- nfsreq_print((u_char *)tp + hlen + 4, length - hlen,
- (u_char *)ip);
- return;
- } else if ((u_char *)tp + 4 + sizeof(struct sunrpc_msg)
- <= snapend &&
- sport == NFS_PORT) {
- nfsreply_print((u_char *)tp + hlen + 4, length - hlen,
- (u_char *)ip);
- return;
- }
- }
+ if (!qflag && hlen >= sizeof(*tp) && hlen <= length &&
+ (length - hlen) >= 4) {
+ u_char *fraglenp;
+ u_int32_t fraglen;
+ register struct sunrpc_msg *rp;
+ enum sunrpc_msg_type direction;
+
+ fraglenp = (u_char *)tp + hlen;
+ if (TTEST2(*fraglenp, 4)) {
+ fraglen = EXTRACT_32BITS(fraglenp) & 0x7FFFFFFF;
+ if (fraglen > (length - hlen) - 4)
+ fraglen = (length - hlen) - 4;
+ rp = (struct sunrpc_msg *)(fraglenp + 4);
+ if (TTEST(rp->rm_direction)) {
+ direction = (enum sunrpc_msg_type)EXTRACT_32BITS(&rp->rm_direction);
+ if (dport == NFS_PORT &&
+ direction == SUNRPC_CALL) {
+ nfsreq_print((u_char *)rp, fraglen,
+ (u_char *)ip);
+ return;
+ }
+ if (sport == NFS_PORT &&
+ direction == SUNRPC_REPLY) {
+ nfsreply_print((u_char *)rp, fraglen,
+ (u_char *)ip);
+ return;
+ }
+ }
+ }
+ }
#ifdef INET6
- if (ip6) {
- if (ip6->ip6_nxt == IPPROTO_TCP) {
- (void)printf("%s.%s > %s.%s: ",
- ip6addr_string(&ip6->ip6_src),
- tcpport_string(sport),
- ip6addr_string(&ip6->ip6_dst),
- tcpport_string(dport));
- } else {
- (void)printf("%s > %s: ",
- tcpport_string(sport), tcpport_string(dport));
- }
- } else
+ if (ip6) {
+ if (ip6->ip6_nxt == IPPROTO_TCP) {
+ (void)printf("%s.%s > %s.%s: ",
+ ip6addr_string(&ip6->ip6_src),
+ tcpport_string(sport),
+ ip6addr_string(&ip6->ip6_dst),
+ tcpport_string(dport));
+ } else {
+ (void)printf("%s > %s: ",
+ tcpport_string(sport), tcpport_string(dport));
+ }
+ } else
#endif /*INET6*/
- {
- if (ip->ip_p == IPPROTO_TCP) {
- (void)printf("%s.%s > %s.%s: ",
- ipaddr_string(&ip->ip_src),
- tcpport_string(sport),
- ipaddr_string(&ip->ip_dst),
- tcpport_string(dport));
- } else {
- (void)printf("%s > %s: ",
- tcpport_string(sport), tcpport_string(dport));
- }
- }
+ {
+ if (ip->ip_p == IPPROTO_TCP) {
+ (void)printf("%s.%s > %s.%s: ",
+ ipaddr_string(&ip->ip_src),
+ tcpport_string(sport),
+ ipaddr_string(&ip->ip_dst),
+ tcpport_string(dport));
+ } else {
+ (void)printf("%s > %s: ",
+ tcpport_string(sport), tcpport_string(dport));
+ }
+ }
- if (hlen < sizeof(*tp)) {
- (void)printf(" tcp %d [bad hdr length %u - too short, < %lu]",
- length - hlen, hlen, (unsigned long)sizeof(*tp));
- return;
- }
+ if (hlen < sizeof(*tp)) {
+ (void)printf(" tcp %d [bad hdr length %u - too short, < %lu]",
+ length - hlen, hlen, (unsigned long)sizeof(*tp));
+ return;
+ }
- TCHECK(*tp);
+ TCHECK(*tp);
- seq = EXTRACT_32BITS(&tp->th_seq);
- ack = EXTRACT_32BITS(&tp->th_ack);
- win = EXTRACT_16BITS(&tp->th_win);
- urp = EXTRACT_16BITS(&tp->th_urp);
+ seq = EXTRACT_32BITS(&tp->th_seq);
+ ack = EXTRACT_32BITS(&tp->th_ack);
+ win = EXTRACT_16BITS(&tp->th_win);
+ urp = EXTRACT_16BITS(&tp->th_urp);
- if (qflag) {
- (void)printf("tcp %d", length - hlen);
- if (hlen > length) {
- (void)printf(" [bad hdr length %u - too long, > %u]",
- hlen, length);
- }
- return;
- }
- if ((flags = tp->th_flags) & (TH_SYN|TH_FIN|TH_RST|TH_PUSH|
- TH_ECNECHO|TH_CWR)) {
- if (flags & TH_SYN)
- putchar('S');
- if (flags & TH_FIN)
- putchar('F');
- if (flags & TH_RST)
- putchar('R');
- if (flags & TH_PUSH)
- putchar('P');
- if (flags & TH_CWR)
- putchar('W'); /* congestion _W_indow reduced (ECN) */
- if (flags & TH_ECNECHO)
- putchar('E'); /* ecn _E_cho sent (ECN) */
- } else
- putchar('.');
+ if (qflag) {
+ (void)printf("tcp %d", length - hlen);
+ if (hlen > length) {
+ (void)printf(" [bad hdr length %u - too long, > %u]",
+ hlen, length);
+ }
+ return;
+ }
- if (!Sflag && (flags & TH_ACK)) {
- register struct tcp_seq_hash *th;
- const void *src, *dst;
- register int rev;
- struct tha tha;
- /*
- * Find (or record) the initial sequence numbers for
- * this conversation. (we pick an arbitrary
- * collating order so there's only one entry for
- * both directions).
- */
+ flags = tp->th_flags;
+ printf("Flags [%s]", bittok2str_nosep(tcp_flag_values, "none", flags));
+
+ if (!Sflag && (flags & TH_ACK)) {
+ register struct tcp_seq_hash *th;
+ const void *src, *dst;
+ register int rev;
+ struct tha tha;
+ /*
+ * Find (or record) the initial sequence numbers for
+ * this conversation. (we pick an arbitrary
+ * collating order so there's only one entry for
+ * both directions).
+ */
#ifdef INET6
- memset(&tha, 0, sizeof(tha));
- rev = 0;
- if (ip6) {
- src = &ip6->ip6_src;
- dst = &ip6->ip6_dst;
- if (sport > dport)
- rev = 1;
- else if (sport == dport) {
- if (memcmp(src, dst, sizeof ip6->ip6_dst) > 0)
- rev = 1;
- }
- if (rev) {
- memcpy(&tha.src, dst, sizeof ip6->ip6_dst);
- memcpy(&tha.dst, src, sizeof ip6->ip6_src);
- tha.port = dport << 16 | sport;
- } else {
- memcpy(&tha.dst, dst, sizeof ip6->ip6_dst);
- memcpy(&tha.src, src, sizeof ip6->ip6_src);
- tha.port = sport << 16 | dport;
- }
- } else {
- src = &ip->ip_src;
- dst = &ip->ip_dst;
- if (sport > dport)
- rev = 1;
- else if (sport == dport) {
- if (memcmp(src, dst, sizeof ip->ip_dst) > 0)
- rev = 1;
- }
- if (rev) {
- memcpy(&tha.src, dst, sizeof ip->ip_dst);
- memcpy(&tha.dst, src, sizeof ip->ip_src);
- tha.port = dport << 16 | sport;
- } else {
- memcpy(&tha.dst, dst, sizeof ip->ip_dst);
- memcpy(&tha.src, src, sizeof ip->ip_src);
- tha.port = sport << 16 | dport;
- }
- }
+ rev = 0;
+ if (ip6) {
+ src = &ip6->ip6_src;
+ dst = &ip6->ip6_dst;
+ if (sport > dport)
+ rev = 1;
+ else if (sport == dport) {
+ if (memcmp(src, dst, sizeof ip6->ip6_dst) > 0)
+ rev = 1;
+ }
+ if (rev) {
+ memcpy(&tha.src, dst, sizeof ip6->ip6_dst);
+ memcpy(&tha.dst, src, sizeof ip6->ip6_src);
+ tha.port = dport << 16 | sport;
+ } else {
+ memcpy(&tha.dst, dst, sizeof ip6->ip6_dst);
+ memcpy(&tha.src, src, sizeof ip6->ip6_src);
+ tha.port = sport << 16 | dport;
+ }
+ } else {
+ /*
+ * Zero out the tha structure; the src and dst
+ * fields are big enough to hold an IPv6
+ * address, but we only have IPv4 addresses
+ * and thus must clear out the remaining 124
+ * bits.
+ *
+ * XXX - should we just clear those bytes after
+ * copying the IPv4 addresses, rather than
+ * zeroing out the entire structure and then
+ * overwriting some of the zeroes?
+ *
+ * XXX - this could fail if we see TCP packets
+ * with an IPv6 address with the lower 124 bits
+ * all zero and also see TCP packes with an
+ * IPv4 address with the same 32 bits as the
+ * upper 32 bits of the IPv6 address in question.
+ * Can that happen? Is it likely enough to be
+ * an issue?
+ */
+ memset(&tha, 0, sizeof(tha));
+ src = &ip->ip_src;
+ dst = &ip->ip_dst;
+ if (sport > dport)
+ rev = 1;
+ else if (sport == dport) {
+ if (memcmp(src, dst, sizeof ip->ip_dst) > 0)
+ rev = 1;
+ }
+ if (rev) {
+ memcpy(&tha.src, dst, sizeof ip->ip_dst);
+ memcpy(&tha.dst, src, sizeof ip->ip_src);
+ tha.port = dport << 16 | sport;
+ } else {
+ memcpy(&tha.dst, dst, sizeof ip->ip_dst);
+ memcpy(&tha.src, src, sizeof ip->ip_src);
+ tha.port = sport << 16 | dport;
+ }
+ }
#else
- rev = 0;
- src = &ip->ip_src;
- dst = &ip->ip_dst;
- if (sport > dport)
- rev = 1;
- else if (sport == dport) {
- if (memcmp(src, dst, sizeof ip->ip_dst) > 0)
- rev = 1;
- }
- if (rev) {
- memcpy(&tha.src, dst, sizeof ip->ip_dst);
- memcpy(&tha.dst, src, sizeof ip->ip_src);
- tha.port = dport << 16 | sport;
- } else {
- memcpy(&tha.dst, dst, sizeof ip->ip_dst);
- memcpy(&tha.src, src, sizeof ip->ip_src);
- tha.port = sport << 16 | dport;
- }
+ rev = 0;
+ src = &ip->ip_src;
+ dst = &ip->ip_dst;
+ if (sport > dport)
+ rev = 1;
+ else if (sport == dport) {
+ if (memcmp(src, dst, sizeof ip->ip_dst) > 0)
+ rev = 1;
+ }
+ if (rev) {
+ memcpy(&tha.src, dst, sizeof ip->ip_dst);
+ memcpy(&tha.dst, src, sizeof ip->ip_src);
+ tha.port = dport << 16 | sport;
+ } else {
+ memcpy(&tha.dst, dst, sizeof ip->ip_dst);
+ memcpy(&tha.src, src, sizeof ip->ip_src);
+ tha.port = sport << 16 | dport;
+ }
#endif
- threv = rev;
- for (th = &tcp_seq_hash[tha.port % TSEQ_HASHSIZE];
- th->nxt; th = th->nxt)
- if (memcmp((char *)&tha, (char *)&th->addr,
- sizeof(th->addr)) == 0)
- break;
+ threv = rev;
+ for (th = &tcp_seq_hash[tha.port % TSEQ_HASHSIZE];
+ th->nxt; th = th->nxt)
+ if (memcmp((char *)&tha, (char *)&th->addr,
+ sizeof(th->addr)) == 0)
+ break;
- if (!th->nxt || (flags & TH_SYN)) {
- /* didn't find it or new conversation */
- if (th->nxt == NULL) {
- th->nxt = (struct tcp_seq_hash *)
- calloc(1, sizeof(*th));
- if (th->nxt == NULL)
- error("tcp_print: calloc");
- }
- th->addr = tha;
- if (rev)
- th->ack = seq, th->seq = ack - 1;
- else
- th->seq = seq, th->ack = ack - 1;
- } else {
- if (rev)
- seq -= th->ack, ack -= th->seq;
- else
- seq -= th->seq, ack -= th->ack;
- }
+ if (!th->nxt || (flags & TH_SYN)) {
+ /* didn't find it or new conversation */
+ if (th->nxt == NULL) {
+ th->nxt = (struct tcp_seq_hash *)
+ calloc(1, sizeof(*th));
+ if (th->nxt == NULL)
+ error("tcp_print: calloc");
+ }
+ th->addr = tha;
+ if (rev)
+ th->ack = seq, th->seq = ack - 1;
+ else
+ th->seq = seq, th->ack = ack - 1;
+ } else {
+ if (rev)
+ seq -= th->ack, ack -= th->seq;
+ else
+ seq -= th->seq, ack -= th->ack;
+ }
- thseq = th->seq;
- thack = th->ack;
- } else {
- /*fool gcc*/
- thseq = thack = threv = 0;
- }
- if (hlen > length) {
- (void)printf(" [bad hdr length %u - too long, > %u]",
- hlen, length);
- return;
- }
+ thseq = th->seq;
+ thack = th->ack;
+ } else {
+ /*fool gcc*/
+ thseq = thack = threv = 0;
+ }
+ if (hlen > length) {
+ (void)printf(" [bad hdr length %u - too long, > %u]",
+ hlen, length);
+ return;
+ }
- if (IP_V(ip) == 4 && vflag && !fragmented) {
- u_int16_t sum, tcp_sum;
- if (TTEST2(tp->th_sport, length)) {
- sum = tcp_cksum(ip, tp, length);
+ if (vflag && !Kflag && !fragmented) {
+ /* Check the checksum, if possible. */
+ u_int16_t sum, tcp_sum;
- (void)printf(", cksum 0x%04x",EXTRACT_16BITS(&tp->th_sum));
- if (sum != 0) {
- tcp_sum = EXTRACT_16BITS(&tp->th_sum);
- (void)printf(" (incorrect (-> 0x%04x),",in_cksum_shouldbe(tcp_sum, sum));
- } else
- (void)printf(" (correct),");
- }
- }
+ if (IP_V(ip) == 4) {
+ if (TTEST2(tp->th_sport, length)) {
+ sum = tcp_cksum(ip, tp, length);
+ tcp_sum = EXTRACT_16BITS(&tp->th_sum);
+
+ (void)printf(", cksum 0x%04x", tcp_sum);
+ if (sum != 0)
+ (void)printf(" (incorrect -> 0x%04x)",
+ in_cksum_shouldbe(tcp_sum, sum));
+ else
+ (void)printf(" (correct)");
+ }
+ }
#ifdef INET6
- if (IP_V(ip) == 6 && ip6->ip6_plen && vflag && !fragmented) {
- u_int16_t sum,tcp_sum;
- if (TTEST2(tp->th_sport, length)) {
- sum = tcp6_cksum(ip6, tp, length);
- (void)printf(", cksum 0x%04x",EXTRACT_16BITS(&tp->th_sum));
- if (sum != 0) {
- tcp_sum = EXTRACT_16BITS(&tp->th_sum);
- (void)printf(" (incorrect (-> 0x%04x),",in_cksum_shouldbe(tcp_sum, sum));
- } else
- (void)printf(" (correct),");
+ else if (IP_V(ip) == 6 && ip6->ip6_plen) {
+ if (TTEST2(tp->th_sport, length)) {
+ sum = nextproto6_cksum(ip6, (const u_int8_t *)tp, length, IPPROTO_TCP);
+ tcp_sum = EXTRACT_16BITS(&tp->th_sum);
- }
- }
+ (void)printf(", cksum 0x%04x", tcp_sum);
+ if (sum != 0)
+ (void)printf(" (incorrect -> 0x%04x)",
+ in_cksum_shouldbe(tcp_sum, sum));
+ else
+ (void)printf(" (correct)");
+
+ }
+ }
#endif
+ }
- length -= hlen;
- if (vflag > 1 || length > 0 || flags & (TH_SYN | TH_FIN | TH_RST))
- (void)printf(" %u:%u(%u)", seq, seq + length, length);
- if (flags & TH_ACK)
- (void)printf(" ack %u", ack);
+ length -= hlen;
+ if (vflag > 1 || length > 0 || flags & (TH_SYN | TH_FIN | TH_RST)) {
+ (void)printf(", seq %u", seq);
- (void)printf(" win %d", win);
+ if (length > 0) {
+ (void)printf(":%u", seq + length);
+ }
+ }
- if (flags & TH_URG)
- (void)printf(" urg %d", urp);
- /*
- * Handle any options.
- */
- if (hlen > sizeof(*tp)) {
- register const u_char *cp;
- register u_int i, opt, datalen;
- register u_int len;
+ if (flags & TH_ACK) {
+ (void)printf(", ack %u", ack);
+ }
- hlen -= sizeof(*tp);
- cp = (const u_char *)tp + sizeof(*tp);
- putchar(' ');
- ch = '<';
- while (hlen > 0) {
- putchar(ch);
- TCHECK(*cp);
- opt = *cp++;
- if (ZEROLENOPT(opt))
- len = 1;
- else {
- TCHECK(*cp);
- len = *cp++; /* total including type, len */
- if (len < 2 || len > hlen)
- goto bad;
- --hlen; /* account for length byte */
- }
- --hlen; /* account for type byte */
- datalen = 0;
+ (void)printf(", win %d", win);
+ if (flags & TH_URG)
+ (void)printf(", urg %d", urp);
+ /*
+ * Handle any options.
+ */
+ if (hlen > sizeof(*tp)) {
+ register const u_char *cp;
+ register u_int i, opt, datalen;
+ register u_int len;
+
+ hlen -= sizeof(*tp);
+ cp = (const u_char *)tp + sizeof(*tp);
+ printf(", options [");
+ while (hlen > 0) {
+ if (ch != '\0')
+ putchar(ch);
+ TCHECK(*cp);
+ opt = *cp++;
+ if (ZEROLENOPT(opt))
+ len = 1;
+ else {
+ TCHECK(*cp);
+ len = *cp++; /* total including type, len */
+ if (len < 2 || len > hlen)
+ goto bad;
+ --hlen; /* account for length byte */
+ }
+ --hlen; /* account for type byte */
+ datalen = 0;
+
/* Bail if "l" bytes of data are not left or were not captured */
#define LENCHECK(l) { if ((l) > hlen) goto bad; TCHECK2(*cp, l); }
- switch (opt) {
- case TCPOPT_MAXSEG:
- (void)printf("mss");
- datalen = 2;
- LENCHECK(datalen);
- (void)printf(" %u", EXTRACT_16BITS(cp));
+ printf("%s", tok2str(tcp_option_values, "Unknown Option %u", opt));
- break;
+ switch (opt) {
- case TCPOPT_EOL:
- (void)printf("eol");
- break;
+ case TCPOPT_MAXSEG:
+ datalen = 2;
+ LENCHECK(datalen);
+ (void)printf(" %u", EXTRACT_16BITS(cp));
+ break;
- case TCPOPT_NOP:
- (void)printf("nop");
- break;
+ case TCPOPT_WSCALE:
+ datalen = 1;
+ LENCHECK(datalen);
+ (void)printf(" %u", *cp);
+ break;
- case TCPOPT_WSCALE:
- (void)printf("wscale");
- datalen = 1;
- LENCHECK(datalen);
- (void)printf(" %u", *cp);
- break;
+ case TCPOPT_SACK:
+ datalen = len - 2;
+ if (datalen % 8 != 0) {
+ (void)printf("malformed sack");
+ } else {
+ u_int32_t s, e;
- case TCPOPT_SACKOK:
- (void)printf("sackOK");
- break;
+ (void)printf(" %d ", datalen / 8);
+ for (i = 0; i < datalen; i += 8) {
+ LENCHECK(i + 4);
+ s = EXTRACT_32BITS(cp + i);
+ LENCHECK(i + 8);
+ e = EXTRACT_32BITS(cp + i + 4);
+ if (threv) {
+ s -= thseq;
+ e -= thseq;
+ } else {
+ s -= thack;
+ e -= thack;
+ }
+ (void)printf("{%u:%u}", s, e);
+ }
+ }
+ break;
- case TCPOPT_SACK:
- datalen = len - 2;
- if (datalen % 8 != 0) {
- (void)printf("malformed sack");
- } else {
- u_int32_t s, e;
+ case TCPOPT_CC:
+ case TCPOPT_CCNEW:
+ case TCPOPT_CCECHO:
+ case TCPOPT_ECHO:
+ case TCPOPT_ECHOREPLY:
- (void)printf("sack %d ", datalen / 8);
- for (i = 0; i < datalen; i += 8) {
- LENCHECK(i + 4);
- s = EXTRACT_32BITS(cp + i);
- LENCHECK(i + 8);
- e = EXTRACT_32BITS(cp + i + 4);
- if (threv) {
- s -= thseq;
- e -= thseq;
- } else {
- s -= thack;
- e -= thack;
- }
- (void)printf("{%u:%u}", s, e);
- }
- }
- break;
+ /*
+ * those options share their semantics.
+ * fall through
+ */
+ datalen = 4;
+ LENCHECK(datalen);
+ (void)printf(" %u", EXTRACT_32BITS(cp));
+ break;
- case TCPOPT_ECHO:
- (void)printf("echo");
- datalen = 4;
- LENCHECK(datalen);
- (void)printf(" %u", EXTRACT_32BITS(cp));
- break;
+ case TCPOPT_TIMESTAMP:
+ datalen = 8;
+ LENCHECK(datalen);
+ (void)printf(" val %u ecr %u",
+ EXTRACT_32BITS(cp),
+ EXTRACT_32BITS(cp + 4));
+ break;
- case TCPOPT_ECHOREPLY:
- (void)printf("echoreply");
- datalen = 4;
- LENCHECK(datalen);
- (void)printf(" %u", EXTRACT_32BITS(cp));
- break;
+ case TCPOPT_SIGNATURE:
+ datalen = TCP_SIGLEN;
+ LENCHECK(datalen);
+#ifdef HAVE_LIBCRYPTO
+ switch (tcp_verify_signature(ip, tp,
+ bp + TH_OFF(tp) * 4, length, cp)) {
- case TCPOPT_TIMESTAMP:
- (void)printf("timestamp");
- datalen = 8;
- LENCHECK(4);
- (void)printf(" %u", EXTRACT_32BITS(cp));
- LENCHECK(datalen);
- (void)printf(" %u", EXTRACT_32BITS(cp + 4));
- break;
+ case SIGNATURE_VALID:
+ (void)printf("valid");
+ break;
- case TCPOPT_CC:
- (void)printf("cc");
- datalen = 4;
- LENCHECK(datalen);
- (void)printf(" %u", EXTRACT_32BITS(cp));
- break;
+ case SIGNATURE_INVALID:
+ (void)printf("invalid");
+ break;
- case TCPOPT_CCNEW:
- (void)printf("ccnew");
- datalen = 4;
- LENCHECK(datalen);
- (void)printf(" %u", EXTRACT_32BITS(cp));
- break;
+ case CANT_CHECK_SIGNATURE:
+ (void)printf("can't check - ");
+ for (i = 0; i < TCP_SIGLEN; ++i)
+ (void)printf("%02x", cp[i]);
+ break;
+ }
+#else
+ for (i = 0; i < TCP_SIGLEN; ++i)
+ (void)printf("%02x", cp[i]);
+#endif
+ break;
- case TCPOPT_CCECHO:
- (void)printf("ccecho");
- datalen = 4;
- LENCHECK(datalen);
- (void)printf(" %u", EXTRACT_32BITS(cp));
- break;
+ case TCPOPT_AUTH:
+ (void)printf("keyid %d", *cp++);
+ datalen = len - 3;
+ for (i = 0; i < datalen; ++i) {
+ LENCHECK(i);
+ (void)printf("%02x", cp[i]);
+ }
+ break;
- case TCPOPT_SIGNATURE:
- (void)printf("md5:");
- datalen = TCP_SIGLEN;
- LENCHECK(datalen);
-#ifdef HAVE_LIBCRYPTO
- switch (tcp_verify_signature(ip, tp,
- bp + TH_OFF(tp) * 4, length, cp)) {
- case SIGNATURE_VALID:
- (void)printf("valid");
- break;
+ case TCPOPT_EOL:
+ case TCPOPT_NOP:
+ case TCPOPT_SACKOK:
+ /*
+ * Nothing interesting.
+ * fall through
+ */
+ break;
- case SIGNATURE_INVALID:
- (void)printf("invalid");
- break;
+ case TCPOPT_UTO:
+ datalen = 2;
+ LENCHECK(datalen);
+ utoval = EXTRACT_16BITS(cp);
+ (void)printf("0x%x", utoval);
+ if (utoval & 0x0001)
+ utoval = (utoval >> 1) * 60;
+ else
+ utoval >>= 1;
+ (void)printf(" %u", utoval);
+ break;
- case CANT_CHECK_SIGNATURE:
- (void)printf("can't check - ");
- for (i = 0; i < TCP_SIGLEN; ++i)
- (void)printf("%02x", cp[i]);
- break;
- }
-#else
- for (i = 0; i < TCP_SIGLEN; ++i)
- (void)printf("%02x", cp[i]);
-#endif
- break;
+ default:
+ datalen = len - 2;
+ for (i = 0; i < datalen; ++i) {
+ LENCHECK(i);
+ (void)printf("%02x", cp[i]);
+ }
+ break;
+ }
- default:
- (void)printf("opt-%u:", opt);
- datalen = len - 2;
- for (i = 0; i < datalen; ++i) {
- LENCHECK(i);
- (void)printf("%02x", cp[i]);
- }
- break;
- }
+ /* Account for data printed */
+ cp += datalen;
+ hlen -= datalen;
- /* Account for data printed */
- cp += datalen;
- hlen -= datalen;
+ /* Check specification against observed length */
+ ++datalen; /* option octet */
+ if (!ZEROLENOPT(opt))
+ ++datalen; /* size octet */
+ if (datalen != len)
+ (void)printf("[len %d]", len);
+ ch = ',';
+ if (opt == TCPOPT_EOL)
+ break;
+ }
+ putchar(']');
+ }
- /* Check specification against observed length */
- ++datalen; /* option octet */
- if (!ZEROLENOPT(opt))
- ++datalen; /* size octet */
- if (datalen != len)
- (void)printf("[len %d]", len);
- ch = ',';
- if (opt == TCPOPT_EOL)
- break;
- }
- putchar('>');
- }
+ /*
+ * Print length field before crawling down the stack.
+ */
+ printf(", length %u", length);
- if (length <= 0)
- return;
+ if (length <= 0)
+ return;
- /*
- * Decode payload if necessary.
- */
- bp += TH_OFF(tp) * 4;
- if (flags & TH_RST) {
- if (vflag)
- print_tcp_rst_data(bp, length);
- } else {
- if (sport == TELNET_PORT || dport == TELNET_PORT) {
- if (!qflag && vflag)
- telnet_print(bp, length);
- } else if (sport == BGP_PORT || dport == BGP_PORT)
- bgp_print(bp, length);
- else if (sport == PPTP_PORT || dport == PPTP_PORT)
- pptp_print(bp);
+ /*
+ * Decode payload if necessary.
+ */
+ bp += TH_OFF(tp) * 4;
+ if ((flags & TH_RST) && vflag) {
+ print_tcp_rst_data(bp, length);
+ return;
+ }
+
+ if (packettype) {
+ switch (packettype) {
+ case PT_ZMTP1:
+ zmtp1_print(bp, length);
+ break;
+ }
+ return;
+ }
+
+ if (sport == TELNET_PORT || dport == TELNET_PORT) {
+ if (!qflag && vflag)
+ telnet_print(bp, length);
+ } else if (sport == BGP_PORT || dport == BGP_PORT)
+ bgp_print(bp, length);
+ else if (sport == PPTP_PORT || dport == PPTP_PORT)
+ pptp_print(bp);
#ifdef TCPDUMP_DO_SMB
- else if (sport == NETBIOS_SSN_PORT || dport == NETBIOS_SSN_PORT)
- nbt_tcp_print(bp, length);
+ else if (sport == NETBIOS_SSN_PORT || dport == NETBIOS_SSN_PORT)
+ nbt_tcp_print(bp, length);
+ else if (sport == SMB_PORT || dport == SMB_PORT)
+ smb_tcp_print(bp, length);
#endif
- else if (sport == BEEP_PORT || dport == BEEP_PORT)
- beep_print(bp, length);
- else if (length > 2 &&
- (sport == NAMESERVER_PORT || dport == NAMESERVER_PORT ||
- sport == MULTICASTDNS_PORT || dport == MULTICASTDNS_PORT)) {
- /*
- * TCP DNS query has 2byte length at the head.
- * XXX packet could be unaligned, it can go strange
- */
- ns_print(bp + 2, length - 2, 0);
- } else if (sport == MSDP_PORT || dport == MSDP_PORT) {
- msdp_print(bp, length);
- }
- else if (length > 0 && (sport == LDP_PORT || dport == LDP_PORT)) {
- ldp_print(bp, length);
- }
- }
- return;
-bad:
- fputs("[bad opt]", stdout);
- if (ch != '\0')
- putchar('>');
- return;
-trunc:
- fputs("[|tcp]", stdout);
- if (ch != '\0')
- putchar('>');
+ else if (sport == BEEP_PORT || dport == BEEP_PORT)
+ beep_print(bp, length);
+ else if (length > 2 &&
+ (sport == NAMESERVER_PORT || dport == NAMESERVER_PORT ||
+ sport == MULTICASTDNS_PORT || dport == MULTICASTDNS_PORT)) {
+ /*
+ * TCP DNS query has 2byte length at the head.
+ * XXX packet could be unaligned, it can go strange
+ */
+ ns_print(bp + 2, length - 2, 0);
+ } else if (sport == MSDP_PORT || dport == MSDP_PORT) {
+ msdp_print(bp, length);
+ } else if (sport == RPKI_RTR_PORT || dport == RPKI_RTR_PORT) {
+ rpki_rtr_print(bp, length);
+ }
+ else if (length > 0 && (sport == LDP_PORT || dport == LDP_PORT)) {
+ ldp_print(bp, length);
+ }
+
+ return;
+ bad:
+ fputs("[bad opt]", stdout);
+ if (ch != '\0')
+ putchar('>');
+ return;
+ trunc:
+ fputs("[|tcp]", stdout);
+ if (ch != '\0')
+ putchar('>');
}
/*
@@ -712,96 +710,116 @@
static void
print_tcp_rst_data(register const u_char *sp, u_int length)
{
- int c;
+ int c;
- if (TTEST2(*sp, length))
- printf(" [RST");
- else
- printf(" [!RST");
- if (length > MAX_RST_DATA_LEN) {
- length = MAX_RST_DATA_LEN; /* can use -X for longer */
- putchar('+'); /* indicate we truncate */
- }
- putchar(' ');
- while (length-- && sp <= snapend) {
- c = *sp++;
- safeputchar(c);
- }
- putchar(']');
+ if (TTEST2(*sp, length))
+ printf(" [RST");
+ else
+ printf(" [!RST");
+ if (length > MAX_RST_DATA_LEN) {
+ length = MAX_RST_DATA_LEN; /* can use -X for longer */
+ putchar('+'); /* indicate we truncate */
+ }
+ putchar(' ');
+ while (length-- && sp <= snapend) {
+ c = *sp++;
+ safeputchar(c);
+ }
+ putchar(']');
}
#ifdef HAVE_LIBCRYPTO
static int
tcp_verify_signature(const struct ip *ip, const struct tcphdr *tp,
- const u_char *data, int length, const u_char *rcvsig)
+ const u_char *data, int length, const u_char *rcvsig)
{
struct tcphdr tp1;
- u_char sig[TCP_SIGLEN];
- char zero_proto = 0;
- MD5_CTX ctx;
- u_int16_t savecsum, tlen;
+ u_char sig[TCP_SIGLEN];
+ char zero_proto = 0;
+ MD5_CTX ctx;
+ u_int16_t savecsum, tlen;
#ifdef INET6
- struct ip6_hdr *ip6;
+ struct ip6_hdr *ip6;
+ u_int32_t len32;
+ u_int8_t nxt;
#endif
- u_int32_t len32;
- u_int8_t nxt;
- tp1 = *tp;
-
- if (tcpmd5secret == NULL)
+ if (data + length > snapend) {
+ printf("snaplen too short, ");
return (CANT_CHECK_SIGNATURE);
+ }
- MD5_Init(&ctx);
- /*
- * Step 1: Update MD5 hash with IP pseudo-header.
- */
- if (IP_V(ip) == 4) {
- MD5_Update(&ctx, (char *)&ip->ip_src, sizeof(ip->ip_src));
- MD5_Update(&ctx, (char *)&ip->ip_dst, sizeof(ip->ip_dst));
- MD5_Update(&ctx, (char *)&zero_proto, sizeof(zero_proto));
- MD5_Update(&ctx, (char *)&ip->ip_p, sizeof(ip->ip_p));
- tlen = EXTRACT_16BITS(&ip->ip_len) - IP_HL(ip) * 4;
- tlen = htons(tlen);
- MD5_Update(&ctx, (char *)&tlen, sizeof(tlen));
+ tp1 = *tp;
+
+ if (sigsecret == NULL) {
+ printf("shared secret not supplied with -M, ");
+ return (CANT_CHECK_SIGNATURE);
+ }
+
+ MD5_Init(&ctx);
+ /*
+ * Step 1: Update MD5 hash with IP pseudo-header.
+ */
+ if (IP_V(ip) == 4) {
+ MD5_Update(&ctx, (char *)&ip->ip_src, sizeof(ip->ip_src));
+ MD5_Update(&ctx, (char *)&ip->ip_dst, sizeof(ip->ip_dst));
+ MD5_Update(&ctx, (char *)&zero_proto, sizeof(zero_proto));
+ MD5_Update(&ctx, (char *)&ip->ip_p, sizeof(ip->ip_p));
+ tlen = EXTRACT_16BITS(&ip->ip_len) - IP_HL(ip) * 4;
+ tlen = htons(tlen);
+ MD5_Update(&ctx, (char *)&tlen, sizeof(tlen));
#ifdef INET6
- } else if (IP_V(ip) == 6) {
- ip6 = (struct ip6_hdr *)ip;
- MD5_Update(&ctx, (char *)&ip6->ip6_src, sizeof(ip6->ip6_src));
- MD5_Update(&ctx, (char *)&ip6->ip6_dst, sizeof(ip6->ip6_dst));
- len32 = htonl(ntohs(ip6->ip6_plen));
- MD5_Update(&ctx, (char *)&len32, sizeof(len32));
- nxt = 0;
- MD5_Update(&ctx, (char *)&nxt, sizeof(nxt));
- MD5_Update(&ctx, (char *)&nxt, sizeof(nxt));
- MD5_Update(&ctx, (char *)&nxt, sizeof(nxt));
- nxt = IPPROTO_TCP;
- MD5_Update(&ctx, (char *)&nxt, sizeof(nxt));
+ } else if (IP_V(ip) == 6) {
+ ip6 = (struct ip6_hdr *)ip;
+ MD5_Update(&ctx, (char *)&ip6->ip6_src, sizeof(ip6->ip6_src));
+ MD5_Update(&ctx, (char *)&ip6->ip6_dst, sizeof(ip6->ip6_dst));
+ len32 = htonl(EXTRACT_16BITS(&ip6->ip6_plen));
+ MD5_Update(&ctx, (char *)&len32, sizeof(len32));
+ nxt = 0;
+ MD5_Update(&ctx, (char *)&nxt, sizeof(nxt));
+ MD5_Update(&ctx, (char *)&nxt, sizeof(nxt));
+ MD5_Update(&ctx, (char *)&nxt, sizeof(nxt));
+ nxt = IPPROTO_TCP;
+ MD5_Update(&ctx, (char *)&nxt, sizeof(nxt));
#endif
- } else
- return (CANT_CHECK_SIGNATURE);
+ } else {
+#ifdef INET6
+ printf("IP version not 4 or 6, ");
+#else
+ printf("IP version not 4, ");
+#endif
+ return (CANT_CHECK_SIGNATURE);
+ }
- /*
- * Step 2: Update MD5 hash with TCP header, excluding options.
- * The TCP checksum must be set to zero.
- */
- savecsum = tp1.th_sum;
- tp1.th_sum = 0;
- MD5_Update(&ctx, (char *)&tp1, sizeof(struct tcphdr));
- tp1.th_sum = savecsum;
- /*
- * Step 3: Update MD5 hash with TCP segment data, if present.
- */
- if (length > 0)
- MD5_Update(&ctx, data, length);
- /*
- * Step 4: Update MD5 hash with shared secret.
- */
- MD5_Update(&ctx, tcpmd5secret, strlen(tcpmd5secret));
- MD5_Final(sig, &ctx);
+ /*
+ * Step 2: Update MD5 hash with TCP header, excluding options.
+ * The TCP checksum must be set to zero.
+ */
+ savecsum = tp1.th_sum;
+ tp1.th_sum = 0;
+ MD5_Update(&ctx, (char *)&tp1, sizeof(struct tcphdr));
+ tp1.th_sum = savecsum;
+ /*
+ * Step 3: Update MD5 hash with TCP segment data, if present.
+ */
+ if (length > 0)
+ MD5_Update(&ctx, data, length);
+ /*
+ * Step 4: Update MD5 hash with shared secret.
+ */
+ MD5_Update(&ctx, sigsecret, strlen(sigsecret));
+ MD5_Final(sig, &ctx);
- if (memcmp(rcvsig, sig, TCP_SIGLEN) == 0)
- return (SIGNATURE_VALID);
- else
- return (SIGNATURE_INVALID);
+ if (memcmp(rcvsig, sig, TCP_SIGLEN) == 0)
+ return (SIGNATURE_VALID);
+ else
+ return (SIGNATURE_INVALID);
}
#endif /* HAVE_LIBCRYPTO */
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 8
+ * End:
+ */
Modified: trunk/contrib/tcpdump/print-telnet.c
===================================================================
--- trunk/contrib/tcpdump/print-telnet.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-telnet.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -51,7 +51,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-telnet.c,v 1.1.1.2 2006-02-25 02:34:03 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-telnet.c,v 1.24 2003-12-29 11:05:10 hannes Exp $";
#endif
#include <tcpdump-stdinc.h>
Modified: trunk/contrib/tcpdump/print-tftp.c
===================================================================
--- trunk/contrib/tcpdump/print-tftp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-tftp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-tftp.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-tftp.c,v 1.39 2008-04-11 16:47:38 gianluca Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -50,7 +50,7 @@
{ WRQ, "WRQ" }, /* write request */
{ DATA, "DATA" }, /* data packet */
{ ACK, "ACK" }, /* acknowledgement */
- { ERROR, "ERROR" }, /* error code */
+ { TFTP_ERROR, "ERROR" }, /* error code */
{ OACK, "OACK" }, /* option acknowledgement */
{ 0, NULL }
};
@@ -99,15 +99,7 @@
case RRQ:
case WRQ:
case OACK:
- /*
- * XXX Not all arpa/tftp.h's specify th_stuff as any
- * array; use address of th_block instead
- */
-#ifdef notdef
p = (u_char *)tp->th_stuff;
-#else
- p = (u_char *)&tp->th_block;
-#endif
putchar(' ');
/* Print filename or first option */
if (opcode != OACK)
@@ -137,7 +129,7 @@
printf(" block %d", EXTRACT_16BITS(&tp->th_block));
break;
- case ERROR:
+ case TFTP_ERROR:
/* Print error code string */
TCHECK(tp->th_code);
printf(" %s \"", tok2str(err2str, "tftp-err-#%d \"",
Modified: trunk/contrib/tcpdump/print-timed.c
===================================================================
--- trunk/contrib/tcpdump/print-timed.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-timed.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-timed.c,v 1.1.1.2 2006-02-25 02:34:03 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-timed.c,v 1.9 2003-11-16 09:36:40 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
Added: trunk/contrib/tcpdump/print-tipc.c
===================================================================
--- trunk/contrib/tcpdump/print-tipc.c (rev 0)
+++ trunk/contrib/tcpdump/print-tipc.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,392 @@
+/*
+ * 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.
+ */
+
+#ifndef lint
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/print-arp.c,v 1.66 2006-03-03 22:53:21 hannes Exp $ (LBL)";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include "netdissect.h"
+#include "addrtoname.h"
+#include "ether.h"
+#include "ethertype.h"
+#include "extract.h" /* must come after interface.h */
+
+/*
+ * Transparent Inter-Process Communication (TIPC) protocol.
+ *
+ * http://tipc.sourceforge.net/doc/draft-spec-tipc-07.html
+ * http://tipc.sourceforge.net/doc/tipc_message_formats.html
+ */
+
+#define TIPC_USER_LOW_IMPORTANCE 0
+#define TIPC_USER_MEDIUM_IMPORTANCE 1
+#define TIPC_USER_HIGH_IMPORTANCE 2
+#define TIPC_USER_CRITICAL_IMPORTANCE 3
+#define TIPC_USER_BCAST_PROTOCOL 5
+#define TIPC_USER_MSG_BUNDLER 6
+#define TIPC_USER_LINK_PROTOCOL 7
+#define TIPC_USER_CONN_MANAGER 8
+#define TIPC_USER_CHANGEOVER_PROTOCOL 10
+#define TIPC_USER_NAME_DISTRIBUTOR 11
+#define TIPC_USER_MSG_FRAGMENTER 12
+#define TIPC_USER_LINK_CONFIG 13
+
+#define TIPC_CONN_MSG 0
+#define TIPC_DIRECT_MSG 1
+#define TIPC_NAMED_MSG 2
+#define TIPC_MCAST_MSG 3
+
+#define TIPC_ZONE(addr) (((addr) >> 24) & 0xFF)
+#define TIPC_CLUSTER(addr) (((addr) >> 12) & 0xFFF)
+#define TIPC_NODE(addr) (((addr) >> 0) & 0xFFF)
+
+struct tipc_pkthdr {
+ u_int32_t w0;
+ u_int32_t w1;
+};
+
+#define TIPC_VER(w0) (((w0) >> 29) & 0x07)
+#define TIPC_USER(w0) (((w0) >> 25) & 0x0F)
+#define TIPC_HSIZE(w0) (((w0) >> 21) & 0x0F)
+#define TIPC_MSIZE(w0) (((w0) >> 0) & 0xFFFF)
+#define TIPC_MTYPE(w1) (((w1) >> 29) & 0x07)
+#define TIPC_BROADCAST_ACK(w1) (((w1) >> 0) & 0xFFFF)
+#define TIPC_LINK_ACK(w2) (((w2) >> 16) & 0xFFFF)
+#define TIPC_LINK_SEQ(w2) (((w2) >> 0) & 0xFFFF)
+
+static const struct tok tipcuser_values[] = {
+ { TIPC_USER_LOW_IMPORTANCE, "Low Importance Data payload" },
+ { TIPC_USER_MEDIUM_IMPORTANCE, "Medium Importance Data payload" },
+ { TIPC_USER_HIGH_IMPORTANCE, "High Importance Data payload" },
+ { TIPC_USER_CRITICAL_IMPORTANCE, "Critical Importance Data payload" },
+ { TIPC_USER_BCAST_PROTOCOL, "Broadcast Link Protocol internal" },
+ { TIPC_USER_MSG_BUNDLER, "Message Bundler Protocol internal" },
+ { TIPC_USER_LINK_PROTOCOL, "Link State Protocol internal" },
+ { TIPC_USER_CONN_MANAGER, "Connection Manager internal" },
+ { TIPC_USER_CHANGEOVER_PROTOCOL, "Link Changeover Protocol internal" },
+ { TIPC_USER_NAME_DISTRIBUTOR, "Name Table Update Protocol internal" },
+ { TIPC_USER_MSG_FRAGMENTER, "Message Fragmentation Protocol internal" },
+ { TIPC_USER_LINK_CONFIG, "Neighbor Detection Protocol internal" },
+ { 0, NULL }
+};
+
+static const struct tok tipcmtype_values[] = {
+ { TIPC_CONN_MSG, "CONN_MSG" },
+ { TIPC_DIRECT_MSG, "MCAST_MSG" },
+ { TIPC_NAMED_MSG, "NAMED_MSG" },
+ { TIPC_MCAST_MSG, "DIRECT_MSG" },
+ { 0, NULL }
+};
+
+static const struct tok tipc_linkconf_mtype_values[] = {
+ { 0, "Link request" },
+ { 1, "Link response" },
+ { 0, NULL }
+};
+
+struct payload_tipc_pkthdr {
+ u_int32_t w0;
+ u_int32_t w1;
+ u_int32_t w2;
+ u_int32_t prev_node;
+ u_int32_t orig_port;
+ u_int32_t dest_port;
+ u_int32_t orig_node;
+ u_int32_t dest_node;
+ u_int32_t name_type;
+ u_int32_t w9;
+ u_int32_t wA;
+};
+
+struct internal_tipc_pkthdr {
+ u_int32_t w0;
+ u_int32_t w1;
+ u_int32_t w2;
+ u_int32_t prev_node;
+ u_int32_t w4;
+ u_int32_t w5;
+ u_int32_t orig_node;
+ u_int32_t dest_node;
+ u_int32_t trans_seq;
+ u_int32_t w9;
+};
+
+#define TIPC_SEQ_GAP(w1) (((w1) >> 16) & 0x1FFF)
+#define TIPC_BC_GAP_AFTER(w2) (((w2) >> 16) & 0xFFFF)
+#define TIPC_BC_GAP_TO(w2) (((w2) >> 0) & 0xFFFF)
+#define TIPC_LAST_SENT_FRAG(w4) (((w4) >> 16) & 0xFFFF)
+#define TIPC_NEXT_SENT_FRAG(w4) (((w4) >> 0) & 0xFFFF)
+#define TIPC_SESS_NO(w5) (((w5) >> 16) & 0xFFFF)
+#define TIPC_MSG_CNT(w9) (((w9) >> 16) & 0xFFFF)
+#define TIPC_LINK_TOL(w9) (((w9) >> 0) & 0xFFFF)
+
+struct link_conf_tipc_pkthdr {
+ u_int32_t w0;
+ u_int32_t w1;
+ u_int32_t dest_domain;
+ u_int32_t prev_node;
+ u_int32_t ntwrk_id;
+ u_int32_t w5;
+ u_int8_t media_address[16];
+};
+
+#define TIPC_NODE_SIG(w1) (((w1) >> 0) & 0xFFFF)
+#define TIPC_MEDIA_ID(w5) (((w5) >> 0) & 0xFF)
+
+static void
+print_payload(netdissect_options *ndo, const struct payload_tipc_pkthdr *ap)
+{
+ u_int32_t w0, w1, w2;
+ u_int user;
+ u_int hsize;
+ u_int msize;
+ u_int mtype;
+ u_int broadcast_ack;
+ u_int link_ack;
+ u_int link_seq;
+ u_int prev_node;
+ u_int orig_port;
+ u_int dest_port;
+ u_int orig_node;
+ u_int dest_node;
+
+ ND_TCHECK(ap->dest_port);
+ w0 = EXTRACT_32BITS(&ap->w0);
+ user = TIPC_USER(w0);
+ hsize = TIPC_HSIZE(w0);
+ msize = TIPC_MSIZE(w0);
+ w1 = EXTRACT_32BITS(&ap->w1);
+ mtype = TIPC_MTYPE(w1);
+ prev_node = EXTRACT_32BITS(&ap->prev_node);
+ orig_port = EXTRACT_32BITS(&ap->orig_port);
+ dest_port = EXTRACT_32BITS(&ap->dest_port);
+ if (hsize <= 6) {
+ ND_PRINT((ndo, "TIPC v%u.0 %u.%u.%u:%u > %u, headerlength %u bytes, MessageSize %u bytes, %s, messageType %s",
+ TIPC_VER(w0),
+ TIPC_ZONE(prev_node), TIPC_CLUSTER(prev_node), TIPC_NODE(prev_node),
+ orig_port, dest_port,
+ hsize*4, msize,
+ tok2str(tipcuser_values, "unknown", user),
+ tok2str(tipcmtype_values, "Unknown", mtype)));
+ } else {
+ ND_TCHECK(ap->dest_node);
+ orig_node = EXTRACT_32BITS(&ap->orig_node);
+ dest_node = EXTRACT_32BITS(&ap->dest_node);
+ ND_PRINT((ndo, "TIPC v%u.0 %u.%u.%u:%u > %u.%u.%u:%u, headerlength %u bytes, MessageSize %u bytes, %s, messageType %s",
+ TIPC_VER(w0),
+ TIPC_ZONE(orig_node), TIPC_CLUSTER(orig_node), TIPC_NODE(orig_node),
+ orig_port,
+ TIPC_ZONE(dest_node), TIPC_CLUSTER(dest_node), TIPC_NODE(dest_node),
+ dest_port,
+ hsize*4, msize,
+ tok2str(tipcuser_values, "unknown", user),
+ tok2str(tipcmtype_values, "Unknown", mtype)));
+
+ if (ndo->ndo_vflag) {
+ broadcast_ack = TIPC_BROADCAST_ACK(w1);
+ w2 = EXTRACT_32BITS(&ap->w2);
+ link_ack = TIPC_LINK_ACK(w2);
+ link_seq = TIPC_LINK_SEQ(w2);
+ ND_PRINT((ndo, "\n\tPrevious Node %u.%u.%u, Broadcast Ack %u, Link Ack %u, Link Sequence %u",
+ TIPC_ZONE(prev_node), TIPC_CLUSTER(prev_node), TIPC_NODE(prev_node),
+ broadcast_ack, link_ack, link_seq));
+ }
+ }
+ return;
+
+trunc:
+ ND_PRINT((ndo, "[|TIPC]"));
+}
+
+static void
+print_internal(netdissect_options *ndo, const struct internal_tipc_pkthdr *ap)
+{
+ u_int32_t w0, w1, w2, w4, w5, w9;
+ u_int user;
+ u_int hsize;
+ u_int msize;
+ u_int mtype;
+ u_int seq_gap;
+ u_int broadcast_ack;
+ u_int bc_gap_after;
+ u_int bc_gap_to;
+ u_int prev_node;
+ u_int last_sent_frag;
+ u_int next_sent_frag;
+ u_int sess_no;
+ u_int orig_node;
+ u_int dest_node;
+ u_int trans_seq;
+ u_int msg_cnt;
+ u_int link_tol;
+
+ ND_TCHECK(ap->dest_node);
+ w0 = EXTRACT_32BITS(&ap->w0);
+ user = TIPC_USER(w0);
+ hsize = TIPC_HSIZE(w0);
+ msize = TIPC_MSIZE(w0);
+ w1 = EXTRACT_32BITS(&ap->w1);
+ mtype = TIPC_MTYPE(w1);
+ orig_node = EXTRACT_32BITS(&ap->orig_node);
+ dest_node = EXTRACT_32BITS(&ap->dest_node);
+ ND_PRINT((ndo, "TIPC v%u.0 %u.%u.%u > %u.%u.%u, headerlength %u bytes, MessageSize %u bytes, %s, messageType %s (0x%08x)",
+ TIPC_VER(w0),
+ TIPC_ZONE(orig_node), TIPC_CLUSTER(orig_node), TIPC_NODE(orig_node),
+ TIPC_ZONE(dest_node), TIPC_CLUSTER(dest_node), TIPC_NODE(dest_node),
+ hsize*4, msize,
+ tok2str(tipcuser_values, "unknown", user),
+ tok2str(tipcmtype_values, "Unknown", mtype), w1));
+
+ if (ndo->ndo_vflag) {
+ ND_TCHECK(*ap);
+ seq_gap = TIPC_SEQ_GAP(w1);
+ broadcast_ack = TIPC_BROADCAST_ACK(w1);
+ w2 = EXTRACT_32BITS(&ap->w2);
+ bc_gap_after = TIPC_BC_GAP_AFTER(w2);
+ bc_gap_to = TIPC_BC_GAP_TO(w2);
+ prev_node = EXTRACT_32BITS(&ap->prev_node);
+ w4 = EXTRACT_32BITS(&ap->w4);
+ last_sent_frag = TIPC_LAST_SENT_FRAG(w4);
+ next_sent_frag = TIPC_NEXT_SENT_FRAG(w4);
+ w5 = EXTRACT_32BITS(&ap->w5);
+ sess_no = TIPC_SESS_NO(w5);
+ trans_seq = EXTRACT_32BITS(&ap->trans_seq);
+ w9 = EXTRACT_32BITS(&ap->w9);
+ msg_cnt = TIPC_MSG_CNT(w9);
+ link_tol = TIPC_LINK_TOL(w9);
+ ND_PRINT((ndo, "\n\tPrevious Node %u.%u.%u, Session No. %u, Broadcast Ack %u, Sequence Gap %u, Broadcast Gap After %u, Broadcast Gap To %u, Last Sent Packet No. %u, Next sent Packet No. %u, Transport Sequence %u, msg_count %u, Link Tolerance %u",
+ TIPC_ZONE(prev_node), TIPC_CLUSTER(prev_node), TIPC_NODE(prev_node),
+ sess_no, broadcast_ack, seq_gap, bc_gap_after, bc_gap_to,
+ last_sent_frag, next_sent_frag, trans_seq, msg_cnt,
+ link_tol));
+ }
+ return;
+
+trunc:
+ ND_PRINT((ndo, "[|TIPC]"));
+}
+
+static void
+print_link_conf(netdissect_options *ndo, const struct link_conf_tipc_pkthdr *ap)
+{
+ u_int32_t w0, w1, w5;
+ u_int user;
+ u_int hsize;
+ u_int msize;
+ u_int mtype;
+ u_int node_sig;
+ u_int prev_node;
+ u_int dest_domain;
+ u_int ntwrk_id;
+ u_int media_id;
+
+ ND_TCHECK(ap->prev_node);
+ w0 = EXTRACT_32BITS(&ap->w0);
+ user = TIPC_USER(w0);
+ hsize = TIPC_HSIZE(w0);
+ msize = TIPC_MSIZE(w0);
+ w1 = EXTRACT_32BITS(&ap->w1);
+ mtype = TIPC_MTYPE(w1);
+ prev_node = EXTRACT_32BITS(&ap->prev_node);
+ dest_domain = EXTRACT_32BITS(&ap->dest_domain);
+ prev_node = EXTRACT_32BITS(&ap->prev_node);
+
+ ND_PRINT((ndo, "TIPC v%u.0 %u.%u.%u > %u.%u.%u, headerlength %u bytes, MessageSize %u bytes, %s, messageType %s",
+ TIPC_VER(w0),
+ TIPC_ZONE(prev_node), TIPC_CLUSTER(prev_node), TIPC_NODE(prev_node),
+ TIPC_ZONE(dest_domain), TIPC_CLUSTER(dest_domain), TIPC_NODE(dest_domain),
+ hsize*4, msize,
+ tok2str(tipcuser_values, "unknown", user),
+ tok2str(tipc_linkconf_mtype_values, "Unknown", mtype)));
+ if (ndo->ndo_vflag) {
+ ND_TCHECK(ap->w5);
+ node_sig = TIPC_NODE_SIG(w1);
+ ntwrk_id = EXTRACT_32BITS(&ap->ntwrk_id);
+ w5 = EXTRACT_32BITS(&ap->w5);
+ media_id = TIPC_MEDIA_ID(w5);
+ ND_PRINT((ndo, "\n\tNodeSignature %u, network_id %u, media_id %u",
+ node_sig, ntwrk_id, media_id));
+ }
+ return;
+
+trunc:
+ ND_PRINT((ndo, "[|TIPC]"));
+}
+
+void
+tipc_print(netdissect_options *ndo, const u_char *bp, u_int length _U_,
+ u_int caplen _U_)
+{
+ const struct tipc_pkthdr *ap;
+ u_int32_t w0;
+ u_int user;
+
+ ap = (struct tipc_pkthdr *)bp;
+ ND_TCHECK(ap->w0);
+ w0 = EXTRACT_32BITS(&ap->w0);
+ user = TIPC_USER(w0);
+
+ switch (user)
+ {
+ case TIPC_USER_LOW_IMPORTANCE:
+ case TIPC_USER_MEDIUM_IMPORTANCE:
+ case TIPC_USER_HIGH_IMPORTANCE:
+ case TIPC_USER_CRITICAL_IMPORTANCE:
+ case TIPC_USER_NAME_DISTRIBUTOR:
+ case TIPC_USER_CONN_MANAGER:
+ print_payload(ndo, (struct payload_tipc_pkthdr *)bp);
+ break;
+
+ case TIPC_USER_LINK_CONFIG:
+ print_link_conf(ndo, (struct link_conf_tipc_pkthdr *)bp);
+ break;
+
+ case TIPC_USER_BCAST_PROTOCOL:
+ case TIPC_USER_MSG_BUNDLER:
+ case TIPC_USER_LINK_PROTOCOL:
+ case TIPC_USER_CHANGEOVER_PROTOCOL:
+ case TIPC_USER_MSG_FRAGMENTER:
+ print_internal(ndo, (struct internal_tipc_pkthdr *)bp);
+ break;
+
+ }
+ return;
+
+trunc:
+ ND_PRINT((ndo, "[|TIPC]"));
+}
+
+/*
+ * Local Variables:
+ * c-style: bsd
+ * End:
+ */
+
Property changes on: trunk/contrib/tcpdump/print-tipc.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-token.c
===================================================================
--- trunk/contrib/tcpdump/print-token.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-token.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -23,11 +23,11 @@
* Further tweaked to more closely resemble print-fddi.c
* Guy Harris <guy at alum.mit.edu>
*
- * $FreeBSD: src/contrib/tcpdump/print-token.c,v 1.8.2.1 2007/10/19 03:04:00 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-token.c 214478 2010-10-28 19:06:17Z rpaulo $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-token.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.27 2005-11-13 12:12:43 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -41,6 +41,7 @@
#include <string.h>
#include "interface.h"
+#include "extract.h"
#include "addrtoname.h"
#include "ethertype.h"
@@ -128,7 +129,16 @@
if (eflag)
token_hdr_print(trp, length, ESRC(&ehdr), EDST(&ehdr));
+ if (caplen < TOKEN_HDRLEN + 2) {
+ printf("[|token-ring]");
+ return hdr_len;
+ }
route_len = RIF_LENGTH(trp);
+ hdr_len += route_len;
+ if (caplen < hdr_len) {
+ printf("[|token-ring]");
+ return hdr_len;
+ }
if (vflag) {
printf("%s ", broadcast_indicator[BROADCAST(trp)]);
printf("%s", direction[DIRECTION(trp)]);
@@ -137,10 +147,10 @@
printf(" [%d:%d]", RING_NUMBER(trp, seg),
BRIDGE_NUMBER(trp, seg));
} else {
- printf("rt = %x", ntohs(trp->token_rcf));
+ printf("rt = %x", EXTRACT_16BITS(&trp->token_rcf));
for (seg = 0; seg < SEGMENT_COUNT(trp); seg++)
- printf(":%x", ntohs(trp->token_rseg[seg]));
+ printf(":%x", EXTRACT_16BITS(&trp->token_rseg[seg]));
}
printf(" (%s) ", largest_frame[LARGEST_FRAME(trp)]);
} else {
@@ -149,7 +159,6 @@
}
/* Skip over token ring MAC header and routing information */
- hdr_len += route_len;
length -= hdr_len;
p += hdr_len;
caplen -= hdr_len;
Added: trunk/contrib/tcpdump/print-udld.c
===================================================================
--- trunk/contrib/tcpdump/print-udld.c (rev 0)
+++ trunk/contrib/tcpdump/print-udld.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 1998-2007 The TCPDUMP project
+ *
+ * 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.
+ *
+ * UNIDIRECTIONAL LINK DETECTION (UDLD) as per
+ * http://www.ietf.org/internet-drafts/draft-foschiano-udld-02.txt
+ *
+ * Original code by Carles Kishimoto <carles.kishimoto at gmail.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include "interface.h"
+#include "addrtoname.h"
+#include "extract.h"
+#include "nlpid.h"
+
+#define UDLD_HEADER_LEN 4
+#define UDLD_DEVICE_ID_TLV 0x0001
+#define UDLD_PORT_ID_TLV 0x0002
+#define UDLD_ECHO_TLV 0x0003
+#define UDLD_MESSAGE_INTERVAL_TLV 0x0004
+#define UDLD_TIMEOUT_INTERVAL_TLV 0x0005
+#define UDLD_DEVICE_NAME_TLV 0x0006
+#define UDLD_SEQ_NUMBER_TLV 0x0007
+
+static struct tok udld_tlv_values[] = {
+ { UDLD_DEVICE_ID_TLV, "Device-ID TLV"},
+ { UDLD_PORT_ID_TLV, "Port-ID TLV"},
+ { UDLD_ECHO_TLV, "Echo TLV"},
+ { UDLD_MESSAGE_INTERVAL_TLV, "Message Interval TLV"},
+ { UDLD_TIMEOUT_INTERVAL_TLV, "Timeout Interval TLV"},
+ { UDLD_DEVICE_NAME_TLV, "Device Name TLV"},
+ { UDLD_SEQ_NUMBER_TLV,"Sequence Number TLV"},
+ { 0, NULL}
+};
+
+static struct tok udld_code_values[] = {
+ { 0x00, "Reserved"},
+ { 0x01, "Probe message"},
+ { 0x02, "Echo message"},
+ { 0x03, "Flush message"},
+ { 0, NULL}
+};
+
+static struct tok udld_flags_values[] = {
+ { 0x00, "RT"},
+ { 0x01, "RSY"},
+ { 0, NULL}
+};
+
+/*
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Ver | Opcode | Flags | Checksum |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | List of TLVs (variable length list) |
+ * | ... |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ */
+
+#define UDLD_EXTRACT_VERSION(x) (((x)&0xe0)>>5)
+#define UDLD_EXTRACT_OPCODE(x) ((x)&0x1f)
+
+void
+udld_print (const u_char *pptr, u_int length)
+{
+ int code, type, len;
+ const u_char *tptr;
+
+ if (length < UDLD_HEADER_LEN)
+ goto trunc;
+
+ tptr = pptr;
+
+ if (!TTEST2(*tptr, UDLD_HEADER_LEN))
+ goto trunc;
+
+ code = UDLD_EXTRACT_OPCODE(*tptr);
+
+ printf("UDLDv%u, Code %s (%x), Flags [%s] (0x%02x), length %u",
+ UDLD_EXTRACT_VERSION(*tptr),
+ tok2str(udld_code_values, "Reserved", code),
+ code,
+ bittok2str(udld_flags_values, "none", *(tptr+1)),
+ *(tptr+1),
+ length);
+
+ /*
+ * In non-verbose mode, just print version and opcode type
+ */
+ if (vflag < 1) {
+ return;
+ }
+
+ printf("\n\tChecksum 0x%04x (unverified)", EXTRACT_16BITS(tptr+2));
+
+ tptr += UDLD_HEADER_LEN;
+
+ while (tptr < (pptr+length)) {
+
+ if (!TTEST2(*tptr, 4))
+ goto trunc;
+
+ type = EXTRACT_16BITS(tptr);
+ len = EXTRACT_16BITS(tptr+2);
+ len -= 4;
+ tptr += 4;
+
+ /* infinite loop check */
+ if (type == 0 || len == 0) {
+ return;
+ }
+
+ printf("\n\t%s (0x%04x) TLV, length %u",
+ tok2str(udld_tlv_values, "Unknown", type),
+ type, len);
+
+ switch (type) {
+ case UDLD_DEVICE_ID_TLV:
+ case UDLD_PORT_ID_TLV:
+ case UDLD_ECHO_TLV:
+ case UDLD_DEVICE_NAME_TLV:
+ printf(", %s", tptr);
+ break;
+
+ case UDLD_MESSAGE_INTERVAL_TLV:
+ case UDLD_TIMEOUT_INTERVAL_TLV:
+ printf(", %us", (*tptr));
+ break;
+
+ case UDLD_SEQ_NUMBER_TLV:
+ printf(", %u", EXTRACT_32BITS(tptr));
+ break;
+
+ default:
+ break;
+ }
+ tptr += len;
+ }
+
+ return;
+
+ trunc:
+ printf("[|udld]");
+}
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 4
+ * End:
+ */
Property changes on: trunk/contrib/tcpdump/print-udld.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-udp.c
===================================================================
--- trunk/contrib/tcpdump/print-udp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-udp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,12 +18,12 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $FreeBSD: src/contrib/tcpdump/print-udp.c,v 1.9.10.1 2007/10/19 03:04:00 mlaier Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/print-udp.c 252283 2013-06-27 00:37:59Z delphij $
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-udp.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.142 2007-08-08 17:20:58 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -35,7 +35,6 @@
#ifdef SEGSIZE
#undef SEGSIZE
#endif
-#include <arpa/tftp.h>
#include <stdio.h>
#include <string.h>
@@ -289,31 +288,8 @@
register const struct udphdr *up,
register u_int len)
{
- union phu {
- struct phdr {
- u_int32_t src;
- u_int32_t dst;
- u_char mbz;
- u_char proto;
- u_int16_t len;
- } ph;
- u_int16_t pa[6];
- } phu;
- register const u_int16_t *sp;
-
- /* pseudo-header.. */
- phu.ph.len = htons((u_int16_t)len);
- phu.ph.mbz = 0;
- phu.ph.proto = IPPROTO_UDP;
- memcpy(&phu.ph.src, &ip->ip_src.s_addr, sizeof(u_int32_t));
- if (IP_HL(ip) == 5)
- memcpy(&phu.ph.dst, &ip->ip_dst.s_addr, sizeof(u_int32_t));
- else
- phu.ph.dst = ip_finddst(ip);
-
- sp = &phu.pa[0];
- return in_cksum((u_short *)up, len,
- sp[0]+sp[1]+sp[2]+sp[3]+sp[4]+sp[5]);
+ return (nextproto4_cksum(ip, (const u_int8_t *)(void *)up, len,
+ IPPROTO_UDP));
}
#ifdef INET6
@@ -320,44 +296,8 @@
static int udp6_cksum(const struct ip6_hdr *ip6, const struct udphdr *up,
u_int len)
{
- size_t i;
- register const u_int16_t *sp;
- u_int32_t sum;
- union {
- struct {
- struct in6_addr ph_src;
- struct in6_addr ph_dst;
- u_int32_t ph_len;
- u_int8_t ph_zero[3];
- u_int8_t ph_nxt;
- } ph;
- u_int16_t pa[20];
- } phu;
-
- /* pseudo-header */
- memset(&phu, 0, sizeof(phu));
- phu.ph.ph_src = ip6->ip6_src;
- phu.ph.ph_dst = ip6->ip6_dst;
- phu.ph.ph_len = htonl(len);
- phu.ph.ph_nxt = IPPROTO_UDP;
-
- sum = 0;
- for (i = 0; i < sizeof(phu.pa) / sizeof(phu.pa[0]); i++)
- sum += phu.pa[i];
-
- sp = (const u_int16_t *)up;
-
- for (i = 0; i < (len & ~1); i += 2)
- sum += *sp++;
-
- if (len & 1)
- sum += htons((*(const u_int8_t *)sp) << 8);
-
- while (sum > 0xffff)
- sum = (sum & 0xffff) + (sum >> 16);
- sum = ~sum & 0xffff;
-
- return (sum);
+ return (nextproto6_cksum(ip6, (const u_int8_t *)(void *)up, len,
+ IPPROTO_UDP));
}
#endif
@@ -531,6 +471,16 @@
0);
#endif
break;
+
+ case PT_RADIUS:
+ udpipaddr_print(ip, sport, dport);
+ radius_print(cp, length);
+ break;
+
+ case PT_VXLAN:
+ udpipaddr_print(ip, sport, dport);
+ vxlan_print((const u_char *)(up + 1), length);
+ break;
}
return;
}
@@ -570,31 +520,46 @@
}
udpipaddr_print(ip, sport, dport);
- if (IP_V(ip) == 4 && (vflag > 1) && !fragmented) {
- int sum = up->uh_sum;
- if (sum == 0) {
- (void)printf("[no cksum] ");
- } else if (TTEST2(cp[0], length)) {
- sum = udp_cksum(ip, up, length + sizeof(struct udphdr));
- if (sum != 0)
- (void)printf("[bad udp cksum %x!] ", sum);
- else
- (void)printf("[udp sum ok] ");
+ if (vflag && !Kflag && !fragmented) {
+ /* Check the checksum, if possible. */
+ u_int16_t sum, udp_sum;
+
+ /*
+ * XXX - do this even if vflag == 1?
+ * TCP does, and we do so for UDP-over-IPv6.
+ */
+ if (IP_V(ip) == 4 && (vflag > 1)) {
+ udp_sum = EXTRACT_16BITS(&up->uh_sum);
+ if (udp_sum == 0) {
+ (void)printf("[no cksum] ");
+ } else if (TTEST2(cp[0], length)) {
+ sum = udp_cksum(ip, up, length + sizeof(struct udphdr));
+
+ if (sum != 0) {
+ (void)printf("[bad udp cksum 0x%04x -> 0x%04x!] ",
+ udp_sum,
+ in_cksum_shouldbe(udp_sum, sum));
+ } else
+ (void)printf("[udp sum ok] ");
+ }
}
- }
#ifdef INET6
- if (IP_V(ip) == 6 && ip6->ip6_plen && vflag && !fragmented) {
- int sum = up->uh_sum;
- /* for IPv6, UDP checksum is mandatory */
- if (TTEST2(cp[0], length)) {
- sum = udp6_cksum(ip6, up, length + sizeof(struct udphdr));
- if (sum != 0)
- (void)printf("[bad udp cksum %x!] ", sum);
- else
- (void)printf("[udp sum ok] ");
+ else if (IP_V(ip) == 6 && ip6->ip6_plen) {
+ /* for IPv6, UDP checksum is mandatory */
+ if (TTEST2(cp[0], length)) {
+ sum = udp6_cksum(ip6, up, length + sizeof(struct udphdr));
+ udp_sum = EXTRACT_16BITS(&up->uh_sum);
+
+ if (sum != 0) {
+ (void)printf("[bad udp cksum 0x%04x -> 0x%04x!] ",
+ udp_sum,
+ in_cksum_shouldbe(udp_sum, sum));
+ } else
+ (void)printf("[udp sum ok] ");
+ }
}
+#endif
}
-#endif
if (!qflag) {
#define ISPORT(p) (dport == (p) || sport == (p))
@@ -654,9 +619,10 @@
#ifdef INET6
else if (ISPORT(RIPNG_PORT))
ripng_print((const u_char *)(up + 1), length);
- else if (ISPORT(DHCP6_SERV_PORT) || ISPORT(DHCP6_CLI_PORT)) {
+ else if (ISPORT(DHCP6_SERV_PORT) || ISPORT(DHCP6_CLI_PORT))
dhcp6_print((const u_char *)(up + 1), length);
- }
+ else if (ISPORT(BABEL_PORT) || ISPORT(BABEL_PORT_OLD))
+ babel_print((const u_char *)(up + 1), length);
#endif /*INET6*/
/*
* Kludge in test for whiteboard packets.
@@ -674,11 +640,16 @@
hsrp_print((const u_char *)(up + 1), length);
else if (ISPORT(LWRES_PORT))
lwres_print((const u_char *)(up + 1), length);
- else if (ISPORT(LDP_PORT))
+ else if (ISPORT(LDP_PORT))
ldp_print((const u_char *)(up + 1), length);
- else if (ISPORT(OLSR_PORT))
- olsr_print((const u_char *)(up + 1), length);
- else if (ISPORT(MPLS_LSP_PING_PORT))
+ else if (ISPORT(OLSR_PORT))
+ olsr_print((const u_char *)(up + 1), length,
+#if INET6
+ (IP_V(ip) == 6) ? 1 : 0);
+#else
+ 0);
+#endif
+ else if (ISPORT(MPLS_LSP_PING_PORT))
lspping_print((const u_char *)(up + 1), length);
else if (dport == BFD_CONTROL_PORT ||
dport == BFD_ECHO_PORT )
@@ -685,10 +656,22 @@
bfd_print((const u_char *)(up+1), length, dport);
else if (ISPORT(LMP_PORT))
lmp_print((const u_char *)(up + 1), length);
+ else if (ISPORT(VQP_PORT))
+ vqp_print((const u_char *)(up + 1), length);
+ else if (ISPORT(SFLOW_PORT))
+ sflow_print((const u_char *)(up + 1), length);
+ else if (dport == LWAPP_CONTROL_PORT)
+ lwapp_control_print((const u_char *)(up + 1), length, 1);
+ else if (sport == LWAPP_CONTROL_PORT)
+ lwapp_control_print((const u_char *)(up + 1), length, 0);
+ else if (ISPORT(LWAPP_DATA_PORT))
+ lwapp_data_print((const u_char *)(up + 1), length);
else if (ISPORT(SIP_PORT))
sip_print((const u_char *)(up + 1), length);
else if (ISPORT(SYSLOG_PORT))
syslog_print((const u_char *)(up + 1), length);
+ else if (ISPORT(OTV_PORT))
+ otv_print((const u_char *)(up + 1), length);
else
(void)printf("UDP, length %u",
(u_int32_t)(ulen - sizeof(*up)));
Added: trunk/contrib/tcpdump/print-usb.c
===================================================================
--- trunk/contrib/tcpdump/print-usb.c (rev 0)
+++ trunk/contrib/tcpdump/print-usb.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,174 @@
+/*
+ * Copyright 2009 Bert Vermeulen <bert at biot.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 Paolo Abeni.''
+ * The name of author 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.
+ *
+ * Support for USB packets
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <pcap.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "interface.h"
+
+
+#if defined(HAVE_PCAP_USB_H) && defined(DLT_USB_LINUX)
+#include <pcap/usb.h>
+
+/* returns direction: 1=inbound 2=outbound -1=invalid */
+static int
+get_direction(int transfer_type, int event_type)
+{
+ int direction;
+
+ direction = -1;
+ switch(transfer_type){
+ case URB_BULK:
+ case URB_CONTROL:
+ case URB_ISOCHRONOUS:
+ switch(event_type)
+ {
+ case URB_SUBMIT:
+ direction = 2;
+ break;
+ case URB_COMPLETE:
+ case URB_ERROR:
+ direction = 1;
+ break;
+ default:
+ direction = -1;
+ }
+ break;
+ case URB_INTERRUPT:
+ switch(event_type)
+ {
+ case URB_SUBMIT:
+ direction = 1;
+ break;
+ case URB_COMPLETE:
+ case URB_ERROR:
+ direction = 2;
+ break;
+ default:
+ direction = -1;
+ }
+ break;
+ default:
+ direction = -1;
+ }
+
+ return direction;
+}
+
+static void
+usb_header_print(const pcap_usb_header *uh)
+{
+ int direction;
+
+ switch(uh->transfer_type)
+ {
+ case URB_ISOCHRONOUS:
+ printf("ISOCHRONOUS");
+ break;
+ case URB_INTERRUPT:
+ printf("INTERRUPT");
+ break;
+ case URB_CONTROL:
+ printf("CONTROL");
+ break;
+ case URB_BULK:
+ printf("BULK");
+ break;
+ default:
+ printf(" ?");
+ }
+
+ switch(uh->event_type)
+ {
+ case URB_SUBMIT:
+ printf(" SUBMIT");
+ break;
+ case URB_COMPLETE:
+ printf(" COMPLETE");
+ break;
+ case URB_ERROR:
+ printf(" ERROR");
+ break;
+ default:
+ printf(" ?");
+ }
+
+ direction = get_direction(uh->transfer_type, uh->event_type);
+ if(direction == 1)
+ printf(" from");
+ else if(direction == 2)
+ printf(" to");
+ printf(" %d:%d:%d", uh->bus_id, uh->device_address, uh->endpoint_number & 0x7f);
+}
+
+/*
+ * This is the top level routine of the printer for captures with a
+ * 48-byte header.
+ *
+ * 'p' points to the header of the packet, 'h->ts' is the timestamp,
+ * 'h->len' is the length of the packet off the wire, and 'h->caplen'
+ * is the number of bytes actually captured.
+ */
+u_int
+usb_linux_48_byte_print(const struct pcap_pkthdr *h, register const u_char *p)
+{
+ if (h->caplen < sizeof(pcap_usb_header)) {
+ printf("[|usb]");
+ return(sizeof(pcap_usb_header));
+ }
+
+ usb_header_print((const pcap_usb_header *) p);
+
+ return(sizeof(pcap_usb_header));
+}
+
+#ifdef DLT_USB_LINUX_MMAPPED
+/*
+ * This is the top level routine of the printer for captures with a
+ * 64-byte header.
+ *
+ * 'p' points to the header of the packet, 'h->ts' is the timestamp,
+ * 'h->len' is the length of the packet off the wire, and 'h->caplen'
+ * is the number of bytes actually captured.
+ */
+u_int
+usb_linux_64_byte_print(const struct pcap_pkthdr *h, register const u_char *p)
+{
+ if (h->caplen < sizeof(pcap_usb_header_mmapped)) {
+ printf("[|usb]");
+ return(sizeof(pcap_usb_header_mmapped));
+ }
+
+ usb_header_print((const pcap_usb_header *) p);
+
+ return(sizeof(pcap_usb_header_mmapped));
+}
+#endif /* DLT_USB_LINUX_MMAPPED */
+
+#endif /* defined(HAVE_PCAP_USB_H) && defined(DLT_USB_LINUX) */
+
Property changes on: trunk/contrib/tcpdump/print-usb.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-vjc.c
===================================================================
--- trunk/contrib/tcpdump/print-vjc.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-vjc.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -25,7 +25,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-vjc.c,v 1.1.1.2 2006-02-25 02:34:03 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-vjc.c,v 1.15 2004-03-25 03:31:17 mcr Exp $ (LBL)";
#endif
#include <tcpdump-stdinc.h>
Added: trunk/contrib/tcpdump/print-vqp.c
===================================================================
--- trunk/contrib/tcpdump/print-vqp.c (rev 0)
+++ trunk/contrib/tcpdump/print-vqp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 1998-2006 The TCPDUMP project
+ *
+ * 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.
+ *
+ * support for the Cisco prop. VQP Protocol
+ *
+ * Original code by Carles Kishimoto <Carles.Kishimoto at bsc.es>
+ */
+
+#ifndef lint
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/print-vqp.c,v 1.3 2006-08-19 06:51:13 guy Exp $";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "interface.h"
+#include "extract.h"
+#include "addrtoname.h"
+
+#define VQP_VERSION 1
+#define VQP_EXTRACT_VERSION(x) ((x)&0xFF)
+
+/*
+ * VQP common header
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Constant | Packet type | Error Code | nitems |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Packet Sequence Number (4 bytes) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+
+struct vqp_common_header_t {
+ u_int8_t version;
+ u_int8_t msg_type;
+ u_int8_t error_code;
+ u_int8_t nitems;
+ u_int8_t sequence[4];
+};
+
+struct vqp_obj_tlv_t {
+ u_int8_t obj_type[4];
+ u_int8_t obj_length[2];
+};
+
+#define VQP_OBJ_REQ_JOIN_PORT 0x01
+#define VQP_OBJ_RESP_VLAN 0x02
+#define VQP_OBJ_REQ_RECONFIRM 0x03
+#define VQP_OBJ_RESP_RECONFIRM 0x04
+
+static const struct tok vqp_msg_type_values[] = {
+ { VQP_OBJ_REQ_JOIN_PORT, "Request, Join Port"},
+ { VQP_OBJ_RESP_VLAN, "Response, VLAN"},
+ { VQP_OBJ_REQ_RECONFIRM, "Request, Reconfirm"},
+ { VQP_OBJ_RESP_RECONFIRM, "Response, Reconfirm"},
+ { 0, NULL}
+};
+
+static const struct tok vqp_error_code_values[] = {
+ { 0x00, "No error"},
+ { 0x03, "Access denied"},
+ { 0x04, "Shutdown port"},
+ { 0x05, "Wrong VTP domain"},
+ { 0, NULL}
+};
+
+/* FIXME the heading 0x0c looks ugly - those must be flags etc. */
+#define VQP_OBJ_IP_ADDRESS 0x0c01
+#define VQP_OBJ_PORT_NAME 0x0c02
+#define VQP_OBJ_VLAN_NAME 0x0c03
+#define VQP_OBJ_VTP_DOMAIN 0x0c04
+#define VQP_OBJ_ETHERNET_PKT 0x0c05
+#define VQP_OBJ_MAC_NULL 0x0c06
+#define VQP_OBJ_MAC_ADDRESS 0x0c08
+
+static const struct tok vqp_obj_values[] = {
+ { VQP_OBJ_IP_ADDRESS, "Client IP Address" },
+ { VQP_OBJ_PORT_NAME, "Port Name" },
+ { VQP_OBJ_VLAN_NAME, "VLAN Name" },
+ { VQP_OBJ_VTP_DOMAIN, "VTP Domain" },
+ { VQP_OBJ_ETHERNET_PKT, "Ethernet Packet" },
+ { VQP_OBJ_MAC_NULL, "MAC Null" },
+ { VQP_OBJ_MAC_ADDRESS, "MAC Address" },
+ { 0, NULL}
+};
+
+void
+vqp_print(register const u_char *pptr, register u_int len)
+{
+ const struct vqp_common_header_t *vqp_common_header;
+ const struct vqp_obj_tlv_t *vqp_obj_tlv;
+
+ const u_char *tptr;
+ u_int16_t vqp_obj_len;
+ u_int32_t vqp_obj_type;
+ int tlen;
+ u_int8_t nitems;
+
+ tptr=pptr;
+ tlen = len;
+ vqp_common_header = (const struct vqp_common_header_t *)pptr;
+ TCHECK(*vqp_common_header);
+
+ /*
+ * Sanity checking of the header.
+ */
+ if (VQP_EXTRACT_VERSION(vqp_common_header->version) != VQP_VERSION) {
+ printf("VQP version %u packet not supported",
+ VQP_EXTRACT_VERSION(vqp_common_header->version));
+ return;
+ }
+
+ /* in non-verbose mode just lets print the basic Message Type */
+ if (vflag < 1) {
+ printf("VQPv%u %s Message, error-code %s (%u), length %u",
+ VQP_EXTRACT_VERSION(vqp_common_header->version),
+ tok2str(vqp_msg_type_values, "unknown (%u)",vqp_common_header->msg_type),
+ tok2str(vqp_error_code_values, "unknown (%u)",vqp_common_header->error_code),
+ vqp_common_header->error_code,
+ len);
+ return;
+ }
+
+ /* ok they seem to want to know everything - lets fully decode it */
+ nitems = vqp_common_header->nitems;
+ printf("\n\tVQPv%u, %s Message, error-code %s (%u), seq 0x%08x, items %u, length %u",
+ VQP_EXTRACT_VERSION(vqp_common_header->version),
+ tok2str(vqp_msg_type_values, "unknown (%u)",vqp_common_header->msg_type),
+ tok2str(vqp_error_code_values, "unknown (%u)",vqp_common_header->error_code),
+ vqp_common_header->error_code,
+ EXTRACT_32BITS(&vqp_common_header->sequence),
+ nitems,
+ len);
+
+ /* skip VQP Common header */
+ tptr+=sizeof(const struct vqp_common_header_t);
+ tlen-=sizeof(const struct vqp_common_header_t);
+
+ while (nitems > 0 && tlen > 0) {
+
+ vqp_obj_tlv = (const struct vqp_obj_tlv_t *)tptr;
+ vqp_obj_type = EXTRACT_32BITS(vqp_obj_tlv->obj_type);
+ vqp_obj_len = EXTRACT_16BITS(vqp_obj_tlv->obj_length);
+ tptr+=sizeof(struct vqp_obj_tlv_t);
+ tlen-=sizeof(struct vqp_obj_tlv_t);
+
+ printf("\n\t %s Object (0x%08x), length %u, value: ",
+ tok2str(vqp_obj_values, "Unknown", vqp_obj_type),
+ vqp_obj_type, vqp_obj_len);
+
+ /* basic sanity check */
+ if (vqp_obj_type == 0 || vqp_obj_len ==0) {
+ return;
+ }
+
+ /* did we capture enough for fully decoding the object ? */
+ if (!TTEST2(*tptr, vqp_obj_len))
+ goto trunc;
+
+ switch(vqp_obj_type) {
+ case VQP_OBJ_IP_ADDRESS:
+ printf("%s (0x%08x)", ipaddr_string(tptr), EXTRACT_32BITS(tptr));
+ break;
+ /* those objects have similar semantics - fall through */
+ case VQP_OBJ_PORT_NAME:
+ case VQP_OBJ_VLAN_NAME:
+ case VQP_OBJ_VTP_DOMAIN:
+ case VQP_OBJ_ETHERNET_PKT:
+ safeputs((const char *)tptr, vqp_obj_len);
+ break;
+ /* those objects have similar semantics - fall through */
+ case VQP_OBJ_MAC_ADDRESS:
+ case VQP_OBJ_MAC_NULL:
+ printf("%s", etheraddr_string(tptr));
+ break;
+ default:
+ if (vflag <= 1)
+ print_unknown_data(tptr, "\n\t ", vqp_obj_len);
+ break;
+ }
+ tptr += vqp_obj_len;
+ tlen -= vqp_obj_len;
+ nitems--;
+ }
+ return;
+trunc:
+ printf("\n\t[|VQP]");
+}
Property changes on: trunk/contrib/tcpdump/print-vqp.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-vrrp.c
===================================================================
--- trunk/contrib/tcpdump/print-vrrp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-vrrp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -25,7 +25,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-vrrp.c,v 1.1.1.2 2006-02-25 02:34:03 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-vrrp.c,v 1.10 2005-05-06 07:56:54 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -110,9 +110,15 @@
int i;
char c;
- if (TTEST2(bp[0], len) && in_cksum((const u_short*)bp, len, 0))
- printf(", (bad vrrp cksum %x)",
- EXTRACT_16BITS(&bp[6]));
+ if (TTEST2(bp[0], len)) {
+ struct cksum_vec vec[1];
+
+ vec[0].ptr = bp;
+ vec[0].len = len;
+ if (in_cksum(vec, 1))
+ printf(", (bad vrrp cksum %x)",
+ EXTRACT_16BITS(&bp[6]));
+ }
printf(", addrs");
if (naddrs > 1)
printf("(%d)", naddrs);
Added: trunk/contrib/tcpdump/print-vtp.c
===================================================================
--- trunk/contrib/tcpdump/print-vtp.c (rev 0)
+++ trunk/contrib/tcpdump/print-vtp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,378 @@
+/*
+ * Copyright (c) 1998-2007 The TCPDUMP project
+ *
+ * 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.
+ *
+ * VLAN TRUNKING PROTOCOL (VTP)
+ *
+ * Reference documentation:
+ * http://www.cisco.com/en/US/tech/tk389/tk689/technologies_tech_note09186a0080094c52.shtml
+ * http://www.cisco.com/warp/public/473/21.html
+ * http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm
+ *
+ * Original code ode by Carles Kishimoto <carles.kishimoto at gmail.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include "interface.h"
+#include "addrtoname.h"
+#include "extract.h"
+#include "nlpid.h"
+
+#define VTP_HEADER_LEN 36
+#define VTP_DOMAIN_NAME_LEN 32
+#define VTP_MD5_DIGEST_LEN 16
+#define VTP_UPDATE_TIMESTAMP_LEN 12
+#define VTP_VLAN_INFO_OFFSET 12
+
+#define VTP_SUMMARY_ADV 0x01
+#define VTP_SUBSET_ADV 0x02
+#define VTP_ADV_REQUEST 0x03
+#define VTP_JOIN_MESSAGE 0x04
+
+struct vtp_vlan_ {
+ u_int8_t len;
+ u_int8_t status;
+ u_int8_t type;
+ u_int8_t name_len;
+ u_int16_t vlanid;
+ u_int16_t mtu;
+ u_int32_t index;
+};
+
+static struct tok vtp_message_type_values[] = {
+ { VTP_SUMMARY_ADV, "Summary advertisement"},
+ { VTP_SUBSET_ADV, "Subset advertisement"},
+ { VTP_ADV_REQUEST, "Advertisement request"},
+ { VTP_JOIN_MESSAGE, "Join message"},
+ { 0, NULL }
+};
+
+static struct tok vtp_header_values[] = {
+ { 0x01, "Followers"}, /* On Summary advertisement, 3rd byte is Followers */
+ { 0x02, "Seq number"}, /* On Subset advertisement, 3rd byte is Sequence number */
+ { 0x03, "Rsvd"}, /* On Adver. requests 3rd byte is Rsvd */
+ { 0x04, "Rsvd"}, /* On Adver. requests 3rd byte is Rsvd */
+ { 0, NULL }
+};
+
+static struct tok vtp_vlan_type_values[] = {
+ { 0x01, "Ethernet"},
+ { 0x02, "FDDI"},
+ { 0x03, "TrCRF"},
+ { 0x04, "FDDI-net"},
+ { 0x05, "TrBRF"},
+ { 0, NULL }
+};
+
+static struct tok vtp_vlan_status[] = {
+ { 0x00, "Operational"},
+ { 0x01, "Suspended"},
+ { 0, NULL }
+};
+
+#define VTP_VLAN_SOURCE_ROUTING_RING_NUMBER 0x01
+#define VTP_VLAN_SOURCE_ROUTING_BRIDGE_NUMBER 0x02
+#define VTP_VLAN_STP_TYPE 0x03
+#define VTP_VLAN_PARENT_VLAN 0x04
+#define VTP_VLAN_TRANS_BRIDGED_VLAN 0x05
+#define VTP_VLAN_PRUNING 0x06
+#define VTP_VLAN_BRIDGE_TYPE 0x07
+#define VTP_VLAN_ARP_HOP_COUNT 0x08
+#define VTP_VLAN_STE_HOP_COUNT 0x09
+#define VTP_VLAN_BACKUP_CRF_MODE 0x0A
+
+static struct tok vtp_vlan_tlv_values[] = {
+ { VTP_VLAN_SOURCE_ROUTING_RING_NUMBER, "Source-Routing Ring Number TLV"},
+ { VTP_VLAN_SOURCE_ROUTING_BRIDGE_NUMBER, "Source-Routing Bridge Number TLV"},
+ { VTP_VLAN_STP_TYPE, "STP type TLV"},
+ { VTP_VLAN_PARENT_VLAN, "Parent VLAN TLV"},
+ { VTP_VLAN_TRANS_BRIDGED_VLAN, "Translationally bridged VLANs TLV"},
+ { VTP_VLAN_PRUNING, "Pruning TLV"},
+ { VTP_VLAN_BRIDGE_TYPE, "Bridge Type TLV"},
+ { VTP_VLAN_ARP_HOP_COUNT, "Max ARP Hop Count TLV"},
+ { VTP_VLAN_STE_HOP_COUNT, "Max STE Hop Count TLV"},
+ { VTP_VLAN_BACKUP_CRF_MODE, "Backup CRF Mode TLV"},
+ { 0, NULL }
+};
+
+static struct tok vtp_stp_type_values[] = {
+ { 1, "SRT"},
+ { 2, "SRB"},
+ { 3, "Auto"},
+ { 0, NULL }
+};
+
+void
+vtp_print (const u_char *pptr, u_int length)
+{
+ int type, len, tlv_len, tlv_value;
+ const u_char *tptr;
+ const struct vtp_vlan_ *vtp_vlan;
+
+ if (length < VTP_HEADER_LEN)
+ goto trunc;
+
+ tptr = pptr;
+
+ if (!TTEST2(*tptr, VTP_HEADER_LEN))
+ goto trunc;
+
+ type = *(tptr+1);
+ printf("VTPv%u, Message %s (0x%02x), length %u",
+ *tptr,
+ tok2str(vtp_message_type_values,"Unknown message type", type),
+ *(tptr+1),
+ length);
+
+ /* In non-verbose mode, just print version and message type */
+ if (vflag < 1) {
+ return;
+ }
+
+ /* verbose mode print all fields */
+ printf("\n\tDomain name: %s, %s: %u",
+ (tptr+4),
+ tok2str(vtp_header_values,"Unknown",*(tptr+1)),
+ *(tptr+2));
+
+ tptr += VTP_HEADER_LEN;
+
+ switch (type) {
+
+ case VTP_SUMMARY_ADV:
+
+ /*
+ * SUMMARY ADVERTISEMENT
+ *
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Version | Code | Followers | MmgtD Len |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Management Domain Name |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Configuration revision number |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Updater Identity IP address |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Update Timestamp (12 bytes) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | MD5 digest (16 bytes) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ */
+
+ printf("\n\t Config Rev %x, Updater %s",
+ EXTRACT_32BITS(tptr),
+ ipaddr_string(tptr+4));
+ tptr += 8;
+ printf(", Timestamp 0x%08x 0x%08x 0x%08x",
+ EXTRACT_32BITS(tptr),
+ EXTRACT_32BITS(tptr + 4),
+ EXTRACT_32BITS(tptr + 8));
+ tptr += VTP_UPDATE_TIMESTAMP_LEN;
+ printf(", MD5 digest: %08x%08x%08x%08x",
+ EXTRACT_32BITS(tptr),
+ EXTRACT_32BITS(tptr + 4),
+ EXTRACT_32BITS(tptr + 8),
+ EXTRACT_32BITS(tptr + 12));
+ tptr += VTP_MD5_DIGEST_LEN;
+ break;
+
+ case VTP_SUBSET_ADV:
+
+ /*
+ * SUBSET ADVERTISEMENT
+ *
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Version | Code | Seq number | MmgtD Len |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Management Domain Name |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Configuration revision number |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | VLAN info field 1 |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | ................ |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | VLAN info field N |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ */
+
+ printf(", Config Rev %x", EXTRACT_32BITS(tptr));
+
+ /*
+ * VLAN INFORMATION
+ * 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
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | V info len | Status | VLAN type | VLAN name len |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | ISL vlan id | MTU size |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | 802.10 index (SAID) |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | VLAN name |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ */
+
+ tptr += 4;
+ while (tptr < (pptr+length)) {
+
+ len = *tptr;
+ if (len == 0)
+ break;
+
+ if (!TTEST2(*tptr, len))
+ goto trunc;
+
+ vtp_vlan = (struct vtp_vlan_*)tptr;
+ printf("\n\tVLAN info status %s, type %s, VLAN-id %u, MTU %u, SAID 0x%08x, Name %s",
+ tok2str(vtp_vlan_status,"Unknown",vtp_vlan->status),
+ tok2str(vtp_vlan_type_values,"Unknown",vtp_vlan->type),
+ EXTRACT_16BITS(&vtp_vlan->vlanid),
+ EXTRACT_16BITS(&vtp_vlan->mtu),
+ EXTRACT_32BITS(&vtp_vlan->index),
+ (tptr + VTP_VLAN_INFO_OFFSET));
+
+ /*
+ * Vlan names are aligned to 32-bit boundaries.
+ */
+ len -= VTP_VLAN_INFO_OFFSET + 4*((vtp_vlan->name_len + 3)/4);
+ tptr += VTP_VLAN_INFO_OFFSET + 4*((vtp_vlan->name_len + 3)/4);
+
+ /* TLV information follows */
+
+ while (len > 0) {
+
+ /*
+ * Cisco specs says 2 bytes for type + 2 bytes for length, take only 1
+ * See: http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm
+ */
+ type = *tptr;
+ tlv_len = *(tptr+1);
+
+ printf("\n\t\t%s (0x%04x) TLV",
+ tok2str(vtp_vlan_tlv_values, "Unknown", type),
+ type);
+
+ /*
+ * infinite loop check
+ */
+ if (type == 0 || tlv_len == 0) {
+ return;
+ }
+
+ if (!TTEST2(*tptr, tlv_len*2 +2))
+ goto trunc;
+
+ tlv_value = EXTRACT_16BITS(tptr+2);
+
+ switch (type) {
+ case VTP_VLAN_STE_HOP_COUNT:
+ printf(", %u", tlv_value);
+ break;
+
+ case VTP_VLAN_PRUNING:
+ printf(", %s (%u)",
+ tlv_value == 1 ? "Enabled" : "Disabled",
+ tlv_value);
+ break;
+
+ case VTP_VLAN_STP_TYPE:
+ printf(", %s (%u)",
+ tok2str(vtp_stp_type_values, "Unknown", tlv_value),
+ tlv_value);
+ break;
+
+ case VTP_VLAN_BRIDGE_TYPE:
+ printf(", %s (%u)",
+ tlv_value == 1 ? "SRB" : "SRT",
+ tlv_value);
+ break;
+
+ case VTP_VLAN_BACKUP_CRF_MODE:
+ printf(", %s (%u)",
+ tlv_value == 1 ? "Backup" : "Not backup",
+ tlv_value);
+ break;
+
+ /*
+ * FIXME those are the defined TLVs that lack a decoder
+ * you are welcome to contribute code ;-)
+ */
+
+ case VTP_VLAN_SOURCE_ROUTING_RING_NUMBER:
+ case VTP_VLAN_SOURCE_ROUTING_BRIDGE_NUMBER:
+ case VTP_VLAN_PARENT_VLAN:
+ case VTP_VLAN_TRANS_BRIDGED_VLAN:
+ case VTP_VLAN_ARP_HOP_COUNT:
+ default:
+ print_unknown_data(tptr, "\n\t\t ", 2 + tlv_len*2);
+ break;
+ }
+ len -= 2 + tlv_len*2;
+ tptr += 2 + tlv_len*2;
+ }
+ }
+ break;
+
+ case VTP_ADV_REQUEST:
+
+ /*
+ * ADVERTISEMENT REQUEST
+ *
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Version | Code | Reserved | MmgtD Len |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Management Domain Name |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | Start value |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ */
+
+ printf("\n\tStart value: %u", EXTRACT_32BITS(tptr));
+ break;
+
+ case VTP_JOIN_MESSAGE:
+
+ /* FIXME - Could not find message format */
+ break;
+
+ default:
+ break;
+ }
+
+ return;
+
+ trunc:
+ printf("[|vtp]");
+}
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 4
+ * End:
+ */
Property changes on: trunk/contrib/tcpdump/print-vtp.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/contrib/tcpdump/print-vxlan.c
===================================================================
--- trunk/contrib/tcpdump/print-vxlan.c (rev 0)
+++ trunk/contrib/tcpdump/print-vxlan.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,74 @@
+/*
+ * 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 Francesco Fondelli (francesco dot fondelli, gmail dot com)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "interface.h"
+#include "extract.h"
+#include "addrtoname.h"
+
+#include "udp.h"
+
+/*
+ * VXLAN header, draft-mahalingam-dutt-dcops-vxlan-03
+ *
+ * 0 1 2 3
+ * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |R|R|R|R|I|R|R|R| Reserved |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | VXLAN Network Identifier (VNI) | Reserved |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ */
+
+void
+vxlan_print(const u_char *bp, u_int len)
+{
+ u_int8_t flags;
+ u_int32_t vni;
+
+ if (len < 8) {
+ printf("[|VXLAN]");
+ return;
+ }
+
+ flags = *bp;
+ bp += 4;
+
+ vni = EXTRACT_24BITS(bp);
+ bp += 4;
+
+ printf("VXLAN, ");
+
+ fputs("flags [", stdout);
+ if (flags & 0x08)
+ fputs("I", stdout);
+ else
+ fputs(".", stdout);
+ fputs("] ", stdout);
+
+ printf("(0x%02x), ", flags);
+ printf("vni %u\n", vni);
+
+ ether_print(gndo, bp, len - 8, len - 8, NULL, NULL);
+ return;
+}
Property changes on: trunk/contrib/tcpdump/print-vxlan.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/print-wb.c
===================================================================
--- trunk/contrib/tcpdump/print-wb.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-wb.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-wb.c,v 1.1.1.2 2006-02-25 02:34:03 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-wb.c,v 1.33 2004-03-24 04:06:28 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/print-zephyr.c
===================================================================
--- trunk/contrib/tcpdump/print-zephyr.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/print-zephyr.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -22,7 +22,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/print-zephyr.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-zephyr.c,v 1.10 2007-08-09 18:47:27 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -140,6 +140,15 @@
char *s;
int lose = 0;
+ /* squelch compiler warnings */
+
+ z.kind = 0;
+ z.class = 0;
+ z.inst = 0;
+ z.opcode = 0;
+ z.sender = 0;
+ z.recipient = 0;
+
#define PARSE_STRING \
s = parse_field(&parse, &parselen); \
if (!s) lose = 1;
Added: trunk/contrib/tcpdump/print-zeromq.c
===================================================================
--- trunk/contrib/tcpdump/print-zeromq.c (rev 0)
+++ trunk/contrib/tcpdump/print-zeromq.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,148 @@
+/*
+ * This file implements decoding of ZeroMQ network protocol(s).
+ *
+ *
+ * Copyright (c) 2013 The TCPDUMP project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <stdio.h>
+
+#include "interface.h"
+#include "extract.h"
+
+/* Maximum number of ZMTP/1.0 frame body bytes (without the flags) to dump in
+ * hex and ASCII under a single "-v" flag.
+ */
+#define VBYTES 128
+
+/*
+ * Below is an excerpt from the "13/ZMTP" specification:
+ *
+ * A ZMTP message consists of 1 or more frames.
+ *
+ * A ZMTP frame consists of a length, followed by a flags field and a frame
+ * body of (length - 1) octets. Note: the length includes the flags field, so
+ * an empty frame has a length of 1.
+ *
+ * For frames with a length of 1 to 254 octets, the length SHOULD BE encoded
+ * as a single octet. The minimum valid length of a frame is 1 octet, thus a
+ * length of 0 is invalid and such frames SHOULD be discarded silently.
+ *
+ * For frames with lengths of 255 and greater, the length SHALL BE encoded as
+ * a single octet with the value 255, followed by the length encoded as a
+ * 64-bit unsigned integer in network byte order. For frames with lengths of
+ * 1 to 254 octets this encoding MAY be also used.
+ *
+ * The flags field consists of a single octet containing various control
+ * flags. Bit 0 is the least significant bit.
+ *
+ * - Bit 0 (MORE): More frames to follow. A value of 0 indicates that there
+ * are no more frames to follow. A value of 1 indicates that more frames
+ * will follow. On messages consisting of a single frame the MORE flag MUST
+ * be 0.
+ *
+ * - Bits 1-7: Reserved. Bits 1-7 are reserved for future use and SHOULD be
+ * zero.
+ */
+
+static const u_char *
+zmtp1_print_frame(const u_char *cp, const u_char *ep) {
+ u_int64_t body_len_declared, body_len_captured, header_len;
+ u_int8_t flags;
+
+ printf("\n\t");
+ TCHECK2(*cp, 1); /* length/0xFF */
+
+ if (cp[0] != 0xFF) {
+ header_len = 1; /* length */
+ body_len_declared = cp[0];
+ if (body_len_declared == 0)
+ return cp + header_len; /* skip to next frame */
+ printf(" frame flags+body (8-bit) length %"PRIu8"", cp[0]);
+ TCHECK2(*cp, header_len + 1); /* length, flags */
+ flags = cp[1];
+ } else {
+ header_len = 1 + 8; /* 0xFF, length */
+ printf(" frame flags+body (64-bit) length");
+ TCHECK2(*cp, header_len); /* 0xFF, length */
+ body_len_declared = EXTRACT_64BITS(cp + 1);
+ if (body_len_declared == 0)
+ return cp + header_len; /* skip to next frame */
+ printf(" %"PRIu64"", body_len_declared);
+ TCHECK2(*cp, header_len + 1); /* 0xFF, length, flags */
+ flags = cp[9];
+ }
+
+ body_len_captured = ep - cp - header_len;
+ if (body_len_declared > body_len_captured)
+ printf(" (%"PRIu64" captured)", body_len_captured);
+ printf(", flags 0x%02"PRIx8"", flags);
+
+ if (vflag) {
+ u_int64_t body_len_printed = MIN(body_len_captured, body_len_declared);
+
+ printf(" (%s|%s|%s|%s|%s|%s|%s|%s)",
+ flags & 0x80 ? "MBZ" : "-",
+ flags & 0x40 ? "MBZ" : "-",
+ flags & 0x20 ? "MBZ" : "-",
+ flags & 0x10 ? "MBZ" : "-",
+ flags & 0x08 ? "MBZ" : "-",
+ flags & 0x04 ? "MBZ" : "-",
+ flags & 0x02 ? "MBZ" : "-",
+ flags & 0x01 ? "MORE" : "-");
+
+ if (vflag == 1)
+ body_len_printed = MIN(VBYTES + 1, body_len_printed);
+ if (body_len_printed > 1) {
+ printf(", first %"PRIu64" byte(s) of body:", body_len_printed - 1);
+ hex_and_ascii_print("\n\t ", cp + header_len + 1, body_len_printed - 1);
+ printf("\n");
+ }
+ }
+
+ TCHECK2(*cp, header_len + body_len_declared); /* Next frame within the buffer ? */
+ return cp + header_len + body_len_declared;
+
+trunc:
+ printf(" [|zmtp1]");
+ return ep;
+}
+
+void
+zmtp1_print(const u_char *cp, u_int len) {
+ const u_char *ep = MIN(snapend, cp + len);
+
+ printf(": ZMTP/1.0");
+ while (cp < ep)
+ cp = zmtp1_print_frame(cp, ep);
+}
+
Property changes on: trunk/contrib/tcpdump/print-zeromq.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/route6d.h
===================================================================
--- trunk/contrib/tcpdump/route6d.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/route6d.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
/*
- * $Header: /home/cvs/src/contrib/tcpdump/route6d.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $
+ * $Header: /tcpdump/master/tcpdump/route6d.h,v 1.5 2002-12-11 07:14:10 guy Exp $
*/
#define RIP6_VERSION 1
Modified: trunk/contrib/tcpdump/rpc_auth.h
===================================================================
--- trunk/contrib/tcpdump/rpc_auth.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/rpc_auth.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/rpc_auth.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/rpc_auth.h,v 1.2 2005-04-27 21:43:48 guy Exp $ (LBL) */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
@@ -29,7 +29,8 @@
*
* from: @(#)auth.h 1.17 88/02/08 SMI
* from: @(#)auth.h 2.3 88/08/07 4.0 RPCSRC
- * $FreeBSD: src/contrib/tcpdump/rpc_auth.h,v 1.1.1.2 2005/07/11 03:54:15 sam Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/rpc_auth.h 190207 2009-03-21 18:30:25Z rpaulo $
+ * FreeBSD: src/include/rpc/auth.h,v 1.14.2.1 1999/08/29 14:39:02 peter Exp
*/
/*
Modified: trunk/contrib/tcpdump/rpc_msg.h
===================================================================
--- trunk/contrib/tcpdump/rpc_msg.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/rpc_msg.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/rpc_msg.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/rpc_msg.h,v 1.2 2005-04-27 21:43:48 guy Exp $ (LBL) */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
@@ -29,7 +29,8 @@
*
* from: @(#)rpc_msg.h 1.7 86/07/16 SMI
* from: @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC
- * $FreeBSD: src/contrib/tcpdump/rpc_msg.h,v 1.1.1.2 2005/07/11 03:54:15 sam Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/rpc_msg.h 190207 2009-03-21 18:30:25Z rpaulo $
+ * FreeBSD: src/include/rpc/rpc_msg.h,v 1.11.2.1 1999/08/29 14:39:07 peter Exp
*/
/*
Modified: trunk/contrib/tcpdump/rx.h
===================================================================
--- trunk/contrib/tcpdump/rx.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/rx.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -23,7 +23,7 @@
/*
* Rx protocol format
*
- * $Id: rx.h,v 1.1.1.2 2006-02-25 02:34:02 laffer1 Exp $
+ * $Id: rx.h,v 1.8 2002-12-11 07:14:11 guy Exp $
*/
#define FS_RX_PORT 7000
Modified: trunk/contrib/tcpdump/sctpConstants.h
===================================================================
--- trunk/contrib/tcpdump/sctpConstants.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/sctpConstants.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/sctpConstants.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/sctpConstants.h,v 1.4 2003-06-03 23:49:23 guy Exp $ (LBL) */
/* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola
*
Modified: trunk/contrib/tcpdump/sctpHeader.h
===================================================================
--- trunk/contrib/tcpdump/sctpHeader.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/sctpHeader.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/sctpHeader.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/sctpHeader.h,v 1.6 2002-12-11 07:14:11 guy Exp $ (LBL) */
/* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola
*
Modified: trunk/contrib/tcpdump/setsignal.c
===================================================================
--- trunk/contrib/tcpdump/setsignal.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/setsignal.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/setsignal.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/setsignal.c,v 1.11 2003-11-16 09:36:42 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
Modified: trunk/contrib/tcpdump/setsignal.h
===================================================================
--- trunk/contrib/tcpdump/setsignal.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/setsignal.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -18,7 +18,7 @@
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/setsignal.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/setsignal.h,v 1.2 1999-10-07 23:47:13 mcr Exp $ (LBL)
*/
#ifndef setsignal_h
#define setsignal_h
Added: trunk/contrib/tcpdump/signature.c
===================================================================
--- trunk/contrib/tcpdump/signature.c (rev 0)
+++ trunk/contrib/tcpdump/signature.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,159 @@
+/*
+ * 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.
+ *
+ * Functions for signature and digest verification.
+ *
+ * Original code by Hannes Gredler (hannes at juniper.net)
+ */
+
+#ifndef lint
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/signature.c,v 1.2 2008-09-22 20:22:10 guy Exp $ (LBL)";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <tcpdump-stdinc.h>
+
+#include <string.h>
+
+#include "interface.h"
+#include "signature.h"
+
+#ifdef HAVE_LIBCRYPTO
+#include <openssl/md5.h>
+#endif
+
+const struct tok signature_check_values[] = {
+ { SIGNATURE_VALID, "valid"},
+ { SIGNATURE_INVALID, "invalid"},
+ { CANT_CHECK_SIGNATURE, "unchecked"},
+ { 0, NULL }
+};
+
+
+#ifdef HAVE_LIBCRYPTO
+/*
+ * Compute a HMAC MD5 sum.
+ * Taken from rfc2104, Appendix.
+ */
+static void
+signature_compute_hmac_md5(const u_int8_t *text, int text_len, unsigned char *key,
+ unsigned int key_len, u_int8_t *digest)
+{
+ MD5_CTX context;
+ unsigned char k_ipad[65]; /* inner padding - key XORd with ipad */
+ unsigned char k_opad[65]; /* outer padding - key XORd with opad */
+ unsigned char tk[16];
+ int i;
+
+ /* if key is longer than 64 bytes reset it to key=MD5(key) */
+ if (key_len > 64) {
+
+ MD5_CTX tctx;
+
+ MD5_Init(&tctx);
+ MD5_Update(&tctx, key, key_len);
+ MD5_Final(tk, &tctx);
+
+ key = tk;
+ key_len = 16;
+ }
+
+ /*
+ * the HMAC_MD5 transform looks like:
+ *
+ * MD5(K XOR opad, MD5(K XOR ipad, text))
+ *
+ * where K is an n byte key
+ * ipad is the byte 0x36 repeated 64 times
+ * opad is the byte 0x5c repeated 64 times
+ * and text is the data being protected
+ */
+
+ /* start out by storing key in pads */
+ memset(k_ipad, 0, sizeof k_ipad);
+ memset(k_opad, 0, sizeof k_opad);
+ memcpy(k_ipad, key, key_len);
+ memcpy(k_opad, key, key_len);
+
+ /* XOR key with ipad and opad values */
+ for (i=0; i<64; i++) {
+ k_ipad[i] ^= 0x36;
+ k_opad[i] ^= 0x5c;
+ }
+
+ /*
+ * perform inner MD5
+ */
+ MD5_Init(&context); /* init context for 1st pass */
+ MD5_Update(&context, k_ipad, 64); /* start with inner pad */
+ MD5_Update(&context, text, text_len); /* then text of datagram */
+ MD5_Final(digest, &context); /* finish up 1st pass */
+
+ /*
+ * perform outer MD5
+ */
+ MD5_Init(&context); /* init context for 2nd pass */
+ MD5_Update(&context, k_opad, 64); /* start with outer pad */
+ MD5_Update(&context, digest, 16); /* then results of 1st hash */
+ MD5_Final(digest, &context); /* finish up 2nd pass */
+}
+#endif
+
+#ifdef HAVE_LIBCRYPTO
+/*
+ * Verify a cryptographic signature of the packet.
+ * Currently only MD5 is supported.
+ */
+int
+signature_verify (const u_char *pptr, u_int plen, u_char *sig_ptr)
+{
+ u_int8_t rcvsig[16];
+ u_int8_t sig[16];
+ unsigned int i;
+
+ /*
+ * Save the signature before clearing it.
+ */
+ memcpy(rcvsig, sig_ptr, sizeof(rcvsig));
+ memset(sig_ptr, 0, sizeof(rcvsig));
+
+ if (!sigsecret) {
+ return (CANT_CHECK_SIGNATURE);
+ }
+
+ signature_compute_hmac_md5(pptr, plen, (unsigned char *)sigsecret,
+ strlen(sigsecret), sig);
+
+ if (memcmp(rcvsig, sig, sizeof(sig)) == 0) {
+ return (SIGNATURE_VALID);
+
+ } else {
+
+ for (i = 0; i < sizeof(sig); ++i) {
+ (void)printf("%02x", sig[i]);
+ }
+
+ return (SIGNATURE_INVALID);
+ }
+}
+#endif
+
+/*
+ * Local Variables:
+ * c-style: whitesmith
+ * c-basic-offset: 4
+ * End:
+ */
Property changes on: trunk/contrib/tcpdump/signature.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/contrib/tcpdump/signature.h
===================================================================
--- trunk/contrib/tcpdump/signature.h (rev 0)
+++ trunk/contrib/tcpdump/signature.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ *
+ * Functions for signature and digest verification.
+ *
+ * Original code by Hannes Gredler (hannes at juniper.net)
+ */
+
+/* @(#) $Header: /tcpdump/master/tcpdump/signature.h,v 1.1 2008-08-16 11:36:20 hannes Exp $ (LBL) */
+
+/* signature checking result codes */
+#define SIGNATURE_VALID 0
+#define SIGNATURE_INVALID 1
+#define CANT_CHECK_SIGNATURE 2
+
+extern const struct tok signature_check_values[];
+extern int signature_verify (const u_char *, u_int, u_char *);
Property changes on: trunk/contrib/tcpdump/signature.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/slcompress.h
===================================================================
--- trunk/contrib/tcpdump/slcompress.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/slcompress.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,7 +1,7 @@
/*
* Definitions for tcp compression routines.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/slcompress.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/slcompress.h,v 1.2 2000-10-09 02:03:44 guy Exp $ (LBL)
*
* Copyright (c) 1989, 1990, 1992, 1993 Regents of the University of
* California. All rights reserved.
Modified: trunk/contrib/tcpdump/slip.h
===================================================================
--- trunk/contrib/tcpdump/slip.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/slip.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -2,7 +2,7 @@
* Definitions that user level programs might need to know to interact
* with serial line IP (slip) lines.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/slip.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $
+ * @(#) $Header: /tcpdump/master/tcpdump/slip.h,v 1.1 2000-10-09 01:53:21 guy Exp $
*
* Copyright (c) 1990 Regents of the University of California.
* All rights reserved.
Modified: trunk/contrib/tcpdump/sll.h
===================================================================
--- trunk/contrib/tcpdump/sll.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/sll.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/sll.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/sll.h,v 1.8 2008-05-30 01:37:41 guy Exp $ (LBL)
*/
/*
@@ -64,8 +64,8 @@
* DO NOT change the layout of this structure, or change any of the
* LINUX_SLL_ values below. If you must change the link-layer header
* for a "cooked" Linux capture, introduce a new DLT_ type (ask
- * "tcpdump-workers at tcpdump.org" for one, so that you don't give it a
- * value that collides with a value already being used), and use the
+ * "tcpdump-workers at lists.tcpdump.org" for one, so that you don't give it
+ * a value that collides with a value already being used), and use the
* new header in captures of that type, so that programs that can
* handle DLT_LINUX_SLL captures will continue to handle them correctly
* without any change, and so that capture files with different headers
Modified: trunk/contrib/tcpdump/smb.h
===================================================================
--- trunk/contrib/tcpdump/smb.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/smb.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/smb.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/smb.h,v 1.9 2004-12-28 22:29:44 guy Exp $ (LBL) */
/*
* Copyright (C) Andrew Tridgell 1995-1999
*
Modified: trunk/contrib/tcpdump/smbutil.c
===================================================================
--- trunk/contrib/tcpdump/smbutil.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/smbutil.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -12,7 +12,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/smbutil.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/smbutil.c,v 1.39 2007-07-15 19:07:39 guy Exp $";
#endif
#include <tcpdump-stdinc.h>
@@ -900,7 +900,7 @@
};
/* Server Error Messages */
-err_code_struct server_msgs[] = {
+static const err_code_struct server_msgs[] = {
{ "ERRerror", 1, "Non-specific error code." },
{ "ERRbadpw", 2, "Bad password - name/password pair in a Tree Connect or Session Setup are invalid." },
{ "ERRbadtype", 3, "reserved." },
@@ -937,7 +937,7 @@
};
/* Hard Error Messages */
-err_code_struct hard_msgs[] = {
+static const err_code_struct hard_msgs[] = {
{ "ERRnowrite", 19, "Attempt to write on write-protected diskette." },
{ "ERRbadunit", 20, "Unknown unit." },
{ "ERRnotready", 21, "Drive not ready." },
Modified: trunk/contrib/tcpdump/strcasecmp.c
===================================================================
--- trunk/contrib/tcpdump/strcasecmp.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/strcasecmp.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -16,7 +16,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/strcasecmp.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/strcasecmp.c,v 1.6 2003-11-16 09:36:43 guy Exp $";
#endif
#include <tcpdump-stdinc.h>
@@ -28,7 +28,7 @@
* together for a case independent comparison. The mappings are
* based upon ascii character sequences.
*/
-static u_char charmap[] = {
+static const u_char charmap[] = {
'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
'\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
'\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
@@ -67,7 +67,7 @@
strcasecmp(s1, s2)
const char *s1, *s2;
{
- register u_char *cm = charmap,
+ register const u_char *cm = charmap,
*us1 = (u_char *)s1,
*us2 = (u_char *)s2;
@@ -82,7 +82,7 @@
const char *s1, *s2;
register int n;
{
- register u_char *cm = charmap,
+ register const u_char *cm = charmap,
*us1 = (u_char *)s1,
*us2 = (u_char *)s2;
Modified: trunk/contrib/tcpdump/tcp.h
===================================================================
--- trunk/contrib/tcpdump/tcp.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/tcp.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/tcp.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/tcp.h,v 1.14 2007-12-09 00:30:47 guy Exp $ (LBL) */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
@@ -45,21 +45,25 @@
tcp_seq th_seq; /* sequence number */
tcp_seq th_ack; /* acknowledgement number */
u_int8_t th_offx2; /* data offset, rsvd */
-#define TH_OFF(th) (((th)->th_offx2 & 0xf0) >> 4)
u_int8_t th_flags;
-#define TH_FIN 0x01
-#define TH_SYN 0x02
-#define TH_RST 0x04
-#define TH_PUSH 0x08
-#define TH_ACK 0x10
-#define TH_URG 0x20
-#define TH_ECNECHO 0x40 /* ECN Echo */
-#define TH_CWR 0x80 /* ECN Cwnd Reduced */
u_int16_t th_win; /* window */
u_int16_t th_sum; /* checksum */
u_int16_t th_urp; /* urgent pointer */
};
+#define TH_OFF(th) (((th)->th_offx2 & 0xf0) >> 4)
+
+/* TCP flags */
+#define TH_FIN 0x01
+#define TH_SYN 0x02
+#define TH_RST 0x04
+#define TH_PUSH 0x08
+#define TH_ACK 0x10
+#define TH_URG 0x20
+#define TH_ECNECHO 0x40 /* ECN Echo */
+#define TH_CWR 0x80 /* ECN Cwnd Reduced */
+
+
#define TCPOPT_EOL 0
#define TCPOPT_NOP 1
#define TCPOPT_MAXSEG 2
@@ -79,6 +83,30 @@
#define TCPOLEN_SIGNATURE 18
#define TCP_SIGLEN 16 /* length of an option 19 digest */
#define TCPOPT_AUTH 20 /* Enhanced AUTH option */
+#define TCPOPT_UTO 28 /* tcp user timeout (rfc5482) */
+#define TCPOLEN_UTO 4
+
#define TCPOPT_TSTAMP_HDR \
(TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
+
+#ifndef TELNET_PORT
+#define TELNET_PORT 23
+#endif
+#ifndef BGP_PORT
+#define BGP_PORT 179
+#endif
+#define NETBIOS_SSN_PORT 139
+#ifndef PPTP_PORT
+#define PPTP_PORT 1723
+#endif
+#define BEEP_PORT 10288
+#ifndef NFS_PORT
+#define NFS_PORT 2049
+#endif
+#define MSDP_PORT 639
+#define RPKI_RTR_PORT 323
+#define LDP_PORT 646
+#ifndef SMB_PORT
+#define SMB_PORT 445
+#endif
Modified: trunk/contrib/tcpdump/tcpdump-stdinc.h
===================================================================
--- trunk/contrib/tcpdump/tcpdump-stdinc.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/tcpdump-stdinc.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -29,8 +29,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
- * $FreeBSD: src/contrib/tcpdump/tcpdump-stdinc.h,v 1.4.2.1 2007/10/19 03:04:00 mlaier Exp $
- * @(#) $Header: /home/cvs/src/contrib/tcpdump/tcpdump-stdinc.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/tcpdump-stdinc.h,v 1.18 2007-11-24 18:13:33 mcr Exp $ (LBL)
*/
/*
@@ -56,6 +55,10 @@
#include <sys/types.h>
#include <net/netdb.h> /* in wpcap's Win32/include */
+#ifndef NBBY
+#define NBBY 8
+#endif
+
#if !defined(__MINGW32__) && !defined(__WATCOMC__)
#undef toascii
#define isascii __isascii
@@ -128,10 +131,43 @@
#endif /* WIN32 */
-#ifdef INET6
-#include "ip6.h"
+#ifndef HAVE___ATTRIBUTE__
+#define __attribute__(x)
#endif
+/*
+ * Used to declare a structure unaligned, so that the C compiler,
+ * if necessary, generates code that doesn't assume alignment.
+ * This is required because there is no guarantee that the packet
+ * data we get from libpcap/WinPcap is properly aligned.
+ *
+ * This assumes that, for all compilers that support __attribute__:
+ *
+ * 1) they support __attribute__((packed));
+ *
+ * 2) for all instruction set architectures requiring strict
+ * alignment, declaring a structure with that attribute
+ * causes the compiler to generate code that handles
+ * misaligned 2-byte, 4-byte, and 8-byte integral
+ * quantities.
+ *
+ * It does not (yet) handle compilers where you can get the compiler
+ * to generate code of that sort by some other means.
+ *
+ * This is required in order to, for example, keep the compiler from
+ * generating, for
+ *
+ * if (bp->bp_htype == 1 && bp->bp_hlen == 6 && bp->bp_op == BOOTPREQUEST) {
+ *
+ * in print-bootp.c, code that loads the first 4-byte word of a
+ * "struct bootp", masking out the bp_hops field, and comparing the result
+ * against 0x01010600.
+ *
+ * Note: this also requires that padding be put into the structure,
+ * at least for compilers where it's implemented as __attribute__((packed)).
+ */
+#define UNALIGNED __attribute__((packed))
+
#if defined(WIN32) || defined(MSDOS)
#define FOPEN_READ_TXT "rt"
#define FOPEN_READ_BIN "rb"
@@ -144,6 +180,37 @@
#define FOPEN_WRITE_BIN FOPEN_WRITE_TXT
#endif
+#if defined(__GNUC__) && defined(__i386__) && !defined(__APPLE__) && !defined(__ntohl)
+ #undef ntohl
+ #undef ntohs
+ #undef htonl
+ #undef htons
+
+ static __inline__ unsigned long __ntohl (unsigned long x);
+ static __inline__ unsigned short __ntohs (unsigned short x);
+
+ #define ntohl(x) __ntohl(x)
+ #define ntohs(x) __ntohs(x)
+ #define htonl(x) __ntohl(x)
+ #define htons(x) __ntohs(x)
+
+ static __inline__ unsigned long __ntohl (unsigned long x)
+ {
+ __asm__ ("xchgb %b0, %h0\n\t" /* swap lower bytes */
+ "rorl $16, %0\n\t" /* swap words */
+ "xchgb %b0, %h0" /* swap higher bytes */
+ : "=q" (x) : "0" (x));
+ return (x);
+ }
+
+ static __inline__ unsigned short __ntohs (unsigned short x)
+ {
+ __asm__ ("xchgb %b0, %h0" /* swap bytes */
+ : "=q" (x) : "0" (x));
+ return (x);
+ }
+#endif
+
#ifndef INET_ADDRSTRLEN
#define INET_ADDRSTRLEN 16
#endif
Deleted: trunk/contrib/tcpdump/tcpdump.1
===================================================================
--- trunk/contrib/tcpdump/tcpdump.1 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/tcpdump.1 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,2382 +0,0 @@
-.\" @(#) $Header: /home/cvs/src/contrib/tcpdump/tcpdump.1,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)
-.\"
-.\" $NetBSD: tcpdump.8,v 1.9 2003/03/31 00:18:17 perry Exp $
-.\"
-.\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
-.\" The Regents of the University of California. All rights reserved.
-.\" 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.
-.\"
-.\" $FreeBSD: src/contrib/tcpdump/tcpdump.1,v 1.17.2.1 2007/10/19 03:04:00 mlaier Exp $
-.\"
-.TH TCPDUMP 1 "18 April 2005"
-.SH NAME
-tcpdump \- dump traffic on a network
-.SH SYNOPSIS
-.na
-.B tcpdump
-[
-.B \-AdDeflLnNOpqRStuUvxX
-] [
-.B \-c
-.I count
-]
-.br
-.ti +8
-[
-.B \-C
-.I file_size
-] [
-.B \-F
-.I file
-]
-.br
-.ti +8
-[
-.B \-i
-.I interface
-]
-[
-.B \-m
-.I module
-]
-[
-.B \-M
-.I secret
-]
-.br
-.ti +8
-[
-.B \-r
-.I file
-]
-[
-.B \-s
-.I snaplen
-]
-[
-.B \-T
-.I type
-]
-[
-.B \-w
-.I file
-]
-.br
-.ti +8
-[
-.B \-W
-.I filecount
-]
-.br
-.ti +8
-[
-.B \-E
-.I spi at ipaddr algo:secret,...
-]
-.br
-.ti +8
-[
-.B \-y
-.I datalinktype
-]
-[
-.B \-Z
-.I user
-]
-.ti +8
-[
-.B \-y
-.I datalinktype
-]
-.ti +8
-[
-.I expression
-]
-.br
-.ad
-.SH DESCRIPTION
-.LP
-\fITcpdump\fP prints out a description of the contents of packets on a
-network interface that match the boolean \fIexpression\fP. It can also
-be run with the
-.B \-w
-flag, which causes it to save the packet data to a file for later
-analysis, and/or with the
-.B \-r
-flag, which causes it to read from a saved packet file rather than to
-read packets from a network interface. In all cases, only packets that
-match
-.I expression
-will be processed by
-.IR tcpdump .
-.LP
-.I Tcpdump
-will, if not run with the
-.B \-c
-flag, continue capturing packets until it is interrupted by a SIGINT
-signal (generated, for example, by typing your interrupt character,
-typically control-C) or a SIGTERM signal (typically generated with the
-.BR kill (1)
-command); if run with the
-.B \-c
-flag, it will capture packets until it is interrupted by a SIGINT or
-SIGTERM signal or the specified number of packets have been processed.
-.LP
-When
-.I tcpdump
-finishes capturing packets, it will report counts of:
-.IP
-packets ``captured'' (this is the number of packets that
-.I tcpdump
-has received and processed);
-.IP
-packets ``received by filter'' (the meaning of this depends on the OS on
-which you're running
-.IR tcpdump ,
-and possibly on the way the OS was configured - if a filter was
-specified on the command line, on some OSes it counts packets regardless
-of whether they were matched by the filter expression and, even if they
-were matched by the filter expression, regardless of whether
-.I tcpdump
-has read and processed them yet, on other OSes it counts only packets that were
-matched by the filter expression regardless of whether
-.I tcpdump
-has read and processed them yet, and on other OSes it counts only
-packets that were matched by the filter expression and were processed by
-.IR tcpdump );
-.IP
-packets ``dropped by kernel'' (this is the number of packets that were
-dropped, due to a lack of buffer space, by the packet capture mechanism
-in the OS on which
-.I tcpdump
-is running, if the OS reports that information to applications; if not,
-it will be reported as 0).
-.LP
-On platforms that support the SIGINFO signal, such as most BSDs
-(including Mac OS X) and Digital/Tru64 UNIX, it will report those counts
-when it receives a SIGINFO signal (generated, for example, by typing
-your ``status'' character, typically control-T, although on some
-platforms, such as Mac OS X, the ``status'' character is not set by
-default, so you must set it with
-.BR stty (1)
-in order to use it) and will continue capturing packets.
-.LP
-Reading packets from a network interface may require that you have
-special privileges:
-.TP
-.B Under SunOS 3.x or 4.x with NIT or BPF:
-You must have read access to
-.I /dev/nit
-or
-.IR /dev/bpf* .
-.TP
-.B Under Solaris with DLPI:
-You must have read/write access to the network pseudo device, e.g.
-.IR /dev/le .
-On at least some versions of Solaris, however, this is not sufficient to
-allow
-.I tcpdump
-to capture in promiscuous mode; on those versions of Solaris, you must
-be root, or
-.I tcpdump
-must be installed setuid to root, in order to capture in promiscuous
-mode. Note that, on many (perhaps all) interfaces, if you don't capture
-in promiscuous mode, you will not see any outgoing packets, so a capture
-not done in promiscuous mode may not be very useful.
-.TP
-.B Under HP-UX with DLPI:
-You must be root or
-.I tcpdump
-must be installed setuid to root.
-.TP
-.B Under IRIX with snoop:
-You must be root or
-.I tcpdump
-must be installed setuid to root.
-.TP
-.B Under Linux:
-You must be root or
-.I tcpdump
-must be installed setuid to root (unless your distribution has a kernel
-that supports capability bits such as CAP_NET_RAW and code to allow
-those capability bits to be given to particular accounts and to cause
-those bits to be set on a user's initial processes when they log in, in
-which case you must have CAP_NET_RAW in order to capture and
-CAP_NET_ADMIN to enumerate network devices with, for example, the
-.B \-D
-flag).
-.TP
-.B Under ULTRIX and Digital UNIX/Tru64 UNIX:
-Any user may capture network traffic with
-.IR tcpdump .
-However, no user (not even the super-user) can capture in promiscuous
-mode on an interface unless the super-user has enabled promiscuous-mode
-operation on that interface using
-.IR pfconfig (8),
-and no user (not even the super-user) can capture unicast traffic
-received by or sent by the machine on an interface unless the super-user
-has enabled copy-all-mode operation on that interface using
-.IR pfconfig ,
-so
-.I useful
-packet capture on an interface probably requires that either
-promiscuous-mode or copy-all-mode operation, or both modes of
-operation, be enabled on that interface.
-.TP
-.B Under BSD (this includes Mac OS X):
-You must have read access to
-.I /dev/bpf*
-on systems that don't have a cloning BPF device, or to
-.I /dev/bpf
-on systems that do.
-On BSDs with a devfs (this includes Mac OS X), this might involve more
-than just having somebody with super-user access setting the ownership
-or permissions on the BPF devices - it might involve configuring devfs
-to set the ownership or permissions every time the system is booted,
-if the system even supports that; if it doesn't support that, you might
-have to find some other way to make that happen at boot time.
-.LP
-Reading a saved packet file doesn't require special privileges.
-.SH OPTIONS
-.TP
-.B \-A
-Print each packet (minus its link level header) in ASCII. Handy for
-capturing web pages.
-.TP
-.B \-c
-Exit after receiving \fIcount\fP packets.
-.TP
-.B \-C
-Before writing a raw packet to a savefile, check whether the file is
-currently larger than \fIfile_size\fP and, if so, close the current
-savefile and open a new one. Savefiles after the first savefile will
-have the name specified with the
-.B \-w
-flag, with a number after it, starting at 1 and continuing upward.
-The units of \fIfile_size\fP are millions of bytes (1,000,000 bytes,
-not 1,048,576 bytes).
-.TP
-.B \-d
-Dump the compiled packet-matching code in a human readable form to
-standard output and stop.
-.TP
-.B \-dd
-Dump packet-matching code as a
-.B C
-program fragment.
-.TP
-.B \-ddd
-Dump packet-matching code as decimal numbers (preceded with a count).
-.TP
-.B \-D
-Print the list of the network interfaces available on the system and on
-which
-.I tcpdump
-can capture packets. For each network interface, a number and an
-interface name, possibly followed by a text description of the
-interface, is printed. The interface name or the number can be supplied
-to the
-.B \-i
-flag to specify an interface on which to capture.
-.IP
-This can be useful on systems that don't have a command to list them
-(e.g., Windows systems, or UNIX systems lacking
-.BR "ifconfig \-a" );
-the number can be useful on Windows 2000 and later systems, where the
-interface name is a somewhat complex string.
-.IP
-The
-.B \-D
-flag will not be supported if
-.I tcpdump
-was built with an older version of
-.I libpcap
-that lacks the
-.B pcap_findalldevs()
-function.
-.TP
-.B \-e
-Print the link-level header on each dump line.
-.TP
-.B \-E
-Use \fIspi at ipaddr algo:secret\fP for decrypting IPsec ESP packets that
-are addressed to \fIaddr\fP and contain Security Parameter Index value
-\fIspi\fP. This combination may be repeated with comma or newline seperation.
-.IP
-Note that setting the secret for IPv4 ESP packets is supported at this time.
-.IP
-Algorithms may be
-\fBdes-cbc\fP,
-\fB3des-cbc\fP,
-\fBblowfish-cbc\fP,
-\fBrc3-cbc\fP,
-\fBcast128-cbc\fP, or
-\fBnone\fP.
-The default is \fBdes-cbc\fP.
-The ability to decrypt packets is only present if \fItcpdump\fP was compiled
-with cryptography enabled.
-.IP
-\fIsecret\fP is the ASCII text for ESP secret key.
-If preceeded by 0x, then a hex value will be read.
-.IP
-The option assumes RFC2406 ESP, not RFC1827 ESP.
-The option is only for debugging purposes, and
-the use of this option with a true `secret' key is discouraged.
-By presenting IPsec secret key onto command line
-you make it visible to others, via
-.IR ps (1)
-and other occasions.
-.IP
-In addition to the above syntax, the syntax \fIfile name\fP may be used
-to have tcpdump read the provided file in. The file is opened upon
-receiving the first ESP packet, so any special permissions that tcpdump
-may have been given should already have been given up.
-.TP
-.B \-f
-Print `foreign' IPv4 addresses numerically rather than symbolically
-(this option is intended to get around serious brain damage in
-Sun's NIS server \(em usually it hangs forever translating non-local
-internet numbers).
-.IP
-The test for `foreign' IPv4 addresses is done using the IPv4 address and
-netmask of the interface on which capture is being done. If that
-address or netmask are not available, available, either because the
-interface on which capture is being done has no address or netmask or
-because the capture is being done on the Linux "any" interface, which
-can capture on more than one interface, this option will not work
-correctly.
-.TP
-.B \-F
-Use \fIfile\fP as input for the filter expression.
-An additional expression given on the command line is ignored.
-.TP
-.B \-i
-Listen on \fIinterface\fP.
-If unspecified, \fItcpdump\fP searches the system interface list for the
-lowest numbered, configured up interface (excluding loopback).
-Ties are broken by choosing the earliest match.
-.IP
-On Linux systems with 2.2 or later kernels, an
-.I interface
-argument of ``any'' can be used to capture packets from all interfaces.
-Note that captures on the ``any'' device will not be done in promiscuous
-mode.
-.IP
-If the
-.B \-D
-flag is supported, an interface number as printed by that flag can be
-used as the
-.I interface
-argument.
-.TP
-.B \-l
-Make stdout line buffered.
-Useful if you want to see the data
-while capturing it.
-E.g.,
-.br
-``tcpdump\ \ \-l\ \ |\ \ tee dat'' or
-``tcpdump\ \ \-l \ \ > dat\ \ &\ \ tail\ \ \-f\ \ dat''.
-.TP
-.B \-L
-List the known data link types for the interface and exit.
-.TP
-.B \-m
-Load SMI MIB module definitions from file \fImodule\fR.
-This option
-can be used several times to load several MIB modules into \fItcpdump\fP.
-.TP
-.B \-M
-Use \fIsecret\fP as a shared secret for validating the digests found in
-TCP segments with the TCP-MD5 option (RFC 2385), if present.
-.TP
-.B \-n
-Don't convert addresses (i.e., host addresses, port numbers, etc.) to names.
-.TP
-.B \-N
-Don't print domain name qualification of host names.
-E.g.,
-if you give this flag then \fItcpdump\fP will print ``nic''
-instead of ``nic.ddn.mil''.
-.TP
-.B \-O
-Do not run the packet-matching code optimizer.
-This is useful only
-if you suspect a bug in the optimizer.
-.TP
-.B \-p
-\fIDon't\fP put the interface
-into promiscuous mode.
-Note that the interface might be in promiscuous
-mode for some other reason; hence, `-p' cannot be used as an abbreviation for
-`ether host {local-hw-addr} or ether broadcast'.
-.TP
-.B \-q
-Quick (quiet?) output.
-Print less protocol information so output
-lines are shorter.
-.TP
-.B \-R
-Assume ESP/AH packets to be based on old specification (RFC1825 to RFC1829).
-If specified, \fItcpdump\fP will not print replay prevention field.
-Since there is no protocol version field in ESP/AH specification,
-\fItcpdump\fP cannot deduce the version of ESP/AH protocol.
-.TP
-.B \-r
-Read packets from \fIfile\fR (which was created with the
-.B \-w
-option).
-Standard input is used if \fIfile\fR is ``-''.
-.TP
-.B \-S
-Print absolute, rather than relative, TCP sequence numbers.
-.TP
-.B \-s
-Snarf \fIsnaplen\fP bytes of data from each packet rather than the
-default of 68 (with SunOS's NIT, the minimum is actually 96).
-68 bytes is adequate for IP, ICMP, TCP
-and UDP but may truncate protocol information from name server and NFS
-packets (see below).
-Packets truncated because of a limited snapshot
-are indicated in the output with ``[|\fIproto\fP]'', where \fIproto\fP
-is the name of the protocol level at which the truncation has occurred.
-Note that taking larger snapshots both increases
-the amount of time it takes to process packets and, effectively,
-decreases the amount of packet buffering.
-This may cause packets to be
-lost.
-You should limit \fIsnaplen\fP to the smallest number that will
-capture the protocol information you're interested in.
-Setting
-\fIsnaplen\fP to 0 means use the required length to catch whole packets.
-.TP
-.B \-T
-Force packets selected by "\fIexpression\fP" to be interpreted the
-specified \fItype\fR.
-Currently known types are
-\fBaodv\fR (Ad-hoc On-demand Distance Vector protocol),
-\fBcnfp\fR (Cisco NetFlow protocol),
-\fBrpc\fR (Remote Procedure Call),
-\fBrtp\fR (Real-Time Applications protocol),
-\fBrtcp\fR (Real-Time Applications control protocol),
-\fBsnmp\fR (Simple Network Management Protocol),
-\fBtftp\fR (Trivial File Transfer Protocol),
-\fBvat\fR (Visual Audio Tool),
-and
-\fBwb\fR (distributed White Board).
-.TP
-.B \-t
-\fIDon't\fP print a timestamp on each dump line.
-.TP
-.B \-tt
-Print an unformatted timestamp on each dump line.
-.TP
-.B \-ttt
-Print a delta (in micro-seconds) between current and previous line
-on each dump line.
-.TP
-.B \-tttt
-Print a timestamp in default format proceeded by date on each dump line.
-.TP
-.B \-u
-Print undecoded NFS handles.
-.TP
-.B \-U
-Make output saved via the
-.B \-w
-option ``packet-buffered''; i.e., as each packet is saved, it will be
-written to the output file, rather than being written only when the
-output buffer fills.
-.IP
-The
-.B \-U
-flag will not be supported if
-.I tcpdump
-was built with an older version of
-.I libpcap
-that lacks the
-.B pcap_dump_flush()
-function.
-.TP
-.B \-v
-When parsing and printing, produce (slightly more) verbose output.
-For example, the time to live,
-identification, total length and options in an IP packet are printed.
-Also enables additional packet integrity checks such as verifying the
-IP and ICMP header checksum.
-.IP
-When writing to a file with the
-.B \-w
-option, report, every 10 seconds, the number of packets captured.
-.TP
-.B \-vv
-Even more verbose output.
-For example, additional fields are
-printed from NFS reply packets, and SMB packets are fully decoded.
-.TP
-.B \-vvv
-Even more verbose output.
-For example,
-telnet \fBSB\fP ... \fBSE\fP options
-are printed in full.
-With
-.B \-X
-Telnet options are printed in hex as well.
-.TP
-.B \-w
-Write the raw packets to \fIfile\fR rather than parsing and printing
-them out.
-They can later be printed with the \-r option.
-Standard output is used if \fIfile\fR is ``-''.
-.TP
-.B \-W
-Used in conjunction with the
-.B \-C
-option, this will limit the number
-of files created to the specified number, and begin overwriting files
-from the beginning, thus creating a 'rotating' buffer.
-In addition, it will name
-the files with enough leading 0s to support the maximum number of
-files, allowing them to sort correctly.
-.TP
-.B \-x
-When parsing and printing,
-in addition to printing the headers of each packet, print the data of
-each packet (minus its link level header) in hex.
-The smaller of the entire packet or
-.I snaplen
-bytes will be printed. Note that this is the entire link-layer
-packet, so for link layers that pad (e.g. Ethernet), the padding bytes
-will also be printed when the higher layer packet is shorter than the
-required padding.
-.TP
-.B \-xx
-When parsing and printing,
-in addition to printing the headers of each packet, print the data of
-each packet,
-.I including
-its link level header, in hex.
-.TP
-.B \-X
-When parsing and printing,
-in addition to printing the headers of each packet, print the data of
-each packet (minus its link level header) in hex and ASCII.
-This is very handy for analysing new protocols.
-.TP
-.B \-XX
-When parsing and printing,
-in addition to printing the headers of each packet, print the data of
-each packet,
-.I including
-its link level header, in hex and ASCII.
-.TP
-.B \-y
-Set the data link type to use while capturing packets to \fIdatalinktype\fP.
-.TP
-.B \-Z
-Drops privileges (if root) and changes user ID to
-.I user
-and the group ID to the primary group of
-.IR user .
-.IP
-This behavior can also be enabled by default at compile time.
-.IP "\fI expression\fP"
-.RS
-selects which packets will be dumped.
-If no \fIexpression\fP
-is given, all packets on the net will be dumped.
-Otherwise,
-only packets for which \fIexpression\fP is `true' will be dumped.
-.LP
-The \fIexpression\fP consists of one or more
-.I primitives.
-Primitives usually consist of an
-.I id
-(name or number) preceded by one or more qualifiers.
-There are three
-different kinds of qualifier:
-.IP \fItype\fP
-qualifiers say what kind of thing the id name or number refers to.
-Possible types are
-.BR host ,
-.B net ,
-.B port
-and
-.BR portrange .
-E.g., `host foo', `net 128.3', `port 20', `portrange 6000-6008'.
-If there is no type
-qualifier,
-.B host
-is assumed.
-.IP \fIdir\fP
-qualifiers specify a particular transfer direction to and/or from
-.IR id .
-Possible directions are
-.BR src ,
-.BR dst ,
-.B "src or dst"
-and
-.B "src and"
-.BR dst .
-E.g., `src foo', `dst net 128.3', `src or dst port ftp-data'.
-If
-there is no dir qualifier,
-.B "src or dst"
-is assumed.
-For some link layers, such as SLIP and the ``cooked'' Linux capture mode
-used for the ``any'' device and for some other device types, the
-.B inbound
-and
-.B outbound
-qualifiers can be used to specify a desired direction.
-.IP \fIproto\fP
-qualifiers restrict the match to a particular protocol.
-Possible
-protos are:
-.BR ether ,
-.BR fddi ,
-.BR tr ,
-.BR wlan ,
-.BR ip ,
-.BR ip6 ,
-.BR arp ,
-.BR rarp ,
-.BR decnet ,
-.BR lat ,
-.BR sca ,
-.BR moprc ,
-.BR mopdl ,
-.BR iso ,
-.BR esis ,
-.BR isis ,
-.BR icmp ,
-.BR icmp6 ,
-.B tcp
-and
-.BR udp .
-E.g., `ether src foo', `arp net 128.3', `tcp port 21', `udp portrange
-7000-7009'.
-If there is
-no proto qualifier, all protocols consistent with the type are
-assumed.
-E.g., `src foo' means `(ip or arp or rarp) src foo'
-(except the latter is not legal syntax), `net bar' means `(ip or
-arp or rarp) net bar' and `port 53' means `(tcp or udp) port 53'.
-.LP
-[`fddi' is actually an alias for `ether'; the parser treats them
-identically as meaning ``the data link level used on the specified
-network interface.'' FDDI headers contain Ethernet-like source
-and destination addresses, and often contain Ethernet-like packet
-types, so you can filter on these FDDI fields just as with the
-analogous Ethernet fields.
-FDDI headers also contain other fields,
-but you cannot name them explicitly in a filter expression.
-.LP
-Similarly, `tr' and `wlan' are aliases for `ether'; the previous
-paragraph's statements about FDDI headers also apply to Token Ring
-and 802.11 wireless LAN headers. For 802.11 headers, the destination
-address is the DA field and the source address is the SA field; the
-BSSID, RA, and TA fields aren't tested.]
-.LP
-In addition to the above, there are some special `primitive' keywords
-that don't follow the pattern:
-.BR gateway ,
-.BR broadcast ,
-.BR less ,
-.B greater
-and arithmetic expressions.
-All of these are described below.
-.LP
-More complex filter expressions are built up by using the words
-.BR and ,
-.B or
-and
-.B not
-to combine primitives.
-E.g., `host foo and not port ftp and not port ftp-data'.
-To save typing, identical qualifier lists can be omitted.
-E.g.,
-`tcp dst port ftp or ftp-data or domain' is exactly the same as
-`tcp dst port ftp or tcp dst port ftp-data or tcp dst port domain'.
-.LP
-Allowable primitives are:
-.IP "\fBdst host \fIhost\fR"
-True if the IPv4/v6 destination field of the packet is \fIhost\fP,
-which may be either an address or a name.
-.IP "\fBsrc host \fIhost\fR"
-True if the IPv4/v6 source field of the packet is \fIhost\fP.
-.IP "\fBhost \fIhost\fP
-True if either the IPv4/v6 source or destination of the packet is \fIhost\fP.
-.IP
-Any of the above host expressions can be prepended with the keywords,
-\fBip\fP, \fBarp\fP, \fBrarp\fP, or \fBip6\fP as in:
-.in +.5i
-.nf
-\fBip host \fIhost\fR
-.fi
-.in -.5i
-which is equivalent to:
-.in +.5i
-.nf
-\fBether proto \fI\\ip\fB and host \fIhost\fR
-.fi
-.in -.5i
-If \fIhost\fR is a name with multiple IP addresses, each address will
-be checked for a match.
-.IP "\fBether dst \fIehost\fP
-True if the Ethernet destination address is \fIehost\fP.
-\fIEhost\fP
-may be either a name from /etc/ethers or a number (see
-.IR ethers (3N)
-for numeric format).
-.IP "\fBether src \fIehost\fP
-True if the Ethernet source address is \fIehost\fP.
-.IP "\fBether host \fIehost\fP
-True if either the Ethernet source or destination address is \fIehost\fP.
-.IP "\fBgateway\fP \fIhost\fP
-True if the packet used \fIhost\fP as a gateway.
-I.e., the Ethernet
-source or destination address was \fIhost\fP but neither the IP source
-nor the IP destination was \fIhost\fP.
-\fIHost\fP must be a name and
-must be found both by the machine's host-name-to-IP-address resolution
-mechanisms (host name file, DNS, NIS, etc.) and by the machine's
-host-name-to-Ethernet-address resolution mechanism (/etc/ethers, etc.).
-(An equivalent expression is
-.in +.5i
-.nf
-\fBether host \fIehost \fBand not host \fIhost\fR
-.fi
-.in -.5i
-which can be used with either names or numbers for \fIhost / ehost\fP.)
-This syntax does not work in IPv6-enabled configuration at this moment.
-.IP "\fBdst net \fInet\fR"
-True if the IPv4/v6 destination address of the packet has a network
-number of \fInet\fP.
-\fINet\fP may be either a name from the networks database
-(/etc/networks, etc.) or a network number.
-An IPv4 network number can be written as a dotted quad (e.g., 192.168.1.0),
-dotted triple (e.g., 192.168.1), dotted pair (e.g, 172.16), or single
-number (e.g., 10); the netmask is 255.255.255.255 for a dotted quad
-(which means that it's really a host match), 255.255.255.0 for a dotted
-triple, 255.255.0.0 for a dotted pair, or 255.0.0.0 for a single number.
-An IPv6 network number must be written out fully; the netmask is
-ff:ff:ff:ff:ff:ff:ff:ff, so IPv6 "network" matches are really always
-host matches, and a network match requires a netmask length.
-.IP "\fBsrc net \fInet\fR"
-True if the IPv4/v6 source address of the packet has a network
-number of \fInet\fP.
-.IP "\fBnet \fInet\fR"
-True if either the IPv4/v6 source or destination address of the packet has a network
-number of \fInet\fP.
-.IP "\fBnet \fInet\fR \fBmask \fInetmask\fR"
-True if the IPv4 address matches \fInet\fR with the specific \fInetmask\fR.
-May be qualified with \fBsrc\fR or \fBdst\fR.
-Note that this syntax is not valid for IPv6 \fInet\fR.
-.IP "\fBnet \fInet\fR/\fIlen\fR"
-True if the IPv4/v6 address matches \fInet\fR with a netmask \fIlen\fR
-bits wide.
-May be qualified with \fBsrc\fR or \fBdst\fR.
-.IP "\fBdst port \fIport\fR"
-True if the packet is ip/tcp, ip/udp, ip6/tcp or ip6/udp and has a
-destination port value of \fIport\fP.
-The \fIport\fP can be a number or a name used in /etc/services (see
-.IR tcp (4P)
-and
-.IR udp (4P)).
-If a name is used, both the port
-number and protocol are checked.
-If a number or ambiguous name is used,
-only the port number is checked (e.g., \fBdst port 513\fR will print both
-tcp/login traffic and udp/who traffic, and \fBport domain\fR will print
-both tcp/domain and udp/domain traffic).
-.IP "\fBsrc port \fIport\fR"
-True if the packet has a source port value of \fIport\fP.
-.IP "\fBport \fIport\fR"
-True if either the source or destination port of the packet is \fIport\fP.
-.IP "\fBdst portrange \fIport1\fB-\fIport2\fR"
-True if the packet is ip/tcp, ip/udp, ip6/tcp or ip6/udp and has a
-destination port value between \fIport1\fP and \fIport2\fP.
-.I port1
-and
-.I port2
-are interpreted in the same fashion as the
-.I port
-parameter for
-.BR port .
-.IP "\fBsrc portrange \fIport1\fB-\fIport2\fR"
-True if the packet has a source port value between \fIport1\fP and
-\fIport2\fP.
-.IP "\fBportrange \fIport1\fB-\fIport2\fR"
-True if either the source or destination port of the packet is between
-\fIport1\fP and \fIport2\fP.
-.IP
-Any of the above port or port range expressions can be prepended with
-the keywords, \fBtcp\fP or \fBudp\fP, as in:
-.in +.5i
-.nf
-\fBtcp src port \fIport\fR
-.fi
-.in -.5i
-which matches only tcp packets whose source port is \fIport\fP.
-.IP "\fBless \fIlength\fR"
-True if the packet has a length less than or equal to \fIlength\fP.
-This is equivalent to:
-.in +.5i
-.nf
-\fBlen <= \fIlength\fP.
-.fi
-.in -.5i
-.IP "\fBgreater \fIlength\fR"
-True if the packet has a length greater than or equal to \fIlength\fP.
-This is equivalent to:
-.in +.5i
-.nf
-\fBlen >= \fIlength\fP.
-.fi
-.in -.5i
-.IP "\fBip proto \fIprotocol\fR"
-True if the packet is an IPv4 packet (see
-.IR ip (4P))
-of protocol type \fIprotocol\fP.
-\fIProtocol\fP can be a number or one of the names
-\fBicmp\fP, \fBicmp6\fP, \fBigmp\fP, \fBigrp\fP, \fBpim\fP, \fBah\fP,
-\fBesp\fP, \fBvrrp\fP, \fBudp\fP, or \fBtcp\fP.
-Note that the identifiers \fBtcp\fP, \fBudp\fP, and \fBicmp\fP are also
-keywords and must be escaped via backslash (\\), which is \\\\ in the C-shell.
-Note that this primitive does not chase the protocol header chain.
-.IP "\fBip6 proto \fIprotocol\fR"
-True if the packet is an IPv6 packet of protocol type \fIprotocol\fP.
-Note that this primitive does not chase the protocol header chain.
-.IP "\fBip6 protochain \fIprotocol\fR"
-True if the packet is IPv6 packet,
-and contains protocol header with type \fIprotocol\fR
-in its protocol header chain.
-For example,
-.in +.5i
-.nf
-\fBip6 protochain 6\fR
-.fi
-.in -.5i
-matches any IPv6 packet with TCP protocol header in the protocol header chain.
-The packet may contain, for example,
-authentication header, routing header, or hop-by-hop option header,
-between IPv6 header and TCP header.
-The BPF code emitted by this primitive is complex and
-cannot be optimized by BPF optimizer code in \fItcpdump\fP,
-so this can be somewhat slow.
-.IP "\fBip protochain \fIprotocol\fR"
-Equivalent to \fBip6 protochain \fIprotocol\fR, but this is for IPv4.
-.IP "\fBether broadcast\fR"
-True if the packet is an Ethernet broadcast packet.
-The \fIether\fP
-keyword is optional.
-.IP "\fBip broadcast\fR"
-True if the packet is an IPv4 broadcast packet.
-It checks for both the all-zeroes and all-ones broadcast conventions,
-and looks up the subnet mask on the interface on which the capture is
-being done.
-.IP
-If the subnet mask of the interface on which the capture is being done
-is not available, either because the interface on which capture is being
-done has no netmask or because the capture is being done on the Linux
-"any" interface, which can capture on more than one interface, this
-check will not work correctly.
-.IP "\fBether multicast\fR"
-True if the packet is an Ethernet multicast packet.
-The \fBether\fP
-keyword is optional.
-This is shorthand for `\fBether[0] & 1 != 0\fP'.
-.IP "\fBip multicast\fR"
-True if the packet is an IPv4 multicast packet.
-.IP "\fBip6 multicast\fR"
-True if the packet is an IPv6 multicast packet.
-.IP "\fBether proto \fIprotocol\fR"
-True if the packet is of ether type \fIprotocol\fR.
-\fIProtocol\fP can be a number or one of the names
-\fBip\fP, \fBip6\fP, \fBarp\fP, \fBrarp\fP, \fBatalk\fP, \fBaarp\fP,
-\fBdecnet\fP, \fBsca\fP, \fBlat\fP, \fBmopdl\fP, \fBmoprc\fP,
-\fBiso\fP, \fBstp\fP, \fBipx\fP, or \fBnetbeui\fP.
-Note these identifiers are also keywords
-and must be escaped via backslash (\\).
-.IP
-[In the case of FDDI (e.g., `\fBfddi protocol arp\fR'), Token Ring
-(e.g., `\fBtr protocol arp\fR'), and IEEE 802.11 wireless LANS (e.g.,
-`\fBwlan protocol arp\fR'), for most of those protocols, the
-protocol identification comes from the 802.2 Logical Link Control (LLC)
-header, which is usually layered on top of the FDDI, Token Ring, or
-802.11 header.
-.IP
-When filtering for most protocol identifiers on FDDI, Token Ring, or
-802.11, \fItcpdump\fR checks only the protocol ID field of an LLC header
-in so-called SNAP format with an Organizational Unit Identifier (OUI) of
-0x000000, for encapsulated Ethernet; it doesn't check whether the packet
-is in SNAP format with an OUI of 0x000000.
-The exceptions are:
-.RS
-.TP
-\fBiso\fP
-\fItcpdump\fR checks the DSAP (Destination Service Access Point) and
-SSAP (Source Service Access Point) fields of the LLC header;
-.TP
-\fBstp\fP and \fBnetbeui\fP
-\fItcpdump\fR checks the DSAP of the LLC header;
-.TP
-\fBatalk\fP
-\fItcpdump\fR checks for a SNAP-format packet with an OUI of 0x080007
-and the AppleTalk etype.
-.RE
-.IP
-In the case of Ethernet, \fItcpdump\fR checks the Ethernet type field
-for most of those protocols. The exceptions are:
-.RS
-.TP
-\fBiso\fP, \fBstp\fP, and \fBnetbeui\fP
-\fItcpdump\fR checks for an 802.3 frame and then checks the LLC header as
-it does for FDDI, Token Ring, and 802.11;
-.TP
-\fBatalk\fP
-\fItcpdump\fR checks both for the AppleTalk etype in an Ethernet frame and
-for a SNAP-format packet as it does for FDDI, Token Ring, and 802.11;
-.TP
-\fBaarp\fP
-\fItcpdump\fR checks for the AppleTalk ARP etype in either an Ethernet
-frame or an 802.2 SNAP frame with an OUI of 0x000000;
-.TP
-\fBipx\fP
-\fItcpdump\fR checks for the IPX etype in an Ethernet frame, the IPX
-DSAP in the LLC header, the 802.3-with-no-LLC-header encapsulation of
-IPX, and the IPX etype in a SNAP frame.
-.RE
-.IP "\fBdecnet src \fIhost\fR"
-True if the DECNET source address is
-.IR host ,
-which may be an address of the form ``10.123'', or a DECNET host
-name.
-[DECNET host name support is only available on ULTRIX systems
-that are configured to run DECNET.]
-.IP "\fBdecnet dst \fIhost\fR"
-True if the DECNET destination address is
-.IR host .
-.IP "\fBdecnet host \fIhost\fR"
-True if either the DECNET source or destination address is
-.IR host .
-.IP "\fBifname \fIinterface\fR"
-True if the packet was logged as coming from the specified interface (applies
-only to packets logged by OpenBSD's
-.BR pf (4)).
-.IP "\fBon \fIinterface\fR"
-Synonymous with the
-.B ifname
-modifier.
-.IP "\fBrnr \fInum\fR"
-True if the packet was logged as matching the specified PF rule number
-(applies only to packets logged by OpenBSD's
-.BR pf (4)).
-.IP "\fBrulenum \fInum\fR"
-Synonomous with the
-.B rnr
-modifier.
-.IP "\fBreason \fIcode\fR"
-True if the packet was logged with the specified PF reason code. The known
-codes are:
-.BR match ,
-.BR bad-offset ,
-.BR fragment ,
-.BR short ,
-.BR normalize ,
-and
-.B memory
-(applies only to packets logged by OpenBSD's
-.BR pf (4)).
-.IP "\fBrset \fIname\fR"
-True if the packet was logged as matching the specified PF ruleset
-name of an anchored ruleset (applies only to packets logged by
-.BR pf (4)).
-.IP "\fBruleset \fIname\fR"
-Synonomous with the
-.B rset
-modifier.
-.IP "\fBsrnr \fInum\fR"
-True if the packet was logged as matching the specified PF rule number
-of an anchored ruleset (applies only to packets logged by
-.BR pf (4)).
-.IP "\fBsubrulenum \fInum\fR"
-Synonomous with the
-.B srnr
-modifier.
-.IP "\fBaction \fIact\fR"
-True if PF took the specified action when the packet was logged. Known actions
-are:
-.B pass
-and
-.B block
-(applies only to packets logged by OpenBSD's
-.BR pf (4)).
-.IP "\fBip\fR, \fBip6\fR, \fBarp\fR, \fBrarp\fR, \fBatalk\fR, \fBaarp\fR, \fBdecnet\fR, \fBiso\fR, \fBstp\fR, \fBipx\fR, \fInetbeui\fP"
-Abbreviations for:
-.in +.5i
-.nf
-\fBether proto \fIp\fR
-.fi
-.in -.5i
-where \fIp\fR is one of the above protocols.
-.IP "\fBlat\fR, \fBmoprc\fR, \fBmopdl\fR"
-Abbreviations for:
-.in +.5i
-.nf
-\fBether proto \fIp\fR
-.fi
-.in -.5i
-where \fIp\fR is one of the above protocols.
-Note that
-\fItcpdump\fP does not currently know how to parse these protocols.
-.IP "\fBvlan \fI[vlan_id]\fR"
-True if the packet is an IEEE 802.1Q VLAN packet.
-If \fI[vlan_id]\fR is specified, only true if the packet has the specified
-\fIvlan_id\fR.
-Note that the first \fBvlan\fR keyword encountered in \fIexpression\fR
-changes the decoding offsets for the remainder of \fIexpression\fR on
-the assumption that the packet is a VLAN packet. The \fBvlan
-\fI[vlan_id]\fR expression may be used more than once, to filter on VLAN
-hierarchies. Each use of that expression increments the filter offsets
-by 4.
-.IP
-For example:
-.in +.5i
-.nf
-\fBvlan 100 && vlan 200\fR
-.fi
-.in -.5i
-filters on VLAN 200 encapsulated within VLAN 100, and
-.in +.5i
-.nf
-\fBvlan && vlan 300 && ip\fR
-.fi
-.in -.5i
-filters IPv4 protocols encapsulated in VLAN 300 encapsulated within any
-higher order VLAN.
-.IP "\fBmpls \fI[label_num]\fR"
-True if the packet is an MPLS packet.
-If \fI[label_num]\fR is specified, only true is the packet has the specified
-\fIlabel_num\fR.
-Note that the first \fBmpls\fR keyword encountered in \fIexpression\fR
-changes the decoding offsets for the remainder of \fIexpression\fR on
-the assumption that the packet is a MPLS-encapsulated IP packet. The
-\fBmpls \fI[label_num]\fR expression may be used more than once, to
-filter on MPLS hierarchies. Each use of that expression increments the
-filter offsets by 4.
-.IP
-For example:
-.in +.5i
-.nf
-\fBmpls 100000 && mpls 1024\fR
-.fi
-.in -.5i
-filters packets with an outer label of 100000 and an inner label of
-1024, and
-.in +.5i
-.nf
-\fBmpls && mpls 1024 && host 192.9.200.1\fR
-.fi
-.in -.5i
-filters packets to or from 192.9.200.1 with an inner label of 1024 and
-any outer label.
-.IP \fBpppoed\fP
-True if the packet is a PPP-over-Ethernet Discovery packet (Ethernet
-type 0x8863).
-.IP \fBpppoes\fP
-True if the packet is a PPP-over-Ethernet Session packet (Ethernet
-type 0x8864).
-Note that the first \fBpppoes\fR keyword encountered in \fIexpression\fR
-changes the decoding offsets for the remainder of \fIexpression\fR on
-the assumption that the packet is a PPPoE session packet.
-.IP
-For example:
-.in +.5i
-.nf
-\fBpppoes && ip\fR
-.fi
-.in -.5i
-filters IPv4 protocols encapsulated in PPPoE.
-.IP "\fBtcp\fR, \fBudp\fR, \fBicmp\fR"
-Abbreviations for:
-.in +.5i
-.nf
-\fBip proto \fIp\fR\fB or ip6 proto \fIp\fR
-.fi
-.in -.5i
-where \fIp\fR is one of the above protocols.
-.IP "\fBiso proto \fIprotocol\fR"
-True if the packet is an OSI packet of protocol type \fIprotocol\fP.
-\fIProtocol\fP can be a number or one of the names
-\fBclnp\fP, \fBesis\fP, or \fBisis\fP.
-.IP "\fBclnp\fR, \fBesis\fR, \fBisis\fR"
-Abbreviations for:
-.in +.5i
-.nf
-\fBiso proto \fIp\fR
-.fi
-.in -.5i
-where \fIp\fR is one of the above protocols.
-.IP "\fBl1\fR, \fBl2\fR, \fBiih\fR, \fBlsp\fR, \fBsnp\fR, \fBcsnp\fR, \fBpsnp\fR"
-Abbreviations for IS-IS PDU types.
-.IP "\fBvpi\fP \fIn\fR
-True if the packet is an ATM packet, for SunATM on Solaris, with a
-virtual path identifier of
-.IR n .
-.IP "\fBvci\fP \fIn\fR
-True if the packet is an ATM packet, for SunATM on Solaris, with a
-virtual channel identifier of
-.IR n .
-.IP \fBlane\fP
-True if the packet is an ATM packet, for SunATM on Solaris, and is
-an ATM LANE packet.
-Note that the first \fBlane\fR keyword encountered in \fIexpression\fR
-changes the tests done in the remainder of \fIexpression\fR
-on the assumption that the packet is either a LANE emulated Ethernet
-packet or a LANE LE Control packet. If \fBlane\fR isn't specified, the
-tests are done under the assumption that the packet is an
-LLC-encapsulated packet.
-.IP \fBllc\fP
-True if the packet is an ATM packet, for SunATM on Solaris, and is
-an LLC-encapsulated packet.
-.IP \fBoamf4s\fP
-True if the packet is an ATM packet, for SunATM on Solaris, and is
-a segment OAM F4 flow cell (VPI=0 & VCI=3).
-.IP \fBoamf4e\fP
-True if the packet is an ATM packet, for SunATM on Solaris, and is
-an end-to-end OAM F4 flow cell (VPI=0 & VCI=4).
-.IP \fBoamf4\fP
-True if the packet is an ATM packet, for SunATM on Solaris, and is
-a segment or end-to-end OAM F4 flow cell (VPI=0 & (VCI=3 | VCI=4)).
-.IP \fBoam\fP
-True if the packet is an ATM packet, for SunATM on Solaris, and is
-a segment or end-to-end OAM F4 flow cell (VPI=0 & (VCI=3 | VCI=4)).
-.IP \fBmetac\fP
-True if the packet is an ATM packet, for SunATM on Solaris, and is
-on a meta signaling circuit (VPI=0 & VCI=1).
-.IP \fBbcc\fP
-True if the packet is an ATM packet, for SunATM on Solaris, and is
-on a broadcast signaling circuit (VPI=0 & VCI=2).
-.IP \fBsc\fP
-True if the packet is an ATM packet, for SunATM on Solaris, and is
-on a signaling circuit (VPI=0 & VCI=5).
-.IP \fBilmic\fP
-True if the packet is an ATM packet, for SunATM on Solaris, and is
-on an ILMI circuit (VPI=0 & VCI=16).
-.IP \fBconnectmsg\fP
-True if the packet is an ATM packet, for SunATM on Solaris, and is
-on a signaling circuit and is a Q.2931 Setup, Call Proceeding, Connect,
-Connect Ack, Release, or Release Done message.
-.IP \fBmetaconnect\fP
-True if the packet is an ATM packet, for SunATM on Solaris, and is
-on a meta signaling circuit and is a Q.2931 Setup, Call Proceeding, Connect,
-Release, or Release Done message.
-.IP "\fIexpr relop expr\fR"
-True if the relation holds, where \fIrelop\fR is one of >, <, >=, <=, =,
-!=, and \fIexpr\fR is an arithmetic expression composed of integer
-constants (expressed in standard C syntax), the normal binary operators
-[+, -, *, /, &, |, <<, >>], a length operator, and special packet data
-accessors. Note that all comparisons are unsigned, so that, for example,
-0x80000000 and 0xffffffff are > 0.
-To access
-data inside the packet, use the following syntax:
-.in +.5i
-.nf
-\fIproto\fB [ \fIexpr\fB : \fIsize\fB ]\fR
-.fi
-.in -.5i
-\fIProto\fR is one of \fBether, fddi, tr, wlan, ppp, slip, link,
-ip, arp, rarp, tcp, udp, icmp, ip6\fR or \fBradio\fR, and
-indicates the protocol layer for the index operation.
-(\fBether, fddi, wlan, tr, ppp, slip\fR and \fBlink\fR all refer to the
-link layer. \fBradio\fR refers to the "radio header" added to some
-802.11 captures.)
-Note that \fItcp, udp\fR and other upper-layer protocol types only
-apply to IPv4, not IPv6 (this will be fixed in the future).
-The byte offset, relative to the indicated protocol layer, is
-given by \fIexpr\fR.
-\fISize\fR is optional and indicates the number of bytes in the
-field of interest; it can be either one, two, or four, and defaults to one.
-The length operator, indicated by the keyword \fBlen\fP, gives the
-length of the packet.
-
-For example, `\fBether[0] & 1 != 0\fP' catches all multicast traffic.
-The expression `\fBip[0] & 0xf != 5\fP'
-catches all IPv4 packets with options.
-The expression
-`\fBip[6:2] & 0x1fff = 0\fP'
-catches only unfragmented IPv4 datagrams and frag zero of fragmented
-IPv4 datagrams.
-This check is implicitly applied to the \fBtcp\fP and \fBudp\fP
-index operations.
-For instance, \fBtcp[0]\fP always means the first
-byte of the TCP \fIheader\fP, and never means the first byte of an
-intervening fragment.
-
-Some offsets and field values may be expressed as names rather than
-as numeric values.
-The following protocol header field offsets are
-available: \fBicmptype\fP (ICMP type field), \fBicmpcode\fP (ICMP
-code field), and \fBtcpflags\fP (TCP flags field).
-
-The following ICMP type field values are available: \fBicmp-echoreply\fP,
-\fBicmp-unreach\fP, \fBicmp-sourcequench\fP, \fBicmp-redirect\fP,
-\fBicmp-echo\fP, \fBicmp-routeradvert\fP, \fBicmp-routersolicit\fP,
-\fBicmp-timxceed\fP, \fBicmp-paramprob\fP, \fBicmp-tstamp\fP,
-\fBicmp-tstampreply\fP, \fBicmp-ireq\fP, \fBicmp-ireqreply\fP,
-\fBicmp-maskreq\fP, \fBicmp-maskreply\fP.
-
-The following TCP flags field values are available: \fBtcp-fin\fP,
-\fBtcp-syn\fP, \fBtcp-rst\fP, \fBtcp-push\fP,
-\fBtcp-ack\fP, \fBtcp-urg\fP.
-.LP
-Primitives may be combined using:
-.IP
-A parenthesized group of primitives and operators
-(parentheses are special to the Shell and must be escaped).
-.IP
-Negation (`\fB!\fP' or `\fBnot\fP').
-.IP
-Concatenation (`\fB&&\fP' or `\fBand\fP').
-.IP
-Alternation (`\fB||\fP' or `\fBor\fP').
-.LP
-Negation has highest precedence.
-Alternation and concatenation have equal precedence and associate
-left to right.
-Note that explicit \fBand\fR tokens, not juxtaposition,
-are now required for concatenation.
-.LP
-If an identifier is given without a keyword, the most recent keyword
-is assumed.
-For example,
-.in +.5i
-.nf
-\fBnot host vs and ace\fR
-.fi
-.in -.5i
-is short for
-.in +.5i
-.nf
-\fBnot host vs and host ace\fR
-.fi
-.in -.5i
-which should not be confused with
-.in +.5i
-.nf
-\fBnot ( host vs or ace )\fR
-.fi
-.in -.5i
-.LP
-Expression arguments can be passed to \fItcpdump\fP as either a single
-argument or as multiple arguments, whichever is more convenient.
-Generally, if the expression contains Shell metacharacters, it is
-easier to pass it as a single, quoted argument.
-Multiple arguments are concatenated with spaces before being parsed.
-.SH EXAMPLES
-.LP
-To print all packets arriving at or departing from \fIsundown\fP:
-.RS
-.nf
-\fBtcpdump host sundown\fP
-.fi
-.RE
-.LP
-To print traffic between \fIhelios\fR and either \fIhot\fR or \fIace\fR:
-.RS
-.nf
-\fBtcpdump host helios and \\( hot or ace \\)\fP
-.fi
-.RE
-.LP
-To print all IP packets between \fIace\fR and any host except \fIhelios\fR:
-.RS
-.nf
-\fBtcpdump ip host ace and not helios\fP
-.fi
-.RE
-.LP
-To print all traffic between local hosts and hosts at Berkeley:
-.RS
-.nf
-.B
-tcpdump net ucb-ether
-.fi
-.RE
-.LP
-To print all ftp traffic through internet gateway \fIsnup\fP:
-(note that the expression is quoted to prevent the shell from
-(mis-)interpreting the parentheses):
-.RS
-.nf
-.B
-tcpdump 'gateway snup and (port ftp or ftp-data)'
-.fi
-.RE
-.LP
-To print traffic neither sourced from nor destined for local hosts
-(if you gateway to one other net, this stuff should never make it
-onto your local net).
-.RS
-.nf
-.B
-tcpdump ip and not net \fIlocalnet\fP
-.fi
-.RE
-.LP
-To print the start and end packets (the SYN and FIN packets) of each
-TCP conversation that involves a non-local host.
-.RS
-.nf
-.B
-tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net \fIlocalnet\fP'
-.fi
-.RE
-.LP
-To print all IPv4 HTTP packets to and from port 80, i.e. print only
-packets that contain data, not, for example, SYN and FIN packets and
-ACK-only packets. (IPv6 is left as an exercise for the reader.)
-.RS
-.nf
-.B
-tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
-.fi
-.RE
-.LP
-To print IP packets longer than 576 bytes sent through gateway \fIsnup\fP:
-.RS
-.nf
-.B
-tcpdump 'gateway snup and ip[2:2] > 576'
-.fi
-.RE
-.LP
-To print IP broadcast or multicast packets that were
-.I not
-sent via Ethernet broadcast or multicast:
-.RS
-.nf
-.B
-tcpdump 'ether[0] & 1 = 0 and ip[16] >= 224'
-.fi
-.RE
-.LP
-To print all ICMP packets that are not echo requests/replies (i.e., not
-ping packets):
-.RS
-.nf
-.B
-tcpdump 'icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply'
-.fi
-.RE
-.SH OUTPUT FORMAT
-.LP
-The output of \fItcpdump\fP is protocol dependent.
-The following
-gives a brief description and examples of most of the formats.
-.de HD
-.sp 1.5
-.B
-..
-.HD
-Link Level Headers
-.LP
-If the '-e' option is given, the link level header is printed out.
-On Ethernets, the source and destination addresses, protocol,
-and packet length are printed.
-.LP
-On FDDI networks, the '-e' option causes \fItcpdump\fP to print
-the `frame control' field, the source and destination addresses,
-and the packet length.
-(The `frame control' field governs the
-interpretation of the rest of the packet.
-Normal packets (such
-as those containing IP datagrams) are `async' packets, with a priority
-value between 0 and 7; for example, `\fBasync4\fR'.
-Such packets
-are assumed to contain an 802.2 Logical Link Control (LLC) packet;
-the LLC header is printed if it is \fInot\fR an ISO datagram or a
-so-called SNAP packet.
-.LP
-On Token Ring networks, the '-e' option causes \fItcpdump\fP to print
-the `access control' and `frame control' fields, the source and
-destination addresses, and the packet length.
-As on FDDI networks,
-packets are assumed to contain an LLC packet.
-Regardless of whether
-the '-e' option is specified or not, the source routing information is
-printed for source-routed packets.
-.LP
-On 802.11 networks, the '-e' option causes \fItcpdump\fP to print
-the `frame control' fields, all of the addresses in the 802.11 header,
-and the packet length.
-As on FDDI networks,
-packets are assumed to contain an LLC packet.
-.LP
-\fI(N.B.: The following description assumes familiarity with
-the SLIP compression algorithm described in RFC-1144.)\fP
-.LP
-On SLIP links, a direction indicator (``I'' for inbound, ``O'' for outbound),
-packet type, and compression information are printed out.
-The packet type is printed first.
-The three types are \fIip\fP, \fIutcp\fP, and \fIctcp\fP.
-No further link information is printed for \fIip\fR packets.
-For TCP packets, the connection identifier is printed following the type.
-If the packet is compressed, its encoded header is printed out.
-The special cases are printed out as
-\fB*S+\fIn\fR and \fB*SA+\fIn\fR, where \fIn\fR is the amount by which
-the sequence number (or sequence number and ack) has changed.
-If it is not a special case,
-zero or more changes are printed.
-A change is indicated by U (urgent pointer), W (window), A (ack),
-S (sequence number), and I (packet ID), followed by a delta (+n or -n),
-or a new value (=n).
-Finally, the amount of data in the packet and compressed header length
-are printed.
-.LP
-For example, the following line shows an outbound compressed TCP packet,
-with an implicit connection identifier; the ack has changed by 6,
-the sequence number by 49, and the packet ID by 6; there are 3 bytes of
-data and 6 bytes of compressed header:
-.RS
-.nf
-\fBO ctcp * A+6 S+49 I+6 3 (6)\fP
-.fi
-.RE
-.HD
-ARP/RARP Packets
-.LP
-Arp/rarp output shows the type of request and its arguments.
-The
-format is intended to be self explanatory.
-Here is a short sample taken from the start of an `rlogin' from
-host \fIrtsg\fP to host \fIcsam\fP:
-.RS
-.nf
-.sp .5
-\f(CWarp who-has csam tell rtsg
-arp reply csam is-at CSAM\fR
-.sp .5
-.fi
-.RE
-The first line says that rtsg sent an arp packet asking
-for the Ethernet address of internet host csam.
-Csam
-replies with its Ethernet address (in this example, Ethernet addresses
-are in caps and internet addresses in lower case).
-.LP
-This would look less redundant if we had done \fItcpdump \-n\fP:
-.RS
-.nf
-.sp .5
-\f(CWarp who-has 128.3.254.6 tell 128.3.254.68
-arp reply 128.3.254.6 is-at 02:07:01:00:01:c4\fP
-.fi
-.RE
-.LP
-If we had done \fItcpdump \-e\fP, the fact that the first packet is
-broadcast and the second is point-to-point would be visible:
-.RS
-.nf
-.sp .5
-\f(CWRTSG Broadcast 0806 64: arp who-has csam tell rtsg
-CSAM RTSG 0806 64: arp reply csam is-at CSAM\fR
-.sp .5
-.fi
-.RE
-For the first packet this says the Ethernet source address is RTSG, the
-destination is the Ethernet broadcast address, the type field
-contained hex 0806 (type ETHER_ARP) and the total length was 64 bytes.
-.HD
-TCP Packets
-.LP
-\fI(N.B.:The following description assumes familiarity with
-the TCP protocol described in RFC-793.
-If you are not familiar
-with the protocol, neither this description nor \fItcpdump\fP will
-be of much use to you.)\fP
-.LP
-The general format of a tcp protocol line is:
-.RS
-.nf
-.sp .5
-\fIsrc > dst: flags data-seqno ack window urgent options\fP
-.sp .5
-.fi
-.RE
-\fISrc\fP and \fIdst\fP are the source and destination IP
-addresses and ports.
-\fIFlags\fP are some combination of S (SYN),
-F (FIN), P (PUSH), R (RST), W (ECN CWR) or E (ECN-Echo), or a single
-`.' (no flags).
-\fIData-seqno\fP describes the portion of sequence space covered
-by the data in this packet (see example below).
-\fIAck\fP is sequence number of the next data expected the other
-direction on this connection.
-\fIWindow\fP is the number of bytes of receive buffer space available
-the other direction on this connection.
-\fIUrg\fP indicates there is `urgent' data in the packet.
-\fIOptions\fP are tcp options enclosed in angle brackets (e.g., <mss 1024>).
-.LP
-\fISrc, dst\fP and \fIflags\fP are always present.
-The other fields
-depend on the contents of the packet's tcp protocol header and
-are output only if appropriate.
-.LP
-Here is the opening portion of an rlogin from host \fIrtsg\fP to
-host \fIcsam\fP.
-.RS
-.nf
-.sp .5
-\s-2\f(CWrtsg.1023 > csam.login: S 768512:768512(0) win 4096 <mss 1024>
-csam.login > rtsg.1023: S 947648:947648(0) ack 768513 win 4096 <mss 1024>
-rtsg.1023 > csam.login: . ack 1 win 4096
-rtsg.1023 > csam.login: P 1:2(1) ack 1 win 4096
-csam.login > rtsg.1023: . ack 2 win 4096
-rtsg.1023 > csam.login: P 2:21(19) ack 1 win 4096
-csam.login > rtsg.1023: P 1:2(1) ack 21 win 4077
-csam.login > rtsg.1023: P 2:3(1) ack 21 win 4077 urg 1
-csam.login > rtsg.1023: P 3:4(1) ack 21 win 4077 urg 1\fR\s+2
-.sp .5
-.fi
-.RE
-The first line says that tcp port 1023 on rtsg sent a packet
-to port \fIlogin\fP
-on csam.
-The \fBS\fP indicates that the \fISYN\fP flag was set.
-The packet sequence number was 768512 and it contained no data.
-(The notation is `first:last(nbytes)' which means `sequence
-numbers \fIfirst\fP
-up to but not including \fIlast\fP which is \fInbytes\fP bytes of user data'.)
-There was no piggy-backed ack, the available receive window was 4096
-bytes and there was a max-segment-size option requesting an mss of
-1024 bytes.
-.LP
-Csam replies with a similar packet except it includes a piggy-backed
-ack for rtsg's SYN.
-Rtsg then acks csam's SYN.
-The `.' means no
-flags were set.
-The packet contained no data so there is no data sequence number.
-Note that the ack sequence
-number is a small integer (1).
-The first time \fItcpdump\fP sees a
-tcp `conversation', it prints the sequence number from the packet.
-On subsequent packets of the conversation, the difference between
-the current packet's sequence number and this initial sequence number
-is printed.
-This means that sequence numbers after the
-first can be interpreted
-as relative byte positions in the conversation's data stream (with the
-first data byte each direction being `1').
-`-S' will override this
-feature, causing the original sequence numbers to be output.
-.LP
-On the 6th line, rtsg sends csam 19 bytes of data (bytes 2 through 20
-in the rtsg \(-> csam side of the conversation).
-The PUSH flag is set in the packet.
-On the 7th line, csam says it's received data sent by rtsg up to
-but not including byte 21.
-Most of this data is apparently sitting in the
-socket buffer since csam's receive window has gotten 19 bytes smaller.
-Csam also sends one byte of data to rtsg in this packet.
-On the 8th and 9th lines,
-csam sends two bytes of urgent, pushed data to rtsg.
-.LP
-If the snapshot was small enough that \fItcpdump\fP didn't capture
-the full TCP header, it interprets as much of the header as it can
-and then reports ``[|\fItcp\fP]'' to indicate the remainder could not
-be interpreted.
-If the header contains a bogus option (one with a length
-that's either too small or beyond the end of the header), \fItcpdump\fP
-reports it as ``[\fIbad opt\fP]'' and does not interpret any further
-options (since it's impossible to tell where they start).
-If the header
-length indicates options are present but the IP datagram length is not
-long enough for the options to actually be there, \fItcpdump\fP reports
-it as ``[\fIbad hdr length\fP]''.
-.HD
-.B Capturing TCP packets with particular flag combinations (SYN-ACK, URG-ACK, etc.)
-.PP
-There are 8 bits in the control bits section of the TCP header:
-.IP
-.I CWR | ECE | URG | ACK | PSH | RST | SYN | FIN
-.PP
-Let's assume that we want to watch packets used in establishing
-a TCP connection.
-Recall that TCP uses a 3-way handshake protocol
-when it initializes a new connection; the connection sequence with
-regard to the TCP control bits is
-.PP
-.RS
-1) Caller sends SYN
-.RE
-.RS
-2) Recipient responds with SYN, ACK
-.RE
-.RS
-3) Caller sends ACK
-.RE
-.PP
-Now we're interested in capturing packets that have only the
-SYN bit set (Step 1).
-Note that we don't want packets from step 2
-(SYN-ACK), just a plain initial SYN.
-What we need is a correct filter
-expression for \fItcpdump\fP.
-.PP
-Recall the structure of a TCP header without options:
-.PP
-.nf
- 0 15 31
------------------------------------------------------------------
-| source port | destination port |
------------------------------------------------------------------
-| sequence number |
------------------------------------------------------------------
-| acknowledgment number |
------------------------------------------------------------------
-| HL | rsvd |C|E|U|A|P|R|S|F| window size |
------------------------------------------------------------------
-| TCP checksum | urgent pointer |
------------------------------------------------------------------
-.fi
-.PP
-A TCP header usually holds 20 octets of data, unless options are
-present.
-The first line of the graph contains octets 0 - 3, the
-second line shows octets 4 - 7 etc.
-.PP
-Starting to count with 0, the relevant TCP control bits are contained
-in octet 13:
-.PP
-.nf
- 0 7| 15| 23| 31
-----------------|---------------|---------------|----------------
-| HL | rsvd |C|E|U|A|P|R|S|F| window size |
-----------------|---------------|---------------|----------------
-| | 13th octet | | |
-.fi
-.PP
-Let's have a closer look at octet no. 13:
-.PP
-.nf
- | |
- |---------------|
- |C|E|U|A|P|R|S|F|
- |---------------|
- |7 5 3 0|
-.fi
-.PP
-These are the TCP control bits we are interested
-in.
-We have numbered the bits in this octet from 0 to 7, right to
-left, so the PSH bit is bit number 3, while the URG bit is number 5.
-.PP
-Recall that we want to capture packets with only SYN set.
-Let's see what happens to octet 13 if a TCP datagram arrives
-with the SYN bit set in its header:
-.PP
-.nf
- |C|E|U|A|P|R|S|F|
- |---------------|
- |0 0 0 0 0 0 1 0|
- |---------------|
- |7 6 5 4 3 2 1 0|
-.fi
-.PP
-Looking at the
-control bits section we see that only bit number 1 (SYN) is set.
-.PP
-Assuming that octet number 13 is an 8-bit unsigned integer in
-network byte order, the binary value of this octet is
-.IP
-00000010
-.PP
-and its decimal representation is
-.PP
-.nf
- 7 6 5 4 3 2 1 0
-0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 1*2 + 0*2 = 2
-.fi
-.PP
-We're almost done, because now we know that if only SYN is set,
-the value of the 13th octet in the TCP header, when interpreted
-as a 8-bit unsigned integer in network byte order, must be exactly 2.
-.PP
-This relationship can be expressed as
-.RS
-.B
-tcp[13] == 2
-.RE
-.PP
-We can use this expression as the filter for \fItcpdump\fP in order
-to watch packets which have only SYN set:
-.RS
-.B
-tcpdump -i xl0 tcp[13] == 2
-.RE
-.PP
-The expression says "let the 13th octet of a TCP datagram have
-the decimal value 2", which is exactly what we want.
-.PP
-Now, let's assume that we need to capture SYN packets, but we
-don't care if ACK or any other TCP control bit is set at the
-same time.
-Let's see what happens to octet 13 when a TCP datagram
-with SYN-ACK set arrives:
-.PP
-.nf
- |C|E|U|A|P|R|S|F|
- |---------------|
- |0 0 0 1 0 0 1 0|
- |---------------|
- |7 6 5 4 3 2 1 0|
-.fi
-.PP
-Now bits 1 and 4 are set in the 13th octet.
-The binary value of
-octet 13 is
-.IP
- 00010010
-.PP
-which translates to decimal
-.PP
-.nf
- 7 6 5 4 3 2 1 0
-0*2 + 0*2 + 0*2 + 1*2 + 0*2 + 0*2 + 1*2 + 0*2 = 18
-.fi
-.PP
-Now we can't just use 'tcp[13] == 18' in the \fItcpdump\fP filter
-expression, because that would select only those packets that have
-SYN-ACK set, but not those with only SYN set.
-Remember that we don't care
-if ACK or any other control bit is set as long as SYN is set.
-.PP
-In order to achieve our goal, we need to logically AND the
-binary value of octet 13 with some other value to preserve
-the SYN bit.
-We know that we want SYN to be set in any case,
-so we'll logically AND the value in the 13th octet with
-the binary value of a SYN:
-.PP
-.nf
-
- 00010010 SYN-ACK 00000010 SYN
- AND 00000010 (we want SYN) AND 00000010 (we want SYN)
- -------- --------
- = 00000010 = 00000010
-.fi
-.PP
-We see that this AND operation delivers the same result
-regardless whether ACK or another TCP control bit is set.
-The decimal representation of the AND value as well as
-the result of this operation is 2 (binary 00000010),
-so we know that for packets with SYN set the following
-relation must hold true:
-.IP
-( ( value of octet 13 ) AND ( 2 ) ) == ( 2 )
-.PP
-This points us to the \fItcpdump\fP filter expression
-.RS
-.B
- tcpdump -i xl0 'tcp[13] & 2 == 2'
-.RE
-.PP
-Note that you should use single quotes or a backslash
-in the expression to hide the AND ('&') special character
-from the shell.
-.HD
-.B
-UDP Packets
-.LP
-UDP format is illustrated by this rwho packet:
-.RS
-.nf
-.sp .5
-\f(CWactinide.who > broadcast.who: udp 84\fP
-.sp .5
-.fi
-.RE
-This says that port \fIwho\fP on host \fIactinide\fP sent a udp
-datagram to port \fIwho\fP on host \fIbroadcast\fP, the Internet
-broadcast address.
-The packet contained 84 bytes of user data.
-.LP
-Some UDP services are recognized (from the source or destination
-port number) and the higher level protocol information printed.
-In particular, Domain Name service requests (RFC-1034/1035) and Sun
-RPC calls (RFC-1050) to NFS.
-.HD
-UDP Name Server Requests
-.LP
-\fI(N.B.:The following description assumes familiarity with
-the Domain Service protocol described in RFC-1035.
-If you are not familiar
-with the protocol, the following description will appear to be written
-in greek.)\fP
-.LP
-Name server requests are formatted as
-.RS
-.nf
-.sp .5
-\fIsrc > dst: id op? flags qtype qclass name (len)\fP
-.sp .5
-\f(CWh2opolo.1538 > helios.domain: 3+ A? ucbvax.berkeley.edu. (37)\fR
-.sp .5
-.fi
-.RE
-Host \fIh2opolo\fP asked the domain server on \fIhelios\fP for an
-address record (qtype=A) associated with the name \fIucbvax.berkeley.edu.\fP
-The query id was `3'.
-The `+' indicates the \fIrecursion desired\fP flag
-was set.
-The query length was 37 bytes, not including the UDP and
-IP protocol headers.
-The query operation was the normal one, \fIQuery\fP,
-so the op field was omitted.
-If the op had been anything else, it would
-have been printed between the `3' and the `+'.
-Similarly, the qclass was the normal one,
-\fIC_IN\fP, and omitted.
-Any other qclass would have been printed
-immediately after the `A'.
-.LP
-A few anomalies are checked and may result in extra fields enclosed in
-square brackets: If a query contains an answer, authority records or
-additional records section,
-.IR ancount ,
-.IR nscount ,
-or
-.I arcount
-are printed as `[\fIn\fPa]', `[\fIn\fPn]' or `[\fIn\fPau]' where \fIn\fP
-is the appropriate count.
-If any of the response bits are set (AA, RA or rcode) or any of the
-`must be zero' bits are set in bytes two and three, `[b2&3=\fIx\fP]'
-is printed, where \fIx\fP is the hex value of header bytes two and three.
-.HD
-UDP Name Server Responses
-.LP
-Name server responses are formatted as
-.RS
-.nf
-.sp .5
-\fIsrc > dst: id op rcode flags a/n/au type class data (len)\fP
-.sp .5
-\f(CWhelios.domain > h2opolo.1538: 3 3/3/7 A 128.32.137.3 (273)
-helios.domain > h2opolo.1537: 2 NXDomain* 0/1/0 (97)\fR
-.sp .5
-.fi
-.RE
-In the first example, \fIhelios\fP responds to query id 3 from \fIh2opolo\fP
-with 3 answer records, 3 name server records and 7 additional records.
-The first answer record is type A (address) and its data is internet
-address 128.32.137.3.
-The total size of the response was 273 bytes,
-excluding UDP and IP headers.
-The op (Query) and response code
-(NoError) were omitted, as was the class (C_IN) of the A record.
-.LP
-In the second example, \fIhelios\fP responds to query 2 with a
-response code of non-existent domain (NXDomain) with no answers,
-one name server and no authority records.
-The `*' indicates that
-the \fIauthoritative answer\fP bit was set.
-Since there were no
-answers, no type, class or data were printed.
-.LP
-Other flag characters that might appear are `\-' (recursion available,
-RA, \fInot\fP set) and `|' (truncated message, TC, set).
-If the
-`question' section doesn't contain exactly one entry, `[\fIn\fPq]'
-is printed.
-.LP
-Note that name server requests and responses tend to be large and the
-default \fIsnaplen\fP of 68 bytes may not capture enough of the packet
-to print.
-Use the \fB\-s\fP flag to increase the snaplen if you
-need to seriously investigate name server traffic.
-`\fB\-s 128\fP'
-has worked well for me.
-
-.HD
-SMB/CIFS decoding
-.LP
-\fItcpdump\fP now includes fairly extensive SMB/CIFS/NBT decoding for data
-on UDP/137, UDP/138 and TCP/139.
-Some primitive decoding of IPX and
-NetBEUI SMB data is also done.
-
-By default a fairly minimal decode is done, with a much more detailed
-decode done if -v is used.
-Be warned that with -v a single SMB packet
-may take up a page or more, so only use -v if you really want all the
-gory details.
-
-For information on SMB packet formats and what all te fields mean see
-www.cifs.org or the pub/samba/specs/ directory on your favorite
-samba.org mirror site.
-The SMB patches were written by Andrew Tridgell
-(tridge at samba.org).
-
-.HD
-NFS Requests and Replies
-.LP
-Sun NFS (Network File System) requests and replies are printed as:
-.RS
-.nf
-.sp .5
-\fIsrc.xid > dst.nfs: len op args\fP
-\fIsrc.nfs > dst.xid: reply stat len op results\fP
-.sp .5
-\f(CW
-sushi.6709 > wrl.nfs: 112 readlink fh 21,24/10.73165
-wrl.nfs > sushi.6709: reply ok 40 readlink "../var"
-sushi.201b > wrl.nfs:
- 144 lookup fh 9,74/4096.6878 "xcolors"
-wrl.nfs > sushi.201b:
- reply ok 128 lookup fh 9,74/4134.3150
-\fR
-.sp .5
-.fi
-.RE
-In the first line, host \fIsushi\fP sends a transaction with id \fI6709\fP
-to \fIwrl\fP (note that the number following the src host is a
-transaction id, \fInot\fP the source port).
-The request was 112 bytes,
-excluding the UDP and IP headers.
-The operation was a \fIreadlink\fP
-(read symbolic link) on file handle (\fIfh\fP) 21,24/10.731657119.
-(If one is lucky, as in this case, the file handle can be interpreted
-as a major,minor device number pair, followed by the inode number and
-generation number.)
-\fIWrl\fP replies `ok' with the contents of the link.
-.LP
-In the third line, \fIsushi\fP asks \fIwrl\fP to lookup the name
-`\fIxcolors\fP' in directory file 9,74/4096.6878.
-Note that the data printed
-depends on the operation type.
-The format is intended to be self
-explanatory if read in conjunction with
-an NFS protocol spec.
-.LP
-If the \-v (verbose) flag is given, additional information is printed.
-For example:
-.RS
-.nf
-.sp .5
-\f(CW
-sushi.1372a > wrl.nfs:
- 148 read fh 21,11/12.195 8192 bytes @ 24576
-wrl.nfs > sushi.1372a:
- reply ok 1472 read REG 100664 ids 417/0 sz 29388
-\fP
-.sp .5
-.fi
-.RE
-(\-v also prints the IP header TTL, ID, length, and fragmentation fields,
-which have been omitted from this example.) In the first line,
-\fIsushi\fP asks \fIwrl\fP to read 8192 bytes from file 21,11/12.195,
-at byte offset 24576.
-\fIWrl\fP replies `ok'; the packet shown on the
-second line is the first fragment of the reply, and hence is only 1472
-bytes long (the other bytes will follow in subsequent fragments, but
-these fragments do not have NFS or even UDP headers and so might not be
-printed, depending on the filter expression used).
-Because the \-v flag
-is given, some of the file attributes (which are returned in addition
-to the file data) are printed: the file type (``REG'', for regular file),
-the file mode (in octal), the uid and gid, and the file size.
-.LP
-If the \-v flag is given more than once, even more details are printed.
-.LP
-Note that NFS requests are very large and much of the detail won't be printed
-unless \fIsnaplen\fP is increased.
-Try using `\fB\-s 192\fP' to watch
-NFS traffic.
-.LP
-NFS reply packets do not explicitly identify the RPC operation.
-Instead,
-\fItcpdump\fP keeps track of ``recent'' requests, and matches them to the
-replies using the transaction ID.
-If a reply does not closely follow the
-corresponding request, it might not be parsable.
-.HD
-AFS Requests and Replies
-.LP
-Transarc AFS (Andrew File System) requests and replies are printed
-as:
-.HD
-.RS
-.nf
-.sp .5
-\fIsrc.sport > dst.dport: rx packet-type\fP
-\fIsrc.sport > dst.dport: rx packet-type service call call-name args\fP
-\fIsrc.sport > dst.dport: rx packet-type service reply call-name args\fP
-.sp .5
-\f(CW
-elvis.7001 > pike.afsfs:
- rx data fs call rename old fid 536876964/1/1 ".newsrc.new"
- new fid 536876964/1/1 ".newsrc"
-pike.afsfs > elvis.7001: rx data fs reply rename
-\fR
-.sp .5
-.fi
-.RE
-In the first line, host elvis sends a RX packet to pike.
-This was
-a RX data packet to the fs (fileserver) service, and is the start of
-an RPC call.
-The RPC call was a rename, with the old directory file id
-of 536876964/1/1 and an old filename of `.newsrc.new', and a new directory
-file id of 536876964/1/1 and a new filename of `.newsrc'.
-The host pike
-responds with a RPC reply to the rename call (which was successful, because
-it was a data packet and not an abort packet).
-.LP
-In general, all AFS RPCs are decoded at least by RPC call name.
-Most
-AFS RPCs have at least some of the arguments decoded (generally only
-the `interesting' arguments, for some definition of interesting).
-.LP
-The format is intended to be self-describing, but it will probably
-not be useful to people who are not familiar with the workings of
-AFS and RX.
-.LP
-If the -v (verbose) flag is given twice, acknowledgement packets and
-additional header information is printed, such as the the RX call ID,
-call number, sequence number, serial number, and the RX packet flags.
-.LP
-If the -v flag is given twice, additional information is printed,
-such as the the RX call ID, serial number, and the RX packet flags.
-The MTU negotiation information is also printed from RX ack packets.
-.LP
-If the -v flag is given three times, the security index and service id
-are printed.
-.LP
-Error codes are printed for abort packets, with the exception of Ubik
-beacon packets (because abort packets are used to signify a yes vote
-for the Ubik protocol).
-.LP
-Note that AFS requests are very large and many of the arguments won't
-be printed unless \fIsnaplen\fP is increased.
-Try using `\fB-s 256\fP'
-to watch AFS traffic.
-.LP
-AFS reply packets do not explicitly identify the RPC operation.
-Instead,
-\fItcpdump\fP keeps track of ``recent'' requests, and matches them to the
-replies using the call number and service ID.
-If a reply does not closely
-follow the
-corresponding request, it might not be parsable.
-
-.HD
-KIP AppleTalk (DDP in UDP)
-.LP
-AppleTalk DDP packets encapsulated in UDP datagrams are de-encapsulated
-and dumped as DDP packets (i.e., all the UDP header information is
-discarded).
-The file
-.I /etc/atalk.names
-is used to translate AppleTalk net and node numbers to names.
-Lines in this file have the form
-.RS
-.nf
-.sp .5
-\fInumber name\fP
-
-\f(CW1.254 ether
-16.1 icsd-net
-1.254.110 ace\fR
-.sp .5
-.fi
-.RE
-The first two lines give the names of AppleTalk networks.
-The third
-line gives the name of a particular host (a host is distinguished
-from a net by the 3rd octet in the number \-
-a net number \fImust\fP have two octets and a host number \fImust\fP
-have three octets.) The number and name should be separated by
-whitespace (blanks or tabs).
-The
-.I /etc/atalk.names
-file may contain blank lines or comment lines (lines starting with
-a `#').
-.LP
-AppleTalk addresses are printed in the form
-.RS
-.nf
-.sp .5
-\fInet.host.port\fP
-
-\f(CW144.1.209.2 > icsd-net.112.220
-office.2 > icsd-net.112.220
-jssmag.149.235 > icsd-net.2\fR
-.sp .5
-.fi
-.RE
-(If the
-.I /etc/atalk.names
-doesn't exist or doesn't contain an entry for some AppleTalk
-host/net number, addresses are printed in numeric form.)
-In the first example, NBP (DDP port 2) on net 144.1 node 209
-is sending to whatever is listening on port 220 of net icsd node 112.
-The second line is the same except the full name of the source node
-is known (`office').
-The third line is a send from port 235 on
-net jssmag node 149 to broadcast on the icsd-net NBP port (note that
-the broadcast address (255) is indicated by a net name with no host
-number \- for this reason it's a good idea to keep node names and
-net names distinct in /etc/atalk.names).
-.LP
-NBP (name binding protocol) and ATP (AppleTalk transaction protocol)
-packets have their contents interpreted.
-Other protocols just dump
-the protocol name (or number if no name is registered for the
-protocol) and packet size.
-
-\fBNBP packets\fP are formatted like the following examples:
-.RS
-.nf
-.sp .5
-\s-2\f(CWicsd-net.112.220 > jssmag.2: nbp-lkup 190: "=:LaserWriter@*"
-jssmag.209.2 > icsd-net.112.220: nbp-reply 190: "RM1140:LaserWriter@*" 250
-techpit.2 > icsd-net.112.220: nbp-reply 190: "techpit:LaserWriter@*" 186\fR\s+2
-.sp .5
-.fi
-.RE
-The first line is a name lookup request for laserwriters sent by net icsd host
-112 and broadcast on net jssmag.
-The nbp id for the lookup is 190.
-The second line shows a reply for this request (note that it has the
-same id) from host jssmag.209 saying that it has a laserwriter
-resource named "RM1140" registered on port 250.
-The third line is
-another reply to the same request saying host techpit has laserwriter
-"techpit" registered on port 186.
-
-\fBATP packet\fP formatting is demonstrated by the following example:
-.RS
-.nf
-.sp .5
-\s-2\f(CWjssmag.209.165 > helios.132: atp-req 12266<0-7> 0xae030001
-helios.132 > jssmag.209.165: atp-resp 12266:0 (512) 0xae040000
-helios.132 > jssmag.209.165: atp-resp 12266:1 (512) 0xae040000
-helios.132 > jssmag.209.165: atp-resp 12266:2 (512) 0xae040000
-helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
-helios.132 > jssmag.209.165: atp-resp 12266:4 (512) 0xae040000
-helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
-helios.132 > jssmag.209.165: atp-resp 12266:6 (512) 0xae040000
-helios.132 > jssmag.209.165: atp-resp*12266:7 (512) 0xae040000
-jssmag.209.165 > helios.132: atp-req 12266<3,5> 0xae030001
-helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
-helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
-jssmag.209.165 > helios.132: atp-rel 12266<0-7> 0xae030001
-jssmag.209.133 > helios.132: atp-req* 12267<0-7> 0xae030002\fR\s+2
-.sp .5
-.fi
-.RE
-Jssmag.209 initiates transaction id 12266 with host helios by requesting
-up to 8 packets (the `<0-7>').
-The hex number at the end of the line
-is the value of the `userdata' field in the request.
-.LP
-Helios responds with 8 512-byte packets.
-The `:digit' following the
-transaction id gives the packet sequence number in the transaction
-and the number in parens is the amount of data in the packet,
-excluding the atp header.
-The `*' on packet 7 indicates that the
-EOM bit was set.
-.LP
-Jssmag.209 then requests that packets 3 & 5 be retransmitted.
-Helios
-resends them then jssmag.209 releases the transaction.
-Finally,
-jssmag.209 initiates the next request.
-The `*' on the request
-indicates that XO (`exactly once') was \fInot\fP set.
-
-.HD
-IP Fragmentation
-.LP
-Fragmented Internet datagrams are printed as
-.RS
-.nf
-.sp .5
-\fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB+)\fR
-\fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB)\fR
-.sp .5
-.fi
-.RE
-(The first form indicates there are more fragments.
-The second
-indicates this is the last fragment.)
-.LP
-\fIId\fP is the fragment id.
-\fISize\fP is the fragment
-size (in bytes) excluding the IP header.
-\fIOffset\fP is this
-fragment's offset (in bytes) in the original datagram.
-.LP
-The fragment information is output for each fragment.
-The first
-fragment contains the higher level protocol header and the frag
-info is printed after the protocol info.
-Fragments
-after the first contain no higher level protocol header and the
-frag info is printed after the source and destination addresses.
-For example, here is part of an ftp from arizona.edu to lbl-rtsg.arpa
-over a CSNET connection that doesn't appear to handle 576 byte datagrams:
-.RS
-.nf
-.sp .5
-\s-2\f(CWarizona.ftp-data > rtsg.1170: . 1024:1332(308) ack 1 win 4096 (frag 595a:328 at 0+)
-arizona > rtsg: (frag 595a:204 at 328)
-rtsg.1170 > arizona.ftp-data: . ack 1536 win 2560\fP\s+2
-.sp .5
-.fi
-.RE
-There are a couple of things to note here: First, addresses in the
-2nd line don't include port numbers.
-This is because the TCP
-protocol information is all in the first fragment and we have no idea
-what the port or sequence numbers are when we print the later fragments.
-Second, the tcp sequence information in the first line is printed as if there
-were 308 bytes of user data when, in fact, there are 512 bytes (308 in
-the first frag and 204 in the second).
-If you are looking for holes
-in the sequence space or trying to match up acks
-with packets, this can fool you.
-.LP
-A packet with the IP \fIdon't fragment\fP flag is marked with a
-trailing \fB(DF)\fP.
-.HD
-Timestamps
-.LP
-By default, all output lines are preceded by a timestamp.
-The timestamp
-is the current clock time in the form
-.RS
-.nf
-\fIhh:mm:ss.frac\fP
-.fi
-.RE
-and is as accurate as the kernel's clock.
-The timestamp reflects the time the kernel first saw the packet.
-No attempt
-is made to account for the time lag between when the
-Ethernet interface removed the packet from the wire and when the kernel
-serviced the `new packet' interrupt.
-.SH "SEE ALSO"
-bpf(4), pcap(3)
-.SH AUTHORS
-The original authors are:
-.LP
-Van Jacobson,
-Craig Leres and
-Steven McCanne, all of the
-Lawrence Berkeley National Laboratory, University of California, Berkeley, CA.
-.LP
-It is currently being maintained by tcpdump.org.
-.LP
-The current version is available via http:
-.LP
-.RS
-.I http://www.tcpdump.org/
-.RE
-.LP
-The original distribution is available via anonymous ftp:
-.LP
-.RS
-.I ftp://ftp.ee.lbl.gov/tcpdump.tar.Z
-.RE
-.LP
-IPv6/IPsec support is added by WIDE/KAME project.
-This program uses Eric Young's SSLeay library, under specific configuration.
-.SH BUGS
-Please send problems, bugs, questions, desirable enhancements, etc. to:
-.LP
-.RS
-tcpdump-workers at tcpdump.org
-.RE
-.LP
-Please send source code contributions, etc. to:
-.LP
-.RS
-patches at tcpdump.org
-.RE
-.LP
-NIT doesn't let you watch your own outbound traffic, BPF will.
-We recommend that you use the latter.
-.LP
-When running
-.BR tcpdump
-with the
-.B \-v
-option on a network interface supporting checksum off-loading,
-IP packets sourced from this machine will have many false 'bad cksum 0' errors.
-.LP
-On Linux systems with 2.0[.x] kernels:
-.IP
-packets on the loopback device will be seen twice;
-.IP
-packet filtering cannot be done in the kernel, so that all packets must
-be copied from the kernel in order to be filtered in user mode;
-.IP
-all of a packet, not just the part that's within the snapshot length,
-will be copied from the kernel (the 2.0[.x] packet capture mechanism, if
-asked to copy only part of a packet to userland, will not report the
-true length of the packet; this would cause most IP packets to get an
-error from
-.BR tcpdump );
-.IP
-capturing on some PPP devices won't work correctly.
-.LP
-We recommend that you upgrade to a 2.2 or later kernel.
-.LP
-Some attempt should be made to reassemble IP fragments or, at least
-to compute the right length for the higher level protocol.
-.LP
-Name server inverse queries are not dumped correctly: the (empty)
-question section is printed rather than real query in the answer
-section.
-Some believe that inverse queries are themselves a bug and
-prefer to fix the program generating them rather than \fItcpdump\fP.
-.LP
-A packet trace that crosses a daylight savings time change will give
-skewed time stamps (the time change is ignored).
-.LP
-Filter expressions on fields other than those in Token Ring headers will
-not correctly handle source-routed Token Ring packets.
-.LP
-Filter expressions on fields other than those in 802.11 headers will not
-correctly handle 802.11 data packets with both To DS and From DS set.
-.LP
-.BR "ip6 proto"
-should chase header chain, but at this moment it does not.
-.BR "ip6 protochain"
-is supplied for this behavior.
-.LP
-Arithmetic expression against transport layer headers, like \fBtcp[0]\fP,
-does not work against IPv6 packets.
-It only looks at IPv4 packets.
Added: trunk/contrib/tcpdump/tcpdump.1.in
===================================================================
--- trunk/contrib/tcpdump/tcpdump.1.in (rev 0)
+++ trunk/contrib/tcpdump/tcpdump.1.in 2016-09-17 22:44:52 UTC (rev 8321)
@@ -0,0 +1,1821 @@
+.\" @(#) $Header: /tcpdump/master/tcpdump/tcpdump.1.in,v 1.2 2008-11-09 23:35:03 mcr Exp $ (LBL)
+.\"
+.\" $NetBSD: tcpdump.8,v 1.9 2003/03/31 00:18:17 perry Exp $
+.\"
+.\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
+.\" The Regents of the University of California. All rights reserved.
+.\" 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.
+.\"
+.TH TCPDUMP 1 "12 July 2012"
+.SH NAME
+tcpdump \- dump traffic on a network
+.SH SYNOPSIS
+.na
+.B tcpdump
+[
+.B \-AbdDefhHIJKlLnNOpqRStuUvxX
+] [
+.B \-B
+.I buffer_size
+] [
+.B \-c
+.I count
+]
+.br
+.ti +8
+[
+.B \-C
+.I file_size
+] [
+.B \-G
+.I rotate_seconds
+] [
+.B \-F
+.I file
+]
+.br
+.ti +8
+[
+.B \-i
+.I interface
+]
+[
+.B \-j
+.I tstamp_type
+]
+[
+.B \-m
+.I module
+]
+[
+.B \-M
+.I secret
+]
+.br
+.ti +8
+[
+.B \-r
+.I file
+]
+[
+.B \-V
+.I file
+]
+[
+.B \-s
+.I snaplen
+]
+[
+.B \-T
+.I type
+]
+[
+.B \-w
+.I file
+]
+.br
+.ti +8
+[
+.B \-W
+.I filecount
+]
+.br
+.ti +8
+[
+.B \-E
+.I spi at ipaddr algo:secret,...
+]
+.br
+.ti +8
+[
+.B \-y
+.I datalinktype
+]
+[
+.B \-z
+.I postrotate-command
+]
+[
+.B \-Z
+.I user
+]
+.ti +8
+[
+.I expression
+]
+.br
+.ad
+.SH DESCRIPTION
+.LP
+\fITcpdump\fP prints out a description of the contents of packets on a
+network interface that match the boolean \fIexpression\fP. It can also
+be run with the
+.B \-w
+flag, which causes it to save the packet data to a file for later
+analysis, and/or with the
+.B \-r
+flag, which causes it to read from a saved packet file rather than to
+read packets from a network interface. It can also be run with the
+.B \-V
+flag, which causes it to read a list of saved packet files. In all cases,
+only packets that match
+.I expression
+will be processed by
+.IR tcpdump .
+.LP
+.I Tcpdump
+will, if not run with the
+.B \-c
+flag, continue capturing packets until it is interrupted by a SIGINT
+signal (generated, for example, by typing your interrupt character,
+typically control-C) or a SIGTERM signal (typically generated with the
+.BR kill (1)
+command); if run with the
+.B \-c
+flag, it will capture packets until it is interrupted by a SIGINT or
+SIGTERM signal or the specified number of packets have been processed.
+.LP
+When
+.I tcpdump
+finishes capturing packets, it will report counts of:
+.IP
+packets ``captured'' (this is the number of packets that
+.I tcpdump
+has received and processed);
+.IP
+packets ``received by filter'' (the meaning of this depends on the OS on
+which you're running
+.IR tcpdump ,
+and possibly on the way the OS was configured - if a filter was
+specified on the command line, on some OSes it counts packets regardless
+of whether they were matched by the filter expression and, even if they
+were matched by the filter expression, regardless of whether
+.I tcpdump
+has read and processed them yet, on other OSes it counts only packets that were
+matched by the filter expression regardless of whether
+.I tcpdump
+has read and processed them yet, and on other OSes it counts only
+packets that were matched by the filter expression and were processed by
+.IR tcpdump );
+.IP
+packets ``dropped by kernel'' (this is the number of packets that were
+dropped, due to a lack of buffer space, by the packet capture mechanism
+in the OS on which
+.I tcpdump
+is running, if the OS reports that information to applications; if not,
+it will be reported as 0).
+.LP
+On platforms that support the SIGINFO signal, such as most BSDs
+(including Mac OS X) and Digital/Tru64 UNIX, it will report those counts
+when it receives a SIGINFO signal (generated, for example, by typing
+your ``status'' character, typically control-T, although on some
+platforms, such as Mac OS X, the ``status'' character is not set by
+default, so you must set it with
+.BR stty (1)
+in order to use it) and will continue capturing packets.
+.LP
+Reading packets from a network interface may require that you have
+special privileges; see the
+.B pcap (3PCAP)
+man page for details. Reading a saved packet file doesn't require
+special privileges.
+.SH OPTIONS
+.TP
+.B \-A
+Print each packet (minus its link level header) in ASCII. Handy for
+capturing web pages.
+.TP
+.B \-b
+Print the AS number in BGP packets in ASDOT notation rather than ASPLAIN
+notation.
+.TP
+.B \-B
+Set the operating system capture buffer size to \fIbuffer_size\fP, in
+units of KiB (1024 bytes).
+.TP
+.B \-c
+Exit after receiving \fIcount\fP packets.
+.TP
+.B \-C
+Before writing a raw packet to a savefile, check whether the file is
+currently larger than \fIfile_size\fP and, if so, close the current
+savefile and open a new one. Savefiles after the first savefile will
+have the name specified with the
+.B \-w
+flag, with a number after it, starting at 1 and continuing upward.
+The units of \fIfile_size\fP are millions of bytes (1,000,000 bytes,
+not 1,048,576 bytes).
+.TP
+.B \-d
+Dump the compiled packet-matching code in a human readable form to
+standard output and stop.
+.TP
+.B \-dd
+Dump packet-matching code as a
+.B C
+program fragment.
+.TP
+.B \-ddd
+Dump packet-matching code as decimal numbers (preceded with a count).
+.TP
+.B \-D
+Print the list of the network interfaces available on the system and on
+which
+.I tcpdump
+can capture packets. For each network interface, a number and an
+interface name, possibly followed by a text description of the
+interface, is printed. The interface name or the number can be supplied
+to the
+.B \-i
+flag to specify an interface on which to capture.
+.IP
+This can be useful on systems that don't have a command to list them
+(e.g., Windows systems, or UNIX systems lacking
+.BR "ifconfig \-a" );
+the number can be useful on Windows 2000 and later systems, where the
+interface name is a somewhat complex string.
+.IP
+The
+.B \-D
+flag will not be supported if
+.I tcpdump
+was built with an older version of
+.I libpcap
+that lacks the
+.B pcap_findalldevs()
+function.
+.TP
+.B \-e
+Print the link-level header on each dump line. This can be used, for
+example, to print MAC layer addresses for protocols such as Ethernet and
+IEEE 802.11.
+.TP
+.B \-E
+Use \fIspi at ipaddr algo:secret\fP for decrypting IPsec ESP packets that
+are addressed to \fIaddr\fP and contain Security Parameter Index value
+\fIspi\fP. This combination may be repeated with comma or newline separation.
+.IP
+Note that setting the secret for IPv4 ESP packets is supported at this time.
+.IP
+Algorithms may be
+\fBdes-cbc\fP,
+\fB3des-cbc\fP,
+\fBblowfish-cbc\fP,
+\fBrc3-cbc\fP,
+\fBcast128-cbc\fP, or
+\fBnone\fP.
+The default is \fBdes-cbc\fP.
+The ability to decrypt packets is only present if \fItcpdump\fP was compiled
+with cryptography enabled.
+.IP
+\fIsecret\fP is the ASCII text for ESP secret key.
+If preceded by 0x, then a hex value will be read.
+.IP
+The option assumes RFC2406 ESP, not RFC1827 ESP.
+The option is only for debugging purposes, and
+the use of this option with a true `secret' key is discouraged.
+By presenting IPsec secret key onto command line
+you make it visible to others, via
+.IR ps (1)
+and other occasions.
+.IP
+In addition to the above syntax, the syntax \fIfile name\fP may be used
+to have tcpdump read the provided file in. The file is opened upon
+receiving the first ESP packet, so any special permissions that tcpdump
+may have been given should already have been given up.
+.TP
+.B \-f
+Print `foreign' IPv4 addresses numerically rather than symbolically
+(this option is intended to get around serious brain damage in
+Sun's NIS server \(em usually it hangs forever translating non-local
+internet numbers).
+.IP
+The test for `foreign' IPv4 addresses is done using the IPv4 address and
+netmask of the interface on which capture is being done. If that
+address or netmask are not available, available, either because the
+interface on which capture is being done has no address or netmask or
+because the capture is being done on the Linux "any" interface, which
+can capture on more than one interface, this option will not work
+correctly.
+.TP
+.B \-F
+Use \fIfile\fP as input for the filter expression.
+An additional expression given on the command line is ignored.
+.TP
+.B \-G
+If specified, rotates the dump file specified with the
+.B \-w
+option every \fIrotate_seconds\fP seconds.
+Savefiles will have the name specified by
+.B \-w
+which should include a time format as defined by
+.BR strftime (3).
+If no time format is specified, each new file will overwrite the previous.
+.IP
+If used in conjunction with the
+.B \-C
+option, filenames will take the form of `\fIfile\fP<count>'.
+.TP
+.B \-h
+Print the tcpdump and libpcap version strings, print a usage message,
+and exit.
+.TP
+.B \-H
+Attempt to detect 802.11s draft mesh headers.
+.TP
+.B \-i
+Listen on \fIinterface\fP.
+If unspecified, \fItcpdump\fP searches the system interface list for the
+lowest numbered, configured up interface (excluding loopback).
+Ties are broken by choosing the earliest match.
+.IP
+On Linux systems with 2.2 or later kernels, an
+.I interface
+argument of ``any'' can be used to capture packets from all interfaces.
+Note that captures on the ``any'' device will not be done in promiscuous
+mode.
+.IP
+If the
+.B \-D
+flag is supported, an interface number as printed by that flag can be
+used as the
+.I interface
+argument.
+.TP
+.B \-I
+Put the interface in "monitor mode"; this is supported only on IEEE
+802.11 Wi-Fi interfaces, and supported only on some operating systems.
+.IP
+Note that in monitor mode the adapter might disassociate from the
+network with which it's associated, so that you will not be able to use
+any wireless networks with that adapter. This could prevent accessing
+files on a network server, or resolving host names or network addresses,
+if you are capturing in monitor mode and are not connected to another
+network with another adapter.
+.IP
+This flag will affect the output of the
+.B \-L
+flag. If
+.B \-I
+isn't specified, only those link-layer types available when not in
+monitor mode will be shown; if
+.B \-I
+is specified, only those link-layer types available when in monitor mode
+will be shown.
+.TP
+.B \-j
+Set the time stamp type for the capture to \fItstamp_type\fP. The names
+to use for the time stamp types are given in
+.BR pcap-tstamp-type (@MAN_MISC_INFO@);
+not all the types listed there will necessarily be valid for any given
+interface.
+.TP
+.B \-J
+List the supported time stamp types for the interface and exit. If the
+time stamp type cannot be set for the interface, no time stamp types are
+listed.
+.TP
+.B \-K
+Don't attempt to verify IP, TCP, or UDP checksums. This is useful for
+interfaces that perform some or all of those checksum calculation in
+hardware; otherwise, all outgoing TCP checksums will be flagged as bad.
+.TP
+.B \-l
+Make stdout line buffered.
+Useful if you want to see the data
+while capturing it.
+E.g.,
+.IP
+.RS
+.RS
+.nf
+\fBtcpdump \-l | tee dat\fP
+.fi
+.RE
+.RE
+.IP
+or
+.IP
+.RS
+.RS
+.nf
+\fBtcpdump \-l > dat & tail \-f dat\fP
+.fi
+.RE
+.RE
+.IP
+Note that on Windows,``line buffered'' means ``unbuffered'', so that
+WinDump will write each character individually if
+.B \-l
+is specified.
+.IP
+.B \-U
+is similar to
+.B \-l
+in its behavior, but it will cause output to be ``packet-buffered'', so
+that the output is written to stdout at the end of each packet rather
+than at the end of each line; this is buffered on all platforms,
+including Windows.
+.TP
+.B \-L
+List the known data link types for the interface, in the specified mode,
+and exit. The list of known data link types may be dependent on the
+specified mode; for example, on some platforms, a Wi-Fi interface might
+support one set of data link types when not in monitor mode (for
+example, it might support only fake Ethernet headers, or might support
+802.11 headers but not support 802.11 headers with radio information)
+and another set of data link types when in monitor mode (for example, it
+might support 802.11 headers, or 802.11 headers with radio information,
+only in monitor mode).
+.TP
+.B \-m
+Load SMI MIB module definitions from file \fImodule\fR.
+This option
+can be used several times to load several MIB modules into \fItcpdump\fP.
+.TP
+.B \-M
+Use \fIsecret\fP as a shared secret for validating the digests found in
+TCP segments with the TCP-MD5 option (RFC 2385), if present.
+.TP
+.B \-n
+Don't convert addresses (i.e., host addresses, port numbers, etc.) to names.
+.TP
+.B \-N
+Don't print domain name qualification of host names.
+E.g.,
+if you give this flag then \fItcpdump\fP will print ``nic''
+instead of ``nic.ddn.mil''.
+.TP
+.B \-O
+Do not run the packet-matching code optimizer.
+This is useful only
+if you suspect a bug in the optimizer.
+.TP
+.B \-p
+\fIDon't\fP put the interface
+into promiscuous mode.
+Note that the interface might be in promiscuous
+mode for some other reason; hence, `-p' cannot be used as an abbreviation for
+`ether host {local-hw-addr} or ether broadcast'.
+.TP
+.B \-q
+Quick (quiet?) output.
+Print less protocol information so output
+lines are shorter.
+.TP
+.B \-R
+Assume ESP/AH packets to be based on old specification (RFC1825 to RFC1829).
+If specified, \fItcpdump\fP will not print replay prevention field.
+Since there is no protocol version field in ESP/AH specification,
+\fItcpdump\fP cannot deduce the version of ESP/AH protocol.
+.TP
+.B \-r
+Read packets from \fIfile\fR (which was created with the
+.B \-w
+option).
+Standard input is used if \fIfile\fR is ``-''.
+.TP
+.B \-S
+Print absolute, rather than relative, TCP sequence numbers.
+.TP
+.B \-s
+Snarf \fIsnaplen\fP bytes of data from each packet rather than the
+default of 65535 bytes.
+Packets truncated because of a limited snapshot
+are indicated in the output with ``[|\fIproto\fP]'', where \fIproto\fP
+is the name of the protocol level at which the truncation has occurred.
+Note that taking larger snapshots both increases
+the amount of time it takes to process packets and, effectively,
+decreases the amount of packet buffering.
+This may cause packets to be
+lost.
+You should limit \fIsnaplen\fP to the smallest number that will
+capture the protocol information you're interested in.
+Setting
+\fIsnaplen\fP to 0 sets it to the default of 65535,
+for backwards compatibility with recent older versions of
+.IR tcpdump .
+.TP
+.B \-T
+Force packets selected by "\fIexpression\fP" to be interpreted the
+specified \fItype\fR.
+Currently known types are
+\fBaodv\fR (Ad-hoc On-demand Distance Vector protocol),
+\fBcarp\fR (Common Address Redundancy Protocol),
+\fBcnfp\fR (Cisco NetFlow protocol),
+\fBradius\fR (RADIUS),
+\fBrpc\fR (Remote Procedure Call),
+\fBrtp\fR (Real-Time Applications protocol),
+\fBrtcp\fR (Real-Time Applications control protocol),
+\fBsnmp\fR (Simple Network Management Protocol),
+\fBtftp\fR (Trivial File Transfer Protocol),
+\fBvat\fR (Visual Audio Tool),
+\fBwb\fR (distributed White Board),
+\fBzmtp1\fR (ZeroMQ Message Transport Protocol 1.0)
+and
+\fBvxlan\fR (Virtual eXtensible Local Area Network).
+.TP
+.B \-t
+\fIDon't\fP print a timestamp on each dump line.
+.TP
+.B \-tt
+Print an unformatted timestamp on each dump line.
+.TP
+.B \-ttt
+Print a delta (micro-second resolution) between current and previous line
+on each dump line.
+.TP
+.B \-tttt
+Print a timestamp in default format proceeded by date on each dump line.
+.TP
+.B \-ttttt
+Print a delta (micro-second resolution) between current and first line
+on each dump line.
+.TP
+.B \-u
+Print undecoded NFS handles.
+.TP
+.B \-U
+If the
+.B \-w
+option is not specified, make the printed packet output
+``packet-buffered''; i.e., as the description of the contents of each
+packet is printed, it will be written to the standard output, rather
+than, when not writing to a terminal, being written only when the output
+buffer fills.
+.IP
+If the
+.B \-w
+option is specified, make the saved raw packet output
+``packet-buffered''; i.e., as each packet is saved, it will be written
+to the output file, rather than being written only when the output
+buffer fills.
+.IP
+The
+.B \-U
+flag will not be supported if
+.I tcpdump
+was built with an older version of
+.I libpcap
+that lacks the
+.B pcap_dump_flush()
+function.
+.TP
+.B \-v
+When parsing and printing, produce (slightly more) verbose output.
+For example, the time to live,
+identification, total length and options in an IP packet are printed.
+Also enables additional packet integrity checks such as verifying the
+IP and ICMP header checksum.
+.IP
+When writing to a file with the
+.B \-w
+option, report, every 10 seconds, the number of packets captured.
+.TP
+.B \-vv
+Even more verbose output.
+For example, additional fields are
+printed from NFS reply packets, and SMB packets are fully decoded.
+.TP
+.B \-vvv
+Even more verbose output.
+For example,
+telnet \fBSB\fP ... \fBSE\fP options
+are printed in full.
+With
+.B \-X
+Telnet options are printed in hex as well.
+.TP
+.B \-V
+Read a list of filenames from \fIfile\fR. Standard input is used
+if \fIfile\fR is ``-''.
+.TP
+.B \-w
+Write the raw packets to \fIfile\fR rather than parsing and printing
+them out.
+They can later be printed with the \-r option.
+Standard output is used if \fIfile\fR is ``-''.
+.IP
+This output will be buffered if written to a file or pipe, so a program
+reading from the file or pipe may not see packets for an arbitrary
+amount of time after they are received. Use the
+.B \-U
+flag to cause packets to be written as soon as they are received.
+.IP
+The MIME type \fIapplication/vnd.tcpdump.pcap\fP has been registered
+with IANA for \fIpcap\fP files. The filename extension \fI.pcap\fP
+appears to be the most commonly used along with \fI.cap\fP and
+\fI.dmp\fP. \fITcpdump\fP itself doesn't check the extension when
+reading capture files and doesn't add an extension when writing them
+(it uses magic numbers in the file header instead). However, many
+operating systems and applications will use the extension if it is
+present and adding one (e.g. .pcap) is recommended.
+.IP
+See
+.BR pcap-savefile (@MAN_FILE_FORMATS@)
+for a description of the file format.
+.TP
+.B \-W
+Used in conjunction with the
+.B \-C
+option, this will limit the number
+of files created to the specified number, and begin overwriting files
+from the beginning, thus creating a 'rotating' buffer.
+In addition, it will name
+the files with enough leading 0s to support the maximum number of
+files, allowing them to sort correctly.
+.IP
+Used in conjunction with the
+.B \-G
+option, this will limit the number of rotated dump files that get
+created, exiting with status 0 when reaching the limit. If used with
+.B \-C
+as well, the behavior will result in cyclical files per timeslice.
+.TP
+.B \-x
+When parsing and printing,
+in addition to printing the headers of each packet, print the data of
+each packet (minus its link level header) in hex.
+The smaller of the entire packet or
+.I snaplen
+bytes will be printed. Note that this is the entire link-layer
+packet, so for link layers that pad (e.g. Ethernet), the padding bytes
+will also be printed when the higher layer packet is shorter than the
+required padding.
+.TP
+.B \-xx
+When parsing and printing,
+in addition to printing the headers of each packet, print the data of
+each packet,
+.I including
+its link level header, in hex.
+.TP
+.B \-X
+When parsing and printing,
+in addition to printing the headers of each packet, print the data of
+each packet (minus its link level header) in hex and ASCII.
+This is very handy for analysing new protocols.
+.TP
+.B \-XX
+When parsing and printing,
+in addition to printing the headers of each packet, print the data of
+each packet,
+.I including
+its link level header, in hex and ASCII.
+.TP
+.B \-y
+Set the data link type to use while capturing packets to \fIdatalinktype\fP.
+.TP
+.B \-z
+Used in conjunction with the
+.B -C
+or
+.B -G
+options, this will make
+.I tcpdump
+run "
+.I command file
+" where
+.I file
+is the savefile being closed after each rotation. For example, specifying
+.B \-z gzip
+or
+.B \-z bzip2
+will compress each savefile using gzip or bzip2.
+.IP
+Note that tcpdump will run the command in parallel to the capture, using
+the lowest priority so that this doesn't disturb the capture process.
+.IP
+And in case you would like to use a command that itself takes flags or
+different arguments, you can always write a shell script that will take the
+savefile name as the only argument, make the flags & arguments arrangements
+and execute the command that you want.
+.TP
+.B \-Z
+If
+.I tcpdump
+is running as root, after opening the capture device or input savefile,
+but before opening any savefiles for output, change the user ID to
+.I user
+and the group ID to the primary group of
+.IR user .
+.IP
+This behavior can also be enabled by default at compile time.
+.IP "\fI expression\fP"
+.RS
+selects which packets will be dumped.
+If no \fIexpression\fP
+is given, all packets on the net will be dumped.
+Otherwise,
+only packets for which \fIexpression\fP is `true' will be dumped.
+.LP
+For the \fIexpression\fP syntax, see
+.BR pcap-filter (@MAN_MISC_INFO@).
+.LP
+Expression arguments can be passed to \fItcpdump\fP as either a single
+argument or as multiple arguments, whichever is more convenient.
+Generally, if the expression contains Shell metacharacters, such as
+backslashes used to escape protocol names, it is easier to pass it as
+a single, quoted argument rather than to escape the Shell
+metacharacters.
+Multiple arguments are concatenated with spaces before being parsed.
+.SH EXAMPLES
+.LP
+To print all packets arriving at or departing from \fIsundown\fP:
+.RS
+.nf
+\fBtcpdump host sundown\fP
+.fi
+.RE
+.LP
+To print traffic between \fIhelios\fR and either \fIhot\fR or \fIace\fR:
+.RS
+.nf
+\fBtcpdump host helios and \\( hot or ace \\)\fP
+.fi
+.RE
+.LP
+To print all IP packets between \fIace\fR and any host except \fIhelios\fR:
+.RS
+.nf
+\fBtcpdump ip host ace and not helios\fP
+.fi
+.RE
+.LP
+To print all traffic between local hosts and hosts at Berkeley:
+.RS
+.nf
+.B
+tcpdump net ucb-ether
+.fi
+.RE
+.LP
+To print all ftp traffic through internet gateway \fIsnup\fP:
+(note that the expression is quoted to prevent the shell from
+(mis-)interpreting the parentheses):
+.RS
+.nf
+.B
+tcpdump 'gateway snup and (port ftp or ftp-data)'
+.fi
+.RE
+.LP
+To print traffic neither sourced from nor destined for local hosts
+(if you gateway to one other net, this stuff should never make it
+onto your local net).
+.RS
+.nf
+.B
+tcpdump ip and not net \fIlocalnet\fP
+.fi
+.RE
+.LP
+To print the start and end packets (the SYN and FIN packets) of each
+TCP conversation that involves a non-local host.
+.RS
+.nf
+.B
+tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net \fIlocalnet\fP'
+.fi
+.RE
+.LP
+To print all IPv4 HTTP packets to and from port 80, i.e. print only
+packets that contain data, not, for example, SYN and FIN packets and
+ACK-only packets. (IPv6 is left as an exercise for the reader.)
+.RS
+.nf
+.B
+tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
+.fi
+.RE
+.LP
+To print IP packets longer than 576 bytes sent through gateway \fIsnup\fP:
+.RS
+.nf
+.B
+tcpdump 'gateway snup and ip[2:2] > 576'
+.fi
+.RE
+.LP
+To print IP broadcast or multicast packets that were
+.I not
+sent via Ethernet broadcast or multicast:
+.RS
+.nf
+.B
+tcpdump 'ether[0] & 1 = 0 and ip[16] >= 224'
+.fi
+.RE
+.LP
+To print all ICMP packets that are not echo requests/replies (i.e., not
+ping packets):
+.RS
+.nf
+.B
+tcpdump 'icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply'
+.fi
+.RE
+.SH OUTPUT FORMAT
+.LP
+The output of \fItcpdump\fP is protocol dependent.
+The following
+gives a brief description and examples of most of the formats.
+.de HD
+.sp 1.5
+.B
+..
+.HD
+Link Level Headers
+.LP
+If the '-e' option is given, the link level header is printed out.
+On Ethernets, the source and destination addresses, protocol,
+and packet length are printed.
+.LP
+On FDDI networks, the '-e' option causes \fItcpdump\fP to print
+the `frame control' field, the source and destination addresses,
+and the packet length.
+(The `frame control' field governs the
+interpretation of the rest of the packet.
+Normal packets (such
+as those containing IP datagrams) are `async' packets, with a priority
+value between 0 and 7; for example, `\fBasync4\fR'.
+Such packets
+are assumed to contain an 802.2 Logical Link Control (LLC) packet;
+the LLC header is printed if it is \fInot\fR an ISO datagram or a
+so-called SNAP packet.
+.LP
+On Token Ring networks, the '-e' option causes \fItcpdump\fP to print
+the `access control' and `frame control' fields, the source and
+destination addresses, and the packet length.
+As on FDDI networks,
+packets are assumed to contain an LLC packet.
+Regardless of whether
+the '-e' option is specified or not, the source routing information is
+printed for source-routed packets.
+.LP
+On 802.11 networks, the '-e' option causes \fItcpdump\fP to print
+the `frame control' fields, all of the addresses in the 802.11 header,
+and the packet length.
+As on FDDI networks,
+packets are assumed to contain an LLC packet.
+.LP
+\fI(N.B.: The following description assumes familiarity with
+the SLIP compression algorithm described in RFC-1144.)\fP
+.LP
+On SLIP links, a direction indicator (``I'' for inbound, ``O'' for outbound),
+packet type, and compression information are printed out.
+The packet type is printed first.
+The three types are \fIip\fP, \fIutcp\fP, and \fIctcp\fP.
+No further link information is printed for \fIip\fR packets.
+For TCP packets, the connection identifier is printed following the type.
+If the packet is compressed, its encoded header is printed out.
+The special cases are printed out as
+\fB*S+\fIn\fR and \fB*SA+\fIn\fR, where \fIn\fR is the amount by which
+the sequence number (or sequence number and ack) has changed.
+If it is not a special case,
+zero or more changes are printed.
+A change is indicated by U (urgent pointer), W (window), A (ack),
+S (sequence number), and I (packet ID), followed by a delta (+n or -n),
+or a new value (=n).
+Finally, the amount of data in the packet and compressed header length
+are printed.
+.LP
+For example, the following line shows an outbound compressed TCP packet,
+with an implicit connection identifier; the ack has changed by 6,
+the sequence number by 49, and the packet ID by 6; there are 3 bytes of
+data and 6 bytes of compressed header:
+.RS
+.nf
+\fBO ctcp * A+6 S+49 I+6 3 (6)\fP
+.fi
+.RE
+.HD
+ARP/RARP Packets
+.LP
+Arp/rarp output shows the type of request and its arguments.
+The
+format is intended to be self explanatory.
+Here is a short sample taken from the start of an `rlogin' from
+host \fIrtsg\fP to host \fIcsam\fP:
+.RS
+.nf
+.sp .5
+\f(CWarp who-has csam tell rtsg
+arp reply csam is-at CSAM\fR
+.sp .5
+.fi
+.RE
+The first line says that rtsg sent an arp packet asking
+for the Ethernet address of internet host csam.
+Csam
+replies with its Ethernet address (in this example, Ethernet addresses
+are in caps and internet addresses in lower case).
+.LP
+This would look less redundant if we had done \fItcpdump \-n\fP:
+.RS
+.nf
+.sp .5
+\f(CWarp who-has 128.3.254.6 tell 128.3.254.68
+arp reply 128.3.254.6 is-at 02:07:01:00:01:c4\fP
+.fi
+.RE
+.LP
+If we had done \fItcpdump \-e\fP, the fact that the first packet is
+broadcast and the second is point-to-point would be visible:
+.RS
+.nf
+.sp .5
+\f(CWRTSG Broadcast 0806 64: arp who-has csam tell rtsg
+CSAM RTSG 0806 64: arp reply csam is-at CSAM\fR
+.sp .5
+.fi
+.RE
+For the first packet this says the Ethernet source address is RTSG, the
+destination is the Ethernet broadcast address, the type field
+contained hex 0806 (type ETHER_ARP) and the total length was 64 bytes.
+.HD
+TCP Packets
+.LP
+\fI(N.B.:The following description assumes familiarity with
+the TCP protocol described in RFC-793.
+If you are not familiar
+with the protocol, neither this description nor \fItcpdump\fP will
+be of much use to you.)\fP
+.LP
+The general format of a tcp protocol line is:
+.RS
+.nf
+.sp .5
+\fIsrc > dst: flags data-seqno ack window urgent options\fP
+.sp .5
+.fi
+.RE
+\fISrc\fP and \fIdst\fP are the source and destination IP
+addresses and ports.
+\fIFlags\fP are some combination of S (SYN),
+F (FIN), P (PUSH), R (RST), U (URG), W (ECN CWR), E (ECN-Echo) or
+`.' (ACK), or `none' if no flags are set.
+\fIData-seqno\fP describes the portion of sequence space covered
+by the data in this packet (see example below).
+\fIAck\fP is sequence number of the next data expected the other
+direction on this connection.
+\fIWindow\fP is the number of bytes of receive buffer space available
+the other direction on this connection.
+\fIUrg\fP indicates there is `urgent' data in the packet.
+\fIOptions\fP are tcp options enclosed in angle brackets (e.g., <mss 1024>).
+.LP
+\fISrc, dst\fP and \fIflags\fP are always present.
+The other fields
+depend on the contents of the packet's tcp protocol header and
+are output only if appropriate.
+.LP
+Here is the opening portion of an rlogin from host \fIrtsg\fP to
+host \fIcsam\fP.
+.RS
+.nf
+.sp .5
+\s-2\f(CWrtsg.1023 > csam.login: S 768512:768512(0) win 4096 <mss 1024>
+csam.login > rtsg.1023: S 947648:947648(0) ack 768513 win 4096 <mss 1024>
+rtsg.1023 > csam.login: . ack 1 win 4096
+rtsg.1023 > csam.login: P 1:2(1) ack 1 win 4096
+csam.login > rtsg.1023: . ack 2 win 4096
+rtsg.1023 > csam.login: P 2:21(19) ack 1 win 4096
+csam.login > rtsg.1023: P 1:2(1) ack 21 win 4077
+csam.login > rtsg.1023: P 2:3(1) ack 21 win 4077 urg 1
+csam.login > rtsg.1023: P 3:4(1) ack 21 win 4077 urg 1\fR\s+2
+.sp .5
+.fi
+.RE
+The first line says that tcp port 1023 on rtsg sent a packet
+to port \fIlogin\fP
+on csam.
+The \fBS\fP indicates that the \fISYN\fP flag was set.
+The packet sequence number was 768512 and it contained no data.
+(The notation is `first:last(nbytes)' which means `sequence
+numbers \fIfirst\fP
+up to but not including \fIlast\fP which is \fInbytes\fP bytes of user data'.)
+There was no piggy-backed ack, the available receive window was 4096
+bytes and there was a max-segment-size option requesting an mss of
+1024 bytes.
+.LP
+Csam replies with a similar packet except it includes a piggy-backed
+ack for rtsg's SYN.
+Rtsg then acks csam's SYN.
+The `.' means the ACK flag was set.
+The packet contained no data so there is no data sequence number.
+Note that the ack sequence
+number is a small integer (1).
+The first time \fItcpdump\fP sees a
+tcp `conversation', it prints the sequence number from the packet.
+On subsequent packets of the conversation, the difference between
+the current packet's sequence number and this initial sequence number
+is printed.
+This means that sequence numbers after the
+first can be interpreted
+as relative byte positions in the conversation's data stream (with the
+first data byte each direction being `1').
+`-S' will override this
+feature, causing the original sequence numbers to be output.
+.LP
+On the 6th line, rtsg sends csam 19 bytes of data (bytes 2 through 20
+in the rtsg \(-> csam side of the conversation).
+The PUSH flag is set in the packet.
+On the 7th line, csam says it's received data sent by rtsg up to
+but not including byte 21.
+Most of this data is apparently sitting in the
+socket buffer since csam's receive window has gotten 19 bytes smaller.
+Csam also sends one byte of data to rtsg in this packet.
+On the 8th and 9th lines,
+csam sends two bytes of urgent, pushed data to rtsg.
+.LP
+If the snapshot was small enough that \fItcpdump\fP didn't capture
+the full TCP header, it interprets as much of the header as it can
+and then reports ``[|\fItcp\fP]'' to indicate the remainder could not
+be interpreted.
+If the header contains a bogus option (one with a length
+that's either too small or beyond the end of the header), \fItcpdump\fP
+reports it as ``[\fIbad opt\fP]'' and does not interpret any further
+options (since it's impossible to tell where they start).
+If the header
+length indicates options are present but the IP datagram length is not
+long enough for the options to actually be there, \fItcpdump\fP reports
+it as ``[\fIbad hdr length\fP]''.
+.HD
+.B Capturing TCP packets with particular flag combinations (SYN-ACK, URG-ACK, etc.)
+.PP
+There are 8 bits in the control bits section of the TCP header:
+.IP
+.I CWR | ECE | URG | ACK | PSH | RST | SYN | FIN
+.PP
+Let's assume that we want to watch packets used in establishing
+a TCP connection.
+Recall that TCP uses a 3-way handshake protocol
+when it initializes a new connection; the connection sequence with
+regard to the TCP control bits is
+.PP
+.RS
+1) Caller sends SYN
+.RE
+.RS
+2) Recipient responds with SYN, ACK
+.RE
+.RS
+3) Caller sends ACK
+.RE
+.PP
+Now we're interested in capturing packets that have only the
+SYN bit set (Step 1).
+Note that we don't want packets from step 2
+(SYN-ACK), just a plain initial SYN.
+What we need is a correct filter
+expression for \fItcpdump\fP.
+.PP
+Recall the structure of a TCP header without options:
+.PP
+.nf
+ 0 15 31
+-----------------------------------------------------------------
+| source port | destination port |
+-----------------------------------------------------------------
+| sequence number |
+-----------------------------------------------------------------
+| acknowledgment number |
+-----------------------------------------------------------------
+| HL | rsvd |C|E|U|A|P|R|S|F| window size |
+-----------------------------------------------------------------
+| TCP checksum | urgent pointer |
+-----------------------------------------------------------------
+.fi
+.PP
+A TCP header usually holds 20 octets of data, unless options are
+present.
+The first line of the graph contains octets 0 - 3, the
+second line shows octets 4 - 7 etc.
+.PP
+Starting to count with 0, the relevant TCP control bits are contained
+in octet 13:
+.PP
+.nf
+ 0 7| 15| 23| 31
+----------------|---------------|---------------|----------------
+| HL | rsvd |C|E|U|A|P|R|S|F| window size |
+----------------|---------------|---------------|----------------
+| | 13th octet | | |
+.fi
+.PP
+Let's have a closer look at octet no. 13:
+.PP
+.nf
+ | |
+ |---------------|
+ |C|E|U|A|P|R|S|F|
+ |---------------|
+ |7 5 3 0|
+.fi
+.PP
+These are the TCP control bits we are interested
+in.
+We have numbered the bits in this octet from 0 to 7, right to
+left, so the PSH bit is bit number 3, while the URG bit is number 5.
+.PP
+Recall that we want to capture packets with only SYN set.
+Let's see what happens to octet 13 if a TCP datagram arrives
+with the SYN bit set in its header:
+.PP
+.nf
+ |C|E|U|A|P|R|S|F|
+ |---------------|
+ |0 0 0 0 0 0 1 0|
+ |---------------|
+ |7 6 5 4 3 2 1 0|
+.fi
+.PP
+Looking at the
+control bits section we see that only bit number 1 (SYN) is set.
+.PP
+Assuming that octet number 13 is an 8-bit unsigned integer in
+network byte order, the binary value of this octet is
+.IP
+00000010
+.PP
+and its decimal representation is
+.PP
+.nf
+ 7 6 5 4 3 2 1 0
+0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 0*2 + 1*2 + 0*2 = 2
+.fi
+.PP
+We're almost done, because now we know that if only SYN is set,
+the value of the 13th octet in the TCP header, when interpreted
+as a 8-bit unsigned integer in network byte order, must be exactly 2.
+.PP
+This relationship can be expressed as
+.RS
+.B
+tcp[13] == 2
+.RE
+.PP
+We can use this expression as the filter for \fItcpdump\fP in order
+to watch packets which have only SYN set:
+.RS
+.B
+tcpdump -i xl0 tcp[13] == 2
+.RE
+.PP
+The expression says "let the 13th octet of a TCP datagram have
+the decimal value 2", which is exactly what we want.
+.PP
+Now, let's assume that we need to capture SYN packets, but we
+don't care if ACK or any other TCP control bit is set at the
+same time.
+Let's see what happens to octet 13 when a TCP datagram
+with SYN-ACK set arrives:
+.PP
+.nf
+ |C|E|U|A|P|R|S|F|
+ |---------------|
+ |0 0 0 1 0 0 1 0|
+ |---------------|
+ |7 6 5 4 3 2 1 0|
+.fi
+.PP
+Now bits 1 and 4 are set in the 13th octet.
+The binary value of
+octet 13 is
+.IP
+ 00010010
+.PP
+which translates to decimal
+.PP
+.nf
+ 7 6 5 4 3 2 1 0
+0*2 + 0*2 + 0*2 + 1*2 + 0*2 + 0*2 + 1*2 + 0*2 = 18
+.fi
+.PP
+Now we can't just use 'tcp[13] == 18' in the \fItcpdump\fP filter
+expression, because that would select only those packets that have
+SYN-ACK set, but not those with only SYN set.
+Remember that we don't care
+if ACK or any other control bit is set as long as SYN is set.
+.PP
+In order to achieve our goal, we need to logically AND the
+binary value of octet 13 with some other value to preserve
+the SYN bit.
+We know that we want SYN to be set in any case,
+so we'll logically AND the value in the 13th octet with
+the binary value of a SYN:
+.PP
+.nf
+
+ 00010010 SYN-ACK 00000010 SYN
+ AND 00000010 (we want SYN) AND 00000010 (we want SYN)
+ -------- --------
+ = 00000010 = 00000010
+.fi
+.PP
+We see that this AND operation delivers the same result
+regardless whether ACK or another TCP control bit is set.
+The decimal representation of the AND value as well as
+the result of this operation is 2 (binary 00000010),
+so we know that for packets with SYN set the following
+relation must hold true:
+.IP
+( ( value of octet 13 ) AND ( 2 ) ) == ( 2 )
+.PP
+This points us to the \fItcpdump\fP filter expression
+.RS
+.B
+ tcpdump -i xl0 'tcp[13] & 2 == 2'
+.RE
+.PP
+Some offsets and field values may be expressed as names
+rather than as numeric values. For example tcp[13] may
+be replaced with tcp[tcpflags]. The following TCP flag
+field values are also available: tcp-fin, tcp-syn, tcp-rst,
+tcp-push, tcp-act, tcp-urg.
+.PP
+This can be demonstrated as:
+.RS
+.B
+ tcpdump -i xl0 'tcp[tcpflags] & tcp-push != 0'
+.RE
+.PP
+Note that you should use single quotes or a backslash
+in the expression to hide the AND ('&') special character
+from the shell.
+.HD
+.B
+UDP Packets
+.LP
+UDP format is illustrated by this rwho packet:
+.RS
+.nf
+.sp .5
+\f(CWactinide.who > broadcast.who: udp 84\fP
+.sp .5
+.fi
+.RE
+This says that port \fIwho\fP on host \fIactinide\fP sent a udp
+datagram to port \fIwho\fP on host \fIbroadcast\fP, the Internet
+broadcast address.
+The packet contained 84 bytes of user data.
+.LP
+Some UDP services are recognized (from the source or destination
+port number) and the higher level protocol information printed.
+In particular, Domain Name service requests (RFC-1034/1035) and Sun
+RPC calls (RFC-1050) to NFS.
+.HD
+UDP Name Server Requests
+.LP
+\fI(N.B.:The following description assumes familiarity with
+the Domain Service protocol described in RFC-1035.
+If you are not familiar
+with the protocol, the following description will appear to be written
+in greek.)\fP
+.LP
+Name server requests are formatted as
+.RS
+.nf
+.sp .5
+\fIsrc > dst: id op? flags qtype qclass name (len)\fP
+.sp .5
+\f(CWh2opolo.1538 > helios.domain: 3+ A? ucbvax.berkeley.edu. (37)\fR
+.sp .5
+.fi
+.RE
+Host \fIh2opolo\fP asked the domain server on \fIhelios\fP for an
+address record (qtype=A) associated with the name \fIucbvax.berkeley.edu.\fP
+The query id was `3'.
+The `+' indicates the \fIrecursion desired\fP flag
+was set.
+The query length was 37 bytes, not including the UDP and
+IP protocol headers.
+The query operation was the normal one, \fIQuery\fP,
+so the op field was omitted.
+If the op had been anything else, it would
+have been printed between the `3' and the `+'.
+Similarly, the qclass was the normal one,
+\fIC_IN\fP, and omitted.
+Any other qclass would have been printed
+immediately after the `A'.
+.LP
+A few anomalies are checked and may result in extra fields enclosed in
+square brackets: If a query contains an answer, authority records or
+additional records section,
+.IR ancount ,
+.IR nscount ,
+or
+.I arcount
+are printed as `[\fIn\fPa]', `[\fIn\fPn]' or `[\fIn\fPau]' where \fIn\fP
+is the appropriate count.
+If any of the response bits are set (AA, RA or rcode) or any of the
+`must be zero' bits are set in bytes two and three, `[b2&3=\fIx\fP]'
+is printed, where \fIx\fP is the hex value of header bytes two and three.
+.HD
+UDP Name Server Responses
+.LP
+Name server responses are formatted as
+.RS
+.nf
+.sp .5
+\fIsrc > dst: id op rcode flags a/n/au type class data (len)\fP
+.sp .5
+\f(CWhelios.domain > h2opolo.1538: 3 3/3/7 A 128.32.137.3 (273)
+helios.domain > h2opolo.1537: 2 NXDomain* 0/1/0 (97)\fR
+.sp .5
+.fi
+.RE
+In the first example, \fIhelios\fP responds to query id 3 from \fIh2opolo\fP
+with 3 answer records, 3 name server records and 7 additional records.
+The first answer record is type A (address) and its data is internet
+address 128.32.137.3.
+The total size of the response was 273 bytes,
+excluding UDP and IP headers.
+The op (Query) and response code
+(NoError) were omitted, as was the class (C_IN) of the A record.
+.LP
+In the second example, \fIhelios\fP responds to query 2 with a
+response code of non-existent domain (NXDomain) with no answers,
+one name server and no authority records.
+The `*' indicates that
+the \fIauthoritative answer\fP bit was set.
+Since there were no
+answers, no type, class or data were printed.
+.LP
+Other flag characters that might appear are `\-' (recursion available,
+RA, \fInot\fP set) and `|' (truncated message, TC, set).
+If the
+`question' section doesn't contain exactly one entry, `[\fIn\fPq]'
+is printed.
+.HD
+SMB/CIFS decoding
+.LP
+\fItcpdump\fP now includes fairly extensive SMB/CIFS/NBT decoding for data
+on UDP/137, UDP/138 and TCP/139.
+Some primitive decoding of IPX and
+NetBEUI SMB data is also done.
+.LP
+By default a fairly minimal decode is done, with a much more detailed
+decode done if -v is used.
+Be warned that with -v a single SMB packet
+may take up a page or more, so only use -v if you really want all the
+gory details.
+.LP
+For information on SMB packet formats and what all the fields mean see
+www.cifs.org or the pub/samba/specs/ directory on your favorite
+samba.org mirror site.
+The SMB patches were written by Andrew Tridgell
+(tridge at samba.org).
+.HD
+NFS Requests and Replies
+.LP
+Sun NFS (Network File System) requests and replies are printed as:
+.RS
+.nf
+.sp .5
+\fIsrc.xid > dst.nfs: len op args\fP
+\fIsrc.nfs > dst.xid: reply stat len op results\fP
+.sp .5
+\f(CW
+sushi.6709 > wrl.nfs: 112 readlink fh 21,24/10.73165
+wrl.nfs > sushi.6709: reply ok 40 readlink "../var"
+sushi.201b > wrl.nfs:
+ 144 lookup fh 9,74/4096.6878 "xcolors"
+wrl.nfs > sushi.201b:
+ reply ok 128 lookup fh 9,74/4134.3150
+\fR
+.sp .5
+.fi
+.RE
+In the first line, host \fIsushi\fP sends a transaction with id \fI6709\fP
+to \fIwrl\fP (note that the number following the src host is a
+transaction id, \fInot\fP the source port).
+The request was 112 bytes,
+excluding the UDP and IP headers.
+The operation was a \fIreadlink\fP
+(read symbolic link) on file handle (\fIfh\fP) 21,24/10.731657119.
+(If one is lucky, as in this case, the file handle can be interpreted
+as a major,minor device number pair, followed by the inode number and
+generation number.)
+\fIWrl\fP replies `ok' with the contents of the link.
+.LP
+In the third line, \fIsushi\fP asks \fIwrl\fP to lookup the name
+`\fIxcolors\fP' in directory file 9,74/4096.6878.
+Note that the data printed
+depends on the operation type.
+The format is intended to be self
+explanatory if read in conjunction with
+an NFS protocol spec.
+.LP
+If the \-v (verbose) flag is given, additional information is printed.
+For example:
+.RS
+.nf
+.sp .5
+\f(CW
+sushi.1372a > wrl.nfs:
+ 148 read fh 21,11/12.195 8192 bytes @ 24576
+wrl.nfs > sushi.1372a:
+ reply ok 1472 read REG 100664 ids 417/0 sz 29388
+\fP
+.sp .5
+.fi
+.RE
+(\-v also prints the IP header TTL, ID, length, and fragmentation fields,
+which have been omitted from this example.) In the first line,
+\fIsushi\fP asks \fIwrl\fP to read 8192 bytes from file 21,11/12.195,
+at byte offset 24576.
+\fIWrl\fP replies `ok'; the packet shown on the
+second line is the first fragment of the reply, and hence is only 1472
+bytes long (the other bytes will follow in subsequent fragments, but
+these fragments do not have NFS or even UDP headers and so might not be
+printed, depending on the filter expression used).
+Because the \-v flag
+is given, some of the file attributes (which are returned in addition
+to the file data) are printed: the file type (``REG'', for regular file),
+the file mode (in octal), the uid and gid, and the file size.
+.LP
+If the \-v flag is given more than once, even more details are printed.
+.LP
+Note that NFS requests are very large and much of the detail won't be printed
+unless \fIsnaplen\fP is increased.
+Try using `\fB\-s 192\fP' to watch
+NFS traffic.
+.LP
+NFS reply packets do not explicitly identify the RPC operation.
+Instead,
+\fItcpdump\fP keeps track of ``recent'' requests, and matches them to the
+replies using the transaction ID.
+If a reply does not closely follow the
+corresponding request, it might not be parsable.
+.HD
+AFS Requests and Replies
+.LP
+Transarc AFS (Andrew File System) requests and replies are printed
+as:
+.HD
+.RS
+.nf
+.sp .5
+\fIsrc.sport > dst.dport: rx packet-type\fP
+\fIsrc.sport > dst.dport: rx packet-type service call call-name args\fP
+\fIsrc.sport > dst.dport: rx packet-type service reply call-name args\fP
+.sp .5
+\f(CW
+elvis.7001 > pike.afsfs:
+ rx data fs call rename old fid 536876964/1/1 ".newsrc.new"
+ new fid 536876964/1/1 ".newsrc"
+pike.afsfs > elvis.7001: rx data fs reply rename
+\fR
+.sp .5
+.fi
+.RE
+In the first line, host elvis sends a RX packet to pike.
+This was
+a RX data packet to the fs (fileserver) service, and is the start of
+an RPC call.
+The RPC call was a rename, with the old directory file id
+of 536876964/1/1 and an old filename of `.newsrc.new', and a new directory
+file id of 536876964/1/1 and a new filename of `.newsrc'.
+The host pike
+responds with a RPC reply to the rename call (which was successful, because
+it was a data packet and not an abort packet).
+.LP
+In general, all AFS RPCs are decoded at least by RPC call name.
+Most
+AFS RPCs have at least some of the arguments decoded (generally only
+the `interesting' arguments, for some definition of interesting).
+.LP
+The format is intended to be self-describing, but it will probably
+not be useful to people who are not familiar with the workings of
+AFS and RX.
+.LP
+If the -v (verbose) flag is given twice, acknowledgement packets and
+additional header information is printed, such as the RX call ID,
+call number, sequence number, serial number, and the RX packet flags.
+.LP
+If the -v flag is given twice, additional information is printed,
+such as the RX call ID, serial number, and the RX packet flags.
+The MTU negotiation information is also printed from RX ack packets.
+.LP
+If the -v flag is given three times, the security index and service id
+are printed.
+.LP
+Error codes are printed for abort packets, with the exception of Ubik
+beacon packets (because abort packets are used to signify a yes vote
+for the Ubik protocol).
+.LP
+Note that AFS requests are very large and many of the arguments won't
+be printed unless \fIsnaplen\fP is increased.
+Try using `\fB-s 256\fP'
+to watch AFS traffic.
+.LP
+AFS reply packets do not explicitly identify the RPC operation.
+Instead,
+\fItcpdump\fP keeps track of ``recent'' requests, and matches them to the
+replies using the call number and service ID.
+If a reply does not closely
+follow the
+corresponding request, it might not be parsable.
+
+.HD
+KIP AppleTalk (DDP in UDP)
+.LP
+AppleTalk DDP packets encapsulated in UDP datagrams are de-encapsulated
+and dumped as DDP packets (i.e., all the UDP header information is
+discarded).
+The file
+.I /etc/atalk.names
+is used to translate AppleTalk net and node numbers to names.
+Lines in this file have the form
+.RS
+.nf
+.sp .5
+\fInumber name\fP
+
+\f(CW1.254 ether
+16.1 icsd-net
+1.254.110 ace\fR
+.sp .5
+.fi
+.RE
+The first two lines give the names of AppleTalk networks.
+The third
+line gives the name of a particular host (a host is distinguished
+from a net by the 3rd octet in the number \-
+a net number \fImust\fP have two octets and a host number \fImust\fP
+have three octets.) The number and name should be separated by
+whitespace (blanks or tabs).
+The
+.I /etc/atalk.names
+file may contain blank lines or comment lines (lines starting with
+a `#').
+.LP
+AppleTalk addresses are printed in the form
+.RS
+.nf
+.sp .5
+\fInet.host.port\fP
+
+\f(CW144.1.209.2 > icsd-net.112.220
+office.2 > icsd-net.112.220
+jssmag.149.235 > icsd-net.2\fR
+.sp .5
+.fi
+.RE
+(If the
+.I /etc/atalk.names
+doesn't exist or doesn't contain an entry for some AppleTalk
+host/net number, addresses are printed in numeric form.)
+In the first example, NBP (DDP port 2) on net 144.1 node 209
+is sending to whatever is listening on port 220 of net icsd node 112.
+The second line is the same except the full name of the source node
+is known (`office').
+The third line is a send from port 235 on
+net jssmag node 149 to broadcast on the icsd-net NBP port (note that
+the broadcast address (255) is indicated by a net name with no host
+number \- for this reason it's a good idea to keep node names and
+net names distinct in /etc/atalk.names).
+.LP
+NBP (name binding protocol) and ATP (AppleTalk transaction protocol)
+packets have their contents interpreted.
+Other protocols just dump
+the protocol name (or number if no name is registered for the
+protocol) and packet size.
+
+\fBNBP packets\fP are formatted like the following examples:
+.RS
+.nf
+.sp .5
+\s-2\f(CWicsd-net.112.220 > jssmag.2: nbp-lkup 190: "=:LaserWriter@*"
+jssmag.209.2 > icsd-net.112.220: nbp-reply 190: "RM1140:LaserWriter@*" 250
+techpit.2 > icsd-net.112.220: nbp-reply 190: "techpit:LaserWriter@*" 186\fR\s+2
+.sp .5
+.fi
+.RE
+The first line is a name lookup request for laserwriters sent by net icsd host
+112 and broadcast on net jssmag.
+The nbp id for the lookup is 190.
+The second line shows a reply for this request (note that it has the
+same id) from host jssmag.209 saying that it has a laserwriter
+resource named "RM1140" registered on port 250.
+The third line is
+another reply to the same request saying host techpit has laserwriter
+"techpit" registered on port 186.
+
+\fBATP packet\fP formatting is demonstrated by the following example:
+.RS
+.nf
+.sp .5
+\s-2\f(CWjssmag.209.165 > helios.132: atp-req 12266<0-7> 0xae030001
+helios.132 > jssmag.209.165: atp-resp 12266:0 (512) 0xae040000
+helios.132 > jssmag.209.165: atp-resp 12266:1 (512) 0xae040000
+helios.132 > jssmag.209.165: atp-resp 12266:2 (512) 0xae040000
+helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
+helios.132 > jssmag.209.165: atp-resp 12266:4 (512) 0xae040000
+helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
+helios.132 > jssmag.209.165: atp-resp 12266:6 (512) 0xae040000
+helios.132 > jssmag.209.165: atp-resp*12266:7 (512) 0xae040000
+jssmag.209.165 > helios.132: atp-req 12266<3,5> 0xae030001
+helios.132 > jssmag.209.165: atp-resp 12266:3 (512) 0xae040000
+helios.132 > jssmag.209.165: atp-resp 12266:5 (512) 0xae040000
+jssmag.209.165 > helios.132: atp-rel 12266<0-7> 0xae030001
+jssmag.209.133 > helios.132: atp-req* 12267<0-7> 0xae030002\fR\s+2
+.sp .5
+.fi
+.RE
+Jssmag.209 initiates transaction id 12266 with host helios by requesting
+up to 8 packets (the `<0-7>').
+The hex number at the end of the line
+is the value of the `userdata' field in the request.
+.LP
+Helios responds with 8 512-byte packets.
+The `:digit' following the
+transaction id gives the packet sequence number in the transaction
+and the number in parens is the amount of data in the packet,
+excluding the atp header.
+The `*' on packet 7 indicates that the
+EOM bit was set.
+.LP
+Jssmag.209 then requests that packets 3 & 5 be retransmitted.
+Helios
+resends them then jssmag.209 releases the transaction.
+Finally,
+jssmag.209 initiates the next request.
+The `*' on the request
+indicates that XO (`exactly once') was \fInot\fP set.
+
+.HD
+IP Fragmentation
+.LP
+Fragmented Internet datagrams are printed as
+.RS
+.nf
+.sp .5
+\fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB+)\fR
+\fB(frag \fIid\fB:\fIsize\fB@\fIoffset\fB)\fR
+.sp .5
+.fi
+.RE
+(The first form indicates there are more fragments.
+The second
+indicates this is the last fragment.)
+.LP
+\fIId\fP is the fragment id.
+\fISize\fP is the fragment
+size (in bytes) excluding the IP header.
+\fIOffset\fP is this
+fragment's offset (in bytes) in the original datagram.
+.LP
+The fragment information is output for each fragment.
+The first
+fragment contains the higher level protocol header and the frag
+info is printed after the protocol info.
+Fragments
+after the first contain no higher level protocol header and the
+frag info is printed after the source and destination addresses.
+For example, here is part of an ftp from arizona.edu to lbl-rtsg.arpa
+over a CSNET connection that doesn't appear to handle 576 byte datagrams:
+.RS
+.nf
+.sp .5
+\s-2\f(CWarizona.ftp-data > rtsg.1170: . 1024:1332(308) ack 1 win 4096 (frag 595a:328 at 0+)
+arizona > rtsg: (frag 595a:204 at 328)
+rtsg.1170 > arizona.ftp-data: . ack 1536 win 2560\fP\s+2
+.sp .5
+.fi
+.RE
+There are a couple of things to note here: First, addresses in the
+2nd line don't include port numbers.
+This is because the TCP
+protocol information is all in the first fragment and we have no idea
+what the port or sequence numbers are when we print the later fragments.
+Second, the tcp sequence information in the first line is printed as if there
+were 308 bytes of user data when, in fact, there are 512 bytes (308 in
+the first frag and 204 in the second).
+If you are looking for holes
+in the sequence space or trying to match up acks
+with packets, this can fool you.
+.LP
+A packet with the IP \fIdon't fragment\fP flag is marked with a
+trailing \fB(DF)\fP.
+.HD
+Timestamps
+.LP
+By default, all output lines are preceded by a timestamp.
+The timestamp
+is the current clock time in the form
+.RS
+.nf
+\fIhh:mm:ss.frac\fP
+.fi
+.RE
+and is as accurate as the kernel's clock.
+The timestamp reflects the time the kernel first saw the packet.
+No attempt
+is made to account for the time lag between when the
+Ethernet interface removed the packet from the wire and when the kernel
+serviced the `new packet' interrupt.
+.SH "SEE ALSO"
+stty(1), pcap(3PCAP), bpf(4), nit(4P), pcap-savefile(@MAN_FILE_FORMATS@),
+pcap-filter(@MAN_MISC_INFO@), pcap-tstamp-type(@MAN_MISC_INFO@)
+.LP
+.RS
+.I http://www.iana.org/assignments/media-types/application/vnd.tcpdump.pcap
+.RE
+.LP
+.SH AUTHORS
+The original authors are:
+.LP
+Van Jacobson,
+Craig Leres and
+Steven McCanne, all of the
+Lawrence Berkeley National Laboratory, University of California, Berkeley, CA.
+.LP
+It is currently being maintained by tcpdump.org.
+.LP
+The current version is available via http:
+.LP
+.RS
+.I http://www.tcpdump.org/
+.RE
+.LP
+The original distribution is available via anonymous ftp:
+.LP
+.RS
+.I ftp://ftp.ee.lbl.gov/old/tcpdump.tar.Z
+.RE
+.LP
+IPv6/IPsec support is added by WIDE/KAME project.
+This program uses Eric Young's SSLeay library, under specific configurations.
+.SH BUGS
+Please send problems, bugs, questions, desirable enhancements, patches
+etc. to:
+.LP
+.RS
+tcpdump-workers at lists.tcpdump.org
+.RE
+.LP
+NIT doesn't let you watch your own outbound traffic, BPF will.
+We recommend that you use the latter.
+.LP
+On Linux systems with 2.0[.x] kernels:
+.IP
+packets on the loopback device will be seen twice;
+.IP
+packet filtering cannot be done in the kernel, so that all packets must
+be copied from the kernel in order to be filtered in user mode;
+.IP
+all of a packet, not just the part that's within the snapshot length,
+will be copied from the kernel (the 2.0[.x] packet capture mechanism, if
+asked to copy only part of a packet to userland, will not report the
+true length of the packet; this would cause most IP packets to get an
+error from
+.BR tcpdump );
+.IP
+capturing on some PPP devices won't work correctly.
+.LP
+We recommend that you upgrade to a 2.2 or later kernel.
+.LP
+Some attempt should be made to reassemble IP fragments or, at least
+to compute the right length for the higher level protocol.
+.LP
+Name server inverse queries are not dumped correctly: the (empty)
+question section is printed rather than real query in the answer
+section.
+Some believe that inverse queries are themselves a bug and
+prefer to fix the program generating them rather than \fItcpdump\fP.
+.LP
+A packet trace that crosses a daylight savings time change will give
+skewed time stamps (the time change is ignored).
+.LP
+Filter expressions on fields other than those in Token Ring headers will
+not correctly handle source-routed Token Ring packets.
+.LP
+Filter expressions on fields other than those in 802.11 headers will not
+correctly handle 802.11 data packets with both To DS and From DS set.
+.LP
+.BR "ip6 proto"
+should chase header chain, but at this moment it does not.
+.BR "ip6 protochain"
+is supplied for this behavior.
+.LP
+Arithmetic expression against transport layer headers, like \fBtcp[0]\fP,
+does not work against IPv6 packets.
+It only looks at IPv4 packets.
Property changes on: trunk/contrib/tcpdump/tcpdump.1.in
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/contrib/tcpdump/tcpdump.c
===================================================================
--- trunk/contrib/tcpdump/tcpdump.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/tcpdump.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -30,10 +30,10 @@
"@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\
The Regents of the University of California. All rights reserved.\n";
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/tcpdump.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.283 2008-09-25 21:45:50 guy Exp $ (LBL)";
#endif
-/* $FreeBSD: src/contrib/tcpdump/tcpdump.c,v 1.11.2.2 2007/11/25 19:28:38 mlaier Exp $ */
+/* $FreeBSD: release/9.2.0/contrib/tcpdump/tcpdump.c 252283 2013-06-27 00:37:59Z delphij $ */
/*
* tcpdump - monitor tcp/ip traffic on an ethernet.
@@ -67,12 +67,20 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#ifndef WIN32
+#include <sys/wait.h>
+#include <sys/resource.h>
#include <pwd.h>
#include <grp.h>
#include <errno.h>
#endif /* WIN32 */
+/* capabilities convinience library */
+#ifdef HAVE_CAP_NG_H
+#include <cap-ng.h>
+#endif /* HAVE_CAP_NG_H */
+
#include "netdissect.h"
#include "interface.h"
#include "addrtoname.h"
@@ -81,20 +89,26 @@
#include "gmt2local.h"
#include "pcap-missing.h"
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
+#ifdef SIGINFO
+#define SIGNAL_REQ_INFO SIGINFO
+#elif SIGUSR1
+#define SIGNAL_REQ_INFO SIGUSR1
+#endif
+
netdissect_options Gndo;
netdissect_options *gndo = &Gndo;
-/*
- * Define the maximum number of files for the -C flag, and how many
- * characters can be added to a filename for the -C flag (which
- * should be enough to handle MAX_CFLAG - 1).
- */
-#define MAX_CFLAG 1000000
-#define MAX_CFLAG_CHARS 6
+static int dflag; /* print filter code */
+static int Lflag; /* list available data link types and exit */
+#ifdef HAVE_PCAP_SET_TSTAMP_TYPE
+static int Jflag; /* list available time stamp types */
+#endif
+static char *zflag = NULL; /* compress each savefile using a specified command (like gzip or bzip2) */
-int dflag; /* print filter code */
-int Lflag; /* list available data link types and exit */
-
static int infodelay;
static int infoprint;
@@ -104,8 +118,9 @@
/* Forwards */
static RETSIGTYPE cleanup(int);
+static RETSIGTYPE child_cleanup(int);
static void usage(void) __attribute__((noreturn));
-static void show_dlts_and_exit(pcap_t *pd) __attribute__((noreturn));
+static void show_dlts_and_exit(const char *device, pcap_t *pd) __attribute__((noreturn));
static void print_packet(u_char *, const struct pcap_pkthdr *, const u_char *);
static void ndo_default_print(netdissect_options *, const u_char *, u_int);
@@ -112,10 +127,11 @@
static void dump_packet_and_trunc(u_char *, const struct pcap_pkthdr *, const u_char *);
static void dump_packet(u_char *, const struct pcap_pkthdr *, const u_char *);
static void droproot(const char *, const char *);
-static void ndo_error(netdissect_options *ndo, const char *fmt, ...);
+static void ndo_error(netdissect_options *ndo, const char *fmt, ...)
+ __attribute__ ((noreturn, format (printf, 2, 3)));
static void ndo_warning(netdissect_options *ndo, const char *fmt, ...);
-#ifdef SIGINFO
+#ifdef SIGNAL_REQ_INFO
RETSIGTYPE requestinfo(int);
#endif
@@ -130,19 +146,23 @@
static void info(int);
static u_int packets_captured;
-typedef u_int (*if_printer)(const struct pcap_pkthdr *, const u_char *);
-
struct printer {
- if_printer f;
+ if_printer f;
int type;
};
+
+struct ndo_printer {
+ if_ndo_printer f;
+ int type;
+};
+
+
static struct printer printers[] = {
{ arcnet_if_print, DLT_ARCNET },
#ifdef DLT_ARCNET_LINUX
{ arcnet_linux_if_print, DLT_ARCNET_LINUX },
#endif
- { ether_if_print, DLT_EN10MB },
{ token_if_print, DLT_IEEE802 },
#ifdef DLT_LANE8023
{ lane_if_print, DLT_LANE8023 },
@@ -151,7 +171,7 @@
{ cip_if_print, DLT_CIP },
#endif
#ifdef DLT_ATM_CLIP
- { cip_if_print, DLT_ATM_CLIP },
+ { cip_if_print, DLT_ATM_CLIP },
#endif
{ sl_if_print, DLT_SLIP },
#ifdef DLT_SLIP_BSDOS
@@ -178,7 +198,7 @@
{ chdlc_if_print, DLT_HDLC },
#endif
#ifdef DLT_PPP_SERIAL
- { ppp_hdlc_if_print, DLT_PPP_SERIAL },
+ { ppp_hdlc_if_print, DLT_PPP_SERIAL },
#endif
#ifdef DLT_PPP_ETHER
{ pppoe_if_print, DLT_PPP_ETHER },
@@ -193,7 +213,7 @@
{ ltalk_if_print, DLT_LTALK },
#endif
#if defined(DLT_PFLOG) && defined(HAVE_NET_PFVAR_H)
- { pflog_if_print, DLT_PFLOG },
+ { pflog_if_print, DLT_PFLOG },
#endif
#ifdef DLT_FR
{ fr_if_print, DLT_FR },
@@ -214,14 +234,17 @@
{ ieee802_11_radio_if_print, DLT_IEEE802_11_RADIO },
#endif
#ifdef DLT_ENC
- { enc_if_print, DLT_ENC },
+ { enc_if_print, DLT_ENC },
#endif
#ifdef DLT_SYMANTEC_FIREWALL
- { symantec_if_print, DLT_SYMANTEC_FIREWALL },
+ { symantec_if_print, DLT_SYMANTEC_FIREWALL },
#endif
#ifdef DLT_APPLE_IP_OVER_IEEE1394
{ ap1394_if_print, DLT_APPLE_IP_OVER_IEEE1394 },
#endif
+#ifdef DLT_IEEE802_11_RADIO_AVS
+ { ieee802_11_radio_avs_if_print, DLT_IEEE802_11_RADIO_AVS },
+#endif
#ifdef DLT_JUNIPER_ATM1
{ juniper_atm1_print, DLT_JUNIPER_ATM1 },
#endif
@@ -256,24 +279,64 @@
{ juniper_services_print, DLT_JUNIPER_SERVICES },
#endif
#ifdef DLT_JUNIPER_ETHER
- { juniper_ether_print, DLT_JUNIPER_ETHER },
+ { juniper_ether_print, DLT_JUNIPER_ETHER },
#endif
#ifdef DLT_JUNIPER_PPP
- { juniper_ppp_print, DLT_JUNIPER_PPP },
+ { juniper_ppp_print, DLT_JUNIPER_PPP },
#endif
#ifdef DLT_JUNIPER_FRELAY
- { juniper_frelay_print, DLT_JUNIPER_FRELAY },
+ { juniper_frelay_print, DLT_JUNIPER_FRELAY },
#endif
#ifdef DLT_JUNIPER_CHDLC
- { juniper_chdlc_print, DLT_JUNIPER_CHDLC },
+ { juniper_chdlc_print, DLT_JUNIPER_CHDLC },
#endif
#ifdef DLT_MFR
- { mfr_if_print, DLT_MFR },
+ { mfr_if_print, DLT_MFR },
#endif
+#if defined(DLT_BLUETOOTH_HCI_H4_WITH_PHDR) && defined(HAVE_PCAP_BLUETOOTH_H)
+ { bt_if_print, DLT_BLUETOOTH_HCI_H4_WITH_PHDR},
+#endif
+#ifdef HAVE_PCAP_USB_H
+#ifdef DLT_USB_LINUX
+ { usb_linux_48_byte_print, DLT_USB_LINUX},
+#endif /* DLT_USB_LINUX */
+#ifdef DLT_USB_LINUX_MMAPPED
+ { usb_linux_64_byte_print, DLT_USB_LINUX_MMAPPED},
+#endif /* DLT_USB_LINUX_MMAPPED */
+#endif /* HAVE_PCAP_USB_H */
+#ifdef DLT_IPV4
+ { raw_if_print, DLT_IPV4 },
+#endif
+#ifdef DLT_IPV6
+ { raw_if_print, DLT_IPV6 },
+#endif
{ NULL, 0 },
};
-static if_printer
+static struct ndo_printer ndo_printers[] = {
+ { ether_if_print, DLT_EN10MB },
+#ifdef DLT_IPNET
+ { ipnet_if_print, DLT_IPNET },
+#endif
+#ifdef DLT_IEEE802_15_4
+ { ieee802_15_4_if_print, DLT_IEEE802_15_4 },
+#endif
+#ifdef DLT_IEEE802_15_4_NOFCS
+ { ieee802_15_4_if_print, DLT_IEEE802_15_4_NOFCS },
+#endif
+#ifdef DLT_PPI
+ { ppi_if_print, DLT_PPI },
+#endif
+#ifdef DLT_NETANALYZER
+ { netanalyzer_if_print, DLT_NETANALYZER },
+#endif
+#ifdef DLT_NETANALYZER_TRANSPARENT
+ { netanalyzer_transparent_if_print, DLT_NETANALYZER_TRANSPARENT },
+#endif
+ { NULL, 0 },
+};
+
+if_printer
lookup_printer(int type)
{
struct printer *p;
@@ -286,25 +349,80 @@
/* NOTREACHED */
}
+if_ndo_printer
+lookup_ndo_printer(int type)
+{
+ struct ndo_printer *p;
+
+ for (p = ndo_printers; p->f; ++p)
+ if (type == p->type)
+ return p->f;
+
+ return NULL;
+ /* NOTREACHED */
+}
+
static pcap_t *pd;
+static int supports_monitor_mode;
+
extern int optind;
extern int opterr;
extern char *optarg;
struct print_info {
- if_printer printer;
+ netdissect_options *ndo;
+ union {
+ if_printer printer;
+ if_ndo_printer ndo_printer;
+ } p;
+ int ndo_type;
};
struct dump_info {
char *WFileName;
+ char *CurrentFileName;
pcap_t *pd;
pcap_dumper_t *p;
};
+#ifdef HAVE_PCAP_SET_TSTAMP_TYPE
static void
-show_dlts_and_exit(pcap_t *pd)
+show_tstamp_types_and_exit(const char *device, pcap_t *pd)
{
+ int n_tstamp_types;
+ int *tstamp_types = 0;
+ const char *tstamp_type_name;
+ int i;
+
+ n_tstamp_types = pcap_list_tstamp_types(pd, &tstamp_types);
+ if (n_tstamp_types < 0)
+ error("%s", pcap_geterr(pd));
+
+ if (n_tstamp_types == 0) {
+ fprintf(stderr, "Time stamp type cannot be set for %s\n",
+ device);
+ exit(0);
+ }
+ fprintf(stderr, "Time stamp types for %s (use option -j to set):\n",
+ device);
+ for (i = 0; i < n_tstamp_types; i++) {
+ tstamp_type_name = pcap_tstamp_type_val_to_name(tstamp_types[i]);
+ if (tstamp_type_name != NULL) {
+ (void) fprintf(stderr, " %s (%s)\n", tstamp_type_name,
+ pcap_tstamp_type_val_to_description(tstamp_types[i]));
+ } else {
+ (void) fprintf(stderr, " %d\n", tstamp_types[i]);
+ }
+ }
+ pcap_free_tstamp_types(tstamp_types);
+ exit(0);
+}
+#endif
+
+static void
+show_dlts_and_exit(const char *device, pcap_t *pd)
+{
int n_dlts;
int *dlts = 0;
const char *dlt_name;
@@ -315,7 +433,21 @@
else if (n_dlts == 0 || !dlts)
error("No data link types.");
- (void) fprintf(stderr, "Data link types (use option -y to set):\n");
+ /*
+ * If the interface is known to support monitor mode, indicate
+ * whether these are the data link types available when not in
+ * monitor mode, if -I wasn't specified, or when in monitor mode,
+ * when -I was specified (the link-layer types available in
+ * monitor mode might be different from the ones available when
+ * not in monitor mode).
+ */
+ if (supports_monitor_mode)
+ (void) fprintf(stderr, "Data link types for %s %s (use option -y to set):\n",
+ device,
+ Iflag ? "when in monitor mode" : "when not in monitor mode");
+ else
+ (void) fprintf(stderr, "Data link types for %s (use option -y to set):\n",
+ device);
while (--n_dlts >= 0) {
dlt_name = pcap_datalink_val_to_name(dlts[n_dlts]);
@@ -326,15 +458,18 @@
/*
* OK, does tcpdump handle that type?
*/
- if (lookup_printer(dlts[n_dlts]) == NULL)
- (void) fprintf(stderr, " (not supported)");
- putchar('\n');
+ if (lookup_printer(dlts[n_dlts]) == NULL
+ && lookup_ndo_printer(dlts[n_dlts]) == NULL)
+ (void) fprintf(stderr, " (printing not supported)");
+ fprintf(stderr, "\n");
} else {
- (void) fprintf(stderr, " DLT %d (not supported)\n",
+ (void) fprintf(stderr, " DLT %d (printing not supported)\n",
dlts[n_dlts]);
}
}
- free(dlts);
+#ifdef HAVE_PCAP_FREE_DATALINKS
+ pcap_free_datalinks(dlts);
+#endif
exit(0);
}
@@ -342,14 +477,30 @@
* Set up flags that might or might not be supported depending on the
* version of libpcap we're using.
*/
-#ifdef WIN32
+#if defined(HAVE_PCAP_CREATE) || defined(WIN32)
#define B_FLAG "B:"
#define B_FLAG_USAGE " [ -B size ]"
-#else /* WIN32 */
+#else /* defined(HAVE_PCAP_CREATE) || defined(WIN32) */
#define B_FLAG
#define B_FLAG_USAGE
-#endif /* WIN32 */
+#endif /* defined(HAVE_PCAP_CREATE) || defined(WIN32) */
+#ifdef HAVE_PCAP_CREATE
+#define I_FLAG "I"
+#else /* HAVE_PCAP_CREATE */
+#define I_FLAG
+#endif /* HAVE_PCAP_CREATE */
+
+#ifdef HAVE_PCAP_SET_TSTAMP_TYPE
+#define j_FLAG "j:"
+#define j_FLAG_USAGE " [ -j tstamptype ]"
+#define J_FLAG "J"
+#else /* PCAP_ERROR_TSTAMP_TYPE_NOTSUP */
+#define j_FLAG
+#define j_FLAG_USAGE
+#define J_FLAG
+#endif /* PCAP_ERROR_TSTAMP_TYPE_NOTSUP */
+
#ifdef HAVE_PCAP_FINDALLDEVS
#ifndef HAVE_PCAP_IF_T
#undef HAVE_PCAP_FINDALLDEVS
@@ -389,6 +540,19 @@
exit(1);
}
}
+#ifdef HAVE_CAP_NG_H
+ int ret = capng_change_id(pw->pw_uid, pw->pw_gid, CAPNG_NO_FLAG);
+ if (ret < 0) {
+ printf("error : ret %d\n", ret);
+ }
+ /* We don't need CAP_SETUID and CAP_SETGID */
+ capng_update(CAPNG_DROP, CAPNG_EFFECTIVE, CAP_SETUID);
+ capng_update(CAPNG_DROP, CAPNG_EFFECTIVE, CAP_SETUID);
+ capng_update(CAPNG_DROP, CAPNG_PERMITTED, CAP_SETUID);
+ capng_update(CAPNG_DROP, CAPNG_PERMITTED, CAP_SETUID);
+ capng_apply(CAPNG_SELECT_BOTH);
+
+#else
if (initgroups(pw->pw_name, pw->pw_gid) != 0 ||
setgid(pw->pw_gid) != 0 || setuid(pw->pw_uid) != 0) {
fprintf(stderr, "tcpdump: Couldn't change to '%.32s' uid=%lu gid=%lu: %s\n",
@@ -398,6 +562,7 @@
pcap_strerror(errno));
exit(1);
}
+#endif /* HAVE_CAP_NG_H */
}
else {
fprintf(stderr, "tcpdump: Couldn't find user '%.32s'\n",
@@ -425,10 +590,34 @@
static void
MakeFilename(char *buffer, char *orig_name, int cnt, int max_chars)
{
+ char *filename = malloc(PATH_MAX + 1);
+ if (filename == NULL)
+ error("Makefilename: malloc");
+
+ /* Process with strftime if Gflag is set. */
+ if (Gflag != 0) {
+ struct tm *local_tm;
+
+ /* Convert Gflag_time to a usable format */
+ if ((local_tm = localtime(&Gflag_time)) == NULL) {
+ error("MakeTimedFilename: localtime");
+ }
+
+ /* There's no good way to detect an error in strftime since a return
+ * value of 0 isn't necessarily failure.
+ */
+ strftime(filename, PATH_MAX, orig_name, local_tm);
+ } else {
+ strncpy(filename, orig_name, PATH_MAX);
+ }
+
if (cnt == 0 && max_chars == 0)
- strcpy(buffer, orig_name);
+ strncpy(buffer, filename, PATH_MAX + 1);
else
- sprintf(buffer, "%s%0*d", orig_name, max_chars, cnt);
+ if (snprintf(buffer, PATH_MAX + 1, "%s%0*d", filename, max_chars, cnt) > PATH_MAX)
+ /* Report an error if the filename is too large */
+ error("too many output files or filename is too long (> %d)", PATH_MAX);
+ free(filename);
}
static int tcpdump_printf(netdissect_options *ndo _U_,
@@ -445,14 +634,55 @@
return ret;
}
+static struct print_info
+get_print_info(int type)
+{
+ struct print_info printinfo;
+
+ printinfo.ndo_type = 1;
+ printinfo.ndo = gndo;
+ printinfo.p.ndo_printer = lookup_ndo_printer(type);
+ if (printinfo.p.ndo_printer == NULL) {
+ printinfo.p.printer = lookup_printer(type);
+ printinfo.ndo_type = 0;
+ if (printinfo.p.printer == NULL) {
+ gndo->ndo_dltname = pcap_datalink_val_to_name(type);
+ if (gndo->ndo_dltname != NULL)
+ error("packet printing is not supported for link type %s: use -w",
+ gndo->ndo_dltname);
+ else
+ error("packet printing is not supported for link type %d: use -w", type);
+ }
+ }
+ return (printinfo);
+}
+
+static char *
+get_next_file(FILE *VFile, char *ptr)
+{
+ char *ret;
+
+ ret = fgets(ptr, PATH_MAX, VFile);
+ if (!ret)
+ return NULL;
+
+ if (ptr[strlen(ptr) - 1] == '\n')
+ ptr[strlen(ptr) - 1] = '\0';
+
+ return ret;
+}
+
int
main(int argc, char **argv)
{
register int cnt, op, i;
bpf_u_int32 localnet, netmask;
- register char *cp, *infile, *cmdbuf, *device, *RFileName, *WFileName, *WFileNameAlt;
+ register char *cp, *infile, *cmdbuf, *device, *RFileName, *VFileName, *WFileName;
pcap_handler callback;
int type;
+ int dlt;
+ int new_dlt;
+ const char *dlt_name;
struct bpf_program fcode;
#ifndef WIN32
RETSIGTYPE (*oldhandler)(int);
@@ -461,18 +691,22 @@
struct dump_info dumpinfo;
u_char *pcap_userdata;
char ebuf[PCAP_ERRBUF_SIZE];
+ char VFileLine[PATH_MAX + 1];
char *username = NULL;
char *chroot_dir = NULL;
+ char *ret = NULL;
+ char *end;
#ifdef HAVE_PCAP_FINDALLDEVS
pcap_if_t *devpointer;
int devnum;
#endif
int status;
+ FILE *VFile;
#ifdef WIN32
- u_int UserBufferSize = 1000000;
if(wsockinit() != 0) return 1;
#endif /* WIN32 */
+ jflag=-1; /* not set */
gndo->ndo_Oflag=1;
gndo->ndo_Rflag=1;
gndo->ndo_dlt=-1;
@@ -486,7 +720,10 @@
device = NULL;
infile = NULL;
RFileName = NULL;
+ VFileName = NULL;
+ VFile = NULL;
WFileName = NULL;
+ dlt = -1;
if ((cp = strrchr(argv[0], '/')) != NULL)
program_name = cp + 1;
else
@@ -499,9 +736,8 @@
smiInit("tcpdump");
#endif
- opterr = 0;
while (
- (op = getopt(argc, argv, "aA" B_FLAG "c:C:d" D_FLAG "eE:fF:i:lLm:M:nNOpqr:Rs:StT:u" U_FLAG "vw:W:xXy:YZ:")) != -1)
+ (op = getopt(argc, argv, "aAb" B_FLAG "c:C:d" D_FLAG "eE:fF:G:hHi:" I_FLAG j_FLAG J_FLAG "KlLm:M:nNOpqr:Rs:StT:u" U_FLAG "V:vw:W:xXy:Yz:Z:")) != -1)
switch (op) {
case 'a':
@@ -512,13 +748,17 @@
++Aflag;
break;
-#ifdef WIN32
+ case 'b':
+ ++bflag;
+ break;
+
+#if defined(HAVE_PCAP_CREATE) || defined(WIN32)
case 'B':
- UserBufferSize = atoi(optarg)*1024;
- if (UserBufferSize < 0)
+ Bflag = atoi(optarg)*1024;
+ if (Bflag <= 0)
error("invalid packet buffer size %s", optarg);
break;
-#endif /* WIN32 */
+#endif /* defined(HAVE_PCAP_CREATE) || defined(WIN32) */
case 'c':
cnt = atoi(optarg);
@@ -575,6 +815,29 @@
infile = optarg;
break;
+ case 'G':
+ Gflag = atoi(optarg);
+ if (Gflag < 0)
+ error("invalid number of seconds %s", optarg);
+
+ /* We will create one file initially. */
+ Gflag_count = 0;
+
+ /* Grab the current time for rotation use. */
+ if ((Gflag_time = time(NULL)) == (time_t)-1) {
+ error("main: can't get current time: %s",
+ pcap_strerror(errno));
+ }
+ break;
+
+ case 'h':
+ usage();
+ break;
+
+ case 'H':
+ ++Hflag;
+ break;
+
case 'i':
if (optarg[0] == '0' && optarg[1] == 0)
error("Invalid adapter index");
@@ -590,7 +853,8 @@
* It can be useful on Windows, where more than
* one interface can have the same name.
*/
- if ((devnum = atoi(optarg)) != 0) {
+ devnum = strtol(optarg, &end, 10);
+ if (optarg != end && *end == '\0') {
if (devnum < 0)
error("Invalid adapter index");
@@ -597,11 +861,17 @@
if (pcap_findalldevs(&devpointer, ebuf) < 0)
error("%s", ebuf);
else {
- for (i = 0; i < devnum-1; i++){
- devpointer = devpointer->next;
- if (devpointer == NULL)
- error("Invalid adapter index");
- }
+ /*
+ * Look for the devnum-th entry
+ * in the list of devices
+ * (1-based).
+ */
+ for (i = 0;
+ i < devnum-1 && devpointer != NULL;
+ i++, devpointer = devpointer->next)
+ ;
+ if (devpointer == NULL)
+ error("Invalid adapter index");
}
device = devpointer->name;
break;
@@ -610,6 +880,24 @@
device = optarg;
break;
+#ifdef HAVE_PCAP_CREATE
+ case 'I':
+ ++Iflag;
+ break;
+#endif /* HAVE_PCAP_CREATE */
+
+#ifdef HAVE_PCAP_SET_TSTAMP_TYPE
+ case 'j':
+ jflag = pcap_tstamp_type_name_to_val(optarg);
+ if (jflag < 0)
+ error("invalid time stamp type %s", optarg);
+ break;
+
+ case 'J':
+ Jflag++;
+ break;
+#endif
+
case 'l':
#ifdef WIN32
/*
@@ -631,19 +919,15 @@
#endif /* WIN32 */
break;
- case 'n':
- ++nflag;
+ case 'K':
+ ++Kflag;
break;
- case 'N':
- ++Nflag;
- break;
-
case 'm':
#ifdef LIBSMI
- if (smiLoadModule(optarg) == 0) {
+ if (smiLoadModule(optarg) == 0) {
error("could not load MIB module %s", optarg);
- }
+ }
sflag = 1;
#else
(void)fprintf(stderr, "%s: ignoring option `-m %s' ",
@@ -657,9 +941,17 @@
#ifndef HAVE_LIBCRYPTO
warning("crypto code not compiled in");
#endif
- tcpmd5secret = optarg;
+ sigsecret = optarg;
break;
+ case 'n':
+ ++nflag;
+ break;
+
+ case 'N':
+ ++Nflag;
+ break;
+
case 'O':
Oflag = 0;
break;
@@ -681,17 +973,14 @@
Rflag = 0;
break;
- case 's': {
- char *end;
-
+ case 's':
snaplen = strtol(optarg, &end, 0);
if (optarg == end || *end != '\0'
- || snaplen < 0 || snaplen > 65535)
+ || snaplen < 0 || snaplen > MAXIMUM_SNAPLEN)
error("invalid snaplen %s", optarg);
else if (snaplen == 0)
- snaplen = 65535;
+ snaplen = MAXIMUM_SNAPLEN;
break;
- }
case 'S':
++Sflag;
@@ -720,6 +1009,14 @@
packettype = PT_TFTP;
else if (strcasecmp(optarg, "aodv") == 0)
packettype = PT_AODV;
+ else if (strcasecmp(optarg, "carp") == 0)
+ packettype = PT_CARP;
+ else if (strcasecmp(optarg, "radius") == 0)
+ packettype = PT_RADIUS;
+ else if (strcasecmp(optarg, "zmtp1") == 0)
+ packettype = PT_ZMTP1;
+ else if (strcasecmp(optarg, "vxlan") == 0)
+ packettype = PT_VXLAN;
else
error("unknown packet type `%s'", optarg);
break;
@@ -738,6 +1035,10 @@
++vflag;
break;
+ case 'V':
+ VFileName = optarg;
+ break;
+
case 'w':
WFileName = optarg;
break;
@@ -781,6 +1082,15 @@
}
break;
#endif
+ case 'z':
+ if (optarg) {
+ zflag = strdup(optarg);
+ } else {
+ usage();
+ /* NOTREACHED */
+ }
+ break;
+
case 'Z':
if (optarg) {
username = strdup(optarg);
@@ -806,13 +1116,20 @@
case 1: /* No time stamp */
case 2: /* Unix timeval style */
case 3: /* Microseconds since previous packet */
+ case 5: /* Microseconds since first packet */
break;
default: /* Not supported */
- error("only -t, -tt, -ttt, and -tttt are supported");
+ error("only -t, -tt, -ttt, -tttt and -ttttt are supported");
break;
}
+ if (fflag != 0 && (VFileName != NULL || RFileName != NULL))
+ error("-f can not be used with -V or -r");
+
+ if (VFileName != NULL && RFileName != NULL)
+ error("-V and -r are mutually exclusive.");
+
#ifdef WITH_CHROOT
/* if run as root, prepare for chrooting */
if (getuid() == 0 || geteuid() == 0) {
@@ -831,10 +1148,16 @@
}
#endif
- if (RFileName != NULL) {
- int dlt;
- const char *dlt_name;
-
+ if (RFileName != NULL || VFileName != NULL) {
+ /*
+ * If RFileName is non-null, it's the pathname of a
+ * savefile to read. If VFileName is non-null, it's
+ * the pathname of a file containing a list of pathnames
+ * (one per line) of savefiles to read.
+ *
+ * In either case, we're reading a savefile, not doing
+ * a live capture.
+ */
#ifndef WIN32
/*
* We don't need network access, so relinquish any set-UID
@@ -848,6 +1171,21 @@
if (setgid(getgid()) != 0 || setuid(getuid()) != 0 )
fprintf(stderr, "Warning: setgid/setuid failed !\n");
#endif /* WIN32 */
+ if (VFileName != NULL) {
+ if (VFileName[0] == '-' && VFileName[1] == '\0')
+ VFile = stdin;
+ else
+ VFile = fopen(VFileName, "r");
+
+ if (VFile == NULL)
+ error("Unable to open file: %s\n", strerror(errno));
+
+ ret = get_next_file(VFile, VFileLine);
+ if (!ret)
+ error("Nothing in %s\n", VFileName);
+ RFileName = VFileLine;
+ }
+
pd = pcap_open_offline(RFileName, ebuf);
if (pd == NULL)
error("%s", ebuf);
@@ -864,9 +1202,10 @@
}
localnet = 0;
netmask = 0;
- if (fflag != 0)
- error("-f and -r options are incompatible");
} else {
+ /*
+ * We're doing a live capture.
+ */
if (device == NULL) {
device = pcap_lookupdev(ebuf);
if (device == NULL)
@@ -873,6 +1212,10 @@
error("%s", ebuf);
}
#ifdef WIN32
+ /*
+ * Print a message to the standard error on Windows.
+ * XXX - why do it here, with a different message?
+ */
if(strlen(device) == 1) //we assume that an ASCII string is always longer than 1 char
{ //a Unicode string has a \0 as second byte (so strlen() is 1)
fprintf(stderr, "%s: listening on %ws\n", program_name, device);
@@ -884,6 +1227,86 @@
fflush(stderr);
#endif /* WIN32 */
+#ifdef HAVE_PCAP_CREATE
+ pd = pcap_create(device, ebuf);
+ if (pd == NULL)
+ error("%s", ebuf);
+#ifdef HAVE_PCAP_SET_TSTAMP_TYPE
+ if (Jflag)
+ show_tstamp_types_and_exit(device, pd);
+#endif
+ /*
+ * Is this an interface that supports monitor mode?
+ */
+ if (pcap_can_set_rfmon(pd) == 1)
+ supports_monitor_mode = 1;
+ else
+ supports_monitor_mode = 0;
+ status = pcap_set_snaplen(pd, snaplen);
+ if (status != 0)
+ error("%s: Can't set snapshot length: %s",
+ device, pcap_statustostr(status));
+ status = pcap_set_promisc(pd, !pflag);
+ if (status != 0)
+ error("%s: Can't set promiscuous mode: %s",
+ device, pcap_statustostr(status));
+ if (Iflag) {
+ status = pcap_set_rfmon(pd, 1);
+ if (status != 0)
+ error("%s: Can't set monitor mode: %s",
+ device, pcap_statustostr(status));
+ }
+ status = pcap_set_timeout(pd, 1000);
+ if (status != 0)
+ error("%s: pcap_set_timeout failed: %s",
+ device, pcap_statustostr(status));
+ if (Bflag != 0) {
+ status = pcap_set_buffer_size(pd, Bflag);
+ if (status != 0)
+ error("%s: Can't set buffer size: %s",
+ device, pcap_statustostr(status));
+ }
+#ifdef HAVE_PCAP_SET_TSTAMP_TYPE
+ if (jflag != -1) {
+ status = pcap_set_tstamp_type(pd, jflag);
+ if (status < 0)
+ error("%s: Can't set time stamp type: %s",
+ device, pcap_statustostr(status));
+ }
+#endif
+ status = pcap_activate(pd);
+ if (status < 0) {
+ /*
+ * pcap_activate() failed.
+ */
+ cp = pcap_geterr(pd);
+ if (status == PCAP_ERROR)
+ error("%s", cp);
+ else if ((status == PCAP_ERROR_NO_SUCH_DEVICE ||
+ status == PCAP_ERROR_PERM_DENIED) &&
+ *cp != '\0')
+ error("%s: %s\n(%s)", device,
+ pcap_statustostr(status), cp);
+ else
+ error("%s: %s", device,
+ pcap_statustostr(status));
+ } else if (status > 0) {
+ /*
+ * pcap_activate() succeeded, but it's warning us
+ * of a problem it had.
+ */
+ cp = pcap_geterr(pd);
+ if (status == PCAP_WARNING)
+ warning("%s", cp);
+ else if (status == PCAP_WARNING_PROMISC_NOTSUP &&
+ *cp != '\0')
+ warning("%s: %s\n(%s)", device,
+ pcap_statustostr(status), cp);
+ else
+ warning("%s: %s", device,
+ pcap_statustostr(status));
+ }
+#else
*ebuf = '\0';
pd = pcap_open_live(device, snaplen, !pflag, 1000, ebuf);
if (pd == NULL)
@@ -890,6 +1313,7 @@
error("%s", ebuf);
else if (*ebuf)
warning("%s", ebuf);
+#endif /* HAVE_PCAP_CREATE */
/*
* Let user own process after socket has been opened.
*/
@@ -897,14 +1321,14 @@
if (setgid(getgid()) != 0 || setuid(getuid()) != 0)
fprintf(stderr, "Warning: setgid/setuid failed !\n");
#endif /* WIN32 */
-#ifdef WIN32
- if(UserBufferSize != 1000000)
- if(pcap_setbuff(pd, UserBufferSize)==-1){
+#if !defined(HAVE_PCAP_CREATE) && defined(WIN32)
+ if(Bflag != 0)
+ if(pcap_setbuff(pd, Bflag)==-1){
error("%s", pcap_geterr(pd));
}
-#endif /* WIN32 */
+#endif /* !defined(HAVE_PCAP_CREATE) && defined(WIN32) */
if (Lflag)
- show_dlts_and_exit(pd);
+ show_dlts_and_exit(device, pd);
if (gndo->ndo_dlt >= 0) {
#ifdef HAVE_PCAP_SET_DATALINK
if (pcap_set_datalink(pd, gndo->ndo_dlt) < 0)
@@ -921,7 +1345,7 @@
}
#endif
(void)fprintf(stderr, "%s: data link type %s\n",
- program_name, gndo->ndo_dltname);
+ program_name, gndo->ndo_dltname);
(void)fflush(stderr);
}
i = pcap_snapshot(pd);
@@ -945,15 +1369,20 @@
if (dflag) {
bpf_dump(&fcode, dflag);
pcap_close(pd);
+ free(cmdbuf);
exit(0);
}
init_addrtoname(localnet, netmask);
+ init_checksum();
#ifndef WIN32
(void)setsignal(SIGPIPE, cleanup);
-#endif /* WIN32 */
(void)setsignal(SIGTERM, cleanup);
(void)setsignal(SIGINT, cleanup);
+#endif /* WIN32 */
+#if defined(HAVE_FORK) || defined(HAVE_VFORK)
+ (void)setsignal(SIGCHLD, child_cleanup);
+#endif
/* Cooperate with nohup(1) */
#ifndef WIN32
if ((oldhandler = setsignal(SIGHUP, cleanup)) != SIG_DFL)
@@ -960,19 +1389,76 @@
(void)setsignal(SIGHUP, oldhandler);
#endif /* WIN32 */
+#ifndef WIN32
+ /*
+ * If a user name was specified with "-Z", attempt to switch to
+ * that user's UID. This would probably be used with sudo,
+ * to allow tcpdump to be run in a special restricted
+ * account (if you just want to allow users to open capture
+ * devices, and can't just give users that permission,
+ * you'd make tcpdump set-UID or set-GID).
+ *
+ * Tcpdump doesn't necessarily write only to one savefile;
+ * the general only way to allow a -Z instance to write to
+ * savefiles as the user under whose UID it's run, rather
+ * than as the user specified with -Z, would thus be to switch
+ * to the original user ID before opening a capture file and
+ * then switch back to the -Z user ID after opening the savefile.
+ * Switching to the -Z user ID only after opening the first
+ * savefile doesn't handle the general case.
+ */
+
+#ifdef HAVE_CAP_NG_H
+ /* We are running as root and we will be writing to savefile */
+ if ((getuid() == 0 || geteuid() == 0) && WFileName) {
+ if (username) {
+ /* Drop all capabilities from effective set */
+ capng_clear(CAPNG_EFFECTIVE);
+ /* Add capabilities we will need*/
+ capng_update(CAPNG_ADD, CAPNG_PERMITTED, CAP_SETUID);
+ capng_update(CAPNG_ADD, CAPNG_PERMITTED, CAP_SETGID);
+ capng_update(CAPNG_ADD, CAPNG_PERMITTED, CAP_DAC_OVERRIDE);
+
+ capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_SETUID);
+ capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_SETGID);
+ capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE);
+
+ capng_apply(CAPNG_SELECT_BOTH);
+ }
+ }
+#endif /* HAVE_CAP_NG_H */
+
+ if (getuid() == 0 || geteuid() == 0) {
+ if (username || chroot_dir)
+ droproot(username, chroot_dir);
+
+ }
+#endif /* WIN32 */
+
if (pcap_setfilter(pd, &fcode) < 0)
error("%s", pcap_geterr(pd));
if (WFileName) {
pcap_dumper_t *p;
+ /* Do not exceed the default PATH_MAX for files. */
+ dumpinfo.CurrentFileName = (char *)malloc(PATH_MAX + 1);
- WFileNameAlt = (char *)malloc(strlen(WFileName) + MAX_CFLAG_CHARS + 1);
- if (WFileNameAlt == NULL)
- error("malloc of WFileNameAlt");
- MakeFilename(WFileNameAlt, WFileName, 0, WflagChars);
- p = pcap_dump_open(pd, WFileNameAlt);
+ if (dumpinfo.CurrentFileName == NULL)
+ error("malloc of dumpinfo.CurrentFileName");
+
+ /* We do not need numbering for dumpfiles if Cflag isn't set. */
+ if (Cflag != 0)
+ MakeFilename(dumpinfo.CurrentFileName, WFileName, 0, WflagChars);
+ else
+ MakeFilename(dumpinfo.CurrentFileName, WFileName, 0, 0);
+
+ p = pcap_dump_open(pd, dumpinfo.CurrentFileName);
+#ifdef HAVE_CAP_NG_H
+ /* Give up capabilities, clear Effective set */
+ capng_clear(CAPNG_EFFECTIVE);
+#endif
if (p == NULL)
error("%s", pcap_geterr(pd));
- if (Cflag != 0) {
+ if (Cflag != 0 || Gflag != 0) {
callback = dump_packet_and_trunc;
dumpinfo.WFileName = WFileName;
dumpinfo.pd = pd;
@@ -982,32 +1468,24 @@
callback = dump_packet;
pcap_userdata = (u_char *)p;
}
+#ifdef HAVE_PCAP_DUMP_FLUSH
+ if (Uflag)
+ pcap_dump_flush(p);
+#endif
} else {
type = pcap_datalink(pd);
- printinfo.printer = lookup_printer(type);
- if (printinfo.printer == NULL) {
- gndo->ndo_dltname = pcap_datalink_val_to_name(type);
- if (gndo->ndo_dltname != NULL)
- error("unsupported data link type %s",
- gndo->ndo_dltname);
- else
- error("unsupported data link type %d", type);
- }
+ printinfo = get_print_info(type);
callback = print_packet;
pcap_userdata = (u_char *)&printinfo;
}
-#ifndef WIN32
+
+#ifdef SIGNAL_REQ_INFO
/*
- * We cannot do this earlier, because we want to be able to open
- * the file (if done) for writing before giving up permissions.
+ * We can't get statistics when reading from a file rather
+ * than capturing from a device.
*/
- if (getuid() == 0 || geteuid() == 0) {
- if (username || chroot_dir)
- droproot(username, chroot_dir);
- }
-#endif /* WIN32 */
-#ifdef SIGINFO
- (void)setsignal(SIGINFO, requestinfo);
+ if (RFileName == NULL)
+ (void)setsignal(SIGNAL_REQ_INFO, requestinfo);
#endif
if (vflag > 0 && WFileName) {
@@ -1028,9 +1506,11 @@
#ifndef WIN32
if (RFileName == NULL) {
- int dlt;
- const char *dlt_name;
-
+ /*
+ * Live capture (if -V was specified, we set RFileName
+ * to a file from the -V file). Print a message to
+ * the standard error on UN*X.
+ */
if (!vflag && !WFileName) {
(void)fprintf(stderr,
"%s: verbose output suppressed, use -v or -vv for full protocol decode\n",
@@ -1050,37 +1530,69 @@
(void)fflush(stderr);
}
#endif /* WIN32 */
- status = pcap_loop(pd, cnt, callback, pcap_userdata);
- if (WFileName == NULL) {
- /*
- * We're printing packets. Flush the printed output,
- * so it doesn't get intermingled with error output.
- */
- if (status == -2) {
+ do {
+ status = pcap_loop(pd, cnt, callback, pcap_userdata);
+ if (WFileName == NULL) {
/*
- * We got interrupted, so perhaps we didn't
- * manage to finish a line we were printing.
- * Print an extra newline, just in case.
+ * We're printing packets. Flush the printed output,
+ * so it doesn't get intermingled with error output.
*/
- putchar('\n');
+ if (status == -2) {
+ /*
+ * We got interrupted, so perhaps we didn't
+ * manage to finish a line we were printing.
+ * Print an extra newline, just in case.
+ */
+ putchar('\n');
+ }
+ (void)fflush(stdout);
}
- (void)fflush(stdout);
+ if (status == -1) {
+ /*
+ * Error. Report it.
+ */
+ (void)fprintf(stderr, "%s: pcap_loop: %s\n",
+ program_name, pcap_geterr(pd));
+ }
+ if (RFileName == NULL) {
+ /*
+ * We're doing a live capture. Report the capture
+ * statistics.
+ */
+ info(1);
+ }
+ pcap_close(pd);
+ if (VFileName != NULL) {
+ ret = get_next_file(VFile, VFileLine);
+ if (ret) {
+ RFileName = VFileLine;
+ pd = pcap_open_offline(RFileName, ebuf);
+ if (pd == NULL)
+ error("%s", ebuf);
+ new_dlt = pcap_datalink(pd);
+ if (WFileName && new_dlt != dlt)
+ error("%s: new dlt does not match original", RFileName);
+ printinfo = get_print_info(new_dlt);
+ dlt_name = pcap_datalink_val_to_name(new_dlt);
+ if (dlt_name == NULL) {
+ fprintf(stderr, "reading from file %s, link-type %u\n",
+ RFileName, new_dlt);
+ } else {
+ fprintf(stderr,
+ "reading from file %s, link-type %s (%s)\n",
+ RFileName, dlt_name,
+ pcap_datalink_val_to_description(new_dlt));
+ }
+ if (pcap_compile(pd, &fcode, cmdbuf, Oflag, netmask) < 0)
+ error("%s", pcap_geterr(pd));
+ if (pcap_setfilter(pd, &fcode) < 0)
+ error("%s", pcap_geterr(pd));
+ }
+ }
}
- if (status == -1) {
- /*
- * Error. Report it.
- */
- (void)fprintf(stderr, "%s: pcap_loop: %s\n",
- program_name, pcap_geterr(pd));
- }
- if (RFileName == NULL) {
- /*
- * We're doing a live capture. Report the capture
- * statistics.
- */
- info(1);
- }
- pcap_close(pd);
+ while (ret != NULL);
+
+ free(cmdbuf);
exit(status == -1 ? 1 : 0);
}
@@ -1125,11 +1637,28 @@
#endif
}
+/*
+ On windows, we do not use a fork, so we do not care less about
+ waiting a child processes to die
+ */
+#if defined(HAVE_FORK) || defined(HAVE_VFORK)
+static RETSIGTYPE
+child_cleanup(int signo _U_)
+{
+ wait(NULL);
+}
+#endif /* HAVE_FORK && HAVE_VFORK */
+
static void
info(register int verbose)
{
struct pcap_stat stat;
+ /*
+ * Older versions of libpcap didn't set ps_ifdrop on some
+ * platforms; initialize it to 0 to handle that.
+ */
+ stat.ps_ifdrop = 0;
if (pcap_stats(pd, &stat) < 0) {
(void)fprintf(stderr, "pcap_stats: %s\n", pcap_geterr(pd));
infoprint = 0;
@@ -1139,25 +1668,75 @@
if (!verbose)
fprintf(stderr, "%s: ", program_name);
- (void)fprintf(stderr, "%u packets captured", packets_captured);
+ (void)fprintf(stderr, "%u packet%s captured", packets_captured,
+ PLURAL_SUFFIX(packets_captured));
if (!verbose)
fputs(", ", stderr);
else
putc('\n', stderr);
- (void)fprintf(stderr, "%d packets received by filter", stat.ps_recv);
+ (void)fprintf(stderr, "%u packet%s received by filter", stat.ps_recv,
+ PLURAL_SUFFIX(stat.ps_recv));
if (!verbose)
fputs(", ", stderr);
else
putc('\n', stderr);
- (void)fprintf(stderr, "%d packets dropped by kernel\n", stat.ps_drop);
+ (void)fprintf(stderr, "%u packet%s dropped by kernel", stat.ps_drop,
+ PLURAL_SUFFIX(stat.ps_drop));
+ if (stat.ps_ifdrop != 0) {
+ if (!verbose)
+ fputs(", ", stderr);
+ else
+ putc('\n', stderr);
+ (void)fprintf(stderr, "%u packet%s dropped by interface\n",
+ stat.ps_ifdrop, PLURAL_SUFFIX(stat.ps_ifdrop));
+ } else
+ putc('\n', stderr);
infoprint = 0;
}
+#if defined(HAVE_FORK) || defined(HAVE_VFORK)
static void
+compress_savefile(const char *filename)
+{
+# ifdef HAVE_FORK
+ if (fork())
+# else
+ if (vfork())
+# endif
+ return;
+ /*
+ * Set to lowest priority so that this doesn't disturb the capture
+ */
+#ifdef NZERO
+ setpriority(PRIO_PROCESS, 0, NZERO - 1);
+#else
+ setpriority(PRIO_PROCESS, 0, 19);
+#endif
+ if (execlp(zflag, zflag, filename, (char *)NULL) == -1)
+ fprintf(stderr,
+ "compress_savefile:execlp(%s, %s): %s\n",
+ zflag,
+ filename,
+ strerror(errno));
+# ifdef HAVE_FORK
+ exit(1);
+# else
+ _exit(1);
+# endif
+}
+#else /* HAVE_FORK && HAVE_VFORK */
+static void
+compress_savefile(const char *filename)
+{
+ fprintf(stderr,
+ "compress_savefile failed. Functionality not implemented under your system\n");
+}
+#endif /* HAVE_FORK && HAVE_VFORK */
+
+static void
dump_packet_and_trunc(u_char *user, const struct pcap_pkthdr *h, const u_char *sp)
{
struct dump_info *dump_info;
- char *name;
++packets_captured;
@@ -1166,29 +1745,111 @@
dump_info = (struct dump_info *)user;
/*
+ * XXX - this won't force the file to rotate on the specified time
+ * boundary, but it will rotate on the first packet received after the
+ * specified Gflag number of seconds. Note: if a Gflag time boundary
+ * and a Cflag size boundary coincide, the time rotation will occur
+ * first thereby cancelling the Cflag boundary (since the file should
+ * be 0).
+ */
+ if (Gflag != 0) {
+ /* Check if it is time to rotate */
+ time_t t;
+
+ /* Get the current time */
+ if ((t = time(NULL)) == (time_t)-1) {
+ error("dump_and_trunc_packet: can't get current_time: %s",
+ pcap_strerror(errno));
+ }
+
+
+ /* If the time is greater than the specified window, rotate */
+ if (t - Gflag_time >= Gflag) {
+ /* Update the Gflag_time */
+ Gflag_time = t;
+ /* Update Gflag_count */
+ Gflag_count++;
+ /*
+ * Close the current file and open a new one.
+ */
+ pcap_dump_close(dump_info->p);
+
+ /*
+ * Compress the file we just closed, if the user asked for it
+ */
+ if (zflag != NULL)
+ compress_savefile(dump_info->CurrentFileName);
+
+ /*
+ * Check to see if we've exceeded the Wflag (when
+ * not using Cflag).
+ */
+ if (Cflag == 0 && Wflag > 0 && Gflag_count >= Wflag) {
+ (void)fprintf(stderr, "Maximum file limit reached: %d\n",
+ Wflag);
+ exit(0);
+ /* NOTREACHED */
+ }
+ if (dump_info->CurrentFileName != NULL)
+ free(dump_info->CurrentFileName);
+ /* Allocate space for max filename + \0. */
+ dump_info->CurrentFileName = (char *)malloc(PATH_MAX + 1);
+ if (dump_info->CurrentFileName == NULL)
+ error("dump_packet_and_trunc: malloc");
+ /*
+ * This is always the first file in the Cflag
+ * rotation: e.g. 0
+ * We also don't need numbering if Cflag is not set.
+ */
+ if (Cflag != 0)
+ MakeFilename(dump_info->CurrentFileName, dump_info->WFileName, 0,
+ WflagChars);
+ else
+ MakeFilename(dump_info->CurrentFileName, dump_info->WFileName, 0, 0);
+
+#ifdef HAVE_CAP_NG_H
+ capng_update(CAPNG_ADD, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE);
+ capng_apply(CAPNG_EFFECTIVE);
+#endif /* HAVE_CAP_NG_H */
+ dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName);
+#ifdef HAVE_CAP_NG_H
+ capng_update(CAPNG_DROP, CAPNG_EFFECTIVE, CAP_DAC_OVERRIDE);
+ capng_apply(CAPNG_EFFECTIVE);
+#endif /* HAVE_CAP_NG_H */
+ if (dump_info->p == NULL)
+ error("%s", pcap_geterr(pd));
+ }
+ }
+
+ /*
* XXX - this won't prevent capture files from getting
* larger than Cflag - the last packet written to the
* file could put it over Cflag.
*/
- if (pcap_dump_ftell(dump_info->p) > Cflag) {
+ if (Cflag != 0 && pcap_dump_ftell(dump_info->p) > Cflag) {
/*
* Close the current file and open a new one.
*/
pcap_dump_close(dump_info->p);
+
+ /*
+ * Compress the file we just closed, if the user asked for it
+ */
+ if (zflag != NULL)
+ compress_savefile(dump_info->CurrentFileName);
+
Cflag_count++;
if (Wflag > 0) {
if (Cflag_count >= Wflag)
Cflag_count = 0;
- } else {
- if (Cflag_count >= MAX_CFLAG)
- error("too many output files");
}
- name = (char *)malloc(strlen(dump_info->WFileName) + MAX_CFLAG_CHARS + 1);
- if (name == NULL)
+ if (dump_info->CurrentFileName != NULL)
+ free(dump_info->CurrentFileName);
+ dump_info->CurrentFileName = (char *)malloc(PATH_MAX + 1);
+ if (dump_info->CurrentFileName == NULL)
error("dump_packet_and_trunc: malloc");
- MakeFilename(name, dump_info->WFileName, Cflag_count, WflagChars);
- dump_info->p = pcap_dump_open(dump_info->pd, name);
- free(name);
+ MakeFilename(dump_info->CurrentFileName, dump_info->WFileName, Cflag_count, WflagChars);
+ dump_info->p = pcap_dump_open(dump_info->pd, dump_info->CurrentFileName);
if (dump_info->p == NULL)
error("%s", pcap_geterr(pd));
}
@@ -1242,7 +1903,12 @@
*/
snapend = sp + h->caplen;
- hdrlen = (*print_info->printer)(h, sp);
+ if(print_info->ndo_type) {
+ hdrlen = (*print_info->p.ndo_printer)(print_info->ndo, h, sp);
+ } else {
+ hdrlen = (*print_info->p.printer)(h, sp);
+ }
+
if (Xflag) {
/*
* Print the raw packet data in hex and ASCII.
@@ -1350,7 +2016,7 @@
ndo_default_print(gndo, bp, length);
}
-#ifdef SIGINFO
+#ifdef SIGNAL_REQ_INFO
RETSIGTYPE requestinfo(int signo _U_)
{
if (infodelay)
@@ -1365,7 +2031,7 @@
*/
#ifdef USE_WIN32_MM_TIMER
void CALLBACK verbose_stats_dump (UINT timer_id _U_, UINT msg _U_, DWORD_PTR arg _U_,
- DWORD_PTR dw1 _U_, DWORD_PTR dw2 _U_)
+ DWORD_PTR dw1 _U_, DWORD_PTR dw2 _U_)
{
struct pcap_stat stat;
@@ -1412,15 +2078,17 @@
#endif /* WIN32 */
#endif /* HAVE_PCAP_LIB_VERSION */
(void)fprintf(stderr,
-"Usage: %s [-aAd" D_FLAG "eflLnNOpqRStu" U_FLAG "vxX]" B_FLAG_USAGE " [-c count] [ -C file_size ]\n", program_name);
+"Usage: %s [-aAbd" D_FLAG "efhH" I_FLAG J_FLAG "KlLnNOpqRStu" U_FLAG "vxX]" B_FLAG_USAGE " [ -c count ]\n", program_name);
(void)fprintf(stderr,
-"\t\t[ -E algo:secret ] [ -F file ] [ -i interface ] [ -M secret ]\n");
+"\t\t[ -C file_size ] [ -E algo:secret ] [ -F file ] [ -G seconds ]\n");
(void)fprintf(stderr,
-"\t\t[ -r file ] [ -s snaplen ] [ -T type ] [ -w file ]\n");
+"\t\t[ -i interface ]" j_FLAG_USAGE " [ -M secret ]\n");
(void)fprintf(stderr,
-"\t\t[ -W filecount ] [ -y datalinktype ] [ -Z user ]\n");
+"\t\t[ -r file ] [ -s snaplen ] [ -T type ] [ -V file ] [ -w file ]\n");
(void)fprintf(stderr,
-"\t\t[ expression ]\n");
+"\t\t[ -W filecount ] [ -y datalinktype ] [ -z command ]\n");
+ (void)fprintf(stderr,
+"\t\t[ -Z user ] [ expression ]\n");
exit(1);
}
@@ -1461,4 +2129,3 @@
(void)fputc('\n', stderr);
}
}
-
Modified: trunk/contrib/tcpdump/telnet.h
===================================================================
--- trunk/contrib/tcpdump/telnet.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/telnet.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,6 +1,6 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/telnet.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/telnet.h,v 1.5 2007-08-29 02:31:44 mcr Exp $ (LBL) */
-/* $NetBSD: telnet.h,v 1.9 2001/06/11 01:50:50 wiz Exp $ */
+/* NetBSD: telnet.h,v 1.9 2001/06/11 01:50:50 wiz Exp */
/*
* Copyright (c) 1983, 1993
Modified: trunk/contrib/tcpdump/tftp.h
===================================================================
--- trunk/contrib/tcpdump/tftp.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/tftp.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/tftp.h,v 1.1.1.1 2009-03-25 16:54:05 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/tftp.h,v 1.2 2008-04-11 16:47:38 gianluca Exp $ (LBL) */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -49,7 +49,7 @@
#define WRQ 02 /* write request */
#define DATA 03 /* data packet */
#define ACK 04 /* acknowledgement */
-#define ERROR 05 /* error code */
+#define TFTP_ERROR 05 /* error code */
#define OACK 06 /* option acknowledgement */
struct tftphdr {
Modified: trunk/contrib/tcpdump/timed.h
===================================================================
--- trunk/contrib/tcpdump/timed.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/timed.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/timed.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/timed.h,v 1.6 2008-02-05 19:46:19 guy Exp $ (LBL) */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@@ -44,12 +44,17 @@
#define TSPVERSION 1
#define ANYADDR NULL
+struct tsp_timeval {
+ u_int32_t tv_sec;
+ u_int32_t tv_usec;
+};
+
struct tsp {
u_int8_t tsp_type;
u_int8_t tsp_vers;
u_int16_t tsp_seq;
union {
- struct timeval tspu_time;
+ struct tsp_timeval tspu_time;
int8_t tspu_hopcnt;
} tsp_u;
int8_t tsp_name[256];
Modified: trunk/contrib/tcpdump/token.h
===================================================================
--- trunk/contrib/tcpdump/token.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/token.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/token.h,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/token.h,v 1.6 2002-12-11 07:14:12 guy Exp $ (LBL) */
/*
* Copyright (c) 1998, Larry Lile
* All rights reserved.
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/contrib/tcpdump/token.h,v 1.4 2004/03/31 14:57:24 bms Exp $
+ * $FreeBSD: release/9.2.0/contrib/tcpdump/token.h 214478 2010-10-28 19:06:17Z rpaulo $
*/
#define TOKEN_HDRLEN 14
@@ -35,12 +35,12 @@
#define FRAME_TYPE(trp) (((trp)->token_fc & 0xC0) >> 6)
#define TOKEN_FC_LLC 1
-#define BROADCAST(trp) ((ntohs((trp)->token_rcf) & 0xE000) >> 13)
-#define RIF_LENGTH(trp) ((ntohs((trp)->token_rcf) & 0x1f00) >> 8)
-#define DIRECTION(trp) ((ntohs((trp)->token_rcf) & 0x0080) >> 7)
-#define LARGEST_FRAME(trp) ((ntohs((trp)->token_rcf) & 0x0070) >> 4)
-#define RING_NUMBER(trp, x) ((ntohs((trp)->token_rseg[x]) & 0xfff0) >> 4)
-#define BRIDGE_NUMBER(trp, x) ((ntohs((trp)->token_rseg[x]) & 0x000f))
+#define BROADCAST(trp) ((EXTRACT_16BITS(&(trp)->token_rcf) & 0xE000) >> 13)
+#define RIF_LENGTH(trp) ((EXTRACT_16BITS(&(trp)->token_rcf) & 0x1f00) >> 8)
+#define DIRECTION(trp) ((EXTRACT_16BITS(&(trp)->token_rcf) & 0x0080) >> 7)
+#define LARGEST_FRAME(trp) ((EXTRACT_16BITS(&(trp)->token_rcf) & 0x0070) >> 4)
+#define RING_NUMBER(trp, x) ((EXTRACT_16BITS(&(trp)->token_rseg[x]) & 0xfff0) >> 4)
+#define BRIDGE_NUMBER(trp, x) ((EXTRACT_16BITS(&(trp)->token_rseg[x]) & 0x000f))
#define SEGMENT_COUNT(trp) ((int)((RIF_LENGTH(trp) - 2) / 2))
struct token_header {
Modified: trunk/contrib/tcpdump/udp.h
===================================================================
--- trunk/contrib/tcpdump/udp.h 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/udp.h 2016-09-17 22:44:52 UTC (rev 8321)
@@ -1,4 +1,4 @@
-/* @(#) $Header: /home/cvs/src/contrib/tcpdump/udp.h,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL) */
+/* @(#) $Header: /tcpdump/master/tcpdump/udp.h,v 1.13 2007-08-08 17:20:58 hannes Exp $ (LBL) */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
@@ -76,14 +76,21 @@
#define HSRP_PORT 1985 /*XXX*/
#define LMP_PORT 701 /* rfc4204 */
#define LWRES_PORT 921
+#define VQP_PORT 1589
#define ZEPHYR_SRV_PORT 2103
#define ZEPHYR_CLT_PORT 2104
#define MPLS_LSP_PING_PORT 3503 /* draft-ietf-mpls-lsp-ping-02.txt */
#define BFD_CONTROL_PORT 3784 /* draft-katz-ward-bfd-v4v6-1hop-00.txt */
#define BFD_ECHO_PORT 3785 /* draft-katz-ward-bfd-v4v6-1hop-00.txt */
+#define SFLOW_PORT 6343 /* http://www.sflow.org/developers/specifications.php */
+#define LWAPP_DATA_PORT 12222 /* draft-ohara-capwap-lwapp-04.txt */
+#define LWAPP_CONTROL_PORT 12223 /* draft-ohara-capwap-lwapp-04.txt */
+#define OTV_PORT 8472 /* draft-hasmit-otv-04 */
#ifdef INET6
#define RIPNG_PORT 521 /*XXX*/
#define DHCP6_SERV_PORT 546 /*XXX*/
#define DHCP6_CLI_PORT 547 /*XXX*/
+#define BABEL_PORT 6696
+#define BABEL_PORT_OLD 6697
#endif
Modified: trunk/contrib/tcpdump/util.c
===================================================================
--- trunk/contrib/tcpdump/util.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/util.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/util.c,v 1.1.1.3 2009-03-25 16:54:05 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/util.c,v 1.109 2007-01-29 09:59:42 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -44,6 +44,8 @@
#include "interface.h"
+char * ts_format(register int, register int);
+
/*
* Print out a null-terminated filename (or other ascii string).
* If ep is NULL, assume no truncation check is needed.
@@ -139,6 +141,19 @@
}
/*
+ * Format the timestamp
+ */
+char *
+ts_format(register int sec, register int usec)
+{
+ static char buf[sizeof("00:00:00.000000")];
+ (void)snprintf(buf, sizeof(buf), "%02d:%02d:%02d.%06u",
+ sec / 3600, (sec % 3600) / 60, sec % 60, usec);
+
+ return buf;
+}
+
+/*
* Print the timestamp
*/
void
@@ -149,14 +164,14 @@
time_t Time;
static unsigned b_sec;
static unsigned b_usec;
+ int d_usec;
+ int d_sec;
switch (tflag) {
case 0: /* Default */
s = (tvp->tv_sec + thiszone) % 86400;
- (void)printf("%02d:%02d:%02d.%06u ",
- s / 3600, (s % 3600) / 60, s % 60,
- (unsigned)tvp->tv_usec);
+ (void)printf("%s ", ts_format(s, tvp->tv_usec));
break;
case 1: /* No time stamp */
@@ -169,22 +184,27 @@
break;
case 3: /* Microseconds since previous packet */
+ case 5: /* Microseconds since first packet */
if (b_sec == 0) {
- printf("000000 ");
- } else {
- int d_usec = tvp->tv_usec - b_usec;
- int d_sec = tvp->tv_sec - b_sec;
+ /* init timestamp for first packet */
+ b_usec = tvp->tv_usec;
+ b_sec = tvp->tv_sec;
+ }
- while (d_usec < 0) {
- d_usec += 1000000;
- d_sec--;
- }
- if (d_sec)
- printf("%d. ", d_sec);
- printf("%06d ", d_usec);
- }
- b_sec = tvp->tv_sec;
- b_usec = tvp->tv_usec;
+ d_usec = tvp->tv_usec - b_usec;
+ d_sec = tvp->tv_sec - b_sec;
+
+ while (d_usec < 0) {
+ d_usec += 1000000;
+ d_sec--;
+ }
+
+ (void)printf("%s ", ts_format(d_sec, d_usec));
+
+ if (tflag == 3) { /* set timestamp for last packet */
+ b_sec = tvp->tv_sec;
+ b_usec = tvp->tv_usec;
+ }
break;
case 4: /* Default + Date*/
@@ -194,10 +214,9 @@
if (!tm)
printf("Date fail ");
else
- printf("%04d-%02d-%02d ",
- tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
- printf("%02d:%02d:%02d.%06u ",
- s / 3600, (s % 3600) / 60, s % 60, (unsigned)tvp->tv_usec);
+ printf("%04d-%02d-%02d %s ",
+ tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
+ ts_format(s, tvp->tv_usec));
break;
}
}
@@ -297,11 +316,12 @@
/*
* Convert a bit token value to a string; use "fmt" if not found.
- * this is useful for parsing bitfields, the output strings are comma seperated
+ * this is useful for parsing bitfields, the output strings are seperated
+ * if the s field is positive.
*/
-char *
-bittok2str(register const struct tok *lp, register const char *fmt,
- register int v)
+static char *
+bittok2str_internal(register const struct tok *lp, register const char *fmt,
+ register int v, register int sep)
{
static char buf[256]; /* our stringbuffer */
int buflen=0;
@@ -308,7 +328,7 @@
register int rotbit; /* this is the bit we rotate through all bitpositions */
register int tokval;
- while (lp->s != NULL && lp != NULL) {
+ while (lp != NULL && lp->s != NULL) {
tokval=lp->v; /* load our first value */
rotbit=1;
while (rotbit != 0) {
@@ -318,7 +338,8 @@
*/
if (tokval == (v&rotbit)) {
/* ok we have found something */
- buflen+=snprintf(buf+buflen, sizeof(buf)-buflen, "%s, ",lp->s);
+ buflen+=snprintf(buf+buflen, sizeof(buf)-buflen, "%s%s",
+ lp->s, sep ? ", " : "");
break;
}
rotbit=rotbit<<1; /* no match - lets shift and try again */
@@ -326,6 +347,11 @@
lp++;
}
+ /* user didn't want string seperation - no need to cut off trailing seperators */
+ if (!sep) {
+ return (buf);
+ }
+
if (buflen != 0) { /* did we find anything */
/* yep, set the the trailing zero 2 bytes before to eliminate the last comma & whitespace */
buf[buflen-2] = '\0';
@@ -341,6 +367,28 @@
}
/*
+ * Convert a bit token value to a string; use "fmt" if not found.
+ * this is useful for parsing bitfields, the output strings are not seperated.
+ */
+char *
+bittok2str_nosep(register const struct tok *lp, register const char *fmt,
+ register int v)
+{
+ return (bittok2str_internal(lp, fmt, v, 0));
+}
+
+/*
+ * Convert a bit token value to a string; use "fmt" if not found.
+ * this is useful for parsing bitfields, the output strings are comma seperated.
+ */
+char *
+bittok2str(register const struct tok *lp, register const char *fmt,
+ register int v)
+{
+ return (bittok2str_internal(lp, fmt, v, 1));
+}
+
+/*
* Convert a value to a string using an array; the macro
* tok2strary() in <interface.h> is the public interface to
* this function and ensures that the second argument is
@@ -367,7 +415,7 @@
*/
int
-mask2plen (u_int32_t mask)
+mask2plen(u_int32_t mask)
{
u_int32_t bitmasks[33] = {
0x00000000,
@@ -391,6 +439,35 @@
return (prefix_len);
}
+#ifdef INET6
+int
+mask62plen(const u_char *mask)
+{
+ u_char bitmasks[9] = {
+ 0x00,
+ 0x80, 0xc0, 0xe0, 0xf0,
+ 0xf8, 0xfc, 0xfe, 0xff
+ };
+ int byte;
+ int cidr_len = 0;
+
+ for (byte = 0; byte < 16; byte++) {
+ u_int bits;
+
+ for (bits = 0; bits < (sizeof (bitmasks) / sizeof (bitmasks[0])); bits++) {
+ if (mask[byte] == bitmasks[bits]) {
+ cidr_len += bits;
+ break;
+ }
+ }
+
+ if (mask[byte] != 0xff)
+ break;
+ }
+ return (cidr_len);
+}
+#endif /* INET6 */
+
/* VARARGS */
void
error(const char *fmt, ...)
@@ -509,7 +586,8 @@
void
safeputs(const char *s, int maxlen)
{
- int idx = 0;
+ int idx = 0;
+
while (*s && idx < maxlen) {
safeputchar(*s);
idx++;
@@ -526,5 +604,5 @@
if (ch < 0x80 && isprint(ch))
printf("%c", ch);
else
- printf("\\%03o", ch);
+ printf("\\0x%02x", ch);
}
Modified: trunk/contrib/tcpdump/vfprintf.c
===================================================================
--- trunk/contrib/tcpdump/vfprintf.c 2016-09-17 22:41:55 UTC (rev 8320)
+++ trunk/contrib/tcpdump/vfprintf.c 2016-09-17 22:44:52 UTC (rev 8321)
@@ -21,7 +21,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /home/cvs/src/contrib/tcpdump/vfprintf.c,v 1.1.1.2 2006-02-25 02:34:04 laffer1 Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/vfprintf.c,v 1.6 2003-11-16 09:36:45 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
More information about the Midnightbsd-cvs
mailing list