Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_var.h
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | struct tcpcb { | ||||
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 */ | ||||
tcp_seq rcv_adv; /* advertised window */ | tcp_seq rcv_adv; /* advertised window */ | ||||
uint32_t rcv_wnd; /* receive window */ | uint32_t rcv_wnd; /* receive window */ | ||||
u_int t_flags2; /* More tcpcb flags storage */ | u_int t_flags2; /* More tcpcb flags storage */ | ||||
int t_srtt; /* smoothed round-trip time */ | uint64_t t_srtt; /* smoothed round-trip time */ | ||||
int t_rttvar; /* variance in round-trip time */ | uint64_t t_rttvar; /* variance in round-trip time */ | ||||
u_int32_t ts_recent; /* timestamp echo data */ | u_int32_t ts_recent; /* timestamp echo data */ | ||||
u_char snd_scale; /* window scaling for send window */ | u_char snd_scale; /* window scaling for send window */ | ||||
u_char rcv_scale; /* window scaling for recv window */ | u_char rcv_scale; /* window scaling for recv window */ | ||||
u_char snd_limited; /* segments limited transmitted */ | u_char snd_limited; /* segments limited transmitted */ | ||||
u_char request_r_scale; /* pending window scaling */ | u_char request_r_scale; /* pending window scaling */ | ||||
tcp_seq last_ack_sent; | |||||
u_int t_rcvtime; /* inactivity time */ | |||||
/* Cache line 3 */ | /* Cache line 3 */ | ||||
sbintime_t t_rcvtime; /* inactivity time */ | |||||
tcp_seq last_ack_sent; | |||||
tcp_seq rcv_up; /* receive urgent pointer */ | tcp_seq rcv_up; /* receive urgent pointer */ | ||||
int t_segqlen; /* segment reassembly queue length */ | |||||
struct tsegqe_head t_segq; /* segment reassembly queue */ | struct tsegqe_head t_segq; /* segment reassembly queue */ | ||||
struct mbuf *t_in_pkt; | struct mbuf *t_in_pkt; | ||||
struct mbuf *t_tail_pkt; | struct mbuf *t_tail_pkt; | ||||
struct tcp_timer *t_timers; /* All the TCP timers in one struct */ | struct tcp_timer *t_timers; /* All the TCP timers in one struct */ | ||||
struct vnet *t_vnet; /* back pointer to parent vnet */ | |||||
uint32_t snd_ssthresh; /* snd_cwnd size threshold for | uint32_t snd_ssthresh; /* snd_cwnd size threshold for | ||||
* for slow start exponential to | * for slow start exponential to | ||||
* linear switch | * linear switch | ||||
*/ | */ | ||||
tcp_seq snd_wl1; /* window update seg seq number */ | int t_segqlen; /* segment reassembly queue length */ | ||||
/* Cache line 4 */ | /* Cache line 4 */ | ||||
struct vnet *t_vnet; /* back pointer to parent vnet */ | |||||
tcp_seq snd_wl1; /* window update seg seq number */ | |||||
tcp_seq snd_wl2; /* window update seg ack number */ | tcp_seq snd_wl2; /* window update seg ack number */ | ||||
tcp_seq irs; /* initial receive sequence number */ | tcp_seq irs; /* initial receive sequence number */ | ||||
tcp_seq iss; /* initial send sequence number */ | tcp_seq iss; /* initial send sequence number */ | ||||
u_int t_acktime; | u_int t_acktime; | ||||
u_int ts_recent_age; /* when last updated */ | |||||
tcp_seq snd_recover; /* for use in NewReno Fast Recovery */ | tcp_seq snd_recover; /* for use in NewReno Fast Recovery */ | ||||
sbintime_t ts_recent_age; /* when last updated */ | |||||
sbintime_t t_rxtcur; /* current retransmit value (ticks) */ | |||||
sbintime_t t_rtttime; /* RTT measurement start time */ | |||||
uint32_t t_lasttsecr; | |||||
uint32_t t_lasttsval; | |||||
/* Cache line 5 */ | |||||
tcp_seq t_rtseq; /* sequence number being timed */ | |||||
uint16_t cl4_spare; /* Spare to adjust CL 4 */ | uint16_t cl4_spare; /* Spare to adjust CL 4 */ | ||||
char t_oobflags; /* have some */ | char t_oobflags; /* have some */ | ||||
char t_iobc; /* input character */ | char t_iobc; /* input character */ | ||||
int t_rxtcur; /* current retransmit value (ticks) */ | sbintime_t t_starttime; /* time connection was established */ | ||||
int t_rxtshift; /* log(2) of rexmt exp. backoff */ | int t_rxtshift; /* log(2) of rexmt exp. backoff */ | ||||
u_int t_rtttime; /* RTT measurement start time */ | |||||
tcp_seq t_rtseq; /* sequence number being timed */ | |||||
u_int t_starttime; /* time connection was established */ | |||||
u_int t_pmtud_saved_maxseg; /* pre-blackhole MSS */ | u_int t_pmtud_saved_maxseg; /* pre-blackhole MSS */ | ||||
u_int t_rttmin; /* minimum rtt allowed */ | sbintime_t t_rttmin; /* minimum rtt allowed */ | ||||
sbintime_t t_rttbest; /* best rtt we'v seen */ | |||||
u_int t_rttbest; /* best rtt we've seen */ | sbintime_t t_delack; /* delayed ack timer */ | ||||
int t_softerror; /* possible error not yet reported */ | int t_softerror; /* possible error not yet reported */ | ||||
uint32_t max_sndwnd; /* largest window peer has offered */ | uint32_t max_sndwnd; /* largest window peer has offered */ | ||||
/* Cache line 5 */ | |||||
uint32_t snd_cwnd_prev; /* cwnd prior to retransmit */ | uint32_t snd_cwnd_prev; /* cwnd prior to retransmit */ | ||||
uint32_t snd_ssthresh_prev; /* ssthresh prior to retransmit */ | uint32_t snd_ssthresh_prev; /* ssthresh prior to retransmit */ | ||||
tcp_seq snd_recover_prev; /* snd_recover prior to retransmit */ | tcp_seq snd_recover_prev; /* snd_recover prior to retransmit */ | ||||
int t_sndzerowin; /* zero-window updates sent */ | |||||
u_long t_rttupdated; /* number of times rtt sampled */ | u_long t_rttupdated; /* number of times rtt sampled */ | ||||
sbintime_t t_badrxtwin; /* window for retransmit recovery */ | |||||
int t_sndzerowin; /* zero-window updates sent */ | |||||
int snd_numholes; /* number of holes seen by sender */ | int snd_numholes; /* number of holes seen by sender */ | ||||
u_int t_badrxtwin; /* window for retransmit recovery */ | |||||
TAILQ_HEAD(sackhole_head, sackhole) snd_holes; | TAILQ_HEAD(sackhole_head, sackhole) snd_holes; | ||||
/* SACK scoreboard (sorted) */ | /* SACK scoreboard (sorted) */ | ||||
tcp_seq snd_fack; /* last seq number(+1) sack'd by rcv'r*/ | tcp_seq snd_fack; /* last seq number(+1) sack'd by rcv'r*/ | ||||
tcp_seq sack_newdata; /* New data xmitted in this recovery | tcp_seq sack_newdata; /* New data xmitted in this recovery | ||||
episode starts at this seq number */ | episode starts at this seq number */ | ||||
struct sackblk sackblks[MAX_SACK_BLKS]; /* seq nos. of sack blocks */ | struct sackblk sackblks[MAX_SACK_BLKS]; /* seq nos. of sack blocks */ | ||||
struct sackhint sackhint; /* SACK scoreboard hint */ | struct sackhint sackhint; /* SACK scoreboard hint */ | ||||
int t_rttlow; /* smallest observerved RTT */ | int t_rttlow; /* smallest observerved RTT */ | ||||
Show All 29 Lines | |||||
#endif | #endif | ||||
}; | }; | ||||
#endif /* _KERNEL || _WANT_TCPCB */ | #endif /* _KERNEL || _WANT_TCPCB */ | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
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; | ||||
u_char opt[TCP_MAXOLEN]; | |||||
}; | }; | ||||
/* | /* | ||||
* TODO: We yet need to brave plowing in | * TODO: We yet need to brave plowing in | ||||
* to tcp_input() and the pru_usrreq() block. | * to tcp_input() and the pru_usrreq() block. | ||||
* Right now these go to the old standards which | * Right now these go to the old standards which | ||||
* are somewhat ok, but in the long term may | * are somewhat ok, but in the long term may | ||||
* need to be changed. If we do tackle tcp_input() | * need to be changed. If we do tackle tcp_input() | ||||
▲ Show 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | struct tcptw { | ||||
tcp_seq snd_nxt; | tcp_seq snd_nxt; | ||||
tcp_seq rcv_nxt; | tcp_seq rcv_nxt; | ||||
tcp_seq iss; | tcp_seq iss; | ||||
tcp_seq irs; | tcp_seq irs; | ||||
u_short last_win; /* cached window value */ | u_short last_win; /* cached window value */ | ||||
short tw_so_options; /* copy of so_options */ | short tw_so_options; /* copy of so_options */ | ||||
struct ucred *tw_cred; /* user credentials */ | struct ucred *tw_cred; /* user credentials */ | ||||
u_int32_t t_recent; | u_int32_t t_recent; | ||||
u_int32_t ts_offset; /* our timestamp offset */ | sbintime_t t_starttime; | ||||
u_int t_starttime; | |||||
int tw_time; | int tw_time; | ||||
TAILQ_ENTRY(tcptw) tw_2msl; | TAILQ_ENTRY(tcptw) tw_2msl; | ||||
void *tw_pspare; /* TCP_SIGNATURE */ | void *tw_pspare; /* TCP_SIGNATURE */ | ||||
u_int *tw_spare; /* TCP_SIGNATURE */ | u_int *tw_spare; /* TCP_SIGNATURE */ | ||||
}; | }; | ||||
#define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb) | #define intotcpcb(ip) ((struct tcpcb *)(ip)->inp_ppcb) | ||||
#define intotw(ip) ((struct tcptw *)(ip)->inp_ppcb) | #define intotw(ip) ((struct tcptw *)(ip)->inp_ppcb) | ||||
Show All 25 Lines | |||||
* statistical, we have to test that we don't drop below | * statistical, we have to test that we don't drop below | ||||
* the minimum feasible timer (which is 2 ticks). | * the minimum feasible timer (which is 2 ticks). | ||||
* This version of the macro adapted from a paper by Lawrence | * This version of the macro adapted from a paper by Lawrence | ||||
* Brakmo and Larry Peterson which outlines a problem caused | * Brakmo and Larry Peterson which outlines a problem caused | ||||
* by insufficient precision in the original implementation, | * by insufficient precision in the original implementation, | ||||
* which results in inappropriately large RTO values for very | * which results in inappropriately large RTO values for very | ||||
* fast networks. | * fast networks. | ||||
*/ | */ | ||||
#define TCP_REXMTVAL(tp) \ | #define TCP_REXMTVAL(tp) max((tp)->t_rttmin, (tp)->t_srtt + ((tp)->t_rttvar << 2)) | ||||
max((tp)->t_rttmin, (((tp)->t_srtt >> (TCP_RTT_SHIFT - TCP_DELTA_SHIFT)) \ | |||||
+ (tp)->t_rttvar) >> TCP_DELTA_SHIFT) | |||||
/* | /* | ||||
* TCP statistics. | * TCP statistics. | ||||
* Many of these should be kept per connection, | * Many of these should be kept per connection, | ||||
* but that's inconvenient at the moment. | * but that's inconvenient at the moment. | ||||
*/ | */ | ||||
struct tcpstat { | struct tcpstat { | ||||
uint64_t tcps_connattempt; /* connections initiated */ | uint64_t tcps_connattempt; /* connections initiated */ | ||||
▲ Show 20 Lines • Show All 339 Lines • ▼ Show 20 Lines | |||||
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_dooptions(struct tcpopt *, u_char *, int, int); | ||||
void tcp_dropwithreset(struct mbuf *, struct tcphdr *, | void tcp_dropwithreset(struct mbuf *, struct tcphdr *, | ||||
struct tcpcb *, int, int); | struct tcpcb *, int, int); | ||||
void tcp_pulloutofband(struct socket *, | void tcp_pulloutofband(struct socket *, | ||||
struct tcphdr *, struct mbuf *, int); | struct tcphdr *, struct mbuf *, int); | ||||
void tcp_xmit_timer(struct tcpcb *, int); | void tcp_xmit_timer(struct tcpcb *, sbintime_t); | ||||
void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); | void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); | ||||
void cc_ack_received(struct tcpcb *tp, struct tcphdr *th, | void cc_ack_received(struct tcpcb *tp, struct tcphdr *th, | ||||
uint16_t nsegs, uint16_t type); | uint16_t nsegs, uint16_t type); | ||||
void cc_conn_init(struct tcpcb *tp); | void cc_conn_init(struct tcpcb *tp); | ||||
void cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); | void cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); | ||||
void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); | void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); | ||||
#ifdef TCP_HHOOK | #ifdef TCP_HHOOK | ||||
void hhook_run_tcp_est_in(struct tcpcb *tp, | void hhook_run_tcp_est_in(struct tcpcb *tp, | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
void tcp_tw_zone_change(void); | void tcp_tw_zone_change(void); | ||||
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, sbintime_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); | ||||
/* | /* | ||||
* 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 | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |