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_pkttype.c | 50 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'extensions/libxt_pkttype.c') diff --git a/extensions/libxt_pkttype.c b/extensions/libxt_pkttype.c index cbb78be4..2d73560a 100644 --- a/extensions/libxt_pkttype.c +++ b/extensions/libxt_pkttype.c @@ -55,16 +55,16 @@ static void print_types(void) } /* Function which prints out usage message. */ -static void help(void) +static void pkttype_help(void) { printf( -"pkt_type v%s options:\n" +"pkttype v%s options:\n" " --pkt-type [!] packettype\tmatch packet type\n" "\n", PKTTYPE_VERSION); print_types(); } -static const struct option opts[] = { +static const struct option pkttype_opts[] = { {"pkt-type", 1, NULL, '1'}, { } }; @@ -85,9 +85,8 @@ static void parse_pkttype(const char *pkttype, struct xt_pkttype_info *info) exit_error(PARAMETER_PROBLEM, "Bad packet type '%s'", pkttype); } -static int parse(int c, char **argv, int invert, unsigned int *flags, - const void *entry, - struct xt_entry_match **match) +static int pkttype_parse(int c, char **argv, int invert, unsigned int *flags, + const void *entry, struct xt_entry_match **match) { struct xt_pkttype_info *info = (struct xt_pkttype_info *)(*match)->data; @@ -108,7 +107,7 @@ static int parse(int c, char **argv, int invert, unsigned int *flags, return 1; } -static void final_check(unsigned int flags) +static void pkttype_check(unsigned int flags) { if (!flags) exit_error(PARAMETER_PROBLEM, "You must specify `--pkt-type'"); @@ -130,7 +129,8 @@ static void print_pkttype(struct xt_pkttype_info *info) printf("%d ", info->pkttype); /* in case we didn't find an entry in named-packtes */ } -static void print(const void *ip, const struct xt_entry_match *match, int numeric) +static void pkttype_print(const void *ip, const struct xt_entry_match *match, + int numeric) { struct xt_pkttype_info *info = (struct xt_pkttype_info *)match->data; @@ -138,7 +138,7 @@ static void print(const void *ip, const struct xt_entry_match *match, int numeri print_pkttype(info); } -static void save(const void *ip, const struct xt_entry_match *match) +static void pkttype_save(const void *ip, const struct xt_entry_match *match) { struct xt_pkttype_info *info = (struct xt_pkttype_info *)match->data; @@ -146,36 +146,36 @@ static void save(const void *ip, const struct xt_entry_match *match) print_pkttype(info); } -static struct xtables_match pkttype = { +static struct xtables_match pkttype_match = { .family = AF_INET, .name = "pkttype", .version = IPTABLES_VERSION, .size = XT_ALIGN(sizeof(struct xt_pkttype_info)), .userspacesize = XT_ALIGN(sizeof(struct xt_pkttype_info)), - .help = &help, - .parse = &parse, - .final_check = &final_check, - .print = &print, - .save = &save, - .extra_opts = opts + .help = pkttype_help, + .parse = pkttype_parse, + .final_check = pkttype_check, + .print = pkttype_print, + .save = pkttype_save, + .extra_opts = pkttype_opts, }; -static struct xtables_match pkttype6 = { +static struct xtables_match pkttype_match6 = { .family = AF_INET6, .name = "pkttype", .version = IPTABLES_VERSION, .size = XT_ALIGN(sizeof(struct xt_pkttype_info)), .userspacesize = XT_ALIGN(sizeof(struct xt_pkttype_info)), - .help = &help, - .parse = &parse, - .final_check = &final_check, - .print = &print, - .save = &save, - .extra_opts = opts + .help = pkttype_help, + .parse = pkttype_parse, + .final_check = pkttype_check, + .print = pkttype_print, + .save = pkttype_save, + .extra_opts = pkttype_opts, }; void _init(void) { - xtables_register_match(&pkttype); - xtables_register_match(&pkttype6); + xtables_register_match(&pkttype_match); + xtables_register_match(&pkttype_match6); } -- cgit v1.2.3