]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[NETFILTER]: futher {ip,ip6,arp}_tables unification
authorDmitry Mishin <dim@openvz.org>
Wed, 22 Mar 2006 21:56:56 +0000 (13:56 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Mar 2006 21:56:56 +0000 (13:56 -0800)
This patch moves {ip,ip6,arp}t_entry_{match,target} definitions to
x_tables.h. This move simplifies code and future compatibility fixes.

Signed-off-by: Dmitry Mishin <dim@openvz.org>
Acked-off-by: Kirill Korotaev <dev@openvz.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netfilter/x_tables.h
include/linux/netfilter_arp/arp_tables.h
include/linux/netfilter_ipv4/ip_tables.h
include/linux/netfilter_ipv6/ip6_tables.h
include/net/tc_act/tc_ipt.h

index bf71efb630075ff4ebeef529cffa32fcd66d8756..1350e47b0234d6ca79a2e2a9dc35c488b5ff0b5d 100644 (file)
@@ -4,6 +4,62 @@
 #define XT_FUNCTION_MAXNAMELEN 30
 #define XT_TABLE_MAXNAMELEN 32
 
+struct xt_entry_match
+{
+       union {
+               struct {
+                       u_int16_t match_size;
+
+                       /* Used by userspace */
+                       char name[XT_FUNCTION_MAXNAMELEN-1];
+
+                       u_int8_t revision;
+               } user;
+               struct {
+                       u_int16_t match_size;
+
+                       /* Used inside the kernel */
+                       struct xt_match *match;
+               } kernel;
+
+               /* Total length */
+               u_int16_t match_size;
+       } u;
+
+       unsigned char data[0];
+};
+
+struct xt_entry_target
+{
+       union {
+               struct {
+                       u_int16_t target_size;
+
+                       /* Used by userspace */
+                       char name[XT_FUNCTION_MAXNAMELEN-1];
+
+                       u_int8_t revision;
+               } user;
+               struct {
+                       u_int16_t target_size;
+
+                       /* Used inside the kernel */
+                       struct xt_target *target;
+               } kernel;
+
+               /* Total length */
+               u_int16_t target_size;
+       } u;
+
+       unsigned char data[0];
+};
+
+struct xt_standard_target
+{
+       struct xt_entry_target target;
+       int verdict;
+};
+
 /* The argument to IPT_SO_GET_REVISION_*.  Returns highest revision
  * kernel supports, if >= revision. */
 struct xt_get_revision
index a27be05f67f011a501b35d4a0f4a0ef073bf1335..62cc27daca4efe2a4fb1b2ac1a384c06229e2ff4 100644 (file)
@@ -65,35 +65,8 @@ struct arpt_arp {
        u_int16_t invflags;
 };
 
-struct arpt_entry_target
-{
-       union {
-               struct {
-                       u_int16_t target_size;
-
-                       /* Used by userspace */
-                       char name[ARPT_FUNCTION_MAXNAMELEN-1];
-                       u_int8_t revision;
-               } user;
-               struct {
-                       u_int16_t target_size;
-
-                       /* Used inside the kernel */
-                       struct arpt_target *target;
-               } kernel;
-
-               /* Total length */
-               u_int16_t target_size;
-       } u;
-
-       unsigned char data[0];
-};
-
-struct arpt_standard_target
-{
-       struct arpt_entry_target target;
-       int verdict;
-};
+#define arpt_entry_target xt_entry_target
+#define arpt_standard_target xt_standard_target
 
 /* Values for "flag" field in struct arpt_ip (general arp structure).
  * No flags defined yet.
index ee262b5344e11b773bf5bf315201e1eef0a5383a..d5b8c0d6a12b3dfef2f688c2294886358f9397fe 100644 (file)
@@ -52,61 +52,9 @@ struct ipt_ip {
        u_int8_t invflags;
 };
 
-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_entry_match xt_entry_match
+#define ipt_entry_target xt_entry_target
+#define ipt_standard_target xt_standard_target
 
 #define ipt_counters xt_counters
 
index 7107f942eb052ea73389290a33e3923a7747415c..d0d5d1ee4be31c64e9b64df889c68d68d73db46a 100644 (file)
@@ -56,60 +56,9 @@ struct ip6t_ip6 {
        u_int8_t invflags;
 };
 
-/* FIXME: If alignment in kernel different from userspace? --RR */
-struct ip6t_entry_match
-{
-       union {
-               struct {
-                       u_int16_t match_size;
-
-                       /* Used by userspace */
-                       char name[IP6T_FUNCTION_MAXNAMELEN-1];
-                       u_int8_t revision;
-               } user;
-               struct {
-                       u_int16_t match_size;
-
-                       /* Used inside the kernel */
-                       struct ip6t_match *match;
-               } kernel;
-
-               /* Total length */
-               u_int16_t match_size;
-       } u;
-
-       unsigned char data[0];
-};
-
-struct ip6t_entry_target
-{
-       union {
-               struct {
-                       u_int16_t target_size;
-
-                       /* Used by userspace */
-                       char name[IP6T_FUNCTION_MAXNAMELEN-1];
-                       u_int8_t revision;
-               } user;
-               struct {
-                       u_int16_t target_size;
-
-                       /* Used inside the kernel */
-                       struct ip6t_target *target;
-               } kernel;
-
-               /* Total length */
-               u_int16_t target_size;
-       } u;
-
-       unsigned char data[0];
-};
-
-struct ip6t_standard_target
-{
-       struct ip6t_entry_target target;
-       int verdict;
-};
+#define ip6t_entry_match xt_entry_match
+#define ip6t_entry_target xt_entry_target
+#define ip6t_standard_target xt_standard_target
 
 #define ip6t_counters  xt_counters
 
index 02eccebd55ae50508cb28f083df59aa068fda746..cb37ad08427faca6d51ac7975c4108fdb6822f71 100644 (file)
@@ -3,14 +3,14 @@
 
 #include <net/act_api.h>
 
-struct ipt_entry_target;
+struct xt_entry_target;
 
 struct tcf_ipt
 {
        tca_gen(ipt);
        u32 hook;
        char *tname;
-       struct ipt_entry_target *t;
+       struct xt_entry_target *t;
 };
 
 #endif