Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/tcp_var.h
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
struct tcpcb { | struct tcpcb { | ||||
/* Cache line 1 */ | /* Cache line 1 */ | ||||
struct inpcb *t_inpcb; /* back pointer to internet pcb */ | struct inpcb *t_inpcb; /* back pointer to internet pcb */ | ||||
struct tcp_function_block *t_fb;/* TCP function call block */ | struct tcp_function_block *t_fb;/* TCP function call block */ | ||||
void *t_fb_ptr; /* Pointer to t_fb specific data */ | void *t_fb_ptr; /* Pointer to t_fb specific data */ | ||||
uint32_t t_maxseg:24, /* maximum segment size */ | uint32_t t_maxseg:24, /* maximum segment size */ | ||||
t_logstate:8; /* State of "black box" logging */ | t_logstate:8; /* State of "black box" logging */ | ||||
uint32_t t_state:4, /* state of this connection */ | uint32_t t_port:16, /* Tunneling (over udp) port */ | ||||
bits_spare : 24; | t_state:4, /* state of this connection */ | ||||
t_idle_reduce : 1, | |||||
t_delayed_ack: 7, /* Delayed ack variable */ | |||||
bits_spare : 4; | |||||
u_int t_flags; | u_int t_flags; | ||||
tcp_seq snd_una; /* sent but unacknowledged */ | tcp_seq snd_una; /* sent but unacknowledged */ | ||||
tcp_seq snd_max; /* highest sequence number sent; | tcp_seq snd_max; /* highest sequence number sent; | ||||
* used to recognize retransmits | * used to recognize retransmits | ||||
*/ | */ | ||||
tcp_seq snd_nxt; /* send next */ | tcp_seq snd_nxt; /* send next */ | ||||
tcp_seq snd_up; /* send urgent pointer */ | tcp_seq snd_up; /* send urgent pointer */ | ||||
uint32_t snd_wnd; /* send window */ | uint32_t snd_wnd; /* send window */ | ||||
uint32_t snd_cwnd; /* congestion-controlled window */ | uint32_t snd_cwnd; /* congestion-controlled window */ | ||||
uint32_t cl1_spare; /* Spare to round out CL 1 */ | uint32_t t_peakrate_thr; /* pre-calculated peak rate threshold */ | ||||
/* Cache line 2 */ | /* Cache line 2 */ | ||||
u_int32_t ts_offset; /* our timestamp offset */ | u_int32_t ts_offset; /* our timestamp offset */ | ||||
u_int32_t rfbuf_ts; /* recv buffer autoscaling timestamp */ | u_int32_t rfbuf_ts; /* recv buffer autoscaling timestamp */ | ||||
int rcv_numsacks; /* # distinct sack blks present */ | int rcv_numsacks; /* # distinct sack blks present */ | ||||
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 */ | ||||
tcp_seq rcv_nxt; /* receive next */ | tcp_seq rcv_nxt; /* receive next */ | ||||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | struct tcpcb { | ||||
struct toedev *tod; /* toedev handling this connection */ | struct toedev *tod; /* toedev handling this connection */ | ||||
int t_sndrexmitpack; /* retransmit packets sent */ | int t_sndrexmitpack; /* retransmit packets sent */ | ||||
int t_rcvoopack; /* out-of-order packets received */ | int t_rcvoopack; /* out-of-order packets received */ | ||||
void *t_toe; /* TOE pcb pointer */ | void *t_toe; /* TOE pcb pointer */ | ||||
struct cc_algo *cc_algo; /* congestion control algorithm */ | struct cc_algo *cc_algo; /* congestion control algorithm */ | ||||
struct cc_var *ccv; /* congestion control specific vars */ | struct cc_var *ccv; /* congestion control specific vars */ | ||||
struct osd *osd; /* storage for Khelp module data */ | struct osd *osd; /* storage for Khelp module data */ | ||||
int t_bytes_acked; /* # bytes acked during current RTT */ | int t_bytes_acked; /* # bytes acked during current RTT */ | ||||
u_int t_maxunacktime; | |||||
u_int t_keepinit; /* time to establish connection */ | u_int t_keepinit; /* time to establish connection */ | ||||
u_int t_keepidle; /* time before keepalive probes begin */ | u_int t_keepidle; /* time before keepalive probes begin */ | ||||
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 */ | ||||
int t_dupacks; /* consecutive dup acks recd */ | int t_dupacks; /* consecutive dup acks recd */ | ||||
int t_lognum; /* Number of log entries */ | int t_lognum; /* Number of log entries */ | ||||
struct tcp_log_stailq t_logs; /* Log buffer */ | struct tcp_log_stailq t_logs; /* Log buffer */ | ||||
struct tcp_log_id_node *t_lin; | struct tcp_log_id_node *t_lin; | ||||
▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Flags for the extended TCP flags field, t_flags2 | * Flags for the extended TCP flags field, t_flags2 | ||||
*/ | */ | ||||
#define TF2_PLPMTU_BLACKHOLE 0x00000001 /* Possible PLPMTUD Black Hole. */ | #define TF2_PLPMTU_BLACKHOLE 0x00000001 /* Possible PLPMTUD Black Hole. */ | ||||
#define TF2_PLPMTU_PMTUD 0x00000002 /* Allowed to attempt PLPMTUD. */ | #define TF2_PLPMTU_PMTUD 0x00000002 /* Allowed to attempt PLPMTUD. */ | ||||
#define TF2_PLPMTU_MAXSEGSNT 0x00000004 /* Last seg sent was full seg. */ | #define TF2_PLPMTU_MAXSEGSNT 0x00000004 /* Last seg sent was full seg. */ | ||||
#define TF2_LOG_AUTO 0x00000008 /* Session is auto-logging. */ | #define TF2_LOG_AUTO 0x00000008 /* Session is auto-logging. */ | ||||
#define TF2_DROP_AF_DATA 0x00000010 /* Drop after all data ack'd */ | |||||
/* | /* | ||||
* Structure to hold TCP options that are only used during segment | * Structure to hold TCP options that are only used during segment | ||||
* processing (in tcp_input), but not held in the tcpcb. | * processing (in tcp_input), but not held in the tcpcb. | ||||
* It's basically used to reduce the number of parameters | * It's basically used to reduce the number of parameters | ||||
* to tcp_dooptions and tcp_addoptions. | * to tcp_dooptions and tcp_addoptions. | ||||
* The binary order of the to_flags is relevant for packing of the | * The binary order of the to_flags is relevant for packing of the | ||||
* options in tcp_addoptions. | * options in tcp_addoptions. | ||||
▲ Show 20 Lines • Show All 272 Lines • ▼ Show 20 Lines | |||||
struct tcp_hhook_data { | struct tcp_hhook_data { | ||||
struct tcpcb *tp; | struct tcpcb *tp; | ||||
struct tcphdr *th; | struct tcphdr *th; | ||||
struct tcpopt *to; | struct tcpopt *to; | ||||
uint32_t len; | uint32_t len; | ||||
int tso; | int tso; | ||||
tcp_seq curack; | tcp_seq curack; | ||||
}; | }; | ||||
#ifdef TCP_HHOOK | |||||
void hhook_run_tcp_est_out(struct tcpcb *tp, | |||||
struct tcphdr *th, struct tcpopt *to, | |||||
uint32_t len, int tso); | |||||
#endif | #endif | ||||
#endif | |||||
/* | /* | ||||
* TCB structure exported to user-land via sysctl(3). | * TCB structure exported to user-land via sysctl(3). | ||||
* | * | ||||
* Fields prefixed with "xt_" are unique to the export structure, and fields | * Fields prefixed with "xt_" are unique to the export structure, and fields | ||||
* with "t_" or other prefixes match corresponding fields of 'struct tcpcb'. | * with "t_" or other prefixes match corresponding fields of 'struct tcpcb'. | ||||
* | * | ||||
* Legend: | * Legend: | ||||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | |||||
#define V_tcp_minmss VNET(tcp_minmss) | #define V_tcp_minmss VNET(tcp_minmss) | ||||
#define V_tcp_mssdflt VNET(tcp_mssdflt) | #define V_tcp_mssdflt VNET(tcp_mssdflt) | ||||
#define V_tcp_recvspace VNET(tcp_recvspace) | #define V_tcp_recvspace VNET(tcp_recvspace) | ||||
#define V_tcp_sack_globalholes VNET(tcp_sack_globalholes) | #define V_tcp_sack_globalholes VNET(tcp_sack_globalholes) | ||||
#define V_tcp_sack_globalmaxholes VNET(tcp_sack_globalmaxholes) | #define V_tcp_sack_globalmaxholes VNET(tcp_sack_globalmaxholes) | ||||
#define V_tcp_sack_maxholes VNET(tcp_sack_maxholes) | #define V_tcp_sack_maxholes VNET(tcp_sack_maxholes) | ||||
#define V_tcp_sc_rst_sock_fail VNET(tcp_sc_rst_sock_fail) | #define V_tcp_sc_rst_sock_fail VNET(tcp_sc_rst_sock_fail) | ||||
#define V_tcp_sendspace VNET(tcp_sendspace) | #define V_tcp_sendspace VNET(tcp_sendspace) | ||||
#define V_tcp_udp_tunneling_overhead VNET(tcp_udp_tunneling_overhead) | |||||
#define V_tcp_udp_tunneling_port VNET(tcp_udp_tunneling_port) | |||||
#ifdef TCP_HHOOK | #ifdef TCP_HHOOK | ||||
VNET_DECLARE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST + 1]); | VNET_DECLARE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST + 1]); | ||||
#define V_tcp_hhh VNET(tcp_hhh) | #define V_tcp_hhh VNET(tcp_hhh) | ||||
#endif | #endif | ||||
int tcp_addoptions(struct tcpopt *, u_char *); | int tcp_addoptions(struct tcpopt *, u_char *); | ||||
int tcp_ccalgounload(struct cc_algo *unload_algo); | int tcp_ccalgounload(struct cc_algo *unload_algo); | ||||
struct tcpcb * | struct tcpcb * | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | |||||
int tcp_twcheck(struct inpcb *, struct tcpopt *, struct tcphdr *, | int tcp_twcheck(struct inpcb *, struct tcpopt *, struct tcphdr *, | ||||
struct mbuf *, int); | struct mbuf *, int); | ||||
void tcp_setpersist(struct tcpcb *); | void tcp_setpersist(struct tcpcb *); | ||||
void tcp_slowtimo(void); | void tcp_slowtimo(void); | ||||
struct tcptemp * | struct tcptemp * | ||||
tcpip_maketemplate(struct inpcb *); | tcpip_maketemplate(struct inpcb *); | ||||
void tcpip_fillheaders(struct inpcb *, void *, void *); | void tcpip_fillheaders(struct inpcb *, void *, void *); | ||||
void tcp_timer_activate(struct tcpcb *, uint32_t, u_int); | void tcp_timer_activate(struct tcpcb *, uint32_t, u_int); | ||||
int tcp_timer_suspend(struct tcpcb *, uint32_t); | |||||
void tcp_timers_unsuspend(struct tcpcb *, uint32_t); | |||||
int tcp_timer_active(struct tcpcb *, uint32_t); | int tcp_timer_active(struct tcpcb *, uint32_t); | ||||
void tcp_timer_stop(struct tcpcb *, uint32_t); | void tcp_timer_stop(struct tcpcb *, uint32_t); | ||||
void tcp_trace(short, short, struct tcpcb *, void *, struct tcphdr *, int); | void tcp_trace(short, short, struct tcpcb *, void *, struct tcphdr *, int); | ||||
int inp_to_cpuid(struct inpcb *inp); | |||||
/* | /* | ||||
* All tcp_hc_* functions are IPv4 and IPv6 (via in_conninfo) | * All tcp_hc_* functions are IPv4 and IPv6 (via in_conninfo) | ||||
*/ | */ | ||||
void tcp_hc_init(void); | void tcp_hc_init(void); | ||||
#ifdef VIMAGE | #ifdef VIMAGE | ||||
void tcp_hc_destroy(void); | void tcp_hc_destroy(void); | ||||
#endif | #endif | ||||
void tcp_hc_get(struct in_conninfo *, struct hc_metrics_lite *); | void tcp_hc_get(struct in_conninfo *, struct hc_metrics_lite *); | ||||
Show All 9 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 *); | ||||
int tcp_compute_pipe(struct tcpcb *); | int tcp_compute_pipe(struct tcpcb *); | ||||
void tcp_sndbuf_autoscale(struct tcpcb *, struct socket *, uint32_t); | void tcp_sndbuf_autoscale(struct tcpcb *, struct socket *, uint32_t); | ||||
struct mbuf * | |||||
tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *plen, | |||||
int32_t seglimit, int32_t segsize, struct sockbuf *sb); | |||||
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 15 Lines |