void ipsec_stats(u_long off __unused, const char *name, int af1 __unused) { if (off == 0) return; printf ("%s:\n", name); kread(off, (char *)&ipsecstat, sizeof (ipsecstat)); print_ipsecstats(); }
void ipsec_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { struct ipsecstat ipsecstat; if (off == 0) return; printf ("%s:\n", name); kread(off, (char *)&ipsecstat, sizeof(ipsecstat)); print_ipsecstats(&ipsecstat); }
void ipsec_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { struct ipsecstat ipsecstat; if (strcmp(name, "ipsec6") == 0) { if (fetch_stats("net.inet6.ipsec6.ipsecstats", off,&ipsecstat, sizeof(ipsecstat), kread_counters) != 0) return; } else { if (fetch_stats("net.inet.ipsec.ipsecstats", off, &ipsecstat, sizeof(ipsecstat), kread_counters) != 0) return; } xo_emit("{T:/%s}:\n", name); print_ipsecstats(&ipsecstat); }
void ipsec_stats(uint32_t off __unused, char *name, int af __unused) { size_t len; len = sizeof(struct ipsecstat); if (strcmp(name, "ipsec") == 0) { if (sysctlbyname("net.inet.ipsec.stats", &ipsecstat, &len, 0, 0) == -1) return; } else if (strcmp(name, "ipsec6") == 0) { if (sysctlbyname("net.inet6.ipsec6.stats", &ipsecstat, &len, 0, 0) == -1) return; } else return; printf ("%s:\n", name); print_ipsecstats(); if (interval > 0) bcopy(&ipsecstat, &pipsecstat, len); }