summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_DSCP.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2007-10-04 16:27:30 +0000
committerPatrick McHardy <kaber@trash.net>2007-10-04 16:27:30 +0000
commit932e648f38ac16b1ea14c1f66f23951388448c5a (patch)
tree71983cde1da7010142071d4cdef88da810a18890 /extensions/libxt_DSCP.c
parent181dead3f13befe02769ef479bcbb51801b7fc4e (diff)
Unique names 2/6
Give symbols of libxt targets 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_DSCP.c')
-rw-r--r--extensions/libxt_DSCP.c54
1 files changed, 24 insertions, 30 deletions
diff --git a/extensions/libxt_DSCP.c b/extensions/libxt_DSCP.c
index 38e02c7f..7e460830 100644
--- a/extensions/libxt_DSCP.c
+++ b/extensions/libxt_DSCP.c
@@ -21,7 +21,7 @@
/* This is evil, but it's my code - HW*/
#include "libipt_dscp_helper.c"
-static void help(void)
+static void DSCP_help(void)
{
printf(
"DSCP target options\n"
@@ -37,7 +37,7 @@ static void help(void)
);
}
-static const struct option opts[] = {
+static const struct option DSCP_opts[] = {
{ "set-dscp", 1, NULL, 'F' },
{ "set-dscp-class", 1, NULL, 'G' },
{ }
@@ -71,10 +71,8 @@ parse_class(const char *s, struct xt_DSCP_info *dinfo)
}
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int DSCP_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_DSCP_info *dinfo
= (struct xt_DSCP_info *)(*target)->data;
@@ -102,8 +100,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
return 1;
}
-static void
-final_check(unsigned int flags)
+static void DSCP_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
@@ -117,10 +114,8 @@ print_dscp(u_int8_t dscp, int numeric)
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void DSCP_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct xt_DSCP_info *dinfo =
(const struct xt_DSCP_info *)target->data;
@@ -129,8 +124,7 @@ print(const void *ip,
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void DSCP_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_DSCP_info *dinfo =
(const struct xt_DSCP_info *)target->data;
@@ -138,36 +132,36 @@ save(const void *ip, const struct xt_entry_target *target)
printf("--set-dscp 0x%02x ", dinfo->dscp);
}
-static struct xtables_target dscp = {
+static struct xtables_target dscp_target = {
.family = AF_INET,
.name = "DSCP",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_DSCP_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_DSCP_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = DSCP_help,
+ .parse = DSCP_parse,
+ .final_check = DSCP_check,
+ .print = DSCP_print,
+ .save = DSCP_save,
+ .extra_opts = DSCP_opts,
};
-static struct xtables_target dscp6 = {
+static struct xtables_target dscp_target6 = {
.family = AF_INET6,
.name = "DSCP",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_DSCP_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_DSCP_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = DSCP_help,
+ .parse = DSCP_parse,
+ .final_check = DSCP_check,
+ .print = DSCP_print,
+ .save = DSCP_save,
+ .extra_opts = DSCP_opts,
};
void _init(void)
{
- xtables_register_target(&dscp);
- xtables_register_target(&dscp6);
+ xtables_register_target(&dscp_target);
+ xtables_register_target(&dscp_target6);
}