Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros
x_tables.h File Reference
#include <linux/kernel.h>
#include <linux/types.h>

Go to the source code of this file.

Data Structures

struct  xt_entry_match
 
struct  xt_entry_target
 
struct  xt_standard_target
 
struct  xt_error_target
 
struct  xt_get_revision
 
struct  _xt_align
 
struct  xt_counters
 
struct  xt_counters_info
 

Macros

#define XT_FUNCTION_MAXNAMELEN   30
 
#define XT_EXTENSION_MAXNAMELEN   29
 
#define XT_TABLE_MAXNAMELEN   32
 
#define XT_TARGET_INIT(__name, __size)
 
#define XT_CONTINUE   0xFFFFFFFF
 
#define XT_RETURN   (-NF_REPEAT - 1)
 
#define XT_ALIGN(s)   __ALIGN_KERNEL((s), __alignof__(struct _xt_align))
 
#define XT_STANDARD_TARGET   ""
 
#define XT_ERROR_TARGET   "ERROR"
 
#define SET_COUNTER(c, b, p)   do { (c).bcnt = (b); (c).pcnt = (p); } while(0)
 
#define ADD_COUNTER(c, b, p)   do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
 
#define XT_INV_PROTO   0x40 /* Invert the sense of PROTO. */
 
#define XT_MATCH_ITERATE(type, e, fn, args...)
 
#define XT_ENTRY_ITERATE_CONTINUE(type, entries, size, n, fn, args...)
 
#define XT_ENTRY_ITERATE(type, entries, size, fn, args...)   XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args)
 
#define xt_entry_foreach(pos, ehead, esize)
 
#define xt_ematch_foreach(pos, entry)
 

Macro Definition Documentation

#define ADD_COUNTER (   c,
  b,
  p 
)    do { (c).bcnt += (b); (c).pcnt += (p); } while(0)

Definition at line 107 of file x_tables.h.

#define SET_COUNTER (   c,
  b,
  p 
)    do { (c).bcnt = (b); (c).pcnt = (p); } while(0)

Definition at line 106 of file x_tables.h.

#define XT_ALIGN (   s)    __ALIGN_KERNEL((s), __alignof__(struct _xt_align))

Definition at line 99 of file x_tables.h.

#define XT_CONTINUE   0xFFFFFFFF

Definition at line 82 of file x_tables.h.

#define xt_ematch_foreach (   pos,
  entry 
)
Value:
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))

Definition at line 179 of file x_tables.h.

#define xt_entry_foreach (   pos,
  ehead,
  esize 
)
Value:
for ((pos) = (typeof(pos))(ehead); \
(pos) < (typeof(pos))((char *)(ehead) + (esize)); \
(pos) = (typeof(pos))((char *)(pos) + (pos)->next_offset))

Definition at line 173 of file x_tables.h.

#define XT_ENTRY_ITERATE (   type,
  entries,
  size,
  fn,
  args... 
)    XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args)

Definition at line 167 of file x_tables.h.

#define XT_ENTRY_ITERATE_CONTINUE (   type,
  entries,
  size,
  n,
  fn,
  args... 
)
Value:
({ \
unsigned int __i, __n; \
int __ret = 0; \
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; \
})

Definition at line 147 of file x_tables.h.

#define XT_ERROR_TARGET   "ERROR"

Definition at line 104 of file x_tables.h.

#define XT_EXTENSION_MAXNAMELEN   29

Definition at line 7 of file x_tables.h.

#define XT_FUNCTION_MAXNAMELEN   30

Definition at line 6 of file x_tables.h.

#define XT_INV_PROTO   0x40 /* Invert the sense of PROTO. */

Definition at line 124 of file x_tables.h.

#define XT_MATCH_ITERATE (   type,
  e,
  fn,
  args... 
)
Value:
({ \
unsigned int __i; \
int __ret = 0; \
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; \
})

Definition at line 128 of file x_tables.h.

#define XT_RETURN   (-NF_REPEAT - 1)

Definition at line 85 of file x_tables.h.

#define XT_STANDARD_TARGET   ""

Definition at line 102 of file x_tables.h.

#define XT_TABLE_MAXNAMELEN   32

Definition at line 8 of file x_tables.h.

#define XT_TARGET_INIT (   __name,
  __size 
)
Value:
{ \
.target.u.user = { \
.target_size = XT_ALIGN(__size), \
.name = __name, \
}, \
}

Definition at line 56 of file x_tables.h.