]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
make structure initializers use C99 standard (Harald Welte)
authorHarald Welte <laforge@gnumonks.org>
Tue, 1 Feb 2005 15:38:20 +0000 (15:38 +0000)
committerHarald Welte <laforge@gnumonks.org>
Tue, 1 Feb 2005 15:38:20 +0000 (15:38 +0000)
19 files changed:
extensions/libip6t_REJECT.c
extensions/libip6t_ROUTE.c
extensions/libip6t_eui64.c
extensions/libip6t_hbh.c
extensions/libip6t_icmpv6.c
extensions/libip6t_ipv6header.c
extensions/libip6t_length.c
extensions/libip6t_limit.c
extensions/libip6t_mac.c
extensions/libip6t_mark.c
extensions/libip6t_multiport.c
extensions/libip6t_nth.c
extensions/libip6t_owner.c
extensions/libip6t_physdev.c
extensions/libip6t_random.c
extensions/libip6t_rt.c
extensions/libip6t_standard.c
extensions/libip6t_tcp.c
extensions/libip6t_udp.c

index 8c4cc7f348b36beea44c7d04968cdcefb55e02b0..702f6b3de77d25fc12d2271347eaa8fb9d64a12f 100644 (file)
@@ -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)
index 94a9180e38fa725b45ba6e35d7b56cecc58dcf46..ad83a1d6cd8262a6f0e77cadcd1d9959ec16eb5d 100644 (file)
@@ -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)
index 56dca06c713234010c7a0438038051b1bc117c3b..f8962c60c7aff2f7c889d996972b7ad2146d1ec3 100644 (file)
@@ -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)
index d0acd4229e644b5950ef0ba0682d2418495d6f6e..bdcbf9b7c571f7f507d8e92f793b9ced699621fb 100644 (file)
@@ -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
index 52d7871ac683bc2cb908d339d29dd769932c99dd..62ee90f5a847d5855c9480fe159f505a29455cdb 100644 (file)
@@ -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)
index 3437e228f2d05554c5053253421a890d9b176e09..a06ced6e2d41a0471068a2f51cad923014a2c8e5 100644 (file)
@@ -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)
index b8fa15b4db5ac6016a695b0d8a94688b0095c570..0d531aea2e96f9710ecec2930db18b76714d7404 100644 (file)
@@ -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)
index 5084946afbdf474d7836111e7ede53d6d3554545..927b6d1488d9534a1d354cb183122c58215c9e1e 100644 (file)
@@ -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)
index 617b353ff65ba57fb003952c5af3ce39774de2d2..353f746137e48ac31a64b2b67f52931d842ef823 100644 (file)
@@ -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)
index 5f335ebeca44e25da92b2e5e2486ff0fcc0cd01e..54a279e2ef18ea06b72de5f2ef658da130e726b2 100644 (file)
@@ -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)
index 2dc406d10489491f0897849f395bf71a1ff54d84..0206c1d80002762748338baf66779da3e852a058 100644 (file)
@@ -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
index 638074d583565686b2061f35a5dc2e4dfe279abb..26eeb26eb53fdac588af00be68c8041b69b87b5c 100644 (file)
@@ -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)
index 6d7258d40ddd1e583e6b0e5fcc5a91835af7c8e5..ec5c4fd5ab0acf0974758633ea43280af925029d 100644 (file)
@@ -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)
index d5fc506af97b5ad03226c7d6bee59b9aa67f67eb..ab2087cbf5c5eebc417c8663683ccafcde2b64b3 100644 (file)
@@ -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)
index 5f151eac6c94aafaa2adf7e04bd3dcde4cd0ea31..a4d1d29946738716709a799b9948c50bb79f5967 100644 (file)
@@ -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)
index 06cab1655f41c8c070d37582202575b3b74b6913..251604b29a842bced30003aa4945e65864478660 100644 (file)
@@ -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
index b8a0ce7959b609342b54b1a598c551bfbaa790d1..c48882f1d8afa312034eb5fc5bdfe3ff99902fe7 100644 (file)
@@ -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)
index a1a912c77b3e4a407ea7f3e3ac87737e6457eee8..3cd23528106634e5a59a2a72b5b143f3e5128436 100644 (file)
@@ -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)
index 139386cd0102a3e7c2838aeb31442bb3cf18a822..73e1d1e9286a339cb0e00c3ca3c71cedd157a235 100644 (file)
@@ -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