1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _LINUX_NETFILTER_XT_RECENT_H
3 #define _LINUX_NETFILTER_XT_RECENT_H 1
4 
5 #include <linux/types.h>
6 #include <linux/netfilter.h>
7 
8 enum {
9 	XT_RECENT_CHECK    = 1 << 0,
10 	XT_RECENT_SET      = 1 << 1,
11 	XT_RECENT_UPDATE   = 1 << 2,
12 	XT_RECENT_REMOVE   = 1 << 3,
13 	XT_RECENT_TTL      = 1 << 4,
14 	XT_RECENT_REAP     = 1 << 5,
15 
16 	XT_RECENT_SOURCE   = 0,
17 	XT_RECENT_DEST     = 1,
18 
19 	XT_RECENT_NAME_LEN = 200,
20 };
21 
22 /* Only allowed with --rcheck and --update */
23 #define XT_RECENT_MODIFIERS (XT_RECENT_TTL|XT_RECENT_REAP)
24 
25 #define XT_RECENT_VALID_FLAGS (XT_RECENT_CHECK|XT_RECENT_SET|XT_RECENT_UPDATE|\
26 			       XT_RECENT_REMOVE|XT_RECENT_TTL|XT_RECENT_REAP)
27 
28 struct xt_recent_mtinfo {
29 	__u32 seconds;
30 	__u32 hit_count;
31 	__u8 check_set;
32 	__u8 invert;
33 	char name[XT_RECENT_NAME_LEN];
34 	__u8 side;
35 };
36 
37 struct xt_recent_mtinfo_v1 {
38 	__u32 seconds;
39 	__u32 hit_count;
40 	__u8 check_set;
41 	__u8 invert;
42 	char name[XT_RECENT_NAME_LEN];
43 	__u8 side;
44 	union nf_inet_addr mask;
45 };
46 
47 #endif /* _LINUX_NETFILTER_XT_RECENT_H */
48