xt_hashlimit.h revision 1308ad3ab33294c3abfd96da12b6df58b381ce52
1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_XT_HASHLIMIT_H
20#define _UAPI_XT_HASHLIMIT_H
21#include <linux/types.h>
22#include <linux/limits.h>
23#include <linux/if.h>
24#define XT_HASHLIMIT_SCALE 10000
25#define XT_HASHLIMIT_SCALE_v2 1000000llu
26#define XT_HASHLIMIT_BYTE_SHIFT 4
27struct xt_hashlimit_htable;
28enum {
29  XT_HASHLIMIT_HASH_DIP = 1 << 0,
30  XT_HASHLIMIT_HASH_DPT = 1 << 1,
31  XT_HASHLIMIT_HASH_SIP = 1 << 2,
32  XT_HASHLIMIT_HASH_SPT = 1 << 3,
33  XT_HASHLIMIT_INVERT = 1 << 4,
34  XT_HASHLIMIT_BYTES = 1 << 5,
35  XT_HASHLIMIT_RATE_MATCH = 1 << 6,
36};
37struct hashlimit_cfg {
38  __u32 mode;
39  __u32 avg;
40  __u32 burst;
41  __u32 size;
42  __u32 max;
43  __u32 gc_interval;
44  __u32 expire;
45};
46struct xt_hashlimit_info {
47  char name[IFNAMSIZ];
48  struct hashlimit_cfg cfg;
49  struct xt_hashlimit_htable * hinfo;
50  union {
51    void * ptr;
52    struct xt_hashlimit_info * master;
53  } u;
54};
55struct hashlimit_cfg1 {
56  __u32 mode;
57  __u32 avg;
58  __u32 burst;
59  __u32 size;
60  __u32 max;
61  __u32 gc_interval;
62  __u32 expire;
63  __u8 srcmask, dstmask;
64};
65struct hashlimit_cfg2 {
66  __u64 avg;
67  __u64 burst;
68  __u32 mode;
69  __u32 size;
70  __u32 max;
71  __u32 gc_interval;
72  __u32 expire;
73  __u8 srcmask, dstmask;
74};
75struct hashlimit_cfg3 {
76  __u64 avg;
77  __u64 burst;
78  __u32 mode;
79  __u32 size;
80  __u32 max;
81  __u32 gc_interval;
82  __u32 expire;
83  __u32 interval;
84  __u8 srcmask, dstmask;
85};
86struct xt_hashlimit_mtinfo1 {
87  char name[IFNAMSIZ];
88  struct hashlimit_cfg1 cfg;
89  struct xt_hashlimit_htable * hinfo __attribute__((aligned(8)));
90};
91struct xt_hashlimit_mtinfo2 {
92  char name[NAME_MAX];
93  struct hashlimit_cfg2 cfg;
94  struct xt_hashlimit_htable * hinfo __attribute__((aligned(8)));
95};
96struct xt_hashlimit_mtinfo3 {
97  char name[NAME_MAX];
98  struct hashlimit_cfg3 cfg;
99  struct xt_hashlimit_htable * hinfo __attribute__((aligned(8)));
100};
101#endif
102