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_SAME.c | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'extensions/libipt_SAME.c') diff --git a/extensions/libipt_SAME.c b/extensions/libipt_SAME.c index 3dfb702..de97466 100644 --- a/extensions/libipt_SAME.c +++ b/extensions/libipt_SAME.c @@ -11,8 +11,7 @@ #include "../include/linux/netfilter_ipv4/ipt_SAME.h" /* Function which prints out usage message. */ -static void -help(void) +static void SAME_help(void) { printf( "SAME v%s options:\n" @@ -29,7 +28,7 @@ help(void) IPTABLES_VERSION); } -static const struct option opts[] = { +static const struct option SAME_opts[] = { { "to", 1, NULL, '1' }, { "nodst", 0, NULL, '2'}, { "random", 0, NULL, '3' }, @@ -37,8 +36,7 @@ static const struct option opts[] = { }; /* Initialize the target. */ -static void -init(struct xt_entry_target *t) +static void SAME_init(struct xt_entry_target *t) { struct ipt_same_info *mr = (struct ipt_same_info *)t->data; @@ -87,10 +85,8 @@ parse_to(char *arg, struct ip_nat_range *range) /* 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 SAME_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_target **target) { struct ipt_same_info *mr = (struct ipt_same_info *)(*target)->data; @@ -139,7 +135,7 @@ parse(int c, char **argv, int invert, unsigned int *flags, } /* Final check; need --to. */ -static void final_check(unsigned int flags) +static void SAME_check(unsigned int flags) { if (!(flags & IPT_SAME_OPT_TO)) exit_error(PARAMETER_PROBLEM, @@ -147,10 +143,8 @@ static void final_check(unsigned int flags) } /* Prints out the targinfo. */ -static void -print(const void *ip, - const struct xt_entry_target *target, - int numeric) +static void SAME_print(const void *ip, const struct xt_entry_target *target, + int numeric) { int count; struct ipt_same_info *mr @@ -184,8 +178,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 SAME_save(const void *ip, const struct xt_entry_target *target) { int count; struct ipt_same_info *mr @@ -215,21 +208,21 @@ save(const void *ip, const struct xt_entry_target *target) printf("--random "); } -static struct iptables_target same = { +static struct iptables_target same_target = { .name = "SAME", .version = IPTABLES_VERSION, .size = IPT_ALIGN(sizeof(struct ipt_same_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_same_info)), - .help = &help, - .init = &init, - .parse = &parse, - .final_check = &final_check, - .print = &print, - .save = &save, - .extra_opts = opts + .help = SAME_help, + .init = SAME_init, + .parse = SAME_parse, + .final_check = SAME_check, + .print = SAME_print, + .save = SAME_save, + .extra_opts = SAME_opts, }; void _init(void) { - register_target(&same); + register_target(&same_target); } -- cgit v1.2.3