From 997045f536026c0d643bf884da5ff5de2605197f Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 4 Oct 2007 16:29:21 +0000 Subject: 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_icmp6.c | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) (limited to 'extensions/libip6t_icmp6.c') diff --git a/extensions/libip6t_icmp6.c b/extensions/libip6t_icmp6.c index 02108497..febf5237 100644 --- a/extensions/libip6t_icmp6.c +++ b/extensions/libip6t_icmp6.c @@ -74,8 +74,7 @@ print_icmpv6types(void) } /* Function which prints out usage message. */ -static void -help(void) +static void icmp6_help(void) { printf( "ICMPv6 v%s options:\n" @@ -85,7 +84,7 @@ help(void) print_icmpv6types(); } -static const struct option opts[] = { +static const struct option icmp6_opts[] = { { "icmpv6-type", 1, NULL, '1' }, { } }; @@ -144,8 +143,7 @@ parse_icmpv6(const char *icmpv6type, u_int8_t *type, u_int8_t code[]) } /* Initialize the match. */ -static void -init(struct xt_entry_match *m) +static void icmp6_init(struct xt_entry_match *m) { struct ip6t_icmp *icmpv6info = (struct ip6t_icmp *)m->data; @@ -154,10 +152,8 @@ init(struct xt_entry_match *m) /* 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) +static int icmp6_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_match **match) { struct ip6t_icmp *icmpv6info = (struct ip6t_icmp *)(*match)->data; @@ -219,10 +215,8 @@ static void print_icmpv6type(u_int8_t type, } /* Prints out the union ipt_matchinfo. */ -static void -print(const void *ip, - const struct xt_entry_match *match, - int numeric) +static void icmp6_print(const void *ip, const struct xt_entry_match *match, + int numeric) { const struct ip6t_icmp *icmpv6 = (struct ip6t_icmp *)match->data; @@ -237,7 +231,7 @@ print(const void *ip, } /* Saves the match in parsable form to stdout. */ -static void save(const void *ip, const struct xt_entry_match *match) +static void icmp6_save(const void *ip, const struct xt_entry_match *match) { const struct ip6t_icmp *icmpv6 = (struct ip6t_icmp *)match->data; @@ -250,28 +244,28 @@ static void save(const void *ip, const struct xt_entry_match *match) printf(" "); } -static void final_check(unsigned int flags) +static void icmp6_check(unsigned int flags) { if (!flags) exit_error(PARAMETER_PROBLEM, "icmpv6 match: You must specify `--icmpv6-type'"); } -static struct ip6tables_match icmpv6 = { +static struct ip6tables_match icmp6_match6 = { .name = "icmp6", .version = IPTABLES_VERSION, .size = IP6T_ALIGN(sizeof(struct ip6t_icmp)), .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_icmp)), - .help = &help, - .init = &init, - .parse = &parse, - .final_check = &final_check, - .print = &print, - .save = &save, - .extra_opts = opts, + .help = icmp6_help, + .init = icmp6_init, + .parse = icmp6_parse, + .final_check = icmp6_check, + .print = icmp6_print, + .save = icmp6_save, + .extra_opts = icmp6_opts, }; void _init(void) { - register_match6(&icmpv6); + register_match6(&icmp6_match6); } -- cgit v1.2.3