summaryrefslogtreecommitdiffstats
path: root/extensions/libipt_policy.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2007-10-04 16:28:39 +0000
committerPatrick McHardy <kaber@trash.net>2007-10-04 16:28:39 +0000
commit59d164019340d110d302634e429320577f0db7be (patch)
tree69c2cb242bed3041027b2ac047b1214e13be48ce /extensions/libipt_policy.c
parent932e648f38ac16b1ea14c1f66f23951388448c5a (diff)
Unique names 3/6
Give symbols of libxt matches unique names (2/3). Adds unique prefixes to all functions (most of them - especially the hook functions) so that debugging programs can unambiguously map a symbol to an address. Also unifies the names of the xtables_match/xtables_target structs, (based upon libxt_connmark.c/libip6t_*.c). Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Diffstat (limited to 'extensions/libipt_policy.c')
-rw-r--r--extensions/libipt_policy.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/extensions/libipt_policy.c b/extensions/libipt_policy.c
index 0e27975f..16797bfb 100644
--- a/extensions/libipt_policy.c
+++ b/extensions/libipt_policy.c
@@ -21,7 +21,7 @@
*/
static struct ipt_policy_info *policy_info;
-static void help(void)
+static void policy_help(void)
{
printf(
"policy v%s options:\n"
@@ -40,7 +40,7 @@ static void help(void)
IPTABLES_VERSION);
}
-static const struct option opts[] =
+static const struct option policy_opts[] =
{
{
.name = "dir",
@@ -120,9 +120,8 @@ static int parse_mode(char *s)
exit_error(PARAMETER_PROBLEM, "policy match: invalid mode `%s'", s);
}
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_match **match)
+static int policy_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_policy_info *info = (void *)(*match)->data;
struct ipt_policy_elem *e = &info->pol[info->len];
@@ -249,7 +248,7 @@ static int parse(int c, char **argv, int invert, unsigned int *flags,
return 1;
}
-static void final_check(unsigned int flags)
+static void policy_check(unsigned int flags)
{
struct ipt_policy_info *info = policy_info;
struct ipt_policy_elem *e;
@@ -381,9 +380,8 @@ static void print_flags(char *prefix, const struct ipt_policy_info *info)
printf("%sstrict ", prefix);
}
-static void print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+static void policy_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ipt_policy_info *info = (void *)match->data;
unsigned int i;
@@ -397,7 +395,7 @@ static void print(const void *ip,
}
}
-static void save(const void *ip, const struct xt_entry_match *match)
+static void policy_save(const void *ip, const struct xt_entry_match *match)
{
const struct ipt_policy_info *info = (void *)match->data;
unsigned int i;
@@ -410,20 +408,20 @@ static void save(const void *ip, const struct xt_entry_match *match)
}
}
-static struct iptables_match policy = {
+static struct iptables_match policy_match = {
.name = "policy",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_policy_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_policy_info)),
- .help = help,
- .parse = parse,
- .final_check = final_check,
- .print = print,
- .save = save,
- .extra_opts = opts
+ .help = policy_help,
+ .parse = policy_parse,
+ .final_check = policy_check,
+ .print = policy_print,
+ .save = policy_save,
+ .extra_opts = policy_opts,
};
void _init(void)
{
- register_match(&policy);
+ register_match(&policy_match);
}