Home | History | Annotate | Download | only in netfilter
      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_X_TABLES_H
     20 #define _UAPI_X_TABLES_H
     21 #include <linux/kernel.h>
     22 #include <linux/types.h>
     23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     24 #define XT_FUNCTION_MAXNAMELEN 30
     25 #define XT_EXTENSION_MAXNAMELEN 29
     26 #define XT_TABLE_MAXNAMELEN 32
     27 struct xt_entry_match {
     28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     29  union {
     30  struct {
     31  __u16 match_size;
     32  char name[XT_EXTENSION_MAXNAMELEN];
     33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     34  __u8 revision;
     35  } user;
     36  struct {
     37  __u16 match_size;
     38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     39  struct xt_match *match;
     40  } kernel;
     41  __u16 match_size;
     42  } u;
     43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     44  unsigned char data[0];
     45 };
     46 struct xt_entry_target {
     47  union {
     48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     49  struct {
     50  __u16 target_size;
     51  char name[XT_EXTENSION_MAXNAMELEN];
     52  __u8 revision;
     53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     54  } user;
     55  struct {
     56  __u16 target_size;
     57  struct xt_target *target;
     58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     59  } kernel;
     60  __u16 target_size;
     61  } u;
     62  unsigned char data[0];
     63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     64 };
     65 #define XT_TARGET_INIT(__name, __size)  {   .target.u.user = {   .target_size = XT_ALIGN(__size),   .name = __name,   },  }
     66 struct xt_standard_target {
     67  struct xt_entry_target target;
     68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     69  int verdict;
     70 };
     71 struct xt_error_target {
     72  struct xt_entry_target target;
     73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     74  char errorname[XT_FUNCTION_MAXNAMELEN];
     75 };
     76 struct xt_get_revision {
     77  char name[XT_EXTENSION_MAXNAMELEN];
     78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     79  __u8 revision;
     80 };
     81 #define XT_CONTINUE 0xFFFFFFFF
     82 #define XT_RETURN (-NF_REPEAT - 1)
     83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     84 struct _xt_align {
     85  __u8 u8;
     86  __u16 u16;
     87  __u32 u32;
     88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     89  __u64 u64;
     90 };
     91 #define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align))
     92 #define XT_STANDARD_TARGET ""
     93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     94 #define XT_ERROR_TARGET "ERROR"
     95 #define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0)
     96 #define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
     97 struct xt_counters {
     98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     99  __u64 pcnt, bcnt;
    100 };
    101 struct xt_counters_info {
    102  char name[XT_TABLE_MAXNAMELEN];
    103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    104  unsigned int num_counters;
    105  struct xt_counters counters[0];
    106 };
    107 #define XT_INV_PROTO 0x40
    108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    109 #define XT_MATCH_ITERATE(type, e, fn, args...)  ({   unsigned int __i;   int __ret = 0;   struct xt_entry_match *__m;     for (__i = sizeof(type);   __i < (e)->target_offset;   __i += __m->u.match_size) {   __m = (void *)e + __i;     __ret = fn(__m , ## args);   if (__ret != 0)   break;   }   __ret;  })
    110 #define XT_ENTRY_ITERATE_CONTINUE(type, entries, size, n, fn, args...)  ({   unsigned int __i, __n;   int __ret = 0;   type *__entry;     for (__i = 0, __n = 0; __i < (size);   __i += __entry->next_offset, __n++) {   __entry = (void *)(entries) + __i;   if (__n < n)   continue;     __ret = fn(__entry , ## args);   if (__ret != 0)   break;   }   __ret;  })
    111 #define XT_ENTRY_ITERATE(type, entries, size, fn, args...)   XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args)
    112 #define xt_entry_foreach(pos, ehead, esize)   for ((pos) = (typeof(pos))(ehead);   (pos) < (typeof(pos))((char *)(ehead) + (esize));   (pos) = (typeof(pos))((char *)(pos) + (pos)->next_offset))
    113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
    114 #define xt_ematch_foreach(pos, entry)   for ((pos) = (struct xt_entry_match *)entry->elems;   (pos) < (struct xt_entry_match *)((char *)(entry) +   (entry)->target_offset);   (pos) = (struct xt_entry_match *)((char *)(pos) +   (pos)->u.match_size))
    115 #endif
    116