From 002261fba0ede5a039d1a65e26d2fa7a37a2f50e Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net" Date: Thu, 4 Oct 2007 16:28:39 +0000 Subject: [PATCH 09/13] 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 --- extensions/libipt_policy.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'extensions/libipt_policy.c') diff --git a/extensions/libipt_policy.c b/extensions/libipt_policy.c index 0e27975..16797bf 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); } -- cgit v1.2.3