aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip_vs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r--include/net/ip_vs.h292
1 files changed, 127 insertions, 165 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index f0d70f066f3d..5679d927562b 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -109,7 +109,6 @@ extern int ip_vs_conn_tab_size;
109struct ip_vs_iphdr { 109struct ip_vs_iphdr {
110 __u32 len; /* IPv4 simply where L4 starts 110 __u32 len; /* IPv4 simply where L4 starts
111 IPv6 where L4 Transport Header starts */ 111 IPv6 where L4 Transport Header starts */
112 __u32 thoff_reasm; /* Transport Header Offset in nfct_reasm skb */
113 __u16 fragoffs; /* IPv6 fragment offset, 0 if first frag (or not frag)*/ 112 __u16 fragoffs; /* IPv6 fragment offset, 0 if first frag (or not frag)*/
114 __s16 protocol; 113 __s16 protocol;
115 __s32 flags; 114 __s32 flags;
@@ -117,34 +116,12 @@ struct ip_vs_iphdr {
117 union nf_inet_addr daddr; 116 union nf_inet_addr daddr;
118}; 117};
119 118
120/* Dependency to module: nf_defrag_ipv6 */
121#if defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE)
122static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb)
123{
124 return skb->nfct_reasm;
125}
126static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset,
127 int len, void *buffer,
128 const struct ip_vs_iphdr *ipvsh)
129{
130 if (unlikely(ipvsh->fragoffs && skb_nfct_reasm(skb)))
131 return skb_header_pointer(skb_nfct_reasm(skb),
132 ipvsh->thoff_reasm, len, buffer);
133
134 return skb_header_pointer(skb, offset, len, buffer);
135}
136#else
137static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb)
138{
139 return NULL;
140}
141static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset, 119static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset,
142 int len, void *buffer, 120 int len, void *buffer,
143 const struct ip_vs_iphdr *ipvsh) 121 const struct ip_vs_iphdr *ipvsh)
144{ 122{
145 return skb_header_pointer(skb, offset, len, buffer); 123 return skb_header_pointer(skb, offset, len, buffer);
146} 124}
147#endif
148 125
149static inline void 126static inline void
150ip_vs_fill_ip4hdr(const void *nh, struct ip_vs_iphdr *iphdr) 127ip_vs_fill_ip4hdr(const void *nh, struct ip_vs_iphdr *iphdr)
@@ -171,19 +148,12 @@ ip_vs_fill_iph_skb(int af, const struct sk_buff *skb, struct ip_vs_iphdr *iphdr)
171 (struct ipv6hdr *)skb_network_header(skb); 148 (struct ipv6hdr *)skb_network_header(skb);
172 iphdr->saddr.in6 = iph->saddr; 149 iphdr->saddr.in6 = iph->saddr;
173 iphdr->daddr.in6 = iph->daddr; 150 iphdr->daddr.in6 = iph->daddr;
174 /* ipv6_find_hdr() updates len, flags, thoff_reasm */ 151 /* ipv6_find_hdr() updates len, flags */
175 iphdr->thoff_reasm = 0;
176 iphdr->len = 0; 152 iphdr->len = 0;
177 iphdr->flags = 0; 153 iphdr->flags = 0;
178 iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1, 154 iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1,
179 &iphdr->fragoffs, 155 &iphdr->fragoffs,
180 &iphdr->flags); 156 &iphdr->flags);
181 /* get proto from re-assembled packet and it's offset */
182 if (skb_nfct_reasm(skb))
183 iphdr->protocol = ipv6_find_hdr(skb_nfct_reasm(skb),
184 &iphdr->thoff_reasm,
185 -1, NULL, NULL);
186
187 } else 157 } else
188#endif 158#endif
189 { 159 {
@@ -236,7 +206,7 @@ static inline int ip_vs_addr_equal(int af, const union nf_inet_addr *a,
236#ifdef CONFIG_IP_VS_DEBUG 206#ifdef CONFIG_IP_VS_DEBUG
237#include <linux/net.h> 207#include <linux/net.h>
238 208
239extern int ip_vs_get_debug_level(void); 209int ip_vs_get_debug_level(void);
240 210
241static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, 211static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
242 const union nf_inet_addr *addr, 212 const union nf_inet_addr *addr,
@@ -532,9 +502,9 @@ struct ip_vs_proto_data {
532 struct tcp_states_t *tcp_state_table; 502 struct tcp_states_t *tcp_state_table;
533}; 503};
534 504
535extern struct ip_vs_protocol *ip_vs_proto_get(unsigned short proto); 505struct ip_vs_protocol *ip_vs_proto_get(unsigned short proto);
536extern struct ip_vs_proto_data *ip_vs_proto_data_get(struct net *net, 506struct ip_vs_proto_data *ip_vs_proto_data_get(struct net *net,
537 unsigned short proto); 507 unsigned short proto);
538 508
539struct ip_vs_conn_param { 509struct ip_vs_conn_param {
540 struct net *net; 510 struct net *net;
@@ -723,8 +693,6 @@ struct ip_vs_dest_dst {
723 struct rcu_head rcu_head; 693 struct rcu_head rcu_head;
724}; 694};
725 695
726/* In grace period after removing */
727#define IP_VS_DEST_STATE_REMOVING 0x01
728/* 696/*
729 * The real server destination forwarding entry 697 * The real server destination forwarding entry
730 * with ip address, port number, and so on. 698 * with ip address, port number, and so on.
@@ -742,7 +710,7 @@ struct ip_vs_dest {
742 710
743 atomic_t refcnt; /* reference counter */ 711 atomic_t refcnt; /* reference counter */
744 struct ip_vs_stats stats; /* statistics */ 712 struct ip_vs_stats stats; /* statistics */
745 unsigned long state; /* state flags */ 713 unsigned long idle_start; /* start time, jiffies */
746 714
747 /* connection counters and thresholds */ 715 /* connection counters and thresholds */
748 atomic_t activeconns; /* active connections */ 716 atomic_t activeconns; /* active connections */
@@ -756,14 +724,13 @@ struct ip_vs_dest {
756 struct ip_vs_dest_dst __rcu *dest_dst; /* cached dst info */ 724 struct ip_vs_dest_dst __rcu *dest_dst; /* cached dst info */
757 725
758 /* for virtual service */ 726 /* for virtual service */
759 struct ip_vs_service *svc; /* service it belongs to */ 727 struct ip_vs_service __rcu *svc; /* service it belongs to */
760 __u16 protocol; /* which protocol (TCP/UDP) */ 728 __u16 protocol; /* which protocol (TCP/UDP) */
761 __be16 vport; /* virtual port number */ 729 __be16 vport; /* virtual port number */
762 union nf_inet_addr vaddr; /* virtual IP address */ 730 union nf_inet_addr vaddr; /* virtual IP address */
763 __u32 vfwmark; /* firewall mark of service */ 731 __u32 vfwmark; /* firewall mark of service */
764 732
765 struct list_head t_list; /* in dest_trash */ 733 struct list_head t_list; /* in dest_trash */
766 struct rcu_head rcu_head;
767 unsigned int in_rs_table:1; /* we are in rs_table */ 734 unsigned int in_rs_table:1; /* we are in rs_table */
768}; 735};
769 736
@@ -1176,8 +1143,8 @@ static inline int sysctl_backup_only(struct netns_ipvs *ipvs)
1176 * IPVS core functions 1143 * IPVS core functions
1177 * (from ip_vs_core.c) 1144 * (from ip_vs_core.c)
1178 */ 1145 */
1179extern const char *ip_vs_proto_name(unsigned int proto); 1146const char *ip_vs_proto_name(unsigned int proto);
1180extern void ip_vs_init_hash_table(struct list_head *table, int rows); 1147void ip_vs_init_hash_table(struct list_head *table, int rows);
1181#define IP_VS_INIT_HASH_TABLE(t) ip_vs_init_hash_table((t), ARRAY_SIZE((t))) 1148#define IP_VS_INIT_HASH_TABLE(t) ip_vs_init_hash_table((t), ARRAY_SIZE((t)))
1182 1149
1183#define IP_VS_APP_TYPE_FTP 1 1150#define IP_VS_APP_TYPE_FTP 1
@@ -1240,22 +1207,22 @@ static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
1240 smp_mb__before_atomic_dec(); 1207 smp_mb__before_atomic_dec();
1241 atomic_dec(&cp->refcnt); 1208 atomic_dec(&cp->refcnt);
1242} 1209}
1243extern void ip_vs_conn_put(struct ip_vs_conn *cp); 1210void ip_vs_conn_put(struct ip_vs_conn *cp);
1244extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport); 1211void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport);
1245 1212
1246struct ip_vs_conn *ip_vs_conn_new(const struct ip_vs_conn_param *p, 1213struct ip_vs_conn *ip_vs_conn_new(const struct ip_vs_conn_param *p,
1247 const union nf_inet_addr *daddr, 1214 const union nf_inet_addr *daddr,
1248 __be16 dport, unsigned int flags, 1215 __be16 dport, unsigned int flags,
1249 struct ip_vs_dest *dest, __u32 fwmark); 1216 struct ip_vs_dest *dest, __u32 fwmark);
1250extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); 1217void ip_vs_conn_expire_now(struct ip_vs_conn *cp);
1251 1218
1252extern const char * ip_vs_state_name(__u16 proto, int state); 1219const char *ip_vs_state_name(__u16 proto, int state);
1253 1220
1254extern void ip_vs_tcp_conn_listen(struct net *net, struct ip_vs_conn *cp); 1221void ip_vs_tcp_conn_listen(struct net *net, struct ip_vs_conn *cp);
1255extern int ip_vs_check_template(struct ip_vs_conn *ct); 1222int ip_vs_check_template(struct ip_vs_conn *ct);
1256extern void ip_vs_random_dropentry(struct net *net); 1223void ip_vs_random_dropentry(struct net *net);
1257extern int ip_vs_conn_init(void); 1224int ip_vs_conn_init(void);
1258extern void ip_vs_conn_cleanup(void); 1225void ip_vs_conn_cleanup(void);
1259 1226
1260static inline void ip_vs_control_del(struct ip_vs_conn *cp) 1227static inline void ip_vs_control_del(struct ip_vs_conn *cp)
1261{ 1228{
@@ -1320,37 +1287,36 @@ ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp)
1320/* 1287/*
1321 * IPVS netns init & cleanup functions 1288 * IPVS netns init & cleanup functions
1322 */ 1289 */
1323extern int ip_vs_estimator_net_init(struct net *net); 1290int ip_vs_estimator_net_init(struct net *net);
1324extern int ip_vs_control_net_init(struct net *net); 1291int ip_vs_control_net_init(struct net *net);
1325extern int ip_vs_protocol_net_init(struct net *net); 1292int ip_vs_protocol_net_init(struct net *net);
1326extern int ip_vs_app_net_init(struct net *net); 1293int ip_vs_app_net_init(struct net *net);
1327extern int ip_vs_conn_net_init(struct net *net); 1294int ip_vs_conn_net_init(struct net *net);
1328extern int ip_vs_sync_net_init(struct net *net); 1295int ip_vs_sync_net_init(struct net *net);
1329extern void ip_vs_conn_net_cleanup(struct net *net); 1296void ip_vs_conn_net_cleanup(struct net *net);
1330extern void ip_vs_app_net_cleanup(struct net *net); 1297void ip_vs_app_net_cleanup(struct net *net);
1331extern void ip_vs_protocol_net_cleanup(struct net *net); 1298void ip_vs_protocol_net_cleanup(struct net *net);
1332extern void ip_vs_control_net_cleanup(struct net *net); 1299void ip_vs_control_net_cleanup(struct net *net);
1333extern void ip_vs_estimator_net_cleanup(struct net *net); 1300void ip_vs_estimator_net_cleanup(struct net *net);
1334extern void ip_vs_sync_net_cleanup(struct net *net); 1301void ip_vs_sync_net_cleanup(struct net *net);
1335extern void ip_vs_service_net_cleanup(struct net *net); 1302void ip_vs_service_net_cleanup(struct net *net);
1336 1303
1337/* 1304/*
1338 * IPVS application functions 1305 * IPVS application functions
1339 * (from ip_vs_app.c) 1306 * (from ip_vs_app.c)
1340 */ 1307 */
1341#define IP_VS_APP_MAX_PORTS 8 1308#define IP_VS_APP_MAX_PORTS 8
1342extern struct ip_vs_app *register_ip_vs_app(struct net *net, 1309struct ip_vs_app *register_ip_vs_app(struct net *net, struct ip_vs_app *app);
1343 struct ip_vs_app *app); 1310void unregister_ip_vs_app(struct net *net, struct ip_vs_app *app);
1344extern void unregister_ip_vs_app(struct net *net, struct ip_vs_app *app); 1311int ip_vs_bind_app(struct ip_vs_conn *cp, struct ip_vs_protocol *pp);
1345extern int ip_vs_bind_app(struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1312void ip_vs_unbind_app(struct ip_vs_conn *cp);
1346extern void ip_vs_unbind_app(struct ip_vs_conn *cp); 1313int register_ip_vs_app_inc(struct net *net, struct ip_vs_app *app, __u16 proto,
1347extern int register_ip_vs_app_inc(struct net *net, struct ip_vs_app *app, 1314 __u16 port);
1348 __u16 proto, __u16 port); 1315int ip_vs_app_inc_get(struct ip_vs_app *inc);
1349extern int ip_vs_app_inc_get(struct ip_vs_app *inc); 1316void ip_vs_app_inc_put(struct ip_vs_app *inc);
1350extern void ip_vs_app_inc_put(struct ip_vs_app *inc); 1317
1351 1318int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb);
1352extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb); 1319int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb);
1353extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb);
1354 1320
1355int register_ip_vs_pe(struct ip_vs_pe *pe); 1321int register_ip_vs_pe(struct ip_vs_pe *pe);
1356int unregister_ip_vs_pe(struct ip_vs_pe *pe); 1322int unregister_ip_vs_pe(struct ip_vs_pe *pe);
@@ -1371,17 +1337,15 @@ struct ip_vs_pe *__ip_vs_pe_getbyname(const char *pe_name);
1371/* 1337/*
1372 * IPVS protocol functions (from ip_vs_proto.c) 1338 * IPVS protocol functions (from ip_vs_proto.c)
1373 */ 1339 */
1374extern int ip_vs_protocol_init(void); 1340int ip_vs_protocol_init(void);
1375extern void ip_vs_protocol_cleanup(void); 1341void ip_vs_protocol_cleanup(void);
1376extern void ip_vs_protocol_timeout_change(struct netns_ipvs *ipvs, int flags); 1342void ip_vs_protocol_timeout_change(struct netns_ipvs *ipvs, int flags);
1377extern int *ip_vs_create_timeout_table(int *table, int size); 1343int *ip_vs_create_timeout_table(int *table, int size);
1378extern int 1344int ip_vs_set_state_timeout(int *table, int num, const char *const *names,
1379ip_vs_set_state_timeout(int *table, int num, const char *const *names, 1345 const char *name, int to);
1380 const char *name, int to); 1346void ip_vs_tcpudp_debug_packet(int af, struct ip_vs_protocol *pp,
1381extern void 1347 const struct sk_buff *skb, int offset,
1382ip_vs_tcpudp_debug_packet(int af, struct ip_vs_protocol *pp, 1348 const char *msg);
1383 const struct sk_buff *skb,
1384 int offset, const char *msg);
1385 1349
1386extern struct ip_vs_protocol ip_vs_protocol_tcp; 1350extern struct ip_vs_protocol ip_vs_protocol_tcp;
1387extern struct ip_vs_protocol ip_vs_protocol_udp; 1351extern struct ip_vs_protocol ip_vs_protocol_udp;
@@ -1394,22 +1358,22 @@ extern struct ip_vs_protocol ip_vs_protocol_sctp;
1394 * Registering/unregistering scheduler functions 1358 * Registering/unregistering scheduler functions
1395 * (from ip_vs_sched.c) 1359 * (from ip_vs_sched.c)
1396 */ 1360 */
1397extern int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler); 1361int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler);
1398extern int unregister_ip_vs_scheduler(struct ip_vs_scheduler *scheduler); 1362int unregister_ip_vs_scheduler(struct ip_vs_scheduler *scheduler);
1399extern int ip_vs_bind_scheduler(struct ip_vs_service *svc, 1363int ip_vs_bind_scheduler(struct ip_vs_service *svc,
1400 struct ip_vs_scheduler *scheduler); 1364 struct ip_vs_scheduler *scheduler);
1401extern void ip_vs_unbind_scheduler(struct ip_vs_service *svc, 1365void ip_vs_unbind_scheduler(struct ip_vs_service *svc,
1402 struct ip_vs_scheduler *sched); 1366 struct ip_vs_scheduler *sched);
1403extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name); 1367struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name);
1404extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); 1368void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler);
1405extern struct ip_vs_conn * 1369struct ip_vs_conn *
1406ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, 1370ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb,
1407 struct ip_vs_proto_data *pd, int *ignored, 1371 struct ip_vs_proto_data *pd, int *ignored,
1408 struct ip_vs_iphdr *iph); 1372 struct ip_vs_iphdr *iph);
1409extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, 1373int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
1410 struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph); 1374 struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph);
1411 1375
1412extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); 1376void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg);
1413 1377
1414 1378
1415/* 1379/*
@@ -1418,25 +1382,24 @@ extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg);
1418extern struct ip_vs_stats ip_vs_stats; 1382extern struct ip_vs_stats ip_vs_stats;
1419extern int sysctl_ip_vs_sync_ver; 1383extern int sysctl_ip_vs_sync_ver;
1420 1384
1421extern struct ip_vs_service * 1385struct ip_vs_service *
1422ip_vs_service_find(struct net *net, int af, __u32 fwmark, __u16 protocol, 1386ip_vs_service_find(struct net *net, int af, __u32 fwmark, __u16 protocol,
1423 const union nf_inet_addr *vaddr, __be16 vport); 1387 const union nf_inet_addr *vaddr, __be16 vport);
1424 1388
1425extern bool 1389bool ip_vs_has_real_service(struct net *net, int af, __u16 protocol,
1426ip_vs_has_real_service(struct net *net, int af, __u16 protocol, 1390 const union nf_inet_addr *daddr, __be16 dport);
1427 const union nf_inet_addr *daddr, __be16 dport); 1391
1428 1392int ip_vs_use_count_inc(void);
1429extern int ip_vs_use_count_inc(void); 1393void ip_vs_use_count_dec(void);
1430extern void ip_vs_use_count_dec(void); 1394int ip_vs_register_nl_ioctl(void);
1431extern int ip_vs_register_nl_ioctl(void); 1395void ip_vs_unregister_nl_ioctl(void);
1432extern void ip_vs_unregister_nl_ioctl(void); 1396int ip_vs_control_init(void);
1433extern int ip_vs_control_init(void); 1397void ip_vs_control_cleanup(void);
1434extern void ip_vs_control_cleanup(void); 1398struct ip_vs_dest *
1435extern struct ip_vs_dest *
1436ip_vs_find_dest(struct net *net, int af, const union nf_inet_addr *daddr, 1399ip_vs_find_dest(struct net *net, int af, const union nf_inet_addr *daddr,
1437 __be16 dport, const union nf_inet_addr *vaddr, __be16 vport, 1400 __be16 dport, const union nf_inet_addr *vaddr, __be16 vport,
1438 __u16 protocol, __u32 fwmark, __u32 flags); 1401 __u16 protocol, __u32 fwmark, __u32 flags);
1439extern void ip_vs_try_bind_dest(struct ip_vs_conn *cp); 1402void ip_vs_try_bind_dest(struct ip_vs_conn *cp);
1440 1403
1441static inline void ip_vs_dest_hold(struct ip_vs_dest *dest) 1404static inline void ip_vs_dest_hold(struct ip_vs_dest *dest)
1442{ 1405{
@@ -1449,60 +1412,59 @@ static inline void ip_vs_dest_put(struct ip_vs_dest *dest)
1449 atomic_dec(&dest->refcnt); 1412 atomic_dec(&dest->refcnt);
1450} 1413}
1451 1414
1415static inline void ip_vs_dest_put_and_free(struct ip_vs_dest *dest)
1416{
1417 if (atomic_dec_return(&dest->refcnt) < 0)
1418 kfree(dest);
1419}
1420
1452/* 1421/*
1453 * IPVS sync daemon data and function prototypes 1422 * IPVS sync daemon data and function prototypes
1454 * (from ip_vs_sync.c) 1423 * (from ip_vs_sync.c)
1455 */ 1424 */
1456extern int start_sync_thread(struct net *net, int state, char *mcast_ifn, 1425int start_sync_thread(struct net *net, int state, char *mcast_ifn, __u8 syncid);
1457 __u8 syncid); 1426int stop_sync_thread(struct net *net, int state);
1458extern int stop_sync_thread(struct net *net, int state); 1427void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp, int pkts);
1459extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp, int pkts);
1460
1461 1428
1462/* 1429/*
1463 * IPVS rate estimator prototypes (from ip_vs_est.c) 1430 * IPVS rate estimator prototypes (from ip_vs_est.c)
1464 */ 1431 */
1465extern void ip_vs_start_estimator(struct net *net, struct ip_vs_stats *stats); 1432void ip_vs_start_estimator(struct net *net, struct ip_vs_stats *stats);
1466extern void ip_vs_stop_estimator(struct net *net, struct ip_vs_stats *stats); 1433void ip_vs_stop_estimator(struct net *net, struct ip_vs_stats *stats);
1467extern void ip_vs_zero_estimator(struct ip_vs_stats *stats); 1434void ip_vs_zero_estimator(struct ip_vs_stats *stats);
1468extern void ip_vs_read_estimator(struct ip_vs_stats_user *dst, 1435void ip_vs_read_estimator(struct ip_vs_stats_user *dst,
1469 struct ip_vs_stats *stats); 1436 struct ip_vs_stats *stats);
1470 1437
1471/* 1438/*
1472 * Various IPVS packet transmitters (from ip_vs_xmit.c) 1439 * Various IPVS packet transmitters (from ip_vs_xmit.c)
1473 */ 1440 */
1474extern int ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, 1441int ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1475 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); 1442 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1476extern int ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, 1443int ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1477 struct ip_vs_protocol *pp, 1444 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1478 struct ip_vs_iphdr *iph); 1445int ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1479extern int ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, 1446 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1480 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); 1447int ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1481extern int ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, 1448 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1482 struct ip_vs_protocol *pp, 1449int ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1483 struct ip_vs_iphdr *iph); 1450 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1484extern int ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, 1451int ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1485 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); 1452 struct ip_vs_protocol *pp, int offset,
1486extern int ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, 1453 unsigned int hooknum, struct ip_vs_iphdr *iph);
1487 struct ip_vs_protocol *pp, int offset, 1454void ip_vs_dest_dst_rcu_free(struct rcu_head *head);
1488 unsigned int hooknum, struct ip_vs_iphdr *iph);
1489extern void ip_vs_dest_dst_rcu_free(struct rcu_head *head);
1490 1455
1491#ifdef CONFIG_IP_VS_IPV6 1456#ifdef CONFIG_IP_VS_IPV6
1492extern int ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, 1457int ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1493 struct ip_vs_protocol *pp, 1458 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1494 struct ip_vs_iphdr *iph); 1459int ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1495extern int ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, 1460 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1496 struct ip_vs_protocol *pp, 1461int ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1497 struct ip_vs_iphdr *iph); 1462 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1498extern int ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, 1463int ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1499 struct ip_vs_protocol *pp, 1464 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1500 struct ip_vs_iphdr *iph); 1465int ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1501extern int ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, 1466 struct ip_vs_protocol *pp, int offset,
1502 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); 1467 unsigned int hooknum, struct ip_vs_iphdr *iph);
1503extern int ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1504 struct ip_vs_protocol *pp, int offset,
1505 unsigned int hooknum, struct ip_vs_iphdr *iph);
1506#endif 1468#endif
1507 1469
1508#ifdef CONFIG_SYSCTL 1470#ifdef CONFIG_SYSCTL
@@ -1551,15 +1513,15 @@ static inline char ip_vs_fwd_tag(struct ip_vs_conn *cp)
1551 return fwd; 1513 return fwd;
1552} 1514}
1553 1515
1554extern void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp, 1516void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp,
1555 struct ip_vs_conn *cp, int dir); 1517 struct ip_vs_conn *cp, int dir);
1556 1518
1557#ifdef CONFIG_IP_VS_IPV6 1519#ifdef CONFIG_IP_VS_IPV6
1558extern void ip_vs_nat_icmp_v6(struct sk_buff *skb, struct ip_vs_protocol *pp, 1520void ip_vs_nat_icmp_v6(struct sk_buff *skb, struct ip_vs_protocol *pp,
1559 struct ip_vs_conn *cp, int dir); 1521 struct ip_vs_conn *cp, int dir);
1560#endif 1522#endif
1561 1523
1562extern __sum16 ip_vs_checksum_complete(struct sk_buff *skb, int offset); 1524__sum16 ip_vs_checksum_complete(struct sk_buff *skb, int offset);
1563 1525
1564static inline __wsum ip_vs_check_diff4(__be32 old, __be32 new, __wsum oldsum) 1526static inline __wsum ip_vs_check_diff4(__be32 old, __be32 new, __wsum oldsum)
1565{ 1527{
@@ -1618,13 +1580,13 @@ static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs)
1618#endif 1580#endif
1619} 1581}
1620 1582
1621extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, 1583void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp,
1622 int outin); 1584 int outin);
1623extern int ip_vs_confirm_conntrack(struct sk_buff *skb); 1585int ip_vs_confirm_conntrack(struct sk_buff *skb);
1624extern void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct, 1586void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct,
1625 struct ip_vs_conn *cp, u_int8_t proto, 1587 struct ip_vs_conn *cp, u_int8_t proto,
1626 const __be16 port, int from_rs); 1588 const __be16 port, int from_rs);
1627extern void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp); 1589void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp);
1628 1590
1629#else 1591#else
1630 1592
@@ -1649,7 +1611,7 @@ static inline void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp)
1649/* CONFIG_IP_VS_NFCT */ 1611/* CONFIG_IP_VS_NFCT */
1650#endif 1612#endif
1651 1613
1652static inline unsigned int 1614static inline int
1653ip_vs_dest_conn_overhead(struct ip_vs_dest *dest) 1615ip_vs_dest_conn_overhead(struct ip_vs_dest *dest)
1654{ 1616{
1655 /* 1617 /*