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__LINUX_BRIDGE_EFF_H 20 #define _UAPI__LINUX_BRIDGE_EFF_H 21 #include <linux/if.h> 22 #include <linux/netfilter_bridge.h> 23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 #include <linux/if_ether.h> 25 #define EBT_TABLE_MAXNAMELEN 32 26 #define EBT_CHAIN_MAXNAMELEN EBT_TABLE_MAXNAMELEN 27 #define EBT_FUNCTION_MAXNAMELEN EBT_TABLE_MAXNAMELEN 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 #define EBT_ACCEPT -1 30 #define EBT_DROP -2 31 #define EBT_CONTINUE -3 32 #define EBT_RETURN -4 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 #define NUM_STANDARD_TARGETS 4 35 #define EBT_VERDICT_BITS 0x0000000F 36 struct xt_match; 37 struct xt_target; 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 struct ebt_counter { 40 uint64_t pcnt; 41 uint64_t bcnt; 42 }; 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 struct ebt_replace { 45 char name[EBT_TABLE_MAXNAMELEN]; 46 unsigned int valid_hooks; 47 unsigned int nentries; 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 unsigned int entries_size; 50 struct ebt_entries __user *hook_entry[NF_BR_NUMHOOKS]; 51 unsigned int num_counters; 52 struct ebt_counter __user *counters; 53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54 char __user *entries; 55 }; 56 struct ebt_replace_kernel { 57 char name[EBT_TABLE_MAXNAMELEN]; 58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59 unsigned int valid_hooks; 60 unsigned int nentries; 61 unsigned int entries_size; 62 struct ebt_entries *hook_entry[NF_BR_NUMHOOKS]; 63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 unsigned int num_counters; 65 struct ebt_counter *counters; 66 char *entries; 67 }; 68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 69 struct ebt_entries { 70 unsigned int distinguisher; 71 char name[EBT_CHAIN_MAXNAMELEN]; 72 unsigned int counter_offset; 73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 74 int policy; 75 unsigned int nentries; 76 char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); 77 }; 78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 79 #define EBT_ENTRY_OR_ENTRIES 0x01 80 #define EBT_NOPROTO 0x02 81 #define EBT_802_3 0x04 82 #define EBT_SOURCEMAC 0x08 83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 84 #define EBT_DESTMAC 0x10 85 #define EBT_F_MASK (EBT_NOPROTO | EBT_802_3 | EBT_SOURCEMAC | EBT_DESTMAC | EBT_ENTRY_OR_ENTRIES) 86 #define EBT_IPROTO 0x01 87 #define EBT_IIN 0x02 88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 89 #define EBT_IOUT 0x04 90 #define EBT_ISOURCE 0x8 91 #define EBT_IDEST 0x10 92 #define EBT_ILOGICALIN 0x20 93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 94 #define EBT_ILOGICALOUT 0x40 95 #define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST) 96 struct ebt_entry_match { 97 union { 98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 99 char name[EBT_FUNCTION_MAXNAMELEN]; 100 struct xt_match *match; 101 } u; 102 unsigned int match_size; 103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 104 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); 105 }; 106 struct ebt_entry_watcher { 107 union { 108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 109 char name[EBT_FUNCTION_MAXNAMELEN]; 110 struct xt_target *watcher; 111 } u; 112 unsigned int watcher_size; 113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 114 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); 115 }; 116 struct ebt_entry_target { 117 union { 118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 119 char name[EBT_FUNCTION_MAXNAMELEN]; 120 struct xt_target *target; 121 } u; 122 unsigned int target_size; 123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 124 unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); 125 }; 126 #define EBT_STANDARD_TARGET "standard" 127 struct ebt_standard_target { 128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 129 struct ebt_entry_target target; 130 int verdict; 131 }; 132 struct ebt_entry { 133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 134 unsigned int bitmask; 135 unsigned int invflags; 136 __be16 ethproto; 137 char in[IFNAMSIZ]; 138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 139 char logical_in[IFNAMSIZ]; 140 char out[IFNAMSIZ]; 141 char logical_out[IFNAMSIZ]; 142 unsigned char sourcemac[ETH_ALEN]; 143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 144 unsigned char sourcemsk[ETH_ALEN]; 145 unsigned char destmac[ETH_ALEN]; 146 unsigned char destmsk[ETH_ALEN]; 147 unsigned int watchers_offset; 148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 149 unsigned int target_offset; 150 unsigned int next_offset; 151 unsigned char elems[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); 152 }; 153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 154 #define EBT_BASE_CTL 128 155 #define EBT_SO_SET_ENTRIES (EBT_BASE_CTL) 156 #define EBT_SO_SET_COUNTERS (EBT_SO_SET_ENTRIES+1) 157 #define EBT_SO_SET_MAX (EBT_SO_SET_COUNTERS+1) 158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 159 #define EBT_SO_GET_INFO (EBT_BASE_CTL) 160 #define EBT_SO_GET_ENTRIES (EBT_SO_GET_INFO+1) 161 #define EBT_SO_GET_INIT_INFO (EBT_SO_GET_ENTRIES+1) 162 #define EBT_SO_GET_INIT_ENTRIES (EBT_SO_GET_INIT_INFO+1) 163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 164 #define EBT_SO_GET_MAX (EBT_SO_GET_INIT_ENTRIES+1) 165 #define EBT_MATCH_ITERATE(e, fn, args...) ({ unsigned int __i; int __ret = 0; struct ebt_entry_match *__match; for (__i = sizeof(struct ebt_entry); __i < (e)->watchers_offset; __i += __match->match_size + sizeof(struct ebt_entry_match)) { __match = (void *)(e) + __i; __ret = fn(__match , ## args); if (__ret != 0) break; } if (__ret == 0) { if (__i != (e)->watchers_offset) __ret = -EINVAL; } __ret; }) 166 #define EBT_WATCHER_ITERATE(e, fn, args...) ({ unsigned int __i; int __ret = 0; struct ebt_entry_watcher *__watcher; for (__i = e->watchers_offset; __i < (e)->target_offset; __i += __watcher->watcher_size + sizeof(struct ebt_entry_watcher)) { __watcher = (void *)(e) + __i; __ret = fn(__watcher , ## args); if (__ret != 0) break; } if (__ret == 0) { if (__i != (e)->target_offset) __ret = -EINVAL; } __ret; }) 167 #define EBT_ENTRY_ITERATE(entries, size, fn, args...) ({ unsigned int __i; int __ret = 0; struct ebt_entry *__entry; for (__i = 0; __i < (size);) { __entry = (void *)(entries) + __i; __ret = fn(__entry , ## args); if (__ret != 0) break; if (__entry->bitmask != 0) __i += __entry->next_offset; else __i += sizeof(struct ebt_entries); } if (__ret == 0) { if (__i != (size)) __ret = -EINVAL; } __ret; }) 168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 169 #endif 170