From 0a0a8dbc129729e0028b64b2e9cc8f099f13c4dd 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:27:07 +0000 Subject: [PATCH 07/13] 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_esp.c | 50 +++++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 27 deletions(-) (limited to 'extensions/libxt_esp.c') diff --git a/extensions/libxt_esp.c b/extensions/libxt_esp.c index 6faaba6..e5b5eaa 100644 --- a/extensions/libxt_esp.c +++ b/extensions/libxt_esp.c @@ -9,8 +9,7 @@ #include /* Function which prints out usage message. */ -static void -help(void) +static void esp_help(void) { printf( "ESP v%s options:\n" @@ -19,7 +18,7 @@ help(void) IPTABLES_VERSION); } -static const struct option opts[] = { +static const struct option esp_opts[] = { { "espspi", 1, NULL, '1' }, { } }; @@ -70,8 +69,7 @@ parse_esp_spis(const char *spistring, u_int32_t *spis) } /* Initialize the match. */ -static void -init(struct xt_entry_match *m) +static void esp_init(struct xt_entry_match *m) { struct xt_esp *espinfo = (struct xt_esp *)m->data; @@ -83,9 +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) +esp_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_match **match) { struct xt_esp *espinfo = (struct xt_esp *)(*match)->data; @@ -123,8 +120,7 @@ print_spis(const char *name, u_int32_t min, u_int32_t max, /* Prints out the union ipt_matchinfo. */ static void -print(const void *ip, - const struct xt_entry_match *match, int numeric) +esp_print(const void *ip, const struct xt_entry_match *match, int numeric) { const struct xt_esp *esp = (struct xt_esp *)match->data; @@ -137,7 +133,7 @@ print(const void *ip, } /* Saves the union ipt_matchinfo in parsable form to stdout. */ -static void save(const void *ip, const struct xt_entry_match *match) +static void esp_save(const void *ip, const struct xt_entry_match *match) { const struct xt_esp *espinfo = (struct xt_esp *)match->data; @@ -157,37 +153,37 @@ static void save(const void *ip, const struct xt_entry_match *match) } -static struct xtables_match esp = { +static struct xtables_match esp_match = { .family = AF_INET, .name = "esp", .version = IPTABLES_VERSION, .size = XT_ALIGN(sizeof(struct xt_esp)), .userspacesize = XT_ALIGN(sizeof(struct xt_esp)), - .help = &help, - .init = &init, - .parse = &parse, - .print = &print, - .save = &save, - .extra_opts = opts + .help = esp_help, + .init = esp_init, + .parse = esp_parse, + .print = esp_print, + .save = esp_save, + .extra_opts = esp_opts, }; -static struct xtables_match esp6 = { +static struct xtables_match esp_match6 = { .family = AF_INET6, .name = "esp", .version = IPTABLES_VERSION, .size = XT_ALIGN(sizeof(struct xt_esp)), .userspacesize = XT_ALIGN(sizeof(struct xt_esp)), - .help = &help, - .init = &init, - .parse = &parse, - .print = &print, - .save = &save, - .extra_opts = opts + .help = esp_help, + .init = esp_init, + .parse = esp_parse, + .print = esp_print, + .save = esp_save, + .extra_opts = esp_opts, }; void _init(void) { - xtables_register_match(&esp); - xtables_register_match(&esp6); + xtables_register_match(&esp_match); + xtables_register_match(&esp_match6); } -- cgit v1.2.3