xt_statistic.h 652 字节
Newer Older
1 2 3
#ifndef _XT_STATISTIC_H
#define _XT_STATISTIC_H

4 5
#include <linux/types.h>

6 7 8 9 10 11 12 13 14 15 16 17 18
enum xt_statistic_mode {
	XT_STATISTIC_MODE_RANDOM,
	XT_STATISTIC_MODE_NTH,
	__XT_STATISTIC_MODE_MAX
};
#define XT_STATISTIC_MODE_MAX (__XT_STATISTIC_MODE_MAX - 1)

enum xt_statistic_flags {
	XT_STATISTIC_INVERT		= 0x1,
};
#define XT_STATISTIC_MASK		0x1

struct xt_statistic_info {
19 20
	__u16			mode;
	__u16			flags;
21 22
	union {
		struct {
23
			__u32	probability;
24 25
		} random;
		struct {
26 27
			__u32	every;
			__u32	packet;
28
			/* Used internally by the kernel */
29
			__u32	count;
30 31 32 33 34 35
		} nth;
	} u;
	struct xt_statistic_info	*master __attribute__((aligned(8)));
};

#endif /* _XT_STATISTIC_H */