ipsecstat
VNET_PCPUSTAT_DEFINE(struct ipsecstat, ipsec4stat);
SYSCTL_VNET_PCPUSTAT(_net_inet_ipsec, OID_AUTO, ipsecstats, struct ipsecstat,
VNET_PCPUSTAT_DEFINE(struct ipsecstat, ipsec6stat);
struct ipsecstat, ipsec6stat, "IPsec IPv6 statistics.");
VNET_PCPUSTAT_DECLARE(struct ipsecstat, ipsec4stat);
VNET_PCPUSTAT_ADD(struct ipsecstat, ipsec4stat, name, 1); \
VNET_PCPUSTAT_DECLARE(struct ipsecstat, ipsec6stat);
VNET_PCPUSTAT_ADD(struct ipsecstat, ipsec6stat, name, 1)
struct ipsecstat ips;
print_ipsecstats(const char *tag, const struct ipsecstat *ipsecstat)
#define p(f, m) if (ipsecstat->f || sflag <= 1) \
xo_emit(m, (uintmax_t)ipsecstat->f, plural(ipsecstat->f))
#define p2(f, m) if (ipsecstat->f || sflag <= 1) \
xo_emit(m, (uintmax_t)ipsecstat->f, plurales(ipsecstat->f))
struct ipsecstat ipsecstat;
if (fetch_stats("net.inet6.ipsec6.ipsecstats", off,&ipsecstat,
sizeof(ipsecstat), kread_counters) != 0)
if (fetch_stats("net.inet.ipsec.ipsecstats", off, &ipsecstat,
sizeof(ipsecstat), kread_counters) != 0)
print_ipsecstats(tag, &ipsecstat);