diff options
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index e79aa48d9fc1..e19124b84cd2 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -170,6 +170,11 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
170 | #define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ | 170 | #define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ |
171 | #define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */ | 171 | #define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */ |
172 | #define TCPOPT_COOKIE 253 /* Cookie extension (experimental) */ | 172 | #define TCPOPT_COOKIE 253 /* Cookie extension (experimental) */ |
173 | #define TCPOPT_EXP 254 /* Experimental */ | ||
174 | /* Magic number to be after the option value for sharing TCP | ||
175 | * experimental options. See draft-ietf-tcpm-experimental-options-00.txt | ||
176 | */ | ||
177 | #define TCPOPT_FASTOPEN_MAGIC 0xF989 | ||
173 | 178 | ||
174 | /* | 179 | /* |
175 | * TCP option lengths | 180 | * TCP option lengths |
@@ -180,6 +185,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
180 | #define TCPOLEN_SACK_PERM 2 | 185 | #define TCPOLEN_SACK_PERM 2 |
181 | #define TCPOLEN_TIMESTAMP 10 | 186 | #define TCPOLEN_TIMESTAMP 10 |
182 | #define TCPOLEN_MD5SIG 18 | 187 | #define TCPOLEN_MD5SIG 18 |
188 | #define TCPOLEN_EXP_FASTOPEN_BASE 4 | ||
183 | #define TCPOLEN_COOKIE_BASE 2 /* Cookie-less header extension */ | 189 | #define TCPOLEN_COOKIE_BASE 2 /* Cookie-less header extension */ |
184 | #define TCPOLEN_COOKIE_PAIR 3 /* Cookie pair header extension */ | 190 | #define TCPOLEN_COOKIE_PAIR 3 /* Cookie pair header extension */ |
185 | #define TCPOLEN_COOKIE_MIN (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MIN) | 191 | #define TCPOLEN_COOKIE_MIN (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MIN) |
@@ -206,6 +212,10 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
206 | /* TCP initial congestion window as per draft-hkchu-tcpm-initcwnd-01 */ | 212 | /* TCP initial congestion window as per draft-hkchu-tcpm-initcwnd-01 */ |
207 | #define TCP_INIT_CWND 10 | 213 | #define TCP_INIT_CWND 10 |
208 | 214 | ||
215 | /* Bit Flags for sysctl_tcp_fastopen */ | ||
216 | #define TFO_CLIENT_ENABLE 1 | ||
217 | #define TFO_CLIENT_NO_COOKIE 4 /* Data in SYN w/o cookie option */ | ||
218 | |||
209 | extern struct inet_timewait_death_row tcp_death_row; | 219 | extern struct inet_timewait_death_row tcp_death_row; |
210 | 220 | ||
211 | /* sysctl variables for tcp */ | 221 | /* sysctl variables for tcp */ |
@@ -222,6 +232,7 @@ extern int sysctl_tcp_retries1; | |||
222 | extern int sysctl_tcp_retries2; | 232 | extern int sysctl_tcp_retries2; |
223 | extern int sysctl_tcp_orphan_retries; | 233 | extern int sysctl_tcp_orphan_retries; |
224 | extern int sysctl_tcp_syncookies; | 234 | extern int sysctl_tcp_syncookies; |
235 | extern int sysctl_tcp_fastopen; | ||
225 | extern int sysctl_tcp_retrans_collapse; | 236 | extern int sysctl_tcp_retrans_collapse; |
226 | extern int sysctl_tcp_stdurg; | 237 | extern int sysctl_tcp_stdurg; |
227 | extern int sysctl_tcp_rfc1337; | 238 | extern int sysctl_tcp_rfc1337; |
@@ -253,6 +264,8 @@ extern int sysctl_tcp_cookie_size; | |||
253 | extern int sysctl_tcp_thin_linear_timeouts; | 264 | extern int sysctl_tcp_thin_linear_timeouts; |
254 | extern int sysctl_tcp_thin_dupack; | 265 | extern int sysctl_tcp_thin_dupack; |
255 | extern int sysctl_tcp_early_retrans; | 266 | extern int sysctl_tcp_early_retrans; |
267 | extern int sysctl_tcp_limit_output_bytes; | ||
268 | extern int sysctl_tcp_challenge_ack_limit; | ||
256 | 269 | ||
257 | extern atomic_long_t tcp_memory_allocated; | 270 | extern atomic_long_t tcp_memory_allocated; |
258 | extern struct percpu_counter tcp_sockets_allocated; | 271 | extern struct percpu_counter tcp_sockets_allocated; |
@@ -321,19 +334,24 @@ extern struct proto tcp_prot; | |||
321 | 334 | ||
322 | extern void tcp_init_mem(struct net *net); | 335 | extern void tcp_init_mem(struct net *net); |
323 | 336 | ||
337 | extern void tcp_tasklet_init(void); | ||
338 | |||
324 | extern void tcp_v4_err(struct sk_buff *skb, u32); | 339 | extern void tcp_v4_err(struct sk_buff *skb, u32); |
325 | 340 | ||
326 | extern void tcp_shutdown (struct sock *sk, int how); | 341 | extern void tcp_shutdown (struct sock *sk, int how); |
327 | 342 | ||
343 | extern void tcp_v4_early_demux(struct sk_buff *skb); | ||
328 | extern int tcp_v4_rcv(struct sk_buff *skb); | 344 | extern int tcp_v4_rcv(struct sk_buff *skb); |
329 | 345 | ||
330 | extern struct inet_peer *tcp_v4_get_peer(struct sock *sk, bool *release_it); | 346 | extern struct inet_peer *tcp_v4_get_peer(struct sock *sk); |
331 | extern void *tcp_v4_tw_get_peer(struct sock *sk); | ||
332 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); | 347 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); |
333 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 348 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
334 | size_t size); | 349 | size_t size); |
335 | extern int tcp_sendpage(struct sock *sk, struct page *page, int offset, | 350 | extern int tcp_sendpage(struct sock *sk, struct page *page, int offset, |
336 | size_t size, int flags); | 351 | size_t size, int flags); |
352 | extern void tcp_release_cb(struct sock *sk); | ||
353 | extern void tcp_write_timer_handler(struct sock *sk); | ||
354 | extern void tcp_delack_timer_handler(struct sock *sk); | ||
337 | extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); | 355 | extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); |
338 | extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | 356 | extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, |
339 | const struct tcphdr *th, unsigned int len); | 357 | const struct tcphdr *th, unsigned int len); |
@@ -388,6 +406,19 @@ extern void tcp_enter_frto(struct sock *sk); | |||
388 | extern void tcp_enter_loss(struct sock *sk, int how); | 406 | extern void tcp_enter_loss(struct sock *sk, int how); |
389 | extern void tcp_clear_retrans(struct tcp_sock *tp); | 407 | extern void tcp_clear_retrans(struct tcp_sock *tp); |
390 | extern void tcp_update_metrics(struct sock *sk); | 408 | extern void tcp_update_metrics(struct sock *sk); |
409 | extern void tcp_init_metrics(struct sock *sk); | ||
410 | extern void tcp_metrics_init(void); | ||
411 | extern bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst, bool paws_check); | ||
412 | extern bool tcp_remember_stamp(struct sock *sk); | ||
413 | extern bool tcp_tw_remember_stamp(struct inet_timewait_sock *tw); | ||
414 | extern void tcp_fastopen_cache_get(struct sock *sk, u16 *mss, | ||
415 | struct tcp_fastopen_cookie *cookie, | ||
416 | int *syn_loss, unsigned long *last_syn_loss); | ||
417 | extern void tcp_fastopen_cache_set(struct sock *sk, u16 mss, | ||
418 | struct tcp_fastopen_cookie *cookie, | ||
419 | bool syn_lost); | ||
420 | extern void tcp_fetch_timewait_stamp(struct sock *sk, struct dst_entry *dst); | ||
421 | extern void tcp_disable_fack(struct tcp_sock *tp); | ||
391 | extern void tcp_close(struct sock *sk, long timeout); | 422 | extern void tcp_close(struct sock *sk, long timeout); |
392 | extern void tcp_init_sock(struct sock *sk); | 423 | extern void tcp_init_sock(struct sock *sk); |
393 | extern unsigned int tcp_poll(struct file * file, struct socket *sock, | 424 | extern unsigned int tcp_poll(struct file * file, struct socket *sock, |
@@ -406,7 +437,7 @@ extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
406 | size_t len, int nonblock, int flags, int *addr_len); | 437 | size_t len, int nonblock, int flags, int *addr_len); |
407 | extern void tcp_parse_options(const struct sk_buff *skb, | 438 | extern void tcp_parse_options(const struct sk_buff *skb, |
408 | struct tcp_options_received *opt_rx, const u8 **hvpp, | 439 | struct tcp_options_received *opt_rx, const u8 **hvpp, |
409 | int estab); | 440 | int estab, struct tcp_fastopen_cookie *foc); |
410 | extern const u8 *tcp_parse_md5sig_option(const struct tcphdr *th); | 441 | extern const u8 *tcp_parse_md5sig_option(const struct tcphdr *th); |
411 | 442 | ||
412 | /* | 443 | /* |
@@ -556,6 +587,8 @@ static inline u32 __tcp_set_rto(const struct tcp_sock *tp) | |||
556 | return (tp->srtt >> 3) + tp->rttvar; | 587 | return (tp->srtt >> 3) + tp->rttvar; |
557 | } | 588 | } |
558 | 589 | ||
590 | extern void tcp_set_rto(struct sock *sk); | ||
591 | |||
559 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) | 592 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) |
560 | { | 593 | { |
561 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | | 594 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | |
@@ -1264,6 +1297,15 @@ extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff | |||
1264 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, | 1297 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, |
1265 | const struct tcp_md5sig_key *key); | 1298 | const struct tcp_md5sig_key *key); |
1266 | 1299 | ||
1300 | struct tcp_fastopen_request { | ||
1301 | /* Fast Open cookie. Size 0 means a cookie request */ | ||
1302 | struct tcp_fastopen_cookie cookie; | ||
1303 | struct msghdr *data; /* data in MSG_FASTOPEN */ | ||
1304 | u16 copied; /* queued in tcp_connect() */ | ||
1305 | }; | ||
1306 | |||
1307 | void tcp_free_fastopen_req(struct tcp_sock *tp); | ||
1308 | |||
1267 | /* write queue abstraction */ | 1309 | /* write queue abstraction */ |
1268 | static inline void tcp_write_queue_purge(struct sock *sk) | 1310 | static inline void tcp_write_queue_purge(struct sock *sk) |
1269 | { | 1311 | { |