diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2007-10-04 16:29:00 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2007-10-04 16:29:00 +0000 |
commit | 1d5b63d12984d12c8d87242179855e17657be16d (patch) | |
tree | 9777125dbd44238ad72fbfb4144736cf2339d031 /extensions/libipt_REDIRECT.c | |
parent | 59d164019340d110d302634e429320577f0db7be (diff) |
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 <jengelh@gmx.de>
Diffstat (limited to 'extensions/libipt_REDIRECT.c')
-rw-r--r-- | extensions/libipt_REDIRECT.c | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/extensions/libipt_REDIRECT.c b/extensions/libipt_REDIRECT.c index 8fa1c325..077b6d88 100644 --- a/extensions/libipt_REDIRECT.c +++ b/extensions/libipt_REDIRECT.c @@ -12,8 +12,7 @@ #define IPT_REDIRECT_OPT_RANDOM 0x02 /* Function which prints out usage message. */ -static void -help(void) +static void REDIRECT_help(void) { printf( "REDIRECT v%s options:\n" @@ -22,15 +21,14 @@ help(void) IPTABLES_VERSION); } -static const struct option opts[] = { +static const struct option REDIRECT_opts[] = { { "to-ports", 1, NULL, '1' }, { "random", 1, NULL, '2' }, { } }; /* Initialize the target. */ -static void -init(struct xt_entry_target *t) +static void REDIRECT_init(struct xt_entry_target *t) { struct ip_nat_multi_range *mr = (struct ip_nat_multi_range *)t->data; @@ -78,10 +76,8 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr) /* 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 *e, - struct xt_entry_target **target) +static int REDIRECT_parse(int c, char **argv, int invert, unsigned int *flags, + const void *e, struct xt_entry_target **target) { const struct ipt_entry *entry = e; struct ip_nat_multi_range *mr @@ -125,10 +121,8 @@ parse(int c, char **argv, int invert, unsigned int *flags, } /* Prints out the targinfo. */ -static void -print(const void *ip, - const struct xt_entry_target *target, - int numeric) +static void REDIRECT_print(const void *ip, const struct xt_entry_target *target, + int numeric) { struct ip_nat_multi_range *mr = (struct ip_nat_multi_range *)target->data; @@ -146,8 +140,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 REDIRECT_save(const void *ip, const struct xt_entry_target *target) { struct ip_nat_multi_range *mr = (struct ip_nat_multi_range *)target->data; @@ -164,20 +157,20 @@ save(const void *ip, const struct xt_entry_target *target) } } -static struct iptables_target redir = { +static struct iptables_target redirect_target = { .name = "REDIRECT", .version = IPTABLES_VERSION, .size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)), .userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)), - .help = &help, - .init = &init, - .parse = &parse, - .print = &print, - .save = &save, - .extra_opts = opts + .help = REDIRECT_help, + .init = REDIRECT_init, + .parse = REDIRECT_parse, + .print = REDIRECT_print, + .save = REDIRECT_save, + .extra_opts = REDIRECT_opts, }; void _init(void) { - register_target(&redir); + register_target(&redirect_target); } |