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