From 002261fba0ede5a039d1a65e26d2fa7a37a2f50e Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Patrick McHardy/emailAddress=kaber@trash.net" Date: Thu, 4 Oct 2007 16:28:39 +0000 Subject: [PATCH 09/13] 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_conntrack.c | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) (limited to 'extensions/libipt_conntrack.c') diff --git a/extensions/libipt_conntrack.c b/extensions/libipt_conntrack.c index 6ee8353..6b3d39b 100644 --- a/extensions/libipt_conntrack.c +++ b/extensions/libipt_conntrack.c @@ -18,8 +18,7 @@ #endif /* Function which prints out usage message. */ -static void -help(void) +static void conntrack_help(void) { printf( "conntrack match v%s options:\n" @@ -41,9 +40,7 @@ help(void) "\n", IPTABLES_VERSION); } - - -static const struct option opts[] = { +static const struct option conntrack_opts[] = { { "ctstate", 1, NULL, '1' }, { "ctproto", 1, NULL, '2' }, { "ctorigsrc", 1, NULL, '3' }, @@ -165,10 +162,8 @@ parse_expires(const char *s, struct ipt_conntrack_info *sinfo) /* 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 conntrack_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_match **match) { struct ipt_conntrack_info *sinfo = (struct ipt_conntrack_info *)(*match)->data; char *protocol = NULL; @@ -316,8 +311,7 @@ parse(int c, char **argv, int invert, unsigned int *flags, return 1; } -static void -final_check(unsigned int flags) +static void conntrack_check(unsigned int flags) { if (!flags) exit_error(PARAMETER_PROBLEM, "You must specify one or more options"); @@ -489,34 +483,32 @@ matchinfo_print(const void *ip, const struct xt_entry_match *match, int numeric, } /* Prints out the matchinfo. */ -static void -print(const void *ip, - const struct xt_entry_match *match, - int numeric) +static void conntrack_print(const void *ip, const struct xt_entry_match *match, + int numeric) { matchinfo_print(ip, match, numeric, ""); } /* Saves the matchinfo in parsable form to stdout. */ -static void save(const void *ip, const struct xt_entry_match *match) +static void conntrack_save(const void *ip, const struct xt_entry_match *match) { matchinfo_print(ip, match, 1, "--"); } -static struct iptables_match conntrack = { +static struct iptables_match conntrack_match = { .name = "conntrack", .version = IPTABLES_VERSION, .size = IPT_ALIGN(sizeof(struct ipt_conntrack_info)), .userspacesize = IPT_ALIGN(sizeof(struct ipt_conntrack_info)), - .help = &help, - .parse = &parse, - .final_check = &final_check, - .print = &print, - .save = &save, - .extra_opts = opts + .help = conntrack_help, + .parse = conntrack_parse, + .final_check = conntrack_check, + .print = conntrack_print, + .save = conntrack_save, + .extra_opts = conntrack_opts, }; void _init(void) { - register_match(&conntrack); + register_match(&conntrack_match); } -- cgit v1.2.3