[NETFILTER]: Remove unused function from NAT protocol helpers

->print and ->print_range are not used (and apparently never were).

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Patrick McHardy and committed by
David S. Miller
9d28026b c07bc1ff

-167
-7
include/linux/netfilter_ipv4/ip_nat_protocol.h
··· 42 enum ip_nat_manip_type maniptype, 43 const struct ip_conntrack *conntrack); 44 45 - unsigned int (*print)(char *buffer, 46 - const struct ip_conntrack_tuple *match, 47 - const struct ip_conntrack_tuple *mask); 48 - 49 - unsigned int (*print_range)(char *buffer, 50 - const struct ip_nat_range *range); 51 - 52 int (*range_to_nfattr)(struct sk_buff *skb, 53 const struct ip_nat_range *range); 54
··· 42 enum ip_nat_manip_type maniptype, 43 const struct ip_conntrack *conntrack); 44 45 int (*range_to_nfattr)(struct sk_buff *skb, 46 const struct ip_nat_range *range); 47
-38
net/ipv4/netfilter/ip_nat_proto_gre.c
··· 151 return 1; 152 } 153 154 - /* print out a nat tuple */ 155 - static unsigned int 156 - gre_print(char *buffer, 157 - const struct ip_conntrack_tuple *match, 158 - const struct ip_conntrack_tuple *mask) 159 - { 160 - unsigned int len = 0; 161 - 162 - if (mask->src.u.gre.key) 163 - len += sprintf(buffer + len, "srckey=0x%x ", 164 - ntohl(match->src.u.gre.key)); 165 - 166 - if (mask->dst.u.gre.key) 167 - len += sprintf(buffer + len, "dstkey=0x%x ", 168 - ntohl(match->src.u.gre.key)); 169 - 170 - return len; 171 - } 172 - 173 - /* print a range of keys */ 174 - static unsigned int 175 - gre_print_range(char *buffer, const struct ip_nat_range *range) 176 - { 177 - if (range->min.gre.key != 0 178 - || range->max.gre.key != 0xFFFF) { 179 - if (range->min.gre.key == range->max.gre.key) 180 - return sprintf(buffer, "key 0x%x ", 181 - ntohl(range->min.gre.key)); 182 - else 183 - return sprintf(buffer, "keys 0x%u-0x%u ", 184 - ntohl(range->min.gre.key), 185 - ntohl(range->max.gre.key)); 186 - } else 187 - return 0; 188 - } 189 - 190 /* nat helper struct */ 191 static struct ip_nat_protocol gre = { 192 .name = "GRE", ··· 158 .manip_pkt = gre_manip_pkt, 159 .in_range = gre_in_range, 160 .unique_tuple = gre_unique_tuple, 161 - .print = gre_print, 162 - .print_range = gre_print_range, 163 #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 164 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 165 .range_to_nfattr = ip_nat_port_range_to_nfattr,
··· 151 return 1; 152 } 153 154 /* nat helper struct */ 155 static struct ip_nat_protocol gre = { 156 .name = "GRE", ··· 194 .manip_pkt = gre_manip_pkt, 195 .in_range = gre_in_range, 196 .unique_tuple = gre_unique_tuple, 197 #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 198 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 199 .range_to_nfattr = ip_nat_port_range_to_nfattr,
-34
net/ipv4/netfilter/ip_nat_proto_icmp.c
··· 74 return 1; 75 } 76 77 - static unsigned int 78 - icmp_print(char *buffer, 79 - const struct ip_conntrack_tuple *match, 80 - const struct ip_conntrack_tuple *mask) 81 - { 82 - unsigned int len = 0; 83 - 84 - if (mask->src.u.icmp.id) 85 - len += sprintf(buffer + len, "id=%u ", 86 - ntohs(match->src.u.icmp.id)); 87 - 88 - if (mask->dst.u.icmp.type) 89 - len += sprintf(buffer + len, "type=%u ", 90 - ntohs(match->dst.u.icmp.type)); 91 - 92 - if (mask->dst.u.icmp.code) 93 - len += sprintf(buffer + len, "code=%u ", 94 - ntohs(match->dst.u.icmp.code)); 95 - 96 - return len; 97 - } 98 - 99 - static unsigned int 100 - icmp_print_range(char *buffer, const struct ip_nat_range *range) 101 - { 102 - if (range->min.icmp.id != 0 || range->max.icmp.id != 0xFFFF) 103 - return sprintf(buffer, "id %u-%u ", 104 - ntohs(range->min.icmp.id), 105 - ntohs(range->max.icmp.id)); 106 - else return 0; 107 - } 108 - 109 struct ip_nat_protocol ip_nat_protocol_icmp = { 110 .name = "ICMP", 111 .protonum = IPPROTO_ICMP, ··· 81 .manip_pkt = icmp_manip_pkt, 82 .in_range = icmp_in_range, 83 .unique_tuple = icmp_unique_tuple, 84 - .print = icmp_print, 85 - .print_range = icmp_print_range, 86 #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 87 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 88 .range_to_nfattr = ip_nat_port_range_to_nfattr,
··· 74 return 1; 75 } 76 77 struct ip_nat_protocol ip_nat_protocol_icmp = { 78 .name = "ICMP", 79 .protonum = IPPROTO_ICMP, ··· 113 .manip_pkt = icmp_manip_pkt, 114 .in_range = icmp_in_range, 115 .unique_tuple = icmp_unique_tuple, 116 #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 117 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 118 .range_to_nfattr = ip_nat_port_range_to_nfattr,
-36
net/ipv4/netfilter/ip_nat_proto_tcp.c
··· 136 return 1; 137 } 138 139 - static unsigned int 140 - tcp_print(char *buffer, 141 - const struct ip_conntrack_tuple *match, 142 - const struct ip_conntrack_tuple *mask) 143 - { 144 - unsigned int len = 0; 145 - 146 - if (mask->src.u.tcp.port) 147 - len += sprintf(buffer + len, "srcpt=%u ", 148 - ntohs(match->src.u.tcp.port)); 149 - 150 - 151 - if (mask->dst.u.tcp.port) 152 - len += sprintf(buffer + len, "dstpt=%u ", 153 - ntohs(match->dst.u.tcp.port)); 154 - 155 - return len; 156 - } 157 - 158 - static unsigned int 159 - tcp_print_range(char *buffer, const struct ip_nat_range *range) 160 - { 161 - if (range->min.tcp.port != 0 || range->max.tcp.port != 0xFFFF) { 162 - if (range->min.tcp.port == range->max.tcp.port) 163 - return sprintf(buffer, "port %u ", 164 - ntohs(range->min.tcp.port)); 165 - else 166 - return sprintf(buffer, "ports %u-%u ", 167 - ntohs(range->min.tcp.port), 168 - ntohs(range->max.tcp.port)); 169 - } 170 - else return 0; 171 - } 172 - 173 struct ip_nat_protocol ip_nat_protocol_tcp = { 174 .name = "TCP", 175 .protonum = IPPROTO_TCP, ··· 143 .manip_pkt = tcp_manip_pkt, 144 .in_range = tcp_in_range, 145 .unique_tuple = tcp_unique_tuple, 146 - .print = tcp_print, 147 - .print_range = tcp_print_range, 148 #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 149 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 150 .range_to_nfattr = ip_nat_port_range_to_nfattr,
··· 136 return 1; 137 } 138 139 struct ip_nat_protocol ip_nat_protocol_tcp = { 140 .name = "TCP", 141 .protonum = IPPROTO_TCP, ··· 177 .manip_pkt = tcp_manip_pkt, 178 .in_range = tcp_in_range, 179 .unique_tuple = tcp_unique_tuple, 180 #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 181 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 182 .range_to_nfattr = ip_nat_port_range_to_nfattr,
-36
net/ipv4/netfilter/ip_nat_proto_udp.c
··· 122 return 1; 123 } 124 125 - static unsigned int 126 - udp_print(char *buffer, 127 - const struct ip_conntrack_tuple *match, 128 - const struct ip_conntrack_tuple *mask) 129 - { 130 - unsigned int len = 0; 131 - 132 - if (mask->src.u.udp.port) 133 - len += sprintf(buffer + len, "srcpt=%u ", 134 - ntohs(match->src.u.udp.port)); 135 - 136 - 137 - if (mask->dst.u.udp.port) 138 - len += sprintf(buffer + len, "dstpt=%u ", 139 - ntohs(match->dst.u.udp.port)); 140 - 141 - return len; 142 - } 143 - 144 - static unsigned int 145 - udp_print_range(char *buffer, const struct ip_nat_range *range) 146 - { 147 - if (range->min.udp.port != 0 || range->max.udp.port != 0xFFFF) { 148 - if (range->min.udp.port == range->max.udp.port) 149 - return sprintf(buffer, "port %u ", 150 - ntohs(range->min.udp.port)); 151 - else 152 - return sprintf(buffer, "ports %u-%u ", 153 - ntohs(range->min.udp.port), 154 - ntohs(range->max.udp.port)); 155 - } 156 - else return 0; 157 - } 158 - 159 struct ip_nat_protocol ip_nat_protocol_udp = { 160 .name = "UDP", 161 .protonum = IPPROTO_UDP, ··· 129 .manip_pkt = udp_manip_pkt, 130 .in_range = udp_in_range, 131 .unique_tuple = udp_unique_tuple, 132 - .print = udp_print, 133 - .print_range = udp_print_range, 134 #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 135 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 136 .range_to_nfattr = ip_nat_port_range_to_nfattr,
··· 122 return 1; 123 } 124 125 struct ip_nat_protocol ip_nat_protocol_udp = { 126 .name = "UDP", 127 .protonum = IPPROTO_UDP, ··· 163 .manip_pkt = udp_manip_pkt, 164 .in_range = udp_in_range, 165 .unique_tuple = udp_unique_tuple, 166 #if defined(CONFIG_IP_NF_CONNTRACK_NETLINK) || \ 167 defined(CONFIG_IP_NF_CONNTRACK_NETLINK_MODULE) 168 .range_to_nfattr = ip_nat_port_range_to_nfattr,
-16
net/ipv4/netfilter/ip_nat_proto_unknown.c
··· 46 return 1; 47 } 48 49 - static unsigned int 50 - unknown_print(char *buffer, 51 - const struct ip_conntrack_tuple *match, 52 - const struct ip_conntrack_tuple *mask) 53 - { 54 - return 0; 55 - } 56 - 57 - static unsigned int 58 - unknown_print_range(char *buffer, const struct ip_nat_range *range) 59 - { 60 - return 0; 61 - } 62 - 63 struct ip_nat_protocol ip_nat_unknown_protocol = { 64 .name = "unknown", 65 /* .me isn't set: getting a ref to this cannot fail. */ 66 .manip_pkt = unknown_manip_pkt, 67 .in_range = unknown_in_range, 68 .unique_tuple = unknown_unique_tuple, 69 - .print = unknown_print, 70 - .print_range = unknown_print_range 71 };
··· 46 return 1; 47 } 48 49 struct ip_nat_protocol ip_nat_unknown_protocol = { 50 .name = "unknown", 51 /* .me isn't set: getting a ref to this cannot fail. */ 52 .manip_pkt = unknown_manip_pkt, 53 .in_range = unknown_in_range, 54 .unique_tuple = unknown_unique_tuple, 55 };