Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_var.h
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | |||||
#define TCP_EI_BITS_PROGRESS 0x020 | #define TCP_EI_BITS_PROGRESS 0x020 | ||||
#define TCP_EI_BITS_PRESIST_MAX 0x040 | #define TCP_EI_BITS_PRESIST_MAX 0x040 | ||||
#define TCP_EI_BITS_KEEP_MAX 0x080 | #define TCP_EI_BITS_KEEP_MAX 0x080 | ||||
#define TCP_EI_BITS_DATA_A_CLO 0x100 | #define TCP_EI_BITS_DATA_A_CLO 0x100 | ||||
#define TCP_EI_BITS_RST_IN_FR 0x200 /* a front state reset */ | #define TCP_EI_BITS_RST_IN_FR 0x200 /* a front state reset */ | ||||
#define TCP_EI_BITS_2MS_TIMER 0x400 /* 2 MSL timer expired */ | #define TCP_EI_BITS_2MS_TIMER 0x400 /* 2 MSL timer expired */ | ||||
#if defined(_KERNEL) || defined(_WANT_TCPCB) | #if defined(_KERNEL) || defined(_WANT_TCPCB) | ||||
#include <netinet/cc/cc.h> | |||||
/* TCP segment queue entry */ | /* TCP segment queue entry */ | ||||
struct tseg_qent { | struct tseg_qent { | ||||
TAILQ_ENTRY(tseg_qent) tqe_q; | TAILQ_ENTRY(tseg_qent) tqe_q; | ||||
struct mbuf *tqe_m; /* mbuf contains packet */ | struct mbuf *tqe_m; /* mbuf contains packet */ | ||||
struct mbuf *tqe_last; /* last mbuf in chain */ | struct mbuf *tqe_last; /* last mbuf in chain */ | ||||
tcp_seq tqe_start; /* TCP Sequence number start */ | tcp_seq tqe_start; /* TCP Sequence number start */ | ||||
int tqe_len; /* TCP segment data length */ | int tqe_len; /* TCP segment data length */ | ||||
uint32_t tqe_flags; /* The flags from tcp_get_flags() */ | uint32_t tqe_flags; /* The flags from tcp_get_flags() */ | ||||
Show All 34 Lines | |||||
/* | /* | ||||
* Tcp control block, one per tcp; fields: | * Tcp control block, one per tcp; fields: | ||||
* Organized for 64 byte cacheline efficiency based | * Organized for 64 byte cacheline efficiency based | ||||
* on common tcp_input/tcp_output processing. | * on common tcp_input/tcp_output processing. | ||||
*/ | */ | ||||
struct tcpcb { | struct tcpcb { | ||||
/* Cache line 1 */ | /* Cache line 1 */ | ||||
struct inpcb *t_inpcb; /* back pointer to internet pcb */ | struct inpcb t_inpcb; /* embedded protocol indepenent cb */ | ||||
#define t_start_zero t_fb | |||||
#define t_zero_size (sizeof(struct tcpcb) - \ | |||||
offsetof(struct tcpcb, t_start_zero)) | |||||
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 */ | ||||
struct callout tt_rexmt; /* retransmit timer */ | |||||
struct callout tt_persist; /* retransmit persistence */ | |||||
struct callout tt_keep; /* keepalive */ | |||||
struct callout tt_2msl; /* 2*msl TIME_WAIT timer */ | |||||
struct callout tt_delack; /* delayed ACK timer */ | |||||
uint32_t tt_flags; /* Timers flags */ | |||||
uint32_t tt_draincnt; /* Count being drained */ | |||||
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_port:16, /* Tunneling (over udp) port */ | uint32_t t_port:16, /* Tunneling (over udp) port */ | ||||
t_state:4, /* state of this connection */ | t_state:4, /* state of this connection */ | ||||
t_idle_reduce : 1, | t_idle_reduce : 1, | ||||
t_delayed_ack: 7, /* Delayed ack variable */ | t_delayed_ack: 7, /* Delayed ack variable */ | ||||
t_fin_is_rst: 1, /* Are fin's treated as resets */ | t_fin_is_rst: 1, /* Are fin's treated as resets */ | ||||
t_log_state_set: 1, | t_log_state_set: 1, | ||||
Show All 30 Lines | #define t_zero_size (sizeof(struct tcpcb) - \ | ||||
u_int t_rcvtime; /* inactivity time */ | u_int t_rcvtime; /* inactivity time */ | ||||
/* Cache line 3 */ | /* Cache line 3 */ | ||||
tcp_seq rcv_up; /* receive urgent pointer */ | tcp_seq rcv_up; /* receive urgent pointer */ | ||||
int t_segqlen; /* segment reassembly queue length */ | int t_segqlen; /* segment reassembly queue length */ | ||||
uint32_t t_segqmbuflen; /* total reassembly queue byte length */ | uint32_t t_segqmbuflen; /* total reassembly queue byte 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 */ | |||||
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 */ | tcp_seq snd_wl1; /* window update seg seq number */ | ||||
/* Cache line 4 */ | /* Cache line 4 */ | ||||
tcp_seq snd_wl2; /* window update seg ack number */ | tcp_seq snd_wl2; /* window update seg ack number */ | ||||
Show All 39 Lines | #define t_zero_size (sizeof(struct tcpcb) - \ | ||||
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 */ | ||||
int rfbuf_cnt; /* recv buffer autoscaling byte count */ | int rfbuf_cnt; /* recv buffer autoscaling byte count */ | ||||
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 *t_cc; /* congestion control algorithm */ | ||||
struct cc_var *ccv; /* congestion control specific vars */ | struct cc_var t_ccv; /* congestion control specific vars */ | ||||
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_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 */ | ||||
Show All 30 Lines | #define t_zero_size (sizeof(struct tcpcb) - \ | ||||
union { | union { | ||||
uint8_t t_end_info_bytes[TCP_END_BYTE_INFO]; | uint8_t t_end_info_bytes[TCP_END_BYTE_INFO]; | ||||
uint64_t t_end_info; | uint64_t t_end_info; | ||||
}; | }; | ||||
#ifdef TCPPCAP | #ifdef 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. */ | ||||
#endif | #endif | ||||
#ifdef TCP_HHOOK | |||||
struct osd t_osd; /* storage for Khelp module data */ | |||||
#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; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | struct tcp_function { | ||||
struct tcp_function_block *tf_fb; | struct tcp_function_block *tf_fb; | ||||
}; | }; | ||||
TAILQ_HEAD(tcp_funchead, tcp_function); | TAILQ_HEAD(tcp_funchead, tcp_function); | ||||
struct tcpcb * tcp_drop(struct tcpcb *, int); | struct tcpcb * tcp_drop(struct tcpcb *, int); | ||||
#ifdef _NETINET_IN_PCB_H_ | #ifdef _NETINET_IN_PCB_H_ | ||||
#define intotcpcb(inp) ((struct tcpcb *)(inp)->inp_ppcb) | #define intotcpcb(inp) __containerof((inp), struct tcpcb, t_inpcb) | ||||
#define sototcpcb(so) intotcpcb(sotoinpcb(so)) | #define sototcpcb(so) intotcpcb(sotoinpcb(so)) | ||||
#define tptoinpcb(tp) tp->t_inpcb | #define tptoinpcb(tp) (&(tp)->t_inpcb) | ||||
#define tptosocket(tp) tp->t_inpcb->inp_socket | #define tptosocket(tp) (tp)->t_inpcb.inp_socket | ||||
/* | /* | ||||
* tcp_output() | * tcp_output() | ||||
* Handles tcp_drop request from advanced stacks and reports that inpcb is | * Handles tcp_drop request from advanced stacks and reports that inpcb is | ||||
* gone with negative return code. | * gone with negative return code. | ||||
* Drop in replacement for the default stack. | * Drop in replacement for the default stack. | ||||
*/ | */ | ||||
static inline int | static inline int | ||||
▲ Show 20 Lines • Show All 880 Lines • Show Last 20 Lines |