diff options
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 0fca06f16463..9f8821e3293a 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -224,8 +224,24 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
224 | 224 | ||
225 | /* Bit Flags for sysctl_tcp_fastopen */ | 225 | /* Bit Flags for sysctl_tcp_fastopen */ |
226 | #define TFO_CLIENT_ENABLE 1 | 226 | #define TFO_CLIENT_ENABLE 1 |
227 | #define TFO_SERVER_ENABLE 2 | ||
227 | #define TFO_CLIENT_NO_COOKIE 4 /* Data in SYN w/o cookie option */ | 228 | #define TFO_CLIENT_NO_COOKIE 4 /* Data in SYN w/o cookie option */ |
228 | 229 | ||
230 | /* Process SYN data but skip cookie validation */ | ||
231 | #define TFO_SERVER_COOKIE_NOT_CHKED 0x100 | ||
232 | /* Accept SYN data w/o any cookie option */ | ||
233 | #define TFO_SERVER_COOKIE_NOT_REQD 0x200 | ||
234 | |||
235 | /* Force enable TFO on all listeners, i.e., not requiring the | ||
236 | * TCP_FASTOPEN socket option. SOCKOPT1/2 determine how to set max_qlen. | ||
237 | */ | ||
238 | #define TFO_SERVER_WO_SOCKOPT1 0x400 | ||
239 | #define TFO_SERVER_WO_SOCKOPT2 0x800 | ||
240 | /* Always create TFO child sockets on a TFO listener even when | ||
241 | * cookie/data not present. (For testing purpose!) | ||
242 | */ | ||
243 | #define TFO_SERVER_ALWAYS 0x1000 | ||
244 | |||
229 | extern struct inet_timewait_death_row tcp_death_row; | 245 | extern struct inet_timewait_death_row tcp_death_row; |
230 | 246 | ||
231 | /* sysctl variables for tcp */ | 247 | /* sysctl variables for tcp */ |
@@ -421,12 +437,6 @@ extern void tcp_metrics_init(void); | |||
421 | extern bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst, bool paws_check); | 437 | extern bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst, bool paws_check); |
422 | extern bool tcp_remember_stamp(struct sock *sk); | 438 | extern bool tcp_remember_stamp(struct sock *sk); |
423 | extern bool tcp_tw_remember_stamp(struct inet_timewait_sock *tw); | 439 | extern bool tcp_tw_remember_stamp(struct inet_timewait_sock *tw); |
424 | extern void tcp_fastopen_cache_get(struct sock *sk, u16 *mss, | ||
425 | struct tcp_fastopen_cookie *cookie, | ||
426 | int *syn_loss, unsigned long *last_syn_loss); | ||
427 | extern void tcp_fastopen_cache_set(struct sock *sk, u16 mss, | ||
428 | struct tcp_fastopen_cookie *cookie, | ||
429 | bool syn_lost); | ||
430 | extern void tcp_fetch_timewait_stamp(struct sock *sk, struct dst_entry *dst); | 440 | extern void tcp_fetch_timewait_stamp(struct sock *sk, struct dst_entry *dst); |
431 | extern void tcp_disable_fack(struct tcp_sock *tp); | 441 | extern void tcp_disable_fack(struct tcp_sock *tp); |
432 | extern void tcp_close(struct sock *sk, long timeout); | 442 | extern void tcp_close(struct sock *sk, long timeout); |
@@ -537,6 +547,7 @@ extern void tcp_send_delayed_ack(struct sock *sk); | |||
537 | extern void tcp_cwnd_application_limited(struct sock *sk); | 547 | extern void tcp_cwnd_application_limited(struct sock *sk); |
538 | extern void tcp_resume_early_retransmit(struct sock *sk); | 548 | extern void tcp_resume_early_retransmit(struct sock *sk); |
539 | extern void tcp_rearm_rto(struct sock *sk); | 549 | extern void tcp_rearm_rto(struct sock *sk); |
550 | extern void tcp_reset(struct sock *sk); | ||
540 | 551 | ||
541 | /* tcp_timer.c */ | 552 | /* tcp_timer.c */ |
542 | extern void tcp_init_xmit_timers(struct sock *); | 553 | extern void tcp_init_xmit_timers(struct sock *); |
@@ -586,6 +597,7 @@ extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); | |||
586 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); | 597 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); |
587 | extern void tcp_mtup_init(struct sock *sk); | 598 | extern void tcp_mtup_init(struct sock *sk); |
588 | extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt); | 599 | extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt); |
600 | extern void tcp_init_buffer_space(struct sock *sk); | ||
589 | 601 | ||
590 | static inline void tcp_bound_rto(const struct sock *sk) | 602 | static inline void tcp_bound_rto(const struct sock *sk) |
591 | { | 603 | { |
@@ -1104,6 +1116,7 @@ static inline void tcp_openreq_init(struct request_sock *req, | |||
1104 | req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */ | 1116 | req->rcv_wnd = 0; /* So that tcp_send_synack() knows! */ |
1105 | req->cookie_ts = 0; | 1117 | req->cookie_ts = 0; |
1106 | tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq; | 1118 | tcp_rsk(req)->rcv_isn = TCP_SKB_CB(skb)->seq; |
1119 | tcp_rsk(req)->rcv_nxt = TCP_SKB_CB(skb)->seq + 1; | ||
1107 | req->mss = rx_opt->mss_clamp; | 1120 | req->mss = rx_opt->mss_clamp; |
1108 | req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; | 1121 | req->ts_recent = rx_opt->saw_tstamp ? rx_opt->rcv_tsval : 0; |
1109 | ireq->tstamp_ok = rx_opt->tstamp_ok; | 1122 | ireq->tstamp_ok = rx_opt->tstamp_ok; |
@@ -1308,15 +1321,34 @@ extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff | |||
1308 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, | 1321 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, |
1309 | const struct tcp_md5sig_key *key); | 1322 | const struct tcp_md5sig_key *key); |
1310 | 1323 | ||
1324 | /* From tcp_fastopen.c */ | ||
1325 | extern void tcp_fastopen_cache_get(struct sock *sk, u16 *mss, | ||
1326 | struct tcp_fastopen_cookie *cookie, | ||
1327 | int *syn_loss, unsigned long *last_syn_loss); | ||
1328 | extern void tcp_fastopen_cache_set(struct sock *sk, u16 mss, | ||
1329 | struct tcp_fastopen_cookie *cookie, | ||
1330 | bool syn_lost); | ||
1311 | struct tcp_fastopen_request { | 1331 | struct tcp_fastopen_request { |
1312 | /* Fast Open cookie. Size 0 means a cookie request */ | 1332 | /* Fast Open cookie. Size 0 means a cookie request */ |
1313 | struct tcp_fastopen_cookie cookie; | 1333 | struct tcp_fastopen_cookie cookie; |
1314 | struct msghdr *data; /* data in MSG_FASTOPEN */ | 1334 | struct msghdr *data; /* data in MSG_FASTOPEN */ |
1315 | u16 copied; /* queued in tcp_connect() */ | 1335 | u16 copied; /* queued in tcp_connect() */ |
1316 | }; | 1336 | }; |
1317 | |||
1318 | void tcp_free_fastopen_req(struct tcp_sock *tp); | 1337 | void tcp_free_fastopen_req(struct tcp_sock *tp); |
1319 | 1338 | ||
1339 | extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; | ||
1340 | int tcp_fastopen_reset_cipher(void *key, unsigned int len); | ||
1341 | void tcp_fastopen_cookie_gen(__be32 addr, struct tcp_fastopen_cookie *foc); | ||
1342 | |||
1343 | #define TCP_FASTOPEN_KEY_LENGTH 16 | ||
1344 | |||
1345 | /* Fastopen key context */ | ||
1346 | struct tcp_fastopen_context { | ||
1347 | struct crypto_cipher __rcu *tfm; | ||
1348 | __u8 key[TCP_FASTOPEN_KEY_LENGTH]; | ||
1349 | struct rcu_head rcu; | ||
1350 | }; | ||
1351 | |||
1320 | /* write queue abstraction */ | 1352 | /* write queue abstraction */ |
1321 | static inline void tcp_write_queue_purge(struct sock *sk) | 1353 | static inline void tcp_write_queue_purge(struct sock *sk) |
1322 | { | 1354 | { |