linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / include / linux / netfilter_ipv4 / ip_tables.h
index c0dac16..76ba24b 100644 (file)
@@ -52,9 +52,61 @@ struct ipt_ip {
        u_int8_t invflags;
 };
 
-#define ipt_entry_match xt_entry_match
-#define ipt_entry_target xt_entry_target
-#define ipt_standard_target xt_standard_target
+struct ipt_entry_match
+{
+       union {
+               struct {
+                       u_int16_t match_size;
+
+                       /* Used by userspace */
+                       char name[IPT_FUNCTION_MAXNAMELEN-1];
+
+                       u_int8_t revision;
+               } user;
+               struct {
+                       u_int16_t match_size;
+
+                       /* Used inside the kernel */
+                       struct ipt_match *match;
+               } kernel;
+
+               /* Total length */
+               u_int16_t match_size;
+       } u;
+
+       unsigned char data[0];
+};
+
+struct ipt_entry_target
+{
+       union {
+               struct {
+                       u_int16_t target_size;
+
+                       /* Used by userspace */
+                       char name[IPT_FUNCTION_MAXNAMELEN-1];
+
+                       u_int8_t revision;
+               } user;
+               struct {
+                       u_int16_t target_size;
+
+                       /* Used inside the kernel */
+                       struct ipt_target *target;
+               } kernel;
+
+               /* Total length */
+               u_int16_t target_size;
+       } u;
+
+       unsigned char data[0];
+};
+
+struct ipt_standard_target
+{
+       struct ipt_entry_target target;
+       int verdict;
+};
 
 #define ipt_counters xt_counters
 
@@ -269,15 +321,11 @@ ipt_get_target(struct ipt_entry *e)
 #include <linux/init.h>
 extern void ipt_init(void) __init;
 
-#define ipt_register_target(tgt)       \
-({     (tgt)->family = AF_INET;        \
-       xt_register_target(tgt); })
-#define ipt_unregister_target(tgt) xt_unregister_target(tgt)
+#define ipt_register_target(tgt) xt_register_target(AF_INET, tgt)
+#define ipt_unregister_target(tgt) xt_unregister_target(AF_INET, tgt)
 
-#define ipt_register_match(mtch)       \
-({     (mtch)->family = AF_INET;       \
-       xt_register_match(mtch); })
-#define ipt_unregister_match(mtch) xt_unregister_match(mtch)
+#define ipt_register_match(mtch) xt_register_match(AF_INET, mtch)
+#define ipt_unregister_match(mtch) xt_unregister_match(AF_INET, mtch)
 
 //#define ipt_register_table(tbl, repl) xt_register_table(AF_INET, tbl, repl)
 //#define ipt_unregister_table(tbl) xt_unregister_table(AF_INET, tbl)
@@ -316,23 +364,5 @@ extern unsigned int ipt_do_table(struct sk_buff **pskb,
                                 void *userdata);
 
 #define IPT_ALIGN(s) XT_ALIGN(s)
-
-#ifdef CONFIG_COMPAT
-#include <net/compat.h>
-
-struct compat_ipt_entry
-{
-       struct ipt_ip ip;
-       compat_uint_t nfcache;
-       u_int16_t target_offset;
-       u_int16_t next_offset;
-       compat_uint_t comefrom;
-       struct compat_xt_counters counters;
-       unsigned char elems[0];
-};
-
-#define COMPAT_IPT_ALIGN(s)    COMPAT_XT_ALIGN(s)
-
-#endif /* CONFIG_COMPAT */
 #endif /*__KERNEL__*/
 #endif /* _IPTABLES_H */