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_ah.c | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'extensions/libip6t_ah.c') diff --git a/extensions/libip6t_ah.c b/extensions/libip6t_ah.c index 0b8652d..c372af5 100644 --- a/extensions/libip6t_ah.c +++ b/extensions/libip6t_ah.c @@ -9,8 +9,7 @@ #include /* Function which prints out usage message. */ -static void -help(void) +static void ah_help(void) { printf( "AH v%s options:\n" @@ -20,7 +19,7 @@ help(void) IPTABLES_VERSION); } -static const struct option opts[] = { +static const struct option ah_opts[] = { { .name = "ahspi", .has_arg = 1, .val = '1' }, { .name = "ahlen", .has_arg = 1, .val = '2' }, { .name = "ahres", .has_arg = 0, .val = '3' }, @@ -71,8 +70,7 @@ parse_ah_spis(const char *spistring, u_int32_t *spis) } /* Initialize the match. */ -static void -init(struct xt_entry_match *m) +static void ah_init(struct xt_entry_match *m) { struct ip6t_ah *ahinfo = (struct ip6t_ah *)m->data; @@ -83,10 +81,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 ah_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_match **match) { struct ip6t_ah *ahinfo = (struct ip6t_ah *)(*match)->data; @@ -149,9 +145,8 @@ print_len(const char *name, u_int32_t len, int invert) } /* Prints out the union ip6t_matchinfo. */ -static void -print(const void *ip, - const struct xt_entry_match *match, int numeric) +static void ah_print(const void *ip, const struct xt_entry_match *match, + int numeric) { const struct ip6t_ah *ah = (struct ip6t_ah *)match->data; @@ -170,7 +165,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 ah_save(const void *ip, const struct xt_entry_match *match) { const struct ip6t_ah *ahinfo = (struct ip6t_ah *)match->data; @@ -198,22 +193,21 @@ static void save(const void *ip, const struct xt_entry_match *match) printf("--ahres "); } -static -struct ip6tables_match ah = { +static struct ip6tables_match ah_match6 = { .name = "ah", .version = IPTABLES_VERSION, .size = IP6T_ALIGN(sizeof(struct ip6t_ah)), .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_ah)), - .help = &help, - .init = &init, - .parse = &parse, - .print = &print, - .save = &save, - .extra_opts = opts + .help = ah_help, + .init = ah_init, + .parse = ah_parse, + .print = ah_print, + .save = ah_save, + .extra_opts = ah_opts, }; void _init(void) { - register_match6(&ah); + register_match6(&ah_match6); } -- cgit v1.2.3