Skip to content

Commit

Permalink
Update libpcap to 1.2.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
david committed Apr 10, 2012
1 parent bf2ad73 commit 5d24d23
Show file tree
Hide file tree
Showing 111 changed files with 20,965 additions and 6,548 deletions.
74 changes: 74 additions & 0 deletions libpcap/CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
Friday December 9, 2011. [email protected].
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. [email protected].
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 <net/bpf.h> 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. [email protected].
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. [email protected].
Summary for 1.1.1 libpcap release
Update CHANGES to reflect more of the changes in 1.1.0.
Expand Down
279 changes: 144 additions & 135 deletions libpcap/CREDITS

Large diffs are not rendered by default.

115 changes: 79 additions & 36 deletions libpcap/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @CFLAGS@ $(CCOPT) $(INCLS) $(DEFS)
FULL_CFLAGS = $(CCOPT) $(INCLS) $(DEFS) $(CFLAGS)

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
Expand All @@ -70,9 +72,9 @@ RANLIB = @RANLIB@
# 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-@[email protected] @USB_SRC@ @BT_SRC@ @CAN_SRC@
PSRC = pcap-@[email protected] @USB_SRC@ @BT_SRC@ @CAN_SRC@ @NETFILTER_SRC@
FSRC = fad-@[email protected]
SSRC = @SSRC@
CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c \
Expand Down Expand Up @@ -115,14 +117,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 \
CLEANFILES = $(OBJ) libpcap.* $(TESTS) \
$(PROG)-`cat $(srcdir)/VERSION`.tar.gz \
lex.yy.c pcap-config

MAN1 = pcap-config.1
Expand All @@ -133,8 +150,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 \
Expand All @@ -152,9 +171,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 \
Expand All @@ -179,7 +196,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=)

Expand All @@ -188,9 +207,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 \
Expand Down Expand Up @@ -229,8 +250,6 @@ EXTRA_DIST = \
fad-null.c \
fad-sita.c \
fad-win32.c \
filtertest.c \
findalldevstest.c \
grammar.y \
install-sh \
lbl/os-aix4.h \
Expand All @@ -255,7 +274,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 \
Expand All @@ -274,6 +292,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 \
Expand All @@ -291,7 +311,6 @@ EXTRA_DIST = \
pcap-win32.c \
runlex.sh \
scanner.l \
selpolltest.c \
Win32/Include/Gnuc.h \
Win32/Include/addrinfo.h \
Win32/Include/bittypes.h \
Expand Down Expand Up @@ -329,7 +348,7 @@ scanner.c:

libpcap.a: $(OBJ)
@rm -f $@
ar rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
$(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
$(RANLIB) $@

shared: libpcap.$(DYEXT)
Expand Down Expand Up @@ -402,7 +421,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
Expand All @@ -411,19 +430,19 @@ libpcap.shareda: $(OBJ)
libpcap.none:

scanner.o: scanner.c tokdefs.h
$(CC) $(CFLAGS) -c scanner.c
$(CC) $(FULL_CFLAGS) -c scanner.c

pcap.o: version.h

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 $@
Expand Down Expand Up @@ -457,35 +476,47 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filter.c
ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c

bpf_filter.o: bpf_filter.c
$(CC) $(CFLAGS) -c bpf_filter.c
$(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 "[email protected]:$<";
# 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) ] || \
Expand Down Expand Up @@ -523,12 +554,21 @@ install: install-shared install-archive pcap-config
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
Expand Down Expand Up @@ -612,8 +652,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
Expand Down Expand Up @@ -650,7 +693,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
Expand Down
Loading

0 comments on commit 5d24d23

Please sign in to comment.