linux/include/linux/tcp.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * INET		An implementation of the TCP/IP protocol suite for the LINUX
 *		operating system.  INET is implemented using the  BSD Socket
 *		interface as the means of communication with the user level.
 *
 *		Definitions for the TCP protocol.
 *
 * Version:	@(#)tcp.h	1.0.2	04/28/93
 *
 * Author:	Fred N. van Kempen, <[email protected]>
 */
#ifndef _LINUX_TCP_H
#define _LINUX_TCP_H


#include <linux/skbuff.h>
#include <linux/win_minmax.h>
#include <net/sock.h>
#include <net/inet_connection_sock.h>
#include <net/inet_timewait_sock.h>
#include <uapi/linux/tcp.h>

static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb)
{}

static inline unsigned int __tcp_hdrlen(const struct tcphdr *th)
{}

static inline unsigned int tcp_hdrlen(const struct sk_buff *skb)
{}

static inline struct tcphdr *inner_tcp_hdr(const struct sk_buff *skb)
{}

static inline unsigned int inner_tcp_hdrlen(const struct sk_buff *skb)
{}

/**
 * skb_tcp_all_headers - Returns size of all headers for a TCP packet
 * @skb: buffer
 *
 * Used in TX path, for a packet known to be a TCP one.
 *
 * if (skb_is_gso(skb)) {
 *         int hlen = skb_tcp_all_headers(skb);
 *         ...
 */
static inline int skb_tcp_all_headers(const struct sk_buff *skb)
{}

/**
 * skb_inner_tcp_all_headers - Returns size of all headers for an encap TCP packet
 * @skb: buffer
 *
 * Used in TX path, for a packet known to be a TCP one.
 *
 * if (skb_is_gso(skb) && skb->encapsulation) {
 *         int hlen = skb_inner_tcp_all_headers(skb);
 *         ...
 */
static inline int skb_inner_tcp_all_headers(const struct sk_buff *skb)
{}

static inline unsigned int tcp_optlen(const struct sk_buff *skb)
{}

/* TCP Fast Open */
#define TCP_FASTOPEN_COOKIE_MIN
#define TCP_FASTOPEN_COOKIE_MAX
#define TCP_FASTOPEN_COOKIE_SIZE

/* TCP Fast Open Cookie as stored in memory */
struct tcp_fastopen_cookie {};

/* This defines a selective acknowledgement block. */
struct tcp_sack_block_wire {};

struct tcp_sack_block {};

/*These are used to set the sack_ok field in struct tcp_options_received */
#define TCP_SACK_SEEN
#define TCP_DSACK_SEEN

struct tcp_options_received {};

static inline void tcp_clear_options(struct tcp_options_received *rx_opt)
{}

/* This is the max number of SACKS that we'll generate and process. It's safe
 * to increase this, although since:
 *   size = TCPOLEN_SACK_BASE_ALIGNED (4) + n * TCPOLEN_SACK_PERBLOCK (8)
 * only four options will fit in a standard TCP header */
#define TCP_NUM_SACKS

struct tcp_request_sock_ops;

struct tcp_request_sock {};

static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
{}

static inline bool tcp_rsk_used_ao(const struct request_sock *req)
{}

#define TCP_RMEM_TO_WIN_SCALE

struct tcp_sock {};

enum tsq_enum {};

enum tsq_flags {};

#define tcp_sk(ptr)

/* Variant of tcp_sk() upgrading a const sock to a read/write tcp socket.
 * Used in context of (lockless) tcp listeners.
 */
#define tcp_sk_rw(ptr)

struct tcp_timewait_sock {};

static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk)
{}

static inline bool tcp_passive_fastopen(const struct sock *sk)
{}

static inline void fastopen_queue_tune(struct sock *sk, int backlog)
{}

static inline void tcp_move_syn(struct tcp_sock *tp,
				struct request_sock *req)
{}

static inline void tcp_saved_syn_free(struct tcp_sock *tp)
{}

static inline u32 tcp_saved_syn_len(const struct saved_syn *saved_syn)
{}

struct sk_buff *tcp_get_timestamping_opt_stats(const struct sock *sk,
					       const struct sk_buff *orig_skb,
					       const struct sk_buff *ack_skb);

static inline u16 tcp_mss_clamp(const struct tcp_sock *tp, u16 mss)
{}

int tcp_skb_shift(struct sk_buff *to, struct sk_buff *from, int pcount,
		  int shiftlen);

void __tcp_sock_set_cork(struct sock *sk, bool on);
void tcp_sock_set_cork(struct sock *sk, bool on);
int tcp_sock_set_keepcnt(struct sock *sk, int val);
int tcp_sock_set_keepidle_locked(struct sock *sk, int val);
int tcp_sock_set_keepidle(struct sock *sk, int val);
int tcp_sock_set_keepintvl(struct sock *sk, int val);
void __tcp_sock_set_nodelay(struct sock *sk, bool on);
void tcp_sock_set_nodelay(struct sock *sk);
void tcp_sock_set_quickack(struct sock *sk, int val);
int tcp_sock_set_syncnt(struct sock *sk, int val);
int tcp_sock_set_user_timeout(struct sock *sk, int val);

static inline bool dst_tcp_usec_ts(const struct dst_entry *dst)
{}

#endif	/* _LINUX_TCP_H */