xt_hashlimit.h revision 525ce914edf136d2bd02ac8c404d56c52e737f4d
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}; 36struct hashlimit_cfg { 37 __u32 mode; 38 __u32 avg; 39 __u32 burst; 40 __u32 size; 41 __u32 max; 42 __u32 gc_interval; 43 __u32 expire; 44}; 45struct xt_hashlimit_info { 46 char name[IFNAMSIZ]; 47 struct hashlimit_cfg cfg; 48 struct xt_hashlimit_htable * hinfo; 49 union { 50 void * ptr; 51 struct xt_hashlimit_info * master; 52 } u; 53}; 54struct hashlimit_cfg1 { 55 __u32 mode; 56 __u32 avg; 57 __u32 burst; 58 __u32 size; 59 __u32 max; 60 __u32 gc_interval; 61 __u32 expire; 62 __u8 srcmask, dstmask; 63}; 64struct hashlimit_cfg2 { 65 __u64 avg; 66 __u64 burst; 67 __u32 mode; 68 __u32 size; 69 __u32 max; 70 __u32 gc_interval; 71 __u32 expire; 72 __u8 srcmask, dstmask; 73}; 74struct xt_hashlimit_mtinfo1 { 75 char name[IFNAMSIZ]; 76 struct hashlimit_cfg1 cfg; 77 struct xt_hashlimit_htable * hinfo __attribute__((aligned(8))); 78}; 79struct xt_hashlimit_mtinfo2 { 80 char name[NAME_MAX]; 81 struct hashlimit_cfg2 cfg; 82 struct xt_hashlimit_htable * hinfo __attribute__((aligned(8))); 83}; 84#endif 85