Commit 054f7565 authored by Art Haas's avatar Art Haas Committed by David S. Miller

[PATCH] Add C99 initializers to net/ipv4/netfilter.

parent 3577484e
......@@ -1205,14 +1205,24 @@ void arpt_unregister_table(struct arpt_table *table)
}
/* The built-in targets: standard (NULL) and error. */
static struct arpt_target arpt_standard_target
= { { NULL, NULL }, ARPT_STANDARD_TARGET, NULL, NULL, NULL };
static struct arpt_target arpt_error_target
= { { NULL, NULL }, ARPT_ERROR_TARGET, arpt_error, NULL, NULL };
static struct nf_sockopt_ops arpt_sockopts
= { { NULL, NULL }, PF_INET, ARPT_BASE_CTL, ARPT_SO_SET_MAX+1, do_arpt_set_ctl,
ARPT_BASE_CTL, ARPT_SO_GET_MAX+1, do_arpt_get_ctl, 0, NULL };
static struct arpt_target arpt_standard_target = {
.name = ARPT_STANDARD_TARGET,
};
static struct arpt_target arpt_error_target = {
.name = ARPT_ERROR_TARGET,
.target = arpt_error,
};
static struct nf_sockopt_ops arpt_sockopts = {
.pf = PF_INET,
.set_optmin = ARPT_BASE_CTL,
.set_optmax = ARPT_SO_SET_MAX+1,
.set = do_arpt_set_ctl,
.get_optmin = ARPT_BASE_CTL,
.get_optmax = ARPT_SO_GET_MAX+1,
.get = do_arpt_get_ctl,
};
#ifdef CONFIG_PROC_FS
static inline int print_name(const struct arpt_table *t,
......
......@@ -1339,11 +1339,12 @@ getorigdst(struct sock *sk, int optval, void *user, int *len)
return -ENOENT;
}
static struct nf_sockopt_ops so_getorigdst
= { { NULL, NULL }, PF_INET,
0, 0, NULL, /* Setsockopts */
SO_ORIGINAL_DST, SO_ORIGINAL_DST+1, &getorigdst,
0, NULL };
static struct nf_sockopt_ops so_getorigdst = {
.pf = PF_INET,
.get_optmin = SO_ORIGINAL_DST,
.get_optmax = SO_ORIGINAL_DST+1,
.get = &getorigdst,
};
#define NET_IP_CONNTRACK_MAX 2089
#define NET_IP_CONNTRACK_MAX_NAME "ip_conntrack_max"
......@@ -1367,7 +1368,6 @@ static ctl_table ip_conntrack_dir_table[] = {
{
.ctl_name = NET_IPV4,
.procname = "ipv4",
.maxlen = 0,
.mode = 0555,
.child = ip_conntrack_table
},
......@@ -1378,7 +1378,6 @@ static ctl_table ip_conntrack_root_table[] = {
{
.ctl_name = CTL_NET,
.procname = "net",
.maxlen = 0,
.mode = 0555,
.child = ip_conntrack_dir_table
},
......
......@@ -555,9 +555,7 @@ ipq_rcv_dev_event(struct notifier_block *this,
}
static struct notifier_block ipq_dev_notifier = {
ipq_rcv_dev_event,
NULL,
0
.notifier_call = ipq_rcv_dev_event,
};
static int
......@@ -577,9 +575,7 @@ ipq_rcv_nl_event(struct notifier_block *this,
}
static struct notifier_block ipq_nl_notifier = {
ipq_rcv_nl_event,
NULL,
0
.notifier_call = ipq_rcv_nl_event,
};
static int sysctl_maxlen = IPQ_QMAX_DEFAULT;
......@@ -601,7 +597,6 @@ static ctl_table ipq_dir_table[] = {
{
.ctl_name = NET_IPV4,
.procname = "ipv4",
.maxlen = 0,
.mode = 0555,
.child = ipq_table
},
......@@ -612,7 +607,6 @@ static ctl_table ipq_root_table[] = {
{
.ctl_name = CTL_NET,
.procname = "net",
.maxlen = 0,
.mode = 0555,
.child = ipq_dir_table
},
......
......@@ -1663,21 +1663,42 @@ icmp_checkentry(const char *tablename,
}
/* The built-in targets: standard (NULL) and error. */
static struct ipt_target ipt_standard_target
= { { NULL, NULL }, IPT_STANDARD_TARGET, NULL, NULL, NULL };
static struct ipt_target ipt_error_target
= { { NULL, NULL }, IPT_ERROR_TARGET, ipt_error, NULL, NULL };
static struct nf_sockopt_ops ipt_sockopts
= { { NULL, NULL }, PF_INET, IPT_BASE_CTL, IPT_SO_SET_MAX+1, do_ipt_set_ctl,
IPT_BASE_CTL, IPT_SO_GET_MAX+1, do_ipt_get_ctl, 0, NULL };
static struct ipt_match tcp_matchstruct
= { { NULL, NULL }, "tcp", &tcp_match, &tcp_checkentry, NULL };
static struct ipt_match udp_matchstruct
= { { NULL, NULL }, "udp", &udp_match, &udp_checkentry, NULL };
static struct ipt_match icmp_matchstruct
= { { NULL, NULL }, "icmp", &icmp_match, &icmp_checkentry, NULL };
static struct ipt_target ipt_standard_target = {
.name = IPT_STANDARD_TARGET,
};
static struct ipt_target ipt_error_target = {
.name = IPT_ERROR_TARGET,
.target = ipt_error,
};
static struct nf_sockopt_ops ipt_sockopts = {
.pf = PF_INET,
.set_optmin = IPT_BASE_CTL,
.set_optmax = IPT_SO_SET_MAX+1,
.set = do_ipt_set_ctl,
.get_optmin = IPT_BASE_CTL,
.get_optmax = IPT_SO_GET_MAX+1,
.get = do_ipt_get_ctl,
};
static struct ipt_match tcp_matchstruct = {
.name = "tcp",
.match = &tcp_match,
.checkentry = &tcp_checkentry,
};
static struct ipt_match udp_matchstruct = {
.name = "udp",
.match = &udp_match,
.checkentry = &udp_checkentry,
};
static struct ipt_match icmp_matchstruct = {
.name = "icmp",
.match = &icmp_match,
.checkentry = &icmp_checkentry,
};
#ifdef CONFIG_PROC_FS
static inline int print_name(const struct ipt_table *t,
......
......@@ -1315,9 +1315,7 @@ int ipfw_device_event(struct notifier_block *this, unsigned long event, void *pt
}
static struct notifier_block ipfw_dev_notifier={
ipfw_device_event,
NULL,
0
.notifier_call = ipfw_device_event,
};
#endif
......
......@@ -88,8 +88,12 @@ checkentry(const char *tablename,
return 1;
}
static struct ipt_target ipt_dscp_reg
= { { NULL, NULL }, "DSCP", target, checkentry, NULL, THIS_MODULE };
static struct ipt_target ipt_dscp_reg = {
.name = "DSCP",
.target = target,
.checkentry = checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -164,8 +164,12 @@ checkentry(const char *tablename,
return 1;
}
static struct ipt_target ipt_ecn_reg
= { { NULL, NULL }, "ECN", target, checkentry, NULL, THIS_MODULE };
static struct ipt_target ipt_ecn_reg = {
.name = "ECN",
.target = target,
.checkentry = checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -350,9 +350,12 @@ static int ipt_log_checkentry(const char *tablename,
return 1;
}
static struct ipt_target ipt_log_reg
= { { NULL, NULL }, "LOG", ipt_log_target, ipt_log_checkentry, NULL,
THIS_MODULE };
static struct ipt_target ipt_log_reg = {
.name = "LOG",
.target = ipt_log_target,
.checkentry = ipt_log_checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -46,8 +46,12 @@ checkentry(const char *tablename,
return 1;
}
static struct ipt_target ipt_mark_reg
= { { NULL, NULL }, "MARK", target, checkentry, NULL, THIS_MODULE };
static struct ipt_target ipt_mark_reg = {
.name = "MARK",
.target = target,
.checkentry = checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -167,20 +167,19 @@ static int masq_inet_event(struct notifier_block *this,
}
static struct notifier_block masq_dev_notifier = {
masq_device_event,
NULL,
0
.notifier_call = masq_device_event,
};
static struct notifier_block masq_inet_notifier = {
masq_inet_event,
NULL,
0
.notifier_call = masq_inet_event,
};
static struct ipt_target masquerade
= { { NULL, NULL }, "MASQUERADE", masquerade_target, masquerade_check, NULL,
THIS_MODULE };
static struct ipt_target masquerade = {
.name = "MASQUERADE",
.target = masquerade_target,
.checkentry = masquerade_check,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -157,9 +157,12 @@ static int ipt_mirror_checkentry(const char *tablename,
return 1;
}
static struct ipt_target ipt_mirror_reg
= { { NULL, NULL }, "MIRROR", ipt_mirror_target, ipt_mirror_checkentry, NULL,
THIS_MODULE };
static struct ipt_target ipt_mirror_reg = {
.name = "MIRROR",
.target = ipt_mirror_target,
.checkentry = ipt_mirror_checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -96,9 +96,12 @@ redirect_target(struct sk_buff **pskb,
return ip_nat_setup_info(ct, &newrange, hooknum);
}
static struct ipt_target redirect_reg
= { { NULL, NULL }, "REDIRECT", redirect_target, redirect_check, NULL,
THIS_MODULE };
static struct ipt_target redirect_reg = {
.name = "REDIRECT",
.target = redirect_target,
.checkentry = redirect_check,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -386,8 +386,12 @@ static int check(const char *tablename,
return 1;
}
static struct ipt_target ipt_reject_reg
= { { NULL, NULL }, "REJECT", reject, check, NULL, THIS_MODULE };
static struct ipt_target ipt_reject_reg = {
.name = "REJECT",
.target = reject,
.checkentry = check,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -238,9 +238,12 @@ ipt_tcpmss_checkentry(const char *tablename,
return 0;
}
static struct ipt_target ipt_tcpmss_reg
= { { NULL, NULL }, "TCPMSS",
ipt_tcpmss_target, ipt_tcpmss_checkentry, NULL, THIS_MODULE };
static struct ipt_target ipt_tcpmss_reg = {
.name = "TCPMSS",
.target = ipt_tcpmss_target,
.checkentry = ipt_tcpmss_checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -76,8 +76,12 @@ checkentry(const char *tablename,
return 1;
}
static struct ipt_target ipt_tos_reg
= { { NULL, NULL }, "TOS", target, checkentry, NULL, THIS_MODULE };
static struct ipt_target ipt_tos_reg = {
.name = "TOS",
.target = target,
.checkentry = checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -304,9 +304,11 @@ static int ipt_ulog_checkentry(const char *tablename,
return 1;
}
static struct ipt_target ipt_ulog_reg =
{ {NULL, NULL}, "ULOG", ipt_ulog_target, ipt_ulog_checkentry, NULL,
THIS_MODULE
static struct ipt_target ipt_ulog_reg = {
.name = "ULOG",
.target = ipt_ulog_target,
.checkentry = ipt_ulog_checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
......
......@@ -87,8 +87,12 @@ checkentry(const char *tablename,
return 1;
}
static struct ipt_match ah_match
= { { NULL, NULL }, "ah", &match, &checkentry, NULL, THIS_MODULE };
static struct ipt_match ah_match = {
.name = "ah",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -100,8 +100,12 @@ static int check(const char *tablename,
return 1;
}
static struct ipt_match conntrack_match
= { { NULL, NULL }, "conntrack", &match, &check, NULL, THIS_MODULE };
static struct ipt_match conntrack_match = {
.name = "conntrack",
.match = &match,
.checkentry = &check,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -40,8 +40,12 @@ static int checkentry(const char *tablename, const struct ipt_ip *ip,
return 1;
}
static struct ipt_match dscp_match = { { NULL, NULL }, "dscp", &match,
&checkentry, NULL, THIS_MODULE };
static struct ipt_match dscp_match = {
.name = "dscp",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -101,8 +101,12 @@ static int checkentry(const char *tablename, const struct ipt_ip *ip,
return 1;
}
static struct ipt_match ecn_match = { { NULL, NULL }, "ecn", &match,
&checkentry, NULL, THIS_MODULE };
static struct ipt_match ecn_match = {
.name = "ecn",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -87,8 +87,12 @@ checkentry(const char *tablename,
return 1;
}
static struct ipt_match esp_match
= { { NULL, NULL }, "esp", &match, &checkentry, NULL, THIS_MODULE };
static struct ipt_match esp_match = {
.name = "esp",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -89,8 +89,12 @@ static int check(const char *tablename,
return 1;
}
static struct ipt_match helper_match
= { { NULL, NULL }, "helper", &match, &check, NULL, THIS_MODULE };
static struct ipt_match helper_match = {
.name = "helper",
.match = &match,
.checkentry = &check,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -38,8 +38,12 @@ checkentry(const char *tablename,
return 1;
}
static struct ipt_match length_match
= { { NULL, NULL }, "length", &match, &checkentry, NULL, THIS_MODULE };
static struct ipt_match length_match = {
.name = "length",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -115,9 +115,12 @@ ipt_limit_checkentry(const char *tablename,
return 1;
}
static struct ipt_match ipt_limit_reg
= { { NULL, NULL }, "limit", ipt_limit_match, ipt_limit_checkentry, NULL,
THIS_MODULE };
static struct ipt_match ipt_limit_reg = {
.name = "limit",
.match = ipt_limit_match,
.checkentry = ipt_limit_checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -47,8 +47,12 @@ ipt_mac_checkentry(const char *tablename,
return 1;
}
static struct ipt_match mac_match
= { { NULL, NULL }, "mac", &match, &ipt_mac_checkentry, NULL, THIS_MODULE };
static struct ipt_match mac_match = {
.name = "mac",
.match = &match,
.checkentry = &ipt_mac_checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -33,8 +33,12 @@ checkentry(const char *tablename,
return 1;
}
static struct ipt_match mark_match
= { { NULL, NULL }, "mark", &match, &checkentry, NULL, THIS_MODULE };
static struct ipt_match mark_match = {
.name = "mark",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -86,8 +86,12 @@ checkentry(const char *tablename,
&& multiinfo->count <= IPT_MULTI_PORTS;
}
static struct ipt_match multiport_match
= { { NULL, NULL }, "multiport", &match, &checkentry, NULL, THIS_MODULE };
static struct ipt_match multiport_match = {
.name = "multiport",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -176,8 +176,12 @@ checkentry(const char *tablename,
return 1;
}
static struct ipt_match owner_match
= { { NULL, NULL }, "owner", &match, &checkentry, NULL, THIS_MODULE };
static struct ipt_match owner_match = {
.name = "owner",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -63,8 +63,12 @@ checkentry(const char *tablename,
return 1;
}
static struct ipt_match physdev_match
= { { NULL, NULL }, "physdev", &match, &checkentry, NULL, THIS_MODULE };
static struct ipt_match physdev_match = {
.name = "physdev",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -42,8 +42,12 @@ static int checkentry(const char *tablename,
return 1;
}
static struct ipt_match pkttype_match
= { { NULL, NULL }, "pkttype", &match, &checkentry, NULL, THIS_MODULE };
static struct ipt_match pkttype_match = {
.name = "pkttype",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -41,8 +41,12 @@ static int check(const char *tablename,
return 1;
}
static struct ipt_match state_match
= { { NULL, NULL }, "state", &match, &check, NULL, THIS_MODULE };
static struct ipt_match state_match = {
.name = "state",
.match = &match,
.checkentry = &check,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -91,8 +91,12 @@ checkentry(const char *tablename,
return 1;
}
static struct ipt_match tcpmss_match
= { { NULL, NULL }, "tcpmss", &match, &checkentry, NULL, THIS_MODULE };
static struct ipt_match tcpmss_match = {
.name = "tcpmss",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -34,8 +34,12 @@ checkentry(const char *tablename,
return 1;
}
static struct ipt_match tos_match
= { { NULL, NULL }, "tos", &match, &checkentry, NULL, THIS_MODULE };
static struct ipt_match tos_match = {
.name = "tos",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -57,8 +57,12 @@ static int checkentry(const char *tablename, const struct ipt_ip *ip,
return 1;
}
static struct ipt_match ttl_match = { { NULL, NULL }, "ttl", &match,
&checkentry, NULL, THIS_MODULE };
static struct ipt_match ttl_match = {
.name = "ttl",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
......@@ -580,8 +580,12 @@ checkentry(const char *tablename,
return 1;
}
static struct ipt_match unclean_match
= { { NULL, NULL }, "unclean", &match, &checkentry, NULL, THIS_MODULE };
static struct ipt_match unclean_match = {
.name = "unclean",
.match = &match,
.checkentry = &checkentry,
.me = THIS_MODULE,
};
static int __init init(void)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment