summaryrefslogtreecommitdiff
path: root/usr.bin/netstat/flowtable.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-09-11 17:20:03 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-09-11 17:20:03 +0000
commit0e1e5c22c20e636264ff1284083c6af7a1b282cb (patch)
tree09add9017de3c98451b1eaf85a24b608cf228e4b /usr.bin/netstat/flowtable.c
parent6160f3cfcac58513eef46e925b0bf15681e88512 (diff)
parent92392e798859a0d87094d6c0b22afee48fde7881 (diff)
Notes
Diffstat (limited to 'usr.bin/netstat/flowtable.c')
-rw-r--r--usr.bin/netstat/flowtable.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/netstat/flowtable.c b/usr.bin/netstat/flowtable.c
index a232d801c1e6..c00dfd649f17 100644
--- a/usr.bin/netstat/flowtable.c
+++ b/usr.bin/netstat/flowtable.c
@@ -28,13 +28,15 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+
#include <sys/param.h>
-#include <sys/sysctl.h>
+
#include <net/flowtable.h>
-#include <err.h>
+
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
+
#include "netstat.h"
/*
@@ -68,17 +70,18 @@ void
flowtable_stats(void)
{
struct flowtable_stat stat;
- size_t len = sizeof(stat);
if (!live)
return;
- if (sysctlbyname("net.flowtable.ip4.stat", &stat, &len, NULL, 0) == 0) {
+ if (fetch_stats("net.flowtable.ip4.stat", 0, &stat,
+ sizeof(stat), NULL) == 0) {
printf("flowtable for IPv4:\n");
print_stats(&stat);
}
- if (sysctlbyname("net.flowtable.ip6.stat", &stat, &len, NULL, 0) == 0) {
+ if (fetch_stats("net.flowtable.ip6.stat", 0, &stat,
+ sizeof(stat), NULL) == 0) {
printf("flowtable for IPv6:\n");
print_stats(&stat);
}