Commit 373ac735 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[NETFILTER]: C99 initizalizers for NAT protocols

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 86e65da9
...@@ -106,16 +106,18 @@ icmp_print_range(char *buffer, const struct ip_nat_range *range) ...@@ -106,16 +106,18 @@ icmp_print_range(char *buffer, const struct ip_nat_range *range)
else return 0; else return 0;
} }
struct ip_nat_protocol ip_nat_protocol_icmp struct ip_nat_protocol ip_nat_protocol_icmp = {
= { "ICMP", IPPROTO_ICMP, THIS_MODULE, .name = "ICMP",
icmp_manip_pkt, .protonum = IPPROTO_ICMP,
icmp_in_range, .me = THIS_MODULE,
icmp_unique_tuple, .manip_pkt = icmp_manip_pkt,
icmp_print, .in_range = icmp_in_range,
icmp_print_range, .unique_tuple = icmp_unique_tuple,
.print = icmp_print,
.print_range = icmp_print_range,
#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \
defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE)
ip_nat_port_range_to_nfattr, .range_to_nfattr = ip_nat_port_range_to_nfattr,
ip_nat_port_nfattr_to_range, .nfattr_to_range = ip_nat_port_nfattr_to_range,
#endif #endif
}; };
...@@ -170,16 +170,18 @@ tcp_print_range(char *buffer, const struct ip_nat_range *range) ...@@ -170,16 +170,18 @@ tcp_print_range(char *buffer, const struct ip_nat_range *range)
else return 0; else return 0;
} }
struct ip_nat_protocol ip_nat_protocol_tcp struct ip_nat_protocol ip_nat_protocol_tcp = {
= { "TCP", IPPROTO_TCP, THIS_MODULE, .name = "TCP",
tcp_manip_pkt, .protonum = IPPROTO_TCP,
tcp_in_range, .me = THIS_MODULE,
tcp_unique_tuple, .manip_pkt = tcp_manip_pkt,
tcp_print, .in_range = tcp_in_range,
tcp_print_range, .unique_tuple = tcp_unique_tuple,
.print = tcp_print,
.print_range = tcp_print_range,
#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \
defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE)
ip_nat_port_range_to_nfattr, .range_to_nfattr = ip_nat_port_range_to_nfattr,
ip_nat_port_nfattr_to_range, .nfattr_to_range = ip_nat_port_nfattr_to_range,
#endif #endif
}; };
...@@ -156,16 +156,18 @@ udp_print_range(char *buffer, const struct ip_nat_range *range) ...@@ -156,16 +156,18 @@ udp_print_range(char *buffer, const struct ip_nat_range *range)
else return 0; else return 0;
} }
struct ip_nat_protocol ip_nat_protocol_udp struct ip_nat_protocol ip_nat_protocol_udp = {
= { "UDP", IPPROTO_UDP, THIS_MODULE, .name = "UDP",
udp_manip_pkt, .protonum = IPPROTO_UDP,
udp_in_range, .me = THIS_MODULE,
udp_unique_tuple, .manip_pkt = udp_manip_pkt,
udp_print, .in_range = udp_in_range,
udp_print_range, .unique_tuple = udp_unique_tuple,
.print = udp_print,
.print_range = udp_print_range,
#if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \
defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE)
ip_nat_port_range_to_nfattr, .range_to_nfattr = ip_nat_port_range_to_nfattr,
ip_nat_port_nfattr_to_range, .nfattr_to_range = ip_nat_port_nfattr_to_range,
#endif #endif
}; };
...@@ -61,10 +61,11 @@ unknown_print_range(char *buffer, const struct ip_nat_range *range) ...@@ -61,10 +61,11 @@ unknown_print_range(char *buffer, const struct ip_nat_range *range)
} }
struct ip_nat_protocol ip_nat_unknown_protocol = { struct ip_nat_protocol ip_nat_unknown_protocol = {
"unknown", 0, THIS_MODULE, .name = "unknown",
unknown_manip_pkt, .me = THIS_MODULE,
unknown_in_range, .manip_pkt = unknown_manip_pkt,
unknown_unique_tuple, .in_range = unknown_in_range,
unknown_print, .unique_tuple = unknown_unique_tuple,
unknown_print_range .print = unknown_print,
.print_range = unknown_print_range
}; };
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