Reduce diffs from the vendor source.
Reorganize Makefile to make it ordered like the vendor's.
TO_REMOVE+=/usr/share/examples/cvsup/DragonFly-release1_12-supfile
TO_REMOVE+=/usr/share/examples/cvsup/DragonFly-release2_0-supfile
TO_REMOVE+=/usr/share/examples/cvsup/DragonFly-src-supfile
-TO_REMOVE+=/usr/include/pcap-bpf.h
TO_REMOVE+=/etc/rc.d/nfslocking
TO_REMOVE+=/usr/sbin/pmap_dump
TO_REMOVE+=/usr/sbin/pmap_set
TO_REMOVE+=/usr/share/man/man4/ata.4.gz
TO_REMOVE+=/usr/share/man/cat4/atapicam.4.gz
TO_REMOVE+=/usr/share/man/man4/atapicam.4.gz
+TO_REMOVE+=/usr/include/pcap-int.h
.if ${MACHINE_ARCH} == "x86_64"
TO_REMOVE+=/usr/libdata/stallion/2681.sys
#endif /* WIN32 */
-#include <net/bpf.h>
+#include <pcap/bpf.h>
#if !defined(KERNEL) && !defined(_KERNEL)
#include <stdlib.h>
#include "nlpid.h"
#include "llc.h"
#include "gencode.h"
-#include <netproto/802_11/ieee80211.h>
+#include "ieee80211.h"
#include "atmuni31.h"
#include "sunatmpos.h"
#include "ppp.h"
#ifdef HAVE_NET_PFVAR_H
#include <sys/socket.h>
#include <net/if.h>
-#include <net/if_var.h>
#include <net/pf/pfvar.h>
#include <net/pf/if_pflog.h>
#endif
#endif /*INET6*/
#include <pcap/namedb.h>
-#include <netproto/802_11/ieee80211_radiotap.h>
-
#define ETHERMTU 1500
#ifndef IPPROTO_SCTP
#include "gencode.h"
#ifdef HAVE_NET_PFVAR_H
#include <net/if.h>
-#include <net/if_var.h>
#include <net/pf/pfvar.h>
#include <net/pf/if_pflog.h>
#endif
-#include <netproto/802_11/ieee80211.h>
+#include "ieee80211.h"
#include <pcap/namedb.h>
#ifdef HAVE_OS_PROTO_H
{ IEEE80211_FC0_SUBTYPE_CF_POLL, "data-cf-poll" },
{ IEEE80211_FC0_SUBTYPE_CF_ACPL, "data-cf-ack-poll" },
{ IEEE80211_FC0_SUBTYPE_NODATA, "null" },
- { IEEE80211_FC0_SUBTYPE_CFACK, "cf-ack" },
- { IEEE80211_FC0_SUBTYPE_CFPOLL, "cf-poll" },
- { IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK, "cf-ack-poll" },
+ { IEEE80211_FC0_SUBTYPE_NODATA_CF_ACK, "cf-ack" },
+ { IEEE80211_FC0_SUBTYPE_NODATA_CF_POLL, "cf-poll" },
+ { IEEE80211_FC0_SUBTYPE_NODATA_CF_ACPL, "cf-ack-poll" },
{ IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_DATA, "qos-data" },
{ IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CF_ACK, "qos-data-cf-ack" },
{ IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CF_POLL, "qos-data-cf-poll" },
{ IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CF_ACPL, "qos-data-cf-ack-poll" },
{ IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_NODATA, "qos" },
- { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CFPOLL, "qos-cf-poll" },
- { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK, "qos-cf-ack-poll" },
+ { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_NODATA_CF_POLL, "qos-cf-poll" },
+ { IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_SUBTYPE_NODATA_CF_ACPL, "qos-cf-ack-poll" },
{ 0, NULL }
};
struct type2tok {
#endif /* WIN32/MSDOS/UN*X */
#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H
-#include <net/bpf.h>
+#include <pcap/bpf.h>
#endif
#include <stdio.h>
#ifdef FLEX_SCANNER
#define YY_NO_INPUT
#define YY_NO_UNPUT
-#define YY_NO_INPUT
static YY_BUFFER_STATE in_buffer;
#else
static const char *in_buffer;
-# Makefile for libpcap
-# $FreeBSD: src/lib/libpcap/Makefile,v 1.24.2.4 2002/07/22 14:21:50 ru Exp $
-# $DragonFly: src/lib/libpcap/Makefile,v 1.12 2007/10/11 01:07:29 pavalos Exp $
-
SRCDIR= ${.CURDIR}/../../contrib/libpcap
LIB= pcap
-SRCS= grammar.y tokdefs.h pcap-bpf.c version.h \
- pcap.c inet.c fad-getad.c gencode.c optimize.c nametoaddr.c \
- etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c \
- scanner.l version.c
+SRCS= pcap-bpf.c \
+ fad-getad.c \
+ pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c \
+ savefile.c sf-pcap.c sf-pcap-ng.c pcap-common.c \
+ bpf_image.c bpf_dump.c \
+ scanner.l grammar.y bpf_filter.c version.c
+
+INCS= pcap.h \
+ pcap-bpf.h \
+ pcap-namedb.h
-# Old compatibility headers
-INCS= pcap.h pcap-namedb.h pcap-int.h
+PCAPINCS= \
+ pcap/bpf.h \
+ pcap/bluetooth.h \
+ pcap/ipnet.h \
+ pcap/namedb.h \
+ pcap/pcap.h \
+ pcap/sll.h \
+ pcap/vlan.h \
+ pcap/usb.h
-PCAPINCS= pcap/pcap.h pcap/namedb.h
PCAPINCSDIR= ${INCLUDEDIR}/pcap
INCSGROUPS= INCS PCAPINCS
MAN= pcap.3 \
- pcap_activate.3 \
+ pcap_compile.3 \
+ pcap_datalink.3 \
+ pcap_dump_open.3 \
+ pcap_list_datalinks.3 \
+ pcap_list_tstamp_types.3 \
+ pcap_open_dead.3 \
+ pcap_open_offline.3 \
+ pcap_set_tstamp_type.3
+MAN+= 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_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_stats.3 \
pcap_statustostr.3 \
pcap_strerror.3 \
- pcap-savefile.5 \
- pcap-filter.7 \
- pcap-linktype.7
+ pcap_tstamp_type_name_to_val.3 \
+ pcap_tstamp_type_val_to_name.3
+MAN+= pcap-savefile.5
+MAN+= pcap-filter.7 \
+ pcap-linktype.7 \
+ pcap-tstamp.7
MLINKS= pcap_datalink_val_to_name.3 pcap_datalink_val_to_description.3 \
pcap_dump_open.3 pcap_dump_fopen.3 \
+ pcap_findalldevs.3 pcap_freealldevs.3 \
pcap_geterr.3 pcap_perror.3 \
pcap_inject.3 pcap_sendpacket.3 \
+ pcap_list_datalinks.3 pcap_free_datalinks.3 \
+ pcap_list_tstamp_types.3 pcap_free_tstamp_types.3 \
pcap_loop.3 pcap_dispatch.3 \
pcap_major_version.3 pcap_minor_version.3 \
pcap_next_ex.3 pcap_next.3 \
CLEANFILES+=${MAN}
WARNS?= 2
-CFLAGS+=-DHAVE_CONFIG_H -Dyylval=pcap_lval -I${.CURDIR} -I.
-CFLAGS+=-D_U_="__attribute__((unused))"
+LFLAGS+=-Ppcap_
+YFLAGS+=-p pcap_
+CFLAGS+=-DHAVE_CONFIG_H -I${.CURDIR}
+CFLAGS+=-D_U_="__attribute__((unused))" -DYYBISON
CFLAGS+=-DHAVE_STRUCT_ETHER_ADDR -DHAVE_NET_PFVAR_H
.if !defined(NOINET6)
CFLAGS+=-DINET6
.PATH: ${PCAP_DISTDIR}
.PATH: ${PCAP_DISTDIR}/bpf/net
-version.c: ${PCAP_DISTDIR}/VERSION
- @rm -f $@
- sed 's/.*/char pcap_version[] = "&";/' ${PCAP_DISTDIR}/VERSION > $@
+version.c: VERSION
+ sed -e 's/.*/char pcap_version[] = "&";/' ${.ALLSRC} > ${.TARGET}
-version.h: ${PCAP_DISTDIR}/VERSION
- @rm -f $@
- sed 's/.*/static const char pcap_version_string[] = "libpcap version &";/' \
- ${PCAP_DISTDIR}/VERSION > $@
+version.h: VERSION
+ sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' \
+ ${.ALLSRC} > ${.TARGET}
tokdefs.h: grammar.h
${LN} -sf grammar.h tokdefs.h
+pcap.o: version.h
+scanner.o: scanner.c tokdefs.h
+
#
# Magic to convert the man pages to something non Solarish
#
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.in by autoheader. */
-/* 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 */
/* Enable optimizer debugging */
/* #undef BDEBUG */
/* 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. */
#define HAVE_DECL_ETHER_HOSTTON 1
/* if libdlpi exists */
/* #undef HAVE_LIBDLPI */
+/* 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 <limits.h> header file. */
#define HAVE_LIMITS_H 1
+/* Define to 1 if you have the <linux/compiler.h> header file. */
+/* #undef HAVE_LINUX_COMPILER_H */
+
+/* Define to 1 if you have the <linux/ethtool.h> header file. */
+/* #undef HAVE_LINUX_ETHTOOL_H */
+
+/* Define to 1 if you have the <linux/if_packet.h> header file. */
+/* #undef HAVE_LINUX_IF_PACKET_H */
+
+/* Define to 1 if you have the <linux/net_tstamp.h> 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 <linux/types.h> header file. */
+/* #undef HAVE_LINUX_TYPES_H */
+
+/* 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 <netinet/if_ether.h> header file. */
#define HAVE_NETINET_IF_ETHER_H 1
+/* Define to 1 if you have the <netpacket/if_packet.h> header file. */
+/* #undef HAVE_NETPACKET_IF_PACKET_H */
+
+/* Define to 1 if you have the <netpacket/packet.h> header file. */
+/* #undef HAVE_NETPACKET_PACKET_H */
+
/* 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. */
/* #undef HAVE_NET_PFVAR_H */
-/* if there's an os_proto.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 <paths.h> header file. */
/* define if net/pfvar.h defines PF_NAT through PF_NORDR */
/* #undef HAVE_PF_NAT_THROUGH_PF_NORDR */
-/* define if you have a /proc/net/dev */
-/* #undef HAVE_PROC_NET_DEV */
-
/* 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 sa_len */
+/* if struct sockaddr has the sa_len member */
#define HAVE_SOCKADDR_SA_LEN 1
/* if struct sockaddr_storage exists */
/* 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 <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
/* target host supports Bluetooth sniffing */
/* #undef PCAP_SUPPORT_BT */
+/* 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 */
/* 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 */
-/* if we have u_int16_t */
+/* Define to `unsigned short' if u_int16_t not defined. */
/* #undef u_int16_t */
-/* if we have u_int32_t */
+/* Define to `unsigned int' if u_int32_t not defined. */
/* #undef u_int32_t */
-/* if we have u_int64_t */
+/* Define to `unsigned long long' if u_int64_t not defined. */
/* #undef u_int64_t */
-/* if we have u_int8_t */
+/* Define to `unsigned char' if u_int8_t not defined. */
/* #undef u_int8_t */