summaryrefslogtreecommitdiff
path: root/sys/netinet/udp_var.h
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2009-08-02 19:43:32 +0000
committerRobert Watson <rwatson@FreeBSD.org>2009-08-02 19:43:32 +0000
commit315e3e38faa1ac7e775bbbbca0079c23fa3513ea (patch)
treea40bf95a151eb088ca45c32ee899b724ba74dcea /sys/netinet/udp_var.h
parent9734411552a036160bfa03958256bdd3bfe6119f (diff)
Notes
Diffstat (limited to 'sys/netinet/udp_var.h')
-rw-r--r--sys/netinet/udp_var.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h
index 803167076023..b8d994cc3a62 100644
--- a/sys/netinet/udp_var.h
+++ b/sys/netinet/udp_var.h
@@ -91,8 +91,19 @@ struct udpstat {
};
#ifdef _KERNEL
+/*
+ * In-kernel consumers can use these accessor macros directly to update
+ * stats.
+ */
#define UDPSTAT_ADD(name, val) V_udpstat.name += (val)
#define UDPSTAT_INC(name) UDPSTAT_ADD(name, 1)
+
+/*
+ * Kernel module consumers must use this accessor macro.
+ */
+void kmod_udpstat_inc(int statnum);
+#define KMOD_UDPSTAT_INC(name) \
+ kmod_udpstat_inc(offsetof(struct udpstat, name) / sizeof(u_long))
#endif
/*