src: use xtables_register_targets throughout

This commit is contained in:
Jan Engelhardt
2011-11-02 00:26:23 +01:00
parent d7aeb7da4b
commit bc1c37618a
3 changed files with 93 additions and 90 deletions

View File

@@ -151,7 +151,8 @@ rawdnat_tg6_save(const void *entry, const struct xt_entry_target *target)
info->mask); info->mask);
} }
static struct xtables_target rawdnat_tg4_reg = { static struct xtables_target rawdnat_tg_reg[] = {
{
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "RAWDNAT", .name = "RAWDNAT",
.revision = 0, .revision = 0,
@@ -164,9 +165,8 @@ static struct xtables_target rawdnat_tg4_reg = {
.print = rawdnat_tg4_print, .print = rawdnat_tg4_print,
.save = rawdnat_tg4_save, .save = rawdnat_tg4_save,
.extra_opts = rawdnat_tg_opts, .extra_opts = rawdnat_tg_opts,
}; },
{
static struct xtables_target rawdnat_tg6_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "RAWDNAT", .name = "RAWDNAT",
.revision = 0, .revision = 0,
@@ -179,10 +179,11 @@ static struct xtables_target rawdnat_tg6_reg = {
.print = rawdnat_tg6_print, .print = rawdnat_tg6_print,
.save = rawdnat_tg6_save, .save = rawdnat_tg6_save,
.extra_opts = rawdnat_tg_opts, .extra_opts = rawdnat_tg_opts,
},
}; };
static void _init(void) static void _init(void)
{ {
xtables_register_target(&rawdnat_tg4_reg); xtables_register_targets(rawdnat_tg_reg,
xtables_register_target(&rawdnat_tg6_reg); sizeof(rawdnat_tg_reg) / sizeof(*rawdnat_tg_reg));
} }

View File

@@ -151,7 +151,8 @@ rawsnat_tg6_save(const void *entry, const struct xt_entry_target *target)
info->mask); info->mask);
} }
static struct xtables_target rawsnat_tg4_reg = { static struct xtables_target rawsnat_tg_reg[] = {
{
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "RAWSNAT", .name = "RAWSNAT",
.revision = 0, .revision = 0,
@@ -164,9 +165,8 @@ static struct xtables_target rawsnat_tg4_reg = {
.print = rawsnat_tg4_print, .print = rawsnat_tg4_print,
.save = rawsnat_tg4_save, .save = rawsnat_tg4_save,
.extra_opts = rawsnat_tg_opts, .extra_opts = rawsnat_tg_opts,
}; },
{
static struct xtables_target rawsnat_tg6_reg = {
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.name = "RAWSNAT", .name = "RAWSNAT",
.revision = 0, .revision = 0,
@@ -179,10 +179,11 @@ static struct xtables_target rawsnat_tg6_reg = {
.print = rawsnat_tg6_print, .print = rawsnat_tg6_print,
.save = rawsnat_tg6_save, .save = rawsnat_tg6_save,
.extra_opts = rawsnat_tg_opts, .extra_opts = rawsnat_tg_opts,
},
}; };
static void _init(void) static void _init(void)
{ {
xtables_register_target(&rawsnat_tg4_reg); xtables_register_targets(rawsnat_tg_reg,
xtables_register_target(&rawsnat_tg6_reg); sizeof(rawsnat_tg_reg) / sizeof(*rawsnat_tg_reg));
} }

View File

@@ -135,7 +135,8 @@ static void tee_tg6_save(const void *ip, const struct xt_entry_target *target)
printf(" --gateway %s ", xtables_ip6addr_to_numeric(&info->gw.in6)); printf(" --gateway %s ", xtables_ip6addr_to_numeric(&info->gw.in6));
} }
static struct xtables_target tee_tg_reg = { static struct xtables_target tee_tg_reg[] = {
{
.name = "TEE", .name = "TEE",
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.revision = 0, .revision = 0,
@@ -148,9 +149,8 @@ static struct xtables_target tee_tg_reg = {
.print = tee_tg_print, .print = tee_tg_print,
.save = tee_tg_save, .save = tee_tg_save,
.extra_opts = tee_tg_opts, .extra_opts = tee_tg_opts,
}; },
{
static struct xtables_target tee_tg6_reg = {
.name = "TEE", .name = "TEE",
.version = XTABLES_VERSION, .version = XTABLES_VERSION,
.revision = 0, .revision = 0,
@@ -163,10 +163,11 @@ static struct xtables_target tee_tg6_reg = {
.print = tee_tg6_print, .print = tee_tg6_print,
.save = tee_tg6_save, .save = tee_tg6_save,
.extra_opts = tee_tg_opts, .extra_opts = tee_tg_opts,
},
}; };
static __attribute__((constructor)) void tee_tg_ldr(void) static __attribute__((constructor)) void tee_tg_ldr(void)
{ {
xtables_register_target(&tee_tg_reg); xtables_register_targets(tee_tg_reg,
xtables_register_target(&tee_tg6_reg); sizeof(tee_tg_reg) / sizeof(*tee_tg_reg));
} }