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>
#endif
/* Function which prints out usage message. */
-static void
-help(void)
+static void CONNMARK_help(void)
{
printf(
"CONNMARK target v%s options:\n"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option CONNMARK_opts[] = {
{ "set-mark", 1, NULL, '1' },
{ "save-mark", 0, NULL, '2' },
{ "restore-mark", 0, NULL, '3' },
/* 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_target **target)
+CONNMARK_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_connmark_target_info *markinfo
= (struct xt_connmark_target_info *)(*target)->data;
return 1;
}
-static void
-final_check(unsigned int flags)
+static void CONNMARK_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
/* Prints out the target info. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void CONNMARK_print(const void *ip,
+ const struct xt_entry_target *target, int numeric)
{
const struct xt_connmark_target_info *markinfo =
(const struct xt_connmark_target_info *)target->data;
}
/* Saves the target into in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void CONNMARK_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_connmark_target_info *markinfo =
(const struct xt_connmark_target_info *)target->data;
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = CONNMARK_help,
+ .parse = CONNMARK_parse,
+ .final_check = CONNMARK_check,
+ .print = CONNMARK_print,
+ .save = CONNMARK_save,
+ .extra_opts = CONNMARK_opts,
};
static struct xtables_target connmark_target6 = {
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connmark_target_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .help = CONNMARK_help,
+ .parse = CONNMARK_parse,
+ .final_check = CONNMARK_check,
+ .print = CONNMARK_print,
+ .save = CONNMARK_save,
+ .extra_opts = CONNMARK_opts,
};
void _init(void)
#define PFX "CONNSECMARK target: "
-static void help(void)
+static void CONNSECMARK_help(void)
{
printf(
"CONNSECMARK target v%s options:\n"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option CONNSECMARK_opts[] = {
{ "save", 0, 0, '1' },
{ "restore", 0, 0, '2' },
{ 0 }
};
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry, struct xt_entry_target **target)
+static int
+CONNSECMARK_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_connsecmark_target_info *info =
(struct xt_connsecmark_target_info*)(*target)->data;
return 1;
}
-static void final_check(unsigned int flags)
+static void CONNSECMARK_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM, PFX "parameter required");
}
}
-static void print(const void *ip,
- const struct xt_entry_target *target, int numeric)
+static void
+CONNSECMARK_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct xt_connsecmark_target_info *info =
(struct xt_connsecmark_target_info*)(target)->data;
print_connsecmark(info);
}
-static void save(const void *ip, const struct xt_entry_target *target)
+static void
+CONNSECMARK_save(const void *ip, const struct xt_entry_target *target)
{
struct xt_connsecmark_target_info *info =
(struct xt_connsecmark_target_info*)target->data;
print_connsecmark(info);
}
-static struct xtables_target connsecmark = {
+static struct xtables_target connsecmark_target = {
.family = AF_INET,
.name = "CONNSECMARK",
.version = IPTABLES_VERSION,
.revision = 0,
.size = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)),
- .parse = &parse,
- .help = &help,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .parse = CONNSECMARK_parse,
+ .help = CONNSECMARK_help,
+ .final_check = CONNSECMARK_check,
+ .print = CONNSECMARK_print,
+ .save = CONNSECMARK_save,
+ .extra_opts = CONNSECMARK_opts,
};
-static struct xtables_target connsecmark6 = {
+static struct xtables_target connsecmark_target6 = {
.family = AF_INET6,
.name = "CONNSECMARK",
.version = IPTABLES_VERSION,
.revision = 0,
.size = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)),
- .parse = &parse,
- .help = &help,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts,
+ .parse = CONNSECMARK_parse,
+ .help = CONNSECMARK_help,
+ .final_check = CONNSECMARK_check,
+ .print = CONNSECMARK_print,
+ .save = CONNSECMARK_save,
+ .extra_opts = CONNSECMARK_opts,
};
void _init(void)
{
- xtables_register_target(&connsecmark);
- xtables_register_target(&connsecmark6);
+ xtables_register_target(&connsecmark_target);
+ xtables_register_target(&connsecmark_target6);
}
/* 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"
);
}
-static const struct option opts[] = {
+static const struct option DSCP_opts[] = {
{ "set-dscp", 1, NULL, 'F' },
{ "set-dscp-class", 1, NULL, 'G' },
{ }
}
-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;
return 1;
}
-static void
-final_check(unsigned int flags)
+static void DSCP_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
}
/* 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;
}
/* 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;
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);
}
#include <linux/netfilter/xt_MARK.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void MARK_help(void)
{
printf(
"MARK target v%s options:\n"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option MARK_opts[] = {
{ "set-mark", 1, NULL, '1' },
{ "and-mark", 1, NULL, '2' },
{ "or-mark", 1, NULL, '3' },
/* Function which parses command options; returns true if it
ate an option */
static int
-parse_v0(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+MARK_parse_v0(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_mark_target_info *markinfo
= (struct xt_mark_target_info *)(*target)->data;
return 1;
}
-static void
-final_check(unsigned int flags)
+static void MARK_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
/* Function which parses command options; returns true if it
ate an option */
static int
-parse_v1(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+MARK_parse_v1(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_mark_target_info_v1 *markinfo
= (struct xt_mark_target_info_v1 *)(*target)->data;
}
/* Prints out the targinfo. */
-static void
-print_v0(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void MARK_print_v0(const void *ip,
+ const struct xt_entry_target *target, int numeric)
{
const struct xt_mark_target_info *markinfo =
(const struct xt_mark_target_info *)target->data;
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save_v0(const void *ip, const struct xt_entry_target *target)
+static void MARK_save_v0(const void *ip, const struct xt_entry_target *target)
{
const struct xt_mark_target_info *markinfo =
(const struct xt_mark_target_info *)target->data;
}
/* Prints out the targinfo. */
-static void
-print_v1(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void MARK_print_v1(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct xt_mark_target_info_v1 *markinfo =
(const struct xt_mark_target_info_v1 *)target->data;
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save_v1(const void *ip, const struct xt_entry_target *target)
+static void MARK_save_v1(const void *ip, const struct xt_entry_target *target)
{
const struct xt_mark_target_info_v1 *markinfo =
(const struct xt_mark_target_info_v1 *)target->data;
print_mark(markinfo->mark);
}
-static struct xtables_target mark_v0 = {
+static struct xtables_target mark_target_v0 = {
.family = AF_INET,
.name = "MARK",
.version = IPTABLES_VERSION,
.revision = 0,
.size = XT_ALIGN(sizeof(struct xt_mark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mark_target_info)),
- .help = &help,
- .parse = &parse_v0,
- .final_check = &final_check,
- .print = &print_v0,
- .save = &save_v0,
- .extra_opts = opts,
+ .help = MARK_help,
+ .parse = MARK_parse_v0,
+ .final_check = MARK_check,
+ .print = MARK_print_v0,
+ .save = MARK_save_v0,
+ .extra_opts = MARK_opts,
};
-static struct xtables_target mark_v1 = {
+static struct xtables_target mark_target_v1 = {
.family = AF_INET,
.name = "MARK",
.version = IPTABLES_VERSION,
.revision = 1,
.size = XT_ALIGN(sizeof(struct xt_mark_target_info_v1)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mark_target_info_v1)),
- .help = &help,
- .parse = &parse_v1,
- .final_check = &final_check,
- .print = &print_v1,
- .save = &save_v1,
- .extra_opts = opts,
+ .help = MARK_help,
+ .parse = MARK_parse_v1,
+ .final_check = MARK_check,
+ .print = MARK_print_v1,
+ .save = MARK_save_v1,
+ .extra_opts = MARK_opts,
};
-static struct xtables_target mark6_v0 = {
+static struct xtables_target mark_target6_v0 = {
.family = AF_INET6,
.name = "MARK",
.version = IPTABLES_VERSION,
.revision = 0,
.size = XT_ALIGN(sizeof(struct xt_mark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mark_target_info)),
- .help = &help,
- .parse = &parse_v0,
- .final_check = &final_check,
- .print = &print_v0,
- .save = &save_v0,
- .extra_opts = opts,
+ .help = MARK_help,
+ .parse = MARK_parse_v0,
+ .final_check = MARK_check,
+ .print = MARK_print_v0,
+ .save = MARK_save_v0,
+ .extra_opts = MARK_opts,
};
void _init(void)
{
- xtables_register_target(&mark_v0);
- xtables_register_target(&mark_v1);
- xtables_register_target(&mark6_v0);
+ xtables_register_target(&mark_target_v0);
+ xtables_register_target(&mark_target_v1);
+ xtables_register_target(&mark_target6_v0);
}
NFLOG_THRESHOLD = 0x8,
};
-static const struct option opts[] = {
+static const struct option NFLOG_opts[] = {
{ "nflog-group", 1, NULL, NFLOG_GROUP },
{ "nflog-prefix", 1, NULL, NFLOG_PREFIX },
{ "nflog-range", 1, NULL, NFLOG_RANGE },
{NULL},
};
-static void help(void)
+static void NFLOG_help(void)
{
printf("NFLOG v%s options:\n"
" --nflog-group NUM NETLINK group used for logging\n"
IPTABLES_VERSION);
}
-static void init(struct xt_entry_target *t)
+static void NFLOG_init(struct xt_entry_target *t)
{
struct xt_nflog_info *info = (struct xt_nflog_info *)t->data;
info->threshold = XT_NFLOG_DEFAULT_THRESHOLD;
}
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int NFLOG_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_nflog_info *info = (struct xt_nflog_info *)(*target)->data;
int n;
printf("%snflog-threshold %u ", prefix, info->threshold);
}
-static void print(const void *ip, const struct xt_entry_target *target,
- int numeric)
+static void NFLOG_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct xt_nflog_info *info = (struct xt_nflog_info *)target->data;
nflog_print(info, "");
}
-static void save(const void *ip, const struct xt_entry_target *target)
+static void NFLOG_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_nflog_info *info = (struct xt_nflog_info *)target->data;
nflog_print(info, "--");
}
-static struct xtables_target nflog = {
+static struct xtables_target nflog_target = {
.family = AF_INET,
.name = "NFLOG",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_nflog_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_nflog_info)),
- .help = help,
- .init = init,
- .parse = parse,
- .print = print,
- .save = save,
- .extra_opts = opts,
+ .help = NFLOG_help,
+ .init = NFLOG_init,
+ .parse = NFLOG_parse,
+ .print = NFLOG_print,
+ .save = NFLOG_save,
+ .extra_opts = NFLOG_opts,
};
-static struct xtables_target nflog6 = {
+static struct xtables_target nflog_target6 = {
.family = AF_INET6,
.name = "NFLOG",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_nflog_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_nflog_info)),
- .help = help,
- .init = init,
- .parse = parse,
- .print = print,
- .save = save,
- .extra_opts = opts,
+ .help = NFLOG_help,
+ .init = NFLOG_init,
+ .parse = NFLOG_parse,
+ .print = NFLOG_print,
+ .save = NFLOG_save,
+ .extra_opts = NFLOG_opts,
};
void _init(void)
{
- xtables_register_target(&nflog);
- xtables_register_target(&nflog6);
+ xtables_register_target(&nflog_target);
+ xtables_register_target(&nflog_target6);
}
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/xt_NFQUEUE.h>
-static void help(void)
+static void NFQUEUE_help(void)
{
printf(
"NFQUEUE target options\n"
);
}
-static const struct option opts[] = {
+static const struct option NFQUEUE_opts[] = {
{ "queue-num", 1, NULL, 'F' },
{ }
};
}
static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+NFQUEUE_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_NFQ_info *tinfo
= (struct xt_NFQ_info *)(*target)->data;
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void NFQUEUE_print(const void *ip,
+ const struct xt_entry_target *target, int numeric)
{
const struct xt_NFQ_info *tinfo =
(const struct xt_NFQ_info *)target->data;
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void NFQUEUE_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_NFQ_info *tinfo =
(const struct xt_NFQ_info *)target->data;
printf("--queue-num %u ", tinfo->queuenum);
}
-static struct xtables_target nfqueue = {
+static struct xtables_target nfqueue_target = {
.family = AF_INET,
.name = "NFQUEUE",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_NFQ_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_NFQ_info)),
- .help = &help,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = NFQUEUE_help,
+ .parse = NFQUEUE_parse,
+ .print = NFQUEUE_print,
+ .save = NFQUEUE_save,
+ .extra_opts = NFQUEUE_opts
};
-static struct xtables_target nfqueue6 = {
+static struct xtables_target nfqueue_target6 = {
.family = AF_INET6,
.name = "NFQUEUE",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_NFQ_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_NFQ_info)),
- .help = &help,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = NFQUEUE_help,
+ .parse = NFQUEUE_parse,
+ .print = NFQUEUE_print,
+ .save = NFQUEUE_save,
+ .extra_opts = NFQUEUE_opts,
};
void _init(void)
{
- xtables_register_target(&nfqueue);
- xtables_register_target(&nfqueue6);
+ xtables_register_target(&nfqueue_target);
+ xtables_register_target(&nfqueue_target6);
}
#include <linux/netfilter/x_tables.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void NOTRACK_help(void)
{
printf(
"NOTRACK target v%s takes no options\n",
/* 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_target **target)
+NOTRACK_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
return 0;
}
-static
-struct xtables_target notrack =
-{
+static struct xtables_target notrack_target = {
.family = AF_INET,
.name = "NOTRACK",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(0),
.userspacesize = XT_ALIGN(0),
- .help = &help,
- .parse = &parse,
+ .help = NOTRACK_help,
+ .parse = NOTRACK_parse,
};
-static
-struct xtables_target notrack6 =
-{
+static struct xtables_target notrack_target6 = {
.family = AF_INET6,
.name = "NOTRACK",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(0),
.userspacesize = XT_ALIGN(0),
- .help = &help,
- .parse = &parse,
+ .help = NOTRACK_help,
+ .parse = NOTRACK_parse,
};
void _init(void)
{
- xtables_register_target(¬rack);
- xtables_register_target(¬rack6);
+ xtables_register_target(¬rack_target);
+ xtables_register_target(¬rack_target6);
}
#define PFX "SECMARK target: "
-static void help(void)
+static void SECMARK_help(void)
{
printf(
"SECMARK target v%s options:\n"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option SECMARK_opts[] = {
{ "selctx", 1, 0, '1' },
{ 0 }
};
* 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_target **target)
+static int SECMARK_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct xt_secmark_target_info *info =
(struct xt_secmark_target_info*)(*target)->data;
return 1;
}
-static void final_check(unsigned int flags)
+static void SECMARK_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM, PFX "parameter required");
}
}
-static void print(const void *ip,
- const struct xt_entry_target *target, int numeric)
+static void SECMARK_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct xt_secmark_target_info *info =
(struct xt_secmark_target_info*)(target)->data;
}
/* Saves the target info in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_target *target)
+static void SECMARK_save(const void *ip, const struct xt_entry_target *target)
{
struct xt_secmark_target_info *info =
(struct xt_secmark_target_info*)target->data;
print_secmark(info);
}
-static struct xtables_target secmark = {
+static struct xtables_target secmark_target = {
.family = AF_INET,
.name = "SECMARK",
.version = IPTABLES_VERSION,
.revision = 0,
.size = XT_ALIGN(sizeof(struct xt_secmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_secmark_target_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = SECMARK_help,
+ .parse = SECMARK_parse,
+ .final_check = SECMARK_check,
+ .print = SECMARK_print,
+ .save = SECMARK_save,
+ .extra_opts = SECMARK_opts,
};
-static struct xtables_target secmark6 = {
+static struct xtables_target secmark_target6 = {
.family = AF_INET6,
.name = "SECMARK",
.version = IPTABLES_VERSION,
.revision = 0,
.size = XT_ALIGN(sizeof(struct xt_secmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_secmark_target_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = SECMARK_help,
+ .parse = SECMARK_parse,
+ .final_check = SECMARK_check,
+ .print = SECMARK_print,
+ .save = SECMARK_save,
+ .extra_opts = SECMARK_opts,
};
void _init(void)
{
- xtables_register_target(&secmark);
- xtables_register_target(&secmark6);
+ xtables_register_target(&secmark_target);
+ xtables_register_target(&secmark_target6);
}
};
/* Function which prints out usage message. */
-static void __help(int hdrsize)
+static void __TCPMSS_help(int hdrsize)
{
printf(
"TCPMSS target v%s mutually-exclusive options:\n"
IPTABLES_VERSION, hdrsize);
}
-static void help(void)
+static void TCPMSS_help(void)
{
- __help(40);
+ __TCPMSS_help(40);
}
-static void help6(void)
+static void TCPMSS_help6(void)
{
- __help(60);
+ __TCPMSS_help(60);
}
-static const struct option opts[] = {
+static const struct option TCPMSS_opts[] = {
{ "set-mss", 1, NULL, '1' },
{ "clamp-mss-to-pmtu", 0, NULL, '2' },
{ }
/* 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_target **target,
- int hdrsize)
+static int __TCPMSS_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target,
+ int hdrsize)
{
struct xt_tcpmss_info *mssinfo
= (struct xt_tcpmss_info *)(*target)->data;
return 1;
}
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int TCPMSS_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
- return __parse(c, argv, invert, flags, entry, target, 40);
+ return __TCPMSS_parse(c, argv, invert, flags, entry, target, 40);
}
-static int
-parse6(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int TCPMSS_parse6(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
- return __parse(c, argv, invert, flags, entry, target, 60);
+ return __TCPMSS_parse(c, argv, invert, flags, entry, target, 60);
}
-static void
-final_check(unsigned int flags)
+static void TCPMSS_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void TCPMSS_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct xt_tcpmss_info *mssinfo =
(const struct xt_tcpmss_info *)target->data;
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void TCPMSS_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_tcpmss_info *mssinfo =
(const struct xt_tcpmss_info *)target->data;
printf("--set-mss %u ", mssinfo->mss);
}
-static struct xtables_target mss = {
+static struct xtables_target tcpmss_target = {
.family = AF_INET,
.name = "TCPMSS",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_tcpmss_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_tcpmss_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = TCPMSS_help,
+ .parse = TCPMSS_parse,
+ .final_check = TCPMSS_check,
+ .print = TCPMSS_print,
+ .save = TCPMSS_save,
+ .extra_opts = TCPMSS_opts,
};
-static struct xtables_target mss6 = {
+static struct xtables_target tcpmss_target6 = {
.family = AF_INET6,
.name = "TCPMSS",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_tcpmss_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_tcpmss_info)),
- .help = &help6,
- .parse = &parse6,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = TCPMSS_help6,
+ .parse = TCPMSS_parse6,
+ .final_check = TCPMSS_check,
+ .print = TCPMSS_print,
+ .save = TCPMSS_save,
+ .extra_opts = TCPMSS_opts,
};
void _init(void)
{
- xtables_register_target(&mss);
- xtables_register_target(&mss6);
+ xtables_register_target(&tcpmss_target);
+ xtables_register_target(&tcpmss_target6);
}
#include <linux/netfilter/x_tables.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void TRACE_help(void)
{
printf(
"TRACE target v%s takes no options\n",
/* 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_target **target)
+static int TRACE_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
return 0;
}
-static struct xtables_target trace = {
+static struct xtables_target trace_target = {
.family = AF_INET,
.name = "TRACE",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(0),
.userspacesize = XT_ALIGN(0),
- .help = &help,
- .parse = &parse,
+ .help = TRACE_help,
+ .parse = TRACE_parse,
};
-static struct xtables_target trace6 = {
+static struct xtables_target trace_target6 = {
.family = AF_INET6,
.name = "TRACE",
.version = IPTABLES_VERSION,
.size = XT_ALIGN(0),
.userspacesize = XT_ALIGN(0),
- .help = &help,
- .parse = &parse,
+ .help = TRACE_help,
+ .parse = TRACE_parse,
};
void _init(void)
{
- xtables_register_target(&trace);
- xtables_register_target(&trace6);
+ xtables_register_target(&trace_target);
+ xtables_register_target(&trace_target6);
}