diff options
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index cda30ea354a..4fcd77af405 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -122,7 +122,13 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
122 | #endif | 122 | #endif |
123 | #define TCP_RTO_MAX ((unsigned)(120*HZ)) | 123 | #define TCP_RTO_MAX ((unsigned)(120*HZ)) |
124 | #define TCP_RTO_MIN ((unsigned)(HZ/5)) | 124 | #define TCP_RTO_MIN ((unsigned)(HZ/5)) |
125 | #define TCP_TIMEOUT_INIT ((unsigned)(3*HZ)) /* RFC 1122 initial RTO value */ | 125 | #define TCP_TIMEOUT_INIT ((unsigned)(1*HZ)) /* RFC2988bis initial RTO value */ |
126 | #define TCP_TIMEOUT_FALLBACK ((unsigned)(3*HZ)) /* RFC 1122 initial RTO value, now | ||
127 | * used as a fallback RTO for the | ||
128 | * initial data transmission if no | ||
129 | * valid RTT sample has been acquired, | ||
130 | * most likely due to retrans in 3WHS. | ||
131 | */ | ||
126 | 132 | ||
127 | #define TCP_RESOURCE_PROBE_INTERVAL ((unsigned)(HZ/2U)) /* Maximal interval between probes | 133 | #define TCP_RESOURCE_PROBE_INTERVAL ((unsigned)(HZ/2U)) /* Maximal interval between probes |
128 | * for local resources. | 134 | * for local resources. |
@@ -295,7 +301,7 @@ static inline void tcp_synq_overflow(struct sock *sk) | |||
295 | static inline int tcp_synq_no_recent_overflow(const struct sock *sk) | 301 | static inline int tcp_synq_no_recent_overflow(const struct sock *sk) |
296 | { | 302 | { |
297 | unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp; | 303 | unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp; |
298 | return time_after(jiffies, last_overflow + TCP_TIMEOUT_INIT); | 304 | return time_after(jiffies, last_overflow + TCP_TIMEOUT_FALLBACK); |
299 | } | 305 | } |
300 | 306 | ||
301 | extern struct proto tcp_prot; | 307 | extern struct proto tcp_prot; |
@@ -425,17 +431,34 @@ extern int tcp_disconnect(struct sock *sk, int flags); | |||
425 | extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS]; | 431 | extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS]; |
426 | extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, | 432 | extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, |
427 | struct ip_options *opt); | 433 | struct ip_options *opt); |
434 | #ifdef CONFIG_SYN_COOKIES | ||
428 | extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, | 435 | extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, |
429 | __u16 *mss); | 436 | __u16 *mss); |
437 | #else | ||
438 | static inline __u32 cookie_v4_init_sequence(struct sock *sk, | ||
439 | struct sk_buff *skb, | ||
440 | __u16 *mss) | ||
441 | { | ||
442 | return 0; | ||
443 | } | ||
444 | #endif | ||
430 | 445 | ||
431 | extern __u32 cookie_init_timestamp(struct request_sock *req); | 446 | extern __u32 cookie_init_timestamp(struct request_sock *req); |
432 | extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *); | 447 | extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *); |
433 | 448 | ||
434 | /* From net/ipv6/syncookies.c */ | 449 | /* From net/ipv6/syncookies.c */ |
435 | extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); | 450 | extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); |
451 | #ifdef CONFIG_SYN_COOKIES | ||
436 | extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb, | 452 | extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb, |
437 | __u16 *mss); | 453 | __u16 *mss); |
438 | 454 | #else | |
455 | static inline __u32 cookie_v6_init_sequence(struct sock *sk, | ||
456 | struct sk_buff *skb, | ||
457 | __u16 *mss) | ||
458 | { | ||
459 | return 0; | ||
460 | } | ||
461 | #endif | ||
439 | /* tcp_output.c */ | 462 | /* tcp_output.c */ |
440 | 463 | ||
441 | extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, | 464 | extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, |
@@ -454,6 +477,9 @@ extern int tcp_write_wakeup(struct sock *); | |||
454 | extern void tcp_send_fin(struct sock *sk); | 477 | extern void tcp_send_fin(struct sock *sk); |
455 | extern void tcp_send_active_reset(struct sock *sk, gfp_t priority); | 478 | extern void tcp_send_active_reset(struct sock *sk, gfp_t priority); |
456 | extern int tcp_send_synack(struct sock *); | 479 | extern int tcp_send_synack(struct sock *); |
480 | extern int tcp_syn_flood_action(struct sock *sk, | ||
481 | const struct sk_buff *skb, | ||
482 | const char *proto); | ||
457 | extern void tcp_push_one(struct sock *, unsigned int mss_now); | 483 | extern void tcp_push_one(struct sock *, unsigned int mss_now); |
458 | extern void tcp_send_ack(struct sock *sk); | 484 | extern void tcp_send_ack(struct sock *sk); |
459 | extern void tcp_send_delayed_ack(struct sock *sk); | 485 | extern void tcp_send_delayed_ack(struct sock *sk); |
@@ -508,6 +534,7 @@ extern void tcp_initialize_rcv_mss(struct sock *sk); | |||
508 | extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); | 534 | extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); |
509 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); | 535 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); |
510 | extern void tcp_mtup_init(struct sock *sk); | 536 | extern void tcp_mtup_init(struct sock *sk); |
537 | extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt); | ||
511 | 538 | ||
512 | static inline void tcp_bound_rto(const struct sock *sk) | 539 | static inline void tcp_bound_rto(const struct sock *sk) |
513 | { | 540 | { |
@@ -1404,6 +1431,8 @@ extern struct sk_buff **tcp4_gro_receive(struct sk_buff **head, | |||
1404 | extern int tcp_gro_complete(struct sk_buff *skb); | 1431 | extern int tcp_gro_complete(struct sk_buff *skb); |
1405 | extern int tcp4_gro_complete(struct sk_buff *skb); | 1432 | extern int tcp4_gro_complete(struct sk_buff *skb); |
1406 | 1433 | ||
1434 | extern int tcp_nuke_addr(struct net *net, struct sockaddr *addr); | ||
1435 | |||
1407 | #ifdef CONFIG_PROC_FS | 1436 | #ifdef CONFIG_PROC_FS |
1408 | extern int tcp4_proc_init(void); | 1437 | extern int tcp4_proc_init(void); |
1409 | extern void tcp4_proc_exit(void); | 1438 | extern void tcp4_proc_exit(void); |