From 181dead3f13befe02769ef479bcbb51801b7fc4e Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 4 Oct 2007 16:27:07 +0000 Subject: Unique symbols 1/6 Give symbols of libxt matches unique names (1/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/libxt_quota.c | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'extensions/libxt_quota.c') diff --git a/extensions/libxt_quota.c b/extensions/libxt_quota.c index 0e04d203..9f962260 100644 --- a/extensions/libxt_quota.c +++ b/extensions/libxt_quota.c @@ -11,14 +11,13 @@ #include -static const struct option opts[] = { +static const struct option quota_opts[] = { {"quota", 1, NULL, '1'}, { } }; /* print usage */ -static void -help(void) +static void quota_help(void) { printf("quota options:\n" " --quota quota quota (bytes)\n" "\n"); @@ -26,7 +25,7 @@ help(void) /* print matchinfo */ static void -print(const void *ip, const struct xt_entry_match *match, int numeric) +quota_print(const void *ip, const struct xt_entry_match *match, int numeric) { struct xt_quota_info *q = (struct xt_quota_info *) match->data; printf("quota: %llu bytes", (unsigned long long) q->quota); @@ -34,7 +33,7 @@ print(const void *ip, const struct xt_entry_match *match, int numeric) /* save matchinfo */ static void -save(const void *ip, const struct xt_entry_match *match) +quota_save(const void *ip, const struct xt_entry_match *match) { struct xt_quota_info *q = (struct xt_quota_info *) match->data; printf("--quota %llu ", (unsigned long long) q->quota); @@ -58,9 +57,8 @@ parse_quota(const char *s, u_int64_t * quota) /* parse all options, returning true if we found any for us */ static int -parse(int c, char **argv, int invert, unsigned int *flags, - const void *entry, - struct xt_entry_match **match) +quota_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_match **match) { struct xt_quota_info *info = (struct xt_quota_info *) (*match)->data; @@ -79,35 +77,35 @@ parse(int c, char **argv, int invert, unsigned int *flags, return 1; } -struct xtables_match quota = { +struct xtables_match quota_match = { .family = AF_INET, .name = "quota", .version = IPTABLES_VERSION, .size = XT_ALIGN(sizeof (struct xt_quota_info)), .userspacesize = offsetof(struct xt_quota_info, quota), - .help = &help, - .parse = &parse, - .print = &print, - .save = &save, - .extra_opts = opts + .help = quota_help, + .parse = quota_parse, + .print = quota_print, + .save = quota_save, + .extra_opts = quota_opts, }; -struct xtables_match quota6 = { +struct xtables_match quota_match6 = { .family = AF_INET6, .name = "quota", .version = IPTABLES_VERSION, .size = XT_ALIGN(sizeof (struct xt_quota_info)), .userspacesize = offsetof(struct xt_quota_info, quota), - .help = &help, - .parse = &parse, - .print = &print, - .save = &save, - .extra_opts = opts + .help = quota_help, + .parse = quota_parse, + .print = quota_print, + .save = quota_save, + .extra_opts = quota_opts, }; void _init(void) { - xtables_register_match("a); - xtables_register_match("a6); + xtables_register_match("a_match); + xtables_register_match("a_match6); } -- cgit v1.2.3