Module Name: src
Committed By: christos
Date: Wed Dec 21 19:00:28 UTC 2011
Modified Files:
src/external/bsd/libpcap/dist: gencode.c
src/external/bsd/libpcap/dist/pcap: bpf.h pcap.h
src/external/bsd/libpcap/lib: Makefile
Log Message:
Don't use libpcap's bpf file, but use our own:
1. include <net/dlt.h> where needed since we have the information in a separate
file.
2. #error in pcap/bpf.h to make sure it is not being used.
3. If we don't include <pcap/bpf.h> include <net/bpf.h> instead.
4. Install symlinks instead of copies of files.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libpcap/dist/gencode.c
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libpcap/dist/pcap/bpf.h
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/libpcap/dist/pcap/pcap.h
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/libpcap/lib/Makefile
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.3 src/external/bsd/libpcap/dist/gencode.c:1.4
--- src/external/bsd/libpcap/dist/gencode.c:1.3 Fri Sep 16 12:09:25 2011
+++ src/external/bsd/libpcap/dist/gencode.c Wed Dec 21 14:00:27 2011
@@ -54,6 +54,7 @@ static const char rcsid[] _U_ =
#ifdef __NetBSD__
#include <sys/param.h>
+#include <net/dlt.h>
#endif
#include <netinet/in.h>
Index: src/external/bsd/libpcap/dist/pcap/bpf.h
diff -u src/external/bsd/libpcap/dist/pcap/bpf.h:1.2 src/external/bsd/libpcap/dist/pcap/bpf.h:1.3
--- src/external/bsd/libpcap/dist/pcap/bpf.h:1.2 Sat Dec 4 20:45:46 2010
+++ src/external/bsd/libpcap/dist/pcap/bpf.h Wed Dec 21 14:00:28 2011
@@ -39,7 +39,7 @@
*
* @(#) Header: /tcpdump/master/libpcap/pcap/bpf.h,v 1.32 2008-12-23 20:13:29 guy Exp (LBL)
*/
-
+#error "This is not used in NetBSD, we use <net/bpf.h>"
/*
* This is libpcap's cut-down version of bpf.h; it includes only
* the stuff needed for the code generator and the userland BPF
Index: src/external/bsd/libpcap/dist/pcap/pcap.h
diff -u src/external/bsd/libpcap/dist/pcap/pcap.h:1.1.1.2 src/external/bsd/libpcap/dist/pcap/pcap.h:1.2
--- src/external/bsd/libpcap/dist/pcap/pcap.h:1.1.1.2 Sat Dec 4 20:27:29 2010
+++ src/external/bsd/libpcap/dist/pcap/pcap.h Wed Dec 21 14:00:28 2011
@@ -49,6 +49,8 @@
#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H
#include <pcap/bpf.h>
+#else
+#include <net/bpf.h>
#endif
#include <stdio.h>
Index: src/external/bsd/libpcap/lib/Makefile
diff -u src/external/bsd/libpcap/lib/Makefile:1.7 src/external/bsd/libpcap/lib/Makefile:1.8
--- src/external/bsd/libpcap/lib/Makefile:1.7 Thu Oct 13 13:23:28 2011
+++ src/external/bsd/libpcap/lib/Makefile Wed Dec 21 14:00:28 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2011/10/13 17:23:28 plunky Exp $
+# $NetBSD: Makefile,v 1.8 2011/12/21 19:00:28 christos Exp $
.include <bsd.own.mk>
@@ -7,6 +7,8 @@ USE_FORT?= yes # network protocol librar
CWARNFLAGS.clang+= -Wno-format-extra-args \
-Wno-unneeded-internal-declaration
+CPPFLAGS+= -DPCAP_DONT_INCLUDE_PCAP_BPF_H
+
.SUFFIXES: .3 .3pcap
__sed: .USE
@@ -86,8 +88,11 @@ SRCS= scanner.l savefile.c pcap.c pcap-b
.PATH: ${NETBSDSRCDIR}/sys/net
SRCS+= bpf_filter.c
-INCS= pcap-namedb.h pcap.h pcap/pcap.h pcap/namedb.h pcap/bpf.h
+INCS= pcap/pcap.h pcap/namedb.h
INCSDIR= /usr/include
+INCSYMLINKS+= ../net/bpf.h ${INCSDIR}/pcap/bpf.h
+INCSYMLINKS+= pcap/pcap.h ${INCSDIR}/pcap.h
+INCSYMLINKS+= pcap/namedb.h ${INCSDIR}/pcap-namedb.h
scanner.d scanner.o: tokdefs.h