HomeFreeBSD

counter(9): rate limit periods may be more than 1 second

Description

counter(9): rate limit periods may be more than 1 second

Teach counter_rate() to deal with periods of more than 1 second, so we can
express 'at most 100 in 10 seconds', which is different from 'at most 10 in
1 second'.
While here move the struct counter_rate definition into subr_counter.c so users
cannot mess with its internals. Add allocation and free functions.

Reviewed by: glebius
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D50796

Details

Provenance
kpAuthored on Jun 3 2025, 7:07 AM
Reviewer
glebius
Differential Revision
D50796: counter(9): rate limit periods may be more than 1 second
Parents
rG4c07abdbacf4: mandoc: Vendor import of upstream at 2025-06-13
Branches
Unknown
Tags
Unknown