Jozsef Kadlecsik | d956798 | 2011-02-01 15:56:00 +0100 | [diff] [blame] | 1 | #ifndef _XT_SET_H |
| 2 | #define _XT_SET_H |
| 3 | |
Patrick McHardy | e3e241b | 2011-02-01 18:52:42 +0100 | [diff] [blame] | 4 | #include <linux/types.h> |
Jozsef Kadlecsik | d956798 | 2011-02-01 15:56:00 +0100 | [diff] [blame] | 5 | #include <linux/netfilter/ipset/ip_set.h> |
| 6 | |
| 7 | /* Revision 0 interface: backward compatible with netfilter/iptables */ |
| 8 | |
| 9 | /* |
| 10 | * Option flags for kernel operations (xt_set_info_v0) |
| 11 | */ |
| 12 | #define IPSET_SRC 0x01 /* Source match/add */ |
| 13 | #define IPSET_DST 0x02 /* Destination match/add */ |
| 14 | #define IPSET_MATCH_INV 0x04 /* Inverse matching */ |
| 15 | |
| 16 | struct xt_set_info_v0 { |
| 17 | ip_set_id_t index; |
| 18 | union { |
| 19 | __u32 flags[IPSET_DIM_MAX + 1]; |
| 20 | struct { |
| 21 | __u32 __flags[IPSET_DIM_MAX]; |
| 22 | __u8 dim; |
| 23 | __u8 flags; |
| 24 | } compat; |
| 25 | } u; |
| 26 | }; |
| 27 | |
| 28 | /* match and target infos */ |
| 29 | struct xt_set_info_match_v0 { |
| 30 | struct xt_set_info_v0 match_set; |
| 31 | }; |
| 32 | |
| 33 | struct xt_set_info_target_v0 { |
| 34 | struct xt_set_info_v0 add_set; |
| 35 | struct xt_set_info_v0 del_set; |
| 36 | }; |
| 37 | |
Jozsef Kadlecsik | ac8cc92 | 2011-06-16 18:42:40 +0200 | [diff] [blame] | 38 | /* Revision 1 match and target */ |
Jozsef Kadlecsik | d956798 | 2011-02-01 15:56:00 +0100 | [diff] [blame] | 39 | |
| 40 | struct xt_set_info { |
| 41 | ip_set_id_t index; |
| 42 | __u8 dim; |
| 43 | __u8 flags; |
| 44 | }; |
| 45 | |
| 46 | /* match and target infos */ |
Jozsef Kadlecsik | ac8cc92 | 2011-06-16 18:42:40 +0200 | [diff] [blame] | 47 | struct xt_set_info_match_v1 { |
Jozsef Kadlecsik | d956798 | 2011-02-01 15:56:00 +0100 | [diff] [blame] | 48 | struct xt_set_info match_set; |
| 49 | }; |
| 50 | |
Jozsef Kadlecsik | ac8cc92 | 2011-06-16 18:42:40 +0200 | [diff] [blame] | 51 | struct xt_set_info_target_v1 { |
Jozsef Kadlecsik | d956798 | 2011-02-01 15:56:00 +0100 | [diff] [blame] | 52 | struct xt_set_info add_set; |
| 53 | struct xt_set_info del_set; |
| 54 | }; |
| 55 | |
Jozsef Kadlecsik | ac8cc92 | 2011-06-16 18:42:40 +0200 | [diff] [blame] | 56 | /* Revision 2 target */ |
| 57 | |
| 58 | struct xt_set_info_target_v2 { |
| 59 | struct xt_set_info add_set; |
| 60 | struct xt_set_info del_set; |
| 61 | u32 flags; |
| 62 | u32 timeout; |
| 63 | }; |
| 64 | |
Jozsef Kadlecsik | d956798 | 2011-02-01 15:56:00 +0100 | [diff] [blame] | 65 | #endif /*_XT_SET_H*/ |