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_rt.c | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'extensions/libip6t_rt.c') diff --git a/extensions/libip6t_rt.c b/extensions/libip6t_rt.c index 036f1011..89469008 100644 --- a/extensions/libip6t_rt.c +++ b/extensions/libip6t_rt.c @@ -15,8 +15,7 @@ /*#define DEBUG 1*/ /* Function which prints out usage message. */ -static void -help(void) +static void rt_help(void) { printf( "RT v%s options:\n" @@ -29,7 +28,7 @@ help(void) IPTABLES_VERSION, IP6T_RT_HOPS); } -static const struct option opts[] = { +static const struct option rt_opts[] = { { "rt-type", 1, NULL, '1' }, { "rt-segsleft", 1, NULL, '2' }, { "rt-len", 1, NULL, '3' }, @@ -138,8 +137,7 @@ parse_addresses(const char *addrstr, struct in6_addr *addrp) } /* Initialize the match. */ -static void -init(struct xt_entry_match *m) +static void rt_init(struct xt_entry_match *m) { struct ip6t_rt *rtinfo = (struct ip6t_rt *)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 rt_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_match **match) { struct ip6t_rt *rtinfo = (struct ip6t_rt *)(*match)->data; @@ -269,9 +265,8 @@ print_addresses(int addrnr, struct in6_addr *addrp) } /* Prints out the union ip6t_matchinfo. */ -static void -print(const void *ip, - const struct xt_entry_match *match, int numeric) +static void rt_print(const void *ip, const struct xt_entry_match *match, + int numeric) { const struct ip6t_rt *rtinfo = (struct ip6t_rt *)match->data; @@ -297,7 +292,7 @@ print(const void *ip, } /* Saves the union ip6t_matchinfo in parsable form to stdout. */ -static void save(const void *ip, const struct xt_entry_match *match) +static void rt_save(const void *ip, const struct xt_entry_match *match) { const struct ip6t_rt *rtinfo = (struct ip6t_rt *)match->data; @@ -334,21 +329,21 @@ static void save(const void *ip, const struct xt_entry_match *match) } -static struct ip6tables_match rt = { +static struct ip6tables_match rt_match6 = { .name = "rt", .version = IPTABLES_VERSION, .size = IP6T_ALIGN(sizeof(struct ip6t_rt)), .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_rt)), - .help = &help, - .init = &init, - .parse = &parse, - .print = &print, - .save = &save, - .extra_opts = opts, + .help = rt_help, + .init = rt_init, + .parse = rt_parse, + .print = rt_print, + .save = rt_save, + .extra_opts = rt_opts, }; void _init(void) { - register_match6(&rt); + register_match6(&rt_match6); } -- cgit v1.2.3