summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Zaborski <oshogbo@FreeBSD.org>2017-10-04 21:05:44 +0000
committerMariusz Zaborski <oshogbo@FreeBSD.org>2017-10-04 21:05:44 +0000
commitb01988a5f58a72c7827daebe9d885364791f3ae8 (patch)
tree4c26aff37c656cbb708b9c8e051808c9a97583ef
parent7b9f317cf32b25619c1bb55dea3aaf4501f9de7a (diff)
downloadsrc-test2-b01988a5f58a72c7827daebe9d885364791f3ae8.tar.gz
src-test2-b01988a5f58a72c7827daebe9d885364791f3ae8.zip
Partially revert r323866.
Using HAVE_* is a internal tcpdump style standard. We want to be consistent with the standard to upstream those changes in the future. Requested by: glebius@
Notes
Notes: svn path=/head/; revision=324287
-rw-r--r--contrib/tcpdump/addrtoname.c10
-rw-r--r--contrib/tcpdump/tcpdump.c18
-rw-r--r--usr.sbin/tcpdump/tcpdump/Makefile2
-rw-r--r--usr.sbin/tcpdump/tcpdump/config.h2
4 files changed, 16 insertions, 16 deletions
diff --git a/contrib/tcpdump/addrtoname.c b/contrib/tcpdump/addrtoname.c
index 7070bbfb9e17..85cbf7b73179 100644
--- a/contrib/tcpdump/addrtoname.c
+++ b/contrib/tcpdump/addrtoname.c
@@ -26,10 +26,10 @@
#include "config.h"
#endif
-#ifdef WITH_CASPER
+#ifdef HAVE_CASPER
#include <libcasper.h>
#include <casper/cap_dns.h>
-#endif /* WITH_CASPER */
+#endif /* HAVE_CASPER */
#include <netdissect-stdinc.h>
@@ -202,7 +202,7 @@ intoa(uint32_t addr)
static uint32_t f_netmask;
static uint32_t f_localnet;
-#ifdef WITH_CASPER
+#ifdef HAVE_CASPER
extern cap_channel_t *capdns;
#endif
@@ -250,7 +250,7 @@ getname(netdissect_options *ndo, const u_char *ap)
*/
if (!ndo->ndo_nflag &&
(addr & f_netmask) == f_localnet) {
-#ifdef WITH_CASPER
+#ifdef HAVE_CASPER
if (capdns != NULL) {
hp = cap_gethostbyaddr(capdns, (char *)&addr, 4,
AF_INET);
@@ -311,7 +311,7 @@ getname6(netdissect_options *ndo, const u_char *ap)
* Do not print names if -n was given.
*/
if (!ndo->ndo_nflag) {
-#ifdef WITH_CASPER
+#ifdef HAVE_CASPER
if (capdns != NULL) {
hp = cap_gethostbyaddr(capdns, (char *)&addr,
sizeof(addr), AF_INET6);
diff --git a/contrib/tcpdump/tcpdump.c b/contrib/tcpdump/tcpdump.c
index 893fe2e9b27e..527f39d92e47 100644
--- a/contrib/tcpdump/tcpdump.c
+++ b/contrib/tcpdump/tcpdump.c
@@ -82,10 +82,10 @@ The Regents of the University of California. All rights reserved.\n";
#include <sys/ioccom.h>
#include <net/bpf.h>
#include <libgen.h>
-#ifdef WITH_CASPER
+#ifdef HAVE_CASPER
#include <libcasper.h>
#include <casper/cap_dns.h>
-#endif /* WITH_CASPER */
+#endif /* HAVE_CASPER */
#endif /* HAVE_CAPSICUM */
#include <pcap.h>
#include <signal.h>
@@ -176,7 +176,7 @@ static int infoprint;
char *program_name;
-#ifdef WITH_CASPER
+#ifdef HAVE_CASPER
cap_channel_t *capdns;
#endif
@@ -730,7 +730,7 @@ get_next_file(FILE *VFile, char *ptr)
return ret;
}
-#ifdef WITH_CASPER
+#ifdef HAVE_CASPER
static cap_channel_t *
capdns_setup(void)
{
@@ -757,7 +757,7 @@ capdns_setup(void)
return (capdnsloc);
}
-#endif /* WITH_CASPER */
+#endif /* HAVE_CASPER */
#ifdef HAVE_PCAP_SET_TSTAMP_PRECISION
static int
@@ -1839,10 +1839,10 @@ main(int argc, char **argv)
exit_tcpdump(0);
}
-#ifdef WITH_CASPER
+#ifdef HAVE_CASPER
if (!ndo->ndo_nflag)
capdns = capdns_setup();
-#endif /* WITH_CASPER */
+#endif /* HAVE_CASPER */
init_print(ndo, localnet, netmask, timezone_offset);
@@ -2066,11 +2066,11 @@ main(int argc, char **argv)
#ifdef HAVE_CAPSICUM
cansandbox = (VFileName == NULL && zflag == NULL);
-#ifdef WITH_CASPER
+#ifdef HAVE_CASPER
cansandbox = (cansandbox && (ndo->ndo_nflag || capdns != NULL));
#else
cansandbox = (cansandbox && ndo->ndo_nflag);
-#endif /* WITH_CASPER */
+#endif /* HAVE_CASPER */
if (cansandbox && cap_enter() < 0 && errno != ENOSYS)
error("unable to enter the capability mode");
#endif /* HAVE_CAPSICUM */
diff --git a/usr.sbin/tcpdump/tcpdump/Makefile b/usr.sbin/tcpdump/tcpdump/Makefile
index 19a1101b6446..8f6f47754b4d 100644
--- a/usr.sbin/tcpdump/tcpdump/Makefile
+++ b/usr.sbin/tcpdump/tcpdump/Makefile
@@ -190,7 +190,7 @@ LIBADD= l pcap
.if ${MK_CASPER} != "no"
LIBADD+= casper
LIBADD+= cap_dns
-CFLAGS+=-DWITH_CASPER
+CFLAGS+=-DHAVE_CASPER
.endif
.if ${MK_OPENSSL} != "no"
LIBADD+= crypto
diff --git a/usr.sbin/tcpdump/tcpdump/config.h b/usr.sbin/tcpdump/tcpdump/config.h
index 1d8bf719c122..8980b31c8591 100644
--- a/usr.sbin/tcpdump/tcpdump/config.h
+++ b/usr.sbin/tcpdump/tcpdump/config.h
@@ -18,7 +18,7 @@
/* Casper library support available */
/* See Makefile */
-/* #undef WITH_CASPER */
+/* #undef HAVE_CASPER */
/* Define to 1 if you have the `cap_enter' function. */
#define HAVE_CAP_ENTER 1