From a390027dcd1a460c262d92b75b0845f321b582e7 Mon Sep 17 00:00:00 2001 From: mlaier Date: Thu, 14 Jul 2005 22:22:51 +0000 Subject: [PATCH] Export pfsyncstats via sysctl "net.inet.pfsync" in order to print them with netstat (seperate commit). Requested by: glebius MFC after: 1 week --- sys/contrib/pf/net/if_pfsync.c | 6 +++++- sys/netinet/in_proto.c | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/contrib/pf/net/if_pfsync.c b/sys/contrib/pf/net/if_pfsync.c index 76af30581a9a..77b4b5feb3d3 100644 --- a/sys/contrib/pf/net/if_pfsync.c +++ b/sys/contrib/pf/net/if_pfsync.c @@ -56,6 +56,7 @@ #include #include #include +#include #else #include #include @@ -119,8 +120,11 @@ int pfsyncdebug; struct pfsync_softc pfsyncif; #endif struct pfsyncstats pfsyncstats; - #ifdef __FreeBSD__ +SYSCTL_DECL(_net_inet_pfsync); +SYSCTL_STRUCT(_net_inet_pfsync, 0, stats, CTLFLAG_RW, + &pfsyncstats, pfsyncstats, + "PFSYNC statistics (struct pfsyncstats, net/if_pfsync.h)"); /* * Locking notes: diff --git a/sys/netinet/in_proto.c b/sys/netinet/in_proto.c index 103682fd1f1b..fd014792f901 100644 --- a/sys/netinet/in_proto.c +++ b/sys/netinet/in_proto.c @@ -301,8 +301,11 @@ SYSCTL_NODE(_net_inet, IPPROTO_AH, ipsec, CTLFLAG_RW, 0, "IPSEC"); #endif /* !FAST_IPSEC */ SYSCTL_NODE(_net_inet, IPPROTO_RAW, raw, CTLFLAG_RW, 0, "RAW"); #ifdef PIM -SYSCTL_NODE(_net_inet, IPPROTO_PIM, pim, CTLFLAG_RW, 0, "PIM"); +SYSCTL_NODE(_net_inet, IPPROTO_PIM, pim, CTLFLAG_RW, 0, "PIM"); +#endif +#ifdef DEV_PFSYNC +SYSCTL_NODE(_net_inet, IPPROTO_PFSYNC, pfsync, CTLFLAG_RW, 0, "PFSYNC"); #endif #ifdef DEV_CARP -SYSCTL_NODE(_net_inet, IPPROTO_CARP, carp, CTLFLAG_RW, 0, "CARP"); +SYSCTL_NODE(_net_inet, IPPROTO_CARP, carp, CTLFLAG_RW, 0, "CARP"); #endif