1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _XT_U32_H
3 #define _XT_U32_H 1
4 
5 #include <linux/types.h>
6 
7 enum xt_u32_ops {
8 	XT_U32_AND,
9 	XT_U32_LEFTSH,
10 	XT_U32_RIGHTSH,
11 	XT_U32_AT,
12 };
13 
14 struct xt_u32_location_element {
15 	__u32 number;
16 	__u8 nextop;
17 };
18 
19 struct xt_u32_value_element {
20 	__u32 min;
21 	__u32 max;
22 };
23 
24 /*
25  * Any way to allow for an arbitrary number of elements?
26  * For now, I settle with a limit of 10 each.
27  */
28 #define XT_U32_MAXSIZE 10
29 
30 struct xt_u32_test {
31 	struct xt_u32_location_element location[XT_U32_MAXSIZE+1];
32 	struct xt_u32_value_element value[XT_U32_MAXSIZE+1];
33 	__u8 nnums;
34 	__u8 nvalues;
35 };
36 
37 struct xt_u32 {
38 	struct xt_u32_test tests[XT_U32_MAXSIZE+1];
39 	__u8 ntests;
40 	__u8 invert;
41 };
42 
43 #endif /* _XT_U32_H */
44