summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/Makefile4
-rw-r--r--usr.bin/netstat/if.c8
-rw-r--r--usr.bin/netstat/main.c2
3 files changed, 12 insertions, 2 deletions
diff --git a/usr.bin/netstat/Makefile b/usr.bin/netstat/Makefile
index 1644aab..2432cfb 100644
--- a/usr.bin/netstat/Makefile
+++ b/usr.bin/netstat/Makefile
@@ -27,6 +27,10 @@ CFLAGS+=-DINET6
CFLAGS+=-DSDP
.endif
+.if ${MK_PF} != "no"
+CFLAGS+=-DPF
+.endif
+
BINGRP= kmem
BINMODE=2555
DPADD= ${LIBKVM} ${LIBMEMSTAT} ${LIBUTIL}
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index 1ec0beb..e0f6e28 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -49,13 +49,15 @@ __FBSDID("$FreeBSD$");
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/ethernet.h>
-#include <net/pfvar.h>
-#include <net/if_pfsync.h>
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <netipx/ipx.h>
#include <netipx/ipx_if.h>
#include <arpa/inet.h>
+#ifdef PF
+#include <net/pfvar.h>
+#include <net/if_pfsync.h>
+#endif
#include <err.h>
#include <errno.h>
@@ -81,6 +83,7 @@ static void sidewaysintpr(int);
static char addr_buf[NI_MAXHOST]; /* for getnameinfo() */
#endif
+#ifdef PF
static const char* pfsyncacts[] = {
/* PFSYNC_ACT_CLR */ "clear all request",
/* PFSYNC_ACT_INS */ "state insert",
@@ -155,6 +158,7 @@ pfsync_stats(u_long off, const char *name, int af1 __unused, int proto __unused)
p(pfsyncs_oerrors, "\t\t%ju send error%s\n");
#undef p
}
+#endif /* PF */
/*
* Display a formatted value, or a '-' in the same space.
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 5c952ad..0876460 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -214,8 +214,10 @@ struct protox {
pim_stats, NULL, "pim", 1, IPPROTO_PIM },
{ -1, N_CARPSTAT, 1, NULL,
carp_stats, NULL, "carp", 1, 0 },
+#ifdef PF
{ -1, N_PFSYNCSTAT, 1, NULL,
pfsync_stats, NULL, "pfsync", 1, 0 },
+#endif
{ -1, N_ARPSTAT, 1, NULL,
arp_stats, NULL, "arp", 1, 0 },
{ -1, -1, 0, NULL,
OpenPOWER on IntegriCloud