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 <jengelh@gmx.de>
diff --git a/extensions/libipt_ah.c b/extensions/libipt_ah.c
index 22a13d1..70ba03e 100644
--- a/extensions/libipt_ah.c
+++ b/extensions/libipt_ah.c
@@ -9,8 +9,7 @@
#include <linux/netfilter_ipv4/ipt_ah.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void ah_help(void)
{
printf(
"AH v%s options:\n"
@@ -19,7 +18,7 @@
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option ah_opts[] = {
{ "ahspi", 1, NULL, '1' },
{ }
};
@@ -67,8 +66,7 @@
}
/* Initialize the match. */
-static void
-init(struct xt_entry_match *m)
+static void ah_init(struct xt_entry_match *m)
{
struct ipt_ah *ahinfo = (struct ipt_ah *)m->data;
@@ -79,10 +77,8 @@
/* 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 ah_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct ipt_ah *ahinfo = (struct ipt_ah *)(*match)->data;
@@ -126,9 +122,8 @@
}
/* Prints out the union ipt_matchinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_match *match, int numeric)
+static void ah_print(const void *ip, const struct xt_entry_match *match,
+ int numeric)
{
const struct ipt_ah *ah = (struct ipt_ah *)match->data;
@@ -141,7 +136,7 @@
}
/* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void ah_save(const void *ip, const struct xt_entry_match *match)
{
const struct ipt_ah *ahinfo = (struct ipt_ah *)match->data;
@@ -161,21 +156,21 @@
}
-static struct iptables_match ah = {
+static struct iptables_match ah_match = {
.name = "ah",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_ah)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_ah)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = ah_help,
+ .init = ah_init,
+ .parse = ah_parse,
+ .print = ah_print,
+ .save = ah_save,
+ .extra_opts = ah_opts,
};
void
_init(void)
{
- register_match(&ah);
+ register_match(&ah_match);
}