Skip to contentSkip to conversation

move ipt_error and ipt_standard to iptables.h

PATCH In review Pablo Neira 2 participants 2 messages Jan 1, 2005 – Jan 2, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 move ipt_error and ipt_standard to iptables.h

Hi,

ipt_error_target, ipt_error and ipt_standard are defined in every table. Move these declarations to ip_tables.h where I think they really belongs to.

Please, let me know if there any special reason to duplicate them that way.

--
Pablo

===== include/linux/netfilter_ipv4/ip_tables.h 1.12 vs edited =====

include/linux/netfilter_ipv4/ip_tables.h +19 -0
@@ -439,6 +447,25 @@
 
 	/* Set to THIS_MODULE. */
 	struct module *me;
+};
+
+/* Standard entry. */
+struct ipt_standard
+{
+	struct ipt_entry entry;
+	struct ipt_standard_target target;
+};
+
+struct ipt_error_target
+{
+	struct ipt_entry_target target;
+	char errorname[IPT_FUNCTION_MAXNAMELEN];
+};
+
+struct ipt_error
+{
+	struct ipt_entry entry;
+	struct ipt_error_target target;
 };
 
 extern int ipt_register_table(struct ipt_table *table);

===== net/ipv4/netfilter/iptable_raw.c 1.3 vs edited =====

net/ipv4/netfilter/iptable_raw.c +0 -19
@@ -8,25 +8,6 @@
 
 #define RAW_VALID_HOOKS ((1 << NF_IP_PRE_ROUTING) | (1 << NF_IP_LOCAL_OUT))
 
-/* Standard entry. */
-struct ipt_standard
-{
-	struct ipt_entry entry;
-	struct ipt_standard_target target;
-};
-
-struct ipt_error_target
-{
-	struct ipt_entry_target target;
-	char errorname[IPT_FUNCTION_MAXNAMELEN];
-};
-
-struct ipt_error
-{
-	struct ipt_entry entry;
-	struct ipt_error_target target;
-};
-
 static struct
 {
 	struct ipt_replace repl;

===== net/ipv4/netfilter/iptable_mangle.c 1.17 vs edited =====

net/ipv4/netfilter/iptable_mangle.c +0 -19
@@ -29,25 +29,6 @@
 			    (1 << NF_IP_LOCAL_OUT) | \
 			    (1 << NF_IP_POST_ROUTING))
 
-/* Standard entry. */
-struct ipt_standard
-{
-	struct ipt_entry entry;
-	struct ipt_standard_target target;
-};
-
-struct ipt_error_target
-{
-	struct ipt_entry_target target;
-	char errorname[IPT_FUNCTION_MAXNAMELEN];
-};
-
-struct ipt_error
-{
-	struct ipt_entry entry;
-	struct ipt_error_target target;
-};
-
 /* Ouch - five different hooks? Maybe this should be a config option..... -- BC */
 static struct
 {

===== net/ipv4/netfilter/iptable_filter.c 1.13 vs edited =====

net/ipv4/netfilter/iptable_filter.c +0 -19
@@ -20,25 +20,6 @@
 
 #define FILTER_VALID_HOOKS ((1 << NF_IP_LOCAL_IN) | (1 << NF_IP_FORWARD) | (1 << NF_IP_LOCAL_OUT))
 
-/* Standard entry. */
-struct ipt_standard
-{
-	struct ipt_entry entry;
-	struct ipt_standard_target target;
-};
-
-struct ipt_error_target
-{
-	struct ipt_entry_target target;
-	char errorname[IPT_FUNCTION_MAXNAMELEN];
-};
-
-struct ipt_error
-{
-	struct ipt_entry entry;
-	struct ipt_error_target target;
-};
-
 static struct
 {
 	struct ipt_replace repl;

===== net/ipv4/netfilter/ip_nat_rule.c 1.15 vs edited =====

net/ipv4/netfilter/ip_nat_rule.c +0 -19
@@ -35,25 +35,6 @@
 
 #define NAT_VALID_HOOKS ((1<<NF_IP_PRE_ROUTING) | (1<<NF_IP_POST_ROUTING) | (1<<NF_IP_LOCAL_OUT))
 
-/* Standard entry. */
-struct ipt_standard
-{
-	struct ipt_entry entry;
-	struct ipt_standard_target target;
-};
-
-struct ipt_error_target
-{
-	struct ipt_entry_target target;
-	char errorname[IPT_FUNCTION_MAXNAMELEN];
-};
-
-struct ipt_error
-{
-	struct ipt_entry entry;
-	struct ipt_error_target target;
-};
-
 static struct
 {
 	struct ipt_replace repl;
#1 lore raw
Quoted 5 lines · Pablo Neira

Hi,

ipt_error_target, ipt_error and ipt_standard are defined in every table. Move these declarations to ip_tables.h where I think they really belongs to.

Please, let me know if there any special reason to duplicate them that way.

I can't imagine a reason, so I've applied you patch. Thanks.

Regards
Patrick