]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/basic/ratelimit.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 Copyright 2010 Lennart Poettering
10 #include "time-util.h"
13 typedef struct RateLimit
{
20 #define RATELIMIT_DEFINE(_name, _interval, _burst) \
22 .interval = (_interval), \
28 #define RATELIMIT_INIT(v, _interval, _burst) \
30 RateLimit *_r = &(v); \
31 _r->interval = (_interval); \
32 _r->burst = (_burst); \
37 #define RATELIMIT_RESET(v) \
39 RateLimit *_r = &(v); \
44 bool ratelimit_below(RateLimit
*r
);