From 2df127b923c944f82e4fff5bd59793b5eee6834f 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:29:21 +0000 Subject: [PATCH 11/13] Unique names 5/6 Give symbols of libxt matches unique names (3/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/libip6t_hl.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'extensions/libip6t_hl.c') diff --git a/extensions/libip6t_hl.c b/extensions/libip6t_hl.c index e4d2ffe..87a1eeb 100644 --- a/extensions/libip6t_hl.c +++ b/extensions/libip6t_hl.c @@ -15,7 +15,7 @@ #include #include -static void help(void) +static void hl_help(void) { printf( "HL match v%s options:\n" @@ -25,9 +25,8 @@ static void help(void) , IPTABLES_VERSION); } -static int parse(int c, char **argv, int invert, unsigned int *flags, - const void *entry, - struct xt_entry_match **match) +static int hl_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_match **match) { struct ip6t_hl_info *info = (struct ip6t_hl_info *) (*match)->data; u_int8_t value; @@ -81,7 +80,7 @@ static int parse(int c, char **argv, int invert, unsigned int *flags, return 1; } -static void final_check(unsigned int flags) +static void hl_check(unsigned int flags) { if (!flags) exit_error(PARAMETER_PROBLEM, @@ -89,9 +88,8 @@ static void final_check(unsigned int flags) "`--hl-eq', `--hl-lt', `--hl-gt'"); } -static void print(const void *ip, - const struct xt_entry_match *match, - int numeric) +static void hl_print(const void *ip, const struct xt_entry_match *match, + int numeric) { static const char *op[] = { [IP6T_HL_EQ] = "==", @@ -105,8 +103,7 @@ static void print(const void *ip, printf("HL match HL %s %u ", op[info->mode], info->hop_limit); } -static void save(const void *ip, - const struct xt_entry_match *match) +static void hl_save(const void *ip, const struct xt_entry_match *match) { static const char *op[] = { [IP6T_HL_EQ] = "eq", @@ -120,7 +117,7 @@ static void save(const void *ip, printf("--hl-%s %u ", op[info->mode], info->hop_limit); } -static const struct option opts[] = { +static const struct option hl_opts[] = { { .name = "hl", .has_arg = 1, .val = '2' }, { .name = "hl-eq", .has_arg = 1, .val = '2' }, { .name = "hl-lt", .has_arg = 1, .val = '3' }, @@ -128,22 +125,21 @@ static const struct option opts[] = { { } }; -static -struct ip6tables_match hl = { +static struct ip6tables_match hl_match6 = { .name = "hl", .version = IPTABLES_VERSION, .size = IP6T_ALIGN(sizeof(struct ip6t_hl_info)), .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_hl_info)), - .help = &help, - .parse = &parse, - .final_check = &final_check, - .print = &print, - .save = &save, - .extra_opts = opts + .help = hl_help, + .parse = hl_parse, + .final_check = hl_check, + .print = hl_print, + .save = hl_save, + .extra_opts = hl_opts, }; void _init(void) { - register_match6(&hl); + register_match6(&hl_match6); } -- cgit v1.2.3