2 * ip_vs_proto_tcp.c: TCP load balancing support for IPVS
4 * Authors: Wensong Zhang <wensong@linuxvirtualserver.org>
5 * Julian Anastasov <ja@ssi.bg>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
12 * Changes: Hans Schillstrom <hans.schillstrom@ericsson.com>
14 * Network name space (netns) aware.
15 * Global data moved to netns i.e struct netns_ipvs
16 * tcp_timeouts table has copy per netns in a hash table per
17 * protocol ip_vs_proto_data and is handled by netns
20 #define KMSG_COMPONENT "IPVS"
21 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
23 #include <linux/kernel.h>
25 #include <linux/tcp.h> /* for tcphdr */
27 #include <net/tcp.h> /* for csum_tcpudp_magic */
28 #include <net/ip6_checksum.h>
29 #include <linux/netfilter.h>
30 #include <linux/netfilter_ipv4.h>
32 #include <net/ip_vs.h>
35 tcp_conn_schedule(int af, struct sk_buff *skb, struct ip_vs_proto_data *pd,
36 int *verdict, struct ip_vs_conn **cpp)
39 struct ip_vs_service *svc;
40 struct tcphdr _tcph, *th;
41 struct ip_vs_iphdr iph;
43 ip_vs_fill_iph_skb(af, skb, &iph);
45 th = skb_header_pointer(skb, iph.len, sizeof(_tcph), &_tcph);
51 /* No !th->ack check to allow scheduling on SYN+ACK for Active FTP */
53 (svc = ip_vs_service_get(net, af, skb->mark, iph.protocol,
54 &iph.daddr, th->dest))) {
57 if (ip_vs_todrop(net_ipvs(net))) {
59 * It seems that we are very loaded.
60 * We have to drop this packet :(
62 ip_vs_service_put(svc);
68 * Let the virtual server select a real server for the
69 * incoming connection, and create a connection entry.
71 *cpp = ip_vs_schedule(svc, skb, pd, &ignored);
72 if (!*cpp && ignored <= 0) {
74 *verdict = ip_vs_leave(svc, skb, pd);
76 ip_vs_service_put(svc);
81 ip_vs_service_put(svc);
89 tcp_fast_csum_update(int af, struct tcphdr *tcph,
90 const union nf_inet_addr *oldip,
91 const union nf_inet_addr *newip,
92 __be16 oldport, __be16 newport)
94 #ifdef CONFIG_IP_VS_IPV6
97 csum_fold(ip_vs_check_diff16(oldip->ip6, newip->ip6,
98 ip_vs_check_diff2(oldport, newport,
99 ~csum_unfold(tcph->check))));
103 csum_fold(ip_vs_check_diff4(oldip->ip, newip->ip,
104 ip_vs_check_diff2(oldport, newport,
105 ~csum_unfold(tcph->check))));
110 tcp_partial_csum_update(int af, struct tcphdr *tcph,
111 const union nf_inet_addr *oldip,
112 const union nf_inet_addr *newip,
113 __be16 oldlen, __be16 newlen)
115 #ifdef CONFIG_IP_VS_IPV6
118 ~csum_fold(ip_vs_check_diff16(oldip->ip6, newip->ip6,
119 ip_vs_check_diff2(oldlen, newlen,
120 csum_unfold(tcph->check))));
124 ~csum_fold(ip_vs_check_diff4(oldip->ip, newip->ip,
125 ip_vs_check_diff2(oldlen, newlen,
126 csum_unfold(tcph->check))));
131 tcp_snat_handler(struct sk_buff *skb,
132 struct ip_vs_protocol *pp, struct ip_vs_conn *cp)
135 unsigned int tcphoff;
137 int payload_csum = 0;
139 struct ip_vs_iphdr iph;
140 ip_vs_fill_iph_skb(cp->af, skb, &iph);
143 #ifdef CONFIG_IP_VS_IPV6
144 if (cp->af == AF_INET6 && iph.fragoffs)
147 oldlen = skb->len - tcphoff;
149 /* csum_check requires unshared skb */
150 if (!skb_make_writable(skb, tcphoff+sizeof(*tcph)))
153 if (unlikely(cp->app != NULL)) {
156 /* Some checks before mangling */
157 if (pp->csum_check && !pp->csum_check(cp->af, skb, pp))
160 /* Call application helper if needed */
161 if (!(ret = ip_vs_app_pkt_out(cp, skb)))
163 /* ret=2: csum update is needed after payload mangling */
165 oldlen = skb->len - tcphoff;
170 tcph = (void *)skb_network_header(skb) + tcphoff;
171 tcph->source = cp->vport;
173 /* Adjust TCP checksums */
174 if (skb->ip_summed == CHECKSUM_PARTIAL) {
175 tcp_partial_csum_update(cp->af, tcph, &cp->daddr, &cp->vaddr,
177 htons(skb->len - tcphoff));
178 } else if (!payload_csum) {
179 /* Only port and addr are changed, do fast csum update */
180 tcp_fast_csum_update(cp->af, tcph, &cp->daddr, &cp->vaddr,
181 cp->dport, cp->vport);
182 if (skb->ip_summed == CHECKSUM_COMPLETE)
183 skb->ip_summed = (cp->app && pp->csum_check) ?
184 CHECKSUM_UNNECESSARY : CHECKSUM_NONE;
186 /* full checksum calculation */
188 skb->csum = skb_checksum(skb, tcphoff, skb->len - tcphoff, 0);
189 #ifdef CONFIG_IP_VS_IPV6
190 if (cp->af == AF_INET6)
191 tcph->check = csum_ipv6_magic(&cp->vaddr.in6,
194 cp->protocol, skb->csum);
197 tcph->check = csum_tcpudp_magic(cp->vaddr.ip,
202 skb->ip_summed = CHECKSUM_UNNECESSARY;
204 IP_VS_DBG(11, "O-pkt: %s O-csum=%d (+%zd)\n",
205 pp->name, tcph->check,
206 (char*)&(tcph->check) - (char*)tcph);
213 tcp_dnat_handler(struct sk_buff *skb,
214 struct ip_vs_protocol *pp, struct ip_vs_conn *cp)
217 unsigned int tcphoff;
219 int payload_csum = 0;
221 struct ip_vs_iphdr iph;
222 ip_vs_fill_iph_skb(cp->af, skb, &iph);
225 #ifdef CONFIG_IP_VS_IPV6
226 if (cp->af == AF_INET6 && iph.fragoffs)
229 oldlen = skb->len - tcphoff;
231 /* csum_check requires unshared skb */
232 if (!skb_make_writable(skb, tcphoff+sizeof(*tcph)))
235 if (unlikely(cp->app != NULL)) {
238 /* Some checks before mangling */
239 if (pp->csum_check && !pp->csum_check(cp->af, skb, pp))
243 * Attempt ip_vs_app call.
244 * It will fix ip_vs_conn and iph ack_seq stuff
246 if (!(ret = ip_vs_app_pkt_in(cp, skb)))
248 /* ret=2: csum update is needed after payload mangling */
250 oldlen = skb->len - tcphoff;
255 tcph = (void *)skb_network_header(skb) + tcphoff;
256 tcph->dest = cp->dport;
259 * Adjust TCP checksums
261 if (skb->ip_summed == CHECKSUM_PARTIAL) {
262 tcp_partial_csum_update(cp->af, tcph, &cp->vaddr, &cp->daddr,
264 htons(skb->len - tcphoff));
265 } else if (!payload_csum) {
266 /* Only port and addr are changed, do fast csum update */
267 tcp_fast_csum_update(cp->af, tcph, &cp->vaddr, &cp->daddr,
268 cp->vport, cp->dport);
269 if (skb->ip_summed == CHECKSUM_COMPLETE)
270 skb->ip_summed = (cp->app && pp->csum_check) ?
271 CHECKSUM_UNNECESSARY : CHECKSUM_NONE;
273 /* full checksum calculation */
275 skb->csum = skb_checksum(skb, tcphoff, skb->len - tcphoff, 0);
276 #ifdef CONFIG_IP_VS_IPV6
277 if (cp->af == AF_INET6)
278 tcph->check = csum_ipv6_magic(&cp->caddr.in6,
281 cp->protocol, skb->csum);
284 tcph->check = csum_tcpudp_magic(cp->caddr.ip,
289 skb->ip_summed = CHECKSUM_UNNECESSARY;
296 tcp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
298 unsigned int tcphoff;
300 #ifdef CONFIG_IP_VS_IPV6
302 tcphoff = sizeof(struct ipv6hdr);
305 tcphoff = ip_hdrlen(skb);
307 switch (skb->ip_summed) {
309 skb->csum = skb_checksum(skb, tcphoff, skb->len - tcphoff, 0);
310 case CHECKSUM_COMPLETE:
311 #ifdef CONFIG_IP_VS_IPV6
312 if (af == AF_INET6) {
313 if (csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
314 &ipv6_hdr(skb)->daddr,
316 ipv6_hdr(skb)->nexthdr,
318 IP_VS_DBG_RL_PKT(0, af, pp, skb, 0,
319 "Failed checksum for");
324 if (csum_tcpudp_magic(ip_hdr(skb)->saddr,
327 ip_hdr(skb)->protocol,
329 IP_VS_DBG_RL_PKT(0, af, pp, skb, 0,
330 "Failed checksum for");
335 /* No need to checksum. */
343 #define TCP_DIR_INPUT 0
344 #define TCP_DIR_OUTPUT 4
345 #define TCP_DIR_INPUT_ONLY 8
347 static const int tcp_state_off[IP_VS_DIR_LAST] = {
348 [IP_VS_DIR_INPUT] = TCP_DIR_INPUT,
349 [IP_VS_DIR_OUTPUT] = TCP_DIR_OUTPUT,
350 [IP_VS_DIR_INPUT_ONLY] = TCP_DIR_INPUT_ONLY,
354 * Timeout table[state]
356 static const int tcp_timeouts[IP_VS_TCP_S_LAST+1] = {
357 [IP_VS_TCP_S_NONE] = 2*HZ,
358 [IP_VS_TCP_S_ESTABLISHED] = 15*60*HZ,
359 [IP_VS_TCP_S_SYN_SENT] = 2*60*HZ,
360 [IP_VS_TCP_S_SYN_RECV] = 1*60*HZ,
361 [IP_VS_TCP_S_FIN_WAIT] = 2*60*HZ,
362 [IP_VS_TCP_S_TIME_WAIT] = 2*60*HZ,
363 [IP_VS_TCP_S_CLOSE] = 10*HZ,
364 [IP_VS_TCP_S_CLOSE_WAIT] = 60*HZ,
365 [IP_VS_TCP_S_LAST_ACK] = 30*HZ,
366 [IP_VS_TCP_S_LISTEN] = 2*60*HZ,
367 [IP_VS_TCP_S_SYNACK] = 120*HZ,
368 [IP_VS_TCP_S_LAST] = 2*HZ,
371 static const char *const tcp_state_name_table[IP_VS_TCP_S_LAST+1] = {
372 [IP_VS_TCP_S_NONE] = "NONE",
373 [IP_VS_TCP_S_ESTABLISHED] = "ESTABLISHED",
374 [IP_VS_TCP_S_SYN_SENT] = "SYN_SENT",
375 [IP_VS_TCP_S_SYN_RECV] = "SYN_RECV",
376 [IP_VS_TCP_S_FIN_WAIT] = "FIN_WAIT",
377 [IP_VS_TCP_S_TIME_WAIT] = "TIME_WAIT",
378 [IP_VS_TCP_S_CLOSE] = "CLOSE",
379 [IP_VS_TCP_S_CLOSE_WAIT] = "CLOSE_WAIT",
380 [IP_VS_TCP_S_LAST_ACK] = "LAST_ACK",
381 [IP_VS_TCP_S_LISTEN] = "LISTEN",
382 [IP_VS_TCP_S_SYNACK] = "SYNACK",
383 [IP_VS_TCP_S_LAST] = "BUG!",
386 #define sNO IP_VS_TCP_S_NONE
387 #define sES IP_VS_TCP_S_ESTABLISHED
388 #define sSS IP_VS_TCP_S_SYN_SENT
389 #define sSR IP_VS_TCP_S_SYN_RECV
390 #define sFW IP_VS_TCP_S_FIN_WAIT
391 #define sTW IP_VS_TCP_S_TIME_WAIT
392 #define sCL IP_VS_TCP_S_CLOSE
393 #define sCW IP_VS_TCP_S_CLOSE_WAIT
394 #define sLA IP_VS_TCP_S_LAST_ACK
395 #define sLI IP_VS_TCP_S_LISTEN
396 #define sSA IP_VS_TCP_S_SYNACK
398 struct tcp_states_t {
399 int next_state[IP_VS_TCP_S_LAST];
402 static const char * tcp_state_name(int state)
404 if (state >= IP_VS_TCP_S_LAST)
406 return tcp_state_name_table[state] ? tcp_state_name_table[state] : "?";
409 static struct tcp_states_t tcp_states [] = {
411 /* sNO, sES, sSS, sSR, sFW, sTW, sCL, sCW, sLA, sLI, sSA */
412 /*syn*/ {{sSR, sES, sES, sSR, sSR, sSR, sSR, sSR, sSR, sSR, sSR }},
413 /*fin*/ {{sCL, sCW, sSS, sTW, sTW, sTW, sCL, sCW, sLA, sLI, sTW }},
414 /*ack*/ {{sCL, sES, sSS, sES, sFW, sTW, sCL, sCW, sCL, sLI, sES }},
415 /*rst*/ {{sCL, sCL, sCL, sSR, sCL, sCL, sCL, sCL, sLA, sLI, sSR }},
418 /* sNO, sES, sSS, sSR, sFW, sTW, sCL, sCW, sLA, sLI, sSA */
419 /*syn*/ {{sSS, sES, sSS, sSR, sSS, sSS, sSS, sSS, sSS, sLI, sSR }},
420 /*fin*/ {{sTW, sFW, sSS, sTW, sFW, sTW, sCL, sTW, sLA, sLI, sTW }},
421 /*ack*/ {{sES, sES, sSS, sES, sFW, sTW, sCL, sCW, sLA, sES, sES }},
422 /*rst*/ {{sCL, sCL, sSS, sCL, sCL, sTW, sCL, sCL, sCL, sCL, sCL }},
425 /* sNO, sES, sSS, sSR, sFW, sTW, sCL, sCW, sLA, sLI, sSA */
426 /*syn*/ {{sSR, sES, sES, sSR, sSR, sSR, sSR, sSR, sSR, sSR, sSR }},
427 /*fin*/ {{sCL, sFW, sSS, sTW, sFW, sTW, sCL, sCW, sLA, sLI, sTW }},
428 /*ack*/ {{sCL, sES, sSS, sES, sFW, sTW, sCL, sCW, sCL, sLI, sES }},
429 /*rst*/ {{sCL, sCL, sCL, sSR, sCL, sCL, sCL, sCL, sLA, sLI, sCL }},
432 static struct tcp_states_t tcp_states_dos [] = {
434 /* sNO, sES, sSS, sSR, sFW, sTW, sCL, sCW, sLA, sLI, sSA */
435 /*syn*/ {{sSR, sES, sES, sSR, sSR, sSR, sSR, sSR, sSR, sSR, sSA }},
436 /*fin*/ {{sCL, sCW, sSS, sTW, sTW, sTW, sCL, sCW, sLA, sLI, sSA }},
437 /*ack*/ {{sCL, sES, sSS, sSR, sFW, sTW, sCL, sCW, sCL, sLI, sSA }},
438 /*rst*/ {{sCL, sCL, sCL, sSR, sCL, sCL, sCL, sCL, sLA, sLI, sCL }},
441 /* sNO, sES, sSS, sSR, sFW, sTW, sCL, sCW, sLA, sLI, sSA */
442 /*syn*/ {{sSS, sES, sSS, sSA, sSS, sSS, sSS, sSS, sSS, sLI, sSA }},
443 /*fin*/ {{sTW, sFW, sSS, sTW, sFW, sTW, sCL, sTW, sLA, sLI, sTW }},
444 /*ack*/ {{sES, sES, sSS, sES, sFW, sTW, sCL, sCW, sLA, sES, sES }},
445 /*rst*/ {{sCL, sCL, sSS, sCL, sCL, sTW, sCL, sCL, sCL, sCL, sCL }},
448 /* sNO, sES, sSS, sSR, sFW, sTW, sCL, sCW, sLA, sLI, sSA */
449 /*syn*/ {{sSA, sES, sES, sSR, sSA, sSA, sSA, sSA, sSA, sSA, sSA }},
450 /*fin*/ {{sCL, sFW, sSS, sTW, sFW, sTW, sCL, sCW, sLA, sLI, sTW }},
451 /*ack*/ {{sCL, sES, sSS, sES, sFW, sTW, sCL, sCW, sCL, sLI, sES }},
452 /*rst*/ {{sCL, sCL, sCL, sSR, sCL, sCL, sCL, sCL, sLA, sLI, sCL }},
455 static void tcp_timeout_change(struct ip_vs_proto_data *pd, int flags)
457 int on = (flags & 1); /* secure_tcp */
460 ** FIXME: change secure_tcp to independent sysctl var
461 ** or make it per-service or per-app because it is valid
462 ** for most if not for all of the applications. Something
463 ** like "capabilities" (flags) for each object.
465 pd->tcp_state_table = (on ? tcp_states_dos : tcp_states);
468 static inline int tcp_state_idx(struct tcphdr *th)
482 set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
483 int direction, struct tcphdr *th)
486 int new_state = IP_VS_TCP_S_CLOSE;
487 int state_off = tcp_state_off[direction];
490 * Update state offset to INPUT_ONLY if necessary
491 * or delete NO_OUTPUT flag if output packet detected
493 if (cp->flags & IP_VS_CONN_F_NOOUTPUT) {
494 if (state_off == TCP_DIR_OUTPUT)
495 cp->flags &= ~IP_VS_CONN_F_NOOUTPUT;
497 state_off = TCP_DIR_INPUT_ONLY;
500 if ((state_idx = tcp_state_idx(th)) < 0) {
501 IP_VS_DBG(8, "tcp_state_idx=%d!!!\n", state_idx);
506 pd->tcp_state_table[state_off+state_idx].next_state[cp->state];
509 if (new_state != cp->state) {
510 struct ip_vs_dest *dest = cp->dest;
512 IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] %s:%d->"
513 "%s:%d state: %s->%s conn->refcnt:%d\n",
515 ((state_off == TCP_DIR_OUTPUT) ?
516 "output " : "input "),
521 IP_VS_DBG_ADDR(cp->af, &cp->daddr),
523 IP_VS_DBG_ADDR(cp->af, &cp->caddr),
525 tcp_state_name(cp->state),
526 tcp_state_name(new_state),
527 atomic_read(&cp->refcnt));
530 if (!(cp->flags & IP_VS_CONN_F_INACTIVE) &&
531 (new_state != IP_VS_TCP_S_ESTABLISHED)) {
532 atomic_dec(&dest->activeconns);
533 atomic_inc(&dest->inactconns);
534 cp->flags |= IP_VS_CONN_F_INACTIVE;
535 } else if ((cp->flags & IP_VS_CONN_F_INACTIVE) &&
536 (new_state == IP_VS_TCP_S_ESTABLISHED)) {
537 atomic_inc(&dest->activeconns);
538 atomic_dec(&dest->inactconns);
539 cp->flags &= ~IP_VS_CONN_F_INACTIVE;
545 cp->timeout = pd->timeout_table[cp->state = new_state];
546 else /* What to do ? */
547 cp->timeout = tcp_timeouts[cp->state = new_state];
551 * Handle state transitions
554 tcp_state_transition(struct ip_vs_conn *cp, int direction,
555 const struct sk_buff *skb,
556 struct ip_vs_proto_data *pd)
558 struct tcphdr _tcph, *th;
560 #ifdef CONFIG_IP_VS_IPV6
561 int ihl = cp->af == AF_INET ? ip_hdrlen(skb) : sizeof(struct ipv6hdr);
563 int ihl = ip_hdrlen(skb);
566 th = skb_header_pointer(skb, ihl, sizeof(_tcph), &_tcph);
570 spin_lock(&cp->lock);
571 set_tcp_state(pd, cp, direction, th);
572 spin_unlock(&cp->lock);
575 static inline __u16 tcp_app_hashkey(__be16 port)
577 return (((__force u16)port >> TCP_APP_TAB_BITS) ^ (__force u16)port)
582 static int tcp_register_app(struct net *net, struct ip_vs_app *inc)
586 __be16 port = inc->port;
588 struct netns_ipvs *ipvs = net_ipvs(net);
589 struct ip_vs_proto_data *pd = ip_vs_proto_data_get(net, IPPROTO_TCP);
591 hash = tcp_app_hashkey(port);
593 spin_lock_bh(&ipvs->tcp_app_lock);
594 list_for_each_entry(i, &ipvs->tcp_apps[hash], p_list) {
595 if (i->port == port) {
600 list_add(&inc->p_list, &ipvs->tcp_apps[hash]);
601 atomic_inc(&pd->appcnt);
604 spin_unlock_bh(&ipvs->tcp_app_lock);
610 tcp_unregister_app(struct net *net, struct ip_vs_app *inc)
612 struct netns_ipvs *ipvs = net_ipvs(net);
613 struct ip_vs_proto_data *pd = ip_vs_proto_data_get(net, IPPROTO_TCP);
615 spin_lock_bh(&ipvs->tcp_app_lock);
616 atomic_dec(&pd->appcnt);
617 list_del(&inc->p_list);
618 spin_unlock_bh(&ipvs->tcp_app_lock);
623 tcp_app_conn_bind(struct ip_vs_conn *cp)
625 struct netns_ipvs *ipvs = net_ipvs(ip_vs_conn_net(cp));
627 struct ip_vs_app *inc;
630 /* Default binding: bind app only for NAT */
631 if (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ)
634 /* Lookup application incarnations and bind the right one */
635 hash = tcp_app_hashkey(cp->vport);
637 spin_lock(&ipvs->tcp_app_lock);
638 list_for_each_entry(inc, &ipvs->tcp_apps[hash], p_list) {
639 if (inc->port == cp->vport) {
640 if (unlikely(!ip_vs_app_inc_get(inc)))
642 spin_unlock(&ipvs->tcp_app_lock);
644 IP_VS_DBG_BUF(9, "%s(): Binding conn %s:%u->"
645 "%s:%u to app %s on port %u\n",
647 IP_VS_DBG_ADDR(cp->af, &cp->caddr),
649 IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
651 inc->name, ntohs(inc->port));
655 result = inc->init_conn(inc, cp);
659 spin_unlock(&ipvs->tcp_app_lock);
667 * Set LISTEN timeout. (ip_vs_conn_put will setup timer)
669 void ip_vs_tcp_conn_listen(struct net *net, struct ip_vs_conn *cp)
671 struct ip_vs_proto_data *pd = ip_vs_proto_data_get(net, IPPROTO_TCP);
673 spin_lock(&cp->lock);
674 cp->state = IP_VS_TCP_S_LISTEN;
675 cp->timeout = (pd ? pd->timeout_table[IP_VS_TCP_S_LISTEN]
676 : tcp_timeouts[IP_VS_TCP_S_LISTEN]);
677 spin_unlock(&cp->lock);
680 /* ---------------------------------------------
681 * timeouts is netns related now.
682 * ---------------------------------------------
684 static int __ip_vs_tcp_init(struct net *net, struct ip_vs_proto_data *pd)
686 struct netns_ipvs *ipvs = net_ipvs(net);
688 ip_vs_init_hash_table(ipvs->tcp_apps, TCP_APP_TAB_SIZE);
689 spin_lock_init(&ipvs->tcp_app_lock);
690 pd->timeout_table = ip_vs_create_timeout_table((int *)tcp_timeouts,
691 sizeof(tcp_timeouts));
692 if (!pd->timeout_table)
694 pd->tcp_state_table = tcp_states;
698 static void __ip_vs_tcp_exit(struct net *net, struct ip_vs_proto_data *pd)
700 kfree(pd->timeout_table);
704 struct ip_vs_protocol ip_vs_protocol_tcp = {
706 .protocol = IPPROTO_TCP,
707 .num_states = IP_VS_TCP_S_LAST,
711 .init_netns = __ip_vs_tcp_init,
712 .exit_netns = __ip_vs_tcp_exit,
713 .register_app = tcp_register_app,
714 .unregister_app = tcp_unregister_app,
715 .conn_schedule = tcp_conn_schedule,
716 .conn_in_get = ip_vs_conn_in_get_proto,
717 .conn_out_get = ip_vs_conn_out_get_proto,
718 .snat_handler = tcp_snat_handler,
719 .dnat_handler = tcp_dnat_handler,
720 .csum_check = tcp_csum_check,
721 .state_name = tcp_state_name,
722 .state_transition = tcp_state_transition,
723 .app_conn_bind = tcp_app_conn_bind,
724 .debug_packet = ip_vs_tcpudp_debug_packet,
725 .timeout_change = tcp_timeout_change,