summaryrefslogtreecommitdiffstats
path: root/sys/netinet/udp_var.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-04-12 11:42:40 +0000
committerrwatson <rwatson@FreeBSD.org>2009-04-12 11:42:40 +0000
commit5dc0256f1481f91aa761b11afb7454bdcbb19b7d (patch)
tree1c2af20a61d5cccd88db042b98dc9009fe9c5206 /sys/netinet/udp_var.h
parentf4376efe43486d410755216aacd2459e2c05a8c3 (diff)
downloadFreeBSD-src-5dc0256f1481f91aa761b11afb7454bdcbb19b7d.zip
FreeBSD-src-5dc0256f1481f91aa761b11afb7454bdcbb19b7d.tar.gz
Update stats in struct udpstat using two new macros, UDPSTAT_ADD()
and UDPSTAT_INC(), rather than directly manipulating the fields across the kernel. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structures. MFC after: 3 days
Diffstat (limited to 'sys/netinet/udp_var.h')
-rw-r--r--sys/netinet/udp_var.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h
index 76a31b8..d83f705 100644
--- a/sys/netinet/udp_var.h
+++ b/sys/netinet/udp_var.h
@@ -71,6 +71,11 @@ struct udpstat {
u_long udps_filtermcast; /* blocked by multicast filter */
};
+#ifdef _KERNEL
+#define UDPSTAT_ADD(name, val) V_udpstat.name += (val)
+#define UDPSTAT_INC(name) UDPSTAT_ADD(name, 1)
+#endif
+
/*
* Names for UDP sysctl objects.
*/
OpenPOWER on IntegriCloud