summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_connbytes.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2007-10-04 16:27:07 +0000
committerPatrick McHardy <kaber@trash.net>2007-10-04 16:27:07 +0000
commit181dead3f13befe02769ef479bcbb51801b7fc4e (patch)
tree37c29ea4f70d8c72a1a9910b8c775fc8d77bd148 /extensions/libxt_connbytes.c
parent926bde877f8182e7db4d057969dc8293e81fd6cf (diff)
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>
Diffstat (limited to 'extensions/libxt_connbytes.c')
-rw-r--r--extensions/libxt_connbytes.c50
1 files changed, 23 insertions, 27 deletions
diff --git a/extensions/libxt_connbytes.c b/extensions/libxt_connbytes.c
index 8efde372..3ec08d05 100644
--- a/extensions/libxt_connbytes.c
+++ b/extensions/libxt_connbytes.c
@@ -9,8 +9,7 @@
#include <linux/netfilter/xt_connbytes.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void connbytes_help(void)
{
printf(
"connbytes v%s options:\n"
@@ -20,7 +19,7 @@ help(void)
"\n", IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option connbytes_opts[] = {
{ "connbytes", 1, NULL, '1' },
{ "connbytes-dir", 1, NULL, '2' },
{ "connbytes-mode", 1, NULL, '3' },
@@ -49,9 +48,8 @@ parse_range(const char *arg, struct xt_connbytes_info *si)
/* 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)
+connbytes_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_match **match)
{
struct xt_connbytes_info *sinfo = (struct xt_connbytes_info *)(*match)->data;
unsigned long i;
@@ -101,7 +99,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
return 1;
}
-static void final_check(unsigned int flags)
+static void connbytes_check(unsigned int flags)
{
if (flags != 7)
exit_error(PARAMETER_PROBLEM, "You must specify `--connbytes'"
@@ -146,9 +144,7 @@ static void print_direction(struct xt_connbytes_info *sinfo)
/* Prints out the matchinfo. */
static void
-print(const void *ip,
- const struct xt_entry_match *match,
- int numeric)
+connbytes_print(const void *ip, const struct xt_entry_match *match, int numeric)
{
struct xt_connbytes_info *sinfo = (struct xt_connbytes_info *)match->data;
@@ -169,7 +165,7 @@ print(const void *ip,
}
/* Saves the matchinfo in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_match *match)
+static void connbytes_save(const void *ip, const struct xt_entry_match *match)
{
struct xt_connbytes_info *sinfo = (struct xt_connbytes_info *)match->data;
@@ -189,36 +185,36 @@ static void save(const void *ip, const struct xt_entry_match *match)
print_direction(sinfo);
}
-static struct xtables_match state = {
+static struct xtables_match connbytes_match = {
.family = AF_INET,
.name = "connbytes",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_connbytes_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connbytes_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = connbytes_help,
+ .parse = connbytes_parse,
+ .final_check = connbytes_check,
+ .print = connbytes_print,
+ .save = connbytes_save,
+ .extra_opts = connbytes_opts,
};
-static struct xtables_match state6 = {
+static struct xtables_match connbytes_match6 = {
.family = AF_INET6,
.name = "connbytes",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_connbytes_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connbytes_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = connbytes_help,
+ .parse = connbytes_parse,
+ .final_check = connbytes_check,
+ .print = connbytes_print,
+ .save = connbytes_save,
+ .extra_opts = connbytes_opts,
};
void _init(void)
{
- xtables_register_match(&state);
- xtables_register_match(&state6);
+ xtables_register_match(&connbytes_match);
+ xtables_register_match(&connbytes_match6);
}