]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Unique symbols 1/6
authorJan Engelhardt <jengelh@medozas.de>
Thu, 4 Oct 2007 16:27:07 +0000 (16:27 +0000)
committerPatrick McHardy <kaber@trash.net>
Thu, 4 Oct 2007 16:27:07 +0000 (16:27 +0000)
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>
26 files changed:
extensions/libxt_comment.c
extensions/libxt_connbytes.c
extensions/libxt_connlimit.c
extensions/libxt_connmark.c
extensions/libxt_dccp.c
extensions/libxt_dscp.c
extensions/libxt_esp.c
extensions/libxt_hashlimit.c
extensions/libxt_helper.c
extensions/libxt_length.c
extensions/libxt_limit.c
extensions/libxt_mac.c
extensions/libxt_mark.c
extensions/libxt_multiport.c
extensions/libxt_physdev.c
extensions/libxt_pkttype.c
extensions/libxt_quota.c
extensions/libxt_sctp.c
extensions/libxt_standard.c
extensions/libxt_statistic.c
extensions/libxt_string.c
extensions/libxt_tcp.c
extensions/libxt_tcpmss.c
extensions/libxt_time.c
extensions/libxt_u32.c
extensions/libxt_udp.c

index c176173bf0238ff81a33b5f9019aedfe1ed6a3c6..e29ce166964370a16182d4c30e4be2baedf9672a 100644 (file)
@@ -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_comment_info *info)
 /* 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, unsigned int *flags,
 }
 
 /* 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_entry_match *match)
        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 8efde372a32b71fc22b8ca7e420a5f450c09449f..3ec08d0507bbdb51f220f3872df1624a66e5d724 100644 (file)
@@ -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_connbytes_info *si)
 /* 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, unsigned int *flags,
        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_connbytes_info *sinfo)
 
 /* 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 struct xt_entry_match *match)
        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 434eab213e003acd78b168aea04e7e3b41091569..1b86d6e97cad951bbdceb5483c81d66ed60b616d 100644 (file)
@@ -178,7 +178,7 @@ static void connlimit_save6(const void *ip, const struct xt_entry_match *match)
               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_reg4 = {
        .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_reg6 = {
 
 void _init(void)
 {
-       xtables_register_match(&connlimit_reg4);
-       xtables_register_match(&connlimit_reg6);
+       xtables_register_match(&connlimit_match);
+       xtables_register_match(&connlimit_match6);
 }
index e9d47bca095cc5cf156a7e747c6ab4393ed38232..f2e32f2c95915e7290ce7dfbae7d3ca406bb4b92 100644 (file)
@@ -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 long mask, int numeric)
 }
 
 /* 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_match = {
        .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_match6 = {
        .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 d794c2dd745694d28483cafc30bd17e2f2bc877a..450f24983c72fdac506d0e72f3afa0b5d8b4a2e8 100644 (file)
 #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 *optstring)
 }
 
 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, int numeric)
 
 /* 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 e0fadd762af21a27531a36a12c4e827a03387d5d..ae85483203c1bcbeddc60061c1bd50b96181585c 100644 (file)
@@ -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_dscp_info *dinfo)
 
 
 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, unsigned int *flags,
        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, int numeric)
 
 /* 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_entry_match *match)
        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 6faaba68697718d535c54f6972dbd1f3e8abb6c8..e5b5eaa9b18bf57f033399e07b32e4b415978a0b 100644 (file)
@@ -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_int32_t *spis)
 }
 
 /* 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 min, u_int32_t max,
 
 /* 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 struct xt_entry_match *match)
 
 }
 
-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 a641bb4d7825710468fe3452fd2e9ee51fbd27ad..982087cfc4ae359b3880cd72c803f225d6653366 100644 (file)
@@ -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_t *val)
 }
 
 /* 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_hashlimit_info *r, char *optarg)
 /* 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, unsigned int *flags,
 }
 
 /* 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_hashlimit_info *r, char separator)
 }
 
 /* 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 struct xt_entry_match *match)
                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 9c24494f27679342829c23d6f22fe751f9b2400f..390930a99ca86ae7226199381923a43b5244252b 100644 (file)
@@ -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, unsigned int *flags,
 }
 
 /* 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 5353d2cd89daa57be39ac0775735ebc06e2e95ff..c55b12bed9245dc58b9ebaa78cfa4a81e5ce0657 100644 (file)
@@ -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_length_info *info)
 /* 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, unsigned int *flags,
 }
 
 /* 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 d0fd7bcf0057a4214aff33d2f9b8b84021b3593b..92cecf410034368404dc4972e56c3d62e3dc66a6 100644 (file)
@@ -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_t *val)
 }
 
 /* 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 struct xt_entry_match *match)
                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 69fbc56f118af54dc53271c5bf06957db89f97e1..5d84aee82696350abbad943194bb523bf628defb 100644 (file)
@@ -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_info *info)
 /* 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 macaddress[ETH_ALEN])
 }
 
 /* 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 flags)
 
 /* 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 struct xt_entry_match *match)
        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 84566217c43891c884d342560fb74cd8b7146750..b7f007b5310820f961ef52d5ff05a7fe32899089 100644 (file)
@@ -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 long mask, int numeric)
 }
 
 /* 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_entry_match *match)
        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 9abd13ebf4c203e38be78e30287927e90669ef91..809a34975757a09f9f89b61cf488c6aac0b9e9a9 100644 (file)
@@ -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 invflags)
 /* 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, unsigned int *flags,
 }
 
 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 invert, unsigned int *flags,
 }
 
 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 protocol, int numeric)
 
 /* 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 *match, int numeric, u_int16_t proto)
        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 *match, int numeric, u_int16_t proto)
        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_match *match, u_int16_t proto)
        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_entry_match *match, u_int16_t proto)
        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 3ddb702b43f2e4d1bfef793739b3d38f54a72e8e..144fbb4f46c5cb0bfa32e02e9154d8e007c46def 100644 (file)
@@ -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 struct xt_entry_match *match)
        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 cbb78be4ab64522e0abb7a6343421e318054a244..2d73560a6be280070038ba1a5e6b509df1ab5f9c 100644 (file)
@@ -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 *pkttype, struct xt_pkttype_info *info)
        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 invert, unsigned int *flags,
        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_pkttype_info *info)
        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 struct xt_entry_match *match, int numeri
        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 struct xt_entry_match *match)
        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 0e04d20352c95b4a55ac2c3c6853855f842d80c5..9f9622608ce8a1348f81ffe6df44e3d13f200c4c 100644 (file)
 
 #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_entry_match *match, int numeric)
 
 /* 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 * quota)
 
 /* 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, unsigned int *flags,
         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(&quota);
-       xtables_register_match(&quota6);
+       xtables_register_match(&quota_match);
+       xtables_register_match(&quota_match6);
 }
index 634862b6e3436d2a5197f0989f94415550e13744..681897476385a7c63c8d0f2d60449d978abfe9fd 100644 (file)
@@ -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 *einfo,
 }
 
 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 af18b3b13f4a08e6e6b6b6771fa91e93928faf08..eef9369bf82df51eef2026e6f3be27602cb4c4b8 100644 (file)
@@ -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 dc0540265756bfd661c114919188a4114036fdf5..1b34527b15927f572599410d6bdf6cdc89d8cc43 100644 (file)
@@ -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, unsigned int *flags,
 }
 
 /* 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_statistic_info *info, char *prefix)
 }
 
 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 2e94eed8b589575bcf1523e42bd342ad80d5c805..50b7f61e45e4236f2044587e94148d6454dade63 100644 (file)
@@ -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 xt_string_info *info)
 /* 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, unsigned int *flags,
 
 
 /* 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 unsigned short int len)
 
 /* 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_entry_match *match)
 }
 
 
-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 ed076678580ae70ab89177ca9c90829e931a3960..b1f12a47a0c44b9c2f9ca4ef1ffb2aac9daa7741 100644 (file)
@@ -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_int8_t *result)
 }
 
 /* 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, int invert, int numeric)
 
 /* 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 struct xt_entry_match *match)
        }
 }
 
-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 23336fd9a3e5d10b2bb5dad6c9c21d6c449df1e1..e08be4890459e83bd130ca10823b41f5e50d6139 100644 (file)
@@ -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 *mssvaluestring,
 /* 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_t mss_max, int invert, int numeric)
 }
 
 /* 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_entry_match *match)
                     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 a766f11007acf2cb944e99b0067ce61cb6d666b7..9c1f155a0c9168d0290f262c11dd57b5efa62bbf 100644 (file)
@@ -463,7 +463,7 @@ static void time_save(const void *ip, const struct xt_entry_match *match)
                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 2be5c8be2df3c66a1bf273d268ef228f34854255..18aae2dba849452bf130c93cd01db3831a2f80ec 100644 (file)
@@ -268,7 +268,7 @@ static void u32_save(const void *ip, const struct xt_entry_match *match)
        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 d9880cebcb2f396e06b9dc3295d9ea55edaec586..dd64a406007c06d595b68a18a49015d8d689c767 100644 (file)
@@ -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, u_int16_t *ports)
 }
 
 /* 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 min, u_int16_t max,
 
 /* 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 struct xt_entry_match *match)
        }
 }
 
-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);
 }