From b9f8667c366415051abe9f147385bd92562701b5 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:00 +0000 Subject: [PATCH 10/13] Unique names 4/6 Give symbols of libxt targets 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 dac8614..76632ff 100644 --- a/extensions/libipt_TOS.c +++ b/extensions/libipt_TOS.c @@ -28,8 +28,7 @@ struct TOS_value }; /* Function which prints out usage message. */ -static void -help(void) +static void TOS_help(void) { unsigned int i; @@ -47,7 +46,7 @@ IPTABLES_VERSION); fputc('\n', stdout); } -static const struct option opts[] = { +static const struct option TOS_opts[] = { { "set-tos", 1, NULL, '1' }, { } }; @@ -78,10 +77,8 @@ parse_tos(const char *s, struct ipt_tos_target_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_target **target) +static int TOS_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_target **target) { struct ipt_tos_target_info *tosinfo = (struct ipt_tos_target_info *)(*target)->data; @@ -102,8 +99,7 @@ parse(int c, char **argv, int invert, unsigned int *flags, return 1; } -static void -final_check(unsigned int flags) +static void TOS_check(unsigned int flags) { if (!flags) exit_error(PARAMETER_PROBLEM, @@ -126,10 +122,8 @@ print_tos(u_int8_t tos, int numeric) } /* Prints out the targinfo. */ -static void -print(const void *ip, - const struct xt_entry_target *target, - int numeric) +static void TOS_print(const void *ip, const struct xt_entry_target *target, + int numeric) { const struct ipt_tos_target_info *tosinfo = (const struct ipt_tos_target_info *)target->data; @@ -138,8 +132,7 @@ print(const void *ip, } /* Saves the union ipt_targinfo in parsable form to stdout. */ -static void -save(const void *ip, const struct xt_entry_target *target) +static void TOS_save(const void *ip, const struct xt_entry_target *target) { const struct ipt_tos_target_info *tosinfo = (const struct ipt_tos_target_info *)target->data; @@ -147,20 +140,20 @@ save(const void *ip, const struct xt_entry_target *target) printf("--set-tos 0x%02x ", tosinfo->tos); } -static struct iptables_target tos = { +static struct iptables_target tos_target = { .name = "TOS", .version = IPTABLES_VERSION, .size = IPT_ALIGN(sizeof(struct ipt_tos_target_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_tos_target_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_target(&tos); + register_target(&tos_target); } -- cgit v1.2.3