diff options
Diffstat (limited to 'freebsd/sys/netinet/icmp_var.h')
-rw-r--r-- | freebsd/sys/netinet/icmp_var.h | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/freebsd/sys/netinet/icmp_var.h b/freebsd/sys/netinet/icmp_var.h index d939cc2e..d3e72bc2 100644 --- a/freebsd/sys/netinet/icmp_var.h +++ b/freebsd/sys/netinet/icmp_var.h @@ -58,11 +58,15 @@ struct icmpstat { }; #ifdef _KERNEL +#include <sys/counter.h> + +VNET_PCPUSTAT_DECLARE(struct icmpstat, icmpstat); /* * In-kernel consumers can use these accessor macros directly to update * stats. */ -#define ICMPSTAT_ADD(name, val) V_icmpstat.name += (val) +#define ICMPSTAT_ADD(name, val) \ + VNET_PCPUSTAT_ADD(struct icmpstat, icmpstat, name, (val)) #define ICMPSTAT_INC(name) ICMPSTAT_ADD(name, 1) /* @@ -70,30 +74,19 @@ struct icmpstat { */ void kmod_icmpstat_inc(int statnum); #define KMOD_ICMPSTAT_INC(name) \ - kmod_icmpstat_inc(offsetof(struct icmpstat, name) / sizeof(u_long)) + kmod_icmpstat_inc(offsetof(struct icmpstat, name) / sizeof(uint64_t)) #endif /* - * Names for ICMP sysctl objects + * Identifiers for ICMP sysctl nodes */ #define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */ #define ICMPCTL_STATS 2 /* statistics (read-only) */ #define ICMPCTL_ICMPLIM 3 -#define ICMPCTL_MAXID 4 - -#define ICMPCTL_NAMES { \ - { 0, 0 }, \ - { "maskrepl", CTLTYPE_INT }, \ - { "stats", CTLTYPE_STRUCT }, \ - { "icmplim", CTLTYPE_INT }, \ -} #ifdef _KERNEL SYSCTL_DECL(_net_inet_icmp); -VNET_DECLARE(struct icmpstat, icmpstat); /* icmp statistics. */ -#define V_icmpstat VNET(icmpstat) - extern int badport_bandlim(int); #define BANDLIM_UNLIMITED -1 #define BANDLIM_ICMP_UNREACH 0 |