From 59d164019340d110d302634e429320577f0db7be Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 4 Oct 2007 16:28:39 +0000 Subject: 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_condition.c | 44 ++++++++++++++++--------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) (limited to 'extensions/libipt_condition.c') diff --git a/extensions/libipt_condition.c b/extensions/libipt_condition.c index 8ce9b530..4a98dd8c 100644 --- a/extensions/libipt_condition.c +++ b/extensions/libipt_condition.c @@ -8,9 +8,7 @@ #include #include - -static void -help(void) +static void condition_help(void) { printf("condition match v%s options:\n" "--condition [!] filename " @@ -18,16 +16,13 @@ help(void) IPTABLES_VERSION); } - -static const struct option opts[] = { +static const struct option condition_opts[] = { { .name = "condition", .has_arg = 1, .flag = 0, .val = 'X' }, { .name = 0 } }; -static int -parse(int c, char **argv, int invert, unsigned int *flags, - const void *entry, - struct xt_entry_match **match) +static int condition_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_match **match) { struct condition_info *info = (struct condition_info *) (*match)->data; @@ -53,19 +48,15 @@ parse(int c, char **argv, int invert, unsigned int *flags, return 0; } - -static void -final_check(unsigned int flags) +static void condition_check(unsigned int flags) { if (!flags) exit_error(PARAMETER_PROBLEM, "Condition match: must specify --condition"); } - -static void -print(const void *ip, - const struct xt_entry_match *match, int numeric) +static void condition_print(const void *ip, const struct xt_entry_match *match, + int numeric) { const struct condition_info *info = (const struct condition_info *) match->data; @@ -74,9 +65,7 @@ print(const void *ip, } -static void -save(const void *ip, - const struct xt_entry_match *match) +static void condition_save(const void *ip, const struct xt_entry_match *match) { const struct condition_info *info = (const struct condition_info *) match->data; @@ -84,23 +73,22 @@ save(const void *ip, printf("--condition %s\"%s\" ", (info->invert) ? "! " : "", info->name); } - -static struct iptables_match condition = { +static struct iptables_match condition_match = { .name = "condition", .version = IPTABLES_VERSION, .size = IPT_ALIGN(sizeof(struct condition_info)), .userspacesize = IPT_ALIGN(sizeof(struct condition_info)), - .help = &help, - .parse = &parse, - .final_check = &final_check, - .print = &print, - .save = &save, - .extra_opts = opts + .help = condition_help, + .parse = condition_parse, + .final_check = condition_check, + .print = condition_print, + .save = condition_save, + .extra_opts = condition_opts, }; void _init(void) { - register_match(&condition); + register_match(&condition_match); } -- cgit v1.2.3