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 <jengelh@gmx.de>
diff --git a/extensions/libxt_quota.c b/extensions/libxt_quota.c
index 0e04d20..9f96226 100644
--- a/extensions/libxt_quota.c
+++ b/extensions/libxt_quota.c
@@ -11,14 +11,13 @@
#include <linux/netfilter/xt_quota.h>
-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 @@
/* 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 @@
/* 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 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 @@
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);
}