]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
includes: sync header files from Linux 2.6.35-rc1
authorJan Engelhardt <jengelh@medozas.de>
Mon, 7 Jun 2010 08:59:03 +0000 (10:59 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Mon, 7 Jun 2010 09:54:17 +0000 (11:54 +0200)
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
include/linux/kernel.h [new file with mode: 0644]
include/linux/netfilter/x_tables.h
include/linux/netfilter/xt_CONNMARK.h
include/linux/netfilter/xt_MARK.h
include/linux/netfilter/xt_TEE.h
include/linux/netfilter/xt_connmark.h
include/linux/netfilter/xt_mark.h
include/linux/netfilter/xt_recent.h
include/linux/netfilter_ipv6.h

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
new file mode 100644 (file)
index 0000000..d1671a0
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef _LINUX_KERNEL_H
+#define _LINUX_KERNEL_H
+
+/*
+ * 'kernel.h' contains some often-used function prototypes etc
+ */
+#define __ALIGN_KERNEL(x, a)           __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
+#define __ALIGN_KERNEL_MASK(x, mask)   (((x) + (mask)) & ~(mask))
+
+
+
+#define SI_LOAD_SHIFT  16
+struct sysinfo {
+       long uptime;                    /* Seconds since boot */
+       unsigned long loads[3];         /* 1, 5, and 15 minute load averages */
+       unsigned long totalram;         /* Total usable main memory size */
+       unsigned long freeram;          /* Available memory size */
+       unsigned long sharedram;        /* Amount of shared memory */
+       unsigned long bufferram;        /* Memory used by buffers */
+       unsigned long totalswap;        /* Total swap space size */
+       unsigned long freeswap;         /* swap space still available */
+       unsigned short procs;           /* Number of current processes */
+       unsigned short pad;             /* explicit padding for m68k */
+       unsigned long totalhigh;        /* Total high memory size */
+       unsigned long freehigh;         /* Available high memory size */
+       unsigned int mem_unit;          /* Memory unit size in bytes */
+       char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
+};
+
+/* Force a compilation error if condition is true */
+#define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition))
+
+/* Force a compilation error if condition is constant and true */
+#define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)]))
+
+/* Force a compilation error if a constant expression is not a power of 2 */
+#define BUILD_BUG_ON_NOT_POWER_OF_2(n)                 \
+       BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
+
+/* Force a compilation error if condition is true, but also produce a
+   result (of value 0 and type size_t), so the expression can be used
+   e.g. in a structure initializer (or where-ever else comma expressions
+   aren't permitted). */
+#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
+#define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); }))
+
+/* Trap pasters of __FUNCTION__ at compile-time */
+#define __FUNCTION__ (__func__)
+
+/* This helps us to avoid #ifdef CONFIG_NUMA */
+#ifdef CONFIG_NUMA
+#define NUMA_BUILD 1
+#else
+#define NUMA_BUILD 0
+#endif
+
+/* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */
+#ifdef CONFIG_FTRACE_MCOUNT_RECORD
+# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD
+#endif
+
+#endif
index ccb5641045a4c728013fe4ffe0c2b50ab18c48ce..fa2d9578d7d2ef4b19079464d2d2087e6a4baab5 100644 (file)
@@ -1,9 +1,10 @@
 #ifndef _X_TABLES_H
 #define _X_TABLES_H
-
+#include <linux/kernel.h>
 #include <linux/types.h>
 
 #define XT_FUNCTION_MAXNAMELEN 30
+#define XT_EXTENSION_MAXNAMELEN 29
 #define XT_TABLE_MAXNAMELEN 32
 
 struct xt_entry_match {
@@ -12,8 +13,7 @@ struct xt_entry_match {
                        __u16 match_size;
 
                        /* Used by userspace */
-                       char name[XT_FUNCTION_MAXNAMELEN-1];
-
+                       char name[XT_EXTENSION_MAXNAMELEN];
                        __u8 revision;
                } user;
                struct {
@@ -36,8 +36,7 @@ struct xt_entry_target {
                        __u16 target_size;
 
                        /* Used by userspace */
-                       char name[XT_FUNCTION_MAXNAMELEN-1];
-
+                       char name[XT_EXTENSION_MAXNAMELEN];
                        __u8 revision;
                } user;
                struct {
@@ -70,8 +69,7 @@ struct xt_standard_target {
 /* The argument to IPT_SO_GET_REVISION_*.  Returns highest revision
  * kernel supports, if >= revision. */
 struct xt_get_revision {
-       char name[XT_FUNCTION_MAXNAMELEN-1];
-
+       char name[XT_EXTENSION_MAXNAMELEN];
        __u8 revision;
 };
 
@@ -93,8 +91,7 @@ struct _xt_align {
        __u64 u64;
 };
 
-#define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1))         \
-                       & ~(__alignof__(struct _xt_align)-1))
+#define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align))
 
 /* Standard return verdict, or do jump. */
 #define XT_STANDARD_TARGET ""
@@ -165,4 +162,19 @@ struct xt_counters_info {
        XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args)
 
 
+/* pos is normally a struct ipt_entry/ip6t_entry/etc. */
+#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))
+
+/* can only be xt_entry_match, so no use of typeof here */
+#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))
+
+
 #endif /* _X_TABLES_H */
index 0a854586675245f236fc940aa3b0cdb4b00e26d0..2f2e48ec80238ad5fa0dc26f5d2f5a8355b8d8e5 100644 (file)
@@ -1,26 +1,6 @@
 #ifndef _XT_CONNMARK_H_target
 #define _XT_CONNMARK_H_target
 
-#include <linux/types.h>
-
-/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
- * by Henrik Nordstrom <hno@marasystems.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-enum {
-       XT_CONNMARK_SET = 0,
-       XT_CONNMARK_SAVE,
-       XT_CONNMARK_RESTORE
-};
-
-struct xt_connmark_tginfo1 {
-       __u32 ctmark, ctmask, nfmask;
-       __u8 mode;
-};
+#include <linux/netfilter/xt_connmark.h>
 
 #endif /*_XT_CONNMARK_H_target*/
index bc9561bdef7902a6115392679d2c623daa86c66a..41c456deba222e25ab188559fb81605cd42353d5 100644 (file)
@@ -1,10 +1,6 @@
 #ifndef _XT_MARK_H_target
 #define _XT_MARK_H_target
 
-#include <linux/types.h>
-
-struct xt_mark_tginfo2 {
-       __u32 mark, mask;
-};
+#include <linux/netfilter/xt_mark.h>
 
 #endif /*_XT_MARK_H_target */
index 55d4a5011523a0ffe903a72eabf62a2f379b9f03..5c21d5c829affe69bdd5572de6f272b2e9de3f97 100644 (file)
@@ -4,6 +4,9 @@
 struct xt_tee_tginfo {
        union nf_inet_addr gw;
        char oif[16];
+
+       /* used internally by the kernel */
+       struct xt_tee_priv *priv __attribute__((aligned(8)));
 };
 
 #endif /* _XT_TEE_TARGET_H */
index 619e47cde01a8921110f57a903d1330b1a6b6f3f..efc17a8305fb71f93741ad1579dae6f9da3075d1 100644 (file)
  * (at your option) any later version.
  */
 
+enum {
+       XT_CONNMARK_SET = 0,
+       XT_CONNMARK_SAVE,
+       XT_CONNMARK_RESTORE
+};
+
+struct xt_connmark_tginfo1 {
+       __u32 ctmark, ctmask, nfmask;
+       __u8 mode;
+};
+
 struct xt_connmark_mtinfo1 {
        __u32 mark, mask;
        __u8 invert;
index 6607c8f38ea528cbf43ac4764bcfad8d280cd1a7..ecadc40d5cdedcfc3ec4b17ecdc8273c46395316 100644 (file)
@@ -3,6 +3,10 @@
 
 #include <linux/types.h>
 
+struct xt_mark_tginfo2 {
+       __u32 mark, mask;
+};
+
 struct xt_mark_mtinfo1 {
        __u32 mark, mask;
        __u8 invert;
index d2c276609925c59a2dad78213094c1c984ff9ed5..83318e01425e74494f5c48fb25f83d015e522d01 100644 (file)
@@ -9,6 +9,7 @@ enum {
        XT_RECENT_UPDATE   = 1 << 2,
        XT_RECENT_REMOVE   = 1 << 3,
        XT_RECENT_TTL      = 1 << 4,
+       XT_RECENT_REAP     = 1 << 5,
 
        XT_RECENT_SOURCE   = 0,
        XT_RECENT_DEST     = 1,
@@ -16,6 +17,12 @@ enum {
        XT_RECENT_NAME_LEN = 200,
 };
 
+/* Only allowed with --rcheck and --update */
+#define XT_RECENT_MODIFIERS (XT_RECENT_TTL|XT_RECENT_REAP)
+
+#define XT_RECENT_VALID_FLAGS (XT_RECENT_CHECK|XT_RECENT_SET|XT_RECENT_UPDATE|\
+                              XT_RECENT_REMOVE|XT_RECENT_TTL|XT_RECENT_REAP)
+
 struct xt_recent_mtinfo {
        __u32 seconds;
        __u32 hit_count;
index 7430b392a2bec2d3004f1cb66edb5e448eddc2fb..f155b9d39574fc7299f22b8f39632edea9a0d787 100644 (file)
@@ -57,6 +57,7 @@
 enum nf_ip6_hook_priorities {
        NF_IP6_PRI_FIRST = INT_MIN,
        NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
+       NF_IP6_PRI_RAW = -300,
        NF_IP6_PRI_SELINUX_FIRST = -225,
        NF_IP6_PRI_CONNTRACK = -200,
        NF_IP6_PRI_MANGLE = -150,