• Home
  • Raw
  • Download

Lines Matching refs:tp

67 tcp_template(struct tcpcb *tp)  in tcp_template()  argument
69 struct socket *so = tp->t_socket; in tcp_template()
70 register struct tcpiphdr *n = &tp->t_template; in tcp_template()
105 tcp_respond(struct tcpcb *tp, struct tcpiphdr *ti, struct mbuf *m, in tcp_respond() argument
112 DEBUG_ARG("tp = %lx", (long)tp); in tcp_respond()
119 if (tp) in tcp_respond()
120 win = sbspace(&tp->t_socket->so_rcv); in tcp_respond()
158 if (tp) in tcp_respond()
159 ti->ti_win = htons((u_int16_t) (win >> tp->rcv_scale)); in tcp_respond()
183 register struct tcpcb *tp; in tcp_newtcpcb() local
185 tp = (struct tcpcb *)malloc(sizeof(*tp)); in tcp_newtcpcb()
186 if (tp == NULL) in tcp_newtcpcb()
189 memset((char *) tp, 0, sizeof(struct tcpcb)); in tcp_newtcpcb()
190 tp->seg_next = tp->seg_prev = (struct tcpiphdr*)tp; in tcp_newtcpcb()
191 tp->t_maxseg = TCP_MSS; in tcp_newtcpcb()
193 tp->t_flags = TCP_DO_RFC1323 ? (TF_REQ_SCALE|TF_REQ_TSTMP) : 0; in tcp_newtcpcb()
194 tp->t_socket = so; in tcp_newtcpcb()
201 tp->t_srtt = TCPTV_SRTTBASE; in tcp_newtcpcb()
202 tp->t_rttvar = TCPTV_SRTTDFLT << 2; in tcp_newtcpcb()
203 tp->t_rttmin = TCPTV_MIN; in tcp_newtcpcb()
205 TCPT_RANGESET(tp->t_rxtcur, in tcp_newtcpcb()
209 tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; in tcp_newtcpcb()
210 tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT; in tcp_newtcpcb()
211 tp->t_state = TCPS_CLOSED; in tcp_newtcpcb()
213 so->so_tcpcb = tp; in tcp_newtcpcb()
215 return (tp); in tcp_newtcpcb()
223 struct tcpcb *tcp_drop(struct tcpcb *tp, int err) in tcp_drop() argument
232 DEBUG_ARG("tp = %lx", (long)tp); in tcp_drop()
235 if (TCPS_HAVERCVDSYN(tp->t_state)) { in tcp_drop()
236 tp->t_state = TCPS_CLOSED; in tcp_drop()
237 (void) tcp_output(tp); in tcp_drop()
245 return (tcp_close(tp)); in tcp_drop()
255 tcp_close(struct tcpcb *tp) in tcp_close() argument
258 struct socket *so = tp->t_socket; in tcp_close()
262 DEBUG_ARG("tp = %lx", (long )tp); in tcp_close()
265 t = tcpfrag_list_first(tp); in tcp_close()
266 while (!tcpfrag_list_end(t, tp)) { in tcp_close()
277 free(tp); in tcp_close()
307 struct tcpcb *tp = intotcpcb(inp); local
309 if (tp)
310 tp->snd_cwnd = tp->t_maxseg;
330 tcp_sockclosed(struct tcpcb *tp) in tcp_sockclosed() argument
334 DEBUG_ARG("tp = %lx", (long)tp); in tcp_sockclosed()
336 switch (tp->t_state) { in tcp_sockclosed()
341 tp->t_state = TCPS_CLOSED; in tcp_sockclosed()
342 tp = tcp_close(tp); in tcp_sockclosed()
347 tp->t_state = TCPS_FIN_WAIT_1; in tcp_sockclosed()
351 tp->t_state = TCPS_LAST_ACK; in tcp_sockclosed()
355 if (tp && tp->t_state >= TCPS_FIN_WAIT_2) in tcp_sockclosed()
356 soisfdisconnected(tp->t_socket); in tcp_sockclosed()
357 if (tp) in tcp_sockclosed()
358 tcp_output(tp); in tcp_sockclosed()
592 struct tcpcb *tp; in tcp_connect() local
648 tp = sototcpcb(so); in tcp_connect()
650 tcp_template(tp); in tcp_connect()
661 tp->t_state = TCPS_SYN_SENT; in tcp_connect()
662 tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT; in tcp_connect()
663 tp->iss = tcp_iss; in tcp_connect()
665 tcp_sendseqinit(tp); in tcp_connect()
666 tcp_output(tp); in tcp_connect()