Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/tcp_var.h
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
struct tcptemp { | struct tcptemp { | ||||
u_char tt_ipgen[40]; /* the size must be of max ip header, now IPv6 */ | u_char tt_ipgen[40]; /* the size must be of max ip header, now IPv6 */ | ||||
struct tcphdr tt_t; | struct tcphdr tt_t; | ||||
}; | }; | ||||
#define tcp6cb tcpcb /* for KAME src sync over BSD*'s */ | #define tcp6cb tcpcb /* for KAME src sync over BSD*'s */ | ||||
/* | /* | ||||
* TODO: We yet need to brave plowing in | |||||
* to tcp_input() and the pru_usrreq() block. | |||||
* Right now these go to the old standards which | |||||
* are somewhat ok, but in the long term may | |||||
* need to be changed. If we do tackle tcp_input() | |||||
* then we need to get rid of the tcp_do_segment() | |||||
* function below. | |||||
*/ | |||||
/* Flags for tcp functions */ | |||||
#define TCP_FUNC_BEING_REMOVED 0x01 /* Can no longer be referenced */ | |||||
struct tcpcb; | |||||
struct inpcb; | |||||
struct sockopt; | |||||
struct socket; | |||||
struct tcp_function_block { | |||||
char tfb_tcp_block_name[TCP_FUNCTION_NAME_LEN_MAX]; | |||||
int (*tfb_tcp_output)(struct tcpcb *); | |||||
void (*tfb_tcp_do_segment)(struct mbuf *, struct tcphdr *, | |||||
struct socket *, struct tcpcb *, | |||||
int, int, uint8_t, | |||||
int); | |||||
int (*tfb_tcp_ctloutput)(struct socket *so, struct sockopt *sopt, | |||||
struct inpcb *inp, struct tcpcb *tp); | |||||
/* Optional memory allocation/free routine */ | |||||
void (*tfb_tcp_fb_init)(struct tcpcb *); | |||||
void (*tfb_tcp_fb_fini)(struct tcpcb *); | |||||
/* Optional timers, must define all if you define one */ | |||||
int (*tfb_tcp_timer_stop_all)(struct tcpcb *); | |||||
int (*tfb_tcp_timers_left)(struct tcpcb *); | |||||
void (*tfb_tcp_timer_activate)(struct tcpcb *, | |||||
uint32_t, u_int); | |||||
int (*tfb_tcp_timer_active)(struct tcpcb *, uint32_t); | |||||
void (*tfb_tcp_timer_stop)(struct tcpcb *, uint32_t); | |||||
volatile uint32_t tfb_refcnt; | |||||
uint32_t tfb_flags; | |||||
}; | |||||
struct tcp_function { | |||||
TAILQ_ENTRY(tcp_function) tf_next; | |||||
struct tcp_function_block *tf_fb; | |||||
}; | |||||
TAILQ_HEAD(tcp_funchead, tcp_function); | |||||
/* | |||||
* Tcp control block, one per tcp; fields: | * Tcp control block, one per tcp; fields: | ||||
* Organized for 16 byte cacheline efficiency. | * Organized for 16 byte cacheline efficiency. | ||||
*/ | */ | ||||
struct tcpcb { | struct tcpcb { | ||||
struct tsegqe_head t_segq; /* segment reassembly queue */ | struct tsegqe_head t_segq; /* segment reassembly queue */ | ||||
void *t_pspare[2]; /* new reassembly queue */ | void *t_pspare[2]; /* new reassembly queue */ | ||||
int t_segqlen; /* segment reassembly queue length */ | int t_segqlen; /* segment reassembly queue length */ | ||||
int t_dupacks; /* consecutive dup acks recd */ | int t_dupacks; /* consecutive dup acks recd */ | ||||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | /* SACK related state */ | ||||
u_int t_keepintvl; /* interval between keepalives */ | u_int t_keepintvl; /* interval between keepalives */ | ||||
u_int t_keepcnt; /* number of keepalives before close */ | u_int t_keepcnt; /* number of keepalives before close */ | ||||
u_int t_tsomax; /* TSO total burst length limit in bytes */ | u_int t_tsomax; /* TSO total burst length limit in bytes */ | ||||
u_int t_tsomaxsegcount; /* TSO maximum segment count */ | u_int t_tsomaxsegcount; /* TSO maximum segment count */ | ||||
u_int t_tsomaxsegsize; /* TSO maximum segment size in bytes */ | u_int t_tsomaxsegsize; /* TSO maximum segment size in bytes */ | ||||
u_int t_pmtud_saved_maxopd; /* pre-blackhole MSS */ | u_int t_pmtud_saved_maxopd; /* pre-blackhole MSS */ | ||||
u_int t_flags2; /* More tcpcb flags storage */ | u_int t_flags2; /* More tcpcb flags storage */ | ||||
uint32_t t_ispare[8]; /* 5 UTO, 3 TBD */ | uint32_t t_ispare[8]; /* 5 UTO, 3 TBD */ | ||||
void *t_pspare2[4]; /* 1 TCP_SIGNATURE, 3 TBD */ | struct tcp_function_block *t_fb;/* TCP function call block */ | ||||
void *t_fb_ptr; /* Pointer to t_fb specific data */ | |||||
void *t_pspare2[2]; /* 1 TCP_SIGNATURE, 1 TBD */ | |||||
#if defined(_KERNEL) && defined(TCPPCAP) | #if defined(_KERNEL) && defined(TCPPCAP) | ||||
struct mbufq t_inpkts; /* List of saved input packets. */ | struct mbufq t_inpkts; /* List of saved input packets. */ | ||||
struct mbufq t_outpkts; /* List of saved output packets. */ | struct mbufq t_outpkts; /* List of saved output packets. */ | ||||
#ifdef _LP64 | #ifdef _LP64 | ||||
uint64_t _pad[0]; /* all used! */ | uint64_t _pad[0]; /* all used! */ | ||||
#else | #else | ||||
uint64_t _pad[2]; /* 2 are available */ | uint64_t _pad[2]; /* 2 are available */ | ||||
#endif /* _LP64 */ | #endif /* _LP64 */ | ||||
▲ Show 20 Lines • Show All 308 Lines • ▼ Show 20 Lines | struct tcpstat { | ||||
uint64_t tcps_sig_err_nosigopt; /* No signature provided by segment */ | uint64_t tcps_sig_err_nosigopt; /* No signature provided by segment */ | ||||
uint64_t _pad[12]; /* 6 UTO, 6 TBD */ | uint64_t _pad[12]; /* 6 UTO, 6 TBD */ | ||||
}; | }; | ||||
#define tcps_rcvmemdrop tcps_rcvreassfull /* compat */ | #define tcps_rcvmemdrop tcps_rcvreassfull /* compat */ | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
#define TI_UNLOCKED 1 | |||||
#define TI_RLOCKED 2 | |||||
#include <sys/counter.h> | #include <sys/counter.h> | ||||
VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ | VNET_PCPUSTAT_DECLARE(struct tcpstat, tcpstat); /* tcp statistics */ | ||||
/* | /* | ||||
* In-kernel consumers can use these accessor macros directly to update | * In-kernel consumers can use these accessor macros directly to update | ||||
* stats. | * stats. | ||||
*/ | */ | ||||
#define TCPSTAT_ADD(name, val) \ | #define TCPSTAT_ADD(name, val) \ | ||||
▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | |||||
void tcp_fini(void *); | void tcp_fini(void *); | ||||
char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *, | char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *, | ||||
const void *); | const void *); | ||||
char *tcp_log_vain(struct in_conninfo *, struct tcphdr *, void *, | char *tcp_log_vain(struct in_conninfo *, struct tcphdr *, void *, | ||||
const void *); | const void *); | ||||
int tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *); | int tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *); | ||||
void tcp_reass_global_init(void); | void tcp_reass_global_init(void); | ||||
void tcp_reass_flush(struct tcpcb *); | void tcp_reass_flush(struct tcpcb *); | ||||
void tcp_dooptions(struct tcpopt *, u_char *, int, int); | |||||
void tcp_dropwithreset(struct mbuf *, struct tcphdr *, | |||||
struct tcpcb *, int, int); | |||||
void tcp_pulloutofband(struct socket *, | |||||
struct tcphdr *, struct mbuf *, int); | |||||
void tcp_xmit_timer(struct tcpcb *, int); | |||||
void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); | |||||
void cc_ack_received(struct tcpcb *tp, struct tcphdr *th, | |||||
uint16_t type); | |||||
void cc_conn_init(struct tcpcb *tp); | |||||
void cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); | |||||
void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); | |||||
void hhook_run_tcp_est_in(struct tcpcb *tp, | |||||
struct tcphdr *th, struct tcpopt *to); | |||||
int tcp_input(struct mbuf **, int *, int); | int tcp_input(struct mbuf **, int *, int); | ||||
void tcp_do_segment(struct mbuf *, struct tcphdr *, | |||||
struct socket *, struct tcpcb *, int, int, uint8_t, | |||||
int); | |||||
int register_tcp_functions(struct tcp_function_block *blk, int wait); | |||||
int deregister_tcp_functions(struct tcp_function_block *blk); | |||||
struct tcp_function_block *find_and_ref_tcp_functions(struct tcp_function_set *fs); | |||||
struct tcp_function_block *find_and_ref_tcp_fb(struct tcp_function_block *blk); | |||||
int tcp_default_ctloutput(struct socket *so, struct sockopt *sopt, struct inpcb *inp, struct tcpcb *tp); | |||||
u_long tcp_maxmtu(struct in_conninfo *, struct tcp_ifcap *); | u_long tcp_maxmtu(struct in_conninfo *, struct tcp_ifcap *); | ||||
u_long tcp_maxmtu6(struct in_conninfo *, struct tcp_ifcap *); | u_long tcp_maxmtu6(struct in_conninfo *, struct tcp_ifcap *); | ||||
void tcp_mss_update(struct tcpcb *, int, int, struct hc_metrics_lite *, | void tcp_mss_update(struct tcpcb *, int, int, struct hc_metrics_lite *, | ||||
struct tcp_ifcap *); | struct tcp_ifcap *); | ||||
void tcp_mss(struct tcpcb *, int); | void tcp_mss(struct tcpcb *, int); | ||||
int tcp_mssopt(struct in_conninfo *); | int tcp_mssopt(struct in_conninfo *); | ||||
struct inpcb * | struct inpcb * | ||||
tcp_drop_syn_sent(struct inpcb *, int); | tcp_drop_syn_sent(struct inpcb *, int); | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | |||||
void tcp_clean_sackreport(struct tcpcb *tp); | void tcp_clean_sackreport(struct tcpcb *tp); | ||||
void tcp_sack_adjust(struct tcpcb *tp); | void tcp_sack_adjust(struct tcpcb *tp); | ||||
struct sackhole *tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt); | struct sackhole *tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt); | ||||
void tcp_sack_partialack(struct tcpcb *, struct tcphdr *); | void tcp_sack_partialack(struct tcpcb *, struct tcphdr *); | ||||
void tcp_free_sackholes(struct tcpcb *tp); | void tcp_free_sackholes(struct tcpcb *tp); | ||||
int tcp_newreno(struct tcpcb *, struct tcphdr *); | int tcp_newreno(struct tcpcb *, struct tcphdr *); | ||||
u_long tcp_seq_subtract(u_long, u_long ); | u_long tcp_seq_subtract(u_long, u_long ); | ||||
int tcp_compute_pipe(struct tcpcb *); | int tcp_compute_pipe(struct tcpcb *); | ||||
void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); | |||||
static inline void | static inline void | ||||
tcp_fields_to_host(struct tcphdr *th) | tcp_fields_to_host(struct tcphdr *th) | ||||
{ | { | ||||
th->th_seq = ntohl(th->th_seq); | th->th_seq = ntohl(th->th_seq); | ||||
th->th_ack = ntohl(th->th_ack); | th->th_ack = ntohl(th->th_ack); | ||||
th->th_win = ntohs(th->th_win); | th->th_win = ntohs(th->th_win); | ||||
Show All 17 Lines |