Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_var.h
Show First 20 Lines • Show All 120 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); | ||||
typedef enum { | |||||
TT_DELACK = 0, | |||||
TT_REXMT, | |||||
TT_PERSIST, | |||||
TT_KEEP, | |||||
TT_2MSL, | |||||
TT_N, | |||||
} tt_which; | |||||
/* | /* | ||||
* Tcp control block, one per tcp connection. | * Tcp control block, one per tcp connection. | ||||
*/ | */ | ||||
struct tcpcb { | struct tcpcb { | ||||
struct inpcb t_inpcb; /* embedded protocol indepenent cb */ | struct inpcb t_inpcb; /* embedded protocol indepenent cb */ | ||||
#define t_start_zero t_fb | #define t_start_zero t_fb | ||||
#define t_zero_size (sizeof(struct tcpcb) - \ | #define t_zero_size (sizeof(struct tcpcb) - \ | ||||
offsetof(struct tcpcb, t_start_zero)) | 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 t_callout; | ||||
struct callout tt_persist; /* retransmit persistence */ | sbintime_t t_timers[TT_N]; | ||||
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 */ | ||||
▲ Show 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | void (*tfb_tcp_hpts_do_segment)(struct mbuf *, struct tcphdr *, | ||||
int, int, uint8_t, | int, int, uint8_t, | ||||
int, struct timeval *); | int, struct timeval *); | ||||
int (*tfb_tcp_ctloutput)(struct inpcb *inp, struct sockopt *sopt); | int (*tfb_tcp_ctloutput)(struct inpcb *inp, struct sockopt *sopt); | ||||
/* Optional memory allocation/free routine */ | /* Optional memory allocation/free routine */ | ||||
int (*tfb_tcp_fb_init)(struct tcpcb *); | int (*tfb_tcp_fb_init)(struct tcpcb *); | ||||
void (*tfb_tcp_fb_fini)(struct tcpcb *, int); | void (*tfb_tcp_fb_fini)(struct tcpcb *, int); | ||||
/* Optional timers, must define all if you define one */ | /* Optional timers, must define all if you define one */ | ||||
int (*tfb_tcp_timer_stop_all)(struct tcpcb *); | int (*tfb_tcp_timer_stop_all)(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); | |||||
void (*tfb_tcp_rexmit_tmr)(struct tcpcb *); | void (*tfb_tcp_rexmit_tmr)(struct tcpcb *); | ||||
int (*tfb_tcp_handoff_ok)(struct tcpcb *); | int (*tfb_tcp_handoff_ok)(struct tcpcb *); | ||||
void (*tfb_tcp_mtu_chg)(struct tcpcb *); | void (*tfb_tcp_mtu_chg)(struct tcpcb *); | ||||
int (*tfb_pru_options)(struct tcpcb *, int); | int (*tfb_pru_options)(struct tcpcb *, int); | ||||
void (*tfb_hwtls_change)(struct tcpcb *, int); | void (*tfb_hwtls_change)(struct tcpcb *, int); | ||||
int (*tfb_compute_pipe)(struct tcpcb *tp); | int (*tfb_compute_pipe)(struct tcpcb *tp); | ||||
volatile uint32_t tfb_refcnt; | volatile uint32_t tfb_refcnt; | ||||
uint32_t tfb_flags; | uint32_t tfb_flags; | ||||
▲ Show 20 Lines • Show All 696 Lines • ▼ Show 20 Lines | |||||
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 *); | ||||
struct tcpcb * | struct tcpcb * | ||||
tcp_close(struct tcpcb *); | tcp_close(struct tcpcb *); | ||||
void tcp_discardcb(struct tcpcb *); | void tcp_discardcb(struct tcpcb *); | ||||
bool tcp_freecb(struct tcpcb *); | |||||
void tcp_twstart(struct tcpcb *); | void tcp_twstart(struct tcpcb *); | ||||
int tcp_ctloutput(struct socket *, struct sockopt *); | int tcp_ctloutput(struct socket *, struct sockopt *); | ||||
void tcp_fini(void *); | void tcp_fini(void *); | ||||
char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, const void *, | char *tcp_log_addrs(struct in_conninfo *, struct tcphdr *, const void *, | ||||
const void *); | const void *); | ||||
char *tcp_log_vain(struct in_conninfo *, struct tcphdr *, const void *, | char *tcp_log_vain(struct in_conninfo *, struct tcphdr *, const void *, | ||||
const void *); | const void *); | ||||
int tcp_reass(struct tcpcb *, struct tcphdr *, tcp_seq *, int *, | int tcp_reass(struct tcpcb *, struct tcphdr *, tcp_seq *, int *, | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | void tcp_respond(struct tcpcb *, void *, | ||||
struct tcphdr *, struct mbuf *, tcp_seq, tcp_seq, uint16_t); | struct tcphdr *, struct mbuf *, tcp_seq, tcp_seq, uint16_t); | ||||
bool tcp_twcheck(struct inpcb *, struct tcpopt *, struct tcphdr *, | bool 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_record_dsack(struct tcpcb *tp, tcp_seq start, tcp_seq end, int tlp); | void tcp_record_dsack(struct tcpcb *tp, tcp_seq start, tcp_seq end, int tlp); | ||||
struct tcptemp * | struct tcptemp * | ||||
tcpip_maketemplate(struct inpcb *); | tcpip_maketemplate(struct inpcb *); | ||||
void tcpip_fillheaders(struct inpcb *, uint16_t, void *, void *); | void tcpip_fillheaders(struct inpcb *, uint16_t, void *, void *); | ||||
void tcp_timer_activate(struct tcpcb *, uint32_t, u_int); | void tcp_timer_activate(struct tcpcb *, tt_which, u_int); | ||||
int tcp_timer_active(struct tcpcb *, uint32_t); | bool tcp_timer_active(struct tcpcb *, tt_which); | ||||
void tcp_timer_stop(struct tcpcb *, uint32_t); | void tcp_timer_stop(struct tcpcb *); | ||||
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); | 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); | ||||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |