* [PATCH 01/13] Remove stray NULLs
@ 2007-10-04 10:11 Jan Engelhardt
2007-10-04 10:11 ` [PATCH 02/14] Delete empty ->init() functions Jan Engelhardt
` (12 more replies)
0 siblings, 13 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:11 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Mixing member accessors (non-named vs named) is not good.
Remove stray NULL.
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
---
extensions/libip6t_HL.c | 2 +-
extensions/libipt_MASQUERADE.c | 2 +-
extensions/libipt_realm.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
Index: iptables/extensions/libip6t_HL.c
===================================================================
--- iptables.orig/extensions/libip6t_HL.c
+++ iptables/extensions/libip6t_HL.c
@@ -146,7 +146,7 @@ static const struct option opts[] = {
};
static
-struct ip6tables_target HL = { NULL,
+struct ip6tables_target HL = {
.name = "HL",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_HL_info)),
Index: iptables/extensions/libipt_MASQUERADE.c
===================================================================
--- iptables.orig/extensions/libipt_MASQUERADE.c
+++ iptables/extensions/libipt_MASQUERADE.c
@@ -161,7 +161,7 @@ save(const void *ip, const struct xt_ent
printf("--random ");
}
-static struct iptables_target masq = { NULL,
+static struct iptables_target masq = {
.name = "MASQUERADE",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
Index: iptables/extensions/libipt_realm.c
===================================================================
--- iptables.orig/extensions/libipt_realm.c
+++ iptables/extensions/libipt_realm.c
@@ -250,7 +250,7 @@ final_check(unsigned int flags)
"realm match: You must specify `--realm'");
}
-static struct iptables_match realm = { NULL,
+static struct iptables_match realm = {
.name = "realm",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_realm_info)),
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 02/14] Delete empty ->init() functions
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
@ 2007-10-04 10:11 ` Jan Engelhardt
2007-10-04 10:11 ` [PATCH 03/14] Delete empty ->final_check() functions Jan Engelhardt
` (11 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:11 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Deletes empty ->init() functions. ip[6]tables already
checks for .init being NULL or not.
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
---
extensions/libip6t_HL.c | 5 -----
extensions/libip6t_policy.c | 5 -----
extensions/libipt_CLUSTERIP.c | 6 ------
extensions/libipt_ECN.c | 5 -----
extensions/libipt_MIRROR.c | 7 -------
extensions/libipt_TOS.c | 7 -------
extensions/libipt_TTL.c | 5 -----
extensions/libipt_policy.c | 5 -----
extensions/libxt_CLASSIFY.c | 8 --------
extensions/libxt_CONNMARK.c | 8 --------
extensions/libxt_DSCP.c | 7 -------
extensions/libxt_MARK.c | 9 ---------
extensions/libxt_NFQUEUE.c | 6 ------
extensions/libxt_NOTRACK.c | 8 --------
extensions/libxt_SECMARK.c | 6 ------
extensions/libxt_TCPMSS.c | 8 --------
extensions/libxt_TRACE.c | 8 --------
extensions/libxt_multiport.c | 10 ----------
extensions/libxt_physdev.c | 7 -------
extensions/libxt_standard.c | 8 --------
20 files changed, 138 deletions(-)
Index: iptables/extensions/libip6t_HL.c
===================================================================
--- iptables.orig/extensions/libip6t_HL.c
+++ iptables/extensions/libip6t_HL.c
@@ -16,10 +16,6 @@
#define IP6T_HL_USED 1
-static void init(struct xt_entry_target *t)
-{
-}
-
static void help(void)
{
printf(
@@ -152,7 +148,6 @@ struct ip6tables_target HL = {
.size = IP6T_ALIGN(sizeof(struct ip6t_HL_info)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_HL_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
Index: iptables/extensions/libip6t_policy.c
===================================================================
--- iptables.orig/extensions/libip6t_policy.c
+++ iptables/extensions/libip6t_policy.c
@@ -133,10 +133,6 @@ extern void parse_hostnetworkmask(const
/* End duplicated code from ip6tables.c */
-static void init(struct xt_entry_match *m)
-{
-}
-
static int parse_direction(char *s)
{
if (strcmp(s, "in") == 0)
@@ -462,7 +458,6 @@ struct ip6tables_match policy = {
.size = IP6T_ALIGN(sizeof(struct ip6t_policy_info)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_policy_info)),
.help = help,
- .init = init,
.parse = parse,
.final_check = final_check,
.print = print,
Index: iptables/extensions/libipt_CLUSTERIP.c
===================================================================
--- iptables.orig/extensions/libipt_CLUSTERIP.c
+++ iptables/extensions/libipt_CLUSTERIP.c
@@ -55,11 +55,6 @@ static const struct option opts[] = {
};
static void
-init(struct xt_entry_target *t)
-{
-}
-
-static void
parse_mac(const char *mac, char *macbuf)
{
unsigned int i = 0;
@@ -253,7 +248,6 @@ static struct iptables_target clusterip
.size = IPT_ALIGN(sizeof(struct ipt_clusterip_tgt_info)),
.userspacesize = offsetof(struct ipt_clusterip_tgt_info, config),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
Index: iptables/extensions/libipt_ECN.c
===================================================================
--- iptables.orig/extensions/libipt_ECN.c
+++ iptables/extensions/libipt_ECN.c
@@ -17,10 +17,6 @@
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv4/ipt_ECN.h>
-static void init(struct xt_entry_target *t)
-{
-}
-
static void help(void)
{
printf(
@@ -170,7 +166,6 @@ struct iptables_target ecn = {
.size = IPT_ALIGN(sizeof(struct ipt_ECN_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_ECN_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
Index: iptables/extensions/libipt_MIRROR.c
===================================================================
--- iptables.orig/extensions/libipt_MIRROR.c
+++ iptables/extensions/libipt_MIRROR.c
@@ -16,12 +16,6 @@ help(void)
IPTABLES_VERSION);
}
-/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
-{
-}
-
/* Function which parses command options; returns true if it
ate an option */
static int
@@ -43,7 +37,6 @@ static struct iptables_target mirror = {
.size = IPT_ALIGN(0),
.userspacesize = IPT_ALIGN(0),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = NULL,
Index: iptables/extensions/libipt_TOS.c
===================================================================
--- iptables.orig/extensions/libipt_TOS.c
+++ iptables/extensions/libipt_TOS.c
@@ -52,12 +52,6 @@ static const struct option opts[] = {
{ }
};
-/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
-{
-}
-
static void
parse_tos(const char *s, struct ipt_tos_target_info *info)
{
@@ -159,7 +153,6 @@ static struct iptables_target tos = {
.size = IPT_ALIGN(sizeof(struct ipt_tos_target_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_tos_target_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
Index: iptables/extensions/libipt_TTL.c
===================================================================
--- iptables.orig/extensions/libipt_TTL.c
+++ iptables/extensions/libipt_TTL.c
@@ -16,10 +16,6 @@
#define IPT_TTL_USED 1
-static void init(struct xt_entry_target *t)
-{
-}
-
static void help(void)
{
printf(
@@ -152,7 +148,6 @@ static struct iptables_target TTL = {
.size = IPT_ALIGN(sizeof(struct ipt_TTL_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_TTL_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
Index: iptables/extensions/libipt_policy.c
===================================================================
--- iptables.orig/extensions/libipt_policy.c
+++ iptables/extensions/libipt_policy.c
@@ -93,10 +93,6 @@ static const struct option opts[] =
{ }
};
-static void init(struct xt_entry_match *m)
-{
-}
-
static int parse_direction(char *s)
{
if (strcmp(s, "in") == 0)
@@ -420,7 +416,6 @@ struct iptables_match policy = {
.size = IPT_ALIGN(sizeof(struct ipt_policy_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_policy_info)),
.help = help,
- .init = init,
.parse = parse,
.final_check = final_check,
.print = print,
Index: iptables/extensions/libxt_CLASSIFY.c
===================================================================
--- iptables.orig/extensions/libxt_CLASSIFY.c
+++ iptables/extensions/libxt_CLASSIFY.c
@@ -26,12 +26,6 @@ static const struct option opts[] = {
{ }
};
-/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
-{
-}
-
int string_to_priority(const char *s, unsigned int *p)
{
unsigned int i, j;
@@ -115,7 +109,6 @@ static struct xtables_target classify =
.size = XT_ALIGN(sizeof(struct xt_classify_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_classify_target_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
@@ -130,7 +123,6 @@ static struct xtables_target classify6 =
.size = XT_ALIGN(sizeof(struct xt_classify_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_classify_target_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
Index: iptables/extensions/libxt_CONNMARK.c
===================================================================
--- iptables.orig/extensions/libxt_CONNMARK.c
+++ iptables/extensions/libxt_CONNMARK.c
@@ -56,12 +56,6 @@ static const struct option opts[] = {
{ }
};
-/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
-{
-}
-
/* Function which parses command options; returns true if it
ate an option */
static int
@@ -207,7 +201,6 @@ static struct xtables_target connmark_ta
.size = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
@@ -222,7 +215,6 @@ static struct xtables_target connmark_ta
.size = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
Index: iptables/extensions/libxt_DSCP.c
===================================================================
--- iptables.orig/extensions/libxt_DSCP.c
+++ iptables/extensions/libxt_DSCP.c
@@ -21,11 +21,6 @@
/* This is evil, but it's my code - HW*/
#include "libipt_dscp_helper.c"
-
-static void init(struct xt_entry_target *t)
-{
-}
-
static void help(void)
{
printf(
@@ -150,7 +145,6 @@ static struct xtables_target dscp = {
.size = XT_ALIGN(sizeof(struct xt_DSCP_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_DSCP_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
@@ -165,7 +159,6 @@ static struct xtables_target dscp6 = {
.size = XT_ALIGN(sizeof(struct xt_DSCP_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_DSCP_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
Index: iptables/extensions/libxt_MARK.c
===================================================================
--- iptables.orig/extensions/libxt_MARK.c
+++ iptables/extensions/libxt_MARK.c
@@ -28,12 +28,6 @@ static const struct option opts[] = {
{ }
};
-/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
-{
-}
-
/* Function which parses command options; returns true if it
ate an option */
static int
@@ -192,7 +186,6 @@ static struct xtables_target mark_v0 = {
.size = XT_ALIGN(sizeof(struct xt_mark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mark_target_info)),
.help = &help,
- .init = &init,
.parse = &parse_v0,
.final_check = &final_check,
.print = &print_v0,
@@ -208,7 +201,6 @@ static struct xtables_target mark_v1 = {
.size = XT_ALIGN(sizeof(struct xt_mark_target_info_v1)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mark_target_info_v1)),
.help = &help,
- .init = &init,
.parse = &parse_v1,
.final_check = &final_check,
.print = &print_v1,
@@ -224,7 +216,6 @@ static struct xtables_target mark6_v0 =
.size = XT_ALIGN(sizeof(struct xt_mark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mark_target_info)),
.help = &help,
- .init = &init,
.parse = &parse_v0,
.final_check = &final_check,
.print = &print_v0,
Index: iptables/extensions/libxt_NFQUEUE.c
===================================================================
--- iptables.orig/extensions/libxt_NFQUEUE.c
+++ iptables/extensions/libxt_NFQUEUE.c
@@ -14,10 +14,6 @@
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/xt_NFQUEUE.h>
-static void init(struct xt_entry_target *t)
-{
-}
-
static void help(void)
{
printf(
@@ -100,7 +96,6 @@ static struct xtables_target nfqueue = {
.size = XT_ALIGN(sizeof(struct xt_NFQ_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_NFQ_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
@@ -115,7 +110,6 @@ static struct xtables_target nfqueue6 =
.size = XT_ALIGN(sizeof(struct xt_NFQ_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_NFQ_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
Index: iptables/extensions/libxt_NOTRACK.c
===================================================================
--- iptables.orig/extensions/libxt_NOTRACK.c
+++ iptables/extensions/libxt_NOTRACK.c
@@ -16,12 +16,6 @@ help(void)
IPTABLES_VERSION);
}
-/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
-{
-}
-
/* Function which parses command options; returns true if it
ate an option */
static int
@@ -46,7 +40,6 @@ struct xtables_target notrack =
.size = XT_ALIGN(0),
.userspacesize = XT_ALIGN(0),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
};
@@ -60,7 +53,6 @@ struct xtables_target notrack6 =
.size = XT_ALIGN(0),
.userspacesize = XT_ALIGN(0),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
};
Index: iptables/extensions/libxt_SECMARK.c
===================================================================
--- iptables.orig/extensions/libxt_SECMARK.c
+++ iptables/extensions/libxt_SECMARK.c
@@ -28,10 +28,6 @@ static const struct option opts[] = {
{ 0 }
};
-/* Initialize the target. */
-static void init(struct xt_entry_target *t)
-{ }
-
/*
* Function which parses command options; returns true if it
* ate an option.
@@ -111,7 +107,6 @@ static struct xtables_target secmark = {
.size = XT_ALIGN(sizeof(struct xt_secmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_secmark_target_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
@@ -127,7 +122,6 @@ static struct xtables_target secmark6 =
.size = XT_ALIGN(sizeof(struct xt_secmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_secmark_target_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
Index: iptables/extensions/libxt_TCPMSS.c
===================================================================
--- iptables.orig/extensions/libxt_TCPMSS.c
+++ iptables/extensions/libxt_TCPMSS.c
@@ -42,12 +42,6 @@ static const struct option opts[] = {
{ }
};
-/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
-{
-}
-
/* Function which parses command options; returns true if it
ate an option */
static int
@@ -146,7 +140,6 @@ static struct xtables_target mss = {
.size = XT_ALIGN(sizeof(struct xt_tcpmss_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_tcpmss_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
@@ -161,7 +154,6 @@ static struct xtables_target mss6 = {
.size = XT_ALIGN(sizeof(struct xt_tcpmss_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_tcpmss_info)),
.help = &help6,
- .init = &init,
.parse = &parse6,
.final_check = &final_check,
.print = &print,
Index: iptables/extensions/libxt_TRACE.c
===================================================================
--- iptables.orig/extensions/libxt_TRACE.c
+++ iptables/extensions/libxt_TRACE.c
@@ -16,12 +16,6 @@ help(void)
IPTABLES_VERSION);
}
-/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
-{
-}
-
/* Function which parses command options; returns true if it
ate an option */
static int
@@ -44,7 +38,6 @@ static struct xtables_target trace = {
.size = XT_ALIGN(0),
.userspacesize = XT_ALIGN(0),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = NULL, /* print */
@@ -58,7 +51,6 @@ static struct xtables_target trace6 = {
.size = XT_ALIGN(0),
.userspacesize = XT_ALIGN(0),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = NULL, /* print */
Index: iptables/extensions/libxt_multiport.c
===================================================================
--- iptables.orig/extensions/libxt_multiport.c
+++ iptables/extensions/libxt_multiport.c
@@ -133,12 +133,6 @@ parse_multi_ports_v1(const char *portstr
free(buffer);
}
-/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
-{
-}
-
static const char *
check_proto(u_int16_t pnum, u_int8_t invflags)
{
@@ -523,7 +517,6 @@ static struct xtables_match multiport =
.size = XT_ALIGN(sizeof(struct xt_multiport)),
.userspacesize = XT_ALIGN(sizeof(struct xt_multiport)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
@@ -539,7 +532,6 @@ static struct xtables_match multiport6 =
.size = XT_ALIGN(sizeof(struct xt_multiport)),
.userspacesize = XT_ALIGN(sizeof(struct xt_multiport)),
.help = &help,
- .init = &init,
.parse = &parse6,
.final_check = &final_check,
.print = &print6,
@@ -555,7 +547,6 @@ static struct xtables_match multiport_v1
.size = XT_ALIGN(sizeof(struct xt_multiport_v1)),
.userspacesize = XT_ALIGN(sizeof(struct xt_multiport_v1)),
.help = &help_v1,
- .init = &init,
.parse = &parse_v1,
.final_check = &final_check,
.print = &print_v1,
@@ -571,7 +562,6 @@ static struct xtables_match multiport6_v
.size = XT_ALIGN(sizeof(struct xt_multiport_v1)),
.userspacesize = XT_ALIGN(sizeof(struct xt_multiport_v1)),
.help = &help_v1,
- .init = &init,
.parse = &parse6_v1,
.final_check = &final_check,
.print = &print6_v1,
Index: iptables/extensions/libxt_physdev.c
===================================================================
--- iptables.orig/extensions/libxt_physdev.c
+++ iptables/extensions/libxt_physdev.c
@@ -34,11 +34,6 @@ static const struct option opts[] = {
{ }
};
-static void
-init(struct xt_entry_match *m)
-{
-}
-
static int
parse(int c, char **argv, int invert, unsigned int *flags,
const void *entry,
@@ -178,7 +173,6 @@ static struct xtables_match physdev = {
.size = XT_ALIGN(sizeof(struct xt_physdev_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_physdev_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
@@ -193,7 +187,6 @@ static struct xtables_match physdev6 = {
.size = XT_ALIGN(sizeof(struct xt_physdev_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_physdev_info)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = &print,
Index: iptables/extensions/libxt_standard.c
===================================================================
--- iptables.orig/extensions/libxt_standard.c
+++ iptables/extensions/libxt_standard.c
@@ -16,12 +16,6 @@ help(void)
"(If target is DROP, ACCEPT, RETURN or nothing)\n", IPTABLES_VERSION);
}
-/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
-{
-}
-
/* Function which parses command options; returns true if it
ate an option */
static int
@@ -51,7 +45,6 @@ struct xtables_target standard = {
.size = XT_ALIGN(sizeof(int)),
.userspacesize = XT_ALIGN(sizeof(int)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = NULL,
@@ -66,7 +59,6 @@ struct xtables_target standard6 = {
.size = XT_ALIGN(sizeof(int)),
.userspacesize = XT_ALIGN(sizeof(int)),
.help = &help,
- .init = &init,
.parse = &parse,
.final_check = &final_check,
.print = NULL,
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 03/14] Delete empty ->final_check() functions
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
2007-10-04 10:11 ` [PATCH 02/14] Delete empty ->init() functions Jan Engelhardt
@ 2007-10-04 10:11 ` Jan Engelhardt
2007-10-04 10:11 ` [PATCH 04/14] Delete empty ->print() and ->save() functions Jan Engelhardt
` (10 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:11 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Deletes empty ->final_check() functions, and makes ip[6]tables
checks for NULL on these.
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
---
extensions/libip6t_LOG.c | 6 ------
extensions/libip6t_REJECT.c | 6 ------
extensions/libip6t_ah.c | 7 -------
extensions/libip6t_dst.c | 7 -------
extensions/libip6t_eui64.c | 6 ------
extensions/libip6t_frag.c | 7 -------
extensions/libip6t_hbh.c | 7 -------
extensions/libip6t_mh.c | 6 ------
extensions/libip6t_rt.c | 7 -------
extensions/libipt_LOG.c | 6 ------
extensions/libipt_MASQUERADE.c | 6 ------
extensions/libipt_MIRROR.c | 6 ------
extensions/libipt_REDIRECT.c | 6 ------
extensions/libipt_REJECT.c | 6 ------
extensions/libipt_ULOG.c | 6 ------
extensions/libipt_ah.c | 7 -------
extensions/libipt_icmp.c | 6 ------
extensions/libipt_unclean.c | 6 ------
extensions/libxt_NFLOG.c | 7 -------
extensions/libxt_NFQUEUE.c | 7 -------
extensions/libxt_NOTRACK.c | 7 -------
extensions/libxt_TRACE.c | 7 -------
extensions/libxt_dccp.c | 7 -------
extensions/libxt_esp.c | 8 --------
extensions/libxt_limit.c | 7 -------
extensions/libxt_quota.c | 8 --------
extensions/libxt_sctp.c | 7 -------
extensions/libxt_standard.c | 7 -------
extensions/libxt_tcp.c | 8 --------
extensions/libxt_time.c | 6 ------
extensions/libxt_u32.c | 6 ------
extensions/libxt_udp.c | 8 --------
ip6tables.c | 5 +++--
iptables.c | 5 +++--
34 files changed, 6 insertions(+), 218 deletions(-)
Index: iptables/extensions/libip6t_LOG.c
===================================================================
--- iptables.orig/extensions/libip6t_LOG.c
+++ iptables/extensions/libip6t_LOG.c
@@ -199,11 +199,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-/* Final check; nothing. */
-static void final_check(unsigned int flags)
-{
-}
-
/* Prints out the targinfo. */
static void
print(const void *ip,
@@ -278,7 +273,6 @@ struct ip6tables_target log
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libip6t_REJECT.c
===================================================================
--- iptables.orig/extensions/libip6t_REJECT.c
+++ iptables/extensions/libip6t_REJECT.c
@@ -113,11 +113,6 @@ parse(int c, char **argv, int invert, un
return 0;
}
-/* Final check; nothing. */
-static void final_check(unsigned int flags)
-{
-}
-
/* Prints out ipt_reject_info. */
static void
print(const void *ip,
@@ -158,7 +153,6 @@ struct ip6tables_target reject = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts,
Index: iptables/extensions/libip6t_ah.c
===================================================================
--- iptables.orig/extensions/libip6t_ah.c
+++ iptables/extensions/libip6t_ah.c
@@ -125,12 +125,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-/* Final check; we don't care. */
-static void
-final_check(unsigned int flags)
-{
-}
-
static void
print_spis(const char *name, u_int32_t min, u_int32_t max,
int invert)
@@ -213,7 +207,6 @@ struct ip6tables_match ah = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libip6t_dst.c
===================================================================
--- iptables.orig/extensions/libip6t_dst.c
+++ iptables/extensions/libip6t_dst.c
@@ -179,12 +179,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-/* Final check; we don't care. */
-static void
-final_check(unsigned int flags)
-{
-}
-
static void
print_options(int optsnr, u_int16_t *optsp)
{
@@ -255,7 +249,6 @@ struct ip6tables_match optstruct = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libip6t_eui64.c
===================================================================
--- iptables.orig/extensions/libip6t_eui64.c
+++ iptables/extensions/libip6t_eui64.c
@@ -32,11 +32,6 @@ parse(int c, char **argv, int invert, un
return 0;
}
-/* Final check */
-static void final_check(unsigned int flags)
-{
-}
-
/* Prints out the matchinfo. */
static void
print(const void *ip,
@@ -59,7 +54,6 @@ static struct ip6tables_match eui64 = {
.userspacesize = IP6T_ALIGN(sizeof(int)),
.help = &help,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
};
Index: iptables/extensions/libip6t_frag.c
===================================================================
--- iptables.orig/extensions/libip6t_frag.c
+++ iptables/extensions/libip6t_frag.c
@@ -156,12 +156,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-/* Final check; we don't care. */
-static void
-final_check(unsigned int flags)
-{
-}
-
static void
print_ids(const char *name, u_int32_t min, u_int32_t max,
int invert)
@@ -258,7 +252,6 @@ struct ip6tables_match frag = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libip6t_hbh.c
===================================================================
--- iptables.orig/extensions/libip6t_hbh.c
+++ iptables/extensions/libip6t_hbh.c
@@ -177,12 +177,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-/* Final check; we don't care. */
-static void
-final_check(unsigned int flags)
-{
-}
-
static void
print_options(int optsnr, u_int16_t *optsp)
{
@@ -248,7 +242,6 @@ static struct ip6tables_match optstruct
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts,
Index: iptables/extensions/libip6t_mh.c
===================================================================
--- iptables.orig/extensions/libip6t_mh.c
+++ iptables/extensions/libip6t_mh.c
@@ -150,11 +150,6 @@ static int parse(int c, char **argv, int
return 1;
}
-/* Final check; we don't care. */
-static void final_check(unsigned int flags)
-{
-}
-
static const char *type_to_name(u_int8_t type)
{
unsigned int i;
@@ -238,7 +233,6 @@ static struct ip6tables_match mh = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts,
Index: iptables/extensions/libip6t_rt.c
===================================================================
--- iptables.orig/extensions/libip6t_rt.c
+++ iptables/extensions/libip6t_rt.c
@@ -237,12 +237,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-/* Final check; we don't care. */
-static void
-final_check(unsigned int flags)
-{
-}
-
static void
print_nums(const char *name, u_int32_t min, u_int32_t max,
int invert)
@@ -348,7 +342,6 @@ static struct ip6tables_match rt = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts,
Index: iptables/extensions/libipt_LOG.c
===================================================================
--- iptables.orig/extensions/libipt_LOG.c
+++ iptables/extensions/libipt_LOG.c
@@ -199,11 +199,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-/* Final check; nothing. */
-static void final_check(unsigned int flags)
-{
-}
-
/* Prints out the targinfo. */
static void
print(const void *ip,
@@ -278,7 +273,6 @@ struct iptables_target log
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libipt_MASQUERADE.c
===================================================================
--- iptables.orig/extensions/libipt_MASQUERADE.c
+++ iptables/extensions/libipt_MASQUERADE.c
@@ -115,11 +115,6 @@ parse(int c, char **argv, int invert, un
}
}
-/* Final check; don't care. */
-static void final_check(unsigned int flags)
-{
-}
-
/* Prints out the targinfo. */
static void
print(const void *ip,
@@ -169,7 +164,6 @@ static struct iptables_target masq = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libipt_MIRROR.c
===================================================================
--- iptables.orig/extensions/libipt_MIRROR.c
+++ iptables/extensions/libipt_MIRROR.c
@@ -26,11 +26,6 @@ parse(int c, char **argv, int invert, un
return 0;
}
-static void
-final_check(unsigned int flags)
-{
-}
-
static struct iptables_target mirror = {
.name = "MIRROR",
.version = IPTABLES_VERSION,
@@ -38,7 +33,6 @@ static struct iptables_target mirror = {
.userspacesize = IPT_ALIGN(0),
.help = &help,
.parse = &parse,
- .final_check = &final_check,
.print = NULL,
.save = NULL,
};
Index: iptables/extensions/libipt_REDIRECT.c
===================================================================
--- iptables.orig/extensions/libipt_REDIRECT.c
+++ iptables/extensions/libipt_REDIRECT.c
@@ -124,11 +124,6 @@ parse(int c, char **argv, int invert, un
}
}
-/* Final check; don't care. */
-static void final_check(unsigned int flags)
-{
-}
-
/* Prints out the targinfo. */
static void
print(const void *ip,
@@ -177,7 +172,6 @@ static struct iptables_target redir = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libipt_REJECT.c
===================================================================
--- iptables.orig/extensions/libipt_REJECT.c
+++ iptables/extensions/libipt_REJECT.c
@@ -132,11 +132,6 @@ parse(int c, char **argv, int invert, un
return 0;
}
-/* Final check; nothing. */
-static void final_check(unsigned int flags)
-{
-}
-
/* Prints out ipt_reject_info. */
static void
print(const void *ip,
@@ -176,7 +171,6 @@ static struct iptables_target reject = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libipt_ULOG.c
===================================================================
--- iptables.orig/extensions/libipt_ULOG.c
+++ iptables/extensions/libipt_ULOG.c
@@ -150,11 +150,6 @@ static int parse(int c, char **argv, int
return 1;
}
-/* Final check; nothing. */
-static void final_check(unsigned int flags)
-{
-}
-
/* Saves the union ipt_targinfo in parsable form to stdout. */
static void save(const void *ip,
const struct xt_entry_target *target)
@@ -200,7 +195,6 @@ static struct iptables_target ulog = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libipt_ah.c
===================================================================
--- iptables.orig/extensions/libipt_ah.c
+++ iptables/extensions/libipt_ah.c
@@ -104,12 +104,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-/* Final check; we don't care. */
-static void
-final_check(unsigned int flags)
-{
-}
-
static void
print_spis(const char *name, u_int32_t min, u_int32_t max,
int invert)
@@ -175,7 +169,6 @@ static struct iptables_match ah = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libipt_icmp.c
===================================================================
--- iptables.orig/extensions/libipt_icmp.c
+++ iptables/extensions/libipt_icmp.c
@@ -280,11 +280,6 @@ static void save(const void *ip, const s
}
}
-/* Final check; we don't care. We can pass 0xFF to match any type */
-static void final_check(unsigned int flags)
-{
-}
-
static struct iptables_match icmp = {
.name = "icmp",
.version = IPTABLES_VERSION,
@@ -293,7 +288,6 @@ static struct iptables_match icmp = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libipt_unclean.c
===================================================================
--- iptables.orig/extensions/libipt_unclean.c
+++ iptables/extensions/libipt_unclean.c
@@ -23,11 +23,6 @@ parse(int c, char **argv, int invert, un
return 0;
}
-/* Final check; must have specified --mac. */
-static void final_check(unsigned int flags)
-{
-}
-
static
struct iptables_match unclean = {
.name = "unclean",
@@ -36,7 +31,6 @@ struct iptables_match unclean = {
.userspacesize = IPT_ALIGN(0),
.help = &help,
.parse = &parse,
- .final_check = &final_check,
.print = NULL,
.save = NULL,
};
Index: iptables/extensions/libxt_NFLOG.c
===================================================================
--- iptables.orig/extensions/libxt_NFLOG.c
+++ iptables/extensions/libxt_NFLOG.c
@@ -110,11 +110,6 @@ static int parse(int c, char **argv, int
return 1;
}
-static void final_check(unsigned int flags)
-{
- return;
-}
-
static void nflog_print(const struct xt_nflog_info *info, char *prefix)
{
if (info->prefix[0] != '\0')
@@ -151,7 +146,6 @@ static struct xtables_target nflog = {
.help = help,
.init = init,
.parse = parse,
- .final_check = final_check,
.print = print,
.save = save,
.extra_opts = opts,
@@ -166,7 +160,6 @@ static struct xtables_target nflog6 = {
.help = help,
.init = init,
.parse = parse,
- .final_check = final_check,
.print = print,
.save = save,
.extra_opts = opts,
Index: iptables/extensions/libxt_NFQUEUE.c
===================================================================
--- iptables.orig/extensions/libxt_NFQUEUE.c
+++ iptables/extensions/libxt_NFQUEUE.c
@@ -63,11 +63,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-static void
-final_check(unsigned int flags)
-{
-}
-
/* Prints out the targinfo. */
static void
print(const void *ip,
@@ -97,7 +92,6 @@ static struct xtables_target nfqueue = {
.userspacesize = XT_ALIGN(sizeof(struct xt_NFQ_info)),
.help = &help,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
@@ -111,7 +105,6 @@ static struct xtables_target nfqueue6 =
.userspacesize = XT_ALIGN(sizeof(struct xt_NFQ_info)),
.help = &help,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libxt_NOTRACK.c
===================================================================
--- iptables.orig/extensions/libxt_NOTRACK.c
+++ iptables/extensions/libxt_NOTRACK.c
@@ -26,11 +26,6 @@ parse(int c, char **argv, int invert, un
return 0;
}
-static void
-final_check(unsigned int flags)
-{
-}
-
static
struct xtables_target notrack =
{
@@ -41,7 +36,6 @@ struct xtables_target notrack =
.userspacesize = XT_ALIGN(0),
.help = &help,
.parse = &parse,
- .final_check = &final_check,
};
static
@@ -54,7 +48,6 @@ struct xtables_target notrack6 =
.userspacesize = XT_ALIGN(0),
.help = &help,
.parse = &parse,
- .final_check = &final_check,
};
void _init(void)
Index: iptables/extensions/libxt_TRACE.c
===================================================================
--- iptables.orig/extensions/libxt_TRACE.c
+++ iptables/extensions/libxt_TRACE.c
@@ -26,11 +26,6 @@ parse(int c, char **argv, int invert, un
return 0;
}
-static void
-final_check(unsigned int flags)
-{
-}
-
static struct xtables_target trace = {
.family = AF_INET,
.name = "TRACE",
@@ -39,7 +34,6 @@ static struct xtables_target trace = {
.userspacesize = XT_ALIGN(0),
.help = &help,
.parse = &parse,
- .final_check = &final_check,
.print = NULL, /* print */
.save = NULL, /* save */
};
@@ -52,7 +46,6 @@ static struct xtables_target trace6 = {
.userspacesize = XT_ALIGN(0),
.help = &help,
.parse = &parse,
- .final_check = &final_check,
.print = NULL, /* print */
.save = NULL, /* save */
};
Index: iptables/extensions/libxt_dccp.c
===================================================================
--- iptables.orig/extensions/libxt_dccp.c
+++ iptables/extensions/libxt_dccp.c
@@ -193,11 +193,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-static void
-final_check(unsigned int flags)
-{
-}
-
static char *
port_to_service(int port)
{
@@ -360,7 +355,6 @@ static struct xtables_match dccp =
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
@@ -376,7 +370,6 @@ static struct xtables_match dccp6 =
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libxt_esp.c
===================================================================
--- iptables.orig/extensions/libxt_esp.c
+++ iptables/extensions/libxt_esp.c
@@ -107,12 +107,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-/* Final check; we don't care. */
-static void
-final_check(unsigned int flags)
-{
-}
-
static void
print_spis(const char *name, u_int32_t min, u_int32_t max,
int invert)
@@ -172,7 +166,6 @@ static struct xtables_match esp = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
@@ -187,7 +180,6 @@ static struct xtables_match esp6 = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libxt_limit.c
===================================================================
--- iptables.orig/extensions/libxt_limit.c
+++ iptables/extensions/libxt_limit.c
@@ -126,11 +126,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-/* Final check; nothing. */
-static void final_check(unsigned int flags)
-{
-}
-
static struct rates
{
const char *name;
@@ -183,7 +178,6 @@ static struct xtables_match limit = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
@@ -198,7 +192,6 @@ static struct xtables_match limit6 = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libxt_quota.c
===================================================================
--- iptables.orig/extensions/libxt_quota.c
+++ iptables/extensions/libxt_quota.c
@@ -79,12 +79,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-/* no final check */
-static void
-final_check(unsigned int flags)
-{
-}
-
struct xtables_match quota = {
.family = AF_INET,
.name = "quota",
@@ -93,7 +87,6 @@ struct xtables_match quota = {
.userspacesize = offsetof(struct xt_quota_info, quota),
.help = &help,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
@@ -107,7 +100,6 @@ struct xtables_match quota6 = {
.userspacesize = offsetof(struct xt_quota_info, quota),
.help = &help,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libxt_sctp.c
===================================================================
--- iptables.orig/extensions/libxt_sctp.c
+++ iptables/extensions/libxt_sctp.c
@@ -317,11 +317,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-static void
-final_check(unsigned int flags)
-{
-}
-
static char *
port_to_service(int port)
{
@@ -534,7 +529,6 @@ static struct xtables_match sctp = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
@@ -549,7 +543,6 @@ static struct xtables_match sctp6 = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/extensions/libxt_standard.c
===================================================================
--- iptables.orig/extensions/libxt_standard.c
+++ iptables/extensions/libxt_standard.c
@@ -26,11 +26,6 @@ parse(int c, char **argv, int invert, un
return 0;
}
-/* Final check; don't care. */
-static void final_check(unsigned int flags)
-{
-}
-
/* Saves the targinfo in parsable form to stdout. */
static void
save(const void *ip, const struct xt_entry_target *target)
@@ -46,7 +41,6 @@ struct xtables_target standard = {
.userspacesize = XT_ALIGN(sizeof(int)),
.help = &help,
.parse = &parse,
- .final_check = &final_check,
.print = NULL,
.save = &save,
};
@@ -60,7 +54,6 @@ struct xtables_target standard6 = {
.userspacesize = XT_ALIGN(sizeof(int)),
.help = &help,
.parse = &parse,
- .final_check = &final_check,
.print = NULL,
.save = &save,
};
Index: iptables/extensions/libxt_tcp.c
===================================================================
--- iptables.orig/extensions/libxt_tcp.c
+++ iptables/extensions/libxt_tcp.c
@@ -220,12 +220,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-/* Final check; we don't care. */
-static void
-final_check(unsigned int flags)
-{
-}
-
static char *
port_to_service(int port)
{
@@ -402,7 +396,6 @@ static struct xtables_match tcp = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts,
@@ -417,7 +410,6 @@ static struct xtables_match tcp6 = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts,
Index: iptables/extensions/libxt_time.c
===================================================================
--- iptables.orig/extensions/libxt_time.c
+++ iptables/extensions/libxt_time.c
@@ -326,10 +326,6 @@ static int time_parse(int c, char **argv
return 0;
}
-static void time_check(unsigned int flags)
-{
-}
-
static void time_print_date(time_t date, const char *command)
{
struct tm *t;
@@ -476,7 +472,6 @@ static struct xtables_match time_reg = {
.help = time_help,
.init = time_init,
.parse = time_parse,
- .final_check = time_check,
.print = time_print,
.save = time_save,
.extra_opts = time_opts,
@@ -491,7 +486,6 @@ static struct xtables_match time6_reg =
.help = time_help,
.init = time_init,
.parse = time_parse,
- .final_check = time_check,
.print = time_print,
.save = time_save,
.extra_opts = time_opts,
Index: iptables/extensions/libxt_u32.c
===================================================================
--- iptables.orig/extensions/libxt_u32.c
+++ iptables/extensions/libxt_u32.c
@@ -247,10 +247,6 @@ static int u32_parse(int c, char **argv,
}
}
-static void u32_check(unsigned int flags)
-{
-}
-
static void u32_print(const void *ip, const struct xt_entry_match *match,
int numeric)
{
@@ -280,7 +276,6 @@ static struct xtables_match u32_reg = {
.userspacesize = XT_ALIGN(sizeof(struct xt_u32)),
.help = u32_help,
.parse = u32_parse,
- .final_check = u32_check,
.print = u32_print,
.save = u32_save,
.extra_opts = u32_opts,
@@ -294,7 +289,6 @@ static struct xtables_match u32_reg6 = {
.userspacesize = XT_ALIGN(sizeof(struct xt_u32)),
.help = u32_help,
.parse = u32_parse,
- .final_check = u32_check,
.print = u32_print,
.save = u32_save,
.extra_opts = u32_opts,
Index: iptables/extensions/libxt_udp.c
===================================================================
--- iptables.orig/extensions/libxt_udp.c
+++ iptables/extensions/libxt_udp.c
@@ -104,12 +104,6 @@ parse(int c, char **argv, int invert, un
return 1;
}
-/* Final check; we don't care. */
-static void
-final_check(unsigned int flags)
-{
-}
-
static char *
port_to_service(int port)
{
@@ -216,7 +210,6 @@ struct xtables_match udp = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
@@ -232,7 +225,6 @@ struct xtables_match udp6 = {
.help = &help,
.init = &init,
.parse = &parse,
- .final_check = &final_check,
.print = &print,
.save = &save,
.extra_opts = opts
Index: iptables/ip6tables.c
===================================================================
--- iptables.orig/ip6tables.c
+++ iptables/ip6tables.c
@@ -1840,9 +1840,10 @@ int do_command6(int argc, char *argv[],
}
for (matchp = matches; matchp; matchp = matchp->next)
- matchp->match->final_check(matchp->match->mflags);
+ if (matchp->match->final_check != NULL)
+ matchp->match->final_check(matchp->match->mflags);
- if (target)
+ if (target != NULL && target->final_check != NULL)
target->final_check(target->tflags);
/* Fix me: must put inverse options checking here --MN */
Index: iptables/iptables.c
===================================================================
--- iptables.orig/iptables.c
+++ iptables/iptables.c
@@ -1906,9 +1906,10 @@ int do_command(int argc, char *argv[], c
}
for (matchp = matches; matchp; matchp = matchp->next)
- matchp->match->final_check(matchp->match->mflags);
+ if (matchp->match->final_check != NULL)
+ matchp->match->final_check(matchp->match->mflags);
- if (target)
+ if (target != NULL && target->final_check != NULL)
target->final_check(target->tflags);
/* Fix me: must put inverse options checking here --MN */
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 04/14] Delete empty ->print() and ->save() functions
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
2007-10-04 10:11 ` [PATCH 02/14] Delete empty ->init() functions Jan Engelhardt
2007-10-04 10:11 ` [PATCH 03/14] Delete empty ->final_check() functions Jan Engelhardt
@ 2007-10-04 10:11 ` Jan Engelhardt
2007-10-04 10:12 ` [PATCH 05/13] Constify data structures Jan Engelhardt
` (9 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:11 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Deletes empty ->print() and ->save() functions.
ip[6]tables prints the trivial thing automatically.
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
---
extensions/libip6t_eui64.c | 17 -----------------
extensions/libipt_unclean.c | 2 --
extensions/libxt_TRACE.c | 4 ----
extensions/libxt_standard.c | 10 ----------
4 files changed, 33 deletions(-)
Index: iptables/extensions/libip6t_eui64.c
===================================================================
--- iptables.orig/extensions/libip6t_eui64.c
+++ iptables/extensions/libip6t_eui64.c
@@ -32,21 +32,6 @@ parse(int c, char **argv, int invert, un
return 0;
}
-/* Prints out the matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
-{
- printf("eui64 ");
-}
-
-/* Saves the union ip6t_matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
-{
-
-}
-
static struct ip6tables_match eui64 = {
.name = "eui64",
.version = IPTABLES_VERSION,
@@ -54,8 +39,6 @@ static struct ip6tables_match eui64 = {
.userspacesize = IP6T_ALIGN(sizeof(int)),
.help = &help,
.parse = &parse,
- .print = &print,
- .save = &save,
};
void _init(void)
Index: iptables/extensions/libipt_unclean.c
===================================================================
--- iptables.orig/extensions/libipt_unclean.c
+++ iptables/extensions/libipt_unclean.c
@@ -31,8 +31,6 @@ struct iptables_match unclean = {
.userspacesize = IPT_ALIGN(0),
.help = &help,
.parse = &parse,
- .print = NULL,
- .save = NULL,
};
void _init(void)
Index: iptables/extensions/libxt_TRACE.c
===================================================================
--- iptables.orig/extensions/libxt_TRACE.c
+++ iptables/extensions/libxt_TRACE.c
@@ -34,8 +34,6 @@ static struct xtables_target trace = {
.userspacesize = XT_ALIGN(0),
.help = &help,
.parse = &parse,
- .print = NULL, /* print */
- .save = NULL, /* save */
};
static struct xtables_target trace6 = {
@@ -46,8 +44,6 @@ static struct xtables_target trace6 = {
.userspacesize = XT_ALIGN(0),
.help = &help,
.parse = &parse,
- .print = NULL, /* print */
- .save = NULL, /* save */
};
void _init(void)
Index: iptables/extensions/libxt_standard.c
===================================================================
--- iptables.orig/extensions/libxt_standard.c
+++ iptables/extensions/libxt_standard.c
@@ -26,12 +26,6 @@ parse(int c, char **argv, int invert, un
return 0;
}
-/* Saves the targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
-{
-}
-
static
struct xtables_target standard = {
.family = AF_INET,
@@ -41,8 +35,6 @@ struct xtables_target standard = {
.userspacesize = XT_ALIGN(sizeof(int)),
.help = &help,
.parse = &parse,
- .print = NULL,
- .save = &save,
};
static
@@ -54,8 +46,6 @@ struct xtables_target standard6 = {
.userspacesize = XT_ALIGN(sizeof(int)),
.help = &help,
.parse = &parse,
- .print = NULL,
- .save = &save,
};
void _init(void)
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 05/13] Constify data structures
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
` (2 preceding siblings ...)
2007-10-04 10:11 ` [PATCH 04/14] Delete empty ->print() and ->save() functions Jan Engelhardt
@ 2007-10-04 10:12 ` Jan Engelhardt
2007-10-04 10:12 ` [PATCH 06/13] No ipt in xt Jan Engelhardt
` (8 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:12 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Constify more data structures. Make functions static.
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
---
extensions/libip6t_LOG.c | 2 +-
extensions/libip6t_REJECT.c | 2 +-
extensions/libip6t_policy.c | 2 +-
extensions/libipt_LOG.c | 2 +-
extensions/libipt_policy.c | 2 +-
extensions/libipt_realm.c | 4 ++--
extensions/libxt_CLASSIFY.c | 2 +-
extensions/libxt_dccp.c | 2 +-
extensions/libxt_hashlimit.c | 2 +-
extensions/libxt_limit.c | 2 +-
extensions/libxt_sctp.c | 2 +-
extensions/libxt_tcp.c | 2 +-
12 files changed, 13 insertions(+), 13 deletions(-)
Index: iptables/extensions/libip6t_LOG.c
===================================================================
--- iptables.orig/extensions/libip6t_LOG.c
+++ iptables/extensions/libip6t_LOG.c
@@ -57,7 +57,7 @@ struct ip6t_log_names {
unsigned int level;
};
-static struct ip6t_log_names ip6t_log_names[]
+static const struct ip6t_log_names ip6t_log_names[]
= { { .name = "alert", .level = LOG_ALERT },
{ .name = "crit", .level = LOG_CRIT },
{ .name = "debug", .level = LOG_DEBUG },
Index: iptables/extensions/libip6t_REJECT.c
===================================================================
--- iptables.orig/extensions/libip6t_REJECT.c
+++ iptables/extensions/libip6t_REJECT.c
@@ -145,7 +145,7 @@ static void save(const void *ip,
printf("--reject-with %s ", reject_table[i].name);
}
-struct ip6tables_target reject = {
+static struct ip6tables_target reject = {
.name = "REJECT",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_reject_info)),
Index: iptables/extensions/libip6t_policy.c
===================================================================
--- iptables.orig/extensions/libip6t_policy.c
+++ iptables/extensions/libip6t_policy.c
@@ -452,7 +452,7 @@ static void save(const void *ip, const s
}
}
-struct ip6tables_match policy = {
+static struct ip6tables_match policy = {
.name = "policy",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_policy_info)),
Index: iptables/extensions/libipt_LOG.c
===================================================================
--- iptables.orig/extensions/libipt_LOG.c
+++ iptables/extensions/libipt_LOG.c
@@ -57,7 +57,7 @@ struct ipt_log_names {
unsigned int level;
};
-static struct ipt_log_names ipt_log_names[]
+static const struct ipt_log_names ipt_log_names[]
= { { .name = "alert", .level = LOG_ALERT },
{ .name = "crit", .level = LOG_CRIT },
{ .name = "debug", .level = LOG_DEBUG },
Index: iptables/extensions/libipt_policy.c
===================================================================
--- iptables.orig/extensions/libipt_policy.c
+++ iptables/extensions/libipt_policy.c
@@ -410,7 +410,7 @@ static void save(const void *ip, const s
}
}
-struct iptables_match policy = {
+static struct iptables_match policy = {
.name = "policy",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_policy_info)),
Index: iptables/extensions/libipt_realm.c
===================================================================
--- iptables.orig/extensions/libipt_realm.c
+++ iptables/extensions/libipt_realm.c
@@ -116,7 +116,7 @@ static void load_realms(void)
}
/* get realm id for name, -1 if error/not found */
-int realm_name2id(const char* name)
+static int realm_name2id(const char* name)
{
struct realmname* cur;
@@ -134,7 +134,7 @@ int realm_name2id(const char* name)
}
/* get realm name for id, NULL if error/not found */
-const char* realm_id2name(int id)
+static const char *realm_id2name(int id)
{
struct realmname* cur;
Index: iptables/extensions/libxt_CLASSIFY.c
===================================================================
--- iptables.orig/extensions/libxt_CLASSIFY.c
+++ iptables/extensions/libxt_CLASSIFY.c
@@ -26,7 +26,7 @@ static const struct option opts[] = {
{ }
};
-int string_to_priority(const char *s, unsigned int *p)
+static int string_to_priority(const char *s, unsigned int *p)
{
unsigned int i, j;
Index: iptables/extensions/libxt_dccp.c
===================================================================
--- iptables.orig/extensions/libxt_dccp.c
+++ iptables/extensions/libxt_dccp.c
@@ -81,7 +81,7 @@ parse_dccp_ports(const char *portstring,
free(buffer);
}
-static char *dccp_pkt_types[] = {
+static const char *const dccp_pkt_types[] = {
[DCCP_PKT_REQUEST] = "REQUEST",
[DCCP_PKT_RESPONSE] = "RESPONSE",
[DCCP_PKT_DATA] = "DATA",
Index: iptables/extensions/libxt_hashlimit.c
===================================================================
--- iptables.orig/extensions/libxt_hashlimit.c
+++ iptables/extensions/libxt_hashlimit.c
@@ -249,7 +249,7 @@ static void final_check(unsigned int fla
"You have to specify --hashlimit-name");
}
-static struct rates
+static const struct rates
{
const char *name;
u_int32_t mult;
Index: iptables/extensions/libxt_limit.c
===================================================================
--- iptables.orig/extensions/libxt_limit.c
+++ iptables/extensions/libxt_limit.c
@@ -126,7 +126,7 @@ parse(int c, char **argv, int invert, un
return 1;
}
-static struct rates
+static const struct rates
{
const char *name;
u_int32_t mult;
Index: iptables/extensions/libxt_sctp.c
===================================================================
--- iptables.orig/extensions/libxt_sctp.c
+++ iptables/extensions/libxt_sctp.c
@@ -110,7 +110,7 @@ struct sctp_chunk_names {
};
/*'ALL' and 'NONE' will be treated specially. */
-static struct sctp_chunk_names sctp_chunk_names[]
+static const struct sctp_chunk_names sctp_chunk_names[]
= { { .name = "DATA", .chunk_type = 0, .valid_flags = "-----UBE"},
{ .name = "INIT", .chunk_type = 1, .valid_flags = "--------"},
{ .name = "INIT_ACK", .chunk_type = 2, .valid_flags = "--------"},
Index: iptables/extensions/libxt_tcp.c
===================================================================
--- iptables.orig/extensions/libxt_tcp.c
+++ iptables/extensions/libxt_tcp.c
@@ -66,7 +66,7 @@ struct tcp_flag_names {
unsigned int flag;
};
-static struct tcp_flag_names tcp_flag_names[]
+static const struct tcp_flag_names tcp_flag_names[]
= { { "FIN", 0x01 },
{ "SYN", 0x02 },
{ "RST", 0x04 },
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 06/13] No ipt in xt
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
` (3 preceding siblings ...)
2007-10-04 10:12 ` [PATCH 05/13] Constify data structures Jan Engelhardt
@ 2007-10-04 10:12 ` Jan Engelhardt
2007-10-04 10:12 ` [PATCH 07/13] Unique symbols 1/6 Jan Engelhardt
` (7 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:12 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Cease using ipt_entry_match (replaced by xt_entry_match).
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
---
extensions/libxt_connlimit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: iptables/extensions/libxt_connlimit.c
===================================================================
--- iptables.orig/extensions/libxt_connlimit.c
+++ iptables/extensions/libxt_connlimit.c
@@ -24,7 +24,7 @@ static const struct option connlimit_opt
{NULL},
};
-static void connlimit_init(struct ipt_entry_match *match)
+static void connlimit_init(struct xt_entry_match *match)
{
struct xt_connlimit_info *info = (void *)match->data;
info->v4_mask = 0xFFFFFFFFUL;
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 07/13] Unique symbols 1/6
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
` (4 preceding siblings ...)
2007-10-04 10:12 ` [PATCH 06/13] No ipt in xt Jan Engelhardt
@ 2007-10-04 10:12 ` Jan Engelhardt
2007-10-04 10:12 ` [PATCH 08/13] Unique names 2/6 Jan Engelhardt
` (6 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:12 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Give symbols of libxt matches unique names (1/3).
Adds unique prefixes to all functions (most of them - especially the hook
functions) so that debugging programs can unambiguously map a symbol to an
address. Also unifies the names of the xtables_match/xtables_target structs,
(based upon libxt_connmark.c/libip6t_*.c).
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
---
extensions/libxt_comment.c | 51 +++++-------
extensions/libxt_connbytes.c | 50 +++++------
extensions/libxt_connlimit.c | 8 -
extensions/libxt_connmark.c | 44 ++++------
extensions/libxt_dccp.c | 54 +++++-------
extensions/libxt_dscp.c | 51 +++++-------
extensions/libxt_esp.c | 50 +++++------
extensions/libxt_hashlimit.c | 59 ++++++--------
extensions/libxt_helper.c | 52 +++++-------
extensions/libxt_length.c | 52 +++++-------
extensions/libxt_limit.c | 51 +++++-------
extensions/libxt_mac.c | 50 +++++------
extensions/libxt_mark.c | 51 +++++-------
extensions/libxt_multiport.c | 180 +++++++++++++++++++++----------------------
extensions/libxt_physdev.c | 50 +++++------
extensions/libxt_pkttype.c | 50 +++++------
extensions/libxt_quota.c | 42 ++++------
extensions/libxt_sctp.c | 52 +++++-------
extensions/libxt_standard.c | 27 ++----
extensions/libxt_statistic.c | 52 +++++-------
extensions/libxt_string.c | 63 ++++++---------
extensions/libxt_tcp.c | 50 +++++------
extensions/libxt_tcpmss.c | 52 +++++-------
extensions/libxt_time.c | 8 -
extensions/libxt_u32.c | 8 -
extensions/libxt_udp.c | 52 +++++-------
26 files changed, 600 insertions(+), 709 deletions(-)
Index: iptables/extensions/libxt_comment.c
===================================================================
--- iptables.orig/extensions/libxt_comment.c
+++ iptables/extensions/libxt_comment.c
@@ -15,8 +15,7 @@
#include <linux/netfilter/xt_comment.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void comment_help(void)
{
printf(
"COMMENT match options:\n"
@@ -24,7 +23,7 @@ help(void)
);
}
-static const struct option opts[] = {
+static const struct option comment_opts[] = {
{ "comment", 1, NULL, '1' },
{ }
};
@@ -44,9 +43,8 @@ parse_comment(const char *s, struct xt_c
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+comment_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_comment_info *commentinfo = (struct xt_comment_info *)(*match)->data;
@@ -68,8 +66,7 @@ parse(int c, char **argv, int invert, un
}
/* Final check; must have specified --comment. */
-static void
-final_check(unsigned int flags)
+static void comment_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -78,9 +75,7 @@ final_check(unsigned int flags)
/* Prints out the matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+comment_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
struct xt_comment_info *commentinfo = (struct xt_comment_info *)match->data;
@@ -90,7 +85,7 @@ print(const void *ip,
/* Saves the union ipt_matchinfo in parsable form to stdout. */
static void
-save(const void *ip, const struct xt_entry_match *match)
+comment_save(const void *ip, const struct xt_entry_match *match)
{
struct xt_comment_info *commentinfo = (struct xt_comment_info *)match->data;
@@ -98,36 +93,36 @@ save(const void *ip, const struct xt_ent
printf("--comment \"%s\" ", commentinfo->comment);
}
-static struct xtables_match comment = {
+static struct xtables_match comment_match = {
.family = AF_INET,
.name = "comment",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_comment_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_comment_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = comment_help,
+ .parse = comment_parse,
+ .final_check = comment_check,
+ .print = comment_print,
+ .save = comment_save,
+ .extra_opts = comment_opts,
};
-static struct xtables_match comment6 = {
+static struct xtables_match comment_match6 = {
.family = AF_INET6,
.name = "comment",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_comment_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_comment_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = comment_help,
+ .parse = comment_parse,
+ .final_check = comment_check,
+ .print = comment_print,
+ .save = comment_save,
+ .extra_opts = comment_opts,
};
void _init(void)
{
- xtables_register_match(&comment);
- xtables_register_match(&comment6);
+ xtables_register_match(&comment_match);
+ xtables_register_match(&comment_match6);
}
Index: iptables/extensions/libxt_connbytes.c
===================================================================
--- iptables.orig/extensions/libxt_connbytes.c
+++ iptables/extensions/libxt_connbytes.c
@@ -9,8 +9,7 @@
#include <linux/netfilter/xt_connbytes.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void connbytes_help(void)
{
printf(
"connbytes v%s options:\n"
@@ -20,7 +19,7 @@ help(void)
"\n", IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option connbytes_opts[] = {
{ "connbytes", 1, NULL, '1' },
{ "connbytes-dir", 1, NULL, '2' },
{ "connbytes-mode", 1, NULL, '3' },
@@ -49,9 +48,8 @@ parse_range(const char *arg, struct xt_c
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+connbytes_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_connbytes_info *sinfo = (struct xt_connbytes_info *)(*match)->data;
unsigned long i;
@@ -101,7 +99,7 @@ parse(int c, char **argv, int invert, un
return 1;
}
-static void final_check(unsigned int flags)
+static void connbytes_check(unsigned int flags)
{
if (flags != 7)
exit_error(PARAMETER_PROBLEM, "You must specify `--connbytes'"
@@ -146,9 +144,7 @@ static void print_direction(struct xt_co
/* Prints out the matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+connbytes_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
struct xt_connbytes_info *sinfo = (struct xt_connbytes_info *)match->data;
@@ -169,7 +165,7 @@ print(const void *ip,
}
/* Saves the matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void connbytes_save(const void *ip, const struct xt_entry_match *match)
{
struct xt_connbytes_info *sinfo = (struct xt_connbytes_info *)match->data;
@@ -189,36 +185,36 @@ static void save(const void *ip, const s
print_direction(sinfo);
}
-static struct xtables_match state = {
+static struct xtables_match connbytes_match = {
.family = AF_INET,
.name = "connbytes",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_connbytes_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connbytes_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = connbytes_help,
+ .parse = connbytes_parse,
+ .final_check = connbytes_check,
+ .print = connbytes_print,
+ .save = connbytes_save,
+ .extra_opts = connbytes_opts,
};
-static struct xtables_match state6 = {
+static struct xtables_match connbytes_match6 = {
.family = AF_INET6,
.name = "connbytes",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_connbytes_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connbytes_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = connbytes_help,
+ .parse = connbytes_parse,
+ .final_check = connbytes_check,
+ .print = connbytes_print,
+ .save = connbytes_save,
+ .extra_opts = connbytes_opts,
};
void _init(void)
{
- xtables_register_match(&state);
- xtables_register_match(&state6);
+ xtables_register_match(&connbytes_match);
+ xtables_register_match(&connbytes_match6);
}
Index: iptables/extensions/libxt_connlimit.c
===================================================================
--- iptables.orig/extensions/libxt_connlimit.c
+++ iptables/extensions/libxt_connlimit.c
@@ -178,7 +178,7 @@ static void connlimit_save6(const void *
count_bits6(info->v6_mask));
}
-static struct xtables_match connlimit_reg4 = {
+static struct xtables_match connlimit_match = {
.name = "connlimit",
.family = AF_INET,
.version = IPTABLES_VERSION,
@@ -193,7 +193,7 @@ static struct xtables_match connlimit_re
.extra_opts = connlimit_opts,
};
-static struct xtables_match connlimit_reg6 = {
+static struct xtables_match connlimit_match6 = {
.name = "connlimit",
.family = AF_INET6,
.version = IPTABLES_VERSION,
@@ -210,6 +210,6 @@ static struct xtables_match connlimit_re
void _init(void)
{
- xtables_register_match(&connlimit_reg4);
- xtables_register_match(&connlimit_reg6);
+ xtables_register_match(&connlimit_match);
+ xtables_register_match(&connlimit_match6);
}
Index: iptables/extensions/libxt_connmark.c
===================================================================
--- iptables.orig/extensions/libxt_connmark.c
+++ iptables/extensions/libxt_connmark.c
@@ -29,8 +29,7 @@
#include <linux/netfilter/xt_connmark.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void connmark_help(void)
{
printf(
"CONNMARK match v%s options:\n"
@@ -39,7 +38,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option connmark_opts[] = {
{ "mark", 1, NULL, '1' },
{ }
};
@@ -47,9 +46,8 @@ static const struct option opts[] = {
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+connmark_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_connmark_info *markinfo = (struct xt_connmark_info *)(*match)->data;
@@ -87,8 +85,7 @@ print_mark(unsigned long mark, unsigned
}
/* Final check; must have specified --mark. */
-static void
-final_check(unsigned int flags)
+static void connmark_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -97,9 +94,7 @@ final_check(unsigned int flags)
/* Prints out the matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+connmark_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
struct xt_connmark_info *info = (struct xt_connmark_info *)match->data;
@@ -110,8 +105,7 @@ print(const void *ip,
}
/* Saves the matchinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void connmark_save(const void *ip, const struct xt_entry_match *match)
{
struct xt_connmark_info *info = (struct xt_connmark_info *)match->data;
@@ -128,12 +122,12 @@ static struct xtables_match connmark_mat
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_connmark_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connmark_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = connmark_help,
+ .parse = connmark_parse,
+ .final_check = connmark_check,
+ .print = connmark_print,
+ .save = connmark_save,
+ .extra_opts = connmark_opts,
};
static struct xtables_match connmark_match6 = {
@@ -142,12 +136,12 @@ static struct xtables_match connmark_mat
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_connmark_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connmark_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = connmark_help,
+ .parse = connmark_parse,
+ .final_check = connmark_check,
+ .print = connmark_print,
+ .save = connmark_save,
+ .extra_opts = connmark_opts,
};
void _init(void)
Index: iptables/extensions/libxt_dccp.c
===================================================================
--- iptables.orig/extensions/libxt_dccp.c
+++ iptables/extensions/libxt_dccp.c
@@ -25,15 +25,14 @@
#endif
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void dccp_init(struct xt_entry_match *m)
{
struct xt_dccp_info *einfo = (struct xt_dccp_info *)m->data;
memset(einfo, 0, sizeof(struct xt_dccp_info));
}
-static void help(void)
+static void dccp_help(void)
{
printf(
"DCCP match v%s options\n"
@@ -45,7 +44,7 @@ static void help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option dccp_opts[] = {
{ .name = "source-port", .has_arg = 1, .val = '1' },
{ .name = "sport", .has_arg = 1, .val = '1' },
{ .name = "destination-port", .has_arg = 1, .val = '2' },
@@ -132,9 +131,8 @@ static u_int8_t parse_dccp_option(char *
}
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+dccp_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_dccp_info *einfo
= (struct xt_dccp_info *)(*match)->data;
@@ -272,9 +270,7 @@ print_option(u_int8_t option, int invert
/* Prints out the matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+dccp_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
const struct xt_dccp_info *einfo =
(const struct xt_dccp_info *)match->data;
@@ -306,9 +302,7 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void
-save(const void *ip,
- const struct xt_entry_match *match)
+static void dccp_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_dccp_info *einfo =
(const struct xt_dccp_info *)match->data;
@@ -345,39 +339,37 @@ save(const void *ip,
}
}
-static struct xtables_match dccp =
-{
+static struct xtables_match dccp_match = {
.name = "dccp",
.family = AF_INET,
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_dccp_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_dccp_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = dccp_help,
+ .init = dccp_init,
+ .parse = dccp_parse,
+ .print = dccp_print,
+ .save = dccp_save,
+ .extra_opts = dccp_opts,
};
-static struct xtables_match dccp6 =
-{
+static struct xtables_match dccp_match6 = {
.name = "dccp",
.family = AF_INET6,
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_dccp_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_dccp_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = dccp_help,
+ .init = dccp_init,
+ .parse = dccp_parse,
+ .print = dccp_print,
+ .save = dccp_save,
+ .extra_opts = dccp_opts,
};
void _init(void)
{
- xtables_register_match(&dccp);
- xtables_register_match(&dccp6);
+ xtables_register_match(&dccp_match);
+ xtables_register_match(&dccp_match6);
}
Index: iptables/extensions/libxt_dscp.c
===================================================================
--- iptables.orig/extensions/libxt_dscp.c
+++ iptables/extensions/libxt_dscp.c
@@ -24,7 +24,7 @@
/* This is evil, but it's my code - HW*/
#include "libipt_dscp_helper.c"
-static void help(void)
+static void dscp_help(void)
{
printf(
"DSCP match v%s options\n"
@@ -39,7 +39,7 @@ static void help(void)
);
}
-static const struct option opts[] = {
+static const struct option dscp_opts[] = {
{ "dscp", 1, NULL, 'F' },
{ "dscp-class", 1, NULL, 'G' },
{ }
@@ -74,9 +74,8 @@ parse_class(const char *s, struct xt_dsc
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+dscp_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_dscp_info *dinfo
= (struct xt_dscp_info *)(*match)->data;
@@ -111,8 +110,7 @@ parse(int c, char **argv, int invert, un
return 1;
}
-static void
-final_check(unsigned int flags)
+static void dscp_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -130,9 +128,7 @@ print_dscp(u_int8_t dscp, int invert, in
/* Prints out the matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+dscp_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
const struct xt_dscp_info *dinfo =
(const struct xt_dscp_info *)match->data;
@@ -141,8 +137,7 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void dscp_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_dscp_info *dinfo =
(const struct xt_dscp_info *)match->data;
@@ -151,36 +146,36 @@ save(const void *ip, const struct xt_ent
print_dscp(dinfo->dscp, dinfo->invert, 1);
}
-static struct xtables_match dscp = {
+static struct xtables_match dscp_match = {
.family = AF_INET,
.name = "dscp",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_dscp_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_dscp_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = dscp_help,
+ .parse = dscp_parse,
+ .final_check = dscp_check,
+ .print = dscp_print,
+ .save = dscp_save,
+ .extra_opts = dscp_opts,
};
-static struct xtables_match dscp6 = {
+static struct xtables_match dscp_match6 = {
.family = AF_INET6,
.name = "dscp",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_dscp_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_dscp_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = dscp_help,
+ .parse = dscp_parse,
+ .final_check = dscp_check,
+ .print = dscp_print,
+ .save = dscp_save,
+ .extra_opts = dscp_opts,
};
void _init(void)
{
- xtables_register_match(&dscp);
- xtables_register_match(&dscp6);
+ xtables_register_match(&dscp_match);
+ xtables_register_match(&dscp_match6);
}
Index: iptables/extensions/libxt_esp.c
===================================================================
--- iptables.orig/extensions/libxt_esp.c
+++ iptables/extensions/libxt_esp.c
@@ -9,8 +9,7 @@
#include <linux/netfilter/xt_esp.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void esp_help(void)
{
printf(
"ESP v%s options:\n"
@@ -19,7 +18,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option esp_opts[] = {
{ "espspi", 1, NULL, '1' },
{ }
};
@@ -70,8 +69,7 @@ parse_esp_spis(const char *spistring, u_
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void esp_init(struct xt_entry_match *m)
{
struct xt_esp *espinfo = (struct xt_esp *)m->data;
@@ -83,9 +81,8 @@ init(struct xt_entry_match *m)
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+esp_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_esp *espinfo = (struct xt_esp *)(*match)->data;
@@ -123,8 +120,7 @@ print_spis(const char *name, u_int32_t m
/* Prints out the union ipt_matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+esp_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
const struct xt_esp *esp = (struct xt_esp *)match->data;
@@ -137,7 +133,7 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void esp_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_esp *espinfo = (struct xt_esp *)match->data;
@@ -157,37 +153,37 @@ static void save(const void *ip, const s
}
-static struct xtables_match esp = {
+static struct xtables_match esp_match = {
.family = AF_INET,
.name = "esp",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_esp)),
.userspacesize = XT_ALIGN(sizeof(struct xt_esp)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = esp_help,
+ .init = esp_init,
+ .parse = esp_parse,
+ .print = esp_print,
+ .save = esp_save,
+ .extra_opts = esp_opts,
};
-static struct xtables_match esp6 = {
+static struct xtables_match esp_match6 = {
.family = AF_INET6,
.name = "esp",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_esp)),
.userspacesize = XT_ALIGN(sizeof(struct xt_esp)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = esp_help,
+ .init = esp_init,
+ .parse = esp_parse,
+ .print = esp_print,
+ .save = esp_save,
+ .extra_opts = esp_opts,
};
void
_init(void)
{
- xtables_register_match(&esp);
- xtables_register_match(&esp6);
+ xtables_register_match(&esp_match);
+ xtables_register_match(&esp_match6);
}
Index: iptables/extensions/libxt_hashlimit.c
===================================================================
--- iptables.orig/extensions/libxt_hashlimit.c
+++ iptables/extensions/libxt_hashlimit.c
@@ -27,8 +27,7 @@
#define XT_HASHLIMIT_EXPIRE 10000
/* Function which prints out usage message. */
-static void
-help(void)
+static void hashlimit_help(void)
{
printf(
"hashlimit v%s options:\n"
@@ -46,7 +45,7 @@ help(void)
"\n", IPTABLES_VERSION, XT_HASHLIMIT_BURST);
}
-static const struct option opts[] = {
+static const struct option hashlimit_opts[] = {
{ "hashlimit", 1, NULL, '%' },
{ "hashlimit-burst", 1, NULL, '$' },
{ "hashlimit-htable-size", 1, NULL, '&' },
@@ -95,8 +94,7 @@ int parse_rate(const char *rate, u_int32
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void hashlimit_init(struct xt_entry_match *m)
{
struct xt_hashlimit_info *r = (struct xt_hashlimit_info *)m->data;
@@ -150,9 +148,8 @@ static int parse_mode(struct xt_hashlimi
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+hashlimit_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_hashlimit_info *r =
(struct xt_hashlimit_info *)(*match)->data;
@@ -236,7 +233,7 @@ parse(int c, char **argv, int invert, un
}
/* Final check; nothing. */
-static void final_check(unsigned int flags)
+static void hashlimit_check(unsigned int flags)
{
if (!(flags & PARAM_LIMIT))
exit_error(PARAMETER_PROBLEM,
@@ -302,10 +299,8 @@ static void print_mode(const struct xt_h
}
/* Prints out the matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void hashlimit_print(const void *ip,
+ const struct xt_entry_match *match, int numeric)
{
struct xt_hashlimit_info *r =
(struct xt_hashlimit_info *)match->data;
@@ -324,7 +319,7 @@ print(const void *ip,
}
/* FIXME: Make minimalist: only print rate if not default --RR */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void hashlimit_save(const void *ip, const struct xt_entry_match *match)
{
struct xt_hashlimit_info *r =
(struct xt_hashlimit_info *)match->data;
@@ -348,38 +343,38 @@ static void save(const void *ip, const s
printf("--hashlimit-htable-expire %u ", r->cfg.expire);
}
-static struct xtables_match hashlimit = {
+static struct xtables_match hashlimit_match = {
.family = AF_INET,
.name = "hashlimit",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_hashlimit_info)),
.userspacesize = offsetof(struct xt_hashlimit_info, hinfo),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = hashlimit_help,
+ .init = hashlimit_init,
+ .parse = hashlimit_parse,
+ .final_check = hashlimit_check,
+ .print = hashlimit_print,
+ .save = hashlimit_save,
+ .extra_opts = hashlimit_opts,
};
-static struct xtables_match hashlimit6 = {
+static struct xtables_match hashlimit_match6 = {
.family = AF_INET6,
.name = "hashlimit",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_hashlimit_info)),
.userspacesize = offsetof(struct xt_hashlimit_info, hinfo),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = hashlimit_help,
+ .init = hashlimit_init,
+ .parse = hashlimit_parse,
+ .final_check = hashlimit_check,
+ .print = hashlimit_print,
+ .save = hashlimit_save,
+ .extra_opts = hashlimit_opts,
};
void _init(void)
{
- xtables_register_match(&hashlimit);
- xtables_register_match(&hashlimit6);
+ xtables_register_match(&hashlimit_match);
+ xtables_register_match(&hashlimit_match6);
}
Index: iptables/extensions/libxt_helper.c
===================================================================
--- iptables.orig/extensions/libxt_helper.c
+++ iptables/extensions/libxt_helper.c
@@ -9,8 +9,7 @@
#include <linux/netfilter/xt_helper.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void helper_help(void)
{
printf(
"helper match v%s options:\n"
@@ -19,7 +18,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option helper_opts[] = {
{ "helper", 1, NULL, '1' },
{ }
};
@@ -27,9 +26,8 @@ static const struct option opts[] = {
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+helper_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_helper_info *info = (struct xt_helper_info *)(*match)->data;
@@ -53,8 +51,7 @@ parse(int c, char **argv, int invert, un
}
/* Final check; must have specified --helper. */
-static void
-final_check(unsigned int flags)
+static void helper_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -63,9 +60,7 @@ final_check(unsigned int flags)
/* Prints out the info. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+helper_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
struct xt_helper_info *info = (struct xt_helper_info *)match->data;
@@ -73,42 +68,41 @@ print(const void *ip,
}
/* Saves the union ipt_info in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void helper_save(const void *ip, const struct xt_entry_match *match)
{
struct xt_helper_info *info = (struct xt_helper_info *)match->data;
printf("%s--helper \"%s\" ",info->invert ? "! " : "", info->name);
}
-static struct xtables_match helper = {
+static struct xtables_match helper_match = {
.family = AF_INET,
.name = "helper",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_helper_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = helper_help,
+ .parse = helper_parse,
+ .final_check = helper_check,
+ .print = helper_print,
+ .save = helper_save,
+ .extra_opts = helper_opts,
};
-static struct xtables_match helper6 = {
+static struct xtables_match helper_match6 = {
.family = AF_INET6,
.name = "helper",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_helper_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = helper_help,
+ .parse = helper_parse,
+ .final_check = helper_check,
+ .print = helper_print,
+ .save = helper_save,
+ .extra_opts = helper_opts,
};
void _init(void)
{
- xtables_register_match(&helper);
- xtables_register_match(&helper6);
+ xtables_register_match(&helper_match);
+ xtables_register_match(&helper_match6);
}
Index: iptables/extensions/libxt_length.c
===================================================================
--- iptables.orig/extensions/libxt_length.c
+++ iptables/extensions/libxt_length.c
@@ -9,8 +9,7 @@
#include <linux/netfilter/xt_length.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void length_help(void)
{
printf(
"length v%s options:\n"
@@ -20,7 +19,7 @@ IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option length_opts[] = {
{ "length", 1, NULL, '1' },
{ }
};
@@ -65,9 +64,8 @@ parse_lengths(const char *s, struct xt_l
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+length_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_length_info *info = (struct xt_length_info *)(*match)->data;
@@ -91,8 +89,7 @@ parse(int c, char **argv, int invert, un
}
/* Final check; must have specified --length. */
-static void
-final_check(unsigned int flags)
+static void length_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -114,52 +111,49 @@ print_length(struct xt_length_info *info
/* Prints out the matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+length_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
printf("length ");
print_length((struct xt_length_info *)match->data);
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void length_save(const void *ip, const struct xt_entry_match *match)
{
printf("--length ");
print_length((struct xt_length_info *)match->data);
}
-static struct xtables_match length = {
+static struct xtables_match length_match = {
.family = AF_INET,
.name = "length",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_length_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_length_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = length_help,
+ .parse = length_parse,
+ .final_check = length_check,
+ .print = length_print,
+ .save = length_save,
+ .extra_opts = length_opts,
};
-static struct xtables_match length6 = {
+static struct xtables_match length_match6 = {
.family = AF_INET6,
.name = "length",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_length_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_length_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = length_help,
+ .parse = length_parse,
+ .final_check = length_check,
+ .print = length_print,
+ .save = length_save,
+ .extra_opts = length_opts,
};
void _init(void)
{
- xtables_register_match(&length);
- xtables_register_match(&length6);
+ xtables_register_match(&length_match);
+ xtables_register_match(&length_match6);
}
Index: iptables/extensions/libxt_limit.c
===================================================================
--- iptables.orig/extensions/libxt_limit.c
+++ iptables/extensions/libxt_limit.c
@@ -18,8 +18,7 @@
#define XT_LIMIT_BURST 5
/* Function which prints out usage message. */
-static void
-help(void)
+static void limit_help(void)
{
printf(
"limit v%s options:\n"
@@ -30,7 +29,7 @@ help(void)
"\n", IPTABLES_VERSION, XT_LIMIT_BURST);
}
-static const struct option opts[] = {
+static const struct option limit_opts[] = {
{ "limit", 1, NULL, '%' },
{ "limit-burst", 1, NULL, '$' },
{ }
@@ -73,8 +72,7 @@ int parse_rate(const char *rate, u_int32
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void limit_init(struct xt_entry_match *m)
{
struct xt_rateinfo *r = (struct xt_rateinfo *)m->data;
@@ -92,9 +90,8 @@ init(struct xt_entry_match *m)
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+limit_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_rateinfo *r = (struct xt_rateinfo *)(*match)->data;
unsigned int num;
@@ -150,9 +147,7 @@ static void print_rate(u_int32_t period)
/* Prints out the matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+limit_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
struct xt_rateinfo *r = (struct xt_rateinfo *)match->data;
printf("limit: avg "); print_rate(r->avg);
@@ -160,7 +155,7 @@ print(const void *ip,
}
/* FIXME: Make minimalist: only print rate if not default --RR */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void limit_save(const void *ip, const struct xt_entry_match *match)
{
struct xt_rateinfo *r = (struct xt_rateinfo *)match->data;
@@ -169,36 +164,36 @@ static void save(const void *ip, const s
printf("--limit-burst %u ", r->burst);
}
-static struct xtables_match limit = {
+static struct xtables_match limit_match = {
.family = AF_INET,
.name = "limit",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_rateinfo)),
.userspacesize = offsetof(struct xt_rateinfo, prev),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = limit_help,
+ .init = limit_init,
+ .parse = limit_parse,
+ .print = limit_print,
+ .save = limit_save,
+ .extra_opts = limit_opts,
};
-static struct xtables_match limit6 = {
+static struct xtables_match limit_match6 = {
.family = AF_INET6,
.name = "limit",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_rateinfo)),
.userspacesize = offsetof(struct xt_rateinfo, prev),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = limit_help,
+ .init = limit_init,
+ .parse = limit_parse,
+ .print = limit_print,
+ .save = limit_save,
+ .extra_opts = limit_opts,
};
void _init(void)
{
- xtables_register_match(&limit);
- xtables_register_match(&limit6);
+ xtables_register_match(&limit_match);
+ xtables_register_match(&limit_match6);
}
Index: iptables/extensions/libxt_mac.c
===================================================================
--- iptables.orig/extensions/libxt_mac.c
+++ iptables/extensions/libxt_mac.c
@@ -13,8 +13,7 @@
#include <linux/netfilter/xt_mac.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void mac_help(void)
{
printf(
"MAC v%s options:\n"
@@ -23,7 +22,7 @@ help(void)
"\n", IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option mac_opts[] = {
{ "mac-source", 1, NULL, '1' },
{ }
};
@@ -55,9 +54,8 @@ parse_mac(const char *mac, struct xt_mac
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+mac_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_mac_info *macinfo = (struct xt_mac_info *)(*match)->data;
@@ -88,7 +86,7 @@ static void print_mac(unsigned char maca
}
/* Final check; must have specified --mac. */
-static void final_check(unsigned int flags)
+static void mac_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -97,9 +95,7 @@ static void final_check(unsigned int fla
/* Prints out the matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+mac_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
printf("MAC ");
@@ -110,7 +106,7 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void mac_save(const void *ip, const struct xt_entry_match *match)
{
if (((struct xt_mac_info *)match->data)->invert)
printf("! ");
@@ -119,36 +115,36 @@ static void save(const void *ip, const s
print_mac(((struct xt_mac_info *)match->data)->srcaddr);
}
-static struct xtables_match mac = {
+static struct xtables_match mac_match = {
.family = AF_INET,
.name = "mac",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_mac_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mac_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = mac_help,
+ .parse = mac_parse,
+ .final_check = mac_check,
+ .print = mac_print,
+ .save = mac_save,
+ .extra_opts = mac_opts,
};
-static struct xtables_match mac6 = {
+static struct xtables_match mac_match6 = {
.family = AF_INET6,
.name = "mac",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_mac_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mac_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = mac_help,
+ .parse = mac_parse,
+ .final_check = mac_check,
+ .print = mac_print,
+ .save = mac_save,
+ .extra_opts = mac_opts,
};
void _init(void)
{
- xtables_register_match(&mac);
- xtables_register_match(&mac6);
+ xtables_register_match(&mac_match);
+ xtables_register_match(&mac_match6);
}
Index: iptables/extensions/libxt_mark.c
===================================================================
--- iptables.orig/extensions/libxt_mark.c
+++ iptables/extensions/libxt_mark.c
@@ -10,8 +10,7 @@
#include "../include/linux/netfilter/xt_mark.h"
/* Function which prints out usage message. */
-static void
-help(void)
+static void mark_help(void)
{
printf(
"MARK match v%s options:\n"
@@ -20,7 +19,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option mark_opts[] = {
{ "mark", 1, NULL, '1' },
{ }
};
@@ -28,9 +27,8 @@ static const struct option opts[] = {
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+mark_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_mark_info *markinfo = (struct xt_mark_info *)(*match)->data;
@@ -66,8 +64,7 @@ print_mark(unsigned long mark, unsigned
}
/* Final check; must have specified --mark. */
-static void
-final_check(unsigned int flags)
+static void mark_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -76,9 +73,7 @@ final_check(unsigned int flags)
/* Prints out the matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+mark_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
struct xt_mark_info *info = (struct xt_mark_info *)match->data;
@@ -92,7 +87,7 @@ print(const void *ip,
/* Saves the union ipt_matchinfo in parsable form to stdout. */
static void
-save(const void *ip, const struct xt_entry_match *match)
+mark_save(const void *ip, const struct xt_entry_match *match)
{
struct xt_mark_info *info = (struct xt_mark_info *)match->data;
@@ -103,36 +98,36 @@ save(const void *ip, const struct xt_ent
print_mark(info->mark, info->mask, 0);
}
-static struct xtables_match mark = {
+static struct xtables_match mark_match = {
.family = AF_INET,
.name = "mark",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_mark_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mark_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = mark_help,
+ .parse = mark_parse,
+ .final_check = mark_check,
+ .print = mark_print,
+ .save = mark_save,
+ .extra_opts = mark_opts,
};
-static struct xtables_match mark6 = {
+static struct xtables_match mark_match6 = {
.family = AF_INET6,
.name = "mark",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_mark_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mark_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = mark_help,
+ .parse = mark_parse,
+ .final_check = mark_check,
+ .print = mark_print,
+ .save = mark_save,
+ .extra_opts = mark_opts,
};
void _init(void)
{
- xtables_register_match(&mark);
- xtables_register_match(&mark6);
+ xtables_register_match(&mark_match);
+ xtables_register_match(&mark_match6);
}
Index: iptables/extensions/libxt_multiport.c
===================================================================
--- iptables.orig/extensions/libxt_multiport.c
+++ iptables/extensions/libxt_multiport.c
@@ -12,8 +12,7 @@
#include "../include/linux/netfilter/xt_multiport.h"
/* Function which prints out usage message. */
-static void
-help(void)
+static void multiport_help(void)
{
printf(
"multiport v%s options:\n"
@@ -29,8 +28,7 @@ help(void)
IPTABLES_VERSION);
}
-static void
-help_v1(void)
+static void multiport_help_v1(void)
{
printf(
"multiport v%s options:\n"
@@ -45,7 +43,7 @@ help_v1(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option multiport_opts[] = {
{ "source-ports", 1, NULL, '1' },
{ "sports", 1, NULL, '1' }, /* synonym */
{ "destination-ports", 1, NULL, '2' },
@@ -156,9 +154,9 @@ check_proto(u_int16_t pnum, u_int8_t inv
/* Function which parses command options; returns true if it
ate an option */
static int
-__parse(int c, char **argv, int invert, unsigned int *flags,
- struct xt_entry_match **match,
- u_int16_t pnum, u_int8_t invflags)
+__multiport_parse(int c, char **argv, int invert, unsigned int *flags,
+ struct xt_entry_match **match, u_int16_t pnum,
+ u_int8_t invflags)
{
const char *proto;
struct xt_multiport *multiinfo
@@ -205,29 +203,27 @@ __parse(int c, char **argv, int invert,
}
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *e,
- struct xt_entry_match **match)
+multiport_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *e, struct xt_entry_match **match)
{
const struct ipt_entry *entry = e;
- return __parse(c, argv, invert, flags, match, entry->ip.proto,
- entry->ip.invflags);
+ return __multiport_parse(c, argv, invert, flags, match,
+ entry->ip.proto, entry->ip.invflags);
}
static int
-parse6(int c, char **argv, int invert, unsigned int *flags,
- const void *e,
- struct xt_entry_match **match)
+multiport_parse6(int c, char **argv, int invert, unsigned int *flags,
+ const void *e, struct xt_entry_match **match)
{
const struct ip6t_entry *entry = (const struct ip6t_entry *)e;
- return __parse(c, argv, invert, flags, match, entry->ipv6.proto,
- entry->ipv6.invflags);
+ return __multiport_parse(c, argv, invert, flags, match,
+ entry->ipv6.proto, entry->ipv6.invflags);
}
static int
-__parse_v1(int c, char **argv, int invert, unsigned int *flags,
- struct xt_entry_match **match,
- u_int16_t pnum, u_int8_t invflags)
+__multiport_parse_v1(int c, char **argv, int invert, unsigned int *flags,
+ struct xt_entry_match **match, u_int16_t pnum,
+ u_int8_t invflags)
{
const char *proto;
struct xt_multiport_v1 *multiinfo
@@ -270,28 +266,25 @@ __parse_v1(int c, char **argv, int inver
}
static int
-parse_v1(int c, char **argv, int invert, unsigned int *flags,
- const void *e,
- struct xt_entry_match **match)
+multiport_parse_v1(int c, char **argv, int invert, unsigned int *flags,
+ const void *e, struct xt_entry_match **match)
{
const struct ipt_entry *entry = e;
- return __parse_v1(c, argv, invert, flags, match, entry->ip.proto,
- entry->ip.invflags);
+ return __multiport_parse_v1(c, argv, invert, flags, match,
+ entry->ip.proto, entry->ip.invflags);
}
static int
-parse6_v1(int c, char **argv, int invert, unsigned int *flags,
- const void *e,
- struct xt_entry_match **match)
+multiport_parse6_v1(int c, char **argv, int invert, unsigned int *flags,
+ const void *e, struct xt_entry_match **match)
{
const struct ip6t_entry *entry = (const struct ip6t_entry *)e;
- return __parse_v1(c, argv, invert, flags, match, entry->ipv6.proto,
- entry->ipv6.invflags);
+ return __multiport_parse_v1(c, argv, invert, flags, match,
+ entry->ipv6.proto, entry->ipv6.invflags);
}
/* Final check; must specify something. */
-static void
-final_check(unsigned int flags)
+static void multiport_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM, "multiport expection an option");
@@ -321,7 +314,8 @@ print_port(u_int16_t port, u_int8_t prot
/* Prints out the matchinfo. */
static void
-__print(const struct xt_entry_match *match, int numeric, u_int16_t proto)
+__multiport_print(const struct xt_entry_match *match, int numeric,
+ u_int16_t proto)
{
const struct xt_multiport *multiinfo
= (const struct xt_multiport *)match->data;
@@ -354,22 +348,22 @@ __print(const struct xt_entry_match *mat
printf(" ");
}
-static void
-print(const void *ip_void, const struct xt_entry_match *match, int numeric)
+static void multiport_print(const void *ip_void,
+ const struct xt_entry_match *match, int numeric)
{
const struct ipt_ip *ip = ip_void;
- __print(match, numeric, ip->proto);
+ __multiport_print(match, numeric, ip->proto);
}
-static void
-print6(const void *ip_void, const struct xt_entry_match *match, int numeric)
+static void multiport_print6(const void *ip_void,
+ const struct xt_entry_match *match, int numeric)
{
const struct ip6t_ip6 *ip = (const struct ip6t_ip6 *)ip_void;
- __print(match, numeric, ip->proto);
+ __multiport_print(match, numeric, ip->proto);
}
-static void
-__print_v1(const struct xt_entry_match *match, int numeric, u_int16_t proto)
+static void __multiport_print_v1(const struct xt_entry_match *match,
+ int numeric, u_int16_t proto)
{
const struct xt_multiport_v1 *multiinfo
= (const struct xt_multiport_v1 *)match->data;
@@ -409,22 +403,23 @@ __print_v1(const struct xt_entry_match *
printf(" ");
}
-static void
-print_v1(const void *ip_void, const struct xt_entry_match *match, int numeric)
+static void multiport_print_v1(const void *ip_void,
+ const struct xt_entry_match *match, int numeric)
{
const struct ipt_ip *ip = ip_void;
- __print_v1(match, numeric, ip->proto);
+ __multiport_print_v1(match, numeric, ip->proto);
}
-static void
-print6_v1(const void *ip_void, const struct xt_entry_match *match, int numeric)
+static void multiport_print6_v1(const void *ip_void,
+ const struct xt_entry_match *match, int numeric)
{
const struct ip6t_ip6 *ip = (const struct ip6t_ip6 *)ip_void;
- __print_v1(match, numeric, ip->proto);
+ __multiport_print_v1(match, numeric, ip->proto);
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void __save(const struct xt_entry_match *match, u_int16_t proto)
+static void __multiport_save(const struct xt_entry_match *match,
+ u_int16_t proto)
{
const struct xt_multiport *multiinfo
= (const struct xt_multiport *)match->data;
@@ -451,19 +446,22 @@ static void __save(const struct xt_entry
printf(" ");
}
-static void save(const void *ip_void, const struct xt_entry_match *match)
+static void multiport_save(const void *ip_void,
+ const struct xt_entry_match *match)
{
const struct ipt_ip *ip = ip_void;
- __save(match, ip->proto);
+ __multiport_save(match, ip->proto);
}
-static void save6(const void *ip_void, const struct xt_entry_match *match)
+static void multiport_save6(const void *ip_void,
+ const struct xt_entry_match *match)
{
const struct ip6t_ip6 *ip = (const struct ip6t_ip6 *)ip_void;
- __save(match, ip->proto);
+ __multiport_save(match, ip->proto);
}
-static void __save_v1(const struct xt_entry_match *match, u_int16_t proto)
+static void __multiport_save_v1(const struct xt_entry_match *match,
+ u_int16_t proto)
{
const struct xt_multiport_v1 *multiinfo
= (const struct xt_multiport_v1 *)match->data;
@@ -497,83 +495,85 @@ static void __save_v1(const struct xt_en
printf(" ");
}
-static void save_v1(const void *ip_void, const struct xt_entry_match *match)
+static void multiport_save_v1(const void *ip_void,
+ const struct xt_entry_match *match)
{
const struct ipt_ip *ip = ip_void;
- __save_v1(match, ip->proto);
+ __multiport_save_v1(match, ip->proto);
}
-static void save6_v1(const void *ip_void, const struct xt_entry_match *match)
+static void multiport_save6_v1(const void *ip_void,
+ const struct xt_entry_match *match)
{
const struct ip6t_ip6 *ip = (const struct ip6t_ip6 *)ip_void;
- __save_v1(match, ip->proto);
+ __multiport_save_v1(match, ip->proto);
}
-static struct xtables_match multiport = {
+static struct xtables_match multiport_match = {
.family = AF_INET,
.name = "multiport",
.revision = 0,
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_multiport)),
.userspacesize = XT_ALIGN(sizeof(struct xt_multiport)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = multiport_help,
+ .parse = multiport_parse,
+ .final_check = multiport_check,
+ .print = multiport_print,
+ .save = multiport_save,
+ .extra_opts = multiport_opts,
};
-static struct xtables_match multiport6 = {
+static struct xtables_match multiport_match6 = {
.family = AF_INET6,
.name = "multiport",
.revision = 0,
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_multiport)),
.userspacesize = XT_ALIGN(sizeof(struct xt_multiport)),
- .help = &help,
- .parse = &parse6,
- .final_check = &final_check,
- .print = &print6,
- .save = &save6,
- .extra_opts = opts
+ .help = multiport_help,
+ .parse = multiport_parse6,
+ .final_check = multiport_check,
+ .print = multiport_print6,
+ .save = multiport_save6,
+ .extra_opts = multiport_opts,
};
-static struct xtables_match multiport_v1 = {
+static struct xtables_match multiport_match_v1 = {
.family = AF_INET,
.name = "multiport",
.version = IPTABLES_VERSION,
.revision = 1,
.size = XT_ALIGN(sizeof(struct xt_multiport_v1)),
.userspacesize = XT_ALIGN(sizeof(struct xt_multiport_v1)),
- .help = &help_v1,
- .parse = &parse_v1,
- .final_check = &final_check,
- .print = &print_v1,
- .save = &save_v1,
- .extra_opts = opts
+ .help = multiport_help_v1,
+ .parse = multiport_parse_v1,
+ .final_check = multiport_check,
+ .print = multiport_print_v1,
+ .save = multiport_save_v1,
+ .extra_opts = multiport_opts,
};
-static struct xtables_match multiport6_v1 = {
+static struct xtables_match multiport_match6_v1 = {
.family = AF_INET6,
.name = "multiport",
.version = IPTABLES_VERSION,
.revision = 1,
.size = XT_ALIGN(sizeof(struct xt_multiport_v1)),
.userspacesize = XT_ALIGN(sizeof(struct xt_multiport_v1)),
- .help = &help_v1,
- .parse = &parse6_v1,
- .final_check = &final_check,
- .print = &print6_v1,
- .save = &save6_v1,
- .extra_opts = opts
+ .help = multiport_help_v1,
+ .parse = multiport_parse6_v1,
+ .final_check = multiport_check,
+ .print = multiport_print6_v1,
+ .save = multiport_save6_v1,
+ .extra_opts = multiport_opts,
};
void
_init(void)
{
- xtables_register_match(&multiport);
- xtables_register_match(&multiport6);
- xtables_register_match(&multiport_v1);
- xtables_register_match(&multiport6_v1);
+ xtables_register_match(&multiport_match);
+ xtables_register_match(&multiport_match6);
+ xtables_register_match(&multiport_match_v1);
+ xtables_register_match(&multiport_match6_v1);
}
Index: iptables/extensions/libxt_physdev.c
===================================================================
--- iptables.orig/extensions/libxt_physdev.c
+++ iptables/extensions/libxt_physdev.c
@@ -12,8 +12,7 @@
#include <linux/if_ether.h>
#endif
-static void
-help(void)
+static void physdev_help(void)
{
printf(
"physdev v%s options:\n"
@@ -25,7 +24,7 @@ help(void)
"\n", IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option physdev_opts[] = {
{ "physdev-in", 1, NULL, '1' },
{ "physdev-out", 1, NULL, '2' },
{ "physdev-is-in", 0, NULL, '3' },
@@ -35,9 +34,8 @@ static const struct option opts[] = {
};
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+physdev_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_physdev_info *info =
(struct xt_physdev_info*)(*match)->data;
@@ -108,16 +106,14 @@ multiple_use:
}
-static void final_check(unsigned int flags)
+static void physdev_check(unsigned int flags)
{
if (flags == 0)
exit_error(PARAMETER_PROBLEM, "PHYSDEV: no physdev option specified");
}
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+physdev_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
struct xt_physdev_info *info =
(struct xt_physdev_info*)match->data;
@@ -142,7 +138,7 @@ print(const void *ip,
printf(" ");
}
-static void save(const void *ip, const struct xt_entry_match *match)
+static void physdev_save(const void *ip, const struct xt_entry_match *match)
{
struct xt_physdev_info *info =
(struct xt_physdev_info*)match->data;
@@ -166,36 +162,36 @@ static void save(const void *ip, const s
printf(" ");
}
-static struct xtables_match physdev = {
+static struct xtables_match physdev_match = {
.family = AF_INET,
.name = "physdev",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_physdev_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_physdev_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = physdev_help,
+ .parse = physdev_parse,
+ .final_check = physdev_check,
+ .print = physdev_print,
+ .save = physdev_save,
+ .extra_opts = physdev_opts,
};
-static struct xtables_match physdev6 = {
+static struct xtables_match physdev_match6 = {
.family = AF_INET6,
.name = "physdev",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_physdev_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_physdev_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = physdev_help,
+ .parse = physdev_parse,
+ .final_check = physdev_check,
+ .print = physdev_print,
+ .save = physdev_save,
+ .extra_opts = physdev_opts,
};
void _init(void)
{
- xtables_register_match(&physdev);
- xtables_register_match(&physdev6);
+ xtables_register_match(&physdev_match);
+ xtables_register_match(&physdev_match6);
}
Index: iptables/extensions/libxt_pkttype.c
===================================================================
--- iptables.orig/extensions/libxt_pkttype.c
+++ iptables/extensions/libxt_pkttype.c
@@ -55,16 +55,16 @@ static void print_types(void)
}
/* Function which prints out usage message. */
-static void help(void)
+static void pkttype_help(void)
{
printf(
-"pkt_type v%s options:\n"
+"pkttype v%s options:\n"
" --pkt-type [!] packettype\tmatch packet type\n"
"\n", PKTTYPE_VERSION);
print_types();
}
-static const struct option opts[] = {
+static const struct option pkttype_opts[] = {
{"pkt-type", 1, NULL, '1'},
{ }
};
@@ -85,9 +85,8 @@ static void parse_pkttype(const char *pk
exit_error(PARAMETER_PROBLEM, "Bad packet type '%s'", pkttype);
}
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int pkttype_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_pkttype_info *info = (struct xt_pkttype_info *)(*match)->data;
@@ -108,7 +107,7 @@ static int parse(int c, char **argv, int
return 1;
}
-static void final_check(unsigned int flags)
+static void pkttype_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM, "You must specify `--pkt-type'");
@@ -130,7 +129,8 @@ static void print_pkttype(struct xt_pktt
printf("%d ", info->pkttype); /* in case we didn't find an entry in named-packtes */
}
-static void print(const void *ip, const struct xt_entry_match *match, int numeric)
+static void pkttype_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
struct xt_pkttype_info *info = (struct xt_pkttype_info *)match->data;
@@ -138,7 +138,7 @@ static void print(const void *ip, const
print_pkttype(info);
}
-static void save(const void *ip, const struct xt_entry_match *match)
+static void pkttype_save(const void *ip, const struct xt_entry_match *match)
{
struct xt_pkttype_info *info = (struct xt_pkttype_info *)match->data;
@@ -146,36 +146,36 @@ static void save(const void *ip, const s
print_pkttype(info);
}
-static struct xtables_match pkttype = {
+static struct xtables_match pkttype_match = {
.family = AF_INET,
.name = "pkttype",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_pkttype_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_pkttype_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = pkttype_help,
+ .parse = pkttype_parse,
+ .final_check = pkttype_check,
+ .print = pkttype_print,
+ .save = pkttype_save,
+ .extra_opts = pkttype_opts,
};
-static struct xtables_match pkttype6 = {
+static struct xtables_match pkttype_match6 = {
.family = AF_INET6,
.name = "pkttype",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_pkttype_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_pkttype_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = pkttype_help,
+ .parse = pkttype_parse,
+ .final_check = pkttype_check,
+ .print = pkttype_print,
+ .save = pkttype_save,
+ .extra_opts = pkttype_opts,
};
void _init(void)
{
- xtables_register_match(&pkttype);
- xtables_register_match(&pkttype6);
+ xtables_register_match(&pkttype_match);
+ xtables_register_match(&pkttype_match6);
}
Index: iptables/extensions/libxt_quota.c
===================================================================
--- iptables.orig/extensions/libxt_quota.c
+++ iptables/extensions/libxt_quota.c
@@ -11,14 +11,13 @@
#include <linux/netfilter/xt_quota.h>
-static const struct option opts[] = {
+static const struct option quota_opts[] = {
{"quota", 1, NULL, '1'},
{ }
};
/* print usage */
-static void
-help(void)
+static void quota_help(void)
{
printf("quota options:\n"
" --quota quota quota (bytes)\n" "\n");
@@ -26,7 +25,7 @@ help(void)
/* print matchinfo */
static void
-print(const void *ip, const struct xt_entry_match *match, int numeric)
+quota_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
struct xt_quota_info *q = (struct xt_quota_info *) match->data;
printf("quota: %llu bytes", (unsigned long long) q->quota);
@@ -34,7 +33,7 @@ print(const void *ip, const struct xt_en
/* save matchinfo */
static void
-save(const void *ip, const struct xt_entry_match *match)
+quota_save(const void *ip, const struct xt_entry_match *match)
{
struct xt_quota_info *q = (struct xt_quota_info *) match->data;
printf("--quota %llu ", (unsigned long long) q->quota);
@@ -58,9 +57,8 @@ parse_quota(const char *s, u_int64_t * q
/* parse all options, returning true if we found any for us */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+quota_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_quota_info *info = (struct xt_quota_info *) (*match)->data;
@@ -79,35 +77,35 @@ parse(int c, char **argv, int invert, un
return 1;
}
-struct xtables_match quota = {
+struct xtables_match quota_match = {
.family = AF_INET,
.name = "quota",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof (struct xt_quota_info)),
.userspacesize = offsetof(struct xt_quota_info, quota),
- .help = &help,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = quota_help,
+ .parse = quota_parse,
+ .print = quota_print,
+ .save = quota_save,
+ .extra_opts = quota_opts,
};
-struct xtables_match quota6 = {
+struct xtables_match quota_match6 = {
.family = AF_INET6,
.name = "quota",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof (struct xt_quota_info)),
.userspacesize = offsetof(struct xt_quota_info, quota),
- .help = &help,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = quota_help,
+ .parse = quota_parse,
+ .print = quota_print,
+ .save = quota_save,
+ .extra_opts = quota_opts,
};
void
_init(void)
{
- xtables_register_match("a);
- xtables_register_match("a6);
+ xtables_register_match("a_match);
+ xtables_register_match("a_match6);
}
Index: iptables/extensions/libxt_sctp.c
===================================================================
--- iptables.orig/extensions/libxt_sctp.c
+++ iptables/extensions/libxt_sctp.c
@@ -41,8 +41,7 @@ static void
print_chunk(u_int32_t chunknum, int numeric);
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void sctp_init(struct xt_entry_match *m)
{
int i;
struct xt_sctp_info *einfo = (struct xt_sctp_info *)m->data;
@@ -54,7 +53,7 @@ init(struct xt_entry_match *m)
}
}
-static void help(void)
+static void sctp_help(void)
{
printf(
"SCTP match v%s options\n"
@@ -68,7 +67,7 @@ static void help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option sctp_opts[] = {
{ .name = "source-port", .has_arg = 1, .val = '1' },
{ .name = "sport", .has_arg = 1, .val = '1' },
{ .name = "destination-port", .has_arg = 1, .val = '2' },
@@ -260,9 +259,8 @@ parse_sctp_chunks(struct xt_sctp_info *e
}
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+sctp_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_sctp_info *einfo
= (struct xt_sctp_info *)(*match)->data;
@@ -450,9 +448,7 @@ out:
/* Prints out the matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+sctp_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
const struct xt_sctp_info *einfo =
(const struct xt_sctp_info *)match->data;
@@ -483,9 +479,7 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void
-save(const void *ip,
- const struct xt_entry_match *match)
+static void sctp_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_sctp_info *einfo =
(const struct xt_sctp_info *)match->data;
@@ -520,37 +514,37 @@ save(const void *ip,
}
}
-static struct xtables_match sctp = {
+static struct xtables_match sctp_match = {
.name = "sctp",
.family = AF_INET,
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_sctp_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_sctp_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = sctp_help,
+ .init = sctp_init,
+ .parse = sctp_parse,
+ .print = sctp_print,
+ .save = sctp_save,
+ .extra_opts = sctp_opts,
};
-static struct xtables_match sctp6 = {
+static struct xtables_match sctp_match6 = {
.name = "sctp",
.family = AF_INET6,
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_sctp_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_sctp_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = sctp_help,
+ .init = sctp_init,
+ .parse = sctp_parse,
+ .print = sctp_print,
+ .save = sctp_save,
+ .extra_opts = sctp_opts,
};
void _init(void)
{
- xtables_register_match(&sctp);
- xtables_register_match(&sctp6);
+ xtables_register_match(&sctp_match);
+ xtables_register_match(&sctp_match6);
}
Index: iptables/extensions/libxt_standard.c
===================================================================
--- iptables.orig/extensions/libxt_standard.c
+++ iptables/extensions/libxt_standard.c
@@ -8,8 +8,7 @@
#include <xtables.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void standard_help(void)
{
printf(
"Standard v%s options:\n"
@@ -18,38 +17,34 @@ help(void)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int standard_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
return 0;
}
-static
-struct xtables_target standard = {
+static struct xtables_target standard_target = {
.family = AF_INET,
.name = "standard",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(int)),
.userspacesize = XT_ALIGN(sizeof(int)),
- .help = &help,
- .parse = &parse,
+ .help = standard_help,
+ .parse = standard_parse,
};
-static
-struct xtables_target standard6 = {
+static struct xtables_target standard_target6 = {
.family = AF_INET6,
.name = "standard",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(int)),
.userspacesize = XT_ALIGN(sizeof(int)),
- .help = &help,
- .parse = &parse,
+ .help = standard_help,
+ .parse = standard_parse,
};
void _init(void)
{
- xtables_register_target(&standard);
- xtables_register_target(&standard6);
+ xtables_register_target(&standard_target);
+ xtables_register_target(&standard_target6);
}
Index: iptables/extensions/libxt_statistic.c
===================================================================
--- iptables.orig/extensions/libxt_statistic.c
+++ iptables/extensions/libxt_statistic.c
@@ -8,8 +8,7 @@
#include <xtables.h>
#include <linux/netfilter/xt_statistic.h>
-static void
-help(void)
+static void statistic_help(void)
{
printf(
"statistic match v%s options:\n"
@@ -23,7 +22,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option statistic_opts[] = {
{ "mode", 1, NULL, '1' },
{ "probability", 1, NULL, '2' },
{ "every", 1, NULL, '3' },
@@ -34,9 +33,8 @@ static const struct option opts[] = {
static struct xt_statistic_info *info;
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+statistic_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
double prob;
@@ -95,8 +93,7 @@ parse(int c, char **argv, int invert, un
}
/* Final check; must have specified --mark. */
-static void
-final_check(unsigned int flags)
+static void statistic_check(unsigned int flags)
{
if (!(flags & 0x1))
exit_error(PARAMETER_PROBLEM, "no mode specified");
@@ -145,9 +142,7 @@ static void print_match(const struct xt_
}
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+statistic_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
struct xt_statistic_info *info = (struct xt_statistic_info *)match->data;
@@ -156,44 +151,43 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void statistic_save(const void *ip, const struct xt_entry_match *match)
{
struct xt_statistic_info *info = (struct xt_statistic_info *)match->data;
print_match(info, "--");
}
-static struct xtables_match statistic = {
+static struct xtables_match statistic_match = {
.family = AF_INET,
.name = "statistic",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_statistic_info)),
.userspacesize = offsetof(struct xt_statistic_info, u.nth.count),
- .help = help,
- .parse = parse,
- .final_check = final_check,
- .print = print,
- .save = save,
- .extra_opts = opts
+ .help = statistic_help,
+ .parse = statistic_parse,
+ .final_check = statistic_check,
+ .print = statistic_print,
+ .save = statistic_save,
+ .extra_opts = statistic_opts,
};
-static struct xtables_match statistic6 = {
+static struct xtables_match statistic_match6 = {
.family = AF_INET6,
.name = "statistic",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_statistic_info)),
.userspacesize = offsetof(struct xt_statistic_info, u.nth.count),
- .help = help,
- .parse = parse,
- .final_check = final_check,
- .print = print,
- .save = save,
- .extra_opts = opts
+ .help = statistic_help,
+ .parse = statistic_parse,
+ .final_check = statistic_check,
+ .print = statistic_print,
+ .save = statistic_save,
+ .extra_opts = statistic_opts,
};
void _init(void)
{
- xtables_register_match(&statistic);
- xtables_register_match(&statistic6);
+ xtables_register_match(&statistic_match);
+ xtables_register_match(&statistic_match6);
}
Index: iptables/extensions/libxt_string.c
===================================================================
--- iptables.orig/extensions/libxt_string.c
+++ iptables/extensions/libxt_string.c
@@ -31,8 +31,7 @@
#include <linux/netfilter/xt_string.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void string_help(void)
{
printf(
"STRING match v%s options:\n"
@@ -44,7 +43,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option string_opts[] = {
{ "from", 1, NULL, '1' },
{ "to", 1, NULL, '2' },
{ "algo", 1, NULL, '3' },
@@ -53,8 +52,7 @@ static const struct option opts[] = {
{ }
};
-static void
-init(struct xt_entry_match *m)
+static void string_init(struct xt_entry_match *m)
{
struct xt_string_info *i = (struct xt_string_info *) m->data;
@@ -169,9 +167,8 @@ parse_hex_string(const char *s, struct x
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+string_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_string_info *stringinfo = (struct xt_string_info *)(*match)->data;
@@ -229,8 +226,7 @@ parse(int c, char **argv, int invert, un
/* Final check; must have specified --string. */
-static void
-final_check(unsigned int flags)
+static void string_check(unsigned int flags)
{
if (!(flags & STRING))
exit_error(PARAMETER_PROBLEM,
@@ -288,9 +284,7 @@ print_string(const char *str, const unsi
/* Prints out the matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+string_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
const struct xt_string_info *info =
(const struct xt_string_info*) match->data;
@@ -311,8 +305,7 @@ print(const void *ip,
/* Saves the union ipt_matchinfo in parseable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void string_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_string_info *info =
(const struct xt_string_info*) match->data;
@@ -332,39 +325,39 @@ save(const void *ip, const struct xt_ent
}
-static struct xtables_match string = {
+static struct xtables_match string_match = {
.name = "string",
- .family = AF_INET,
+ .family = AF_INET,
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_string_info)),
.userspacesize = offsetof(struct xt_string_info, config),
- .help = help,
- .init = init,
- .parse = parse,
- .final_check = final_check,
- .print = print,
- .save = save,
- .extra_opts = opts
+ .help = string_help,
+ .init = string_init,
+ .parse = string_parse,
+ .final_check = string_check,
+ .print = string_print,
+ .save = string_save,
+ .extra_opts = string_opts,
};
-static struct xtables_match string6 = {
+static struct xtables_match string_match6 = {
.name = "string",
- .family = AF_INET6,
+ .family = AF_INET6,
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_string_info)),
.userspacesize = offsetof(struct xt_string_info, config),
- .help = help,
- .init = init,
- .parse = parse,
- .final_check = final_check,
- .print = print,
- .save = save,
- .extra_opts = opts
+ .help = string_help,
+ .init = string_init,
+ .parse = string_parse,
+ .final_check = string_check,
+ .print = string_print,
+ .save = string_save,
+ .extra_opts = string_opts,
};
void _init(void)
{
- xtables_register_match(&string);
- xtables_register_match(&string6);
+ xtables_register_match(&string_match);
+ xtables_register_match(&string_match6);
}
Index: iptables/extensions/libxt_tcp.c
===================================================================
--- iptables.orig/extensions/libxt_tcp.c
+++ iptables/extensions/libxt_tcp.c
@@ -8,8 +8,7 @@
#include <linux/netfilter/xt_tcpudp.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void tcp_help(void)
{
printf(
"TCP v%s options:\n"
@@ -27,7 +26,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option tcp_opts[] = {
{ "source-port", 1, NULL, '1' },
{ "sport", 1, NULL, '1' }, /* synonym */
{ "destination-port", 1, NULL, '2' },
@@ -130,8 +129,7 @@ parse_tcp_option(const char *option, u_i
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void tcp_init(struct xt_entry_match *m)
{
struct xt_tcp *tcpinfo = (struct xt_tcp *)m->data;
@@ -146,9 +144,8 @@ init(struct xt_entry_match *m)
/* Function which parses command options; returns true if it
ate an option. */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+tcp_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_tcp *tcpinfo = (struct xt_tcp *)(*match)->data;
@@ -310,8 +307,7 @@ print_flags(u_int8_t mask, u_int8_t cmp,
/* Prints out the union ipt_matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+tcp_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
const struct xt_tcp *tcp = (struct xt_tcp *)match->data;
@@ -334,7 +330,7 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void tcp_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_tcp *tcpinfo = (struct xt_tcp *)match->data;
@@ -387,37 +383,37 @@ static void save(const void *ip, const s
}
}
-static struct xtables_match tcp = {
+static struct xtables_match tcp_match = {
.family = AF_INET,
.name = "tcp",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_tcp)),
.userspacesize = XT_ALIGN(sizeof(struct xt_tcp)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = tcp_help,
+ .init = tcp_init,
+ .parse = tcp_parse,
+ .print = tcp_print,
+ .save = tcp_save,
+ .extra_opts = tcp_opts,
};
-static struct xtables_match tcp6 = {
+static struct xtables_match tcp_match6 = {
.family = AF_INET6,
.name = "tcp",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_tcp)),
.userspacesize = XT_ALIGN(sizeof(struct xt_tcp)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = tcp_help,
+ .init = tcp_init,
+ .parse = tcp_parse,
+ .print = tcp_print,
+ .save = tcp_save,
+ .extra_opts = tcp_opts,
};
void
_init(void)
{
- xtables_register_match(&tcp);
- xtables_register_match(&tcp6);
+ xtables_register_match(&tcp_match);
+ xtables_register_match(&tcp_match6);
}
Index: iptables/extensions/libxt_tcpmss.c
===================================================================
--- iptables.orig/extensions/libxt_tcpmss.c
+++ iptables/extensions/libxt_tcpmss.c
@@ -9,8 +9,7 @@
#include <linux/netfilter/xt_tcpmss.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void tcpmss_help(void)
{
printf(
"tcpmss match v%s options:\n"
@@ -19,7 +18,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option tcpmss_opts[] = {
{ "mss", 1, NULL, '1' },
{ }
};
@@ -59,9 +58,8 @@ parse_tcp_mssvalues(const char *mssvalue
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+tcpmss_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_tcpmss_match_info *mssinfo =
(struct xt_tcpmss_match_info *)(*match)->data;
@@ -97,8 +95,7 @@ print_tcpmss(u_int16_t mss_min, u_int16_
}
/* Final check; must have specified --mss. */
-static void
-final_check(unsigned int flags)
+static void tcpmss_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -107,9 +104,7 @@ final_check(unsigned int flags)
/* Prints out the matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+tcpmss_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
const struct xt_tcpmss_match_info *mssinfo =
(const struct xt_tcpmss_match_info *)match->data;
@@ -120,8 +115,7 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void tcpmss_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_tcpmss_match_info *mssinfo =
(const struct xt_tcpmss_match_info *)match->data;
@@ -131,36 +125,36 @@ save(const void *ip, const struct xt_ent
mssinfo->invert, 0);
}
-static struct xtables_match tcpmss = {
+static struct xtables_match tcpmss_match = {
.family = AF_INET,
.name = "tcpmss",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_tcpmss_match_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_tcpmss_match_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = tcpmss_help,
+ .parse = tcpmss_parse,
+ .final_check = tcpmss_check,
+ .print = tcpmss_print,
+ .save = tcpmss_save,
+ .extra_opts = tcpmss_opts,
};
-static struct xtables_match tcpmss6 = {
+static struct xtables_match tcpmss_match6 = {
.family = AF_INET6,
.name = "tcpmss",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_tcpmss_match_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_tcpmss_match_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = tcpmss_help,
+ .parse = tcpmss_parse,
+ .final_check = tcpmss_check,
+ .print = tcpmss_print,
+ .save = tcpmss_save,
+ .extra_opts = tcpmss_opts,
};
void _init(void)
{
- xtables_register_match(&tcpmss);
- xtables_register_match(&tcpmss6);
+ xtables_register_match(&tcpmss_match);
+ xtables_register_match(&tcpmss_match6);
}
Index: iptables/extensions/libxt_time.c
===================================================================
--- iptables.orig/extensions/libxt_time.c
+++ iptables/extensions/libxt_time.c
@@ -463,7 +463,7 @@ static void time_save(const void *ip, co
printf("--utc ");
}
-static struct xtables_match time_reg = {
+static struct xtables_match time_match = {
.name = "time",
.family = AF_INET,
.version = IPTABLES_VERSION,
@@ -477,7 +477,7 @@ static struct xtables_match time_reg = {
.extra_opts = time_opts,
};
-static struct xtables_match time6_reg = {
+static struct xtables_match time_match6 = {
.name = "time",
.family = AF_INET6,
.version = IPTABLES_VERSION,
@@ -493,6 +493,6 @@ static struct xtables_match time6_reg =
void _init(void)
{
- xtables_register_match(&time_reg);
- xtables_register_match(&time6_reg);
+ xtables_register_match(&time_match);
+ xtables_register_match(&time_match6);
}
Index: iptables/extensions/libxt_u32.c
===================================================================
--- iptables.orig/extensions/libxt_u32.c
+++ iptables/extensions/libxt_u32.c
@@ -268,7 +268,7 @@ static void u32_save(const void *ip, con
return;
}
-static struct xtables_match u32_reg = {
+static struct xtables_match u32_match = {
.name = "u32",
.family = AF_INET,
.version = IPTABLES_VERSION,
@@ -281,7 +281,7 @@ static struct xtables_match u32_reg = {
.extra_opts = u32_opts,
};
-static struct xtables_match u32_reg6 = {
+static struct xtables_match u32_match6 = {
.name = "u32",
.family = AF_INET6,
.version = IPTABLES_VERSION,
@@ -296,7 +296,7 @@ static struct xtables_match u32_reg6 = {
void _init(void)
{
- xtables_register_match(&u32_reg);
- xtables_register_match(&u32_reg6);
+ xtables_register_match(&u32_match);
+ xtables_register_match(&u32_match6);
return;
}
Index: iptables/extensions/libxt_udp.c
===================================================================
--- iptables.orig/extensions/libxt_udp.c
+++ iptables/extensions/libxt_udp.c
@@ -8,8 +8,7 @@
#include <linux/netfilter/xt_tcpudp.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void udp_help(void)
{
printf(
"UDP v%s options:\n"
@@ -22,7 +21,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option udp_opts[] = {
{ "source-port", 1, NULL, '1' },
{ "sport", 1, NULL, '1' }, /* synonym */
{ "destination-port", 1, NULL, '2' },
@@ -54,8 +53,7 @@ parse_udp_ports(const char *portstring,
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void udp_init(struct xt_entry_match *m)
{
struct xt_udp *udpinfo = (struct xt_udp *)m->data;
@@ -68,9 +66,8 @@ init(struct xt_entry_match *m)
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+udp_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_udp *udpinfo = (struct xt_udp *)(*match)->data;
@@ -149,8 +146,7 @@ print_ports(const char *name, u_int16_t
/* Prints out the union ipt_matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+udp_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
const struct xt_udp *udp = (struct xt_udp *)match->data;
@@ -167,7 +163,7 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void udp_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_udp *udpinfo = (struct xt_udp *)match->data;
@@ -200,39 +196,37 @@ static void save(const void *ip, const s
}
}
-static
-struct xtables_match udp = {
+static struct xtables_match udp_match = {
.family = AF_INET,
.name = "udp",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_udp)),
.userspacesize = XT_ALIGN(sizeof(struct xt_udp)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = udp_help,
+ .init = udp_init,
+ .parse = udp_parse,
+ .print = udp_print,
+ .save = udp_save,
+ .extra_opts = udp_opts,
};
-static
-struct xtables_match udp6 = {
+static struct xtables_match udp_match6 = {
.family = AF_INET6,
.name = "udp",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_udp)),
.userspacesize = XT_ALIGN(sizeof(struct xt_udp)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = udp_help,
+ .init = udp_init,
+ .parse = udp_parse,
+ .print = udp_print,
+ .save = udp_save,
+ .extra_opts = udp_opts,
};
void
_init(void)
{
- xtables_register_match(&udp);
- xtables_register_match(&udp6);
+ xtables_register_match(&udp_match);
+ xtables_register_match(&udp_match6);
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 08/13] Unique names 2/6
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
` (5 preceding siblings ...)
2007-10-04 10:12 ` [PATCH 07/13] Unique symbols 1/6 Jan Engelhardt
@ 2007-10-04 10:12 ` Jan Engelhardt
2007-10-04 10:13 ` [PATCH 09/13] Unique names 3/6 Jan Engelhardt
` (5 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:12 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Give symbols of libxt targets unique names (1/3).
Adds unique prefixes to all functions (most of them - especially the hook
functions) so that debugging programs can unambiguously map a symbol to an
address. Also unifies the names of the xtables_match/xtables_target structs,
(based upon libxt_connmark.c/libip6t_*.c).
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
---
extensions/libxt_CONNMARK.c | 46 +++++++++-------------
extensions/libxt_CONNSECMARK.c | 51 +++++++++++++-----------
extensions/libxt_DSCP.c | 54 +++++++++++---------------
extensions/libxt_MARK.c | 84 ++++++++++++++++++-----------------------
extensions/libxt_NFLOG.c | 49 +++++++++++------------
extensions/libxt_NFQUEUE.c | 46 ++++++++++------------
extensions/libxt_NOTRACK.c | 28 +++++--------
extensions/libxt_SECMARK.c | 48 +++++++++++------------
extensions/libxt_TCPMSS.c | 80 +++++++++++++++++----------------------
extensions/libxt_TRACE.c | 25 +++++-------
10 files changed, 234 insertions(+), 277 deletions(-)
Index: iptables/extensions/libxt_CONNMARK.c
===================================================================
--- iptables.orig/extensions/libxt_CONNMARK.c
+++ iptables/extensions/libxt_CONNMARK.c
@@ -36,8 +36,7 @@ struct markinfo {
#endif
/* Function which prints out usage message. */
-static void
-help(void)
+static void CONNMARK_help(void)
{
printf(
"CONNMARK target v%s options:\n"
@@ -48,7 +47,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option CONNMARK_opts[] = {
{ "set-mark", 1, NULL, '1' },
{ "save-mark", 0, NULL, '2' },
{ "restore-mark", 0, NULL, '3' },
@@ -59,9 +58,8 @@ static const struct option opts[] = {
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+CONNMARK_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_connmark_target_info *markinfo
= (struct xt_connmark_target_info *)(*target)->data;
@@ -114,8 +112,7 @@ parse(int c, char **argv, int invert, un
return 1;
}
-static void
-final_check(unsigned int flags)
+static void CONNMARK_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -137,10 +134,8 @@ print_mask(const char *text, unsigned lo
/* Prints out the target info. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void CONNMARK_print(const void *ip,
+ const struct xt_entry_target *target, int numeric)
{
const struct xt_connmark_target_info *markinfo =
(const struct xt_connmark_target_info *)target->data;
@@ -167,8 +162,7 @@ print(const void *ip,
}
/* Saves the target into in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void CONNMARK_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_connmark_target_info *markinfo =
(const struct xt_connmark_target_info *)target->data;
@@ -200,12 +194,12 @@ static struct xtables_target connmark_ta
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = CONNMARK_help,
+ .parse = CONNMARK_parse,
+ .final_check = CONNMARK_check,
+ .print = CONNMARK_print,
+ .save = CONNMARK_save,
+ .extra_opts = CONNMARK_opts,
};
static struct xtables_target connmark_target6 = {
@@ -214,12 +208,12 @@ static struct xtables_target connmark_ta
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = CONNMARK_help,
+ .parse = CONNMARK_parse,
+ .final_check = CONNMARK_check,
+ .print = CONNMARK_print,
+ .save = CONNMARK_save,
+ .extra_opts = CONNMARK_opts,
};
void _init(void)
Index: iptables/extensions/libxt_CONNSECMARK.c
===================================================================
--- iptables.orig/extensions/libxt_CONNSECMARK.c
+++ iptables/extensions/libxt_CONNSECMARK.c
@@ -14,7 +14,7 @@
#define PFX "CONNSECMARK target: "
-static void help(void)
+static void CONNSECMARK_help(void)
{
printf(
"CONNSECMARK target v%s options:\n"
@@ -24,14 +24,15 @@ static void help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option CONNSECMARK_opts[] = {
{ "save", 0, 0, '1' },
{ "restore", 0, 0, '2' },
{ 0 }
};
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry, struct xt_entry_target **target)
+static int
+CONNSECMARK_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_connsecmark_target_info *info =
(struct xt_connsecmark_target_info*)(*target)->data;
@@ -60,7 +61,7 @@ static int parse(int c, char **argv, int
return 1;
}
-static void final_check(unsigned int flags)
+static void CONNSECMARK_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM, PFX "parameter required");
@@ -86,8 +87,9 @@ static void print_connsecmark(struct xt_
}
}
-static void print(const void *ip,
- const struct xt_entry_target *target, int numeric)
+static void
+CONNSECMARK_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct xt_connsecmark_target_info *info =
(struct xt_connsecmark_target_info*)(target)->data;
@@ -96,7 +98,8 @@ static void print(const void *ip,
print_connsecmark(info);
}
-static void save(const void *ip, const struct xt_entry_target *target)
+static void
+CONNSECMARK_save(const void *ip, const struct xt_entry_target *target)
{
struct xt_connsecmark_target_info *info =
(struct xt_connsecmark_target_info*)target->data;
@@ -105,38 +108,38 @@ static void save(const void *ip, const s
print_connsecmark(info);
}
-static struct xtables_target connsecmark = {
+static struct xtables_target connsecmark_target = {
.family = AF_INET,
.name = "CONNSECMARK",
.version = IPTABLES_VERSION,
.revision = 0,
.size = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)),
- .parse = &parse,
- .help = &help,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .parse = CONNSECMARK_parse,
+ .help = CONNSECMARK_help,
+ .final_check = CONNSECMARK_check,
+ .print = CONNSECMARK_print,
+ .save = CONNSECMARK_save,
+ .extra_opts = CONNSECMARK_opts,
};
-static struct xtables_target connsecmark6 = {
+static struct xtables_target connsecmark_target6 = {
.family = AF_INET6,
.name = "CONNSECMARK",
.version = IPTABLES_VERSION,
.revision = 0,
.size = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)),
- .parse = &parse,
- .help = &help,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .parse = CONNSECMARK_parse,
+ .help = CONNSECMARK_help,
+ .final_check = CONNSECMARK_check,
+ .print = CONNSECMARK_print,
+ .save = CONNSECMARK_save,
+ .extra_opts = CONNSECMARK_opts,
};
void _init(void)
{
- xtables_register_target(&connsecmark);
- xtables_register_target(&connsecmark6);
+ xtables_register_target(&connsecmark_target);
+ xtables_register_target(&connsecmark_target6);
}
Index: iptables/extensions/libxt_DSCP.c
===================================================================
--- iptables.orig/extensions/libxt_DSCP.c
+++ iptables/extensions/libxt_DSCP.c
@@ -21,7 +21,7 @@
/* This is evil, but it's my code - HW*/
#include "libipt_dscp_helper.c"
-static void help(void)
+static void DSCP_help(void)
{
printf(
"DSCP target options\n"
@@ -37,7 +37,7 @@ static void help(void)
);
}
-static const struct option opts[] = {
+static const struct option DSCP_opts[] = {
{ "set-dscp", 1, NULL, 'F' },
{ "set-dscp-class", 1, NULL, 'G' },
{ }
@@ -71,10 +71,8 @@ parse_class(const char *s, struct xt_DSC
}
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int DSCP_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_DSCP_info *dinfo
= (struct xt_DSCP_info *)(*target)->data;
@@ -102,8 +100,7 @@ parse(int c, char **argv, int invert, un
return 1;
}
-static void
-final_check(unsigned int flags)
+static void DSCP_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -117,10 +114,8 @@ print_dscp(u_int8_t dscp, int numeric)
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void DSCP_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct xt_DSCP_info *dinfo =
(const struct xt_DSCP_info *)target->data;
@@ -129,8 +124,7 @@ print(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void DSCP_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_DSCP_info *dinfo =
(const struct xt_DSCP_info *)target->data;
@@ -138,36 +132,36 @@ save(const void *ip, const struct xt_ent
printf("--set-dscp 0x%02x ", dinfo->dscp);
}
-static struct xtables_target dscp = {
+static struct xtables_target dscp_target = {
.family = AF_INET,
.name = "DSCP",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_DSCP_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_DSCP_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = DSCP_help,
+ .parse = DSCP_parse,
+ .final_check = DSCP_check,
+ .print = DSCP_print,
+ .save = DSCP_save,
+ .extra_opts = DSCP_opts,
};
-static struct xtables_target dscp6 = {
+static struct xtables_target dscp_target6 = {
.family = AF_INET6,
.name = "DSCP",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_DSCP_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_DSCP_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = DSCP_help,
+ .parse = DSCP_parse,
+ .final_check = DSCP_check,
+ .print = DSCP_print,
+ .save = DSCP_save,
+ .extra_opts = DSCP_opts,
};
void _init(void)
{
- xtables_register_target(&dscp);
- xtables_register_target(&dscp6);
+ xtables_register_target(&dscp_target);
+ xtables_register_target(&dscp_target6);
}
Index: iptables/extensions/libxt_MARK.c
===================================================================
--- iptables.orig/extensions/libxt_MARK.c
+++ iptables/extensions/libxt_MARK.c
@@ -9,8 +9,7 @@
#include <linux/netfilter/xt_MARK.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void MARK_help(void)
{
printf(
"MARK target v%s options:\n"
@@ -21,7 +20,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option MARK_opts[] = {
{ "set-mark", 1, NULL, '1' },
{ "and-mark", 1, NULL, '2' },
{ "or-mark", 1, NULL, '3' },
@@ -31,9 +30,8 @@ static const struct option opts[] = {
/* Function which parses command options; returns true if it
ate an option */
static int
-parse_v0(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+MARK_parse_v0(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_mark_target_info *markinfo
= (struct xt_mark_target_info *)(*target)->data;
@@ -61,8 +59,7 @@ parse_v0(int c, char **argv, int invert,
return 1;
}
-static void
-final_check(unsigned int flags)
+static void MARK_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -73,9 +70,8 @@ final_check(unsigned int flags)
/* Function which parses command options; returns true if it
ate an option */
static int
-parse_v1(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+MARK_parse_v1(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_mark_target_info_v1 *markinfo
= (struct xt_mark_target_info_v1 *)(*target)->data;
@@ -112,10 +108,8 @@ print_mark(unsigned long mark)
}
/* Prints out the targinfo. */
-static void
-print_v0(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void MARK_print_v0(const void *ip,
+ const struct xt_entry_target *target, int numeric)
{
const struct xt_mark_target_info *markinfo =
(const struct xt_mark_target_info *)target->data;
@@ -124,8 +118,7 @@ print_v0(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save_v0(const void *ip, const struct xt_entry_target *target)
+static void MARK_save_v0(const void *ip, const struct xt_entry_target *target)
{
const struct xt_mark_target_info *markinfo =
(const struct xt_mark_target_info *)target->data;
@@ -135,10 +128,8 @@ save_v0(const void *ip, const struct xt_
}
/* Prints out the targinfo. */
-static void
-print_v1(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void MARK_print_v1(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct xt_mark_target_info_v1 *markinfo =
(const struct xt_mark_target_info_v1 *)target->data;
@@ -158,8 +149,7 @@ print_v1(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save_v1(const void *ip, const struct xt_entry_target *target)
+static void MARK_save_v1(const void *ip, const struct xt_entry_target *target)
{
const struct xt_mark_target_info_v1 *markinfo =
(const struct xt_mark_target_info_v1 *)target->data;
@@ -178,54 +168,54 @@ save_v1(const void *ip, const struct xt_
print_mark(markinfo->mark);
}
-static struct xtables_target mark_v0 = {
+static struct xtables_target mark_target_v0 = {
.family = AF_INET,
.name = "MARK",
.version = IPTABLES_VERSION,
.revision = 0,
.size = XT_ALIGN(sizeof(struct xt_mark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mark_target_info)),
- .help = &help,
- .parse = &parse_v0,
- .final_check = &final_check,
- .print = &print_v0,
- .save = &save_v0,
- .extra_opts = opts,
+ .help = MARK_help,
+ .parse = MARK_parse_v0,
+ .final_check = MARK_check,
+ .print = MARK_print_v0,
+ .save = MARK_save_v0,
+ .extra_opts = MARK_opts,
};
-static struct xtables_target mark_v1 = {
+static struct xtables_target mark_target_v1 = {
.family = AF_INET,
.name = "MARK",
.version = IPTABLES_VERSION,
.revision = 1,
.size = XT_ALIGN(sizeof(struct xt_mark_target_info_v1)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mark_target_info_v1)),
- .help = &help,
- .parse = &parse_v1,
- .final_check = &final_check,
- .print = &print_v1,
- .save = &save_v1,
- .extra_opts = opts,
+ .help = MARK_help,
+ .parse = MARK_parse_v1,
+ .final_check = MARK_check,
+ .print = MARK_print_v1,
+ .save = MARK_save_v1,
+ .extra_opts = MARK_opts,
};
-static struct xtables_target mark6_v0 = {
+static struct xtables_target mark_target6_v0 = {
.family = AF_INET6,
.name = "MARK",
.version = IPTABLES_VERSION,
.revision = 0,
.size = XT_ALIGN(sizeof(struct xt_mark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mark_target_info)),
- .help = &help,
- .parse = &parse_v0,
- .final_check = &final_check,
- .print = &print_v0,
- .save = &save_v0,
- .extra_opts = opts,
+ .help = MARK_help,
+ .parse = MARK_parse_v0,
+ .final_check = MARK_check,
+ .print = MARK_print_v0,
+ .save = MARK_save_v0,
+ .extra_opts = MARK_opts,
};
void _init(void)
{
- xtables_register_target(&mark_v0);
- xtables_register_target(&mark_v1);
- xtables_register_target(&mark6_v0);
+ xtables_register_target(&mark_target_v0);
+ xtables_register_target(&mark_target_v1);
+ xtables_register_target(&mark_target6_v0);
}
Index: iptables/extensions/libxt_NFLOG.c
===================================================================
--- iptables.orig/extensions/libxt_NFLOG.c
+++ iptables/extensions/libxt_NFLOG.c
@@ -14,7 +14,7 @@ enum {
NFLOG_THRESHOLD = 0x8,
};
-static const struct option opts[] = {
+static const struct option NFLOG_opts[] = {
{ "nflog-group", 1, NULL, NFLOG_GROUP },
{ "nflog-prefix", 1, NULL, NFLOG_PREFIX },
{ "nflog-range", 1, NULL, NFLOG_RANGE },
@@ -22,7 +22,7 @@ static const struct option opts[] = {
{NULL},
};
-static void help(void)
+static void NFLOG_help(void)
{
printf("NFLOG v%s options:\n"
" --nflog-group NUM NETLINK group used for logging\n"
@@ -32,7 +32,7 @@ static void help(void)
IPTABLES_VERSION);
}
-static void init(struct xt_entry_target *t)
+static void NFLOG_init(struct xt_entry_target *t)
{
struct xt_nflog_info *info = (struct xt_nflog_info *)t->data;
@@ -40,9 +40,8 @@ static void init(struct xt_entry_target
info->threshold = XT_NFLOG_DEFAULT_THRESHOLD;
}
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int NFLOG_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_nflog_info *info = (struct xt_nflog_info *)(*target)->data;
int n;
@@ -122,51 +121,51 @@ static void nflog_print(const struct xt_
printf("%snflog-threshold %u ", prefix, info->threshold);
}
-static void print(const void *ip, const struct xt_entry_target *target,
- int numeric)
+static void NFLOG_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct xt_nflog_info *info = (struct xt_nflog_info *)target->data;
nflog_print(info, "");
}
-static void save(const void *ip, const struct xt_entry_target *target)
+static void NFLOG_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_nflog_info *info = (struct xt_nflog_info *)target->data;
nflog_print(info, "--");
}
-static struct xtables_target nflog = {
+static struct xtables_target nflog_target = {
.family = AF_INET,
.name = "NFLOG",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_nflog_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_nflog_info)),
- .help = help,
- .init = init,
- .parse = parse,
- .print = print,
- .save = save,
- .extra_opts = opts,
+ .help = NFLOG_help,
+ .init = NFLOG_init,
+ .parse = NFLOG_parse,
+ .print = NFLOG_print,
+ .save = NFLOG_save,
+ .extra_opts = NFLOG_opts,
};
-static struct xtables_target nflog6 = {
+static struct xtables_target nflog_target6 = {
.family = AF_INET6,
.name = "NFLOG",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_nflog_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_nflog_info)),
- .help = help,
- .init = init,
- .parse = parse,
- .print = print,
- .save = save,
- .extra_opts = opts,
+ .help = NFLOG_help,
+ .init = NFLOG_init,
+ .parse = NFLOG_parse,
+ .print = NFLOG_print,
+ .save = NFLOG_save,
+ .extra_opts = NFLOG_opts,
};
void _init(void)
{
- xtables_register_target(&nflog);
- xtables_register_target(&nflog6);
+ xtables_register_target(&nflog_target);
+ xtables_register_target(&nflog_target6);
}
Index: iptables/extensions/libxt_NFQUEUE.c
===================================================================
--- iptables.orig/extensions/libxt_NFQUEUE.c
+++ iptables/extensions/libxt_NFQUEUE.c
@@ -14,7 +14,7 @@
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/xt_NFQUEUE.h>
-static void help(void)
+static void NFQUEUE_help(void)
{
printf(
"NFQUEUE target options\n"
@@ -23,7 +23,7 @@ static void help(void)
);
}
-static const struct option opts[] = {
+static const struct option NFQUEUE_opts[] = {
{ "queue-num", 1, NULL, 'F' },
{ }
};
@@ -42,9 +42,8 @@ parse_num(const char *s, struct xt_NFQ_i
}
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+NFQUEUE_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_NFQ_info *tinfo
= (struct xt_NFQ_info *)(*target)->data;
@@ -64,10 +63,8 @@ parse(int c, char **argv, int invert, un
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void NFQUEUE_print(const void *ip,
+ const struct xt_entry_target *target, int numeric)
{
const struct xt_NFQ_info *tinfo =
(const struct xt_NFQ_info *)target->data;
@@ -75,8 +72,7 @@ print(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void NFQUEUE_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_NFQ_info *tinfo =
(const struct xt_NFQ_info *)target->data;
@@ -84,34 +80,34 @@ save(const void *ip, const struct xt_ent
printf("--queue-num %u ", tinfo->queuenum);
}
-static struct xtables_target nfqueue = {
+static struct xtables_target nfqueue_target = {
.family = AF_INET,
.name = "NFQUEUE",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_NFQ_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_NFQ_info)),
- .help = &help,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = NFQUEUE_help,
+ .parse = NFQUEUE_parse,
+ .print = NFQUEUE_print,
+ .save = NFQUEUE_save,
+ .extra_opts = NFQUEUE_opts
};
-static struct xtables_target nfqueue6 = {
+static struct xtables_target nfqueue_target6 = {
.family = AF_INET6,
.name = "NFQUEUE",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_NFQ_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_NFQ_info)),
- .help = &help,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = NFQUEUE_help,
+ .parse = NFQUEUE_parse,
+ .print = NFQUEUE_print,
+ .save = NFQUEUE_save,
+ .extra_opts = NFQUEUE_opts,
};
void _init(void)
{
- xtables_register_target(&nfqueue);
- xtables_register_target(&nfqueue6);
+ xtables_register_target(&nfqueue_target);
+ xtables_register_target(&nfqueue_target6);
}
Index: iptables/extensions/libxt_NOTRACK.c
===================================================================
--- iptables.orig/extensions/libxt_NOTRACK.c
+++ iptables/extensions/libxt_NOTRACK.c
@@ -8,8 +8,7 @@
#include <linux/netfilter/x_tables.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void NOTRACK_help(void)
{
printf(
"NOTRACK target v%s takes no options\n",
@@ -19,39 +18,34 @@ IPTABLES_VERSION);
/* Function which parses command options; returns true if it
ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+NOTRACK_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
return 0;
}
-static
-struct xtables_target notrack =
-{
+static struct xtables_target notrack_target = {
.family = AF_INET,
.name = "NOTRACK",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(0),
.userspacesize = XT_ALIGN(0),
- .help = &help,
- .parse = &parse,
+ .help = NOTRACK_help,
+ .parse = NOTRACK_parse,
};
-static
-struct xtables_target notrack6 =
-{
+static struct xtables_target notrack_target6 = {
.family = AF_INET6,
.name = "NOTRACK",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(0),
.userspacesize = XT_ALIGN(0),
- .help = &help,
- .parse = &parse,
+ .help = NOTRACK_help,
+ .parse = NOTRACK_parse,
};
void _init(void)
{
- xtables_register_target(¬rack);
- xtables_register_target(¬rack6);
+ xtables_register_target(¬rack_target);
+ xtables_register_target(¬rack_target6);
}
Index: iptables/extensions/libxt_SECMARK.c
===================================================================
--- iptables.orig/extensions/libxt_SECMARK.c
+++ iptables/extensions/libxt_SECMARK.c
@@ -14,7 +14,7 @@
#define PFX "SECMARK target: "
-static void help(void)
+static void SECMARK_help(void)
{
printf(
"SECMARK target v%s options:\n"
@@ -23,7 +23,7 @@ static void help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option SECMARK_opts[] = {
{ "selctx", 1, 0, '1' },
{ 0 }
};
@@ -32,8 +32,8 @@ static const struct option opts[] = {
* Function which parses command options; returns true if it
* ate an option.
*/
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry, struct xt_entry_target **target)
+static int SECMARK_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_secmark_target_info *info =
(struct xt_secmark_target_info*)(*target)->data;
@@ -61,7 +61,7 @@ static int parse(int c, char **argv, int
return 1;
}
-static void final_check(unsigned int flags)
+static void SECMARK_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM, PFX "parameter required");
@@ -79,8 +79,8 @@ static void print_secmark(struct xt_secm
}
}
-static void print(const void *ip,
- const struct xt_entry_target *target, int numeric)
+static void SECMARK_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct xt_secmark_target_info *info =
(struct xt_secmark_target_info*)(target)->data;
@@ -90,7 +90,7 @@ static void print(const void *ip,
}
/* Saves the target info in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_target *target)
+static void SECMARK_save(const void *ip, const struct xt_entry_target *target)
{
struct xt_secmark_target_info *info =
(struct xt_secmark_target_info*)target->data;
@@ -99,38 +99,38 @@ static void save(const void *ip, const s
print_secmark(info);
}
-static struct xtables_target secmark = {
+static struct xtables_target secmark_target = {
.family = AF_INET,
.name = "SECMARK",
.version = IPTABLES_VERSION,
.revision = 0,
.size = XT_ALIGN(sizeof(struct xt_secmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_secmark_target_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = SECMARK_help,
+ .parse = SECMARK_parse,
+ .final_check = SECMARK_check,
+ .print = SECMARK_print,
+ .save = SECMARK_save,
+ .extra_opts = SECMARK_opts,
};
-static struct xtables_target secmark6 = {
+static struct xtables_target secmark_target6 = {
.family = AF_INET6,
.name = "SECMARK",
.version = IPTABLES_VERSION,
.revision = 0,
.size = XT_ALIGN(sizeof(struct xt_secmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_secmark_target_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = SECMARK_help,
+ .parse = SECMARK_parse,
+ .final_check = SECMARK_check,
+ .print = SECMARK_print,
+ .save = SECMARK_save,
+ .extra_opts = SECMARK_opts,
};
void _init(void)
{
- xtables_register_target(&secmark);
- xtables_register_target(&secmark6);
+ xtables_register_target(&secmark_target);
+ xtables_register_target(&secmark_target6);
}
Index: iptables/extensions/libxt_TCPMSS.c
===================================================================
--- iptables.orig/extensions/libxt_TCPMSS.c
+++ iptables/extensions/libxt_TCPMSS.c
@@ -17,7 +17,7 @@ struct mssinfo {
};
/* Function which prints out usage message. */
-static void __help(int hdrsize)
+static void __TCPMSS_help(int hdrsize)
{
printf(
"TCPMSS target v%s mutually-exclusive options:\n"
@@ -26,17 +26,17 @@ static void __help(int hdrsize)
IPTABLES_VERSION, hdrsize);
}
-static void help(void)
+static void TCPMSS_help(void)
{
- __help(40);
+ __TCPMSS_help(40);
}
-static void help6(void)
+static void TCPMSS_help6(void)
{
- __help(60);
+ __TCPMSS_help(60);
}
-static const struct option opts[] = {
+static const struct option TCPMSS_opts[] = {
{ "set-mss", 1, NULL, '1' },
{ "clamp-mss-to-pmtu", 0, NULL, '2' },
{ }
@@ -44,11 +44,9 @@ static const struct option opts[] = {
/* Function which parses command options; returns true if it
ate an option */
-static int
-__parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target,
- int hdrsize)
+static int __TCPMSS_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target,
+ int hdrsize)
{
struct xt_tcpmss_info *mssinfo
= (struct xt_tcpmss_info *)(*target)->data;
@@ -82,24 +80,19 @@ __parse(int c, char **argv, int invert,
return 1;
}
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int TCPMSS_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
- return __parse(c, argv, invert, flags, entry, target, 40);
+ return __TCPMSS_parse(c, argv, invert, flags, entry, target, 40);
}
-static int
-parse6(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int TCPMSS_parse6(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
- return __parse(c, argv, invert, flags, entry, target, 60);
+ return __TCPMSS_parse(c, argv, invert, flags, entry, target, 60);
}
-static void
-final_check(unsigned int flags)
+static void TCPMSS_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -107,10 +100,8 @@ final_check(unsigned int flags)
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void TCPMSS_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct xt_tcpmss_info *mssinfo =
(const struct xt_tcpmss_info *)target->data;
@@ -121,8 +112,7 @@ print(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void TCPMSS_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_tcpmss_info *mssinfo =
(const struct xt_tcpmss_info *)target->data;
@@ -133,36 +123,36 @@ save(const void *ip, const struct xt_ent
printf("--set-mss %u ", mssinfo->mss);
}
-static struct xtables_target mss = {
+static struct xtables_target tcpmss_target = {
.family = AF_INET,
.name = "TCPMSS",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_tcpmss_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_tcpmss_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = TCPMSS_help,
+ .parse = TCPMSS_parse,
+ .final_check = TCPMSS_check,
+ .print = TCPMSS_print,
+ .save = TCPMSS_save,
+ .extra_opts = TCPMSS_opts,
};
-static struct xtables_target mss6 = {
+static struct xtables_target tcpmss_target6 = {
.family = AF_INET6,
.name = "TCPMSS",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_tcpmss_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_tcpmss_info)),
- .help = &help6,
- .parse = &parse6,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = TCPMSS_help6,
+ .parse = TCPMSS_parse6,
+ .final_check = TCPMSS_check,
+ .print = TCPMSS_print,
+ .save = TCPMSS_save,
+ .extra_opts = TCPMSS_opts,
};
void _init(void)
{
- xtables_register_target(&mss);
- xtables_register_target(&mss6);
+ xtables_register_target(&tcpmss_target);
+ xtables_register_target(&tcpmss_target6);
}
Index: iptables/extensions/libxt_TRACE.c
===================================================================
--- iptables.orig/extensions/libxt_TRACE.c
+++ iptables/extensions/libxt_TRACE.c
@@ -8,8 +8,7 @@
#include <linux/netfilter/x_tables.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void TRACE_help(void)
{
printf(
"TRACE target v%s takes no options\n",
@@ -18,36 +17,34 @@ IPTABLES_VERSION);
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int TRACE_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
return 0;
}
-static struct xtables_target trace = {
+static struct xtables_target trace_target = {
.family = AF_INET,
.name = "TRACE",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(0),
.userspacesize = XT_ALIGN(0),
- .help = &help,
- .parse = &parse,
+ .help = TRACE_help,
+ .parse = TRACE_parse,
};
-static struct xtables_target trace6 = {
+static struct xtables_target trace_target6 = {
.family = AF_INET6,
.name = "TRACE",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(0),
.userspacesize = XT_ALIGN(0),
- .help = &help,
- .parse = &parse,
+ .help = TRACE_help,
+ .parse = TRACE_parse,
};
void _init(void)
{
- xtables_register_target(&trace);
- xtables_register_target(&trace6);
+ xtables_register_target(&trace_target);
+ xtables_register_target(&trace_target6);
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 09/13] Unique names 3/6
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
` (6 preceding siblings ...)
2007-10-04 10:12 ` [PATCH 08/13] Unique names 2/6 Jan Engelhardt
@ 2007-10-04 10:13 ` Jan Engelhardt
2007-10-04 10:13 ` [PATCH 10/13] Unique names 4/6 Jan Engelhardt
` (4 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:13 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Give symbols of libxt matches unique names (2/3).
Adds unique prefixes to all functions (most of them - especially the hook
functions) so that debugging programs can unambiguously map a symbol to an
address. Also unifies the names of the xtables_match/xtables_target structs,
(based upon libxt_connmark.c/libip6t_*.c).
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
---
extensions/libipt_addrtype.c | 41 ++++++++++++++++++---------------------
extensions/libipt_ah.c | 37 +++++++++++++++--------------------
extensions/libipt_condition.c | 44 +++++++++++++++---------------------------
extensions/libipt_conntrack.c | 40 +++++++++++++++-----------------------
extensions/libipt_ecn.c | 41 ++++++++++++++++-----------------------
extensions/libipt_icmp.c | 38 +++++++++++++++---------------------
extensions/libipt_iprange.c | 39 +++++++++++++++----------------------
extensions/libipt_owner.c | 39 +++++++++++++++----------------------
extensions/libipt_policy.c | 34 +++++++++++++++-----------------
extensions/libipt_realm.c | 39 +++++++++++++++----------------------
extensions/libipt_recent.c | 44 +++++++++++++++++-------------------------
extensions/libipt_set.c | 41 +++++++++++++++++----------------------
extensions/libipt_tos.c | 39 +++++++++++++++----------------------
extensions/libipt_ttl.c | 35 +++++++++++++++------------------
extensions/libipt_unclean.c | 18 ++++++-----------
15 files changed, 239 insertions(+), 330 deletions(-)
Index: iptables/extensions/libipt_addrtype.c
===================================================================
--- iptables.orig/extensions/libipt_addrtype.c
+++ iptables/extensions/libipt_addrtype.c
@@ -28,7 +28,7 @@ static const char *const rtn_names[] = {
NULL
};
-static void help_types(void)
+static void addrtype_help_types(void)
{
int i;
@@ -36,7 +36,7 @@ static void help_types(void)
printf(" %s\n", rtn_names[i]);
}
-static void help(void)
+static void addrtype_help(void)
{
printf(
"Address type match v%s options:\n"
@@ -45,7 +45,7 @@ static void help(void)
"\n"
"Valid types: \n"
, IPTABLES_VERSION);
- help_types();
+ addrtype_help_types();
}
static int
@@ -81,9 +81,9 @@ static void parse_types(const char *arg,
#define IPT_ADDRTYPE_OPT_SRCTYPE 0x1
#define IPT_ADDRTYPE_OPT_DSTTYPE 0x2
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int
+addrtype_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_addrtype_info *info =
(struct ipt_addrtype_info *) (*match)->data;
@@ -116,7 +116,7 @@ static int parse(int c, char **argv, int
return 1;
}
-static void final_check(unsigned int flags)
+static void addrtype_check(unsigned int flags)
{
if (!(flags & (IPT_ADDRTYPE_OPT_SRCTYPE|IPT_ADDRTYPE_OPT_DSTTYPE)))
exit_error(PARAMETER_PROBLEM,
@@ -137,9 +137,8 @@ static void print_types(u_int16_t mask)
printf(" ");
}
-static void print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void addrtype_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ipt_addrtype_info *info =
(struct ipt_addrtype_info *) match->data;
@@ -159,8 +158,7 @@ static void print(const void *ip,
}
}
-static void save(const void *ip,
- const struct xt_entry_match *match)
+static void addrtype_save(const void *ip, const struct xt_entry_match *match)
{
const struct ipt_addrtype_info *info =
(struct ipt_addrtype_info *) match->data;
@@ -179,28 +177,27 @@ static void save(const void *ip,
}
}
-static const struct option opts[] = {
+static const struct option addrtype_opts[] = {
{ "src-type", 1, NULL, '1' },
{ "dst-type", 1, NULL, '2' },
{ }
};
-static
-struct iptables_match addrtype = {
+static struct iptables_match addrtype_match = {
.name = "addrtype",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_addrtype_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_addrtype_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = addrtype_help,
+ .parse = addrtype_parse,
+ .final_check = addrtype_check,
+ .print = addrtype_print,
+ .save = addrtype_save,
+ .extra_opts = addrtype_opts,
};
void _init(void)
{
- register_match(&addrtype);
+ register_match(&addrtype_match);
}
Index: iptables/extensions/libipt_ah.c
===================================================================
--- iptables.orig/extensions/libipt_ah.c
+++ iptables/extensions/libipt_ah.c
@@ -9,8 +9,7 @@
#include <linux/netfilter_ipv4/ipt_ah.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void ah_help(void)
{
printf(
"AH v%s options:\n"
@@ -19,7 +18,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option ah_opts[] = {
{ "ahspi", 1, NULL, '1' },
{ }
};
@@ -67,8 +66,7 @@ parse_ah_spis(const char *spistring, u_i
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void ah_init(struct xt_entry_match *m)
{
struct ipt_ah *ahinfo = (struct ipt_ah *)m->data;
@@ -79,10 +77,8 @@ init(struct xt_entry_match *m)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int ah_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_ah *ahinfo = (struct ipt_ah *)(*match)->data;
@@ -126,9 +122,8 @@ print_spis(const char *name, u_int32_t m
}
/* Prints out the union ipt_matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+static void ah_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ipt_ah *ah = (struct ipt_ah *)match->data;
@@ -141,7 +136,7 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void ah_save(const void *ip, const struct xt_entry_match *match)
{
const struct ipt_ah *ahinfo = (struct ipt_ah *)match->data;
@@ -161,21 +156,21 @@ static void save(const void *ip, const s
}
-static struct iptables_match ah = {
+static struct iptables_match ah_match = {
.name = "ah",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_ah)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_ah)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = ah_help,
+ .init = ah_init,
+ .parse = ah_parse,
+ .print = ah_print,
+ .save = ah_save,
+ .extra_opts = ah_opts,
};
void
_init(void)
{
- register_match(&ah);
+ register_match(&ah_match);
}
Index: iptables/extensions/libipt_condition.c
===================================================================
--- iptables.orig/extensions/libipt_condition.c
+++ iptables/extensions/libipt_condition.c
@@ -8,9 +8,7 @@
#include<linux/netfilter_ipv4/ip_tables.h>
#include<linux/netfilter_ipv4/ipt_condition.h>
-
-static void
-help(void)
+static void condition_help(void)
{
printf("condition match v%s options:\n"
"--condition [!] filename "
@@ -18,16 +16,13 @@ help(void)
IPTABLES_VERSION);
}
-
-static const struct option opts[] = {
+static const struct option condition_opts[] = {
{ .name = "condition", .has_arg = 1, .flag = 0, .val = 'X' },
{ .name = 0 }
};
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int condition_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct condition_info *info =
(struct condition_info *) (*match)->data;
@@ -53,19 +48,15 @@ parse(int c, char **argv, int invert, un
return 0;
}
-
-static void
-final_check(unsigned int flags)
+static void condition_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
"Condition match: must specify --condition");
}
-
-static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+static void condition_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct condition_info *info =
(const struct condition_info *) match->data;
@@ -74,9 +65,7 @@ print(const void *ip,
}
-static void
-save(const void *ip,
- const struct xt_entry_match *match)
+static void condition_save(const void *ip, const struct xt_entry_match *match)
{
const struct condition_info *info =
(const struct condition_info *) match->data;
@@ -84,23 +73,22 @@ save(const void *ip,
printf("--condition %s\"%s\" ", (info->invert) ? "! " : "", info->name);
}
-
-static struct iptables_match condition = {
+static struct iptables_match condition_match = {
.name = "condition",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct condition_info)),
.userspacesize = IPT_ALIGN(sizeof(struct condition_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = condition_help,
+ .parse = condition_parse,
+ .final_check = condition_check,
+ .print = condition_print,
+ .save = condition_save,
+ .extra_opts = condition_opts,
};
void
_init(void)
{
- register_match(&condition);
+ register_match(&condition_match);
}
Index: iptables/extensions/libipt_conntrack.c
===================================================================
--- iptables.orig/extensions/libipt_conntrack.c
+++ iptables/extensions/libipt_conntrack.c
@@ -18,8 +18,7 @@
#endif
/* Function which prints out usage message. */
-static void
-help(void)
+static void conntrack_help(void)
{
printf(
"conntrack match v%s options:\n"
@@ -41,9 +40,7 @@ help(void)
"\n", IPTABLES_VERSION);
}
-
-
-static const struct option opts[] = {
+static const struct option conntrack_opts[] = {
{ "ctstate", 1, NULL, '1' },
{ "ctproto", 1, NULL, '2' },
{ "ctorigsrc", 1, NULL, '3' },
@@ -165,10 +162,8 @@ parse_expires(const char *s, struct ipt_
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int conntrack_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_conntrack_info *sinfo = (struct ipt_conntrack_info *)(*match)->data;
char *protocol = NULL;
@@ -316,8 +311,7 @@ parse(int c, char **argv, int invert, un
return 1;
}
-static void
-final_check(unsigned int flags)
+static void conntrack_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM, "You must specify one or more options");
@@ -489,34 +483,32 @@ matchinfo_print(const void *ip, const st
}
/* Prints out the matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void conntrack_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
matchinfo_print(ip, match, numeric, "");
}
/* Saves the matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void conntrack_save(const void *ip, const struct xt_entry_match *match)
{
matchinfo_print(ip, match, 1, "--");
}
-static struct iptables_match conntrack = {
+static struct iptables_match conntrack_match = {
.name = "conntrack",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_conntrack_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_conntrack_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = conntrack_help,
+ .parse = conntrack_parse,
+ .final_check = conntrack_check,
+ .print = conntrack_print,
+ .save = conntrack_save,
+ .extra_opts = conntrack_opts,
};
void _init(void)
{
- register_match(&conntrack);
+ register_match(&conntrack_match);
}
Index: iptables/extensions/libipt_ecn.c
===================================================================
--- iptables.orig/extensions/libipt_ecn.c
+++ iptables/extensions/libipt_ecn.c
@@ -16,7 +16,7 @@
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv4/ipt_ecn.h>
-static void help(void)
+static void ecn_help(void)
{
printf(
"ECN match v%s options\n"
@@ -26,17 +26,15 @@ static void help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option ecn_opts[] = {
{ .name = "ecn-tcp-cwr", .has_arg = 0, .val = 'F' },
{ .name = "ecn-tcp-ece", .has_arg = 0, .val = 'G' },
{ .name = "ecn-ip-ect", .has_arg = 1, .val = 'H' },
{ }
};
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int ecn_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
unsigned int result;
struct ipt_ecn_info *einfo
@@ -86,8 +84,7 @@ parse(int c, char **argv, int invert, un
return 1;
}
-static void
-final_check(unsigned int flags)
+static void ecn_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -95,10 +92,8 @@ final_check(unsigned int flags)
}
/* Prints out the matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void ecn_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ipt_ecn_info *einfo =
(const struct ipt_ecn_info *)match->data;
@@ -125,8 +120,7 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void ecn_save(const void *ip, const struct xt_entry_match *match)
{
const struct ipt_ecn_info *einfo =
(const struct ipt_ecn_info *)match->data;
@@ -150,21 +144,20 @@ save(const void *ip, const struct xt_ent
}
}
-static
-struct iptables_match ecn
-= { .name = "ecn",
+static struct iptables_match ecn_match = {
+ .name = "ecn",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_ecn_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_ecn_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = ecn_help,
+ .parse = ecn_parse,
+ .final_check = ecn_check,
+ .print = ecn_print,
+ .save = ecn_save,
+ .extra_opts = ecn_opts,
};
void _init(void)
{
- register_match(&ecn);
+ register_match(&ecn_match);
}
Index: iptables/extensions/libipt_icmp.c
===================================================================
--- iptables.orig/extensions/libipt_icmp.c
+++ iptables/extensions/libipt_icmp.c
@@ -98,8 +98,7 @@ print_icmptypes(void)
}
/* Function which prints out usage message. */
-static void
-help(void)
+static void icmp_help(void)
{
printf(
"ICMP v%s options:\n"
@@ -109,7 +108,7 @@ help(void)
print_icmptypes();
}
-static const struct option opts[] = {
+static const struct option icmp_opts[] = {
{ "icmp-type", 1, NULL, '1' },
{ }
};
@@ -168,8 +167,7 @@ parse_icmp(const char *icmptype, u_int8_
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void icmp_init(struct xt_entry_match *m)
{
struct ipt_icmp *icmpinfo = (struct ipt_icmp *)m->data;
@@ -179,10 +177,8 @@ init(struct xt_entry_match *m)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int icmp_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_icmp *icmpinfo = (struct ipt_icmp *)(*match)->data;
@@ -244,10 +240,8 @@ static void print_icmptype(u_int8_t type
}
/* Prints out the union ipt_matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void icmp_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ipt_icmp *icmp = (struct ipt_icmp *)match->data;
@@ -262,7 +256,7 @@ print(const void *ip,
}
/* Saves the match in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void icmp_save(const void *ip, const struct xt_entry_match *match)
{
const struct ipt_icmp *icmp = (struct ipt_icmp *)match->data;
@@ -280,20 +274,20 @@ static void save(const void *ip, const s
}
}
-static struct iptables_match icmp = {
+static struct iptables_match icmp_match = {
.name = "icmp",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_icmp)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_icmp)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = icmp_help,
+ .init = icmp_init,
+ .parse = icmp_parse,
+ .print = icmp_print,
+ .save = icmp_save,
+ .extra_opts = icmp_opts,
};
void _init(void)
{
- register_match(&icmp);
+ register_match(&icmp_match);
}
Index: iptables/extensions/libipt_iprange.c
===================================================================
--- iptables.orig/extensions/libipt_iprange.c
+++ iptables/extensions/libipt_iprange.c
@@ -9,8 +9,7 @@
#include <linux/netfilter_ipv4/ipt_iprange.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void iprange_help(void)
{
printf(
"iprange match v%s options:\n"
@@ -20,7 +19,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option iprange_opts[] = {
{ "src-range", 1, NULL, '1' },
{ "dst-range", 1, NULL, '2' },
{ }
@@ -54,10 +53,8 @@ parse_iprange(char *arg, struct ipt_ipra
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int iprange_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_iprange_info *info = (struct ipt_iprange_info *)(*match)->data;
@@ -99,8 +96,7 @@ parse(int c, char **argv, int invert, un
}
/* Final check; must have specified --src-range or --dst-range. */
-static void
-final_check(unsigned int flags)
+static void iprange_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -120,10 +116,8 @@ print_iprange(const struct ipt_iprange *
}
/* Prints out the info. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void iprange_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
struct ipt_iprange_info *info = (struct ipt_iprange_info *)match->data;
@@ -142,8 +136,7 @@ print(const void *ip,
}
/* Saves the union ipt_info in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void iprange_save(const void *ip, const struct xt_entry_match *match)
{
struct ipt_iprange_info *info = (struct ipt_iprange_info *)match->data;
@@ -163,20 +156,20 @@ save(const void *ip, const struct xt_ent
}
}
-static struct iptables_match iprange = {
+static struct iptables_match iprange_match = {
.name = "iprange",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_iprange_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_iprange_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = iprange_help,
+ .parse = iprange_parse,
+ .final_check = iprange_check,
+ .print = iprange_print,
+ .save = iprange_save,
+ .extra_opts = iprange_opts,
};
void _init(void)
{
- register_match(&iprange);
+ register_match(&iprange_match);
}
Index: iptables/extensions/libipt_owner.c
===================================================================
--- iptables.orig/extensions/libipt_owner.c
+++ iptables/extensions/libipt_owner.c
@@ -11,8 +11,7 @@
#include <linux/netfilter_ipv4/ipt_owner.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void owner_help(void)
{
#ifdef IPT_OWNER_COMM
printf(
@@ -38,7 +37,7 @@ IPTABLES_VERSION);
#endif /* IPT_OWNER_COMM */
}
-static const struct option opts[] = {
+static const struct option owner_opts[] = {
{ "uid-owner", 1, NULL, '1' },
{ "gid-owner", 1, NULL, '2' },
{ "pid-owner", 1, NULL, '3' },
@@ -51,10 +50,8 @@ static const struct option opts[] = {
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int owner_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_owner_info *ownerinfo = (struct ipt_owner_info *)(*match)->data;
@@ -189,8 +186,7 @@ print_item(struct ipt_owner_info *info,
}
/* Final check; must have specified --own. */
-static void
-final_check(unsigned int flags)
+static void owner_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -198,10 +194,8 @@ final_check(unsigned int flags)
}
/* Prints out the matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void owner_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
struct ipt_owner_info *info = (struct ipt_owner_info *)match->data;
@@ -215,8 +209,7 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void owner_save(const void *ip, const struct xt_entry_match *match)
{
struct ipt_owner_info *info = (struct ipt_owner_info *)match->data;
@@ -229,20 +222,20 @@ save(const void *ip, const struct xt_ent
#endif
}
-static struct iptables_match owner = {
+static struct iptables_match owner_match = {
.name = "owner",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_owner_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_owner_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = owner_help,
+ .parse = owner_parse,
+ .final_check = owner_check,
+ .print = owner_print,
+ .save = owner_save,
+ .extra_opts = owner_opts,
};
void _init(void)
{
- register_match(&owner);
+ register_match(&owner_match);
}
Index: iptables/extensions/libipt_policy.c
===================================================================
--- iptables.orig/extensions/libipt_policy.c
+++ iptables/extensions/libipt_policy.c
@@ -21,7 +21,7 @@
*/
static struct ipt_policy_info *policy_info;
-static void help(void)
+static void policy_help(void)
{
printf(
"policy v%s options:\n"
@@ -40,7 +40,7 @@ static void help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] =
+static const struct option policy_opts[] =
{
{
.name = "dir",
@@ -120,9 +120,8 @@ static int parse_mode(char *s)
exit_error(PARAMETER_PROBLEM, "policy match: invalid mode `%s'", s);
}
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_policy_info *info = (void *)(*match)->data;
struct ipt_policy_elem *e = &info->pol[info->len];
@@ -249,7 +248,7 @@ static int parse(int c, char **argv, int
return 1;
}
-static void final_check(unsigned int flags)
+static void policy_check(unsigned int flags)
{
struct ipt_policy_info *info = policy_info;
struct ipt_policy_elem *e;
@@ -381,9 +380,8 @@ static void print_flags(char *prefix, co
printf("%sstrict ", prefix);
}
-static void print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void policy_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ipt_policy_info *info = (void *)match->data;
unsigned int i;
@@ -397,7 +395,7 @@ static void print(const void *ip,
}
}
-static void save(const void *ip, const struct xt_entry_match *match)
+static void policy_save(const void *ip, const struct xt_entry_match *match)
{
const struct ipt_policy_info *info = (void *)match->data;
unsigned int i;
@@ -410,20 +408,20 @@ static void save(const void *ip, const s
}
}
-static struct iptables_match policy = {
+static struct iptables_match policy_match = {
.name = "policy",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_policy_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_policy_info)),
- .help = help,
- .parse = parse,
- .final_check = final_check,
- .print = print,
- .save = save,
- .extra_opts = opts
+ .help = policy_help,
+ .parse = policy_parse,
+ .final_check = policy_check,
+ .print = policy_print,
+ .save = policy_save,
+ .extra_opts = policy_opts,
};
void _init(void)
{
- register_match(&policy);
+ register_match(&policy_match);
}
Index: iptables/extensions/libipt_realm.c
===================================================================
--- iptables.orig/extensions/libipt_realm.c
+++ iptables/extensions/libipt_realm.c
@@ -15,8 +15,7 @@
#include <linux/netfilter_ipv4/ipt_realm.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void realm_help(void)
{
printf(
"realm v%s options:\n"
@@ -25,7 +24,7 @@ help(void)
"\n", IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option realm_opts[] = {
{ "realm", 1, NULL, '1' },
{ }
};
@@ -154,10 +153,8 @@ static const char *realm_id2name(int id)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int realm_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_realm_info *realminfo = (struct ipt_realm_info *)(*match)->data;
int id;
@@ -213,10 +210,8 @@ print_realm(unsigned long id, unsigned l
}
/* Prints out the matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void realm_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
struct ipt_realm_info *ri = (struct ipt_realm_info *) match->data;
@@ -229,8 +224,7 @@ print(const void *ip,
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void realm_save(const void *ip, const struct xt_entry_match *match)
{
struct ipt_realm_info *ri = (struct ipt_realm_info *) match->data;
@@ -242,30 +236,29 @@ save(const void *ip, const struct xt_ent
}
/* Final check; must have specified --mark. */
-static void
-final_check(unsigned int flags)
+static void realm_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
"realm match: You must specify `--realm'");
}
-static struct iptables_match realm = {
+static struct iptables_match realm_match = {
.name = "realm",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_realm_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_realm_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = realm_help,
+ .parse = realm_parse,
+ .final_check = realm_check,
+ .print = realm_print,
+ .save = realm_save,
+ .extra_opts = realm_opts,
};
void _init(void)
{
- register_match(&realm);
+ register_match(&realm_match);
}
Index: iptables/extensions/libipt_recent.c
===================================================================
--- iptables.orig/extensions/libipt_recent.c
+++ iptables/extensions/libipt_recent.c
@@ -22,7 +22,7 @@
#endif /* IPT_RECENT_NAME_LEN */
/* Options for this module */
-static const struct option opts[] = {
+static const struct option recent_opts[] = {
{ .name = "set", .has_arg = 0, .val = 201 },
{ .name = "rcheck", .has_arg = 0, .val = 202 },
{ .name = "update", .has_arg = 0, .val = 203 },
@@ -37,8 +37,7 @@ static const struct option opts[] = {
};
/* Function which prints out usage message. */
-static void
-help(void)
+static void recent_help(void)
{
printf(
"recent v%s options:\n"
@@ -67,8 +66,7 @@ IPTABLES_VERSION);
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *match)
+static void recent_init(struct xt_entry_match *match)
{
struct ipt_recent_info *info = (struct ipt_recent_info *)(match)->data;
@@ -82,10 +80,8 @@ init(struct xt_entry_match *match)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int recent_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_recent_info *info = (struct ipt_recent_info *)(*match)->data;
switch (c) {
@@ -162,8 +158,7 @@ parse(int c, char **argv, int invert, un
}
/* Final check; must have specified a specific option. */
-static void
-final_check(unsigned int flags)
+static void recent_check(unsigned int flags)
{
if (!flags)
@@ -173,10 +168,8 @@ final_check(unsigned int flags)
}
/* Prints out the matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void recent_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
struct ipt_recent_info *info = (struct ipt_recent_info *)match->data;
@@ -197,8 +190,7 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void recent_save(const void *ip, const struct xt_entry_match *match)
{
struct ipt_recent_info *info = (struct ipt_recent_info *)match->data;
@@ -218,21 +210,21 @@ save(const void *ip, const struct xt_ent
}
/* Structure for iptables to use to communicate with module */
-static struct iptables_match recent = {
+static struct iptables_match recent_match = {
.name = "recent",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_recent_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_recent_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = recent_help,
+ .init = recent_init,
+ .parse = recent_parse,
+ .final_check = recent_check,
+ .print = recent_print,
+ .save = recent_save,
+ .extra_opts = recent_opts,
};
void _init(void)
{
- register_match(&recent);
+ register_match(&recent_match);
}
Index: iptables/extensions/libipt_set.c
===================================================================
--- iptables.orig/extensions/libipt_set.c
+++ iptables/extensions/libipt_set.c
@@ -22,7 +22,7 @@
#include "libipt_set.h"
/* Function which prints out usage message. */
-static void help(void)
+static void set_help(void)
{
printf("set v%s options:\n"
" [!] --set name flags\n"
@@ -32,13 +32,13 @@ static void help(void)
"\n", IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option set_opts[] = {
{"set", 1, 0, '1'},
{0}
};
/* Initialize the match. */
-static void init(struct xt_entry_match *match)
+static void set_init(struct xt_entry_match *match)
{
struct ipt_set_info_match *info =
(struct ipt_set_info_match *) match->data;
@@ -49,10 +49,8 @@ static void init(struct xt_entry_match *
}
/* Function which parses command options; returns true if it ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int set_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_set_info_match *myinfo =
(struct ipt_set_info_match *) (*match)->data;
@@ -95,7 +93,7 @@ parse(int c, char **argv, int invert, un
}
/* Final check; must have specified --set. */
-static void final_check(unsigned int flags)
+static void set_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -125,9 +123,8 @@ print_match(const char *prefix, const st
}
/* Prints out the matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+static void set_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
struct ipt_set_info_match *info =
(struct ipt_set_info_match *) match->data;
@@ -136,8 +133,7 @@ print(const void *ip,
}
/* Saves the matchinfo in parsable form to stdout. */
-static void save(const void *ip,
- const struct xt_entry_match *match)
+static void set_save(const void *ip, const struct xt_entry_match *match)
{
struct ipt_set_info_match *info =
(struct ipt_set_info_match *) match->data;
@@ -145,22 +141,21 @@ static void save(const void *ip,
print_match("--set", &info->match_set);
}
-static
-struct iptables_match set = {
+static struct iptables_match set_match = {
.name = "set",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_set_info_match)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_set_info_match)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = set_help,
+ .init = set_init,
+ .parse = set_parse,
+ .final_check = set_check,
+ .print = set_print,
+ .save = set_save,
+ .extra_opts = set_opts,
};
void _init(void)
{
- register_match(&set);
+ register_match(&set_match);
}
Index: iptables/extensions/libipt_tos.c
===================================================================
--- iptables.orig/extensions/libipt_tos.c
+++ iptables/extensions/libipt_tos.c
@@ -23,8 +23,7 @@ struct TOS_value
};
/* Function which prints out usage message. */
-static void
-help(void)
+static void tos_help(void)
{
unsigned int i;
@@ -42,7 +41,7 @@ IPTABLES_VERSION);
fputc('\n', stdout);
}
-static const struct option opts[] = {
+static const struct option tos_opts[] = {
{ "tos", 1, NULL, '1' },
{ }
};
@@ -74,10 +73,8 @@ parse_tos(const char *s, struct ipt_tos_
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int tos_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_tos_info *tosinfo = (struct ipt_tos_info *)(*match)->data;
@@ -117,8 +114,7 @@ print_tos(u_int8_t tos, int numeric)
}
/* Final check; must have specified --tos. */
-static void
-final_check(unsigned int flags)
+static void tos_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -126,10 +122,8 @@ final_check(unsigned int flags)
}
/* Prints out the matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void tos_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ipt_tos_info *info = (const struct ipt_tos_info *)match->data;
@@ -140,8 +134,7 @@ print(const void *ip,
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void tos_save(const void *ip, const struct xt_entry_match *match)
{
const struct ipt_tos_info *info = (const struct ipt_tos_info *)match->data;
@@ -151,20 +144,20 @@ save(const void *ip, const struct xt_ent
print_tos(info->tos, 0);
}
-static struct iptables_match tos = {
+static struct iptables_match tos_match = {
.name = "tos",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_tos_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_tos_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = tos_help,
+ .parse = tos_parse,
+ .final_check = tos_check,
+ .print = tos_print,
+ .save = tos_save,
+ .extra_opts = tos_opts,
};
void _init(void)
{
- register_match(&tos);
+ register_match(&tos_match);
}
Index: iptables/extensions/libipt_ttl.c
===================================================================
--- iptables.orig/extensions/libipt_ttl.c
+++ iptables/extensions/libipt_ttl.c
@@ -14,7 +14,7 @@
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv4/ipt_ttl.h>
-static void help(void)
+static void ttl_help(void)
{
printf(
"TTL match v%s options:\n"
@@ -24,9 +24,8 @@ static void help(void)
, IPTABLES_VERSION);
}
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int ttl_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_ttl_info *info = (struct ipt_ttl_info *) (*match)->data;
unsigned int value;
@@ -84,7 +83,7 @@ static int parse(int c, char **argv, int
return 1;
}
-static void final_check(unsigned int flags)
+static void ttl_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -92,9 +91,8 @@ static void final_check(unsigned int fla
"`--ttl-eq', `--ttl-lt', `--ttl-gt");
}
-static void print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void ttl_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ipt_ttl_info *info =
(struct ipt_ttl_info *) match->data;
@@ -117,8 +115,7 @@ static void print(const void *ip,
printf("%u ", info->ttl);
}
-static void save(const void *ip,
- const struct xt_entry_match *match)
+static void ttl_save(const void *ip, const struct xt_entry_match *match)
{
const struct ipt_ttl_info *info =
(struct ipt_ttl_info *) match->data;
@@ -143,7 +140,7 @@ static void save(const void *ip,
printf("%u ", info->ttl);
}
-static const struct option opts[] = {
+static const struct option ttl_opts[] = {
{ "ttl", 1, NULL, '2' },
{ "ttl-eq", 1, NULL, '2'},
{ "ttl-lt", 1, NULL, '3'},
@@ -151,21 +148,21 @@ static const struct option opts[] = {
{ }
};
-static struct iptables_match ttl = {
+static struct iptables_match ttl_match = {
.name = "ttl",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_ttl_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_ttl_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = ttl_help,
+ .parse = ttl_parse,
+ .final_check = ttl_check,
+ .print = ttl_print,
+ .save = ttl_save,
+ .extra_opts = ttl_opts,
};
void _init(void)
{
- register_match(&ttl);
+ register_match(&ttl_match);
}
Index: iptables/extensions/libipt_unclean.c
===================================================================
--- iptables.orig/extensions/libipt_unclean.c
+++ iptables/extensions/libipt_unclean.c
@@ -5,8 +5,7 @@
#include <iptables.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void unclean_help(void)
{
printf(
"unclean v%s takes no options\n"
@@ -15,25 +14,22 @@ help(void)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int unclean_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
return 0;
}
-static
-struct iptables_match unclean = {
+static struct iptables_match unclean_match = {
.name = "unclean",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(0),
.userspacesize = IPT_ALIGN(0),
- .help = &help,
- .parse = &parse,
+ .help = unclean_help,
+ .parse = unclean_parse,
};
void _init(void)
{
- register_match(&unclean);
+ register_match(&unclean_match);
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 10/13] Unique names 4/6
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
` (7 preceding siblings ...)
2007-10-04 10:13 ` [PATCH 09/13] Unique names 3/6 Jan Engelhardt
@ 2007-10-04 10:13 ` Jan Engelhardt
2007-10-04 10:13 ` [PATCH 11/13] Unique names 5/6 Jan Engelhardt
` (3 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:13 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Give symbols of libxt targets unique names (2/3).
Adds unique prefixes to all functions (most of them - especially the hook
functions) so that debugging programs can unambiguously map a symbol to an
address. Also unifies the names of the xtables_match/xtables_target structs,
(based upon libxt_connmark.c/libip6t_*.c).
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
---
extensions/libipt_CLUSTERIP.c | 39 ++++++++++++------------------
extensions/libipt_DNAT.c | 38 ++++++++++++-----------------
extensions/libipt_ECN.c | 39 ++++++++++++------------------
extensions/libipt_LOG.c | 41 ++++++++++++-------------------
extensions/libipt_MASQUERADE.c | 37 ++++++++++++----------------
extensions/libipt_MIRROR.c | 17 +++++--------
extensions/libipt_NETMAP.c | 53 +++++++++++++++++------------------------
extensions/libipt_REDIRECT.c | 39 ++++++++++++------------------
extensions/libipt_REJECT.c | 38 ++++++++++++-----------------
extensions/libipt_SAME.c | 43 +++++++++++++--------------------
extensions/libipt_SET.c | 41 +++++++++++++------------------
extensions/libipt_SNAT.c | 38 ++++++++++++-----------------
extensions/libipt_TOS.c | 39 ++++++++++++------------------
extensions/libipt_TTL.c | 34 ++++++++++++--------------
extensions/libipt_ULOG.c | 35 ++++++++++++---------------
15 files changed, 242 insertions(+), 329 deletions(-)
Index: iptables/extensions/libipt_CLUSTERIP.c
===================================================================
--- iptables.orig/extensions/libipt_CLUSTERIP.c
+++ iptables/extensions/libipt_CLUSTERIP.c
@@ -19,8 +19,7 @@
#include <linux/netfilter_ipv4/ip_tables.h>
#include "../include/linux/netfilter_ipv4/ipt_CLUSTERIP.h"
-static void
-help(void)
+static void CLUSTERIP_help(void)
{
printf(
"CLUSTERIP target v%s options:\n"
@@ -44,7 +43,7 @@ IPTABLES_VERSION);
#define PARAM_LOCALNODE 0x0010
#define PARAM_HASHINIT 0x0020
-static const struct option opts[] = {
+static const struct option CLUSTERIP_opts[] = {
{ "new", 0, NULL, '1' },
{ "hashmode", 1, NULL, '2' },
{ "clustermac", 1, NULL, '3' },
@@ -78,10 +77,8 @@ parse_mac(const char *mac, char *macbuf)
}
}
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int CLUSTERIP_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_clusterip_tgt_info *cipinfo
= (struct ipt_clusterip_tgt_info *)(*target)->data;
@@ -158,8 +155,7 @@ parse(int c, char **argv, int invert, un
return 1;
}
-static void
-final_check(unsigned int flags)
+static void CLUSTERIP_check(unsigned int flags)
{
if (flags == 0)
return;
@@ -201,10 +197,8 @@ static char *mac2str(const u_int8_t mac[
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void CLUSTERIP_print(const void *ip,
+ const struct xt_entry_target *target, int numeric)
{
const struct ipt_clusterip_tgt_info *cipinfo =
(const struct ipt_clusterip_tgt_info *)target->data;
@@ -223,8 +217,7 @@ print(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void CLUSTERIP_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_clusterip_tgt_info *cipinfo =
(const struct ipt_clusterip_tgt_info *)target->data;
@@ -242,20 +235,20 @@ save(const void *ip, const struct xt_ent
cipinfo->hash_initval);
}
-static struct iptables_target clusterip = {
+static struct iptables_target clusterip_target = {
.name = "CLUSTERIP",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_clusterip_tgt_info)),
.userspacesize = offsetof(struct ipt_clusterip_tgt_info, config),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = CLUSTERIP_help,
+ .parse = CLUSTERIP_parse,
+ .final_check = CLUSTERIP_check,
+ .print = CLUSTERIP_print,
+ .save = CLUSTERIP_save,
+ .extra_opts = CLUSTERIP_opts,
};
void _init(void)
{
- register_target(&clusterip);
+ register_target(&clusterip_target);
}
Index: iptables/extensions/libipt_DNAT.c
===================================================================
--- iptables.orig/extensions/libipt_DNAT.c
+++ iptables/extensions/libipt_DNAT.c
@@ -20,8 +20,7 @@ struct ipt_natinfo
};
/* Function which prints out usage message. */
-static void
-help(void)
+static void DNAT_help(void)
{
printf(
"DNAT v%s options:\n"
@@ -32,7 +31,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option DNAT_opts[] = {
{ "to-destination", 1, NULL, '1' },
{ "random", 0, NULL, '2' },
{ }
@@ -139,10 +138,8 @@ parse_to(char *arg, int portok, struct i
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *e,
- struct xt_entry_target **target)
+static int DNAT_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *e, struct xt_entry_target **target)
{
const struct ipt_entry *entry = e;
struct ipt_natinfo *info = (void *)*target;
@@ -187,7 +184,7 @@ parse(int c, char **argv, int invert, un
}
/* Final check; must have specfied --to-source. */
-static void final_check(unsigned int flags)
+static void DNAT_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -215,10 +212,8 @@ static void print_range(const struct ip_
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void DNAT_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct ipt_natinfo *info = (void *)target;
unsigned int i = 0;
@@ -233,8 +228,7 @@ print(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void DNAT_save(const void *ip, const struct xt_entry_target *target)
{
struct ipt_natinfo *info = (void *)target;
unsigned int i = 0;
@@ -248,20 +242,20 @@ save(const void *ip, const struct xt_ent
}
}
-static struct iptables_target dnat = {
+static struct iptables_target dnat_target = {
.name = "DNAT",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
.userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = DNAT_help,
+ .parse = DNAT_parse,
+ .final_check = DNAT_check,
+ .print = DNAT_print,
+ .save = DNAT_save,
+ .extra_opts = DNAT_opts,
};
void _init(void)
{
- register_target(&dnat);
+ register_target(&dnat_target);
}
Index: iptables/extensions/libipt_ECN.c
===================================================================
--- iptables.orig/extensions/libipt_ECN.c
+++ iptables/extensions/libipt_ECN.c
@@ -17,7 +17,7 @@
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv4/ipt_ECN.h>
-static void help(void)
+static void ECN_help(void)
{
printf(
"ECN target v%s options\n"
@@ -33,7 +33,7 @@ static void help(void)
#endif
-static const struct option opts[] = {
+static const struct option ECN_opts[] = {
{ "ecn-tcp-remove", 0, NULL, 'F' },
{ "ecn-tcp-cwr", 1, NULL, 'G' },
{ "ecn-tcp-ece", 1, NULL, 'H' },
@@ -41,10 +41,8 @@ static const struct option opts[] = {
{ }
};
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int ECN_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
unsigned int result;
struct ipt_ECN_info *einfo
@@ -100,8 +98,7 @@ parse(int c, char **argv, int invert, un
return 1;
}
-static void
-final_check(unsigned int flags)
+static void ECN_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -109,10 +106,8 @@ final_check(unsigned int flags)
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void ECN_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ipt_ECN_info *einfo =
(const struct ipt_ECN_info *)target->data;
@@ -136,8 +131,7 @@ print(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void ECN_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_ECN_info *einfo =
(const struct ipt_ECN_info *)target->data;
@@ -159,21 +153,20 @@ save(const void *ip, const struct xt_ent
}
}
-static
-struct iptables_target ecn = {
+static struct iptables_target ecn_target = {
.name = "ECN",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_ECN_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_ECN_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = ECN_help,
+ .parse = ECN_parse,
+ .final_check = ECN_check,
+ .print = ECN_print,
+ .save = ECN_save,
+ .extra_opts = ECN_opts,
};
void _init(void)
{
- register_target(&ecn);
+ register_target(&ecn_target);
}
Index: iptables/extensions/libipt_LOG.c
===================================================================
--- iptables.orig/extensions/libipt_LOG.c
+++ iptables/extensions/libipt_LOG.c
@@ -18,8 +18,7 @@
#endif
/* Function which prints out usage message. */
-static void
-help(void)
+static void LOG_help(void)
{
printf(
"LOG v%s options:\n"
@@ -32,7 +31,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option LOG_opts[] = {
{ .name = "log-level", .has_arg = 1, .val = '!' },
{ .name = "log-prefix", .has_arg = 1, .val = '#' },
{ .name = "log-tcp-sequence", .has_arg = 0, .val = '1' },
@@ -43,8 +42,7 @@ static const struct option opts[] = {
};
/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void LOG_init(struct xt_entry_target *t)
{
struct ipt_log_info *loginfo = (struct ipt_log_info *)t->data;
@@ -108,10 +106,8 @@ parse_level(const char *level)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_log_info *loginfo = (struct ipt_log_info *)(*target)->data;
@@ -200,10 +196,8 @@ parse(int c, char **argv, int invert, un
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void LOG_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ipt_log_info *loginfo
= (const struct ipt_log_info *)target->data;
@@ -241,8 +235,7 @@ print(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void LOG_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_log_info *loginfo
= (const struct ipt_log_info *)target->data;
@@ -263,22 +256,20 @@ save(const void *ip, const struct xt_ent
printf("--log-uid ");
}
-static
-struct iptables_target log
-= {
+static struct iptables_target log_target = {
.name = "LOG",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_log_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_log_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = LOG_help,
+ .init = LOG_init,
+ .parse = LOG_parse,
+ .print = LOG_print,
+ .save = LOG_save,
+ .extra_opts = LOG_opts,
};
void _init(void)
{
- register_target(&log);
+ register_target(&log_target);
}
Index: iptables/extensions/libipt_MASQUERADE.c
===================================================================
--- iptables.orig/extensions/libipt_MASQUERADE.c
+++ iptables/extensions/libipt_MASQUERADE.c
@@ -9,8 +9,7 @@
#include <linux/netfilter/nf_nat.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void MASQUERADE_help(void)
{
printf(
"MASQUERADE v%s options:\n"
@@ -23,15 +22,14 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option MASQUERADE_opts[] = {
{ "to-ports", 1, NULL, '1' },
{ "random", 0, NULL, '2' },
{ }
};
/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void MASQUERADE_init(struct xt_entry_target *t)
{
struct ip_nat_multi_range *mr = (struct ip_nat_multi_range *)t->data;
@@ -76,10 +74,8 @@ parse_ports(const char *arg, struct ip_n
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *e,
- struct xt_entry_target **target)
+static int MASQUERADE_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *e, struct xt_entry_target **target)
{
const struct ipt_entry *entry = e;
int portok;
@@ -117,9 +113,8 @@ parse(int c, char **argv, int invert, un
/* Prints out the targinfo. */
static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+MASQUERADE_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct ip_nat_multi_range *mr
= (struct ip_nat_multi_range *)target->data;
@@ -139,7 +134,7 @@ print(const void *ip,
/* Saves the union ipt_targinfo in parsable form to stdout. */
static void
-save(const void *ip, const struct xt_entry_target *target)
+MASQUERADE_save(const void *ip, const struct xt_entry_target *target)
{
struct ip_nat_multi_range *mr
= (struct ip_nat_multi_range *)target->data;
@@ -156,20 +151,20 @@ save(const void *ip, const struct xt_ent
printf("--random ");
}
-static struct iptables_target masq = {
+static struct iptables_target masquerade_target = {
.name = "MASQUERADE",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
.userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = MASQUERADE_help,
+ .init = MASQUERADE_init,
+ .parse = MASQUERADE_parse,
+ .print = MASQUERADE_print,
+ .save = MASQUERADE_save,
+ .extra_opts = MASQUERADE_opts,
};
void _init(void)
{
- register_target(&masq);
+ register_target(&masquerade_target);
}
Index: iptables/extensions/libipt_MIRROR.c
===================================================================
--- iptables.orig/extensions/libipt_MIRROR.c
+++ iptables/extensions/libipt_MIRROR.c
@@ -8,8 +8,7 @@
#include <linux/netfilter_ipv4/ip_tables.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void MIRROR_help(void)
{
printf(
"MIRROR target v%s takes no options\n",
@@ -18,26 +17,24 @@ IPTABLES_VERSION);
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int MIRROR_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
return 0;
}
-static struct iptables_target mirror = {
+static struct iptables_target mirror_target = {
.name = "MIRROR",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(0),
.userspacesize = IPT_ALIGN(0),
- .help = &help,
- .parse = &parse,
+ .help = MIRROR_help,
+ .parse = MIRROR_parse,
.print = NULL,
.save = NULL,
};
void _init(void)
{
- register_target(&mirror);
+ register_target(&mirror_target);
}
Index: iptables/extensions/libipt_NETMAP.c
===================================================================
--- iptables.orig/extensions/libipt_NETMAP.c
+++ iptables/extensions/libipt_NETMAP.c
@@ -13,19 +13,18 @@
#define MODULENAME "NETMAP"
-static const struct option opts[] = {
+static const struct option NETMAP_opts[] = {
{ "to", 1, NULL, '1' },
{ }
};
/* Function which prints out usage message. */
-static void
-help(void)
+static void NETMAP_help(void)
{
printf(MODULENAME" v%s options:\n"
" --%s address[/mask]\n"
" Network address to map to.\n\n",
- IPTABLES_VERSION, opts[0].name);
+ IPTABLES_VERSION, NETMAP_opts[0].name);
}
static u_int32_t
@@ -55,8 +54,7 @@ netmask2bits(u_int32_t netmask)
}
/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void NETMAP_init(struct xt_entry_target *t)
{
struct ip_nat_multi_range *mr = (struct ip_nat_multi_range *)t->data;
@@ -116,10 +114,8 @@ parse_to(char *arg, struct ip_nat_range
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int NETMAP_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ip_nat_multi_range *mr
= (struct ip_nat_multi_range *)(*target)->data;
@@ -128,7 +124,7 @@ parse(int c, char **argv, int invert, un
case '1':
if (check_inverse(optarg, &invert, NULL, 0))
exit_error(PARAMETER_PROBLEM,
- "Unexpected `!' after --%s", opts[0].name);
+ "Unexpected `!' after --%s", NETMAP_opts[0].name);
parse_to(optarg, &mr->range[0]);
*flags = 1;
@@ -140,18 +136,16 @@ parse(int c, char **argv, int invert, un
}
/* Final check; need --to */
-static void final_check(unsigned int flags)
+static void NETMAP_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
- MODULENAME" needs --%s", opts[0].name);
+ MODULENAME" needs --%s", NETMAP_opts[0].name);
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void NETMAP_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct ip_nat_multi_range *mr
= (struct ip_nat_multi_range *)target->data;
@@ -170,29 +164,28 @@ print(const void *ip,
}
/* Saves the targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void NETMAP_save(const void *ip, const struct xt_entry_target *target)
{
- printf("--%s ", opts[0].name);
- print(ip, target, 0);
+ printf("--%s ", NETMAP_opts[0].name);
+ NETMAP_print(ip, target, 0);
}
-static struct iptables_target target_module = {
+static struct iptables_target netmap_target = {
.name = MODULENAME,
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
.userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = NETMAP_help,
+ .init = NETMAP_init,
+ .parse = NETMAP_parse,
+ .final_check = NETMAP_check,
+ .print = NETMAP_print,
+ .save = NETMAP_save,
+ .extra_opts = NETMAP_opts,
};
void _init(void)
{
- register_target(&target_module);
+ register_target(&netmap_target);
}
Index: iptables/extensions/libipt_REDIRECT.c
===================================================================
--- iptables.orig/extensions/libipt_REDIRECT.c
+++ iptables/extensions/libipt_REDIRECT.c
@@ -12,8 +12,7 @@
#define IPT_REDIRECT_OPT_RANDOM 0x02
/* Function which prints out usage message. */
-static void
-help(void)
+static void REDIRECT_help(void)
{
printf(
"REDIRECT v%s options:\n"
@@ -22,15 +21,14 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option REDIRECT_opts[] = {
{ "to-ports", 1, NULL, '1' },
{ "random", 1, NULL, '2' },
{ }
};
/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void REDIRECT_init(struct xt_entry_target *t)
{
struct ip_nat_multi_range *mr = (struct ip_nat_multi_range *)t->data;
@@ -78,10 +76,8 @@ parse_ports(const char *arg, struct ip_n
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *e,
- struct xt_entry_target **target)
+static int REDIRECT_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *e, struct xt_entry_target **target)
{
const struct ipt_entry *entry = e;
struct ip_nat_multi_range *mr
@@ -125,10 +121,8 @@ parse(int c, char **argv, int invert, un
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void REDIRECT_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct ip_nat_multi_range *mr
= (struct ip_nat_multi_range *)target->data;
@@ -146,8 +140,7 @@ print(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void REDIRECT_save(const void *ip, const struct xt_entry_target *target)
{
struct ip_nat_multi_range *mr
= (struct ip_nat_multi_range *)target->data;
@@ -164,20 +157,20 @@ save(const void *ip, const struct xt_ent
}
}
-static struct iptables_target redir = {
+static struct iptables_target redirect_target = {
.name = "REDIRECT",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
.userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = REDIRECT_help,
+ .init = REDIRECT_init,
+ .parse = REDIRECT_parse,
+ .print = REDIRECT_print,
+ .save = REDIRECT_save,
+ .extra_opts = REDIRECT_opts,
};
void _init(void)
{
- register_target(&redir);
+ register_target(&redirect_target);
}
Index: iptables/extensions/libipt_REJECT.c
===================================================================
--- iptables.orig/extensions/libipt_REJECT.c
+++ iptables/extensions/libipt_REJECT.c
@@ -67,8 +67,7 @@ print_reject_types(void)
/* Saves the union ipt_targinfo in parsable form to stdout. */
/* Function which prints out usage message. */
-static void
-help(void)
+static void REJECT_help(void)
{
printf(
"REJECT options:\n"
@@ -80,14 +79,13 @@ help(void)
printf("(*) See man page or read the INCOMPATIBILITES file for compatibility issues.\n");
}
-static const struct option opts[] = {
+static const struct option REJECT_opts[] = {
{ "reject-with", 1, NULL, '1' },
{ }
};
/* Allocate and initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void REJECT_init(struct xt_entry_target *t)
{
struct ipt_reject_info *reject = (struct ipt_reject_info *)t->data;
@@ -98,10 +96,8 @@ init(struct xt_entry_target *t)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int REJECT_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_reject_info *reject = (struct ipt_reject_info *)(*target)->data;
unsigned int limit = sizeof(reject_table)/sizeof(struct reject_names);
@@ -133,10 +129,8 @@ parse(int c, char **argv, int invert, un
}
/* Prints out ipt_reject_info. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void REJECT_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ipt_reject_info *reject
= (const struct ipt_reject_info *)target->data;
@@ -150,7 +144,7 @@ print(const void *ip,
}
/* Saves ipt_reject in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_target *target)
+static void REJECT_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_reject_info *reject
= (const struct ipt_reject_info *)target->data;
@@ -163,20 +157,20 @@ static void save(const void *ip, const s
printf("--reject-with %s ", reject_table[i].name);
}
-static struct iptables_target reject = {
+static struct iptables_target reject_target = {
.name = "REJECT",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_reject_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_reject_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = REJECT_help,
+ .init = REJECT_init,
+ .parse = REJECT_parse,
+ .print = REJECT_print,
+ .save = REJECT_save,
+ .extra_opts = REJECT_opts,
};
void _init(void)
{
- register_target(&reject);
+ register_target(&reject_target);
}
Index: iptables/extensions/libipt_SAME.c
===================================================================
--- iptables.orig/extensions/libipt_SAME.c
+++ iptables/extensions/libipt_SAME.c
@@ -11,8 +11,7 @@
#include "../include/linux/netfilter_ipv4/ipt_SAME.h"
/* Function which prints out usage message. */
-static void
-help(void)
+static void SAME_help(void)
{
printf(
"SAME v%s options:\n"
@@ -29,7 +28,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option SAME_opts[] = {
{ "to", 1, NULL, '1' },
{ "nodst", 0, NULL, '2'},
{ "random", 0, NULL, '3' },
@@ -37,8 +36,7 @@ static const struct option opts[] = {
};
/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void SAME_init(struct xt_entry_target *t)
{
struct ipt_same_info *mr = (struct ipt_same_info *)t->data;
@@ -87,10 +85,8 @@ parse_to(char *arg, struct ip_nat_range
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int SAME_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_same_info *mr
= (struct ipt_same_info *)(*target)->data;
@@ -139,7 +135,7 @@ parse(int c, char **argv, int invert, un
}
/* Final check; need --to. */
-static void final_check(unsigned int flags)
+static void SAME_check(unsigned int flags)
{
if (!(flags & IPT_SAME_OPT_TO))
exit_error(PARAMETER_PROBLEM,
@@ -147,10 +143,8 @@ static void final_check(unsigned int fla
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void SAME_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
int count;
struct ipt_same_info *mr
@@ -184,8 +178,7 @@ print(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void SAME_save(const void *ip, const struct xt_entry_target *target)
{
int count;
struct ipt_same_info *mr
@@ -215,21 +208,21 @@ save(const void *ip, const struct xt_ent
printf("--random ");
}
-static struct iptables_target same = {
+static struct iptables_target same_target = {
.name = "SAME",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_same_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_same_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = SAME_help,
+ .init = SAME_init,
+ .parse = SAME_parse,
+ .final_check = SAME_check,
+ .print = SAME_print,
+ .save = SAME_save,
+ .extra_opts = SAME_opts,
};
void _init(void)
{
- register_target(&same);
+ register_target(&same_target);
}
Index: iptables/extensions/libipt_SET.c
===================================================================
--- iptables.orig/extensions/libipt_SET.c
+++ iptables/extensions/libipt_SET.c
@@ -23,7 +23,7 @@
#include "libipt_set.h"
/* Function which prints out usage message. */
-static void help(void)
+static void SET_help(void)
{
printf("SET v%s options:\n"
" --add-set name flags\n"
@@ -34,14 +34,14 @@ static void help(void)
"\n", IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option SET_opts[] = {
{"add-set", 1, 0, '1'},
{"del-set", 1, 0, '2'},
{0}
};
/* Initialize the target. */
-static void init(struct xt_entry_target *target)
+static void SET_init(struct xt_entry_target *target)
{
struct ipt_set_info_target *info =
(struct ipt_set_info_target *) target->data;
@@ -83,9 +83,8 @@ parse_target(char **argv, int invert, un
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry, struct xt_entry_target **target)
+static int SET_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_set_info_target *myinfo =
(struct ipt_set_info_target *) (*target)->data;
@@ -107,7 +106,7 @@ parse(int c, char **argv, int invert, un
}
/* Final check; must specify at least one. */
-static void final_check(unsigned int flags)
+static void SET_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -135,9 +134,8 @@ print_target(const char *prefix, const s
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target, int numeric)
+static void SET_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct ipt_set_info_target *info =
(struct ipt_set_info_target *) target->data;
@@ -147,8 +145,7 @@ print(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void SET_save(const void *ip, const struct xt_entry_target *target)
{
struct ipt_set_info_target *info =
(struct ipt_set_info_target *) target->data;
@@ -157,23 +154,21 @@ save(const void *ip, const struct xt_ent
print_target("--del-set", &info->del_set);
}
-static
-struct iptables_target ipt_set_target
-= {
+static struct iptables_target set_target = {
.name = "SET",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_set_info_target)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_set_info_target)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = SET_help,
+ .init = SET_init,
+ .parse = SET_parse,
+ .final_check = SET_check,
+ .print = SET_print,
+ .save = SET_save,
+ .extra_opts = SET_opts,
};
void _init(void)
{
- register_target(&ipt_set_target);
+ register_target(&set_target);
}
Index: iptables/extensions/libipt_SNAT.c
===================================================================
--- iptables.orig/extensions/libipt_SNAT.c
+++ iptables/extensions/libipt_SNAT.c
@@ -20,8 +20,7 @@ struct ipt_natinfo
};
/* Function which prints out usage message. */
-static void
-help(void)
+static void SNAT_help(void)
{
printf(
"SNAT v%s options:\n"
@@ -32,7 +31,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option SNAT_opts[] = {
{ "to-source", 1, NULL, '1' },
{ "random", 0, NULL, '2' },
{ }
@@ -139,10 +138,8 @@ parse_to(char *arg, int portok, struct i
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *e,
- struct xt_entry_target **target)
+static int SNAT_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *e, struct xt_entry_target **target)
{
const struct ipt_entry *entry = e;
struct ipt_natinfo *info = (void *)*target;
@@ -189,7 +186,7 @@ parse(int c, char **argv, int invert, un
}
/* Final check; must have specfied --to-source. */
-static void final_check(unsigned int flags)
+static void SNAT_check(unsigned int flags)
{
if (!(flags & IPT_SNAT_OPT_SOURCE))
exit_error(PARAMETER_PROBLEM,
@@ -217,10 +214,8 @@ static void print_range(const struct ip_
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void SNAT_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct ipt_natinfo *info = (void *)target;
unsigned int i = 0;
@@ -235,8 +230,7 @@ print(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void SNAT_save(const void *ip, const struct xt_entry_target *target)
{
struct ipt_natinfo *info = (void *)target;
unsigned int i = 0;
@@ -250,20 +244,20 @@ save(const void *ip, const struct xt_ent
}
}
-static struct iptables_target snat = {
+static struct iptables_target snat_target = {
.name = "SNAT",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
.userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = SNAT_help,
+ .parse = SNAT_parse,
+ .final_check = SNAT_check,
+ .print = SNAT_print,
+ .save = SNAT_save,
+ .extra_opts = SNAT_opts,
};
void _init(void)
{
- register_target(&snat);
+ register_target(&snat_target);
}
Index: iptables/extensions/libipt_TOS.c
===================================================================
--- iptables.orig/extensions/libipt_TOS.c
+++ iptables/extensions/libipt_TOS.c
@@ -28,8 +28,7 @@ struct TOS_value
};
/* Function which prints out usage message. */
-static void
-help(void)
+static void TOS_help(void)
{
unsigned int i;
@@ -47,7 +46,7 @@ IPTABLES_VERSION);
fputc('\n', stdout);
}
-static const struct option opts[] = {
+static const struct option TOS_opts[] = {
{ "set-tos", 1, NULL, '1' },
{ }
};
@@ -78,10 +77,8 @@ parse_tos(const char *s, struct ipt_tos_
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int TOS_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_tos_target_info *tosinfo
= (struct ipt_tos_target_info *)(*target)->data;
@@ -102,8 +99,7 @@ parse(int c, char **argv, int invert, un
return 1;
}
-static void
-final_check(unsigned int flags)
+static void TOS_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -126,10 +122,8 @@ print_tos(u_int8_t tos, int numeric)
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void TOS_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ipt_tos_target_info *tosinfo =
(const struct ipt_tos_target_info *)target->data;
@@ -138,8 +132,7 @@ print(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void TOS_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_tos_target_info *tosinfo =
(const struct ipt_tos_target_info *)target->data;
@@ -147,20 +140,20 @@ save(const void *ip, const struct xt_ent
printf("--set-tos 0x%02x ", tosinfo->tos);
}
-static struct iptables_target tos = {
+static struct iptables_target tos_target = {
.name = "TOS",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_tos_target_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_tos_target_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = TOS_help,
+ .parse = TOS_parse,
+ .final_check = TOS_check,
+ .print = TOS_print,
+ .save = TOS_save,
+ .extra_opts = TOS_opts,
};
void _init(void)
{
- register_target(&tos);
+ register_target(&tos_target);
}
Index: iptables/extensions/libipt_TTL.c
===================================================================
--- iptables.orig/extensions/libipt_TTL.c
+++ iptables/extensions/libipt_TTL.c
@@ -16,7 +16,7 @@
#define IPT_TTL_USED 1
-static void help(void)
+static void TTL_help(void)
{
printf(
"TTL target v%s options\n"
@@ -26,9 +26,8 @@ static void help(void)
, IPTABLES_VERSION);
}
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int TTL_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_TTL_info *info = (struct ipt_TTL_info *) (*target)->data;
unsigned int value;
@@ -85,15 +84,14 @@ static int parse(int c, char **argv, int
return 1;
}
-static void final_check(unsigned int flags)
+static void TTL_check(unsigned int flags)
{
if (!(flags & IPT_TTL_USED))
exit_error(PARAMETER_PROBLEM,
"TTL: You must specify an action");
}
-static void save(const void *ip,
- const struct xt_entry_target *target)
+static void TTL_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_TTL_info *info =
(struct ipt_TTL_info *) target->data;
@@ -113,8 +111,8 @@ static void save(const void *ip,
printf("%u ", info->ttl);
}
-static void print(const void *ip,
- const struct xt_entry_target *target, int numeric)
+static void TTL_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ipt_TTL_info *info =
(struct ipt_TTL_info *) target->data;
@@ -134,28 +132,28 @@ static void print(const void *ip,
printf("%u ", info->ttl);
}
-static const struct option opts[] = {
+static const struct option TTL_opts[] = {
{ "ttl-set", 1, NULL, '1' },
{ "ttl-dec", 1, NULL, '2' },
{ "ttl-inc", 1, NULL, '3' },
{ }
};
-static struct iptables_target TTL = {
+static struct iptables_target ttl_target = {
.next = NULL,
.name = "TTL",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_TTL_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_TTL_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = TTL_help,
+ .parse = TTL_parse,
+ .final_check = TTL_check,
+ .print = TTL_print,
+ .save = TTL_save,
+ .extra_opts = TTL_opts,
};
void _init(void)
{
- register_target(&TTL);
+ register_target(&ttl_target);
}
Index: iptables/extensions/libipt_ULOG.c
===================================================================
--- iptables.orig/extensions/libipt_ULOG.c
+++ iptables/extensions/libipt_ULOG.c
@@ -34,7 +34,7 @@ void print_groups(unsigned int gmask)
}
/* Function which prints out usage message. */
-static void help(void)
+static void ULOG_help(void)
{
printf("ULOG v%s options:\n"
" --ulog-nlgroup nlgroup NETLINK group used for logging\n"
@@ -44,7 +44,7 @@ static void help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option ULOG_opts[] = {
{"ulog-nlgroup", 1, NULL, '!'},
{"ulog-prefix", 1, NULL, '#'},
{"ulog-cprange", 1, NULL, 'A'},
@@ -53,7 +53,7 @@ static const struct option opts[] = {
};
/* Initialize the target. */
-static void init(struct xt_entry_target *t)
+static void ULOG_init(struct xt_entry_target *t)
{
struct ipt_ulog_info *loginfo = (struct ipt_ulog_info *) t->data;
@@ -69,9 +69,8 @@ static void init(struct xt_entry_target
/* Function which parses command options; returns true if it
ate an option */
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int ULOG_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_ulog_info *loginfo =
(struct ipt_ulog_info *) (*target)->data;
@@ -151,8 +150,7 @@ static int parse(int c, char **argv, int
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void save(const void *ip,
- const struct xt_entry_target *target)
+static void ULOG_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_ulog_info *loginfo
= (const struct ipt_ulog_info *) target->data;
@@ -172,9 +170,8 @@ static void save(const void *ip,
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target, int numeric)
+static void ULOG_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ipt_ulog_info *loginfo
= (const struct ipt_ulog_info *) target->data;
@@ -187,20 +184,20 @@ print(const void *ip,
printf("queue_threshold %u ", (unsigned int)loginfo->qthreshold);
}
-static struct iptables_target ulog = {
+static struct iptables_target ulog_target = {
.name = "ULOG",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_ulog_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_ulog_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = ULOG_help,
+ .init = ULOG_init,
+ .parse = ULOG_parse,
+ .print = ULOG_print,
+ .save = ULOG_save,
+ .extra_opts = ULOG_opts,
};
void _init(void)
{
- register_target(&ulog);
+ register_target(&ulog_target);
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 11/13] Unique names 5/6
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
` (8 preceding siblings ...)
2007-10-04 10:13 ` [PATCH 10/13] Unique names 4/6 Jan Engelhardt
@ 2007-10-04 10:13 ` Jan Engelhardt
2007-10-04 10:13 ` [PATCH 12/13] Unique symbols 6/6 Jan Engelhardt
` (2 subsequent siblings)
12 siblings, 0 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:13 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Give symbols of libxt matches unique names (3/3).
Adds unique prefixes to all functions (most of them - especially the hook
functions) so that debugging programs can unambiguously map a symbol to an
address. Also unifies the names of the xtables_match/xtables_target structs,
(based upon libxt_connmark.c/libip6t_*.c).
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
---
extensions/libip6t_ah.c | 38 ++++++++++++++-------------------
extensions/libip6t_condition.c | 43 ++++++++++++++------------------------
extensions/libip6t_dst.c | 38 ++++++++++++++-------------------
extensions/libip6t_eui64.c | 17 ++++++---------
extensions/libip6t_frag.c | 38 ++++++++++++++-------------------
extensions/libip6t_hbh.c | 39 +++++++++++++++-------------------
extensions/libip6t_hl.c | 36 ++++++++++++++------------------
extensions/libip6t_icmp6.c | 42 ++++++++++++++++---------------------
extensions/libip6t_ipv6header.c | 45 ++++++++++++++++------------------------
extensions/libip6t_mh.c | 34 ++++++++++++++----------------
extensions/libip6t_owner.c | 39 ++++++++++++++--------------------
extensions/libip6t_policy.c | 34 ++++++++++++++----------------
extensions/libip6t_rt.c | 37 ++++++++++++++------------------
extensions/libip6t_state.c | 37 ++++++++++++++------------------
14 files changed, 220 insertions(+), 297 deletions(-)
Index: iptables/extensions/libip6t_ah.c
===================================================================
--- iptables.orig/extensions/libip6t_ah.c
+++ iptables/extensions/libip6t_ah.c
@@ -9,8 +9,7 @@
#include <linux/netfilter_ipv6/ip6t_ah.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void ah_help(void)
{
printf(
"AH v%s options:\n"
@@ -20,7 +19,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option ah_opts[] = {
{ .name = "ahspi", .has_arg = 1, .val = '1' },
{ .name = "ahlen", .has_arg = 1, .val = '2' },
{ .name = "ahres", .has_arg = 0, .val = '3' },
@@ -71,8 +70,7 @@ parse_ah_spis(const char *spistring, u_i
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void ah_init(struct xt_entry_match *m)
{
struct ip6t_ah *ahinfo = (struct ip6t_ah *)m->data;
@@ -83,10 +81,8 @@ init(struct xt_entry_match *m)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int ah_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ip6t_ah *ahinfo = (struct ip6t_ah *)(*match)->data;
@@ -149,9 +145,8 @@ print_len(const char *name, u_int32_t le
}
/* Prints out the union ip6t_matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+static void ah_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ip6t_ah *ah = (struct ip6t_ah *)match->data;
@@ -170,7 +165,7 @@ print(const void *ip,
}
/* Saves the union ip6t_matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void ah_save(const void *ip, const struct xt_entry_match *match)
{
const struct ip6t_ah *ahinfo = (struct ip6t_ah *)match->data;
@@ -198,22 +193,21 @@ static void save(const void *ip, const s
printf("--ahres ");
}
-static
-struct ip6tables_match ah = {
+static struct ip6tables_match ah_match6 = {
.name = "ah",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_ah)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_ah)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = ah_help,
+ .init = ah_init,
+ .parse = ah_parse,
+ .print = ah_print,
+ .save = ah_save,
+ .extra_opts = ah_opts,
};
void
_init(void)
{
- register_match6(&ah);
+ register_match6(&ah_match6);
}
Index: iptables/extensions/libip6t_condition.c
===================================================================
--- iptables.orig/extensions/libip6t_condition.c
+++ iptables/extensions/libip6t_condition.c
@@ -8,9 +8,7 @@
#include<linux/netfilter_ipv6/ip6_tables.h>
#include<linux/netfilter_ipv6/ip6t_condition.h>
-
-static void
-help(void)
+static void condition_help(void)
{
printf("condition match v%s options:\n"
"--condition [!] filename "
@@ -18,16 +16,14 @@ help(void)
IPTABLES_VERSION);
}
-
-static const struct option opts[] = {
+static const struct option condition_opts[] = {
{ .name = "condition", .has_arg = 1, .flag = 0, .val = 'X' },
{ .name = 0 }
};
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+condition_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct condition6_info *info =
(struct condition6_info *) (*match)->data;
@@ -53,19 +49,15 @@ parse(int c, char **argv, int invert, un
return 0;
}
-
-static void
-final_check(unsigned int flags)
+static void condition_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
"Condition match: must specify --condition");
}
-
-static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+static void condition_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct condition6_info *info =
(const struct condition6_info *) match->data;
@@ -74,9 +66,7 @@ print(const void *ip,
}
-static void
-save(const void *ip,
- const struct xt_entry_match *match)
+static void condition_save(const void *ip, const struct xt_entry_match *match)
{
const struct condition6_info *info =
(const struct condition6_info *) match->data;
@@ -84,23 +74,22 @@ save(const void *ip,
printf("--condition %s\"%s\" ", (info->invert) ? "! " : "", info->name);
}
-
-static struct ip6tables_match condition = {
+static struct ip6tables_match condition_match6 = {
.name = "condition",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct condition6_info)),
.userspacesize = IP6T_ALIGN(sizeof(struct condition6_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = condition_help,
+ .parse = condition_parse,
+ .final_check = condition_check,
+ .print = condition_print,
+ .save = condition_save,
+ .extra_opts = condition_opts,
};
void
_init(void)
{
- register_match6(&condition);
+ register_match6(&condition_match6);
}
Index: iptables/extensions/libip6t_dst.c
===================================================================
--- iptables.orig/extensions/libip6t_dst.c
+++ iptables/extensions/libip6t_dst.c
@@ -20,8 +20,7 @@
#endif
/* Function which prints out usage message. */
-static void
-help(void)
+static void dst_help(void)
{
printf(
UNAME " v%s options:\n"
@@ -31,7 +30,7 @@ UNAME " v%s options:\n"
IPTABLES_VERSION, IP6T_OPTS_OPTSNR);
}
-static const struct option opts[] = {
+static const struct option dst_opts[] = {
{ .name = LNAME "-len", .has_arg = 1, .val = '1' },
{ .name = LNAME "-opts", .has_arg = 1, .val = '2' },
{ .name = LNAME "-not-strict", .has_arg = 1, .val = '3' },
@@ -117,8 +116,7 @@ parse_options(const char *optsstr, u_int
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void dst_init(struct xt_entry_match *m)
{
struct ip6t_opts *optinfo = (struct ip6t_opts *)m->data;
@@ -130,10 +128,8 @@ init(struct xt_entry_match *m)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int dst_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ip6t_opts *optinfo = (struct ip6t_opts *)(*match)->data;
@@ -195,9 +191,8 @@ print_options(int optsnr, u_int16_t *opt
}
/* Prints out the union ip6t_matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+static void dst_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ip6t_opts *optinfo = (struct ip6t_opts *)match->data;
@@ -221,7 +216,7 @@ print(const void *ip,
}
/* Saves the union ip6t_matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void dst_save(const void *ip, const struct xt_entry_match *match)
{
const struct ip6t_opts *optinfo = (struct ip6t_opts *)match->data;
@@ -240,22 +235,21 @@ static void save(const void *ip, const s
printf("--" LNAME "-not-strict ");
}
-static
-struct ip6tables_match optstruct = {
+static struct ip6tables_match dst_match6 = {
.name = LNAME,
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_opts)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_opts)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = dst_help,
+ .init = dst_init,
+ .parse = dst_parse,
+ .print = dst_print,
+ .save = dst_save,
+ .extra_opts = dst_opts,
};
void
_init(void)
{
- register_match6(&optstruct);
+ register_match6(&dst_match6);
}
Index: iptables/extensions/libip6t_eui64.c
===================================================================
--- iptables.orig/extensions/libip6t_eui64.c
+++ iptables/extensions/libip6t_eui64.c
@@ -12,8 +12,7 @@
#include <ip6tables.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void eui64_help(void)
{
printf(
"eui64 v%s options:\n"
@@ -24,24 +23,22 @@ help(void)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int eui64_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
return 0;
}
-static struct ip6tables_match eui64 = {
+static struct ip6tables_match eui64_target6 = {
.name = "eui64",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(int)),
.userspacesize = IP6T_ALIGN(sizeof(int)),
- .help = &help,
- .parse = &parse,
+ .help = eui64_help,
+ .parse = eui64_parse,
};
void _init(void)
{
- register_match6(&eui64);
+ register_match6(&eui64_target6);
}
Index: iptables/extensions/libip6t_frag.c
===================================================================
--- iptables.orig/extensions/libip6t_frag.c
+++ iptables/extensions/libip6t_frag.c
@@ -9,8 +9,7 @@
#include <linux/netfilter_ipv6/ip6t_frag.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void frag_help(void)
{
printf(
"FRAG v%s options:\n"
@@ -23,7 +22,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option frag_opts[] = {
{ .name = "fragid", .has_arg = 1, .val = '1' },
{ .name = "fraglen", .has_arg = 1, .val = '2' },
{ .name = "fragres", .has_arg = 0, .val = '3' },
@@ -77,8 +76,7 @@ parse_frag_ids(const char *idstring, u_i
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void frag_init(struct xt_entry_match *m)
{
struct ip6t_frag *fraginfo = (struct ip6t_frag *)m->data;
@@ -91,10 +89,8 @@ init(struct xt_entry_match *m)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int frag_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ip6t_frag *fraginfo = (struct ip6t_frag *)(*match)->data;
@@ -172,9 +168,8 @@ print_ids(const char *name, u_int32_t mi
}
/* Prints out the union ip6t_matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+static void frag_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ip6t_frag *frag = (struct ip6t_frag *)match->data;
@@ -206,7 +201,7 @@ print(const void *ip,
}
/* Saves the union ip6t_matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void frag_save(const void *ip, const struct xt_entry_match *match)
{
const struct ip6t_frag *fraginfo = (struct ip6t_frag *)match->data;
@@ -243,22 +238,21 @@ static void save(const void *ip, const s
printf("--fraglast ");
}
-static
-struct ip6tables_match frag = {
+static struct ip6tables_match frag_match6 = {
.name = "frag",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_frag)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_frag)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = frag_help,
+ .init = frag_init,
+ .parse = frag_parse,
+ .print = frag_print,
+ .save = frag_save,
+ .extra_opts = frag_opts,
};
void
_init(void)
{
- register_match6(&frag);
+ register_match6(&frag_match6);
}
Index: iptables/extensions/libip6t_hbh.c
===================================================================
--- iptables.orig/extensions/libip6t_hbh.c
+++ iptables/extensions/libip6t_hbh.c
@@ -18,8 +18,7 @@
#define LNAME (HOPBYHOP ? "hbh" : "dst")
/* Function which prints out usage message. */
-static void
-help(void)
+static void hbh_help(void)
{
printf(
"%s v%s options:\n"
@@ -30,14 +29,14 @@ UNAME , IPTABLES_VERSION, LNAME, LNAME,
}
#if HOPBYHOP
-static const struct option opts[] = {
+static const struct option hbh_opts[] = {
{ "hbh-len", 1, NULL, '1' },
{ "hbh-opts", 1, NULL, '2' },
{ "hbh-not-strict", 1, NULL, '3' },
{ }
};
#else
-static const struct option opts[] = {
+static const struct option hbh_opts[] = {
{ "dst-len", 1, NULL, '1' },
{ "dst-opts", 1, NULL, '2' },
{ "dst-not-strict", 1, NULL, '3' },
@@ -116,8 +115,7 @@ parse_options(const char *optsstr, u_int
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void hbh_init(struct xt_entry_match *m)
{
struct ip6t_opts *optinfo = (struct ip6t_opts *)m->data;
@@ -129,10 +127,8 @@ init(struct xt_entry_match *m)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int hbh_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ip6t_opts *optinfo = (struct ip6t_opts *)(*match)->data;
@@ -192,9 +188,8 @@ print_options(int optsnr, u_int16_t *opt
}
/* Prints out the union ip6t_matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+static void hbh_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ip6t_opts *optinfo = (struct ip6t_opts *)match->data;
@@ -214,7 +209,7 @@ print(const void *ip,
}
/* Saves the union ip6t_matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void hbh_save(const void *ip, const struct xt_entry_match *match)
{
const struct ip6t_opts *optinfo = (struct ip6t_opts *)match->data;
@@ -230,7 +225,7 @@ static void save(const void *ip, const s
}
-static struct ip6tables_match optstruct = {
+static struct ip6tables_match hbh_match6 = {
#if HOPBYHOP
.name = "hbh",
#else
@@ -239,16 +234,16 @@ static struct ip6tables_match optstruct
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_opts)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_opts)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = hbh_help,
+ .init = hbh_init,
+ .parse = hbh_parse,
+ .print = hbh_print,
+ .save = hbh_save,
+ .extra_opts = hbh_opts,
};
void
_init(void)
{
- register_match6(&optstruct);
+ register_match6(&hbh_match6);
}
Index: iptables/extensions/libip6t_hl.c
===================================================================
--- iptables.orig/extensions/libip6t_hl.c
+++ iptables/extensions/libip6t_hl.c
@@ -15,7 +15,7 @@
#include <linux/netfilter_ipv6/ip6_tables.h>
#include <linux/netfilter_ipv6/ip6t_hl.h>
-static void help(void)
+static void hl_help(void)
{
printf(
"HL match v%s options:\n"
@@ -25,9 +25,8 @@ static void help(void)
, IPTABLES_VERSION);
}
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int hl_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ip6t_hl_info *info = (struct ip6t_hl_info *) (*match)->data;
u_int8_t value;
@@ -81,7 +80,7 @@ static int parse(int c, char **argv, int
return 1;
}
-static void final_check(unsigned int flags)
+static void hl_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -89,9 +88,8 @@ static void final_check(unsigned int fla
"`--hl-eq', `--hl-lt', `--hl-gt'");
}
-static void print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void hl_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
static const char *op[] = {
[IP6T_HL_EQ] = "==",
@@ -105,8 +103,7 @@ static void print(const void *ip,
printf("HL match HL %s %u ", op[info->mode], info->hop_limit);
}
-static void save(const void *ip,
- const struct xt_entry_match *match)
+static void hl_save(const void *ip, const struct xt_entry_match *match)
{
static const char *op[] = {
[IP6T_HL_EQ] = "eq",
@@ -120,7 +117,7 @@ static void save(const void *ip,
printf("--hl-%s %u ", op[info->mode], info->hop_limit);
}
-static const struct option opts[] = {
+static const struct option hl_opts[] = {
{ .name = "hl", .has_arg = 1, .val = '2' },
{ .name = "hl-eq", .has_arg = 1, .val = '2' },
{ .name = "hl-lt", .has_arg = 1, .val = '3' },
@@ -128,22 +125,21 @@ static const struct option opts[] = {
{ }
};
-static
-struct ip6tables_match hl = {
+static struct ip6tables_match hl_match6 = {
.name = "hl",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_hl_info)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_hl_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = hl_help,
+ .parse = hl_parse,
+ .final_check = hl_check,
+ .print = hl_print,
+ .save = hl_save,
+ .extra_opts = hl_opts,
};
void _init(void)
{
- register_match6(&hl);
+ register_match6(&hl_match6);
}
Index: iptables/extensions/libip6t_icmp6.c
===================================================================
--- iptables.orig/extensions/libip6t_icmp6.c
+++ iptables/extensions/libip6t_icmp6.c
@@ -74,8 +74,7 @@ print_icmpv6types(void)
}
/* Function which prints out usage message. */
-static void
-help(void)
+static void icmp6_help(void)
{
printf(
"ICMPv6 v%s options:\n"
@@ -85,7 +84,7 @@ help(void)
print_icmpv6types();
}
-static const struct option opts[] = {
+static const struct option icmp6_opts[] = {
{ "icmpv6-type", 1, NULL, '1' },
{ }
};
@@ -144,8 +143,7 @@ parse_icmpv6(const char *icmpv6type, u_i
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void icmp6_init(struct xt_entry_match *m)
{
struct ip6t_icmp *icmpv6info = (struct ip6t_icmp *)m->data;
@@ -154,10 +152,8 @@ init(struct xt_entry_match *m)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int icmp6_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ip6t_icmp *icmpv6info = (struct ip6t_icmp *)(*match)->data;
@@ -219,10 +215,8 @@ static void print_icmpv6type(u_int8_t ty
}
/* Prints out the union ipt_matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void icmp6_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ip6t_icmp *icmpv6 = (struct ip6t_icmp *)match->data;
@@ -237,7 +231,7 @@ print(const void *ip,
}
/* Saves the match in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void icmp6_save(const void *ip, const struct xt_entry_match *match)
{
const struct ip6t_icmp *icmpv6 = (struct ip6t_icmp *)match->data;
@@ -250,28 +244,28 @@ static void save(const void *ip, const s
printf(" ");
}
-static void final_check(unsigned int flags)
+static void icmp6_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
"icmpv6 match: You must specify `--icmpv6-type'");
}
-static struct ip6tables_match icmpv6 = {
+static struct ip6tables_match icmp6_match6 = {
.name = "icmp6",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_icmp)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_icmp)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = icmp6_help,
+ .init = icmp6_init,
+ .parse = icmp6_parse,
+ .final_check = icmp6_check,
+ .print = icmp6_print,
+ .save = icmp6_save,
+ .extra_opts = icmp6_opts,
};
void _init(void)
{
- register_match6(&icmpv6);
+ register_match6(&icmp6_match6);
}
Index: iptables/extensions/libip6t_ipv6header.c
===================================================================
--- iptables.orig/extensions/libip6t_ipv6header.c
+++ iptables/extensions/libip6t_ipv6header.c
@@ -134,8 +134,7 @@ add_proto_to_mask(int proto){
return flag;
}
-static void
-help(void)
+static void ipv6header_help(void)
{
printf(
"ipv6header v%s match options:\n"
@@ -148,14 +147,13 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option ipv6header_opts[] = {
{ "header", 1, NULL, '1' },
{ "soft", 0, NULL, '2' },
{ }
};
-static void
-init(struct xt_entry_match *m)
+static void ipv6header_init(struct xt_entry_match *m)
{
struct ip6t_ipv6header_info *info = (struct ip6t_ipv6header_info *)m->data;
@@ -184,9 +182,8 @@ parse_header(const char *flags) {
/* Parses command options; returns 0 if it ate an option */
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+ipv6header_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ip6t_ipv6header_info *info = (struct ip6t_ipv6header_info *)(*match)->data;
@@ -223,8 +220,7 @@ parse(int c, char **argv, int invert, un
}
/* Checks the flags variable */
-static void
-final_check(unsigned int flags)
+static void ipv6header_check(unsigned int flags)
{
if (!flags) exit_error(PARAMETER_PROBLEM, "ip6t_ipv6header: no options specified");
}
@@ -252,10 +248,8 @@ print_header(u_int8_t flags){
}
/* Prints out the match */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void ipv6header_print(const void *ip,
+ const struct xt_entry_match *match, int numeric)
{
const struct ip6t_ipv6header_info *info = (const struct ip6t_ipv6header_info *)match->data;
printf("ipv6header ");
@@ -277,9 +271,7 @@ print(const void *ip,
}
/* Saves the match */
-static void
-save(const void *ip,
- const struct xt_entry_match *match)
+static void ipv6header_save(const void *ip, const struct xt_entry_match *match)
{
const struct ip6t_ipv6header_info *info = (const struct ip6t_ipv6header_info *)match->data;
@@ -294,22 +286,21 @@ save(const void *ip,
return;
}
-static
-struct ip6tables_match ipv6header = {
+static struct ip6tables_match ipv6header_match6 = {
.name = "ipv6header",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_ipv6header_info)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_ipv6header_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = ipv6header_help,
+ .init = ipv6header_init,
+ .parse = ipv6header_parse,
+ .final_check = ipv6header_check,
+ .print = ipv6header_print,
+ .save = ipv6header_save,
+ .extra_opts = ipv6header_opts,
};
void _init(void)
{
- register_match6(&ipv6header);
+ register_match6(&ipv6header_match6);
}
Index: iptables/extensions/libip6t_mh.c
===================================================================
--- iptables.orig/extensions/libip6t_mh.c
+++ iptables/extensions/libip6t_mh.c
@@ -58,7 +58,7 @@ static void print_types_all(void)
printf("\n");
}
-static void help(void)
+static void mh_help(void)
{
printf(
"MH v%s options:\n"
@@ -67,7 +67,7 @@ IPTABLES_VERSION);
print_types_all();
}
-static void init(struct xt_entry_match *m)
+static void mh_init(struct xt_entry_match *m)
{
struct ip6t_mh *mhinfo = (struct ip6t_mh *)m->data;
@@ -125,9 +125,8 @@ static void parse_mh_types(const char *m
#define MH_TYPES 0x01
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int mh_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ip6t_mh *mhinfo = (struct ip6t_mh *)(*match)->data;
@@ -189,9 +188,8 @@ static void print_types(u_int8_t min, u_
}
}
-static void print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void mh_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ip6t_mh *mhinfo = (struct ip6t_mh *)match->data;
@@ -204,7 +202,7 @@ static void print(const void *ip,
mhinfo->invflags & ~IP6T_MH_INV_MASK);
}
-static void save(const void *ip, const struct xt_entry_match *match)
+static void mh_save(const void *ip, const struct xt_entry_match *match)
{
const struct ip6t_mh *mhinfo = (struct ip6t_mh *)match->data;
@@ -220,25 +218,25 @@ static void save(const void *ip, const s
printf("--mh-type %u ", mhinfo->types[0]);
}
-static const struct option opts[] = {
+static const struct option mh_opts[] = {
{ "mh-type", 1, NULL, '1' },
{ }
};
-static struct ip6tables_match mh = {
+static struct ip6tables_match mh_match6 = {
.name = "mh",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_mh)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_mh)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = mh_help,
+ .init = mh_init,
+ .parse = mh_parse,
+ .print = mh_print,
+ .save = mh_save,
+ .extra_opts = mh_opts,
};
void _init(void)
{
- register_match6(&mh);
+ register_match6(&mh_match6);
}
Index: iptables/extensions/libip6t_owner.c
===================================================================
--- iptables.orig/extensions/libip6t_owner.c
+++ iptables/extensions/libip6t_owner.c
@@ -11,8 +11,7 @@
#include <linux/netfilter_ipv6/ip6t_owner.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void owner_help(void)
{
#ifdef IP6T_OWNER_COMM
printf(
@@ -36,7 +35,7 @@ IPTABLES_VERSION);
#endif /* IP6T_OWNER_COMM */
}
-static const struct option opts[] = {
+static const struct option owner_opts[] = {
{ "uid-owner", 1, NULL, '1' },
{ "gid-owner", 1, NULL, '2' },
{ "pid-owner", 1, NULL, '3' },
@@ -49,10 +48,8 @@ static const struct option opts[] = {
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int owner_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ip6t_owner_info *ownerinfo = (struct ip6t_owner_info *)(*match)->data;
@@ -188,8 +185,7 @@ print_item(struct ip6t_owner_info *info,
}
/* Final check; must have specified --own. */
-static void
-final_check(unsigned int flags)
+static void owner_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -197,10 +193,8 @@ final_check(unsigned int flags)
}
/* Prints out the matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void owner_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
struct ip6t_owner_info *info = (struct ip6t_owner_info *)match->data;
@@ -214,8 +208,7 @@ print(const void *ip,
}
/* Saves the union ip6t_matchinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_match *match)
+static void owner_save(const void *ip, const struct xt_entry_match *match)
{
struct ip6t_owner_info *info = (struct ip6t_owner_info *)match->data;
@@ -228,20 +221,20 @@ save(const void *ip, const struct xt_ent
#endif
}
-static struct ip6tables_match owner = {
+static struct ip6tables_match owner_match6 = {
.name = "owner",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_owner_info)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_owner_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = owner_help,
+ .parse = owner_parse,
+ .final_check = owner_check,
+ .print = owner_print,
+ .save = owner_save,
+ .extra_opts = owner_opts,
};
void _init(void)
{
- register_match6(&owner);
+ register_match6(&owner_match6);
}
Index: iptables/extensions/libip6t_policy.c
===================================================================
--- iptables.orig/extensions/libip6t_policy.c
+++ iptables/extensions/libip6t_policy.c
@@ -22,7 +22,7 @@
*/
static struct ip6t_policy_info *policy_info;
-static void help(void)
+static void policy_help(void)
{
printf(
"policy v%s options:\n"
@@ -41,7 +41,7 @@ static void help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] =
+static const struct option policy_opts[] =
{
{
.name = "dir",
@@ -160,9 +160,8 @@ static int parse_mode(char *s)
exit_error(PARAMETER_PROBLEM, "policy match: invalid mode `%s'", s);
}
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ip6t_policy_info *info = (void *)(*match)->data;
struct ip6t_policy_elem *e = &info->pol[info->len];
@@ -289,7 +288,7 @@ static int parse(int c, char **argv, int
return 1;
}
-static void final_check(unsigned int flags)
+static void policy_check(unsigned int flags)
{
struct ip6t_policy_info *info = policy_info;
struct ip6t_policy_elem *e;
@@ -421,9 +420,8 @@ static void print_flags(char *prefix, co
printf("%sstrict ", prefix);
}
-static void print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void policy_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ip6t_policy_info *info = (void *)match->data;
unsigned int i;
@@ -439,7 +437,7 @@ static void print(const void *ip,
printf("\n");
}
-static void save(const void *ip, const struct xt_entry_match *match)
+static void policy_save(const void *ip, const struct xt_entry_match *match)
{
const struct ip6t_policy_info *info = (void *)match->data;
unsigned int i;
@@ -452,20 +450,20 @@ static void save(const void *ip, const s
}
}
-static struct ip6tables_match policy = {
+static struct ip6tables_match policy_match6 = {
.name = "policy",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_policy_info)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_policy_info)),
- .help = help,
- .parse = parse,
- .final_check = final_check,
- .print = print,
- .save = save,
- .extra_opts = opts
+ .help = policy_help,
+ .parse = policy_parse,
+ .final_check = policy_check,
+ .print = policy_print,
+ .save = policy_save,
+ .extra_opts = policy_opts,
};
void _init(void)
{
- register_match6(&policy);
+ register_match6(&policy_match6);
}
Index: iptables/extensions/libip6t_rt.c
===================================================================
--- iptables.orig/extensions/libip6t_rt.c
+++ iptables/extensions/libip6t_rt.c
@@ -15,8 +15,7 @@
/*#define DEBUG 1*/
/* Function which prints out usage message. */
-static void
-help(void)
+static void rt_help(void)
{
printf(
"RT v%s options:\n"
@@ -29,7 +28,7 @@ help(void)
IPTABLES_VERSION, IP6T_RT_HOPS);
}
-static const struct option opts[] = {
+static const struct option rt_opts[] = {
{ "rt-type", 1, NULL, '1' },
{ "rt-segsleft", 1, NULL, '2' },
{ "rt-len", 1, NULL, '3' },
@@ -138,8 +137,7 @@ parse_addresses(const char *addrstr, str
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void rt_init(struct xt_entry_match *m)
{
struct ip6t_rt *rtinfo = (struct ip6t_rt *)m->data;
@@ -154,10 +152,8 @@ init(struct xt_entry_match *m)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int rt_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ip6t_rt *rtinfo = (struct ip6t_rt *)(*match)->data;
@@ -269,9 +265,8 @@ print_addresses(int addrnr, struct in6_a
}
/* Prints out the union ip6t_matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+static void rt_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ip6t_rt *rtinfo = (struct ip6t_rt *)match->data;
@@ -297,7 +292,7 @@ print(const void *ip,
}
/* Saves the union ip6t_matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void rt_save(const void *ip, const struct xt_entry_match *match)
{
const struct ip6t_rt *rtinfo = (struct ip6t_rt *)match->data;
@@ -334,21 +329,21 @@ static void save(const void *ip, const s
}
-static struct ip6tables_match rt = {
+static struct ip6tables_match rt_match6 = {
.name = "rt",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_rt)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_rt)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = rt_help,
+ .init = rt_init,
+ .parse = rt_parse,
+ .print = rt_print,
+ .save = rt_save,
+ .extra_opts = rt_opts,
};
void
_init(void)
{
- register_match6(&rt);
+ register_match6(&rt_match6);
}
Index: iptables/extensions/libip6t_state.c
===================================================================
--- iptables.orig/extensions/libip6t_state.c
+++ iptables/extensions/libip6t_state.c
@@ -13,8 +13,7 @@
#endif
/* Function which prints out usage message. */
-static void
-help(void)
+static void state_help(void)
{
printf(
"state v%s options:\n"
@@ -23,7 +22,7 @@ help(void)
"\n", IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option state_opts[] = {
{ "state", 1, 0, '1' },
{0}
};
@@ -63,10 +62,8 @@ parse_states(const char *arg, struct ipt
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int state_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_state_info *sinfo = (struct ipt_state_info *)(*match)->data;
@@ -88,7 +85,7 @@ parse(int c, char **argv, int invert, un
}
/* Final check; must have specified --state. */
-static void final_check(unsigned int flags)
+static void state_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM, "You must specify `--state'");
@@ -122,10 +119,8 @@ static void print_state(unsigned int sta
}
/* Prints out the matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void state_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
struct ipt_state_info *sinfo = (struct ipt_state_info *)match->data;
@@ -134,7 +129,7 @@ print(const void *ip,
}
/* Saves the matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void state_save(const void *ip, const struct xt_entry_match *match)
{
struct ipt_state_info *sinfo = (struct ipt_state_info *)match->data;
@@ -142,20 +137,20 @@ static void save(const void *ip, const s
print_state(sinfo->statemask);
}
-static struct ip6tables_match state = {
+static struct ip6tables_match state_match6 = {
.name = "state",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ipt_state_info)),
.userspacesize = IP6T_ALIGN(sizeof(struct ipt_state_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = state_help,
+ .parse = state_parse,
+ .final_check = state_check,
+ .print = state_print,
+ .save = state_save,
+ .extra_opts = state_opts,
};
void _init(void)
{
- register_match6(&state);
+ register_match6(&state_match6);
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 12/13] Unique symbols 6/6
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
` (9 preceding siblings ...)
2007-10-04 10:13 ` [PATCH 11/13] Unique names 5/6 Jan Engelhardt
@ 2007-10-04 10:13 ` Jan Engelhardt
2007-10-04 10:13 ` [PATCH 13/13] Remove redundant dst/hbh lines Jan Engelhardt
2007-10-04 10:14 ` [PATCH */13] That sums it up Jan Engelhardt
12 siblings, 0 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:13 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Give symbols of libxt targets unique names (3/3).
Adds unique prefixes to all functions (most of them - especially the hook
functions) so that debugging programs can unambiguously map a symbol to an
address. Also unifies the names of the xtables_match/xtables_target structs,
(based upon libxt_connmark.c/libip6t_*.c).
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
---
extensions/libip6t_HL.c | 35 ++++++++++++++++-------------------
extensions/libip6t_LOG.c | 41 ++++++++++++++++-------------------------
extensions/libip6t_REJECT.c | 39 ++++++++++++++++-----------------------
3 files changed, 48 insertions(+), 67 deletions(-)
Index: iptables/extensions/libip6t_HL.c
===================================================================
--- iptables.orig/extensions/libip6t_HL.c
+++ iptables/extensions/libip6t_HL.c
@@ -16,7 +16,7 @@
#define IP6T_HL_USED 1
-static void help(void)
+static void HL_help(void)
{
printf(
"HL target v%s options\n"
@@ -26,9 +26,8 @@ static void help(void)
, IPTABLES_VERSION);
}
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int HL_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ip6t_HL_info *info = (struct ip6t_HL_info *) (*target)->data;
unsigned int value;
@@ -85,15 +84,14 @@ static int parse(int c, char **argv, int
return 1;
}
-static void final_check(unsigned int flags)
+static void HL_check(unsigned int flags)
{
if (!(flags & IP6T_HL_USED))
exit_error(PARAMETER_PROBLEM,
"HL: You must specify an action");
}
-static void save(const void *ip,
- const struct xt_entry_target *target)
+static void HL_save(const void *ip, const struct xt_entry_target *target)
{
const struct ip6t_HL_info *info =
(struct ip6t_HL_info *) target->data;
@@ -113,8 +111,8 @@ static void save(const void *ip,
printf("%u ", info->hop_limit);
}
-static void print(const void *ip,
- const struct xt_entry_target *target, int numeric)
+static void HL_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ip6t_HL_info *info =
(struct ip6t_HL_info *) target->data;
@@ -134,28 +132,27 @@ static void print(const void *ip,
printf("%u ", info->hop_limit);
}
-static const struct option opts[] = {
+static const struct option HL_opts[] = {
{ "hl-set", 1, NULL, '1' },
{ "hl-dec", 1, NULL, '2' },
{ "hl-inc", 1, NULL, '3' },
{ }
};
-static
-struct ip6tables_target HL = {
+static struct ip6tables_target hl_target6 = {
.name = "HL",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_HL_info)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_HL_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = HL_help,
+ .parse = HL_parse,
+ .final_check = HL_check,
+ .print = HL_print,
+ .save = HL_save,
+ .extra_opts = HL_opts,
};
void _init(void)
{
- register_target6(&HL);
+ register_target6(&hl_target6);
}
Index: iptables/extensions/libip6t_LOG.c
===================================================================
--- iptables.orig/extensions/libip6t_LOG.c
+++ iptables/extensions/libip6t_LOG.c
@@ -18,8 +18,7 @@
#define LOG_DEFAULT_LEVEL LOG_WARNING
/* Function which prints out usage message. */
-static void
-help(void)
+static void LOG_help(void)
{
printf(
"LOG v%s options:\n"
@@ -32,7 +31,7 @@ help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option LOG_opts[] = {
{ .name = "log-level", .has_arg = 1, .val = '!' },
{ .name = "log-prefix", .has_arg = 1, .val = '#' },
{ .name = "log-tcp-sequence", .has_arg = 0, .val = '1' },
@@ -43,8 +42,7 @@ static const struct option opts[] = {
};
/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void LOG_init(struct xt_entry_target *t)
{
struct ip6t_log_info *loginfo = (struct ip6t_log_info *)t->data;
@@ -108,10 +106,8 @@ parse_level(const char *level)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int LOG_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ip6t_log_info *loginfo = (struct ip6t_log_info *)(*target)->data;
@@ -200,10 +196,8 @@ parse(int c, char **argv, int invert, un
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void LOG_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ip6t_log_info *loginfo
= (const struct ip6t_log_info *)target->data;
@@ -241,8 +235,7 @@ print(const void *ip,
}
/* Saves the union ip6t_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void LOG_save(const void *ip, const struct xt_entry_target *target)
{
const struct ip6t_log_info *loginfo
= (const struct ip6t_log_info *)target->data;
@@ -263,22 +256,20 @@ save(const void *ip, const struct xt_ent
printf("--log-uid ");
}
-static
-struct ip6tables_target log
-= {
+static struct ip6tables_target log_target6 = {
.name = "LOG",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_log_info)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_log_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = LOG_help,
+ .init = LOG_init,
+ .parse = LOG_parse,
+ .print = LOG_print,
+ .save = LOG_save,
+ .extra_opts = LOG_opts,
};
void _init(void)
{
- register_target6(&log);
+ register_target6(&log_target6);
}
Index: iptables/extensions/libip6t_REJECT.c
===================================================================
--- iptables.orig/extensions/libip6t_REJECT.c
+++ iptables/extensions/libip6t_REJECT.c
@@ -54,8 +54,7 @@ print_reject_types(void)
/* Saves the union ipt_targinfo in parsable form to stdout. */
/* Function which prints out usage message. */
-static void
-help(void)
+static void REJECT_help(void)
{
printf(
"REJECT options:\n"
@@ -65,14 +64,13 @@ help(void)
print_reject_types();
}
-static const struct option opts[] = {
+static const struct option REJECT_opts[] = {
{ "reject-with", 1, NULL, '1' },
{ }
};
/* Allocate and initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void REJECT_init(struct xt_entry_target *t)
{
struct ip6t_reject_info *reject = (struct ip6t_reject_info *)t->data;
@@ -83,10 +81,8 @@ init(struct xt_entry_target *t)
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int REJECT_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ip6t_reject_info *reject =
(struct ip6t_reject_info *)(*target)->data;
@@ -114,10 +110,8 @@ parse(int c, char **argv, int invert, un
}
/* Prints out ipt_reject_info. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void REJECT_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ip6t_reject_info *reject
= (const struct ip6t_reject_info *)target->data;
@@ -131,8 +125,7 @@ print(const void *ip,
}
/* Saves ipt_reject in parsable form to stdout. */
-static void save(const void *ip,
- const struct xt_entry_target *target)
+static void REJECT_save(const void *ip, const struct xt_entry_target *target)
{
const struct ip6t_reject_info *reject
= (const struct ip6t_reject_info *)target->data;
@@ -145,20 +138,20 @@ static void save(const void *ip,
printf("--reject-with %s ", reject_table[i].name);
}
-static struct ip6tables_target reject = {
+static struct ip6tables_target reject_target6 = {
.name = "REJECT",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_reject_info)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_reject_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = REJECT_help,
+ .init = REJECT_init,
+ .parse = REJECT_parse,
+ .print = REJECT_print,
+ .save = REJECT_save,
+ .extra_opts = REJECT_opts,
};
void _init(void)
{
- register_target6(&reject);
+ register_target6(&reject_target6);
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 13/13] Remove redundant dst/hbh lines
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
` (10 preceding siblings ...)
2007-10-04 10:13 ` [PATCH 12/13] Unique symbols 6/6 Jan Engelhardt
@ 2007-10-04 10:13 ` Jan Engelhardt
2007-10-04 10:14 ` [PATCH */13] That sums it up Jan Engelhardt
12 siblings, 0 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:13 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Remove hbh stuff from libip6t_dst,
remove dst stuff from libip6t_hbh.
Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
---
extensions/libip6t_dst.c | 48 ++++++++++++++++++--------------------------
extensions/libip6t_hbh.c | 51 ++++++++++++++++-------------------------------
2 files changed, 38 insertions(+), 61 deletions(-)
Index: iptables/extensions/libip6t_dst.c
===================================================================
--- iptables.orig/extensions/libip6t_dst.c
+++ iptables/extensions/libip6t_dst.c
@@ -11,29 +11,21 @@
#include <sys/socket.h>
#include <arpa/inet.h>
-#ifdef HOPBYHOP
-#define UNAME "HBH"
-#define LNAME "hbh"
-#else
-#define UNAME "DST"
-#define LNAME "dst"
-#endif
-
/* Function which prints out usage message. */
static void dst_help(void)
{
printf(
-UNAME " v%s options:\n"
-" --" LNAME "-len [!] length total length of this header\n"
-" --" LNAME "-opts TYPE[:LEN][,TYPE[:LEN]...] \n"
-" Options and its length (list, max: %d)\n",
+"dst v%s options:\n"
+" --dst-len [!] length total length of this header\n"
+" --dst-opts TYPE[:LEN][,TYPE[:LEN]...]\n"
+" Options and its length (list, max: %d)\n",
IPTABLES_VERSION, IP6T_OPTS_OPTSNR);
}
static const struct option dst_opts[] = {
- { .name = LNAME "-len", .has_arg = 1, .val = '1' },
- { .name = LNAME "-opts", .has_arg = 1, .val = '2' },
- { .name = LNAME "-not-strict", .has_arg = 1, .val = '3' },
+ { .name = "dst-len", .has_arg = 1, .val = '1' },
+ { .name = "dst-opts", .has_arg = 1, .val = '2' },
+ { .name = "dst-not-strict", .has_arg = 1, .val = '3' },
{ }
};
@@ -47,7 +39,7 @@ parse_opts_num(const char *idstr, const
if ( idstr == ep ) {
exit_error(PARAMETER_PROBLEM,
- UNAME " no valid digits in %s `%s'", typestr, idstr);
+ "dst: no valid digits in %s `%s'", typestr, idstr);
}
if ( id == ULONG_MAX && errno == ERANGE ) {
exit_error(PARAMETER_PROBLEM,
@@ -56,7 +48,7 @@ parse_opts_num(const char *idstr, const
}
if ( *idstr != '\0' && *ep != '\0' ) {
exit_error(PARAMETER_PROBLEM,
- UNAME " error parsing %s `%s'", typestr, idstr);
+ "dst: error parsing %s `%s'", typestr, idstr);
}
return (u_int32_t) id;
}
@@ -137,7 +129,7 @@ static int dst_parse(int c, char **argv,
case '1':
if (*flags & IP6T_OPTS_LEN)
exit_error(PARAMETER_PROBLEM,
- "Only one `--" LNAME "-len' allowed");
+ "Only one `--dst-len' allowed");
check_inverse(optarg, &invert, &optind, 0);
optinfo->hdrlen = parse_opts_num(argv[optind-1], "length");
if (invert)
@@ -148,11 +140,11 @@ static int dst_parse(int c, char **argv,
case '2':
if (*flags & IP6T_OPTS_OPTS)
exit_error(PARAMETER_PROBLEM,
- "Only one `--" LNAME "-opts' allowed");
+ "Only one `--dst-opts' allowed");
check_inverse(optarg, &invert, &optind, 0);
if (invert)
exit_error(PARAMETER_PROBLEM,
- " '!' not allowed with `--" LNAME "-opts'");
+ " '!' not allowed with `--dst-opts'");
optinfo->optsnr = parse_options(argv[optind-1], optinfo->opts);
optinfo->flags |= IP6T_OPTS_OPTS;
*flags |= IP6T_OPTS_OPTS;
@@ -160,11 +152,11 @@ static int dst_parse(int c, char **argv,
case '3':
if (*flags & IP6T_OPTS_NSTRICT)
exit_error(PARAMETER_PROBLEM,
- "Only one `--" LNAME "-not-strict' allowed");
+ "Only one `--dst-not-strict' allowed");
if ( !(*flags & IP6T_OPTS_OPTS) )
exit_error(PARAMETER_PROBLEM,
- "`--" LNAME "-opts ...' required before `--"
- LNAME "-not-strict'");
+ "`--dst-opts ...' required before "
+ "`--dst-not-strict'");
optinfo->flags |= IP6T_OPTS_NSTRICT;
*flags |= IP6T_OPTS_NSTRICT;
break;
@@ -196,7 +188,7 @@ static void dst_print(const void *ip, co
{
const struct ip6t_opts *optinfo = (struct ip6t_opts *)match->data;
- printf(LNAME " ");
+ printf("dst ");
if (optinfo->flags & IP6T_OPTS_LEN)
printf("length:%s%u ",
optinfo->invflags & IP6T_OPTS_INV_LEN ? "!" : "",
@@ -221,22 +213,22 @@ static void dst_save(const void *ip, con
const struct ip6t_opts *optinfo = (struct ip6t_opts *)match->data;
if (optinfo->flags & IP6T_OPTS_LEN) {
- printf("--" LNAME "-len %s%u ",
+ printf("--dst-len %s%u ",
(optinfo->invflags & IP6T_OPTS_INV_LEN) ? "! " : "",
optinfo->hdrlen);
}
if (optinfo->flags & IP6T_OPTS_OPTS)
- printf("--" LNAME "-opts ");
+ printf("--dst-opts ");
print_options(optinfo->optsnr, (u_int16_t *)optinfo->opts);
if (optinfo->flags & IP6T_OPTS_NSTRICT)
- printf("--" LNAME "-not-strict ");
+ printf("--dst-not-strict ");
}
static struct ip6tables_match dst_match6 = {
- .name = LNAME,
+ .name = "dst",
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_opts)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_opts)),
Index: iptables/extensions/libip6t_hbh.c
===================================================================
--- iptables.orig/extensions/libip6t_hbh.c
+++ iptables/extensions/libip6t_hbh.c
@@ -13,36 +13,24 @@
#include <arpa/inet.h>
#define DEBUG 0
-#define HOPBYHOP 1
-#define UNAME (HOPBYHOP ? "HBH" : "DST")
-#define LNAME (HOPBYHOP ? "hbh" : "dst")
/* Function which prints out usage message. */
static void hbh_help(void)
{
printf(
-"%s v%s options:\n"
-" --%s-len [!] length total length of this header\n"
-" --%s-opts TYPE[:LEN][,TYPE[:LEN]...] \n"
-" Options and its length (list, max: %d)\n",
-UNAME , IPTABLES_VERSION, LNAME, LNAME, IP6T_OPTS_OPTSNR);
+"hbh v%s options:\n"
+" --hbh-len [!] length total length of this header\n"
+" --hbh-opts TYPE[:LEN][,TYPE[:LEN]...] \n"
+" Options and its length (list, max: %d)\n",
+IPTABLES_VERSION, IP6T_OPTS_OPTSNR);
}
-#if HOPBYHOP
static const struct option hbh_opts[] = {
{ "hbh-len", 1, NULL, '1' },
{ "hbh-opts", 1, NULL, '2' },
{ "hbh-not-strict", 1, NULL, '3' },
{ }
};
-#else
-static const struct option hbh_opts[] = {
- { "dst-len", 1, NULL, '1' },
- { "dst-opts", 1, NULL, '2' },
- { "dst-not-strict", 1, NULL, '3' },
- { }
-};
-#endif
static u_int32_t
parse_opts_num(const char *idstr, const char *typestr)
@@ -54,7 +42,7 @@ parse_opts_num(const char *idstr, const
if ( idstr == ep ) {
exit_error(PARAMETER_PROBLEM,
- "%s no valid digits in %s `%s'", UNAME, typestr, idstr);
+ "hbh: no valid digits in %s `%s'", typestr, idstr);
}
if ( id == ULONG_MAX && errno == ERANGE ) {
exit_error(PARAMETER_PROBLEM,
@@ -63,7 +51,7 @@ parse_opts_num(const char *idstr, const
}
if ( *idstr != '\0' && *ep != '\0' ) {
exit_error(PARAMETER_PROBLEM,
- "%s error parsing %s `%s'", UNAME, typestr, idstr);
+ "hbh: error parsing %s `%s'", typestr, idstr);
}
return (u_int32_t) id;
}
@@ -136,7 +124,7 @@ static int hbh_parse(int c, char **argv,
case '1':
if (*flags & IP6T_OPTS_LEN)
exit_error(PARAMETER_PROBLEM,
- "Only one `--%s-len' allowed", LNAME);
+ "Only one `--hbh-len' allowed");
check_inverse(optarg, &invert, &optind, 0);
optinfo->hdrlen = parse_opts_num(argv[optind-1], "length");
if (invert)
@@ -147,11 +135,11 @@ static int hbh_parse(int c, char **argv,
case '2':
if (*flags & IP6T_OPTS_OPTS)
exit_error(PARAMETER_PROBLEM,
- "Only one `--%s-opts' allowed", LNAME);
+ "Only one `--hbh-opts' allowed");
check_inverse(optarg, &invert, &optind, 0);
if (invert)
exit_error(PARAMETER_PROBLEM,
- " '!' not allowed with `--%s-opts'", LNAME);
+ " '!' not allowed with `--hbh-opts'");
optinfo->optsnr = parse_options(argv[optind-1], optinfo->opts);
optinfo->flags |= IP6T_OPTS_OPTS;
*flags |= IP6T_OPTS_OPTS;
@@ -159,10 +147,10 @@ static int hbh_parse(int c, char **argv,
case '3':
if (*flags & IP6T_OPTS_NSTRICT)
exit_error(PARAMETER_PROBLEM,
- "Only one `--%s-not-strict' allowed", LNAME);
+ "Only one `--hbh-not-strict' allowed");
if ( !(*flags & IP6T_OPTS_OPTS) )
exit_error(PARAMETER_PROBLEM,
- "`--%s-opts ...' required before `--%s-not-strict'", LNAME, LNAME);
+ "`--hbh-opts ...' required before `--hbh-not-strict'");
optinfo->flags |= IP6T_OPTS_NSTRICT;
*flags |= IP6T_OPTS_NSTRICT;
break;
@@ -193,7 +181,7 @@ static void hbh_print(const void *ip, co
{
const struct ip6t_opts *optinfo = (struct ip6t_opts *)match->data;
- printf("%s ", LNAME);
+ printf("hbh ");
if (optinfo->flags & IP6T_OPTS_LEN) {
printf("length");
printf(":%s", optinfo->invflags & IP6T_OPTS_INV_LEN ? "!" : "");
@@ -214,23 +202,20 @@ static void hbh_save(const void *ip, con
const struct ip6t_opts *optinfo = (struct ip6t_opts *)match->data;
if (optinfo->flags & IP6T_OPTS_LEN) {
- printf("--%s-len %s%u ", LNAME,
+ printf("--hbh-len %s%u ",
(optinfo->invflags & IP6T_OPTS_INV_LEN) ? "! " : "",
optinfo->hdrlen);
}
- if (optinfo->flags & IP6T_OPTS_OPTS) printf("--%s-opts ", LNAME);
+ if (optinfo->flags & IP6T_OPTS_OPTS)
+ printf("--hbh-opts ");
print_options(optinfo->optsnr, (u_int16_t *)optinfo->opts);
- if (optinfo->flags & IP6T_OPTS_NSTRICT) printf("--%s-not-strict ", LNAME);
-
+ if (optinfo->flags & IP6T_OPTS_NSTRICT)
+ printf("--hbh-not-strict ");
}
static struct ip6tables_match hbh_match6 = {
-#if HOPBYHOP
.name = "hbh",
-#else
- .name = "dst",
-#endif
.version = IPTABLES_VERSION,
.size = IP6T_ALIGN(sizeof(struct ip6t_opts)),
.userspacesize = IP6T_ALIGN(sizeof(struct ip6t_opts)),
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH */13] That sums it up
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
` (11 preceding siblings ...)
2007-10-04 10:13 ` [PATCH 13/13] Remove redundant dst/hbh lines Jan Engelhardt
@ 2007-10-04 10:14 ` Jan Engelhardt
2007-10-04 10:18 ` Jan Engelhardt
2007-10-04 16:28 ` Patrick McHardy
12 siblings, 2 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:14 UTC (permalink / raw)
To: Netfilter Developer Mailing List
Of course this series has 13, and not 14 patches, and it's
unique symbols, not unique name.
Need. More. Coke.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH */13] That sums it up
2007-10-04 10:14 ` [PATCH */13] That sums it up Jan Engelhardt
@ 2007-10-04 10:18 ` Jan Engelhardt
2007-10-04 16:28 ` Patrick McHardy
1 sibling, 0 replies; 16+ messages in thread
From: Jan Engelhardt @ 2007-10-04 10:18 UTC (permalink / raw)
To: Netfilter Developer Mailing List
On Oct 4 2007 12:14, Jan Engelhardt wrote:
>Of course this series has 13, and not 14 patches, and it's
>unique symbols, not unique name.
>Need. More. Coke.
And it goes on top of r7051, so an extra `svn merge -r7052:7051
libipt_addrtype.c` is needed right before patch 9/13.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH */13] That sums it up
2007-10-04 10:14 ` [PATCH */13] That sums it up Jan Engelhardt
2007-10-04 10:18 ` Jan Engelhardt
@ 2007-10-04 16:28 ` Patrick McHardy
1 sibling, 0 replies; 16+ messages in thread
From: Patrick McHardy @ 2007-10-04 16:28 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Netfilter Developer Mailing List
Jan Engelhardt wrote:
> Of course this series has 13, and not 14 patches, and it's
> unique symbols, not unique name.
All applied, thanks a lot for cleaning this up :)
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2007-10-04 16:29 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-04 10:11 [PATCH 01/13] Remove stray NULLs Jan Engelhardt
2007-10-04 10:11 ` [PATCH 02/14] Delete empty ->init() functions Jan Engelhardt
2007-10-04 10:11 ` [PATCH 03/14] Delete empty ->final_check() functions Jan Engelhardt
2007-10-04 10:11 ` [PATCH 04/14] Delete empty ->print() and ->save() functions Jan Engelhardt
2007-10-04 10:12 ` [PATCH 05/13] Constify data structures Jan Engelhardt
2007-10-04 10:12 ` [PATCH 06/13] No ipt in xt Jan Engelhardt
2007-10-04 10:12 ` [PATCH 07/13] Unique symbols 1/6 Jan Engelhardt
2007-10-04 10:12 ` [PATCH 08/13] Unique names 2/6 Jan Engelhardt
2007-10-04 10:13 ` [PATCH 09/13] Unique names 3/6 Jan Engelhardt
2007-10-04 10:13 ` [PATCH 10/13] Unique names 4/6 Jan Engelhardt
2007-10-04 10:13 ` [PATCH 11/13] Unique names 5/6 Jan Engelhardt
2007-10-04 10:13 ` [PATCH 12/13] Unique symbols 6/6 Jan Engelhardt
2007-10-04 10:13 ` [PATCH 13/13] Remove redundant dst/hbh lines Jan Engelhardt
2007-10-04 10:14 ` [PATCH */13] That sums it up Jan Engelhardt
2007-10-04 10:18 ` Jan Engelhardt
2007-10-04 16:28 ` Patrick McHardy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).