diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-04-12 14:06:26 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-04-12 14:06:26 +0000 |
commit | 0d601ec4b544374b7099546be0f71a85eb2cd7da (patch) | |
tree | 3145b480ca90af6e567ce0da08765331b02aac6b /sys/netinet/pim_var.h | |
parent | 7dde6eabe7b79445be1a7ce55359e86b33907454 (diff) | |
download | FreeBSD-src-0d601ec4b544374b7099546be0f71a85eb2cd7da.zip FreeBSD-src-0d601ec4b544374b7099546be0f71a85eb2cd7da.tar.gz |
Update stats in struct pimstat using two new macros: PIMSTAT_ADD()
and PIMSTAT_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/pim_var.h')
-rw-r--r-- | sys/netinet/pim_var.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/netinet/pim_var.h b/sys/netinet/pim_var.h index f79edde..aecb673 100644 --- a/sys/netinet/pim_var.h +++ b/sys/netinet/pim_var.h @@ -59,6 +59,11 @@ struct pimstat { u_quad_t pims_snd_registers_bytes; /* sent regs. bytes (data only) */ }; +#ifdef _KERNEL +#define PIMSTAT_ADD(name, val) pimstat.name += (val) +#define PIMSTAT_INC(name) PIMSTAT_ADD(name, 1) +#endif + /* * Names for PIM sysctl objects */ |