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>
#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"
);
}
-static const struct option opts[] = {
+static const struct option comment_opts[] = {
{ "comment", 1, NULL, '1' },
{ }
};
/* 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;
}
/* 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,
/* 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;
/* 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;
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);
}
#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"
"\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' },
/* 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;
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'"
/* 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;
}
/* 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;
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);
}
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,
.extra_opts = connlimit_opts,
};
-static struct xtables_match connlimit_reg6 = {
+static struct xtables_match connlimit_match6 = {
.name = "connlimit",
.family = AF_INET6,
.version = IPTABLES_VERSION,
void _init(void)
{
- xtables_register_match(&connlimit_reg4);
- xtables_register_match(&connlimit_reg6);
+ xtables_register_match(&connlimit_match);
+ xtables_register_match(&connlimit_match6);
}
#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"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option connmark_opts[] = {
{ "mark", 1, NULL, '1' },
{ }
};
/* 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;
}
/* 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,
/* 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;
}
/* 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;
.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 = {
.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)
#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"
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' },
}
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;
/* 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;
}
/* 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;
}
}
-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);
}
/* 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"
);
}
-static const struct option opts[] = {
+static const struct option dscp_opts[] = {
{ "dscp", 1, NULL, 'F' },
{ "dscp-class", 1, NULL, 'G' },
{ }
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;
return 1;
}
-static void
-final_check(unsigned int flags)
+static void dscp_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
/* 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;
}
/* 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;
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);
}
#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"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option esp_opts[] = {
{ "espspi", 1, NULL, '1' },
{ }
};
}
/* 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;
/* 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;
/* 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;
}
/* 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;
}
-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);
}
#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"
"\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, '&' },
}
/* 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;
/* 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;
}
/* 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,
}
/* 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;
}
/* 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;
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);
}
#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"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option helper_opts[] = {
{ "helper", 1, NULL, '1' },
{ }
};
/* 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;
}
/* 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,
/* 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;
}
/* 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);
}
#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"
}
-static const struct option opts[] = {
+static const struct option length_opts[] = {
{ "length", 1, NULL, '1' },
{ }
};
/* 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;
}
/* 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,
/* 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);
}
#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"
"\n", IPTABLES_VERSION, XT_LIMIT_BURST);
}
-static const struct option opts[] = {
+static const struct option limit_opts[] = {
{ "limit", 1, NULL, '%' },
{ "limit-burst", 1, NULL, '$' },
{ }
}
/* 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;
/* 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;
/* 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);
}
/* 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;
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);
}
#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"
"\n", IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option mac_opts[] = {
{ "mac-source", 1, NULL, '1' },
{ }
};
/* 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;
}
/* 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,
/* 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 ");
}
/* 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("! ");
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);
}
#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"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option mark_opts[] = {
{ "mark", 1, NULL, '1' },
{ }
};
/* 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;
}
/* 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,
/* 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;
/* 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;
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);
}
#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"
IPTABLES_VERSION);
}
-static void
-help_v1(void)
+static void multiport_help_v1(void)
{
printf(
"multiport v%s options:\n"
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' },
/* 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
}
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
}
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");
/* 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;
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;
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;
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;
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);
}
#include <linux/if_ether.h>
#endif
-static void
-help(void)
+static void physdev_help(void)
{
printf(
"physdev v%s options:\n"
"\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' },
};
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;
}
-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;
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;
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);
}
}
/* 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'},
{ }
};
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;
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'");
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;
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;
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);
}
#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");
/* 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);
/* 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);
/* 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;
return 1;
}
-struct xtables_match quota = {
+struct xtables_match quota_match = {
.family = AF_INET,
.name = "quota",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof (struct xt_quota_info)),
.userspacesize = offsetof(struct xt_quota_info, quota),
- .help = &help,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = quota_help,
+ .parse = quota_parse,
+ .print = quota_print,
+ .save = quota_save,
+ .extra_opts = quota_opts,
};
-struct xtables_match quota6 = {
+struct xtables_match quota_match6 = {
.family = AF_INET6,
.name = "quota",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof (struct xt_quota_info)),
.userspacesize = offsetof(struct xt_quota_info, quota),
- .help = &help,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = quota_help,
+ .parse = quota_parse,
+ .print = quota_print,
+ .save = quota_save,
+ .extra_opts = quota_opts,
};
void
_init(void)
{
- xtables_register_match("a);
- xtables_register_match("a6);
+ xtables_register_match("a_match);
+ xtables_register_match("a_match6);
}
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;
}
}
-static void help(void)
+static void sctp_help(void)
{
printf(
"SCTP match v%s options\n"
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' },
}
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;
/* 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;
}
/* 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;
}
}
-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);
}
#include <xtables.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void standard_help(void)
{
printf(
"Standard v%s options:\n"
/* Function which parses command options; returns true if it
ate an option */
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *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);
}
#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"
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' },
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;
}
/* 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");
}
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;
}
/* 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);
}
#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"
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' },
{ }
};
-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;
/* 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;
/* 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,
/* 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;
/* 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;
}
-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);
}
#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"
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' },
}
/* 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;
/* 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;
/* 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;
}
/* 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;
}
}
-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);
}
#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"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option tcpmss_opts[] = {
{ "mss", 1, NULL, '1' },
{ }
};
/* 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;
}
/* 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,
/* 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;
}
/* 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;
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);
}
printf("--utc ");
}
-static struct xtables_match time_reg = {
+static struct xtables_match time_match = {
.name = "time",
.family = AF_INET,
.version = IPTABLES_VERSION,
.extra_opts = time_opts,
};
-static struct xtables_match time6_reg = {
+static struct xtables_match time_match6 = {
.name = "time",
.family = AF_INET6,
.version = IPTABLES_VERSION,
void _init(void)
{
- xtables_register_match(&time_reg);
- xtables_register_match(&time6_reg);
+ xtables_register_match(&time_match);
+ xtables_register_match(&time_match6);
}
return;
}
-static struct xtables_match u32_reg = {
+static struct xtables_match u32_match = {
.name = "u32",
.family = AF_INET,
.version = IPTABLES_VERSION,
.extra_opts = u32_opts,
};
-static struct xtables_match u32_reg6 = {
+static struct xtables_match u32_match6 = {
.name = "u32",
.family = AF_INET6,
.version = IPTABLES_VERSION,
void _init(void)
{
- xtables_register_match(&u32_reg);
- xtables_register_match(&u32_reg6);
+ xtables_register_match(&u32_match);
+ xtables_register_match(&u32_match6);
return;
}
#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"
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' },
}
/* 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;
/* 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;
/* 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;
}
/* 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;
}
}
-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);
}