Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_var.h
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
#define TCP_EI_STATUS_PROGRESS 0x6 | #define TCP_EI_STATUS_PROGRESS 0x6 | ||||
#define TCP_EI_STATUS_PERSIST_MAX 0x7 | #define TCP_EI_STATUS_PERSIST_MAX 0x7 | ||||
#define TCP_EI_STATUS_KEEP_MAX 0x8 | #define TCP_EI_STATUS_KEEP_MAX 0x8 | ||||
#define TCP_EI_STATUS_DATA_A_CLOSE 0x9 | #define TCP_EI_STATUS_DATA_A_CLOSE 0x9 | ||||
#define TCP_EI_STATUS_RST_IN_FRONT 0xa | #define TCP_EI_STATUS_RST_IN_FRONT 0xa | ||||
#define TCP_EI_STATUS_2MSL 0xb | #define TCP_EI_STATUS_2MSL 0xb | ||||
#define TCP_EI_STATUS_MAX_VALUE 0xb | #define TCP_EI_STATUS_MAX_VALUE 0xb | ||||
#define TCP_HTTP_REQ_LOG_NEW 0x01 | #define TCP_TRK_REQ_LOG_NEW 0x01 | ||||
#define TCP_HTTP_REQ_LOG_COMPLETE 0x02 | #define TCP_TRK_REQ_LOG_COMPLETE 0x02 | ||||
#define TCP_HTTP_REQ_LOG_FREED 0x03 | #define TCP_TRK_REQ_LOG_FREED 0x03 | ||||
#define TCP_HTTP_REQ_LOG_ALLOCFAIL 0x04 | #define TCP_TRK_REQ_LOG_ALLOCFAIL 0x04 | ||||
#define TCP_HTTP_REQ_LOG_MOREYET 0x05 | #define TCP_TRK_REQ_LOG_MOREYET 0x05 | ||||
#define TCP_HTTP_REQ_LOG_FORCEFREE 0x06 | #define TCP_TRK_REQ_LOG_FORCEFREE 0x06 | ||||
#define TCP_HTTP_REQ_LOG_STALE 0x07 | #define TCP_TRK_REQ_LOG_STALE 0x07 | ||||
#define TCP_HTTP_REQ_LOG_SEARCH 0x08 | #define TCP_TRK_REQ_LOG_SEARCH 0x08 | ||||
/************************************************/ | /************************************************/ | ||||
/* Status bits we track to assure no duplicates, | /* Status bits we track to assure no duplicates, | ||||
* the bits here are not used by the code but | * the bits here are not used by the code but | ||||
* for human representation. To check a bit we | * for human representation. To check a bit we | ||||
* take and shift over by 1 minus the value (1-8). | * take and shift over by 1 minus the value (1-8). | ||||
*/ | */ | ||||
/************************************************/ | /************************************************/ | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | struct sackhint { | ||||
uint32_t prr_delivered; /* Total bytes delivered using PRR */ | uint32_t prr_delivered; /* Total bytes delivered using PRR */ | ||||
uint32_t prr_out; /* Bytes sent during IN_RECOVERY */ | uint32_t prr_out; /* Bytes sent during IN_RECOVERY */ | ||||
}; | }; | ||||
#define SEGQ_EMPTY(tp) TAILQ_EMPTY(&(tp)->t_segq) | #define SEGQ_EMPTY(tp) TAILQ_EMPTY(&(tp)->t_segq) | ||||
STAILQ_HEAD(tcp_log_stailq, tcp_log_mem); | STAILQ_HEAD(tcp_log_stailq, tcp_log_mem); | ||||
#define TCP_HTTP_TRACK_FLG_EMPTY 0x00 /* Available */ | #define TCP_TRK_TRACK_FLG_EMPTY 0x00 /* Available */ | ||||
#define TCP_HTTP_TRACK_FLG_USED 0x01 /* In use */ | #define TCP_TRK_TRACK_FLG_USED 0x01 /* In use */ | ||||
#define TCP_HTTP_TRACK_FLG_OPEN 0x02 /* End is not valid (open range request) */ | #define TCP_TRK_TRACK_FLG_OPEN 0x02 /* End is not valid (open range request) */ | ||||
#define TCP_HTTP_TRACK_FLG_SEQV 0x04 /* We had a sendfile that touched it */ | #define TCP_TRK_TRACK_FLG_SEQV 0x04 /* We had a sendfile that touched it */ | ||||
#define TCP_HTTP_TRACK_FLG_COMP 0x08 /* Sendfile as placed the last bits (range req only) */ | #define TCP_TRK_TRACK_FLG_COMP 0x08 /* Sendfile as placed the last bits (range req only) */ | ||||
#define TCP_HTTP_TRACK_FLG_FSND 0x10 /* First send has been done into the seq space */ | #define TCP_TRK_TRACK_FLG_FSND 0x10 /* First send has been done into the seq space */ | ||||
#define MAX_TCP_HTTP_REQ 5 /* Max we will have at once */ | #define MAX_TCP_TRK_REQ 5 /* Max we will have at once */ | ||||
#ifdef TCP_REQUEST_TRK | struct tcp_sendfile_track { | ||||
struct http_sendfile_track { | |||||
uint64_t timestamp; /* User sent timestamp */ | uint64_t timestamp; /* User sent timestamp */ | ||||
uint64_t start; /* Start of sendfile offset */ | uint64_t start; /* Start of sendfile offset */ | ||||
uint64_t end; /* End if not open-range req */ | uint64_t end; /* End if not open-range req */ | ||||
uint64_t localtime; /* Time we actually got the req */ | uint64_t localtime; /* Time we actually got the req */ | ||||
uint64_t deadline; /* If in CU mode, deadline to delivery */ | uint64_t deadline; /* If in CU mode, deadline to delivery */ | ||||
uint64_t first_send; /* Time of first send in the range */ | uint64_t first_send; /* Time of first send in the range */ | ||||
uint64_t cspr; /* Client suggested pace rate */ | uint64_t cspr; /* Client suggested pace rate */ | ||||
uint64_t sent_at_fs; /* What was t_sndbytes as we begun sending */ | uint64_t sent_at_fs; /* What was t_sndbytes as we begun sending */ | ||||
uint64_t rxt_at_fs; /* What was t_snd_rxt_bytes as we begun sending */ | uint64_t rxt_at_fs; /* What was t_snd_rxt_bytes as we begun sending */ | ||||
tcp_seq start_seq; /* First TCP Seq assigned */ | tcp_seq start_seq; /* First TCP Seq assigned */ | ||||
tcp_seq end_seq; /* If range req last seq */ | tcp_seq end_seq; /* If range req last seq */ | ||||
uint32_t flags; /* Type of request open etc */ | uint32_t flags; /* Type of request open etc */ | ||||
uint32_t sbcc_at_s; /* When we allocate what is the sb_cc */ | uint32_t sbcc_at_s; /* When we allocate what is the sb_cc */ | ||||
uint32_t hint_maxseg; /* Client hinted maxseg */ | uint32_t hint_maxseg; /* Client hinted maxseg */ | ||||
uint32_t hybrid_flags; /* Hybrid flags on this request */ | uint32_t hybrid_flags; /* Hybrid flags on this request */ | ||||
}; | }; | ||||
#endif | |||||
/* | /* | ||||
* Change Query responses for a stack switch we create a structure | * Change Query responses for a stack switch we create a structure | ||||
* that allows query response from the new stack to the old, if | * that allows query response from the new stack to the old, if | ||||
* supported. | * supported. | ||||
* | * | ||||
* There are three queries currently defined. | * There are three queries currently defined. | ||||
* - sendmap | * - sendmap | ||||
▲ Show 20 Lines • Show All 311 Lines • ▼ Show 20 Lines | #ifdef TCPPCAP | ||||
struct mbufq t_outpkts; /* List of saved output packets. */ | struct mbufq t_outpkts; /* List of saved output packets. */ | ||||
#endif | #endif | ||||
#ifdef TCP_HHOOK | #ifdef TCP_HHOOK | ||||
struct osd t_osd; /* storage for Khelp module data */ | struct osd t_osd; /* storage for Khelp module data */ | ||||
#endif | #endif | ||||
uint8_t _t_logpoint; /* Used when a BB log points is enabled */ | uint8_t _t_logpoint; /* Used when a BB log points is enabled */ | ||||
#ifdef TCP_REQUEST_TRK | #ifdef TCP_REQUEST_TRK | ||||
/* Response tracking addons. */ | /* Response tracking addons. */ | ||||
uint8_t t_http_req; /* Request count */ | uint8_t t_tcpreq_req; /* Request count */ | ||||
uint8_t t_http_open; /* Number of open range requests */ | uint8_t t_tcpreq_open; /* Number of open range requests */ | ||||
uint8_t t_http_closed; /* Number of closed range requests */ | uint8_t t_tcpreq_closed; /* Number of closed range requests */ | ||||
struct http_sendfile_track t_http_info[MAX_TCP_HTTP_REQ]; | struct tcp_sendfile_track t_tcpreq_info[MAX_TCP_TRK_REQ]; | ||||
#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; | ||||
▲ Show 20 Lines • Show All 1,002 Lines • ▼ Show 20 Lines | |||||
struct mbuf * | struct mbuf * | ||||
tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *plen, | tcp_m_copym(struct mbuf *m, int32_t off0, int32_t *plen, | ||||
int32_t seglimit, int32_t segsize, struct sockbuf *sb, bool hw_tls); | int32_t seglimit, int32_t segsize, struct sockbuf *sb, bool hw_tls); | ||||
int tcp_stats_init(void); | int tcp_stats_init(void); | ||||
void tcp_log_end_status(struct tcpcb *tp, uint8_t status); | void tcp_log_end_status(struct tcpcb *tp, uint8_t status); | ||||
#ifdef TCP_REQUEST_TRK | #ifdef TCP_REQUEST_TRK | ||||
void tcp_http_free_a_slot(struct tcpcb *tp, struct http_sendfile_track *ent); | void tcp_req_free_a_slot(struct tcpcb *tp, struct tcp_sendfile_track *ent); | ||||
struct http_sendfile_track * | struct tcp_sendfile_track * | ||||
tcp_http_find_a_req_that_is_completed_by(struct tcpcb *tp, tcp_seq th_ack, int *ip); | tcp_req_find_a_req_that_is_completed_by(struct tcpcb *tp, tcp_seq th_ack, int *ip); | ||||
int tcp_http_check_for_comp(struct tcpcb *tp, tcp_seq ack_point); | int tcp_req_check_for_comp(struct tcpcb *tp, tcp_seq ack_point); | ||||
int | int | ||||
tcp_http_is_entry_comp(struct tcpcb *tp, struct http_sendfile_track *ent, tcp_seq ack_point); | tcp_req_is_entry_comp(struct tcpcb *tp, struct tcp_sendfile_track *ent, tcp_seq ack_point); | ||||
struct http_sendfile_track * | struct tcp_sendfile_track * | ||||
tcp_http_find_req_for_seq(struct tcpcb *tp, tcp_seq seq); | tcp_req_find_req_for_seq(struct tcpcb *tp, tcp_seq seq); | ||||
void | void | ||||
tcp_http_log_req_info(struct tcpcb *tp, | tcp_req_log_req_info(struct tcpcb *tp, | ||||
struct http_sendfile_track *http, uint16_t slot, | struct tcp_sendfile_track *req, uint16_t slot, | ||||
uint8_t val, uint64_t offset, uint64_t nbytes); | uint8_t val, uint64_t offset, uint64_t nbytes); | ||||
uint32_t | uint32_t | ||||
tcp_estimate_tls_overhead(struct socket *so, uint64_t tls_usr_bytes); | tcp_estimate_tls_overhead(struct socket *so, uint64_t tls_usr_bytes); | ||||
void | void | ||||
tcp_http_alloc_req(struct tcpcb *tp, union tcp_log_userdata *user, | tcp_req_alloc_req(struct tcpcb *tp, union tcp_log_userdata *user, | ||||
uint64_t ts); | uint64_t ts); | ||||
struct http_sendfile_track * | struct tcp_sendfile_track * | ||||
tcp_http_alloc_req_full(struct tcpcb *tp, struct http_req *req, uint64_t ts, int rec_dups); | tcp_req_alloc_req_full(struct tcpcb *tp, struct tcp_snd_req *req, uint64_t ts, int rec_dups); | ||||
#endif | #endif | ||||
#ifdef TCP_ACCOUNTING | #ifdef TCP_ACCOUNTING | ||||
int tcp_do_ack_accounting(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to, uint32_t tiwin, int mss); | int tcp_do_ack_accounting(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to, uint32_t tiwin, int mss); | ||||
#endif | #endif | ||||
static inline void | static inline void | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |