From owner-svn-src-head@FreeBSD.ORG Mon May 14 05:12:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8050E1065670; Mon, 14 May 2012 05:12:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66E388FC1B; Mon, 14 May 2012 05:12:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4E5Cv9f016160; Mon, 14 May 2012 05:12:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4E5CvV9016150; Mon, 14 May 2012 05:12:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201205140512.q4E5CvV9016150@svn.freebsd.org> From: Xin LI Date: Mon, 14 May 2012 05:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235426 - in head: contrib/libpcap contrib/libpcap/bpf/net contrib/libpcap/packaging contrib/libpcap/pcap contrib/libpcap/test lib/libpcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2012 05:12:57 -0000 Author: delphij Date: Mon May 14 05:12:56 2012 New Revision: 235426 URL: http://svn.freebsd.org/changeset/base/235426 Log: Merge from vendor branch: update libpcap to 1.2.1. MFC after: 2 weeks Added: head/contrib/libpcap/pcap-netfilter-linux.c - copied unchanged from r235294, vendor/libpcap/dist/pcap-netfilter-linux.c head/contrib/libpcap/pcap-netfilter-linux.h - copied unchanged from r235294, vendor/libpcap/dist/pcap-netfilter-linux.h head/contrib/libpcap/pcap-tstamp.manmisc.in - copied unchanged from r235294, vendor/libpcap/dist/pcap-tstamp.manmisc.in head/contrib/libpcap/pcap_list_tstamp_types.3pcap.in - copied unchanged from r235294, vendor/libpcap/dist/pcap_list_tstamp_types.3pcap.in head/contrib/libpcap/pcap_set_tstamp_type.3pcap.in - copied unchanged from r235294, vendor/libpcap/dist/pcap_set_tstamp_type.3pcap.in head/contrib/libpcap/pcap_tstamp_type_name_to_val.3pcap - copied unchanged from r235294, vendor/libpcap/dist/pcap_tstamp_type_name_to_val.3pcap head/contrib/libpcap/pcap_tstamp_type_val_to_name.3pcap - copied unchanged from r235294, vendor/libpcap/dist/pcap_tstamp_type_val_to_name.3pcap head/contrib/libpcap/test/ - copied from r235294, vendor/libpcap/dist/test/ Deleted: head/contrib/libpcap/filtertest.c head/contrib/libpcap/findalldevstest.c head/contrib/libpcap/opentest.c head/contrib/libpcap/pcap_free_datalinks.3pcap head/contrib/libpcap/pcap_freealldevs.3pcap head/contrib/libpcap/selpolltest.c Modified: head/contrib/libpcap/CHANGES head/contrib/libpcap/CREDITS head/contrib/libpcap/Makefile.in head/contrib/libpcap/README head/contrib/libpcap/VERSION head/contrib/libpcap/bpf/net/bpf_filter.c head/contrib/libpcap/config.h.in head/contrib/libpcap/configure head/contrib/libpcap/configure.in head/contrib/libpcap/ethertype.h head/contrib/libpcap/fad-getad.c head/contrib/libpcap/gencode.c head/contrib/libpcap/gencode.h head/contrib/libpcap/grammar.y head/contrib/libpcap/inet.c head/contrib/libpcap/packaging/pcap.spec.in head/contrib/libpcap/pcap-bpf.c head/contrib/libpcap/pcap-bt-linux.c head/contrib/libpcap/pcap-common.c head/contrib/libpcap/pcap-config.in head/contrib/libpcap/pcap-dag.c head/contrib/libpcap/pcap-dlpi.c head/contrib/libpcap/pcap-filter.manmisc head/contrib/libpcap/pcap-filter.manmisc.in head/contrib/libpcap/pcap-int.h head/contrib/libpcap/pcap-libdlpi.c head/contrib/libpcap/pcap-linktype.manmisc head/contrib/libpcap/pcap-linktype.manmisc.in head/contrib/libpcap/pcap-linux.c head/contrib/libpcap/pcap-savefile.manfile head/contrib/libpcap/pcap-stdinc.h head/contrib/libpcap/pcap-usb-linux.c head/contrib/libpcap/pcap-win32.c head/contrib/libpcap/pcap.3pcap head/contrib/libpcap/pcap.3pcap.in head/contrib/libpcap/pcap.c head/contrib/libpcap/pcap/bpf.h head/contrib/libpcap/pcap/pcap.h head/contrib/libpcap/pcap_activate.3pcap head/contrib/libpcap/pcap_can_set_rfmon.3pcap head/contrib/libpcap/pcap_compile.3pcap head/contrib/libpcap/pcap_compile.3pcap.in head/contrib/libpcap/pcap_datalink.3pcap head/contrib/libpcap/pcap_datalink.3pcap.in head/contrib/libpcap/pcap_datalink_name_to_val.3pcap head/contrib/libpcap/pcap_datalink_val_to_name.3pcap head/contrib/libpcap/pcap_dump_open.3pcap head/contrib/libpcap/pcap_fileno.3pcap head/contrib/libpcap/pcap_findalldevs.3pcap head/contrib/libpcap/pcap_get_selectable_fd.3pcap head/contrib/libpcap/pcap_list_datalinks.3pcap head/contrib/libpcap/pcap_list_datalinks.3pcap.in head/contrib/libpcap/pcap_loop.3pcap head/contrib/libpcap/pcap_major_version.3pcap head/contrib/libpcap/pcap_next_ex.3pcap head/contrib/libpcap/pcap_open_dead.3pcap head/contrib/libpcap/pcap_open_live.3pcap head/contrib/libpcap/pcap_open_offline.3pcap head/contrib/libpcap/pcap_set_datalink.3pcap head/contrib/libpcap/savefile.c head/contrib/libpcap/scanner.l head/contrib/libpcap/sf-pcap-ng.c head/contrib/libpcap/sf-pcap.c head/lib/libpcap/Makefile head/lib/libpcap/config.h Directory Properties: head/contrib/libpcap/ (props changed) Modified: head/contrib/libpcap/CHANGES ============================================================================== --- head/contrib/libpcap/CHANGES Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/CHANGES Mon May 14 05:12:56 2012 (r235426) @@ -1,3 +1,77 @@ +Friday December 9, 2011. guy@alum.mit.edu. +Summary for 1.2.1 libpcap release + Update README file. + Fix typoes in README.linux file. + Clean up some compiler warnings. + Fix Linux compile problems and tests for ethtool.h. + Treat Debian/kFreeBSD and GNU/Hurd as systems with GNU + toolchains. + Support 802.1 QinQ as a form of VLAN in filters. + Treat "carp" as equivalent to "vrrp" in filters. + Fix code generated for "ip6 protochain". + Add some new link-layer header types. + Support capturing NetFilter log messages on Linux. + Clean up some error messages. + Turn off monitor mode on exit for mac80211 interfaces on Linux. + Fix problems turning monitor mode on for non-mac80211 interfaces + on Linux. + Properly fail if /sys/class/net or /proc/net/dev exist but can't + be opened. + Fail if pcap_activate() is called on an already-activated + pcap_t, and add a test program for that. + Fix filtering in pcap-ng files. + Don't build for PowerPC on Mac OS X Lion. + Simplify handling of new DLT_/LINKTYPE_ values. + Expand pcap(3PCAP) man page. + +Sunday July 24, 2011. mcr@sandelman.ca. +Summary for 1.2 libpcap release + All of the changes listed below for 1.1.1 and 1.1.2. + Changes to error handling for pcap_findalldevs(). + Fix the calculation of the frame size in memory-mapped captures. + Add a link-layer header type for STANAG 5066 D_PDUs. + Add a link-layer type for a variant of 3GPP TS 27.010. + Noted real nature of LINKTYPE_ARCNET. + Add a link-layer type for DVB-CI. + Fix configure-script discovery of VLAN acceleration support. + see http://netoptimizer.blogspot.com/2010/09/tcpdump-vs-vlan-tags.html + Linux, HP-UX, AIX, NetBSD and OpenBSD compilation/conflict fixes. + Protect against including AIX 5.x's having been included. + Add DLT_DBUS, for raw D-Bus messages. + Treat either EPERM or EACCES as "no soup for you". + Changes to permissions on DLPI systems. + Add DLT_IEEE802_15_4_NOFCS for 802.15.4 interfaces. + +Fri. August 6, 2010. guy@alum.mit.edu. +Summary for 1.1.2 libpcap release + Return DLT_ values, not raw LINKTYPE_ values from + pcap_datalink() when reading pcap-ng files + Add support for "wlan ra" and "wlan ta", to check the RA and TA + of WLAN frames that have them + Don't crash if "wlan addr{1,2,3,4}" are used without 802.11 + headers + Do filtering on USB and Bluetooth capturing + On FreeBSD/SPARC64, use -fPIC - it's apparently necessary + Check for valid port numbers (fit in a 16-bit unsigned field) in + "port" filters + Reject attempts to put savefiles into non-blocking mode + Check for "no such device" for the "get the media types" ioctl + in *BSD + Improve error messages from bpf_open(), and let it do the error + handling + Return more specific errors from pcap_can_set_rfmon(); fix + documentation + Update description fetching code for FreeBSD, fix code for + OpenBSD + Ignore /sys/net/dev files if we get ENODEV for them, not just + ENXIO; fixes handling of bonding devices on Linux + Fix check for a constant 0 argument to BPF_DIV + Use the right version of ar when cross-building + Free any filter set on a savefile when the savefile is closed + Include the CFLAGS setting when configure was run in the + compiler flags + Add support for 802.15.4 interfaces on Linux + Thu. April 1, 2010. guy@alum.mit.edu. Summary for 1.1.1 libpcap release Update CHANGES to reflect more of the changes in 1.1.0. Modified: head/contrib/libpcap/CREDITS ============================================================================== --- head/contrib/libpcap/CREDITS Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/CREDITS Mon May 14 05:12:56 2012 (r235426) @@ -1,145 +1,154 @@ This file lists people who have contributed to libpcap: The current maintainers: - Bill Fenner - Fulvio Risso - Guy Harris - Hannes Gredler - Michael Richardson + Bill Fenner + Fulvio Risso + Guy Harris + Hannes Gredler + Michael Richardson Additional people who have contributed patches: - Alan Bawden - Albert Chin - Alexander 'Leo' Bergolth - Alexey Kuznetsov - Alon Bar-Lev - Andrew Brown - Antti Kantee - Arien Vijn - Arkadiusz Miskiewicz - Armando L. Caro Jr. - Assar Westerlund - Brian Ginsbach - Charles M. Hannum - Chris G. Demetriou - Chris Lightfoot - Chris Maynard - Chris Pepper - Christian Bell - Christian Peron - Daniele Orlandi - Darren Reed - David Kaelbling - David Young - Dean Gaudet - Don Ebright - Dug Song - Dustin Spicuzza - Eric Anderson - Erik de Castro Lopo - Felix Obenhuber - Florent Drouin - Franz Schaefer - Fulko Hew - Fumiyuki Shimizu - Gianluca Varenni - Gilbert Hoyek - Gisle Vanem - Graeme Hewson - Greg Stark - Greg Troxel - Gregor Maier - Guillaume Pelat - Hagen Paul Pfeifer - Hyung Sik Yoon - Igor Khristophorov - Jan-Philip Velders - Jason R. Thorpe - Javier Achirica - Jean Tourrilhes - Jean-Louis Charton - Jefferson Ogata - Jesper Peterson - Joerg Mayer - John Bankier - Jon Lindgren - Jon Smirl - Juergen Schoenwaelder - Jung-uk Kim - Kazushi Sugyo - Klaus Klein - Koryn Grant - Kris Katterjohn - Krzysztof Halasa - Lorenzo Cavallaro - Loris Degioanni - Love Hörnquist-Åstrand - Luis Martin Garcia - Maciej W. Rozycki - Marcus Felipe Pereira - Mark C. Brown - Mark Pizzolato - Markus Mayer - Martin Husemann - Márton Németh - Matthew Luckie - Max Laier - Mike Frysinger - Mike Kershaw - Mike Wiacek - Monroe Williams - N. Leiten - Nicolas Dade - Octavian Cerna - Olaf Kirch - Ollie Wild - Onno van der Linden - Paolo Abeni - Patrick Marie - Patrick McHardy - Paul Mundt - Pavel Kankovsky - Pawel Pokrywka - Peter Fales - Peter Jeremy - Peter Volkov - Phil Wood - Rafal Maszkowski - - Richard Stearn - Rick Jones - Robert Edmonds - Roberto Mariani - Romain Francoise - Sagun Shakya - Scott Barron - Scott Gifford - Sebastian Krahmer - Sebastien Roy - Sepherosa Ziehau - Shaun Clowes - Solomon Peachy - Stefan Hudson - Stephen Donnelly - Takashi Yamamoto - Tanaka Shin-ya - Tobias Poschwatta - Tony Li - Torsten Landschoff - Uns Lider - Uwe Girlich - Wesley Shields - Xianjie Zhang - Xin Li - Yen Yen Lim - Yvan Vanhullebus - Yoann Vandoorselaere + Alan Bawden + Albert Chin + Alexander 'Leo' Bergolth + Alexey Kuznetsov + Alon Bar-Lev + Andrew Brown + + Antti Kantee + Arien Vijn + Arkadiusz Miskiewicz + Armando L. Caro Jr. + Assar Westerlund + Brian Ginsbach + Charles M. Hannum + Chris G. Demetriou + Chris Lightfoot + Chris Maynard + Chris Pepper + Christian Bell + Christian Peron + Daniele Orlandi + Darren Reed + David Kaelbling + David Young + Dean Gaudet + Don Ebright + Dug Song + Dustin Spicuzza + Eric Anderson + Erik de Castro Lopo + Felix Obenhuber + Florent Drouin + Franz Schaefer + frederich + Fulko Hew + Fumiyuki Shimizu + Garrett Cooper + Gianluca Varenni + Gilbert Hoyek + Gisle Vanem + Graeme Hewson + Greg Stark + Greg Troxel + Gregor Maier + Guillaume Pelat + Hagen Paul Pfeifer + Henri Doreau + Hyung Sik Yoon + Igor Khristophorov + Jan-Philip Velders + Jason R. Thorpe + Javier Achirica + Jean Tourrilhes + Jean-Louis Charton + Jefferson Ogata + Jesper Dangaard Brouer + Jesper Peterson + Joerg Mayer + John Bankier + Jon Lindgren + Jon Smirl + Juergen Schoenwaelder + Julien Moutinho + Jung-uk Kim + Kazushi Sugyo + Klaus Klein + Koryn Grant + Kris Katterjohn + Krzysztof Halasa + Lorenzo Cavallaro + Loris Degioanni + Love Hörnquist-Åstrand + Luis MartinGarcia + Maciej W. Rozycki + Marcus Felipe Pereira + Mark C. Brown + Mark Pizzolato + Markus Mayer + Martin Husemann + Márton Németh + Matthew Luckie + Max Laier + Mike Frysinger + Mike Kershaw + Mike Wiacek + Miroslav Lichvar + Monroe Williams + + N. Leiten + Nicolas Dade + Octavian Cerna + Olaf Kirch + Ollie Wild + Onno van der Linden + Paolo Abeni + Patrick Marie + Patrick McHardy + Paul Mundt + Pavel Kankovsky + Pawel Pokrywka + Peter Fales + Peter Jeremy + Peter Volkov + Phil Wood + Rafal Maszkowski + + Richard Stearn + Rick Jones + Robert Edmonds + Roberto Mariani + Romain Francoise + Sagun Shakya + Scott Barron + Scott Gifford + Scott Mcmillan + Sebastian Krahmer + Sebastien Roy + Sepherosa Ziehau + Shaun Clowes + Solomon Peachy + Stefan Hudson + Stephen Donnelly + Takashi Yamamoto + Tanaka Shin-ya + Tobias Poschwatta + Tony Li + Torsten Landschoff + Uns Lider + Uwe Girlich + Wesley Shields + Xianjie Zhang + Xin Li + Yen Yen Lim + Yvan Vanhullebus + Yoann Vandoorselaere The original LBL crew: - Steve McCanne - Craig Leres - Van Jacobson + Steve McCanne + Craig Leres + Van Jacobson Past maintainers: - Jun-ichiro itojun Hagino + Jun-ichiro itojun Hagino Modified: head/contrib/libpcap/Makefile.in ============================================================================== --- head/contrib/libpcap/Makefile.in Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/Makefile.in Mon May 14 05:12:56 2012 (r235426) @@ -46,19 +46,21 @@ VPATH = @srcdir@ LD = /usr/bin/ld CC = @CC@ +AR = @AR@ CCOPT = @V_CCOPT@ INCLS = -I. @V_INCLS@ DEFS = @DEFS@ @V_DEFS@ ADDLOBJS = @ADDLOBJS@ ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@ LIBS = @LIBS@ +CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ DYEXT = @DYEXT@ V_RPATH_OPT = @V_RPATH_OPT@ PROG=libpcap # Standard CFLAGS -CFLAGS = $(CCOPT) $(INCLS) $(DEFS) +FULL_CFLAGS = $(CCOPT) $(INCLS) $(DEFS) $(CFLAGS) INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -78,9 +80,9 @@ YACC = @V_YACC@ # 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 -PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ +PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @CAN_SRC@ @NETFILTER_SRC@ FSRC = fad-@V_FINDALLDEVS@.c SSRC = @SSRC@ CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c \ @@ -123,14 +125,29 @@ HDR = $(PUBHDR) \ sf-pcap-ng.h \ sunatmpos.h +TESTS = \ + filtertest \ + findalldevstest \ + nonblocktest \ + opentest \ + selpolltest + +TESTS_SRC = \ + tests/filtertest.c \ + tests/findalldevstest.c \ + tests/nonblocktest.c \ + tests/opentest.c \ + tests/reactivatetest.c \ + tests/selpolltest.c + GENHDR = \ scanner.h tokdefs.h version.h TAGFILES = \ $(SRC) $(HDR) -CLEANFILES = $(OBJ) libpcap.* filtertest findalldevstest selpolltest \ - opentest $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \ +CLEANFILES = $(OBJ) libpcap.* $(TESTS) \ + $(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \ lex.yy.c pcap-config MAN1 = pcap-config.1 @@ -141,8 +158,10 @@ MAN3PCAP_EXPAND = \ pcap_datalink.3pcap.in \ pcap_dump_open.3pcap.in \ pcap_list_datalinks.3pcap.in \ + pcap_list_tstamp_types.3pcap.in \ pcap_open_dead.3pcap.in \ - pcap_open_offline.3pcap.in + pcap_open_offline.3pcap.in \ + pcap_set_tstamp_type.3pcap.in MAN3PCAP_NOEXPAND = \ pcap_activate.3pcap \ @@ -160,9 +179,7 @@ MAN3PCAP_NOEXPAND = \ pcap_file.3pcap \ pcap_fileno.3pcap \ pcap_findalldevs.3pcap \ - pcap_freealldevs.3pcap \ pcap_freecode.3pcap \ - pcap_free_datalinks.3pcap \ pcap_get_selectable_fd.3pcap \ pcap_geterr.3pcap \ pcap_inject.3pcap \ @@ -187,7 +204,9 @@ MAN3PCAP_NOEXPAND = \ pcap_snapshot.3pcap \ pcap_stats.3pcap \ pcap_statustostr.3pcap \ - pcap_strerror.3pcap + pcap_strerror.3pcap \ + pcap_tstamp_type_name_to_val.3pcap \ + pcap_tstamp_type_val_to_name.3pcap MAN3PCAP = $(MAN3PCAP_NOEXPAND) $(MAN3PCAP_EXPAND:.in=) @@ -196,9 +215,11 @@ MANFILE = \ MANMISC = \ pcap-filter.manmisc.in \ - pcap-linktype.manmisc.in + pcap-linktype.manmisc.in \ + pcap-tstamp.manmisc.in EXTRA_DIST = \ + $(TESTS_SRC) \ CHANGES \ ChmodBPF/ChmodBPF \ ChmodBPF/StartupParameters.plist \ @@ -237,8 +258,6 @@ EXTRA_DIST = \ fad-null.c \ fad-sita.c \ fad-win32.c \ - filtertest.c \ - findalldevstest.c \ grammar.y \ install-sh \ lbl/os-aix4.h \ @@ -263,7 +282,6 @@ EXTRA_DIST = \ msdos/pktdrvr.c \ msdos/pktdrvr.h \ msdos/readme.dos \ - opentest.c \ org.tcpdump.chmod_bpf.plist \ packaging/pcap.spec.in \ pcap-bpf.c \ @@ -282,6 +300,8 @@ EXTRA_DIST = \ pcap-libdlpi.c \ pcap-linux.c \ pcap-namedb.h \ + pcap-netfilter-linux.c \ + pcap-netfilter-linux.h \ pcap-nit.c \ pcap-null.c \ pcap-pf.c \ @@ -299,7 +319,6 @@ EXTRA_DIST = \ pcap-win32.c \ runlex.sh \ scanner.l \ - selpolltest.c \ Win32/Include/Gnuc.h \ Win32/Include/addrinfo.h \ Win32/Include/bittypes.h \ @@ -328,7 +347,7 @@ all: libpcap.a shared pcap-config libpcap.a: $(OBJ) @rm -f $@ - ar rc $@ $(OBJ) $(ADDLARCHIVEOBJS) + $(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS) $(RANLIB) $@ shared: libpcap.$(DYEXT) @@ -401,7 +420,7 @@ libpcap.sl: $(OBJ) libpcap.shareda: $(OBJ) @rm -f $@ shr.o $(CC) @V_SHLIB_OPT@ -o shr.o $(OBJ) $(ADDLOBJS) $(LDFLAGS) $(LIBS) - ar rc $@ shr.o + $(AR) rc $@ shr.o # # For platforms that don't support shared libraries (or on which we @@ -414,7 +433,7 @@ scanner.c: $(srcdir)/scanner.l $(srcdir)/runlex.sh $(LEX) -o$@ $< scanner.o: scanner.c tokdefs.h - $(CC) $(CFLAGS) -c scanner.c + $(CC) $(FULL_CFLAGS) -c scanner.c pcap.o: version.h @@ -427,13 +446,13 @@ grammar.c: $(srcdir)/grammar.y grammar.o: grammar.c @rm -f $@ - $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c + $(CC) $(FULL_CFLAGS) -Dyylval=pcap_lval -c grammar.c version.o: version.c - $(CC) $(CFLAGS) -c version.c + $(CC) $(FULL_CFLAGS) -c version.c snprintf.o: $(srcdir)/missing/snprintf.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c version.c: $(srcdir)/VERSION @rm -f $@ @@ -467,35 +486,47 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c bpf_filter.o: bpf_filter.c - $(CC) $(CFLAGS) -c bpf_filter.c + $(CC) $(FULL_CFLAGS) -c bpf_filter.c # # Generate the pcap-config script. # -pcap-config: $(srcdir)/pcap-config.in +# Some Makes, e.g. AIX Make and Solaris Make, can't handle "--file=$@.tmp:$<"; +# for example, the Solaris 9 make man page says +# +# Because make assigns $< and $* as it would for implicit rules +# (according to the suffixes list and the directory contents), +# they may be unreliable when used within explicit target entries. +# +# and this is an explicit target entry. +# +# Therefore, instead of using $<, we explicitly put in $(srcdir)/pcap-config.in. +# +pcap-config: $(srcdir)/pcap-config.in ./config.status @rm -f $@ $@.tmp - sed -e 's|@includedir[@]|$(includedir)|g' \ - -e 's|@libdir[@]|$(libdir)|g' \ - -e 's|@LIBS[@]|$(LIBS)|g' \ - -e 's|@V_RPATH_OPT[@]|$(V_RPATH_OPT)|g' \ - $(srcdir)/pcap-config.in >$@.tmp + ./config.status --file=$@.tmp:$(srcdir)/pcap-config.in mv $@.tmp $@ chmod a+x $@ # # Test programs - not built by default, and not installed. # -filtertest: filtertest.c libpcap.a - $(CC) $(CFLAGS) -I. -L. -o filtertest $(srcdir)/filtertest.c libpcap.a $(LIBS) +tests: $(TESTS) + +filtertest: tests/filtertest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o filtertest $(srcdir)/tests/filtertest.c libpcap.a $(LIBS) + +findalldevstest: tests/findalldevstest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o findalldevstest $(srcdir)/tests/findalldevstest.c libpcap.a $(LIBS) -findalldevstest: findalldevstest.c libpcap.a - $(CC) $(CFLAGS) -I. -L. -o findalldevstest $(srcdir)/findalldevstest.c libpcap.a $(LIBS) +nonblocktest: tests/nonblocktest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o nonblocktest $(srcdir)/tests/nonblocktest.c libpcap.a $(LIBS) -selpolltest: selpolltest.c libpcap.a - $(CC) $(CFLAGS) -I. -L. -o selpolltest $(srcdir)/selpolltest.c libpcap.a $(LIBS) +opentest: tests/opentest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o opentest $(srcdir)/tests/opentest.c libpcap.a $(LIBS) -opentest: opentest.c libpcap.a - $(CC) $(CFLAGS) -I. -L. -o opentest $(srcdir)/opentest.c libpcap.a $(LIBS) +selpolltest: tests/selpolltest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o selpolltest $(srcdir)/tests/selpolltest.c libpcap.a $(LIBS) install: install-shared install-archive pcap-config [ -d $(DESTDIR)$(libdir) ] || \ @@ -533,12 +564,21 @@ install: install-shared install-archive rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3pcap \ $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap + ln $(DESTDIR)$(mandir)/man3/pcap_findalldevs.3pcap \ + $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3pcap \ $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap ln $(DESTDIR)$(mandir)/man3/pcap_inject.3pcap \ $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap + ln $(DESTDIR)$(mandir)/man3/pcap_list_datalinks.3pcap \ + $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap + ln $(DESTDIR)$(mandir)/man3/pcap_list_tstamp_types.3pcap \ + $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap ln $(DESTDIR)$(mandir)/man3/pcap_loop.3pcap \ $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap @@ -622,8 +662,11 @@ uninstall: uninstall-shared rm -f $(DESTDIR)$(mandir)/man3/$$i; done rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap + rm -f $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap @@ -660,7 +703,7 @@ clean: distclean: clean rm -f Makefile config.cache config.log config.status \ - config.h gnuc.h os-proto.h bpf_filter.c pcap-config \ + config.h gnuc.h net os-proto.h bpf_filter.c pcap-config \ stamp-h stamp-h.in rm -f $(MAN3PCAP_EXPAND:.in=) $(MANFILE:.in=) $(MANMISC:.in=) rm -rf autom4te.cache Modified: head/contrib/libpcap/README ============================================================================== --- head/contrib/libpcap/README Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/README Mon May 14 05:12:56 2012 (r235426) @@ -63,13 +63,14 @@ added overhead (especially, for selectiv would translate BPF filters into a filter program that is compatible with the underlying kernel subsystem, but this is not yet implemented. -BPF is standard in 4.4BSD, BSD/OS, NetBSD, FreeBSD, and OpenBSD. DEC -OSF/1/Digital UNIX/Tru64 UNIX uses the packetfilter interface but has -been extended to accept BPF filters (which libpcap utilizes). Also, you -can add BPF filter support to Ultrix using the kernel source and/or -object patches available in: +BPF is standard in 4.4BSD, BSD/OS, NetBSD, FreeBSD, OpenBSD, DragonFly +BSD, and Mac OS X; an older, modified and undocumented version is +standard in AIX. {DEC OSF/1, Digital UNIX, Tru64 UNIX} uses the +packetfilter interface but has been extended to accept BPF filters +(which libpcap utilizes). Also, you can add BPF filter support to +Ultrix using the kernel source and/or object patches available in: - ftp://gatekeeper.dec.com/pub/DEC/net/bpfext42.tar.Z. + http://www.tcpdump.org/other/bpfext42.tar.Z Linux, in the 2.2 kernel and later kernels, has a "Socket Filter" mechanism that accepts BPF filters; see the README.linux file for Modified: head/contrib/libpcap/VERSION ============================================================================== --- head/contrib/libpcap/VERSION Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/VERSION Mon May 14 05:12:56 2012 (r235426) @@ -1 +1 @@ -1.1.1 +1.2.1 Modified: head/contrib/libpcap/bpf/net/bpf_filter.c ============================================================================== --- head/contrib/libpcap/bpf/net/bpf_filter.c Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/bpf/net/bpf_filter.c Mon May 14 05:12:56 2012 (r235426) @@ -619,7 +619,7 @@ bpf_validate(f, len) /* * Check for constant division by 0. */ - if (BPF_RVAL(p->code) == BPF_K && p->k == 0) + if (BPF_SRC(p->code) == BPF_K && p->k == 0) return 0; break; default: Modified: head/contrib/libpcap/config.h.in ============================================================================== --- head/contrib/libpcap/config.h.in Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/config.h.in Mon May 14 05:12:56 2012 (r235426) @@ -18,6 +18,9 @@ /* define if you have streams capable DAG API */ #undef HAVE_DAG_STREAMS_API +/* define if you have vdag_set_device_info() */ +#undef HAVE_DAG_VDAG + /* Define to 1 if you have the declaration of `ether_hostton', and to 0 if you don't. */ #undef HAVE_DECL_ETHER_HOSTTON @@ -52,12 +55,30 @@ /* if libnl exists */ #undef HAVE_LIBNL +/* if libnl exists and is version 2.x */ +#undef HAVE_LIBNL_2_x + /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_COMPILER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_ETHTOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IF_PACKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_NET_TSTAMP_H + /* if tp_vlan_tci exists */ #undef HAVE_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_TYPES_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_USBDEVICE_FS_H @@ -73,6 +94,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IF_ETHER_H +/* Define to 1 if you have the header file. */ +#undef HAVE_NETPACKET_IF_PACKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETPACKET_PACKET_H + /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_MEDIA_H @@ -217,6 +244,9 @@ /* target host supports CAN sniffing */ #undef PCAP_SUPPORT_CAN +/* target host supports netfilter sniffing */ +#undef PCAP_SUPPORT_NETFILTER + /* target host supports USB sniffing */ #undef PCAP_SUPPORT_USB Modified: head/contrib/libpcap/configure ============================================================================== --- head/contrib/libpcap/configure Mon May 14 05:10:41 2012 (r235425) +++ head/contrib/libpcap/configure Mon May 14 05:12:56 2012 (r235426) @@ -679,6 +679,7 @@ HAVE_LINUX_TPACKET_AUXDATA V_LEX V_YACC RANLIB +AR V_CCOPT V_DEFS V_FINDALLDEVS @@ -696,6 +697,8 @@ MAN_FILE_FORMATS MAN_MISC_INFO PCAP_SUPPORT_USB USB_SRC +PCAP_SUPPORT_NETFILTER +NETFILTER_SRC PCAP_SUPPORT_BT BT_SRC PCAP_SUPPORT_CAN @@ -1293,6 +1296,7 @@ Optional Features: getaddrinfo available] --enable-optimizer-dbg build optimizer debugging code --enable-yydebug build parser debugging code + --disable-universal don't build universal on OS X --enable-bluetooth enable Bluetooth support [default=yes, if support available] --enable-can enable CAN support [default=yes, if support @@ -3229,7 +3233,24 @@ _ACEOF # or accepts command-line arguments like # those the GNU linker accepts. # - V_CCOPT="$V_CCOPT -fpic" + # Some instruction sets require -fPIC on some + # operating systems. Check for them. If you + # have a combination that requires it, add it + # here. + # + PIC_OPT=-fpic + case "$host_cpu" in + + sparc64*) + case "$host_os" in + + freebsd*) + PIC_OPT=-fPIC + ;; + esac + ;; + esac + V_CCOPT="$V_CCOPT $PIC_OPT" V_SONAME_OPT="-Wl,-soname," V_RPATH_OPT="-Wl,-rpath," ;; @@ -5425,24 +5446,29 @@ fi done -for ac_header in net/pfvar.h +for ac_header in linux/types.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +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 - cat >conftest.$ac_ext <<_ACEOF + # 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. */ -#include -#include -#include - +$ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext @@ -5462,19 +5488,94 @@ eval "echo \"\$as_me:$LINENO: $ac_try_ec test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" + ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" + 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 cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -5484,29 +5585,33 @@ fi done -if test "$ac_cv_header_net_pfvar_h" = yes; then - # - # Check for various PF actions. - # - { echo "$as_me:$LINENO: checking whether net/pfvar.h defines PF_NAT through PF_NORDR" >&5 -echo $ECHO_N "checking whether net/pfvar.h defines PF_NAT through PF_NORDR... $ECHO_C" >&6; } - cat >conftest.$ac_ext <<_ACEOF + + + +for ac_header in linux/if_packet.h netpacket/packet.h netpacket/if_packet.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. */ -#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***