dect
/
libpcap
Archived
13
0
Fork 0

Don't hard-wire section 4 as the section for the pcap-filter and

pcap-linktype man pages; it should be section 7 for UN*Xes using the
V7/BSD conventions (this includes *BSD, Linux, and Mac OS X), and
section 5 for UN*Xes using the System V conventions (this includes
Solaris and HP-UX, and possibly AIX).
This commit is contained in:
guy 2008-10-21 07:33:01 +00:00
parent 854adf5232
commit 285c3a9fb0
10 changed files with 216 additions and 34 deletions

View File

@ -17,7 +17,7 @@
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.130 2008-09-26 23:48:50 guy Exp $ (LBL)
# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.131 2008-10-21 07:33:01 guy Exp $ (LBL)
#
# Various configurable paths (remember to edit Makefile.in, not Makefile)
@ -126,14 +126,19 @@ CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
MAN1 = pcap-config.1
MAN3PCAP = pcap.3pcap \
MAN3PCAP_EXPAND = \
pcap.3pcap.in \
pcap_compile.3pcap.in \
pcap_datalink.3pcap.in \
pcap_list_datalinks.3pcap.in \
pcap_open_dead.3pcap.in
MAN3PCAP_NOEXPAND = \
pcap_activate.3pcap \
pcap_breakloop.3pcap \
pcap_can_set_rfmon.3pcap \
pcap_close.3pcap \
pcap_compile.3pcap \
pcap_create.3pcap \
pcap_datalink.3pcap \
pcap_datalink_name_to_val.3pcap \
pcap_datalink_val_to_name.3pcap \
pcap_dump.3pcap \
@ -153,14 +158,12 @@ MAN3PCAP = pcap.3pcap \
pcap_inject.3pcap \
pcap_is_swapped.3pcap \
pcap_lib_version.3pcap \
pcap_list_datalinks.3pcap \
pcap_lookupdev.3pcap \
pcap_lookupnet.3pcap \
pcap_loop.3pcap \
pcap_major_version.3pcap \
pcap_next_ex.3pcap \
pcap_offline_filter.3pcap \
pcap_open_dead.3pcap \
pcap_open_live.3pcap \
pcap_open_offline.3pcap \
pcap_set_buffer_size.3pcap \
@ -177,8 +180,10 @@ MAN3PCAP = pcap.3pcap \
pcap_statustostr.3pcap \
pcap_strerror.3pcap
MAN4 = pcap-filter.4 \
pcap-linktype.4
MAN3PCAP = $(MAN3PCAP_NOEXPAND) $(MAN3PCAP_EXPAND:.in=)
MANMISC = pcap-filter.manmisc.in \
pcap-linktype.manmisc.in
EXTRA_DIST = \
CHANGES \
@ -417,8 +422,8 @@ install: libpcap.a pcap-config
(mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
[ -d $(DESTDIR)$(mandir)/man3 ] || \
(mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3)
[ -d $(DESTDIR)$(mandir)/man4 ] || \
(mkdir -p $(DESTDIR)$(mandir)/man4; chmod 755 $(DESTDIR)$(mandir)/man4)
[ -d $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@ ] || \
(mkdir -p $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@)
$(INSTALL_DATA) $(srcdir)/pcap/pcap.h \
$(DESTDIR)$(includedir)/pcap/pcap.h
$(INSTALL_DATA) $(srcdir)/pcap/bpf.h \
@ -459,9 +464,9 @@ install: libpcap.a pcap-config
$(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
ln $(DESTDIR)$(mandir)/man3/pcap_setnonblock.3pcap \
$(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
for i in $(MAN4); do \
$(INSTALL_DATA) $(srcdir)/$$i \
$(DESTDIR)$(mandir)/man4/$$i; done
for i in $(MANMISC); do \
$(INSTALL_DATA) $(srcdir)/`echo $$i | sed 's/.manmisc.in/.manmisc/'` \
$(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
install-shared: install-shared-$(DYEXT)
install-shared-so: libpcap.so
@ -494,8 +499,8 @@ uninstall:
rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
rm -f $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
for i in $(MAN4); do \
rm -f $(DESTDIR)$(mandir)/man4/$$i; done
for i in $(MANMISC); do \
rm -f $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
clean:
rm -f $(CLEANFILES) libpcap*.dylib libpcap.so*
@ -504,6 +509,7 @@ distclean: clean
rm -f Makefile config.cache config.log config.status \
config.h gnuc.h os-proto.h bpf_filter.c pcap-config \
stamp-h stamp-h.in
rm -f $(MAN3PCAP_EXPAND:.in=) $(MANMISC:.in=)
rm -rf autom4te.cache
tags: $(TAGFILES)
@ -516,7 +522,8 @@ packaging/pcap.spec: packaging/pcap.spec.in VERSION
releasetar:
@cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
mkdir $$name; \
tar cf - $(CSRC) $(HDR) $(MAN1) $(MAN3PCAP) $(MAN4) $(EXTRA_DIST) | (cd $$name; tar xf -); \
tar cf - $(CSRC) $(HDR) $(MAN1) $(MAN3PCAP_EXPAND) \
$(MAN3PCAP_NOEXPAND) $(MANMISC) $(EXTRA_DIST) | (cd $$name; tar xf -); \
tar -c -z -f $$name.tar.gz $$name; \
rm -rf $$name

62
configure vendored
View File

@ -1,5 +1,5 @@
#! /bin/sh
# From configure.in Revision: 1.157 .
# From configure.in Revision: 1.158 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61.
#
@ -688,6 +688,8 @@ SSRC
DYEXT
DAGLIBS
DEPLIBS
MAN_FILE_FORMATS
MAN_MISC_INFO
PCAP_SUPPORT_USB
USB_SRC
PCAP_SUPPORT_BT
@ -8574,7 +8576,14 @@ echo "$as_me: error: Your operating system's lex is insufficient to compile
fi
fi
#
# Assume a.out/ELF convention for shared library names (".so"), and
# V7/BSD convention for man pages (file formats in section 5,
# miscellaneous info in section 7).
#
DYEXT="so"
MAN_FILE_FORMATS=5
MAN_MISC_INFO=7
case "$host_os" in
aix*)
@ -8587,6 +8596,12 @@ _ACEOF
# We need "-lodm" and "-lcfg", as libpcap requires them on
# AIX.
DEPLIBS="-lodm -lcfg"
#
# Assume System V conventions for man pages.
#
MAN_FILE_FORMATS=4
MAN_MISC_INFO=5
;;
hpux9*)
@ -8595,12 +8610,30 @@ cat >>confdefs.h <<\_ACEOF
#define HAVE_HPUX9 1
_ACEOF
#
# Use System V conventions for man pages.
#
MAN_FILE_FORMATS=4
MAN_MISC_INFO=5
;;
hpux10.0*)
#
# Use System V conventions for man pages.
#
MAN_FILE_FORMATS=4
MAN_MISC_INFO=5
;;
hpux10.1*)
#
# Use System V conventions for man pages.
#
MAN_FILE_FORMATS=4
MAN_MISC_INFO=5
;;
hpux*)
@ -8609,6 +8642,12 @@ cat >>confdefs.h <<\_ACEOF
#define HAVE_HPUX10_20_OR_LATER 1
_ACEOF
#
# Use System V conventions for man pages.
#
MAN_FILE_FORMATS=4
MAN_MISC_INFO=5
;;
sinix*)
@ -8677,6 +8716,12 @@ cat >>confdefs.h <<\_ACEOF
#define HAVE_SOLARIS 1
_ACEOF
#
# Use System V conventions for man pages.
#
MAN_FILE_FORMATS=4
MAN_MISC_INFO=5
;;
darwin*)
@ -9132,6 +9177,8 @@ ln -s ${srcdir}/bpf/net net
{ echo "$as_me:$LINENO: checking for USB sniffing support" >&5
echo $ECHO_N "checking for USB sniffing support... $ECHO_C" >&6; }
case "$host_os" in
@ -9402,7 +9449,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
ac_config_headers="$ac_config_headers config.h"
ac_config_files="$ac_config_files Makefile"
ac_config_files="$ac_config_files Makefile pcap-filter.manmisc pcap-linktype.manmisc pcap.3pcap pcap_compile.3pcap pcap_datalink.3pcap pcap_list_datalinks.3pcap pcap_open_dead.3pcap"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -9959,6 +10006,13 @@ do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"pcap-filter.manmisc") CONFIG_FILES="$CONFIG_FILES pcap-filter.manmisc" ;;
"pcap-linktype.manmisc") CONFIG_FILES="$CONFIG_FILES pcap-linktype.manmisc" ;;
"pcap.3pcap") CONFIG_FILES="$CONFIG_FILES pcap.3pcap" ;;
"pcap_compile.3pcap") CONFIG_FILES="$CONFIG_FILES pcap_compile.3pcap" ;;
"pcap_datalink.3pcap") CONFIG_FILES="$CONFIG_FILES pcap_datalink.3pcap" ;;
"pcap_list_datalinks.3pcap") CONFIG_FILES="$CONFIG_FILES pcap_list_datalinks.3pcap" ;;
"pcap_open_dead.3pcap") CONFIG_FILES="$CONFIG_FILES pcap_open_dead.3pcap" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
@ -10094,6 +10148,8 @@ SSRC!$SSRC$ac_delim
DYEXT!$DYEXT$ac_delim
DAGLIBS!$DAGLIBS$ac_delim
DEPLIBS!$DEPLIBS$ac_delim
MAN_FILE_FORMATS!$MAN_FILE_FORMATS$ac_delim
MAN_MISC_INFO!$MAN_MISC_INFO$ac_delim
PCAP_SUPPORT_USB!$PCAP_SUPPORT_USB$ac_delim
USB_SRC!$USB_SRC$ac_delim
PCAP_SUPPORT_BT!$PCAP_SUPPORT_BT$ac_delim
@ -10104,7 +10160,7 @@ INSTALL_DATA!$INSTALL_DATA$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 82; then
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 84; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

View File

@ -1,4 +1,4 @@
dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.157 2008-09-23 18:04:01 guy Exp $ (LBL)
dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.158 2008-10-21 07:33:01 guy Exp $ (LBL)
dnl
dnl Copyright (c) 1994, 1995, 1996, 1997
dnl The Regents of the University of California. All rights reserved.
@ -6,7 +6,7 @@ dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_REVISION($Revision: 1.157 $)
AC_REVISION($Revision: 1.158 $)
AC_PREREQ(2.50)
AC_INIT(pcap.c)
@ -866,7 +866,14 @@ if test "$V_LEX" = lex ; then
fi
fi
#
# Assume a.out/ELF convention for shared library names (".so"), and
# V7/BSD convention for man pages (file formats in section 5,
# miscellaneous info in section 7).
#
DYEXT="so"
MAN_FILE_FORMATS=5
MAN_MISC_INFO=7
case "$host_os" in
aix*)
@ -876,16 +883,40 @@ aix*)
# We need "-lodm" and "-lcfg", as libpcap requires them on
# AIX.
DEPLIBS="-lodm -lcfg"
#
# Assume System V conventions for man pages.
#
MAN_FILE_FORMATS=4
MAN_MISC_INFO=5
;;
hpux9*)
AC_DEFINE(HAVE_HPUX9,1,[on HP-UX 9.x])
#
# Use System V conventions for man pages.
#
MAN_FILE_FORMATS=4
MAN_MISC_INFO=5
;;
hpux10.0*)
#
# Use System V conventions for man pages.
#
MAN_FILE_FORMATS=4
MAN_MISC_INFO=5
;;
hpux10.1*)
#
# Use System V conventions for man pages.
#
MAN_FILE_FORMATS=4
MAN_MISC_INFO=5
;;
hpux*)
@ -896,6 +927,12 @@ hpux*)
dnl for 32-bit PA-RISC, but should be left as "so" for
dnl 64-bit PA-RISC or, I suspect, IA-64.
AC_DEFINE(HAVE_HPUX10_20_OR_LATER,1,[on HP-UX 10.20 or later])
#
# Use System V conventions for man pages.
#
MAN_FILE_FORMATS=4
MAN_MISC_INFO=5
;;
sinix*)
@ -914,6 +951,12 @@ sinix*)
solaris*)
AC_DEFINE(HAVE_SOLARIS,1,[On solaris])
#
# Use System V conventions for man pages.
#
MAN_FILE_FORMATS=4
MAN_MISC_INFO=5
;;
darwin*)
@ -960,6 +1003,8 @@ AC_SUBST(SSRC)
AC_SUBST(DYEXT)
AC_SUBST(DAGLIBS)
AC_SUBST(DEPLIBS)
AC_SUBST(MAN_FILE_FORMATS)
AC_SUBST(MAN_MISC_INFO)
dnl check for USB sniffing support
AC_MSG_CHECKING(for USB sniffing support)
@ -1005,7 +1050,9 @@ AC_PROG_INSTALL
AC_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile)
AC_OUTPUT(Makefile pcap-filter.manmisc pcap-linktype.manmisc pcap.3pcap
pcap_compile.3pcap pcap_datalink.3pcap pcap_list_datalinks.3pcap
pcap_open_dead.3pcap)
if test -f .devel ; then
make depend

View File

@ -1,4 +1,4 @@
.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap-filter.4,v 1.2 2008-05-30 01:35:33 guy Exp $ (LBL)
.\" @(#) $Header: /tcpdump/master/libpcap/pcap-filter.manmisc.in,v 1.1 2008-10-21 07:33:01 guy Exp $ (LBL)
.\"
.\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
.\" The Regents of the University of California. All rights reserved.
@ -20,7 +20,7 @@
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.TH PCAP-FILTER 4 "6 January 2008"
.TH PCAP-FILTER @MAN_MISC_INFO@ "6 January 2008"
.SH NAME
pcap-filter \- packet filter syntax
.br

View File

@ -1,4 +1,4 @@
.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap-linktype.4,v 1.1 2008-04-05 20:19:41 guy Exp $
.\" @(#) $Header: /tcpdump/master/libpcap/pcap-linktype.manmisc.in,v 1.1 2008-10-21 07:33:01 guy Exp $
.\"
.\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997
.\" The Regents of the University of California. All rights reserved.
@ -20,7 +20,7 @@
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
.TH PCAP-LINKTYPE 4 "4 April 2008"
.TH PCAP-LINKTYPE @MAN_MISC_INFO@ "4 April 2008"
.SH NAME
pcap-linktype \- link-layer header types supported by libpcap
.SH DESCRIPTION

View File

@ -1,4 +1,4 @@
.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3pcap,v 1.6 2008-05-30 01:35:33 guy Exp $
.\" @(#) $Header: /tcpdump/master/libpcap/pcap.3pcap.in,v 1.1 2008-10-21 07:33:01 guy Exp $
.\"
.\" Copyright (c) 1994, 1996, 1997
.\" The Regents of the University of California. All rights reserved.
@ -363,7 +363,7 @@ use an
script or some other configuration script to check whether the libpcap
1.0 APIs are available and use them only if they are.
.SH SEE ALSO
autoconf(1), tcpdump(1), tcpslice(1), pcap-filter(4), pfconfig(8),
autoconf(1), tcpdump(1), tcpslice(1), pcap-filter(@MAN_MISC_INFO@), pfconfig(8),
usermod(1M)
.SH AUTHORS
The original authors of libpcap are:

72
pcap_compile.3pcap.in Normal file
View File

@ -0,0 +1,72 @@
.\" @(#) $Header: /tcpdump/master/libpcap/pcap_compile.3pcap.in,v 1.1 2008-10-21 07:33:02 guy Exp $
.\"
.\" Copyright (c) 1994, 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.
.\"
.TH PCAP_COMPILE 3PCAP "5 April 2008"
.SH NAME
pcap_compile \- compile a filter expression
.SH SYNOPSIS
.nf
.ft B
#include <pcap/pcap.h>
.ft
.LP
.ft B
int pcap_compile(pcap_t *p, struct bpf_program *fp,
.ti +8
const char *str, int optimize, bpf_u_int32 netmask);
.ft
.fi
.SH DESCRIPTION
.B pcap_compile()
is used to compile the string
.I str
into a filter program. See
.BR pcap-filter (@MAN_MISC_INFO@)
for the syntax of that string.
.I program
is a pointer to a
.I bpf_program
struct and is filled in by
.BR pcap_compile() .
.I optimize
controls whether optimization on the resulting code is performed.
.I netmask
specifies the IPv4 netmask of the network on which packets are being
captured; it is used only when checking for IPv4 broadcast addresses in
the filter program. If the netmask of the network on which packets are
being captured isn't known to the program, or if packets are being
captured on the Linux "any" pseudo-interface that can capture on more
than one network, a value of 0 can be supplied; tests for IPv4 broadcast
addreses won't be done correctly, but all other tests in the filter
program will be OK.
.SH RETURN VALUE
.B pcap_compile()
returns 0 on success and \-1 on failure.
If \-1 is returned,
.B pcap_geterr()
or
.B pcap_perror()
may be called with
.I p
as an argument to fetch or display the error text.
.SH SEE ALSO
pcap(3PCAP), pcap_setfilter(3PCAP), pcap_freecode(3PCAP),
pcap_geterr(3PCAP), pcap-filter(@MAN_MISC_INFO@)

View File

@ -1,4 +1,4 @@
.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap_datalink.3pcap,v 1.3 2008-04-06 02:53:21 guy Exp $
.\" @(#) $Header: /tcpdump/master/libpcap/pcap_datalink.3pcap.in,v 1.1 2008-10-21 07:33:02 guy Exp $
.\"
.\" Copyright (c) 1994, 1996, 1997
.\" The Regents of the University of California. All rights reserved.
@ -38,4 +38,4 @@ returns the link layer type for the live capture or ``savefile''
specified by
.IR p .
.SH SEE ALSO
pcap(3PCAP), pcap-linktype(4)
pcap(3PCAP), pcap-linktype(@MAN_MISC_INFO@)

View File

@ -1,4 +1,4 @@
.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap_list_datalinks.3pcap,v 1.4 2008-05-26 19:58:06 guy Exp $
.\" @(#) $Header: /tcpdump/master/libpcap/pcap_list_datalinks.3pcap.in,v 1.1 2008-10-21 07:33:02 guy Exp $
.\"
.\" Copyright (c) 1994, 1996, 1997
.\" The Regents of the University of California. All rights reserved.
@ -55,4 +55,4 @@ may be called with
as an argument to fetch or display the error text.
.SH SEE ALSO
pcap(3PCAP), pcap_geterr(3PCAP), pcap_free_datalinks(3PCAP),
pcap-linktype(4)
pcap-linktype(@MAN_MISC_INFO@)

View File

@ -1,4 +1,4 @@
.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap_open_dead.3pcap,v 1.3 2008-04-06 02:53:22 guy Exp $
.\" @(#) $Header: /tcpdump/master/libpcap/pcap_open_dead.3pcap.in,v 1.1 2008-10-21 07:33:02 guy Exp $
.\"
.\" Copyright (c) 1994, 1996, 1997
.\" The Regents of the University of California. All rights reserved.
@ -49,4 +49,4 @@ specifies the link-layer type for the
specifies the snapshot length for the
.BR pcap_t .
.SH SEE ALSO
pcap(3PCAP), pcap-linktype(4)
pcap(3PCAP), pcap-linktype(@MAN_MISC_INFO@)