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_physdev.c | 50 +++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 27 deletions(-) (limited to 'extensions/libxt_physdev.c') diff --git a/extensions/libxt_physdev.c b/extensions/libxt_physdev.c index 3ddb702b..144fbb4f 100644 --- a/extensions/libxt_physdev.c +++ b/extensions/libxt_physdev.c @@ -12,8 +12,7 @@ #include #endif -static void -help(void) +static void physdev_help(void) { printf( "physdev v%s options:\n" @@ -25,7 +24,7 @@ help(void) "\n", IPTABLES_VERSION); } -static const struct option opts[] = { +static const struct option physdev_opts[] = { { "physdev-in", 1, NULL, '1' }, { "physdev-out", 1, NULL, '2' }, { "physdev-is-in", 0, NULL, '3' }, @@ -35,9 +34,8 @@ static const struct option opts[] = { }; static int -parse(int c, char **argv, int invert, unsigned int *flags, - const void *entry, - struct xt_entry_match **match) +physdev_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_match **match) { struct xt_physdev_info *info = (struct xt_physdev_info*)(*match)->data; @@ -108,16 +106,14 @@ multiple_use: } -static void final_check(unsigned int flags) +static void physdev_check(unsigned int flags) { if (flags == 0) exit_error(PARAMETER_PROBLEM, "PHYSDEV: no physdev option specified"); } static void -print(const void *ip, - const struct xt_entry_match *match, - int numeric) +physdev_print(const void *ip, const struct xt_entry_match *match, int numeric) { struct xt_physdev_info *info = (struct xt_physdev_info*)match->data; @@ -142,7 +138,7 @@ print(const void *ip, printf(" "); } -static void save(const void *ip, const struct xt_entry_match *match) +static void physdev_save(const void *ip, const struct xt_entry_match *match) { struct xt_physdev_info *info = (struct xt_physdev_info*)match->data; @@ -166,36 +162,36 @@ static void save(const void *ip, const struct xt_entry_match *match) printf(" "); } -static struct xtables_match physdev = { +static struct xtables_match physdev_match = { .family = AF_INET, .name = "physdev", .version = IPTABLES_VERSION, .size = XT_ALIGN(sizeof(struct xt_physdev_info)), .userspacesize = XT_ALIGN(sizeof(struct xt_physdev_info)), - .help = &help, - .parse = &parse, - .final_check = &final_check, - .print = &print, - .save = &save, - .extra_opts = opts + .help = physdev_help, + .parse = physdev_parse, + .final_check = physdev_check, + .print = physdev_print, + .save = physdev_save, + .extra_opts = physdev_opts, }; -static struct xtables_match physdev6 = { +static struct xtables_match physdev_match6 = { .family = AF_INET6, .name = "physdev", .version = IPTABLES_VERSION, .size = XT_ALIGN(sizeof(struct xt_physdev_info)), .userspacesize = XT_ALIGN(sizeof(struct xt_physdev_info)), - .help = &help, - .parse = &parse, - .final_check = &final_check, - .print = &print, - .save = &save, - .extra_opts = opts + .help = physdev_help, + .parse = physdev_parse, + .final_check = physdev_check, + .print = physdev_print, + .save = physdev_save, + .extra_opts = physdev_opts, }; void _init(void) { - xtables_register_match(&physdev); - xtables_register_match(&physdev6); + xtables_register_match(&physdev_match); + xtables_register_match(&physdev_match6); } -- cgit v1.2.3