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_realm.c | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) (limited to 'extensions/libipt_realm.c') diff --git a/extensions/libipt_realm.c b/extensions/libipt_realm.c index 2bd04c34..4f3416f0 100644 --- a/extensions/libipt_realm.c +++ b/extensions/libipt_realm.c @@ -15,8 +15,7 @@ #include /* Function which prints out usage message. */ -static void -help(void) +static void realm_help(void) { printf( "realm v%s options:\n" @@ -25,7 +24,7 @@ help(void) "\n", IPTABLES_VERSION); } -static const struct option opts[] = { +static const struct option realm_opts[] = { { "realm", 1, NULL, '1' }, { } }; @@ -154,10 +153,8 @@ static const char *realm_id2name(int id) /* 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_match **match) +static int realm_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_match **match) { struct ipt_realm_info *realminfo = (struct ipt_realm_info *)(*match)->data; int id; @@ -213,10 +210,8 @@ print_realm(unsigned long id, unsigned long mask, int numeric) } /* Prints out the matchinfo. */ -static void -print(const void *ip, - const struct xt_entry_match *match, - int numeric) +static void realm_print(const void *ip, const struct xt_entry_match *match, + int numeric) { struct ipt_realm_info *ri = (struct ipt_realm_info *) match->data; @@ -229,8 +224,7 @@ print(const void *ip, /* Saves the union ipt_matchinfo in parsable form to stdout. */ -static void -save(const void *ip, const struct xt_entry_match *match) +static void realm_save(const void *ip, const struct xt_entry_match *match) { struct ipt_realm_info *ri = (struct ipt_realm_info *) match->data; @@ -242,30 +236,29 @@ save(const void *ip, const struct xt_entry_match *match) } /* Final check; must have specified --mark. */ -static void -final_check(unsigned int flags) +static void realm_check(unsigned int flags) { if (!flags) exit_error(PARAMETER_PROBLEM, "realm match: You must specify `--realm'"); } -static struct iptables_match realm = { +static struct iptables_match realm_match = { .name = "realm", .version = IPTABLES_VERSION, .size = IPT_ALIGN(sizeof(struct ipt_realm_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_realm_info)), - .help = &help, - .parse = &parse, - .final_check = &final_check, - .print = &print, - .save = &save, - .extra_opts = opts + .help = realm_help, + .parse = realm_parse, + .final_check = realm_check, + .print = realm_print, + .save = realm_save, + .extra_opts = realm_opts, }; void _init(void) { - register_match(&realm); + register_match(&realm_match); } -- cgit v1.2.3