aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h35
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)
295static inline int tcp_synq_no_recent_overflow(const struct sock *sk) 301static 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
301extern struct proto tcp_prot; 307extern struct proto tcp_prot;
@@ -425,17 +431,34 @@ extern int tcp_disconnect(struct sock *sk, int flags);
425extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS]; 431extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];
426extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, 432extern 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
428extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, 435extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb,
429 __u16 *mss); 436 __u16 *mss);
437#else
438static 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
431extern __u32 cookie_init_timestamp(struct request_sock *req); 446extern __u32 cookie_init_timestamp(struct request_sock *req);
432extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *); 447extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *);
433 448
434/* From net/ipv6/syncookies.c */ 449/* From net/ipv6/syncookies.c */
435extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); 450extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
451#ifdef CONFIG_SYN_COOKIES
436extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb, 452extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb,
437 __u16 *mss); 453 __u16 *mss);
438 454#else
455static 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
441extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, 464extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
@@ -454,6 +477,9 @@ extern int tcp_write_wakeup(struct sock *);
454extern void tcp_send_fin(struct sock *sk); 477extern void tcp_send_fin(struct sock *sk);
455extern void tcp_send_active_reset(struct sock *sk, gfp_t priority); 478extern void tcp_send_active_reset(struct sock *sk, gfp_t priority);
456extern int tcp_send_synack(struct sock *); 479extern int tcp_send_synack(struct sock *);
480extern int tcp_syn_flood_action(struct sock *sk,
481 const struct sk_buff *skb,
482 const char *proto);
457extern void tcp_push_one(struct sock *, unsigned int mss_now); 483extern void tcp_push_one(struct sock *, unsigned int mss_now);
458extern void tcp_send_ack(struct sock *sk); 484extern void tcp_send_ack(struct sock *sk);
459extern void tcp_send_delayed_ack(struct sock *sk); 485extern void tcp_send_delayed_ack(struct sock *sk);
@@ -508,6 +534,7 @@ extern void tcp_initialize_rcv_mss(struct sock *sk);
508extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); 534extern int tcp_mtu_to_mss(struct sock *sk, int pmtu);
509extern int tcp_mss_to_mtu(struct sock *sk, int mss); 535extern int tcp_mss_to_mtu(struct sock *sk, int mss);
510extern void tcp_mtup_init(struct sock *sk); 536extern void tcp_mtup_init(struct sock *sk);
537extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt);
511 538
512static inline void tcp_bound_rto(const struct sock *sk) 539static 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,
1404extern int tcp_gro_complete(struct sk_buff *skb); 1431extern int tcp_gro_complete(struct sk_buff *skb);
1405extern int tcp4_gro_complete(struct sk_buff *skb); 1432extern int tcp4_gro_complete(struct sk_buff *skb);
1406 1433
1434extern int tcp_nuke_addr(struct net *net, struct sockaddr *addr);
1435
1407#ifdef CONFIG_PROC_FS 1436#ifdef CONFIG_PROC_FS
1408extern int tcp4_proc_init(void); 1437extern int tcp4_proc_init(void);
1409extern void tcp4_proc_exit(void); 1438extern void tcp4_proc_exit(void);