Lines Matching refs:sk
53 void tcp_time_wait(struct sock *sk, int state, int timeo);
306 static inline bool tcp_out_of_memory(struct sock *sk) in tcp_out_of_memory() argument
308 if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && in tcp_out_of_memory()
309 sk_memory_allocated(sk) > sk_prot_mem_limits(sk, 2)) in tcp_out_of_memory()
314 static inline bool tcp_too_many_orphans(struct sock *sk, int shift) in tcp_too_many_orphans() argument
316 struct percpu_counter *ocp = sk->sk_prot->orphan_count; in tcp_too_many_orphans()
327 bool tcp_check_oom(struct sock *sk, int shift);
330 static inline void tcp_synq_overflow(struct sock *sk) in tcp_synq_overflow() argument
332 tcp_sk(sk)->rx_opt.ts_recent_stamp = jiffies; in tcp_synq_overflow()
336 static inline bool tcp_synq_no_recent_overflow(const struct sock *sk) in tcp_synq_no_recent_overflow() argument
338 unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp; in tcp_synq_no_recent_overflow()
354 void tcp_shutdown(struct sock *sk, int how);
360 int tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size);
361 int tcp_sendpage(struct sock *sk, struct page *page, int offset, size_t size,
363 void tcp_release_cb(struct sock *sk);
365 void tcp_write_timer_handler(struct sock *sk);
366 void tcp_delack_timer_handler(struct sock *sk);
367 int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
368 int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
370 void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
372 void tcp_rcv_space_adjust(struct sock *sk);
373 int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp);
374 void tcp_twsk_destructor(struct sock *sk);
375 ssize_t tcp_splice_read(struct socket *sk, loff_t *ppos,
379 static inline void tcp_dec_quickack_mode(struct sock *sk, in tcp_dec_quickack_mode() argument
382 struct inet_connection_sock *icsk = inet_csk(sk); in tcp_dec_quickack_mode()
410 struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
414 void tcp_enter_loss(struct sock *sk);
416 void tcp_update_metrics(struct sock *sk);
417 void tcp_init_metrics(struct sock *sk);
421 bool tcp_remember_stamp(struct sock *sk);
423 void tcp_fetch_timewait_stamp(struct sock *sk, struct dst_entry *dst);
425 void tcp_close(struct sock *sk, long timeout);
426 void tcp_init_sock(struct sock *sk);
429 int tcp_getsockopt(struct sock *sk, int level, int optname,
431 int tcp_setsockopt(struct sock *sk, int level, int optname,
433 int compat_tcp_getsockopt(struct sock *sk, int level, int optname,
435 int compat_tcp_setsockopt(struct sock *sk, int level, int optname,
437 void tcp_set_keepalive(struct sock *sk, int val);
439 int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,
450 void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb);
451 void tcp_v4_mtu_reduced(struct sock *sk);
452 void tcp_req_err(struct sock *sk, u32 seq);
453 int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb);
454 struct sock *tcp_create_openreq_child(struct sock *sk,
457 void tcp_ca_openreq_child(struct sock *sk, const struct dst_entry *dst);
458 struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
461 int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb);
462 int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
463 int tcp_connect(struct sock *sk);
464 struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
467 int tcp_disconnect(struct sock *sk, int flags);
469 void tcp_finish_connect(struct sock *sk, struct sk_buff *skb);
470 int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size);
471 void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb);
476 struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb);
498 __u32 cookie_v4_init_sequence(struct sock *sk, const struct sk_buff *skb,
508 struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
512 __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb,
517 void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
519 bool tcp_may_send_now(struct sock *sk);
522 void tcp_retransmit_timer(struct sock *sk);
531 void tcp_send_fin(struct sock *sk);
532 void tcp_send_active_reset(struct sock *sk, gfp_t priority);
535 void tcp_send_ack(struct sock *sk);
536 void tcp_send_delayed_ack(struct sock *sk);
537 void tcp_send_loss_probe(struct sock *sk);
538 bool tcp_schedule_loss_probe(struct sock *sk);
541 void tcp_resume_early_retransmit(struct sock *sk);
542 void tcp_rearm_rto(struct sock *sk);
543 void tcp_reset(struct sock *sk);
547 static inline void tcp_clear_xmit_timers(struct sock *sk) in tcp_clear_xmit_timers() argument
549 inet_csk_clear_xmit_timers(sk); in tcp_clear_xmit_timers()
552 unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu);
553 unsigned int tcp_current_mss(struct sock *sk);
584 int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
587 void tcp_initialize_rcv_mss(struct sock *sk);
589 int tcp_mtu_to_mss(struct sock *sk, int pmtu);
590 int tcp_mss_to_mtu(struct sock *sk, int mss);
591 void tcp_mtup_init(struct sock *sk);
592 void tcp_init_buffer_space(struct sock *sk);
594 static inline void tcp_bound_rto(const struct sock *sk) in tcp_bound_rto() argument
596 if (inet_csk(sk)->icsk_rto > TCP_RTO_MAX) in tcp_bound_rto()
597 inet_csk(sk)->icsk_rto = TCP_RTO_MAX; in tcp_bound_rto()
617 static inline void tcp_fast_path_check(struct sock *sk) in tcp_fast_path_check() argument
619 struct tcp_sock *tp = tcp_sk(sk); in tcp_fast_path_check()
623 atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf && in tcp_fast_path_check()
629 static inline u32 tcp_rto_min(struct sock *sk) in tcp_rto_min() argument
631 const struct dst_entry *dst = __sk_dst_get(sk); in tcp_rto_min()
639 static inline u32 tcp_rto_min_us(struct sock *sk) in tcp_rto_min_us() argument
641 return jiffies_to_usecs(tcp_rto_min(sk)); in tcp_rto_min_us()
666 u32 __tcp_select_window(struct sock *sk);
668 void tcp_send_window_probe(struct sock *sk);
815 void (*init)(struct sock *sk);
817 void (*release)(struct sock *sk);
820 u32 (*ssthresh)(struct sock *sk);
822 void (*cong_avoid)(struct sock *sk, u32 ack, u32 acked);
824 void (*set_state)(struct sock *sk, u8 new_state);
826 void (*cwnd_event)(struct sock *sk, enum tcp_ca_event ev);
828 void (*in_ack_event)(struct sock *sk, u32 flags);
830 u32 (*undo_cwnd)(struct sock *sk);
832 void (*pkts_acked)(struct sock *sk, u32 num_acked, s32 rtt_us);
834 size_t (*get_info)(struct sock *sk, u32 ext, int *attr,
844 void tcp_assign_congestion_control(struct sock *sk);
845 void tcp_init_congestion_control(struct sock *sk);
846 void tcp_cleanup_congestion_control(struct sock *sk);
852 int tcp_set_congestion_control(struct sock *sk, const char *name);
856 u32 tcp_reno_ssthresh(struct sock *sk);
857 void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 acked);
871 static inline bool tcp_ca_needs_ecn(const struct sock *sk) in tcp_ca_needs_ecn() argument
873 const struct inet_connection_sock *icsk = inet_csk(sk); in tcp_ca_needs_ecn()
878 static inline void tcp_set_ca_state(struct sock *sk, const u8 ca_state) in tcp_set_ca_state() argument
880 struct inet_connection_sock *icsk = inet_csk(sk); in tcp_set_ca_state()
883 icsk->icsk_ca_ops->set_state(sk, ca_state); in tcp_set_ca_state()
887 static inline void tcp_ca_event(struct sock *sk, const enum tcp_ca_event event) in tcp_ca_event() argument
889 const struct inet_connection_sock *icsk = inet_csk(sk); in tcp_ca_event()
892 icsk->icsk_ca_ops->cwnd_event(sk, event); in tcp_ca_event()
969 static inline bool tcp_in_cwnd_reduction(const struct sock *sk) in tcp_in_cwnd_reduction() argument
972 (1 << inet_csk(sk)->icsk_ca_state); in tcp_in_cwnd_reduction()
979 static inline __u32 tcp_current_ssthresh(const struct sock *sk) in tcp_current_ssthresh() argument
981 const struct tcp_sock *tp = tcp_sk(sk); in tcp_current_ssthresh()
983 if (tcp_in_cwnd_reduction(sk)) in tcp_current_ssthresh()
994 void tcp_enter_cwr(struct sock *sk);
1035 static inline bool tcp_is_cwnd_limited(const struct sock *sk) in tcp_is_cwnd_limited() argument
1037 const struct tcp_sock *tp = tcp_sk(sk); in tcp_is_cwnd_limited()
1046 static inline void tcp_check_probe_timer(struct sock *sk) in tcp_check_probe_timer() argument
1048 const struct tcp_sock *tp = tcp_sk(sk); in tcp_check_probe_timer()
1049 const struct inet_connection_sock *icsk = inet_csk(sk); in tcp_check_probe_timer()
1052 inet_csk_reset_xmit_timer(sk, ICSK_TIME_PROBE0, in tcp_check_probe_timer()
1096 bool tcp_prequeue(struct sock *sk, struct sk_buff *skb);
1107 void tcp_set_state(struct sock *sk, int state);
1109 void tcp_done(struct sock *sk);
1132 static inline int tcp_space(const struct sock *sk) in tcp_space() argument
1134 return tcp_win_from_space(sk->sk_rcvbuf - in tcp_space()
1135 atomic_read(&sk->sk_rmem_alloc)); in tcp_space()
1138 static inline int tcp_full_space(const struct sock *sk) in tcp_full_space() argument
1140 return tcp_win_from_space(sk->sk_rcvbuf); in tcp_full_space()
1144 struct sock *sk, struct dst_entry *dst);
1146 void tcp_enter_memory_pressure(struct sock *sk);
1171 static inline int tcp_fin_time(const struct sock *sk) in tcp_fin_time() argument
1173 int fin_timeout = tcp_sk(sk)->linger2 ? : sysctl_tcp_fin_timeout; in tcp_fin_time()
1174 const int rto = inet_csk(sk)->icsk_rto; in tcp_fin_time()
1303 const struct sock *sk, const struct sk_buff *skb);
1304 int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr,
1306 int tcp_md5_do_del(struct sock *sk, const union tcp_md5_addr *addr,
1308 struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk,
1312 struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk,
1317 static inline struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk, in tcp_md5_do_lookup() argument
1341 void tcp_fastopen_cache_get(struct sock *sk, u16 *mss,
1344 void tcp_fastopen_cache_set(struct sock *sk, u16 mss,
1358 bool tcp_try_fastopen(struct sock *sk, struct sk_buff *skb,
1373 static inline void tcp_write_queue_purge(struct sock *sk) in tcp_write_queue_purge() argument
1377 while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL) in tcp_write_queue_purge()
1378 sk_wmem_free_skb(sk, skb); in tcp_write_queue_purge()
1379 sk_mem_reclaim(sk); in tcp_write_queue_purge()
1380 tcp_clear_all_retrans_hints(tcp_sk(sk)); in tcp_write_queue_purge()
1383 static inline struct sk_buff *tcp_write_queue_head(const struct sock *sk) in tcp_write_queue_head() argument
1385 return skb_peek(&sk->sk_write_queue); in tcp_write_queue_head()
1388 static inline struct sk_buff *tcp_write_queue_tail(const struct sock *sk) in tcp_write_queue_tail() argument
1390 return skb_peek_tail(&sk->sk_write_queue); in tcp_write_queue_tail()
1393 static inline struct sk_buff *tcp_write_queue_next(const struct sock *sk, in tcp_write_queue_next() argument
1396 return skb_queue_next(&sk->sk_write_queue, skb); in tcp_write_queue_next()
1399 static inline struct sk_buff *tcp_write_queue_prev(const struct sock *sk, in tcp_write_queue_prev() argument
1402 return skb_queue_prev(&sk->sk_write_queue, skb); in tcp_write_queue_prev()
1405 #define tcp_for_write_queue(skb, sk) \ argument
1406 skb_queue_walk(&(sk)->sk_write_queue, skb)
1408 #define tcp_for_write_queue_from(skb, sk) \ argument
1409 skb_queue_walk_from(&(sk)->sk_write_queue, skb)
1411 #define tcp_for_write_queue_from_safe(skb, tmp, sk) \ argument
1412 skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp)
1414 static inline struct sk_buff *tcp_send_head(const struct sock *sk) in tcp_send_head() argument
1416 return sk->sk_send_head; in tcp_send_head()
1419 static inline bool tcp_skb_is_last(const struct sock *sk, in tcp_skb_is_last() argument
1422 return skb_queue_is_last(&sk->sk_write_queue, skb); in tcp_skb_is_last()
1425 static inline void tcp_advance_send_head(struct sock *sk, const struct sk_buff *skb) in tcp_advance_send_head() argument
1427 if (tcp_skb_is_last(sk, skb)) in tcp_advance_send_head()
1428 sk->sk_send_head = NULL; in tcp_advance_send_head()
1430 sk->sk_send_head = tcp_write_queue_next(sk, skb); in tcp_advance_send_head()
1433 static inline void tcp_check_send_head(struct sock *sk, struct sk_buff *skb_unlinked) in tcp_check_send_head() argument
1435 if (sk->sk_send_head == skb_unlinked) in tcp_check_send_head()
1436 sk->sk_send_head = NULL; in tcp_check_send_head()
1439 static inline void tcp_init_send_head(struct sock *sk) in tcp_init_send_head() argument
1441 sk->sk_send_head = NULL; in tcp_init_send_head()
1444 static inline void __tcp_add_write_queue_tail(struct sock *sk, struct sk_buff *skb) in __tcp_add_write_queue_tail() argument
1446 __skb_queue_tail(&sk->sk_write_queue, skb); in __tcp_add_write_queue_tail()
1449 static inline void tcp_add_write_queue_tail(struct sock *sk, struct sk_buff *skb) in tcp_add_write_queue_tail() argument
1451 __tcp_add_write_queue_tail(sk, skb); in tcp_add_write_queue_tail()
1454 if (sk->sk_send_head == NULL) { in tcp_add_write_queue_tail()
1455 sk->sk_send_head = skb; in tcp_add_write_queue_tail()
1457 if (tcp_sk(sk)->highest_sack == NULL) in tcp_add_write_queue_tail()
1458 tcp_sk(sk)->highest_sack = skb; in tcp_add_write_queue_tail()
1462 static inline void __tcp_add_write_queue_head(struct sock *sk, struct sk_buff *skb) in __tcp_add_write_queue_head() argument
1464 __skb_queue_head(&sk->sk_write_queue, skb); in __tcp_add_write_queue_head()
1470 struct sock *sk) in tcp_insert_write_queue_after() argument
1472 __skb_queue_after(&sk->sk_write_queue, skb, buff); in tcp_insert_write_queue_after()
1478 struct sock *sk) in tcp_insert_write_queue_before() argument
1480 __skb_queue_before(&sk->sk_write_queue, skb, new); in tcp_insert_write_queue_before()
1482 if (sk->sk_send_head == skb) in tcp_insert_write_queue_before()
1483 sk->sk_send_head = new; in tcp_insert_write_queue_before()
1486 static inline void tcp_unlink_write_queue(struct sk_buff *skb, struct sock *sk) in tcp_unlink_write_queue() argument
1488 __skb_unlink(skb, &sk->sk_write_queue); in tcp_unlink_write_queue()
1491 static inline bool tcp_write_queue_empty(struct sock *sk) in tcp_write_queue_empty() argument
1493 return skb_queue_empty(&sk->sk_write_queue); in tcp_write_queue_empty()
1496 static inline void tcp_push_pending_frames(struct sock *sk) in tcp_push_pending_frames() argument
1498 if (tcp_send_head(sk)) { in tcp_push_pending_frames()
1499 struct tcp_sock *tp = tcp_sk(sk); in tcp_push_pending_frames()
1501 __tcp_push_pending_frames(sk, tcp_current_mss(sk), tp->nonagle); in tcp_push_pending_frames()
1520 static inline void tcp_advance_highest_sack(struct sock *sk, struct sk_buff *skb) in tcp_advance_highest_sack() argument
1522 tcp_sk(sk)->highest_sack = tcp_skb_is_last(sk, skb) ? NULL : in tcp_advance_highest_sack()
1523 tcp_write_queue_next(sk, skb); in tcp_advance_highest_sack()
1526 static inline struct sk_buff *tcp_highest_sack(struct sock *sk) in tcp_highest_sack() argument
1528 return tcp_sk(sk)->highest_sack; in tcp_highest_sack()
1531 static inline void tcp_highest_sack_reset(struct sock *sk) in tcp_highest_sack_reset() argument
1533 tcp_sk(sk)->highest_sack = tcp_write_queue_head(sk); in tcp_highest_sack_reset()
1537 static inline void tcp_highest_sack_combine(struct sock *sk, in tcp_highest_sack_combine() argument
1541 if (tcp_sk(sk)->sacked_out && (old == tcp_sk(sk)->highest_sack)) in tcp_highest_sack_combine()
1542 tcp_sk(sk)->highest_sack = new; in tcp_highest_sack_combine()
1585 void tcp_v4_destroy_sock(struct sock *sk);
1599 static inline bool tcp_stream_memory_free(const struct sock *sk) in tcp_stream_memory_free() argument
1601 const struct tcp_sock *tp = tcp_sk(sk); in tcp_stream_memory_free()
1612 int tcp_rtx_synack(struct sock *sk, struct request_sock *req);
1615 struct sock *sk, struct sk_buff *skb);
1620 struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk,
1624 const struct sock *sk,
1626 int (*md5_parse)(struct sock *sk,
1635 struct tcp_md5sig_key *(*req_md5_lookup)(struct sock *sk,
1639 const struct sock *sk,
1642 void (*init_req)(struct request_sock *req, struct sock *sk,
1645 __u32 (*cookie_init_seq)(struct sock *sk, const struct sk_buff *skb,
1648 struct dst_entry *(*route_req)(struct sock *sk, struct flowi *fl,
1652 int (*send_synack)(struct sock *sk, struct dst_entry *dst,
1655 void (*queue_hash_add)(struct sock *sk, struct request_sock *req,
1661 struct sock *sk, struct sk_buff *skb, in cookie_init_sequence() argument
1664 return ops->cookie_init_seq(sk, skb, mss); in cookie_init_sequence()
1668 struct sock *sk, struct sk_buff *skb, in cookie_init_sequence() argument