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) \
66 {.target.u.user = {.target_size = XT_ALIGN(__size),.name = __name, }, \
67 }
68 struct xt_standard_target {
69   struct xt_entry_target target;
70 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
71   int verdict;
72 };
73 struct xt_error_target {
74   struct xt_entry_target target;
75 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
76   char errorname[XT_FUNCTION_MAXNAMELEN];
77 };
78 struct xt_get_revision {
79   char name[XT_EXTENSION_MAXNAMELEN];
80 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
81   __u8 revision;
82 };
83 #define XT_CONTINUE 0xFFFFFFFF
84 #define XT_RETURN (- NF_REPEAT - 1)
85 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
86 struct _xt_align {
87   __u8 u8;
88   __u16 u16;
89   __u32 u32;
90 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
91   __u64 u64;
92 };
93 #define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align))
94 #define XT_STANDARD_TARGET ""
95 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
96 #define XT_ERROR_TARGET "ERROR"
97 #define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0)
98 #define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
99 struct xt_counters {
100 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
101   __u64 pcnt, bcnt;
102 };
103 struct xt_counters_info {
104   char name[XT_TABLE_MAXNAMELEN];
105 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
106   unsigned int num_counters;
107   struct xt_counters counters[0];
108 };
109 #define XT_INV_PROTO 0x40
110 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
111 #define XT_MATCH_ITERATE(type,e,fn,args...) \
112 ({ 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; \
113 })
114 #define XT_ENTRY_ITERATE_CONTINUE(type,entries,size,n,fn,args...) \
115 ({ 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; \
116 })
117 #define XT_ENTRY_ITERATE(type,entries,size,fn,args...) XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args)
118 #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))
119 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
120 #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))
121 #endif
122