summaryrefslogtreecommitdiffstats
path: root/extensions/libipt_condition.c
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/libipt_condition.c')
-rw-r--r--extensions/libipt_condition.c44
1 files changed, 16 insertions, 28 deletions
diff --git a/extensions/libipt_condition.c b/extensions/libipt_condition.c
index 8ce9b530..4a98dd8c 100644
--- a/extensions/libipt_condition.c
+++ b/extensions/libipt_condition.c
@@ -8,9 +8,7 @@
#include<linux/netfilter_ipv4/ip_tables.h>
#include<linux/netfilter_ipv4/ipt_condition.h>
-
-static void
-help(void)
+static void condition_help(void)
{
printf("condition match v%s options:\n"
"--condition [!] filename "
@@ -18,16 +16,13 @@ help(void)
IPTABLES_VERSION);
}
-
-static const struct option opts[] = {
+static const struct option condition_opts[] = {
{ .name = "condition", .has_arg = 1, .flag = 0, .val = 'X' },
{ .name = 0 }
};
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int condition_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct condition_info *info =
(struct condition_info *) (*match)->data;
@@ -53,19 +48,15 @@ parse(int c, char **argv, int invert, unsigned int *flags,
return 0;
}
-
-static void
-final_check(unsigned int flags)
+static void condition_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
"Condition match: must specify --condition");
}
-
-static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+static void condition_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct condition_info *info =
(const struct condition_info *) match->data;
@@ -74,9 +65,7 @@ print(const void *ip,
}
-static void
-save(const void *ip,
- const struct xt_entry_match *match)
+static void condition_save(const void *ip, const struct xt_entry_match *match)
{
const struct condition_info *info =
(const struct condition_info *) match->data;
@@ -84,23 +73,22 @@ save(const void *ip,
printf("--condition %s\"%s\" ", (info->invert) ? "! " : "", info->name);
}
-
-static struct iptables_match condition = {
+static struct iptables_match condition_match = {
.name = "condition",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct condition_info)),
.userspacesize = IPT_ALIGN(sizeof(struct condition_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = condition_help,
+ .parse = condition_parse,
+ .final_check = condition_check,
+ .print = condition_print,
+ .save = condition_save,
+ .extra_opts = condition_opts,
};
void
_init(void)
{
- register_match(&condition);
+ register_match(&condition_match);
}