diff options
author | 2015-06-05 15:58:00 +0200 | |
---|---|---|
committer | 2016-06-25 16:48:39 +0200 | |
commit | 99d303ac2739e65a02fbbc325b74ad6fcac63cc2 (patch) | |
tree | 6f4095f42d3d298cdd5ab8bc6f8ed89d9673b38b /src/ratelimiter.h | |
download | wireguard-monolithic-historical-99d303ac2739e65a02fbbc325b74ad6fcac63cc2.tar.xz wireguard-monolithic-historical-99d303ac2739e65a02fbbc325b74ad6fcac63cc2.zip |
Initial commit
Diffstat (limited to 'src/ratelimiter.h')
-rw-r--r-- | src/ratelimiter.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ratelimiter.h b/src/ratelimiter.h new file mode 100644 index 0000000..dac7752 --- /dev/null +++ b/src/ratelimiter.h @@ -0,0 +1,20 @@ +/* Copyright 2015-2016 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ + +#ifndef RATELIMITER_H +#define RATELIMITER_H + +#include <uapi/linux/netfilter/xt_hashlimit.h> +struct wireguard_device; +struct sk_buff; + +struct ratelimiter { + struct net *net; + struct xt_match *v4_match, *v6_match; + struct xt_hashlimit_mtinfo1 v4_info, v6_info; +}; + +int ratelimiter_init(struct ratelimiter *ratelimiter, struct wireguard_device *wg); +void ratelimiter_uninit(struct ratelimiter *ratelimiter); +bool ratelimiter_allow(struct ratelimiter *ratelimiter, struct sk_buff *skb); + +#endif |