summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2005-02-01 15:38:20 +0000
committerHarald Welte <laforge@gnumonks.org>2005-02-01 15:38:20 +0000
commit02aa73312d6078b6de26757d5a558e0085ec20b5 (patch)
tree6063c31b752d5b6db91f096319850c3604259cb3
parent2b9d07b98158250d6b77efc8fc0148813339c59d (diff)
make structure initializers use C99 standard (Harald Welte)
-rw-r--r--extensions/libip6t_REJECT.c25
-rw-r--r--extensions/libip6t_ROUTE.c26
-rw-r--r--extensions/libip6t_eui64.c26
-rw-r--r--extensions/libip6t_hbh.c28
-rw-r--r--extensions/libip6t_icmpv6.c25
-rw-r--r--extensions/libip6t_ipv6header.c25
-rw-r--r--extensions/libip6t_length.c25
-rw-r--r--extensions/libip6t_limit.c26
-rw-r--r--extensions/libip6t_mac.c26
-rw-r--r--extensions/libip6t_mark.c26
-rw-r--r--extensions/libip6t_multiport.c26
-rw-r--r--extensions/libip6t_nth.c25
-rw-r--r--extensions/libip6t_owner.c26
-rw-r--r--extensions/libip6t_physdev.c26
-rw-r--r--extensions/libip6t_random.c25
-rw-r--r--extensions/libip6t_rt.c26
-rw-r--r--extensions/libip6t_standard.c25
-rw-r--r--extensions/libip6t_tcp.c27
-rw-r--r--extensions/libip6t_udp.c26
19 files changed, 229 insertions, 261 deletions
diff --git a/extensions/libip6t_REJECT.c b/extensions/libip6t_REJECT.c
index 8c4cc7f3..702f6b3d 100644
--- a/extensions/libip6t_REJECT.c
+++ b/extensions/libip6t_REJECT.c
@@ -152,19 +152,18 @@ static void save(const struct ip6t_ip6 *ip,
printf("--reject-with %s ", reject_table[i].name);
}
-struct ip6tables_target reject
-= { NULL,
- "REJECT",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_reject_info)),
- IP6T_ALIGN(sizeof(struct ip6t_reject_info)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+struct ip6tables_target reject = {
+ .name = "REJECT",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_reject_info)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_reject_info)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_ROUTE.c b/extensions/libip6t_ROUTE.c
index 94a9180e..ad83a1d6 100644
--- a/extensions/libip6t_ROUTE.c
+++ b/extensions/libip6t_ROUTE.c
@@ -220,20 +220,18 @@ static void save(const struct ip6t_ip6 *ip,
}
-static
-struct ip6tables_target route
-= { NULL,
- "ROUTE",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_route_target_info)),
- IP6T_ALIGN(sizeof(struct ip6t_route_target_info)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+static struct ip6tables_target route = {
+ .name = "ROUTE",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_route_target_info)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_route_target_info)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_eui64.c b/extensions/libip6t_eui64.c
index 56dca06c..f8962c60 100644
--- a/extensions/libip6t_eui64.c
+++ b/extensions/libip6t_eui64.c
@@ -65,20 +65,18 @@ static void save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match
}
-static
-struct ip6tables_match eui64
-= { NULL,
- "eui64",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(int)),
- IP6T_ALIGN(sizeof(int)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+static struct ip6tables_match eui64 = {
+ .name = "eui64",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(int)),
+ .userspacesize = IP6T_ALIGN(sizeof(int)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_hbh.c b/extensions/libip6t_hbh.c
index d0acd422..bdcbf9b7 100644
--- a/extensions/libip6t_hbh.c
+++ b/extensions/libip6t_hbh.c
@@ -237,24 +237,22 @@ static void save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match
}
-static
-struct ip6tables_match optstruct
-= { NULL,
+static struct ip6tables_match optstruct = {
#if HOPBYHOP
- "hbh",
+ .name = "hbh",
#else
- "dst",
+ .name = "dst",
#endif
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_opts)),
- IP6T_ALIGN(sizeof(struct ip6t_opts)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_opts)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_opts)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void
diff --git a/extensions/libip6t_icmpv6.c b/extensions/libip6t_icmpv6.c
index 52d7871a..62ee90f5 100644
--- a/extensions/libip6t_icmpv6.c
+++ b/extensions/libip6t_icmpv6.c
@@ -257,19 +257,18 @@ static void final_check(unsigned int flags)
{
}
-static struct ip6tables_match icmpv6
-= { NULL,
- "icmp6",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_icmp)),
- IP6T_ALIGN(sizeof(struct ip6t_icmp)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+static struct ip6tables_match icmpv6 = {
+ .name = "icmp6",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_icmp)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_icmp)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_ipv6header.c b/extensions/libip6t_ipv6header.c
index 3437e228..a06ced6e 100644
--- a/extensions/libip6t_ipv6header.c
+++ b/extensions/libip6t_ipv6header.c
@@ -298,19 +298,18 @@ save(const struct ip6t_ip6 *ip,
}
static
-struct ip6tables_match ipv6header
-= { NULL,
- "ipv6header",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_ipv6header_info)),
- IP6T_ALIGN(sizeof(struct ip6t_ipv6header_info)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+struct ip6tables_match ipv6header = {
+ .name = "ipv6header",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_ipv6header_info)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_ipv6header_info)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_length.c b/extensions/libip6t_length.c
index b8fa15b4..0d531aea 100644
--- a/extensions/libip6t_length.c
+++ b/extensions/libip6t_length.c
@@ -140,19 +140,18 @@ save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match)
print_length((struct ip6t_length_info *)match->data);
}
-struct ip6tables_match length
-= { NULL,
- "length",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_length_info)),
- IP6T_ALIGN(sizeof(struct ip6t_length_info)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+struct ip6tables_match length = {
+ .name = "length",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_length_info)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_length_info)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_limit.c b/extensions/libip6t_limit.c
index 5084946a..927b6d14 100644
--- a/extensions/libip6t_limit.c
+++ b/extensions/libip6t_limit.c
@@ -177,20 +177,18 @@ static void save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match
printf("--limit-burst %u ", r->burst);
}
-static
-struct ip6tables_match limit
-= { NULL,
- "limit",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_rateinfo)),
- offsetof(struct ip6t_rateinfo, prev),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+static struct ip6tables_match limit = {
+ .name = "limit",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_rateinfo)),
+ .userspacesize = offsetof(struct ip6t_rateinfo, prev),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_mac.c b/extensions/libip6t_mac.c
index 617b353f..353f7461 100644
--- a/extensions/libip6t_mac.c
+++ b/extensions/libip6t_mac.c
@@ -128,20 +128,18 @@ static void save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match
print_mac(((struct ip6t_mac_info *)match->data)->srcaddr);
}
-static
-struct ip6tables_match mac
-= { NULL,
- "mac",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_mac_info)),
- IP6T_ALIGN(sizeof(struct ip6t_mac_info)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+static struct ip6tables_match mac = {
+ .name = "mac",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_mac_info)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_mac_info)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_mark.c b/extensions/libip6t_mark.c
index 5f335ebe..54a279e2 100644
--- a/extensions/libip6t_mark.c
+++ b/extensions/libip6t_mark.c
@@ -131,20 +131,18 @@ save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match)
print_mark(info->mark, info->mask, 0);
}
-static
-struct ip6tables_match mark
-= { NULL,
- "mark",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_mark_info)),
- IP6T_ALIGN(sizeof(struct ip6t_mark_info)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+static struct ip6tables_match mark = {
+ .name = "mark",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_mark_info)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_mark_info)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_multiport.c b/extensions/libip6t_multiport.c
index 2dc406d1..0206c1d8 100644
--- a/extensions/libip6t_multiport.c
+++ b/extensions/libip6t_multiport.c
@@ -249,20 +249,18 @@ static void save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match
printf(" ");
}
-static
-struct ip6tables_match multiport
-= { NULL,
- "multiport",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_multiport)),
- IP6T_ALIGN(sizeof(struct ip6t_multiport)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+static struct ip6tables_match multiport = {
+ .name = "multiport",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_multiport)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_multiport)),
+ .help = &help,
+ .init = &init,
+ .parase = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void
diff --git a/extensions/libip6t_nth.c b/extensions/libip6t_nth.c
index 638074d5..26eeb26e 100644
--- a/extensions/libip6t_nth.c
+++ b/extensions/libip6t_nth.c
@@ -217,19 +217,18 @@ save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match)
printf("--packet %u ", nthinfo->packet );
}
-struct ip6tables_match nth
-= { NULL,
- "nth",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_nth_info)),
- IP6T_ALIGN(sizeof(struct ip6t_nth_info)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+struct ip6tables_match nth = {
+ .name = "nth",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_nth_info)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_nth_info)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_owner.c b/extensions/libip6t_owner.c
index 6d7258d4..ec5c4fd5 100644
--- a/extensions/libip6t_owner.c
+++ b/extensions/libip6t_owner.c
@@ -237,20 +237,18 @@ save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match)
#endif
}
-static
-struct ip6tables_match owner
-= { NULL,
- "owner",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_owner_info)),
- IP6T_ALIGN(sizeof(struct ip6t_owner_info)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+static struct ip6tables_match owner = {
+ .name = "owner",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_owner_info)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_owner_info)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_physdev.c b/extensions/libip6t_physdev.c
index d5fc506a..ab2087cb 100644
--- a/extensions/libip6t_physdev.c
+++ b/extensions/libip6t_physdev.c
@@ -210,20 +210,18 @@ static void save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match
printf(" ");
}
-static
-struct ip6tables_match physdev
-= { NULL,
- "physdev",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_physdev_info)),
- IP6T_ALIGN(sizeof(struct ip6t_physdev_info)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+static struct ip6tables_match physdev = {
+ .name = "physdev",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_physdev_info)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_physdev_info)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_random.c b/extensions/libip6t_random.c
index 5f151eac..a4d1d299 100644
--- a/extensions/libip6t_random.c
+++ b/extensions/libip6t_random.c
@@ -131,19 +131,18 @@ save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match)
printf("--average %u ", result.quot);
}
-struct ip6tables_match rand_match
-= { NULL,
- "random",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_rand_info)),
- IP6T_ALIGN(sizeof(struct ip6t_rand_info)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+struct ip6tables_match rand_match = {
+ .name = "random",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_rand_info)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_rand_info)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_rt.c b/extensions/libip6t_rt.c
index 06cab165..251604b2 100644
--- a/extensions/libip6t_rt.c
+++ b/extensions/libip6t_rt.c
@@ -341,20 +341,18 @@ static void save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match
}
-static
-struct ip6tables_match rt
-= { NULL,
- "rt",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_rt)),
- IP6T_ALIGN(sizeof(struct ip6t_rt)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+static struct ip6tables_match rt = {
+ .name = "rt",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_rt)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_rt)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void
diff --git a/extensions/libip6t_standard.c b/extensions/libip6t_standard.c
index b8a0ce79..c48882f1 100644
--- a/extensions/libip6t_standard.c
+++ b/extensions/libip6t_standard.c
@@ -47,20 +47,17 @@ save(const struct ip6t_ip6 *ip6, const struct ip6t_entry_target *target)
{
}
-static
-struct ip6tables_target standard
-= { NULL,
- "standard",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(int)),
- IP6T_ALIGN(sizeof(int)),
- &help,
- &init,
- &parse,
- &final_check,
- NULL, /* print */
- &save,
- opts
+static struct ip6tables_target standard = {
+ .name = "standard",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(int)),
+ .userspacesize = IP6T_ALIGN(sizeof(int)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .save = &save,
+ .extra_opts = opts,
};
void _init(void)
diff --git a/extensions/libip6t_tcp.c b/extensions/libip6t_tcp.c
index a1a912c7..3cd23528 100644
--- a/extensions/libip6t_tcp.c
+++ b/extensions/libip6t_tcp.c
@@ -424,20 +424,19 @@ static void save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match
}
}
-static
-struct ip6tables_match tcp
-= { NULL,
- "tcp",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_tcp)),
- IP6T_ALIGN(sizeof(struct ip6t_tcp)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts };
+static struct ip6tables_match tcp = {
+ .name = "tcp",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_tcp)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_tcp)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
+};
void
_init(void)
diff --git a/extensions/libip6t_udp.c b/extensions/libip6t_udp.c
index 139386cd..73e1d1e9 100644
--- a/extensions/libip6t_udp.c
+++ b/extensions/libip6t_udp.c
@@ -233,20 +233,18 @@ static void save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match
}
}
-static
-struct ip6tables_match udp
-= { NULL,
- "udp",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_udp)),
- IP6T_ALIGN(sizeof(struct ip6t_udp)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+static struct ip6tables_match udp = {
+ .name = "udp",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_udp)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_udp)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts,
};
void