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 **************************************************************************** 11 ****************************************************************************/ 12#ifndef _X_TABLES_H 13#define _X_TABLES_H 14 15#define XT_FUNCTION_MAXNAMELEN 30 16#define XT_TABLE_MAXNAMELEN 32 17 18struct xt_entry_match 19{ 20 union { 21 struct { 22 u_int16_t match_size; 23 24 char name[XT_FUNCTION_MAXNAMELEN-1]; 25 26 u_int8_t revision; 27 } user; 28 struct { 29 u_int16_t match_size; 30 31 struct xt_match *match; 32 } kernel; 33 34 u_int16_t match_size; 35 } u; 36 37 unsigned char data[0]; 38}; 39 40struct xt_entry_target 41{ 42 union { 43 struct { 44 u_int16_t target_size; 45 46 char name[XT_FUNCTION_MAXNAMELEN-1]; 47 48 u_int8_t revision; 49 } user; 50 struct { 51 u_int16_t target_size; 52 53 struct xt_target *target; 54 } kernel; 55 56 u_int16_t target_size; 57 } u; 58 59 unsigned char data[0]; 60}; 61 62struct xt_standard_target 63{ 64 struct xt_entry_target target; 65 int verdict; 66}; 67 68struct xt_get_revision 69{ 70 char name[XT_FUNCTION_MAXNAMELEN-1]; 71 72 u_int8_t revision; 73}; 74 75#define XT_CONTINUE 0xFFFFFFFF 76 77#define XT_RETURN (-NF_REPEAT - 1) 78 79struct _xt_align 80{ 81 u_int8_t u8; 82 u_int16_t u16; 83 u_int32_t u32; 84 u_int64_t u64; 85}; 86 87#define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) & ~(__alignof__(struct _xt_align)-1)) 88 89#define XT_STANDARD_TARGET "" 90 91#define XT_ERROR_TARGET "ERROR" 92 93#define XT_BASE_CTL 64 94 95#define XT_SO_SET_REPLACE (XT_BASE_CTL) 96#define XT_SO_SET_ADD_COUNTERS (XT_BASE_CTL + 1) 97#define XT_SO_SET_MAX XT_SO_SET_ADD_COUNTERS 98 99#define XT_SO_GET_INFO (XT_BASE_CTL) 100#define XT_SO_GET_ENTRIES (XT_BASE_CTL + 1) 101#define XT_SO_GET_REVISION_MATCH (XT_BASE_CTL + 2) 102#define XT_SO_GET_REVISION_TARGET (XT_BASE_CTL + 3) 103#define XT_SO_GET_MAX XT_SO_GET_REVISION_TARGET 104 105#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0) 106#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0) 107 108struct xt_counters 109{ 110 u_int64_t pcnt, bcnt; 111}; 112 113struct xt_counters_info 114{ 115 116 char name[XT_TABLE_MAXNAMELEN]; 117 118 unsigned int num_counters; 119 120 struct xt_counters counters[0]; 121}; 122 123#define XT_INV_PROTO 0x40 124 125#endif 126