Module Name: src
Committed By: christos
Date: Sun Dec 5 01:45:47 UTC 2010
Modified Files:
src/external/bsd/libpcap/dist: gencode.c optimize.c pcap-bpf.c
pcap-namedb.h pcap.c pcap.h scanner.l
src/external/bsd/libpcap/dist/pcap: bpf.h
Added Files:
src/external/bsd/libpcap: Makefile
src/external/bsd/libpcap/include: config.h
src/external/bsd/libpcap/lib: Makefile shlib_version version.c
version.h
Log Message:
- add our fixes
- make compile with WARNS=5
- add glue
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/libpcap/Makefile
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/libpcap/dist/gencode.c \
src/external/bsd/libpcap/dist/optimize.c \
src/external/bsd/libpcap/dist/pcap-bpf.c \
src/external/bsd/libpcap/dist/pcap-namedb.h \
src/external/bsd/libpcap/dist/pcap.c src/external/bsd/libpcap/dist/pcap.h \
src/external/bsd/libpcap/dist/scanner.l
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/libpcap/dist/pcap/bpf.h
cvs rdiff -u -r0 -r1.1 src/external/bsd/libpcap/include/config.h
cvs rdiff -u -r0 -r1.1 src/external/bsd/libpcap/lib/Makefile \
src/external/bsd/libpcap/lib/shlib_version \
src/external/bsd/libpcap/lib/version.c \
src/external/bsd/libpcap/lib/version.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/libpcap/dist/gencode.c
diff -u src/external/bsd/libpcap/dist/gencode.c:1.1.1.2 src/external/bsd/libpcap/dist/gencode.c:1.2
--- src/external/bsd/libpcap/dist/gencode.c:1.1.1.2 Sat Dec 4 20:27:06 2010
+++ src/external/bsd/libpcap/dist/gencode.c Sat Dec 4 20:45:46 2010
@@ -6119,7 +6119,7 @@
ai = res;
b = tmp = NULL;
tproto = tproto6 = proto;
- if (off_linktype == -1 && tproto == Q_DEFAULT) {
+ if (off_linktype == (u_int)-1 && tproto == Q_DEFAULT) {
tproto = Q_IP;
tproto6 = Q_IPV6;
}
@@ -6468,7 +6468,7 @@
bpf_error("%s resolved to multiple address", s1);
addr = &((struct sockaddr_in6 *)res->ai_addr)->sin6_addr;
- if (sizeof(mask) * 8 < masklen)
+ if ((int)sizeof(mask) * 8 < masklen)
bpf_error("mask length must be <= %u", (unsigned int)(sizeof(mask) * 8));
memset(&mask, 0, sizeof(mask));
memset(&mask, 0xff, masklen / 8);
Index: src/external/bsd/libpcap/dist/optimize.c
diff -u src/external/bsd/libpcap/dist/optimize.c:1.1.1.2 src/external/bsd/libpcap/dist/optimize.c:1.2
--- src/external/bsd/libpcap/dist/optimize.c:1.1.1.2 Sat Dec 4 20:27:08 2010
+++ src/external/bsd/libpcap/dist/optimize.c Sat Dec 4 20:45:46 2010
@@ -920,7 +920,7 @@
if (b->s.code == (BPF_JMP|BPF_K|BPF_JSET)) {
if (b->s.k == 0)
JT(b) = JF(b);
- if (b->s.k == 0xffffffff)
+ if (b->s.k == (int)0xffffffff)
JF(b) = JT(b);
}
/*
@@ -948,11 +948,11 @@
break;
case BPF_JGT:
- v = (unsigned)v > b->s.k;
+ v = (unsigned)v > (unsigned)b->s.k;
break;
case BPF_JGE:
- v = (unsigned)v >= b->s.k;
+ v = (unsigned)v >= (unsigned)b->s.k;
break;
case BPF_JSET:
@@ -2093,7 +2093,7 @@
{
struct bpf_insn *dst;
struct slist *src;
- int slen;
+ u_int slen;
u_int off;
int extrajmps; /* number of extra jumps inserted */
struct slist **offset = NULL;
@@ -2151,7 +2151,7 @@
goto filled;
{
- int i;
+ u_int i;
int jt, jf;
const char *ljerr = "%s for block-local relative jump: off=%d";
Index: src/external/bsd/libpcap/dist/pcap-bpf.c
diff -u src/external/bsd/libpcap/dist/pcap-bpf.c:1.1.1.2 src/external/bsd/libpcap/dist/pcap-bpf.c:1.2
--- src/external/bsd/libpcap/dist/pcap-bpf.c:1.1.1.2 Sat Dec 4 20:27:09 2010
+++ src/external/bsd/libpcap/dist/pcap-bpf.c Sat Dec 4 20:45:46 2010
@@ -51,6 +51,9 @@
#include <sys/ioccom.h>
#endif
#include <sys/utsname.h>
+#ifdef __NetBSD__
+#include <paths.h>
+#endif
#ifdef HAVE_ZEROCOPY_BPF
#include <machine/atomic.h>
@@ -773,7 +776,7 @@
register u_char *bp, *ep;
u_char *datap;
#ifdef PCAP_FDDIPAD
- register int pad;
+ register u_int pad;
#endif
#ifdef HAVE_ZEROCOPY_BPF
int i;
@@ -898,7 +901,7 @@
pad = p->fddipad;
#endif
while (bp < ep) {
- register int caplen, hdrlen;
+ register u_int caplen, hdrlen;
/*
* Has "pcap_breakloop()" been called?
@@ -1401,7 +1404,7 @@
#ifdef BIOCGDLTLIST
struct bpf_dltlist bdl;
#if defined(__APPLE__) || defined(HAVE_BSD_IEEE80211)
- int new_dlt;
+ u_int new_dlt;
#endif
#endif /* BIOCGDLTLIST */
#if defined(BIOCGHDRCMPLT) && defined(BIOCSHDRCMPLT)
@@ -1873,7 +1876,7 @@
* already in that mode.
*/
new_dlt = find_802_11(&bdl);
- if (new_dlt != -1) {
+ if (new_dlt != (unsigned)-1) {
/*
* We have at least one 802.11 DLT_ value.
* new_dlt is the best of the 802.11
@@ -2343,7 +2346,7 @@
find_802_11(struct bpf_dltlist *bdlp)
{
int new_dlt;
- int i;
+ u_int i;
/*
* Scan the list of DLT_ values, looking for 802.11 values,
Index: src/external/bsd/libpcap/dist/pcap-namedb.h
diff -u src/external/bsd/libpcap/dist/pcap-namedb.h:1.1.1.2 src/external/bsd/libpcap/dist/pcap-namedb.h:1.2
--- src/external/bsd/libpcap/dist/pcap-namedb.h:1.1.1.2 Sat Dec 4 20:27:16 2010
+++ src/external/bsd/libpcap/dist/pcap-namedb.h Sat Dec 4 20:45:46 2010
@@ -1,3 +1,5 @@
+/* $NetBSD: pcap-namedb.h,v 1.2 2010/12/05 01:45:46 christos Exp $ */
+
/*
* Copyright (c) 1994, 1996
* The Regents of the University of California. All rights reserved.
Index: src/external/bsd/libpcap/dist/pcap.c
diff -u src/external/bsd/libpcap/dist/pcap.c:1.1.1.2 src/external/bsd/libpcap/dist/pcap.c:1.2
--- src/external/bsd/libpcap/dist/pcap.c:1.1.1.2 Sat Dec 4 20:27:20 2010
+++ src/external/bsd/libpcap/dist/pcap.c Sat Dec 4 20:45:46 2010
@@ -532,7 +532,7 @@
return (0);
}
for (i = 0; i < p->dlt_count; i++)
- if (p->dlt_list[i] == dlt)
+ if (p->dlt_list[i] == (u_int)dlt)
break;
if (i >= p->dlt_count)
goto unsupported;
@@ -604,6 +604,7 @@
DLT_CHOICE(DLT_LINUX_SLL, "Linux cooked"),
DLT_CHOICE(DLT_LTALK, "Localtalk"),
DLT_CHOICE(DLT_PFLOG, "OpenBSD pflog file"),
+ DLT_CHOICE(DLT_PFSYNC, "Packet filter state syncing"),
DLT_CHOICE(DLT_PRISM_HEADER, "802.11 plus Prism header"),
DLT_CHOICE(DLT_IP_OVER_FC, "RFC 2625 IP-over-Fibre Channel"),
DLT_CHOICE(DLT_SUNATM, "Sun raw ATM"),
Index: src/external/bsd/libpcap/dist/pcap.h
diff -u src/external/bsd/libpcap/dist/pcap.h:1.1.1.2 src/external/bsd/libpcap/dist/pcap.h:1.2
--- src/external/bsd/libpcap/dist/pcap.h:1.1.1.2 Sat Dec 4 20:27:20 2010
+++ src/external/bsd/libpcap/dist/pcap.h Sat Dec 4 20:45:46 2010
@@ -32,6 +32,8 @@
*
* @(#) Header: /tcpdump/master/libpcap/pcap.h,v 1.59 2006-10-04 18:09:22 guy Exp (LBL)
*/
+/* $NetBSD: pcap.h,v 1.2 2010/12/05 01:45:46 christos Exp $ */
+
/*
* For backwards compatibility.
Index: src/external/bsd/libpcap/dist/scanner.l
diff -u src/external/bsd/libpcap/dist/scanner.l:1.1.1.2 src/external/bsd/libpcap/dist/scanner.l:1.2
--- src/external/bsd/libpcap/dist/scanner.l:1.1.1.2 Sat Dec 4 20:27:22 2010
+++ src/external/bsd/libpcap/dist/scanner.l Sat Dec 4 20:45:46 2010
@@ -77,7 +77,6 @@
static inline int xdtoi(int);
#ifdef FLEX_SCANNER
-#define YY_NO_UNPUT
static YY_BUFFER_STATE in_buffer;
#else
static const char *in_buffer;
@@ -185,6 +184,8 @@
+%option nounput
+
%%
dst return DST;
src return SRC;
Index: src/external/bsd/libpcap/dist/pcap/bpf.h
diff -u src/external/bsd/libpcap/dist/pcap/bpf.h:1.1.1.2 src/external/bsd/libpcap/dist/pcap/bpf.h:1.2
--- src/external/bsd/libpcap/dist/pcap/bpf.h:1.1.1.2 Sat Dec 4 20:27:29 2010
+++ src/external/bsd/libpcap/dist/pcap/bpf.h Sat Dec 4 20:45:46 2010
@@ -298,7 +298,7 @@
*
* XXX: is there a conflict with DLT_PFSYNC 18 as well?
*/
-#ifdef __OpenBSD__
+#if defined(__OpenBSD__) || defined(__NetBSD__)
#define DLT_OLD_PFLOG 17
#define DLT_PFSYNC 18
#endif
Added files:
Index: src/external/bsd/libpcap/Makefile
diff -u /dev/null src/external/bsd/libpcap/Makefile:1.1
--- /dev/null Sat Dec 4 20:45:47 2010
+++ src/external/bsd/libpcap/Makefile Sat Dec 4 20:45:46 2010
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2010/12/05 01:45:46 christos Exp $
+
+SUBDIR= lib
+
+.include <bsd.subdir.mk>
Index: src/external/bsd/libpcap/include/config.h
diff -u /dev/null src/external/bsd/libpcap/include/config.h:1.1
--- /dev/null Sat Dec 4 20:45:47 2010
+++ src/external/bsd/libpcap/include/config.h Sat Dec 4 20:45:46 2010
@@ -0,0 +1,279 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* Enable optimizer debugging */
+/* #undef BDEBUG */
+
+/* define if you have a cloning BPF device */
+/* #undef HAVE_CLONING_BPF */
+
+/* define if you have the DAG API */
+/* #undef HAVE_DAG_API */
+
+/* define if you have dag_get_erf_types() */
+/* #undef HAVE_DAG_GET_ERF_TYPES */
+
+/* define if you have dag_get_stream_erf_types() */
+/* #undef HAVE_DAG_GET_STREAM_ERF_TYPES */
+
+/* define if you have streams capable DAG API */
+/* #undef HAVE_DAG_STREAMS_API */
+
+/* Define to 1 if you have the declaration of `ether_hostton', and to 0 if you
+ don't. */
+#define HAVE_DECL_ETHER_HOSTTON 1
+
+/* define if you have a /dev/dlpi */
+/* #undef HAVE_DEV_DLPI */
+
+/* if passive_req_t primitive exists */
+/* #undef HAVE_DLPI_PASSIVE */
+
+/* Define to 1 if you have the `ether_hostton' function. */
+#define HAVE_ETHER_HOSTTON 1
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#define HAVE_FSEEKO 1
+
+/* on HP-UX 10.20 or later */
+/* #undef HAVE_HPUX10_20_OR_LATER */
+
+/* on HP-UX 9.x */
+/* #undef HAVE_HPUX9 */
+
+/* if ppa_info_t_dl_module_id exists */
+/* #undef HAVE_HP_PPA_INFO_T_DL_MODULE_ID_1 */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* if libdlpi exists */
+/* #undef HAVE_LIBDLPI */
+
+/* if libnl exists */
+/* #undef HAVE_LIBNL */
+
+/* Define to 1 if you have the <limits.h> header file. */
+#define HAVE_LIMITS_H 1
+
+/* if tp_vlan_tci exists */
+/* #undef HAVE_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI */
+
+/* Define to 1 if you have the <linux/usbdevice_fs.h> header file. */
+/* #undef HAVE_LINUX_USBDEVICE_FS_H */
+
+/* Define to 1 if you have the <linux/wireless.h> header file. */
+/* #undef HAVE_LINUX_WIRELESS_H */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <netinet/ether.h> header file. */
+/* #undef HAVE_NETINET_ETHER_H */
+
+/* Define to 1 if you have the <netinet/if_ether.h> header file. */
+#define HAVE_NETINET_IF_ETHER_H 1
+
+/* Define to 1 if you have the <net/if_media.h> header file. */
+#define HAVE_NET_IF_MEDIA_H 1
+
+/* Define to 1 if you have the <net/pfvar.h> header file. */
+#define HAVE_NET_PFVAR_H 1
+
+/* 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 <paths.h> header file. */
+#define HAVE_PATHS_H 1
+
+/* define if net/pfvar.h defines PF_NAT through PF_NORDR */
+#define HAVE_PF_NAT_THROUGH_PF_NORDR 1
+
+/* define if you have a Septel API */
+/* #undef HAVE_SEPTEL_API */
+
+/* define if you have Myricom SNF API */
+/* #undef HAVE_SNF_API */
+
+/* Define to 1 if you have the `snprintf' function. */
+#define HAVE_SNPRINTF 1
+
+/* if struct sockaddr has the sa_len member */
+#define HAVE_SOCKADDR_SA_LEN 1
+
+/* if struct sockaddr_storage exists */
+#define HAVE_SOCKADDR_STORAGE 1
+
+/* define if socklen_t is defined */
+#define HAVE_SOCKLEN_T 1
+
+/* On solaris */
+/* #undef HAVE_SOLARIS */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+#define HAVE_STRLCPY 1
+
+/* Define to 1 if the system has the type `struct BPF_TIMEVAL'. */
+/* #undef HAVE_STRUCT_BPF_TIMEVAL */
+
+/* Define to 1 if the system has the type `struct ether_addr'. */
+/* #undef HAVE_STRUCT_ETHER_ADDR */
+
+/* Define to 1 if you have the <sys/bitypes.h> header file. */
+/* #undef HAVE_SYS_BITYPES_H */
+
+/* Define to 1 if you have the <sys/bufmod.h> header file. */
+/* #undef HAVE_SYS_BUFMOD_H */
+
+/* Define to 1 if you have the <sys/dlpi_ext.h> header file. */
+/* #undef HAVE_SYS_DLPI_EXT_H */
+
+/* Define to 1 if you have the <sys/ioccom.h> header file. */
+#define HAVE_SYS_IOCCOM_H 1
+
+/* Define to 1 if you have the <sys/sockio.h> header file. */
+#define HAVE_SYS_SOCKIO_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* if if_packet.h has tpacket_stats defined */
+/* #undef HAVE_TPACKET_STATS */
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* if struct usbdevfs_ctrltransfer has bRequestType */
+/* #undef HAVE_USBDEVFS_CTRLTRANSFER_BREQUESTTYPE */
+
+/* define if version.h is generated in the build procedure */
+#define HAVE_VERSION_H 1
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
+/* define if the system supports zerocopy BPF */
+/* #undef HAVE_ZEROCOPY_BPF */
+
+/* define if your compiler has __attribute__ */
+#define HAVE___ATTRIBUTE__ 1
+
+/* IPv6 */
+#define INET6 1
+
+/* if unaligned access fails */
+/* #undef LBL_ALIGN */
+
+/* path for device for USB sniffing */
+/* #undef LINUX_USB_MON_DEV */
+
+/* Define to 1 if netinet/ether.h declares `ether_hostton' */
+/* #undef NETINET_ETHER_H_DECLARES_ETHER_HOSTTON */
+
+/* Define to 1 if netinet/if_ether.h declares `ether_hostton' */
+#define NETINET_IF_ETHER_H_DECLARES_ETHER_HOSTTON
+
+/* do not use protochain */
+/* #undef NO_PROTOCHAIN */
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
+
+/* /dev/dlpi directory */
+/* #undef PCAP_DEV_PREFIX */
+
+/* target host supports Bluetooth sniffing */
+/* #undef PCAP_SUPPORT_BT */
+
+/* target host supports CAN sniffing */
+/* #undef PCAP_SUPPORT_CAN */
+
+/* target host supports USB sniffing */
+/* #undef PCAP_SUPPORT_USB */
+
+/* include ACN support */
+/* #undef SITA */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Enable parser debugging */
+/* #undef YYDEBUG */
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* needed on HP-UX */
+/* #undef _HPUX_SOURCE */
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+/* #undef _LARGEFILE_SOURCE */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* define on AIX to get certain functions */
+/* #undef _SUN */
+
+/* to handle Ultrix compilers that don't support const in prototypes */
+/* #undef const */
+
+/* Define as token for inline if inlining supported */
+#define inline inline
+
+/* Define to `short' if int16_t not defined. */
+/* #undef int16_t */
+
+/* Define to `int' if int32_t not defined. */
+/* #undef int32_t */
+
+/* Define to `long long' if int64_t not defined. */
+/* #undef int64_t */
+
+/* Define to `signed char' if int8_t not defined. */
+/* #undef int8_t */
+
+/* on sinix */
+/* #undef sinix */
+
+/* Define to `unsigned short' if u_int16_t not defined. */
+/* #undef u_int16_t */
+
+/* Define to `unsigned int' if u_int32_t not defined. */
+/* #undef u_int32_t */
+
+/* Define to `unsigned long long' if u_int64_t not defined. */
+/* #undef u_int64_t */
+
+/* Define to `unsigned char' if u_int8_t not defined. */
+/* #undef u_int8_t */
Index: src/external/bsd/libpcap/lib/Makefile
diff -u /dev/null src/external/bsd/libpcap/lib/Makefile:1.1
--- /dev/null Sat Dec 4 20:45:47 2010
+++ src/external/bsd/libpcap/lib/Makefile Sat Dec 4 20:45:46 2010
@@ -0,0 +1,98 @@
+# $NetBSD: Makefile,v 1.1 2010/12/05 01:45:46 christos Exp $
+
+.include <bsd.own.mk>
+
+USE_FORT?= yes # network protocol library
+
+.SUFFIXES: .3 .3pcap
+
+.3pcap.3:
+ rm -f ${.TARGET}
+ cp ${.IMPSRC} ${.TARGET}
+
+
+SRCDIR= ${.CURDIR}/../dist/
+.PATH: ${SRCDIR}
+
+LIB= pcap
+MAN= pcap.3 pcap_activate.3 pcap_breakloop.3 pcap_can_set_rfmon.3 \
+ pcap_close.3 pcap_compile.3 pcap_create.3 pcap_datalink.3 \
+ pcap_datalink_name_to_val.3 pcap_datalink_val_to_name.3 \
+ pcap_dump.3 pcap_dump_close.3 pcap_dump_file.3 \
+ pcap_dump_flush.3 pcap_dump_ftell.3 pcap_dump_open.3 \
+ pcap_file.3 pcap_fileno.3 pcap_findalldevs.3 \
+ pcap_free_datalinks.3 pcap_freealldevs.3 pcap_freecode.3 \
+ pcap_get_selectable_fd.3 pcap_geterr.3 pcap_inject.3 \
+ pcap_is_swapped.3 pcap_lib_version.3 pcap_list_datalinks.3 \
+ pcap_lookupdev.3 pcap_lookupnet.3 pcap_loop.3 \
+ pcap_major_version.3 pcap_next_ex.3 pcap_offline_filter.3 \
+ pcap_open_dead.3 pcap_open_live.3 pcap_open_offline.3 \
+ pcap_set_buffer_size.3 pcap_set_datalink.3 pcap_set_promisc.3 \
+ pcap_set_rfmon.3 pcap_set_snaplen.3 pcap_set_timeout.3 \
+ pcap_setdirection.3 pcap_setfilter.3 pcap_setnonblock.3 \
+ pcap_snapshot.3 pcap_stats.3 pcap_statustostr.3 \
+ pcap_strerror.3 pcap-savefile.5 pcap-filter.7 pcap-linktype.7
+
+
+MAN3IN= pcap.3pcap.in pcap_compile.3pcap.in pcap_datalink.3pcap.in \
+ pcap_dump_open.3pcap.in pcap_list_datalinks.3pcap.in \
+ pcap_open_dead.3pcap.in pcap_open_offline.3pcap.in
+MANMISCIN= pcap-filter.manmisc.in pcap-linktype.manmisc.in
+MANFILEIN= pcap-savefile.manfile.in
+CLEANFILES+= ${MAN}
+
+WARNS?= 5
+
+__sed: .USE
+ @rm -f ${.TARGET}
+ ${TOOL_SED} -e 's,@MAN_FILE_FORMATS@,5,g' \
+ -e 's,@MAN_MISC_INFO@,7,g' < ${.ALLSRC} > ${.TARGET}
+
+.for i in ${MAN3IN}
+${i:S/pcap.in//}: ${i} __sed
+.endfor
+
+.for i in ${MANMISCIN}
+${i:S/manmisc.in/7/}: ${i} __sed
+.endfor
+
+.for i in ${MANFILEIN}
+${i:S/manfile.in/5/}: ${i} __sed
+.endfor
+
+CPPFLAGS+= -I${.CURDIR}/../include -I${.CURDIR} -I${SRCDIR}
+CPPFLAGS+= -DYYBISON
+LPREFIX= pcap_
+YPREFIX= pcap_
+YHEADER= 1
+
+CPPFLAGS+= -DHAVE_CONFIG_H
+
+.if defined(HAVE_PCC)
+CPPFLAGS+= -D_U_=""
+.elif defined(HAVE_GCC)
+CPPFLAGS+= -D_U_="__attribute__((__unused__))"
+.endif
+
+.if (${USE_INET6} != "no")
+CPPFLAGS+= -DINET6
+.endif
+
+SRCS= scanner.l savefile.c pcap.c pcap-bpf.c optimize.c nametoaddr.c \
+ inet.c grammar.y gencode.c fad-getad.c etherent.c bpf_image.c \
+ bpf_dump.c version.c
+
+.PATH: ${NETBSDSRCDIR}/sys/net
+SRCS+= bpf_filter.c
+
+INCS= pcap-namedb.h pcap.h
+INCSDIR= /usr/include
+
+scanner.d scanner.o: tokdefs.h
+
+tokdefs.h: grammar.h
+ cp $? $@
+
+CLEANFILES+= tokdefs.h
+
+.include <bsd.lib.mk>
Index: src/external/bsd/libpcap/lib/shlib_version
diff -u /dev/null src/external/bsd/libpcap/lib/shlib_version:1.1
--- /dev/null Sat Dec 4 20:45:47 2010
+++ src/external/bsd/libpcap/lib/shlib_version Sat Dec 4 20:45:46 2010
@@ -0,0 +1,5 @@
+# $NetBSD: shlib_version,v 1.1 2010/12/05 01:45:46 christos Exp $
+# Remember to update distrib/sets/lists/base/shl.* when changing
+#
+major=4
+minor=0
Index: src/external/bsd/libpcap/lib/version.c
diff -u /dev/null src/external/bsd/libpcap/lib/version.c:1.1
--- /dev/null Sat Dec 4 20:45:47 2010
+++ src/external/bsd/libpcap/lib/version.c Sat Dec 4 20:45:46 2010
@@ -0,0 +1,3 @@
+/* $NetBSD: version.c,v 1.1 2010/12/05 01:45:46 christos Exp $ */
+
+char pcap_version[] = "1.1.1";
Index: src/external/bsd/libpcap/lib/version.h
diff -u /dev/null src/external/bsd/libpcap/lib/version.h:1.1
--- /dev/null Sat Dec 4 20:45:47 2010
+++ src/external/bsd/libpcap/lib/version.h Sat Dec 4 20:45:46 2010
@@ -0,0 +1,3 @@
+/* $NetBSD: version.h,v 1.1 2010/12/05 01:45:46 christos Exp $ */
+
+static const char pcap_version_string[] = "libpcap version 1.1.1";