4 /* The protocol version */
5 #define IPSET_PROTOCOL 5
7 /* The max length of strings including NUL: set and type identifiers */
8 #define IPSET_MAXNAMELEN 32
10 /* Sets are identified by an index in kernel space. Tweak with ip_set_id_t
11 * and IPSET_INVALID_ID if you want to increase the max number of sets.
13 typedef uint16_t ip_set_id_t;
15 #define IPSET_INVALID_ID 65535
22 /* Max dimension in elements.
23 * If changed, new revision of iptables match/target is required.
28 /* Option flags for kernel operations */
30 IPSET_INV_MATCH = (1 << IPSET_DIM_ZERO),
31 IPSET_DIM_ONE_SRC = (1 << IPSET_DIM_ONE),
32 IPSET_DIM_TWO_SRC = (1 << IPSET_DIM_TWO),
33 IPSET_DIM_THREE_SRC = (1 << IPSET_DIM_THREE),
36 /* Interface to iptables/ip6tables */
40 union ip_set_name_index {
41 char name[IPSET_MAXNAMELEN];
45 #define IP_SET_OP_GET_BYNAME 0x00000006 /* Get set index by name */
46 struct ip_set_req_get_set {
49 union ip_set_name_index set;
52 #define IP_SET_OP_GET_BYINDEX 0x00000007 /* Get set name by index */
53 /* Uses ip_set_req_get_set */
55 #define IP_SET_OP_VERSION 0x00000100 /* Ask kernel version */
56 struct ip_set_req_version {
61 /* Revision 0 interface: backward compatible with netfilter/iptables */
64 * Option flags for kernel operations (xt_set_info_v0)
66 #define IPSET_SRC 0x01 /* Source match/add */
67 #define IPSET_DST 0x02 /* Destination match/add */
68 #define IPSET_MATCH_INV 0x04 /* Inverse matching */
70 struct xt_set_info_v0 {
73 u_int32_t flags[IPSET_DIM_MAX + 1];
75 u_int32_t __flags[IPSET_DIM_MAX];
82 /* match and target infos */
83 struct xt_set_info_match_v0 {
84 struct xt_set_info_v0 match_set;
87 struct xt_set_info_target_v0 {
88 struct xt_set_info_v0 add_set;
89 struct xt_set_info_v0 del_set;
92 /* Revision 1: current interface to netfilter/iptables */
100 /* match and target infos */
101 struct xt_set_info_match {
102 struct xt_set_info match_set;
105 struct xt_set_info_target {
106 struct xt_set_info add_set;
107 struct xt_set_info del_set;