• Home
  • Raw
  • Download

Lines Matching refs:Tcb

42   IN TCP_CB *Tcb  in TcpRcvWinOld()  argument
49 if (TCP_SEQ_GT (Tcb->RcvWl2 + Tcb->RcvWnd, Tcb->RcvNxt)) { in TcpRcvWinOld()
52 Tcb->RcvWl2 + Tcb->RcvWnd, in TcpRcvWinOld()
53 Tcb->RcvNxt in TcpRcvWinOld()
70 IN TCP_CB *Tcb in TcpRcvWinNow() argument
78 Sk = Tcb->Sk; in TcpRcvWinNow()
81 OldWin = TcpRcvWinOld (Tcb); in TcpRcvWinNow()
95 if ((Increase > Tcb->SndMss) || (2 * Increase >= GET_RCV_BUFFSIZE (Sk))) { in TcpRcvWinNow()
115 IN OUT TCP_CB *Tcb, in TcpComputeWnd() argument
126 Wnd = GET_RCV_BUFFSIZE (Tcb->Sk); in TcpComputeWnd()
129 Wnd = TcpRcvWinNow (Tcb); in TcpComputeWnd()
131 Tcb->RcvWnd = Wnd; in TcpComputeWnd()
134 Wnd = MIN (Wnd >> Tcb->RcvWndScale, 0xffff); in TcpComputeWnd()
148 IN TCP_CB *Tcb in TcpGetMaxSndNxt() argument
154 if (IsListEmpty (&Tcb->SndQue)) { in TcpGetMaxSndNxt()
155 return Tcb->SndNxt; in TcpGetMaxSndNxt()
158 Entry = Tcb->SndQue.BackLink; in TcpGetMaxSndNxt()
161 ASSERT (TCP_SEQ_GEQ (TCPSEG_NETBUF (Nbuf)->End, Tcb->SndNxt)); in TcpGetMaxSndNxt()
177 IN TCP_CB *Tcb, in TcpDataToSend() argument
187 Sk = Tcb->Sk; in TcpDataToSend()
198 Limit = Tcb->SndWl2 + Tcb->SndWnd; in TcpDataToSend()
200 if (TCP_SEQ_GT (Limit, Tcb->SndUna + Tcb->CWnd)) { in TcpDataToSend()
202 Limit = Tcb->SndUna + Tcb->CWnd; in TcpDataToSend()
205 if (TCP_SEQ_GT (Limit, Tcb->SndNxt)) { in TcpDataToSend()
206 Win = TCP_SUB_SEQ (Limit, Tcb->SndNxt); in TcpDataToSend()
215 Left = GET_SND_DATASIZE (Sk) + TCP_SUB_SEQ (TcpGetMaxSndNxt (Tcb), Tcb->SndNxt); in TcpDataToSend()
219 if (Len > Tcb->SndMss) { in TcpDataToSend()
220 Len = Tcb->SndMss; in TcpDataToSend()
239 if ((Len == Tcb->SndMss) || (2 * Len >= Tcb->SndWndMax)) { in TcpDataToSend()
245 ((Tcb->SndNxt == Tcb->SndUna) || TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_NO_NAGLE)) in TcpDataToSend()
256 if (!TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT)) { in TcpDataToSend()
261 Tcb) in TcpDataToSend()
264 if (!Tcb->ProbeTimerOn) { in TcpDataToSend()
265 TcpSetProbeTimer (Tcb); in TcpDataToSend()
285 IN OUT TCP_CB *Tcb, in TcpTransmitSegment() argument
304 Len = TcpSynBuildOption (Tcb, Nbuf); in TcpTransmitSegment()
307 Len = TcpBuildOption (Tcb, Nbuf); in TcpTransmitSegment()
324 Head->SrcPort = Tcb->LocalEnd.Port; in TcpTransmitSegment()
325 Head->DstPort = Tcb->RemoteEnd.Port; in TcpTransmitSegment()
327 Head->Ack = NTOHL (Tcb->RcvNxt); in TcpTransmitSegment()
330 Head->Wnd = TcpComputeWnd (Tcb, Syn); in TcpTransmitSegment()
339 if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_SND_PSH) && in TcpTransmitSegment()
340 TCP_SEQ_BETWEEN (Seg->Seq, Tcb->SndPsh, Seg->End) in TcpTransmitSegment()
344 TCP_CLEAR_FLG (Tcb->CtrlFlag, TCP_CTRL_SND_PSH); in TcpTransmitSegment()
346 } else if ((Seg->End == Tcb->SndNxt) && (GET_SND_DATASIZE (Tcb->Sk) == 0)) { in TcpTransmitSegment()
357 if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_SND_URG) && TCP_SEQ_LEQ (Seg->Seq, Tcb->SndUp)) { in TcpTransmitSegment()
361 if (TCP_SEQ_LT (Tcb->SndUp, Seg->End)) { in TcpTransmitSegment()
363 Seg->Urg = (UINT16) TCP_SUB_SEQ (Tcb->SndUp, Seg->Seq); in TcpTransmitSegment()
367 TCP_SUB_SEQ (Tcb->SndUp, in TcpTransmitSegment()
376 Head->Checksum = TcpChecksum (Nbuf, Tcb->HeadSum); in TcpTransmitSegment()
381 Tcb->RcvWl2 = Tcb->RcvNxt; in TcpTransmitSegment()
383 Tcb->RcvWnd = NTOHS (Head->Wnd); in TcpTransmitSegment()
389 Tcb->DelayedAck = 0; in TcpTransmitSegment()
391 return TcpSendIpPacket (Tcb, Nbuf, &Tcb->LocalEnd.Ip, &Tcb->RemoteEnd.Ip, Tcb->Sk->IpVersion); in TcpTransmitSegment()
406 IN TCP_CB *Tcb, in TcpGetSegmentSndQue() argument
422 ASSERT ((Tcb != NULL) && TCP_SEQ_LEQ (Seq, Tcb->SndNxt) && (Len > 0)); in TcpGetSegmentSndQue()
427 Head = &Tcb->SndQue; in TcpGetSegmentSndQue()
552 IN TCP_CB *Tcb, in TcpGetSegmentSock() argument
561 ASSERT ((Tcb != NULL) && (Tcb->Sk != NULL)); in TcpGetSegmentSock()
569 Tcb) in TcpGetSegmentSock()
586 DataGet = SockGetDataToSend (Tcb->Sk, 0, Len, Data); in TcpGetSegmentSock()
594 InsertTailList (&(Tcb->SndQue), &(Nbuf->List)); in TcpGetSegmentSock()
598 SockDataSent (Tcb->Sk, DataGet); in TcpGetSegmentSock()
617 IN TCP_CB *Tcb, in TcpGetSegment() argument
624 ASSERT (Tcb != NULL); in TcpGetSegment()
629 if ((Len != 0) && TCP_SEQ_LT (Seq, TcpGetMaxSndNxt (Tcb))) { in TcpGetSegment()
631 Nbuf = TcpGetSegmentSndQue (Tcb, Seq, Len); in TcpGetSegment()
634 Nbuf = TcpGetSegmentSock (Tcb, Seq, Len); in TcpGetSegment()
653 IN TCP_CB *Tcb, in TcpRetransmit() argument
667 if (TCP_SEQ_LT (Tcb->SndWl2 + Tcb->SndWnd, Seq)) { in TcpRetransmit()
671 Tcb) in TcpRetransmit()
677 Len = TCP_SUB_SEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq); in TcpRetransmit()
678 Len = MIN (Len, Tcb->SndMss); in TcpRetransmit()
680 Nbuf = TcpGetSegmentSndQue (Tcb, Seq, Len); in TcpRetransmit()
687 if (TcpTransmitSegment (Tcb, Nbuf) != 0) { in TcpRetransmit()
772 IN OUT TCP_CB *Tcb, in TcpToSendData() argument
784 ASSERT ((Tcb != NULL) && (Tcb->Sk != NULL) && (Tcb->State != TCP_LISTEN)); in TcpToSendData()
788 if ((Tcb->State == TCP_CLOSED) || TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT)) { in TcpToSendData()
797 Len = TcpDataToSend (Tcb, Force); in TcpToSendData()
798 Seq = Tcb->SndNxt; in TcpToSendData()
800 ASSERT ((Tcb->State) < (ARRAY_SIZE (mTcpOutFlag))); in TcpToSendData()
801 Flag = mTcpOutFlag[Tcb->State]; in TcpToSendData()
805 Seq = Tcb->Iss; in TcpToSendData()
817 Nbuf = TcpGetSegment (Tcb, Seq, Len); in TcpToSendData()
823 Tcb) in TcpToSendData()
845 if ((TcpGetMaxSndNxt (Tcb) == Tcb->SndNxt) && in TcpToSendData()
846 (GET_SND_DATASIZE (Tcb->Sk) == 0) && in TcpToSendData()
847 TCP_SEQ_LT (End + 1, Tcb->SndWnd + Tcb->SndWl2) in TcpToSendData()
852 Tcb, in TcpToSendData()
853 mTcpStateName[Tcb->State]) in TcpToSendData()
867 ASSERT (TcpCheckSndQue (&Tcb->SndQue) != 0); in TcpToSendData()
876 Tcb) in TcpToSendData()
883 if (TcpTransmitSegment (Tcb, Nbuf) != 0) { in TcpToSendData()
888 TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT); in TcpToSendData()
909 Tcb->DelayedAck = 0; in TcpToSendData()
912 TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT); in TcpToSendData()
915 if (TCP_SEQ_GT (End, Tcb->SndNxt)) { in TcpToSendData()
916 Tcb->SndNxt = End; in TcpToSendData()
919 if (!TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT)) { in TcpToSendData()
920 TcpSetTimer (Tcb, TCP_TIMER_REXMIT, Tcb->Rto); in TcpToSendData()
927 if ((Tcb->CongestState == TCP_CONGEST_OPEN) && !TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_RTT_ON)) { in TcpToSendData()
933 Tcb) in TcpToSendData()
936 TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_RTT_ON); in TcpToSendData()
937 Tcb->RttSeq = Seq; in TcpToSendData()
938 Tcb->RttMeasure = 0; in TcpToSendData()
941 } while (Len == Tcb->SndMss); in TcpToSendData()
961 IN OUT TCP_CB *Tcb in TcpSendAck() argument
976 Seg->Seq = Tcb->SndNxt; in TcpSendAck()
977 Seg->End = Tcb->SndNxt; in TcpSendAck()
980 if (TcpTransmitSegment (Tcb, Nbuf) == 0) { in TcpSendAck()
981 TCP_CLEAR_FLG (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW); in TcpSendAck()
982 Tcb->DelayedAck = 0; in TcpSendAck()
999 IN OUT TCP_CB *Tcb in TcpSendZeroProbe() argument
1019 Seg->Seq = Tcb->SndNxt - 1; in TcpSendZeroProbe()
1020 Seg->End = Tcb->SndNxt - 1; in TcpSendZeroProbe()
1023 Result = TcpTransmitSegment (Tcb, Nbuf); in TcpSendZeroProbe()
1037 IN OUT TCP_CB *Tcb in TcpToSendAck() argument
1048 if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW) || (Tcb->DelayedAck >= 1)) { in TcpToSendAck()
1049 TcpSendAck (Tcb); in TcpToSendAck()
1053 TcpNow = TcpRcvWinNow (Tcb); in TcpToSendAck()
1055 if (TcpNow > TcpRcvWinOld (Tcb)) { in TcpToSendAck()
1056 TcpSendAck (Tcb); in TcpToSendAck()
1063 Tcb) in TcpToSendAck()
1069 Tcb->DelayedAck++; in TcpToSendAck()
1089 IN TCP_CB *Tcb, in TcpSendReset() argument
1129 if (Tcb == NULL) { in TcpSendReset()
1141 Nhead->Seq = HTONL (Tcb->SndNxt); in TcpSendReset()
1142 Nhead->Ack = HTONL (Tcb->RcvNxt); in TcpSendReset()
1162 TcpSendIpPacket (Tcb, Nbuf, Local, Remote, Version); in TcpSendReset()