From 181dead3f13befe02769ef479bcbb51801b7fc4e Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 4 Oct 2007 16:27:07 +0000 Subject: Unique symbols 1/6 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 --- extensions/libxt_helper.c | 52 +++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 29 deletions(-) (limited to 'extensions/libxt_helper.c') diff --git a/extensions/libxt_helper.c b/extensions/libxt_helper.c index 9c24494f..390930a9 100644 --- a/extensions/libxt_helper.c +++ b/extensions/libxt_helper.c @@ -9,8 +9,7 @@ #include /* 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); } -- cgit v1.2.3