summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_mroute.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-04-12 14:00:36 +0000
committerrwatson <rwatson@FreeBSD.org>2009-04-12 14:00:36 +0000
commit7dde6eabe7b79445be1a7ce55359e86b33907454 (patch)
tree9fa9b2018f245f7a7b3e6ea1d009cf16267468bc /sys/netinet/ip_mroute.h
parentb6c3ef293c21db10fb7caf37450826d242c15794 (diff)
downloadFreeBSD-src-7dde6eabe7b79445be1a7ce55359e86b33907454.zip
FreeBSD-src-7dde6eabe7b79445be1a7ce55359e86b33907454.tar.gz
Update stats in struct mrtstat using two new macros: MRTSTAT_ADD()
and MRTSTAT_INC(), rather than directly manipulating the fields of the structure. This will make it easier to change the implementation of these statistics, such as using per-CPU versions of the data structure. MFC after: 3 days
Diffstat (limited to 'sys/netinet/ip_mroute.h')
-rw-r--r--sys/netinet/ip_mroute.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/netinet/ip_mroute.h b/sys/netinet/ip_mroute.h
index a167965..d5ef5e0 100644
--- a/sys/netinet/ip_mroute.h
+++ b/sys/netinet/ip_mroute.h
@@ -221,6 +221,11 @@ struct mrtstat {
u_long mrts_upq_sockfull; /* upcalls dropped - socket full */
};
+#ifdef _KERNEL
+#define MRTSTAT_ADD(name, val) mrtstat.name += (val)
+#define MRTSTAT_INC(name) MRTSTAT_ADD(name, 1)
+#endif
+
/*
* Argument structure used by mrouted to get src-grp pkt counts
*/
OpenPOWER on IntegriCloud