summaryrefslogtreecommitdiffstats
path: root/sys/netinet/icmp_var.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/icmp_var.h')
-rw-r--r--sys/netinet/icmp_var.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/netinet/icmp_var.h b/sys/netinet/icmp_var.h
index 4d70ada..30da6a2 100644
--- a/sys/netinet/icmp_var.h
+++ b/sys/netinet/icmp_var.h
@@ -58,8 +58,19 @@ struct icmpstat {
};
#ifdef _KERNEL
+/*
+ * In-kernel consumers can use these accessor macros directly to update
+ * stats.
+ */
#define ICMPSTAT_ADD(name, val) V_icmpstat.name += (val)
#define ICMPSTAT_INC(name) ICMPSTAT_ADD(name, 1)
+
+/*
+ * Kernel module consumers must use this accessor macro.
+ */
+void kmod_icmpstat_inc(int statnum);
+#define KMOD_ICMPSTAT_INC(name) \
+ kmod_icmpstat_inc(offsetof(struct icmpstat, name) / sizeof(u_long))
#endif
/*
OpenPOWER on IntegriCloud