Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/libpcap Don't use libpcap's bpf file, but use o...
details: https://anonhg.NetBSD.org/src/rev/9b7ec8b243cd
branches: trunk
changeset: 772170:9b7ec8b243cd
user: christos <christos%NetBSD.org@localhost>
date: Wed Dec 21 19:00:27 2011 +0000
description:
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.
diffstat:
external/bsd/libpcap/dist/gencode.c | 1 +
external/bsd/libpcap/dist/pcap/bpf.h | 2 +-
external/bsd/libpcap/dist/pcap/pcap.h | 2 ++
external/bsd/libpcap/lib/Makefile | 9 +++++++--
4 files changed, 11 insertions(+), 3 deletions(-)
diffs (66 lines):
diff -r 11ee6b4108a8 -r 9b7ec8b243cd external/bsd/libpcap/dist/gencode.c
--- a/external/bsd/libpcap/dist/gencode.c Wed Dec 21 15:27:50 2011 +0000
+++ b/external/bsd/libpcap/dist/gencode.c Wed Dec 21 19:00:27 2011 +0000
@@ -54,6 +54,7 @@
#ifdef __NetBSD__
#include <sys/param.h>
+#include <net/dlt.h>
#endif
#include <netinet/in.h>
diff -r 11ee6b4108a8 -r 9b7ec8b243cd external/bsd/libpcap/dist/pcap/bpf.h
--- a/external/bsd/libpcap/dist/pcap/bpf.h Wed Dec 21 15:27:50 2011 +0000
+++ b/external/bsd/libpcap/dist/pcap/bpf.h Wed Dec 21 19:00:27 2011 +0000
@@ -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
diff -r 11ee6b4108a8 -r 9b7ec8b243cd external/bsd/libpcap/dist/pcap/pcap.h
--- a/external/bsd/libpcap/dist/pcap/pcap.h Wed Dec 21 15:27:50 2011 +0000
+++ b/external/bsd/libpcap/dist/pcap/pcap.h Wed Dec 21 19:00:27 2011 +0000
@@ -49,6 +49,8 @@
#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H
#include <pcap/bpf.h>
+#else
+#include <net/bpf.h>
#endif
#include <stdio.h>
diff -r 11ee6b4108a8 -r 9b7ec8b243cd external/bsd/libpcap/lib/Makefile
--- a/external/bsd/libpcap/lib/Makefile Wed Dec 21 15:27:50 2011 +0000
+++ b/external/bsd/libpcap/lib/Makefile Wed Dec 21 19:00:27 2011 +0000
@@ -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 @@
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 @@
.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
Home |
Main Index |
Thread Index |
Old Index