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_REJECT.c | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'extensions/libipt_REJECT.c') diff --git a/extensions/libipt_REJECT.c b/extensions/libipt_REJECT.c index c2b3b35..7e23ada 100644 --- a/extensions/libipt_REJECT.c +++ b/extensions/libipt_REJECT.c @@ -67,8 +67,7 @@ print_reject_types(void) /* Saves the union ipt_targinfo in parsable form to stdout. */ /* Function which prints out usage message. */ -static void -help(void) +static void REJECT_help(void) { printf( "REJECT options:\n" @@ -80,14 +79,13 @@ help(void) printf("(*) See man page or read the INCOMPATIBILITES file for compatibility issues.\n"); } -static const struct option opts[] = { +static const struct option REJECT_opts[] = { { "reject-with", 1, NULL, '1' }, { } }; /* Allocate and initialize the target. */ -static void -init(struct xt_entry_target *t) +static void REJECT_init(struct xt_entry_target *t) { struct ipt_reject_info *reject = (struct ipt_reject_info *)t->data; @@ -98,10 +96,8 @@ init(struct xt_entry_target *t) /* 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 REJECT_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_target **target) { struct ipt_reject_info *reject = (struct ipt_reject_info *)(*target)->data; unsigned int limit = sizeof(reject_table)/sizeof(struct reject_names); @@ -133,10 +129,8 @@ parse(int c, char **argv, int invert, unsigned int *flags, } /* Prints out ipt_reject_info. */ -static void -print(const void *ip, - const struct xt_entry_target *target, - int numeric) +static void REJECT_print(const void *ip, const struct xt_entry_target *target, + int numeric) { const struct ipt_reject_info *reject = (const struct ipt_reject_info *)target->data; @@ -150,7 +144,7 @@ print(const void *ip, } /* Saves ipt_reject in parsable form to stdout. */ -static void save(const void *ip, const struct xt_entry_target *target) +static void REJECT_save(const void *ip, const struct xt_entry_target *target) { const struct ipt_reject_info *reject = (const struct ipt_reject_info *)target->data; @@ -163,20 +157,20 @@ static void save(const void *ip, const struct xt_entry_target *target) printf("--reject-with %s ", reject_table[i].name); } -static struct iptables_target reject = { +static struct iptables_target reject_target = { .name = "REJECT", .version = IPTABLES_VERSION, .size = IPT_ALIGN(sizeof(struct ipt_reject_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_reject_info)), - .help = &help, - .init = &init, - .parse = &parse, - .print = &print, - .save = &save, - .extra_opts = opts + .help = REJECT_help, + .init = REJECT_init, + .parse = REJECT_parse, + .print = REJECT_print, + .save = REJECT_save, + .extra_opts = REJECT_opts, }; void _init(void) { - register_target(&reject); + register_target(&reject_target); } -- cgit v1.2.3