Give symbols of libxt targets 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 <jengelh@gmx.de>
#include <linux/netfilter_ipv4/ip_tables.h>
#include "../include/linux/netfilter_ipv4/ipt_CLUSTERIP.h"
-static void
-help(void)
+static void CLUSTERIP_help(void)
{
printf(
"CLUSTERIP target v%s options:\n"
#define PARAM_LOCALNODE 0x0010
#define PARAM_HASHINIT 0x0020
-static const struct option opts[] = {
+static const struct option CLUSTERIP_opts[] = {
{ "new", 0, NULL, '1' },
{ "hashmode", 1, NULL, '2' },
{ "clustermac", 1, NULL, '3' },
}
}
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int CLUSTERIP_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_clusterip_tgt_info *cipinfo
= (struct ipt_clusterip_tgt_info *)(*target)->data;
return 1;
}
-static void
-final_check(unsigned int flags)
+static void CLUSTERIP_check(unsigned int flags)
{
if (flags == 0)
return;
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void CLUSTERIP_print(const void *ip,
+ const struct xt_entry_target *target, int numeric)
{
const struct ipt_clusterip_tgt_info *cipinfo =
(const struct ipt_clusterip_tgt_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 CLUSTERIP_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_clusterip_tgt_info *cipinfo =
(const struct ipt_clusterip_tgt_info *)target->data;
cipinfo->hash_initval);
}
-static struct iptables_target clusterip = {
+static struct iptables_target clusterip_target = {
.name = "CLUSTERIP",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_clusterip_tgt_info)),
.userspacesize = offsetof(struct ipt_clusterip_tgt_info, config),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = CLUSTERIP_help,
+ .parse = CLUSTERIP_parse,
+ .final_check = CLUSTERIP_check,
+ .print = CLUSTERIP_print,
+ .save = CLUSTERIP_save,
+ .extra_opts = CLUSTERIP_opts,
};
void _init(void)
{
- register_target(&clusterip);
+ register_target(&clusterip_target);
}
};
/* Function which prints out usage message. */
-static void
-help(void)
+static void DNAT_help(void)
{
printf(
"DNAT v%s options:\n"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option DNAT_opts[] = {
{ "to-destination", 1, NULL, '1' },
{ "random", 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 *e,
- struct xt_entry_target **target)
+static int DNAT_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *e, struct xt_entry_target **target)
{
const struct ipt_entry *entry = e;
struct ipt_natinfo *info = (void *)*target;
}
/* Final check; must have specfied --to-source. */
-static void final_check(unsigned int flags)
+static void DNAT_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 DNAT_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct ipt_natinfo *info = (void *)target;
unsigned int i = 0;
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void DNAT_save(const void *ip, const struct xt_entry_target *target)
{
struct ipt_natinfo *info = (void *)target;
unsigned int i = 0;
}
}
-static struct iptables_target dnat = {
+static struct iptables_target dnat_target = {
.name = "DNAT",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
.userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = DNAT_help,
+ .parse = DNAT_parse,
+ .final_check = DNAT_check,
+ .print = DNAT_print,
+ .save = DNAT_save,
+ .extra_opts = DNAT_opts,
};
void _init(void)
{
- register_target(&dnat);
+ register_target(&dnat_target);
}
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv4/ipt_ECN.h>
-static void help(void)
+static void ECN_help(void)
{
printf(
"ECN target v%s options\n"
#endif
-static const struct option opts[] = {
+static const struct option ECN_opts[] = {
{ "ecn-tcp-remove", 0, NULL, 'F' },
{ "ecn-tcp-cwr", 1, NULL, 'G' },
{ "ecn-tcp-ece", 1, NULL, 'H' },
{ }
};
-static int
-parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int ECN_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
unsigned int result;
struct ipt_ECN_info *einfo
return 1;
}
-static void
-final_check(unsigned int flags)
+static void ECN_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 ECN_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ipt_ECN_info *einfo =
(const struct ipt_ECN_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 ECN_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_ECN_info *einfo =
(const struct ipt_ECN_info *)target->data;
}
}
-static
-struct iptables_target ecn = {
+static struct iptables_target ecn_target = {
.name = "ECN",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_ECN_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_ECN_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = ECN_help,
+ .parse = ECN_parse,
+ .final_check = ECN_check,
+ .print = ECN_print,
+ .save = ECN_save,
+ .extra_opts = ECN_opts,
};
void _init(void)
{
- register_target(&ecn);
+ register_target(&ecn_target);
}
#endif
/* Function which prints out usage message. */
-static void
-help(void)
+static void LOG_help(void)
{
printf(
"LOG v%s options:\n"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option LOG_opts[] = {
{ .name = "log-level", .has_arg = 1, .val = '!' },
{ .name = "log-prefix", .has_arg = 1, .val = '#' },
{ .name = "log-tcp-sequence", .has_arg = 0, .val = '1' },
};
/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void LOG_init(struct xt_entry_target *t)
{
struct ipt_log_info *loginfo = (struct ipt_log_info *)t->data;
/* 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 LOG_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_log_info *loginfo = (struct ipt_log_info *)(*target)->data;
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void LOG_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ipt_log_info *loginfo
= (const struct ipt_log_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 LOG_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_log_info *loginfo
= (const struct ipt_log_info *)target->data;
printf("--log-uid ");
}
-static
-struct iptables_target log
-= {
+static struct iptables_target log_target = {
.name = "LOG",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_log_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_log_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = LOG_help,
+ .init = LOG_init,
+ .parse = LOG_parse,
+ .print = LOG_print,
+ .save = LOG_save,
+ .extra_opts = LOG_opts,
};
void _init(void)
{
- register_target(&log);
+ register_target(&log_target);
}
#include <linux/netfilter/nf_nat.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void MASQUERADE_help(void)
{
printf(
"MASQUERADE v%s options:\n"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option MASQUERADE_opts[] = {
{ "to-ports", 1, NULL, '1' },
{ "random", 0, NULL, '2' },
{ }
};
/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void MASQUERADE_init(struct xt_entry_target *t)
{
struct ip_nat_multi_range *mr = (struct ip_nat_multi_range *)t->data;
/* 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 *e,
- struct xt_entry_target **target)
+static int MASQUERADE_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *e, struct xt_entry_target **target)
{
const struct ipt_entry *entry = e;
int portok;
/* Prints out the targinfo. */
static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+MASQUERADE_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct ip_nat_multi_range *mr
= (struct ip_nat_multi_range *)target->data;
/* Saves the union ipt_targinfo in parsable form to stdout. */
static void
-save(const void *ip, const struct xt_entry_target *target)
+MASQUERADE_save(const void *ip, const struct xt_entry_target *target)
{
struct ip_nat_multi_range *mr
= (struct ip_nat_multi_range *)target->data;
printf("--random ");
}
-static struct iptables_target masq = {
+static struct iptables_target masquerade_target = {
.name = "MASQUERADE",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
.userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = MASQUERADE_help,
+ .init = MASQUERADE_init,
+ .parse = MASQUERADE_parse,
+ .print = MASQUERADE_print,
+ .save = MASQUERADE_save,
+ .extra_opts = MASQUERADE_opts,
};
void _init(void)
{
- register_target(&masq);
+ register_target(&masquerade_target);
}
#include <linux/netfilter_ipv4/ip_tables.h>
/* Function which prints out usage message. */
-static void
-help(void)
+static void MIRROR_help(void)
{
printf(
"MIRROR 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 MIRROR_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
return 0;
}
-static struct iptables_target mirror = {
+static struct iptables_target mirror_target = {
.name = "MIRROR",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(0),
.userspacesize = IPT_ALIGN(0),
- .help = &help,
- .parse = &parse,
+ .help = MIRROR_help,
+ .parse = MIRROR_parse,
.print = NULL,
.save = NULL,
};
void _init(void)
{
- register_target(&mirror);
+ register_target(&mirror_target);
}
#define MODULENAME "NETMAP"
-static const struct option opts[] = {
+static const struct option NETMAP_opts[] = {
{ "to", 1, NULL, '1' },
{ }
};
/* Function which prints out usage message. */
-static void
-help(void)
+static void NETMAP_help(void)
{
printf(MODULENAME" v%s options:\n"
" --%s address[/mask]\n"
" Network address to map to.\n\n",
- IPTABLES_VERSION, opts[0].name);
+ IPTABLES_VERSION, NETMAP_opts[0].name);
}
static u_int32_t
}
/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void NETMAP_init(struct xt_entry_target *t)
{
struct ip_nat_multi_range *mr = (struct ip_nat_multi_range *)t->data;
/* 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 NETMAP_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ip_nat_multi_range *mr
= (struct ip_nat_multi_range *)(*target)->data;
case '1':
if (check_inverse(optarg, &invert, NULL, 0))
exit_error(PARAMETER_PROBLEM,
- "Unexpected `!' after --%s", opts[0].name);
+ "Unexpected `!' after --%s", NETMAP_opts[0].name);
parse_to(optarg, &mr->range[0]);
*flags = 1;
}
/* Final check; need --to */
-static void final_check(unsigned int flags)
+static void NETMAP_check(unsigned int flags)
{
if (!flags)
exit_error(PARAMETER_PROBLEM,
- MODULENAME" needs --%s", opts[0].name);
+ MODULENAME" needs --%s", NETMAP_opts[0].name);
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void NETMAP_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct ip_nat_multi_range *mr
= (struct ip_nat_multi_range *)target->data;
}
/* Saves the targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void NETMAP_save(const void *ip, const struct xt_entry_target *target)
{
- printf("--%s ", opts[0].name);
- print(ip, target, 0);
+ printf("--%s ", NETMAP_opts[0].name);
+ NETMAP_print(ip, target, 0);
}
-static struct iptables_target target_module = {
+static struct iptables_target netmap_target = {
.name = MODULENAME,
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
.userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = NETMAP_help,
+ .init = NETMAP_init,
+ .parse = NETMAP_parse,
+ .final_check = NETMAP_check,
+ .print = NETMAP_print,
+ .save = NETMAP_save,
+ .extra_opts = NETMAP_opts,
};
void _init(void)
{
- register_target(&target_module);
+ register_target(&netmap_target);
}
#define IPT_REDIRECT_OPT_RANDOM 0x02
/* Function which prints out usage message. */
-static void
-help(void)
+static void REDIRECT_help(void)
{
printf(
"REDIRECT v%s options:\n"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option REDIRECT_opts[] = {
{ "to-ports", 1, NULL, '1' },
{ "random", 1, NULL, '2' },
{ }
};
/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void REDIRECT_init(struct xt_entry_target *t)
{
struct ip_nat_multi_range *mr = (struct ip_nat_multi_range *)t->data;
/* 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 *e,
- struct xt_entry_target **target)
+static int REDIRECT_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *e, struct xt_entry_target **target)
{
const struct ipt_entry *entry = e;
struct ip_nat_multi_range *mr
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void REDIRECT_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct ip_nat_multi_range *mr
= (struct ip_nat_multi_range *)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 REDIRECT_save(const void *ip, const struct xt_entry_target *target)
{
struct ip_nat_multi_range *mr
= (struct ip_nat_multi_range *)target->data;
}
}
-static struct iptables_target redir = {
+static struct iptables_target redirect_target = {
.name = "REDIRECT",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
.userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = REDIRECT_help,
+ .init = REDIRECT_init,
+ .parse = REDIRECT_parse,
+ .print = REDIRECT_print,
+ .save = REDIRECT_save,
+ .extra_opts = REDIRECT_opts,
};
void _init(void)
{
- register_target(&redir);
+ register_target(&redirect_target);
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
/* Function which prints out usage message. */
-static void
-help(void)
+static void REJECT_help(void)
{
printf(
"REJECT options:\n"
printf("(*) See man page or read the INCOMPATIBILITES file for compatibility issues.\n");
}
-static const struct option opts[] = {
+static const struct option REJECT_opts[] = {
{ "reject-with", 1, NULL, '1' },
{ }
};
/* Allocate and initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void REJECT_init(struct xt_entry_target *t)
{
struct ipt_reject_info *reject = (struct ipt_reject_info *)t->data;
/* 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 REJECT_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_reject_info *reject = (struct ipt_reject_info *)(*target)->data;
unsigned int limit = sizeof(reject_table)/sizeof(struct reject_names);
}
/* Prints out ipt_reject_info. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void REJECT_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ipt_reject_info *reject
= (const struct ipt_reject_info *)target->data;
}
/* Saves ipt_reject in parsable form to stdout. */
-static void save(const void *ip, const struct xt_entry_target *target)
+static void REJECT_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_reject_info *reject
= (const struct ipt_reject_info *)target->data;
printf("--reject-with %s ", reject_table[i].name);
}
-static struct iptables_target reject = {
+static struct iptables_target reject_target = {
.name = "REJECT",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_reject_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_reject_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = REJECT_help,
+ .init = REJECT_init,
+ .parse = REJECT_parse,
+ .print = REJECT_print,
+ .save = REJECT_save,
+ .extra_opts = REJECT_opts,
};
void _init(void)
{
- register_target(&reject);
+ register_target(&reject_target);
}
#include "../include/linux/netfilter_ipv4/ipt_SAME.h"
/* Function which prints out usage message. */
-static void
-help(void)
+static void SAME_help(void)
{
printf(
"SAME v%s options:\n"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option SAME_opts[] = {
{ "to", 1, NULL, '1' },
{ "nodst", 0, NULL, '2'},
{ "random", 0, NULL, '3' },
};
/* Initialize the target. */
-static void
-init(struct xt_entry_target *t)
+static void SAME_init(struct xt_entry_target *t)
{
struct ipt_same_info *mr = (struct ipt_same_info *)t->data;
/* 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 SAME_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_same_info *mr
= (struct ipt_same_info *)(*target)->data;
}
/* Final check; need --to. */
-static void final_check(unsigned int flags)
+static void SAME_check(unsigned int flags)
{
if (!(flags & IPT_SAME_OPT_TO))
exit_error(PARAMETER_PROBLEM,
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void SAME_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
int count;
struct ipt_same_info *mr
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void SAME_save(const void *ip, const struct xt_entry_target *target)
{
int count;
struct ipt_same_info *mr
printf("--random ");
}
-static struct iptables_target same = {
+static struct iptables_target same_target = {
.name = "SAME",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_same_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_same_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = SAME_help,
+ .init = SAME_init,
+ .parse = SAME_parse,
+ .final_check = SAME_check,
+ .print = SAME_print,
+ .save = SAME_save,
+ .extra_opts = SAME_opts,
};
void _init(void)
{
- register_target(&same);
+ register_target(&same_target);
}
#include "libipt_set.h"
/* Function which prints out usage message. */
-static void help(void)
+static void SET_help(void)
{
printf("SET v%s options:\n"
" --add-set name flags\n"
"\n", IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option SET_opts[] = {
{"add-set", 1, 0, '1'},
{"del-set", 1, 0, '2'},
{0}
};
/* Initialize the target. */
-static void init(struct xt_entry_target *target)
+static void SET_init(struct xt_entry_target *target)
{
struct ipt_set_info_target *info =
(struct ipt_set_info_target *) target->data;
/* 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 SET_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_set_info_target *myinfo =
(struct ipt_set_info_target *) (*target)->data;
}
/* Final check; must specify at least one. */
-static void final_check(unsigned int flags)
+static void SET_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 SET_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct ipt_set_info_target *info =
(struct ipt_set_info_target *) 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 SET_save(const void *ip, const struct xt_entry_target *target)
{
struct ipt_set_info_target *info =
(struct ipt_set_info_target *) target->data;
print_target("--del-set", &info->del_set);
}
-static
-struct iptables_target ipt_set_target
-= {
+static struct iptables_target set_target = {
.name = "SET",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_set_info_target)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_set_info_target)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = SET_help,
+ .init = SET_init,
+ .parse = SET_parse,
+ .final_check = SET_check,
+ .print = SET_print,
+ .save = SET_save,
+ .extra_opts = SET_opts,
};
void _init(void)
{
- register_target(&ipt_set_target);
+ register_target(&set_target);
}
};
/* Function which prints out usage message. */
-static void
-help(void)
+static void SNAT_help(void)
{
printf(
"SNAT v%s options:\n"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option SNAT_opts[] = {
{ "to-source", 1, NULL, '1' },
{ "random", 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 *e,
- struct xt_entry_target **target)
+static int SNAT_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *e, struct xt_entry_target **target)
{
const struct ipt_entry *entry = e;
struct ipt_natinfo *info = (void *)*target;
}
/* Final check; must have specfied --to-source. */
-static void final_check(unsigned int flags)
+static void SNAT_check(unsigned int flags)
{
if (!(flags & IPT_SNAT_OPT_SOURCE))
exit_error(PARAMETER_PROBLEM,
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target,
- int numeric)
+static void SNAT_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
struct ipt_natinfo *info = (void *)target;
unsigned int i = 0;
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
-static void
-save(const void *ip, const struct xt_entry_target *target)
+static void SNAT_save(const void *ip, const struct xt_entry_target *target)
{
struct ipt_natinfo *info = (void *)target;
unsigned int i = 0;
}
}
-static struct iptables_target snat = {
+static struct iptables_target snat_target = {
.name = "SNAT",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
.userspacesize = IPT_ALIGN(sizeof(struct ip_nat_multi_range)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = SNAT_help,
+ .parse = SNAT_parse,
+ .final_check = SNAT_check,
+ .print = SNAT_print,
+ .save = SNAT_save,
+ .extra_opts = SNAT_opts,
};
void _init(void)
{
- register_target(&snat);
+ register_target(&snat_target);
}
};
/* Function which prints out usage message. */
-static void
-help(void)
+static void TOS_help(void)
{
unsigned int i;
fputc('\n', stdout);
}
-static const struct option opts[] = {
+static const struct option TOS_opts[] = {
{ "set-tos", 1, NULL, '1' },
{ }
};
/* 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 TOS_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_tos_target_info *tosinfo
= (struct ipt_tos_target_info *)(*target)->data;
return 1;
}
-static void
-final_check(unsigned int flags)
+static void TOS_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 TOS_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ipt_tos_target_info *tosinfo =
(const struct ipt_tos_target_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 TOS_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_tos_target_info *tosinfo =
(const struct ipt_tos_target_info *)target->data;
printf("--set-tos 0x%02x ", tosinfo->tos);
}
-static struct iptables_target tos = {
+static struct iptables_target tos_target = {
.name = "TOS",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_tos_target_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_tos_target_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = TOS_help,
+ .parse = TOS_parse,
+ .final_check = TOS_check,
+ .print = TOS_print,
+ .save = TOS_save,
+ .extra_opts = TOS_opts,
};
void _init(void)
{
- register_target(&tos);
+ register_target(&tos_target);
}
#define IPT_TTL_USED 1
-static void help(void)
+static void TTL_help(void)
{
printf(
"TTL target v%s options\n"
, IPTABLES_VERSION);
}
-static int parse(int c, char **argv, int invert, unsigned int *flags,
- const void *entry,
- struct xt_entry_target **target)
+static int TTL_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_TTL_info *info = (struct ipt_TTL_info *) (*target)->data;
unsigned int value;
return 1;
}
-static void final_check(unsigned int flags)
+static void TTL_check(unsigned int flags)
{
if (!(flags & IPT_TTL_USED))
exit_error(PARAMETER_PROBLEM,
"TTL: You must specify an action");
}
-static void save(const void *ip,
- const struct xt_entry_target *target)
+static void TTL_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_TTL_info *info =
(struct ipt_TTL_info *) target->data;
printf("%u ", info->ttl);
}
-static void print(const void *ip,
- const struct xt_entry_target *target, int numeric)
+static void TTL_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ipt_TTL_info *info =
(struct ipt_TTL_info *) target->data;
printf("%u ", info->ttl);
}
-static const struct option opts[] = {
+static const struct option TTL_opts[] = {
{ "ttl-set", 1, NULL, '1' },
{ "ttl-dec", 1, NULL, '2' },
{ "ttl-inc", 1, NULL, '3' },
{ }
};
-static struct iptables_target TTL = {
+static struct iptables_target ttl_target = {
.next = NULL,
.name = "TTL",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_TTL_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_TTL_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = TTL_help,
+ .parse = TTL_parse,
+ .final_check = TTL_check,
+ .print = TTL_print,
+ .save = TTL_save,
+ .extra_opts = TTL_opts,
};
void _init(void)
{
- register_target(&TTL);
+ register_target(&ttl_target);
}
}
/* Function which prints out usage message. */
-static void help(void)
+static void ULOG_help(void)
{
printf("ULOG v%s options:\n"
" --ulog-nlgroup nlgroup NETLINK group used for logging\n"
IPTABLES_VERSION);
}
-static const struct option opts[] = {
+static const struct option ULOG_opts[] = {
{"ulog-nlgroup", 1, NULL, '!'},
{"ulog-prefix", 1, NULL, '#'},
{"ulog-cprange", 1, NULL, 'A'},
};
/* Initialize the target. */
-static void init(struct xt_entry_target *t)
+static void ULOG_init(struct xt_entry_target *t)
{
struct ipt_ulog_info *loginfo = (struct ipt_ulog_info *) t->data;
/* 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 ULOG_parse(int c, char **argv, int invert, unsigned int *flags,
+ const void *entry, struct xt_entry_target **target)
{
struct ipt_ulog_info *loginfo =
(struct ipt_ulog_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 ULOG_save(const void *ip, const struct xt_entry_target *target)
{
const struct ipt_ulog_info *loginfo
= (const struct ipt_ulog_info *) target->data;
}
/* Prints out the targinfo. */
-static void
-print(const void *ip,
- const struct xt_entry_target *target, int numeric)
+static void ULOG_print(const void *ip, const struct xt_entry_target *target,
+ int numeric)
{
const struct ipt_ulog_info *loginfo
= (const struct ipt_ulog_info *) target->data;
printf("queue_threshold %u ", (unsigned int)loginfo->qthreshold);
}
-static struct iptables_target ulog = {
+static struct iptables_target ulog_target = {
.name = "ULOG",
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_ulog_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_ulog_info)),
- .help = &help,
- .init = &init,
- .parse = &parse,
- .print = &print,
- .save = &save,
- .extra_opts = opts
+ .help = ULOG_help,
+ .init = ULOG_init,
+ .parse = ULOG_parse,
+ .print = ULOG_print,
+ .save = ULOG_save,
+ .extra_opts = ULOG_opts,
};
void _init(void)
{
- register_target(&ulog);
+ register_target(&ulog_target);
}