PERFORCE change 80821 for review
soc-anders
soc-anders at FreeBSD.org
Sat Jul 23 00:07:21 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=80821
Change 80821 by soc-anders at soc-anders_gimli on 2005/07/23 00:06:36
IPsec6 stats are now available
Affected files ...
.. //depot/projects/soc2005/ifcleanup/src/src/usr.bin/netstat/ipsec.c#3 edit
Differences ...
==== //depot/projects/soc2005/ifcleanup/src/src/usr.bin/netstat/ipsec.c#3 (text+ko) ====
@@ -238,18 +238,18 @@
ipsec_stats(u_long off __unused, const char *name, int af1 __unused)
{
size_t len;
+ char *mib;
+ printf ("%s:\n", name);
- printf ("%s:\n", name);
+ if (strcmp(name, "ipsec") == 0)
+ mib = "net.inet.ipsec.stats";
+ else
+ mib = "net.inet6.ipsec6.stats";
- if (strcmp(name, "ipsec") == 0) {
- len = sizeof(ipsecstat);
- if (sysctlbyname("net.inet.ipsec.stats", &ipsecstat, &len,
- NULL, 0) < 0) {
- warn("sysctl: net.inet.ipsec.stats");
- return;
- }
- } else {
- /* IFCLEANUP: Not yet available */
+ len = sizeof(ipsecstat);
+ if (sysctlbyname(mib, &ipsecstat, &len,
+ NULL, 0) < 0) {
+ warn("sysctl: net.inet.ipsec.stats");
return;
}
print_ipsecstats();
More information about the p4-projects
mailing list