From 932e648f38ac16b1ea14c1f66f23951388448c5a Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 4 Oct 2007 16:27:30 +0000 Subject: Unique names 2/6 Give symbols of libxt targets 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_CONNSECMARK.c | 51 ++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 24 deletions(-) (limited to 'extensions/libxt_CONNSECMARK.c') diff --git a/extensions/libxt_CONNSECMARK.c b/extensions/libxt_CONNSECMARK.c index bf3b1a1a..a7d7cf7d 100644 --- a/extensions/libxt_CONNSECMARK.c +++ b/extensions/libxt_CONNSECMARK.c @@ -14,7 +14,7 @@ #define PFX "CONNSECMARK target: " -static void help(void) +static void CONNSECMARK_help(void) { printf( "CONNSECMARK target v%s options:\n" @@ -24,14 +24,15 @@ static void help(void) IPTABLES_VERSION); } -static const struct option opts[] = { +static const struct option CONNSECMARK_opts[] = { { "save", 0, 0, '1' }, { "restore", 0, 0, '2' }, { 0 } }; -static int parse(int c, char **argv, int invert, unsigned int *flags, - const void *entry, struct xt_entry_target **target) +static int +CONNSECMARK_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_target **target) { struct xt_connsecmark_target_info *info = (struct xt_connsecmark_target_info*)(*target)->data; @@ -60,7 +61,7 @@ static int parse(int c, char **argv, int invert, unsigned int *flags, return 1; } -static void final_check(unsigned int flags) +static void CONNSECMARK_check(unsigned int flags) { if (!flags) exit_error(PARAMETER_PROBLEM, PFX "parameter required"); @@ -86,8 +87,9 @@ static void print_connsecmark(struct xt_connsecmark_target_info *info) } } -static void print(const void *ip, - const struct xt_entry_target *target, int numeric) +static void +CONNSECMARK_print(const void *ip, const struct xt_entry_target *target, + int numeric) { struct xt_connsecmark_target_info *info = (struct xt_connsecmark_target_info*)(target)->data; @@ -96,7 +98,8 @@ static void print(const void *ip, print_connsecmark(info); } -static void save(const void *ip, const struct xt_entry_target *target) +static void +CONNSECMARK_save(const void *ip, const struct xt_entry_target *target) { struct xt_connsecmark_target_info *info = (struct xt_connsecmark_target_info*)target->data; @@ -105,38 +108,38 @@ static void save(const void *ip, const struct xt_entry_target *target) print_connsecmark(info); } -static struct xtables_target connsecmark = { +static struct xtables_target connsecmark_target = { .family = AF_INET, .name = "CONNSECMARK", .version = IPTABLES_VERSION, .revision = 0, .size = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)), .userspacesize = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)), - .parse = &parse, - .help = &help, - .final_check = &final_check, - .print = &print, - .save = &save, - .extra_opts = opts, + .parse = CONNSECMARK_parse, + .help = CONNSECMARK_help, + .final_check = CONNSECMARK_check, + .print = CONNSECMARK_print, + .save = CONNSECMARK_save, + .extra_opts = CONNSECMARK_opts, }; -static struct xtables_target connsecmark6 = { +static struct xtables_target connsecmark_target6 = { .family = AF_INET6, .name = "CONNSECMARK", .version = IPTABLES_VERSION, .revision = 0, .size = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)), .userspacesize = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)), - .parse = &parse, - .help = &help, - .final_check = &final_check, - .print = &print, - .save = &save, - .extra_opts = opts, + .parse = CONNSECMARK_parse, + .help = CONNSECMARK_help, + .final_check = CONNSECMARK_check, + .print = CONNSECMARK_print, + .save = CONNSECMARK_save, + .extra_opts = CONNSECMARK_opts, }; void _init(void) { - xtables_register_target(&connsecmark); - xtables_register_target(&connsecmark6); + xtables_register_target(&connsecmark_target); + xtables_register_target(&connsecmark_target6); } -- cgit v1.2.3