Home | History | Annotate | Download | only in netfilter_ipv4
      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 _IPTABLES_H
     20 #define _IPTABLES_H
     21 #include <linux/compiler.h>
     22 #include <linux/netfilter_ipv4.h>
     23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     24 #include <linux/netfilter/x_tables.h>
     25 #define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
     26 #define IPT_TABLE_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
     27 #define ipt_match xt_match
     28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     29 #define ipt_target xt_target
     30 #define ipt_table xt_table
     31 #define ipt_get_revision xt_get_revision
     32 struct ipt_ip {
     33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     34  struct in_addr src, dst;
     35  struct in_addr smsk, dmsk;
     36  char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
     37  unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
     38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     39  u_int16_t proto;
     40  u_int8_t flags;
     41  u_int8_t invflags;
     42 };
     43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     44 #define ipt_entry_match xt_entry_match
     45 #define ipt_entry_target xt_entry_target
     46 #define ipt_standard_target xt_standard_target
     47 #define ipt_counters xt_counters
     48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     49 #define IPT_F_FRAG 0x01
     50 #define IPT_F_GOTO 0x02
     51 #define IPT_F_MASK 0x03
     52 #define IPT_INV_VIA_IN 0x01
     53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     54 #define IPT_INV_VIA_OUT 0x02
     55 #define IPT_INV_TOS 0x04
     56 #define IPT_INV_SRCIP 0x08
     57 #define IPT_INV_DSTIP 0x10
     58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     59 #define IPT_INV_FRAG 0x20
     60 #define IPT_INV_PROTO XT_INV_PROTO
     61 #define IPT_INV_MASK 0x7F
     62 struct ipt_entry
     63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     64 {
     65  struct ipt_ip ip;
     66  unsigned int nfcache;
     67  u_int16_t target_offset;
     68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     69  u_int16_t next_offset;
     70  unsigned int comefrom;
     71  struct xt_counters counters;
     72  unsigned char elems[0];
     73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     74 };
     75 #define IPT_BASE_CTL XT_BASE_CTL
     76 #define IPT_SO_SET_REPLACE XT_SO_SET_REPLACE
     77 #define IPT_SO_SET_ADD_COUNTERS XT_SO_SET_ADD_COUNTERS
     78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     79 #define IPT_SO_SET_MAX XT_SO_SET_MAX
     80 #define IPT_SO_GET_INFO XT_SO_GET_INFO
     81 #define IPT_SO_GET_ENTRIES XT_SO_GET_ENTRIES
     82 #define IPT_SO_GET_REVISION_MATCH XT_SO_GET_REVISION_MATCH
     83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     84 #define IPT_SO_GET_REVISION_TARGET XT_SO_GET_REVISION_TARGET
     85 #define IPT_SO_GET_MAX XT_SO_GET_REVISION_TARGET
     86 #define IPT_CONTINUE XT_CONTINUE
     87 #define IPT_RETURN XT_RETURN
     88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     89 #include <linux/netfilter/xt_tcpudp.h>
     90 #define ipt_udp xt_udp
     91 #define ipt_tcp xt_tcp
     92 #define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
     93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     94 #define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
     95 #define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
     96 #define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
     97 #define IPT_TCP_INV_MASK XT_TCP_INV_MASK
     98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     99 #define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
    100 #define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
    101 #define IPT_UDP_INV_MASK XT_UDP_INV_MASK
    102 struct ipt_icmp
    103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    104 {
    105  u_int8_t type;
    106  u_int8_t code[2];
    107  u_int8_t invflags;
    108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    109 };
    110 #define IPT_ICMP_INV 0x01
    111 struct ipt_getinfo
    112 {
    113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    114  char name[IPT_TABLE_MAXNAMELEN];
    115  unsigned int valid_hooks;
    116  unsigned int hook_entry[NF_IP_NUMHOOKS];
    117  unsigned int underflow[NF_IP_NUMHOOKS];
    118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    119  unsigned int num_entries;
    120  unsigned int size;
    121 };
    122 struct ipt_replace
    123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    124 {
    125  char name[IPT_TABLE_MAXNAMELEN];
    126  unsigned int valid_hooks;
    127  unsigned int num_entries;
    128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    129  unsigned int size;
    130  unsigned int hook_entry[NF_IP_NUMHOOKS];
    131  unsigned int underflow[NF_IP_NUMHOOKS];
    132  unsigned int num_counters;
    133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    134  struct xt_counters __user *counters;
    135  struct ipt_entry entries[0];
    136 };
    137 #define ipt_counters_info xt_counters_info
    138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    139 struct ipt_get_entries
    140 {
    141  char name[IPT_TABLE_MAXNAMELEN];
    142  unsigned int size;
    143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    144  struct ipt_entry entrytable[0];
    145 };
    146 #define IPT_STANDARD_TARGET XT_STANDARD_TARGET
    147 #define IPT_ERROR_TARGET XT_ERROR_TARGET
    148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    149 static __inline__ struct ipt_entry_target *
    150 ipt_get_target(struct ipt_entry *e)
    151 {
    152  return (void *)e + e->target_offset;
    153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    154 }
    155 #define IPT_MATCH_ITERATE(e, fn, args...)  ({   unsigned int __i;   int __ret = 0;   struct ipt_entry_match *__match;     for (__i = sizeof(struct ipt_entry);   __i < (e)->target_offset;   __i += __match->u.match_size) {   __match = (void *)(e) + __i;     __ret = fn(__match , ## args);   if (__ret != 0)   break;   }   __ret;  })
    156 #define IPT_ENTRY_ITERATE(entries, size, fn, args...)  ({   unsigned int __i;   int __ret = 0;   struct ipt_entry *__entry;     for (__i = 0; __i < (size); __i += __entry->next_offset) {   __entry = (void *)(entries) + __i;     __ret = fn(__entry , ## args);   if (__ret != 0)   break;   }   __ret;  })
    157 #endif
    158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    159