xt_set.h 1.7 KB
Newer Older
1 2 3
#ifndef _XT_SET_H
#define _XT_SET_H

4
#include <linux/types.h>
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
#include <linux/netfilter/ipset/ip_set.h>

/* Revision 0 interface: backward compatible with netfilter/iptables */

/*
 * Option flags for kernel operations (xt_set_info_v0)
 */
#define IPSET_SRC		0x01	/* Source match/add */
#define IPSET_DST		0x02	/* Destination match/add */
#define IPSET_MATCH_INV		0x04	/* Inverse matching */

struct xt_set_info_v0 {
	ip_set_id_t index;
	union {
		__u32 flags[IPSET_DIM_MAX + 1];
		struct {
			__u32 __flags[IPSET_DIM_MAX];
			__u8 dim;
			__u8 flags;
		} compat;
	} u;
};

/* match and target infos */
struct xt_set_info_match_v0 {
	struct xt_set_info_v0 match_set;
};

struct xt_set_info_target_v0 {
	struct xt_set_info_v0 add_set;
	struct xt_set_info_v0 del_set;
};

38
/* Revision 1  match and target */
39 40 41 42 43 44 45 46

struct xt_set_info {
	ip_set_id_t index;
	__u8 dim;
	__u8 flags;
};

/* match and target infos */
47
struct xt_set_info_match_v1 {
48 49 50
	struct xt_set_info match_set;
};

51
struct xt_set_info_target_v1 {
52 53 54 55
	struct xt_set_info add_set;
	struct xt_set_info del_set;
};

56 57 58 59 60
/* Revision 2 target */

struct xt_set_info_target_v2 {
	struct xt_set_info add_set;
	struct xt_set_info del_set;
61 62
	__u32 flags;
	__u32 timeout;
63 64
};

65 66 67 68
/* Revision 3 match */

struct xt_set_info_match_v3 {
	struct xt_set_info match_set;
69 70
	struct ip_set_counter_match0 packets;
	struct ip_set_counter_match0 bytes;
71 72 73
	__u32 flags;
};

74 75 76 77 78 79 80 81 82 83
/* Revision 3 target */

struct xt_set_info_target_v3 {
	struct xt_set_info add_set;
	struct xt_set_info del_set;
	struct xt_set_info map_set;
	__u32 flags;
	__u32 timeout;
};

84 85 86 87 88 89 90 91 92
/* Revision 4 match */

struct xt_set_info_match_v4 {
	struct xt_set_info match_set;
	struct ip_set_counter_match packets;
	struct ip_set_counter_match bytes;
	__u32 flags;
};

93
#endif /*_XT_SET_H*/