From 002261fba0ede5a039d1a65e26d2fa7a37a2f50e 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:28:39 +0000 Subject: [PATCH 09/13] Unique names 3/6 Give symbols of libxt matches unique names (2/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/libipt_tos.c | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) (limited to 'extensions/libipt_tos.c') diff --git a/extensions/libipt_tos.c b/extensions/libipt_tos.c index ebdd0c1..11c304f 100644 --- a/extensions/libipt_tos.c +++ b/extensions/libipt_tos.c @@ -23,8 +23,7 @@ struct TOS_value }; /* Function which prints out usage message. */ -static void -help(void) +static void tos_help(void) { unsigned int i; @@ -42,7 +41,7 @@ IPTABLES_VERSION); fputc('\n', stdout); } -static const struct option opts[] = { +static const struct option tos_opts[] = { { "tos", 1, NULL, '1' }, { } }; @@ -74,10 +73,8 @@ parse_tos(const char *s, struct ipt_tos_info *info) /* 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 tos_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_match **match) { struct ipt_tos_info *tosinfo = (struct ipt_tos_info *)(*match)->data; @@ -117,8 +114,7 @@ print_tos(u_int8_t tos, int numeric) } /* Final check; must have specified --tos. */ -static void -final_check(unsigned int flags) +static void tos_check(unsigned int flags) { if (!flags) exit_error(PARAMETER_PROBLEM, @@ -126,10 +122,8 @@ final_check(unsigned int flags) } /* Prints out the matchinfo. */ -static void -print(const void *ip, - const struct xt_entry_match *match, - int numeric) +static void tos_print(const void *ip, const struct xt_entry_match *match, + int numeric) { const struct ipt_tos_info *info = (const struct ipt_tos_info *)match->data; @@ -140,8 +134,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 tos_save(const void *ip, const struct xt_entry_match *match) { const struct ipt_tos_info *info = (const struct ipt_tos_info *)match->data; @@ -151,20 +144,20 @@ save(const void *ip, const struct xt_entry_match *match) print_tos(info->tos, 0); } -static struct iptables_match tos = { +static struct iptables_match tos_match = { .name = "tos", .version = IPTABLES_VERSION, .size = IPT_ALIGN(sizeof(struct ipt_tos_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_tos_info)), - .help = &help, - .parse = &parse, - .final_check = &final_check, - .print = &print, - .save = &save, - .extra_opts = opts + .help = tos_help, + .parse = tos_parse, + .final_check = tos_check, + .print = tos_print, + .save = tos_save, + .extra_opts = tos_opts, }; void _init(void) { - register_match(&tos); + register_match(&tos_match); } -- cgit v1.2.3