Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/tcp_output.c
Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | |||||
tcp_output(struct tcpcb *tp) | tcp_output(struct tcpcb *tp) | ||||
{ | { | ||||
struct socket *so = tp->t_inpcb->inp_socket; | struct socket *so = tp->t_inpcb->inp_socket; | ||||
int32_t len; | int32_t len; | ||||
uint32_t recwin, sendwin; | uint32_t recwin, sendwin; | ||||
int off, flags, error = 0; /* Keep compiler happy */ | int off, flags, error = 0; /* Keep compiler happy */ | ||||
struct mbuf *m; | struct mbuf *m; | ||||
struct ip *ip = NULL; | struct ip *ip = NULL; | ||||
#ifdef TCPDEBUG | |||||
struct ipovly *ipov = NULL; | struct ipovly *ipov = NULL; | ||||
#endif | |||||
struct tcphdr *th; | struct tcphdr *th; | ||||
u_char opt[TCP_MAXOLEN]; | u_char opt[TCP_MAXOLEN]; | ||||
unsigned ipoptlen, optlen, hdrlen; | unsigned ipoptlen, optlen, hdrlen; | ||||
#if defined(IPSEC) || defined(IPSEC_SUPPORT) | #if defined(IPSEC) || defined(IPSEC_SUPPORT) | ||||
unsigned ipsec_optlen = 0; | unsigned ipsec_optlen = 0; | ||||
#endif | #endif | ||||
int idle, sendalot; | int idle, sendalot; | ||||
int sack_rxmit, sack_bytes_rxmt; | int sack_rxmit, sack_bytes_rxmt; | ||||
▲ Show 20 Lines • Show All 876 Lines • ▼ Show 20 Lines | #ifdef INET6 | ||||
if (isipv6) { | if (isipv6) { | ||||
ip6 = mtod(m, struct ip6_hdr *); | ip6 = mtod(m, struct ip6_hdr *); | ||||
th = (struct tcphdr *)(ip6 + 1); | th = (struct tcphdr *)(ip6 + 1); | ||||
tcpip_fillheaders(tp->t_inpcb, ip6, th); | tcpip_fillheaders(tp->t_inpcb, ip6, th); | ||||
} else | } else | ||||
#endif /* INET6 */ | #endif /* INET6 */ | ||||
{ | { | ||||
ip = mtod(m, struct ip *); | ip = mtod(m, struct ip *); | ||||
#ifdef TCPDEBUG | |||||
ipov = (struct ipovly *)ip; | ipov = (struct ipovly *)ip; | ||||
#endif | |||||
th = (struct tcphdr *)(ip + 1); | th = (struct tcphdr *)(ip + 1); | ||||
tcpip_fillheaders(tp->t_inpcb, ip, th); | tcpip_fillheaders(tp->t_inpcb, ip, th); | ||||
} | } | ||||
/* | /* | ||||
* Fill in fields, remembering maximum advertised | * Fill in fields, remembering maximum advertised | ||||
* window for use in delaying messages about window sizes. | * window for use in delaying messages about window sizes. | ||||
* If resending a FIN, be sure not to use a new sequence number. | * If resending a FIN, be sure not to use a new sequence number. | ||||
▲ Show 20 Lines • Show All 766 Lines • Show Last 20 Lines |