Home | History | Annotate | Download | only in TcpDxe

Lines Matching refs:Tcb

35   @param[in]  Tcb     Pointer to the TCP_CB of this TCP instance.

42 IN TCP_CB *Tcb
49 if (TCP_SEQ_GT (Tcb->RcvWl2 + Tcb->RcvWnd, Tcb->RcvNxt)) {
52 Tcb->RcvWl2 + Tcb->RcvWnd,
53 Tcb->RcvNxt
63 @param[in] Tcb Pointer to the TCP_CB of this TCP instance.
70 IN TCP_CB *Tcb
78 Sk = Tcb->Sk;
81 OldWin = TcpRcvWinOld (Tcb);
95 if ((Increase > Tcb->SndMss) || (2 * Increase >= GET_RCV_BUFFSIZE (Sk))) {
106 @param[in, out] Tcb Pointer to the TCP_CB of this TCP instance.
115 IN OUT TCP_CB *Tcb,
126 Wnd = GET_RCV_BUFFSIZE (Tcb->Sk);
129 Wnd = TcpRcvWinNow (Tcb);
131 Tcb->RcvWnd = Wnd;
134 Wnd = MIN (Wnd >> Tcb->RcvWndScale, 0xffff);
141 @param[in] Tcb Pointer to the TCP_CB of this TCP instance.
148 IN TCP_CB *Tcb
154 if (IsListEmpty (&Tcb->SndQue)) {
155 return Tcb->SndNxt;
158 Entry = Tcb->SndQue.BackLink;
161 ASSERT (TCP_SEQ_GEQ (TCPSEG_NETBUF (Nbuf)->End, Tcb->SndNxt));
168 @param[in] Tcb Pointer to the TCP_CB of this TCP instance.
177 IN TCP_CB *Tcb,
187 Sk = Tcb->Sk;
198 Limit = Tcb->SndWl2 + Tcb->SndWnd;
200 if (TCP_SEQ_GT (Limit, Tcb->SndUna + Tcb->CWnd)) {
202 Limit = Tcb->SndUna + Tcb->CWnd;
205 if (TCP_SEQ_GT (Limit, Tcb->SndNxt)) {
206 Win = TCP_SUB_SEQ (Limit, Tcb->SndNxt);
211 // socket send queue, and the data on the TCB's send
215 Left = GET_SND_DATASIZE (Sk) + TCP_SUB_SEQ (TcpGetMaxSndNxt (Tcb), Tcb->SndNxt);
219 if (Len > Tcb->SndMss) {
220 Len = Tcb->SndMss;
239 if ((Len == Tcb->SndMss) || (2 * Len >= Tcb->SndWndMax)) {
245 ((Tcb->SndNxt == Tcb->SndUna) || TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_NO_NAGLE))
256 if (!TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT)) {
260 "TcpDataToSend: enter persistent state for TCB %p\n",
261 Tcb)
264 if (!Tcb->ProbeTimerOn) {
265 TcpSetProbeTimer (Tcb);
275 @param[in, out] Tcb Pointer to the TCP_CB of this TCP instance.
285 IN OUT TCP_CB *Tcb,
304 Len = TcpSynBuildOption (Tcb, Nbuf);
307 Len = TcpBuildOption (Tcb, Nbuf);
324 Head->SrcPort = Tcb->LocalEnd.Port;
325 Head->DstPort = Tcb->RemoteEnd.Port;
327 Head->Ack = NTOHL (Tcb->RcvNxt);
330 Head->Wnd = TcpComputeWnd (Tcb, Syn);
339 if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_SND_PSH) &&
340 TCP_SEQ_BETWEEN (Seg->Seq, Tcb->SndPsh, Seg->End)
344 TCP_CLEAR_FLG (Tcb->CtrlFlag, TCP_CTRL_SND_PSH);
346 } else if ((Seg->End == Tcb->SndNxt) && (GET_SND_DATASIZE (Tcb->Sk) == 0)) {
357 if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_SND_URG) && TCP_SEQ_LEQ (Seg->Seq, Tcb->SndUp)) {
361 if (TCP_SEQ_LT (Tcb->SndUp, Seg->End)) {
363 Seg->Urg = (UINT16) TCP_SUB_SEQ (Tcb->SndUp, Seg->Seq);
367 TCP_SUB_SEQ (Tcb->SndUp,
376 Head->Checksum = TcpChecksum (Nbuf, Tcb->HeadSum);
381 Tcb->RcvWl2 = Tcb->RcvNxt;
383 Tcb->RcvWnd = NTOHS (Head->Wnd);
389 Tcb->DelayedAck = 0;
391 return TcpSendIpPacket (Tcb, Nbuf, &Tcb->LocalEnd.Ip, &Tcb->RemoteEnd.Ip, Tcb->Sk->IpVersion);
395 Get a segment from the Tcb's SndQue.
397 @param[in] Tcb Pointer to the TCP_CB of this TCP instance.
406 IN TCP_CB *Tcb,
422 ASSERT ((Tcb != NULL) && TCP_SEQ_LEQ (Seq, Tcb->SndNxt) && (Len > 0));
427 Head = &Tcb->SndQue;
541 Get a segment from the Tcb's socket buffer.
543 @param[in] Tcb Pointer to the TCP_CB of this TCP instance.
552 IN TCP_CB *Tcb,
561 ASSERT ((Tcb != NULL) && (Tcb->Sk != NULL));
568 "TcpGetSegmentSock: failed to allocate a netbuf for TCB %p\n",
569 Tcb)
586 DataGet = SockGetDataToSend (Tcb->Sk, 0, Len, Data);
594 InsertTailList (&(Tcb->SndQue), &(Nbuf->List));
598 SockDataSent (Tcb->Sk, DataGet);
608 @param[in] Tcb Pointer to the TCP_CB of this TCP instance.
617 IN TCP_CB *Tcb,
624 ASSERT (Tcb != NULL);
629 if ((Len != 0) && TCP_SEQ_LT (Seq, TcpGetMaxSndNxt (Tcb))) {
631 Nbuf = TcpGetSegmentSndQue (Tcb, Seq, Len);
634 Nbuf = TcpGetSegmentSock (Tcb, Seq, Len);
644 @param[in] Tcb Pointer to the TCP_CB of this TCP instance.
653 IN TCP_CB *Tcb,
667 if (TCP_SEQ_LT (Tcb->SndWl2 + Tcb->SndWnd, Seq)) {
670 "TcpRetransmit: retransmission cancelled because send window too small for TCB %p\n",
671 Tcb)
677 Len = TCP_SUB_SEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq);
678 Len = MIN (Len, Tcb->SndMss);
680 Nbuf = TcpGetSegmentSndQue (Tcb, Seq, Len);
687 if (TcpTransmitSegment (Tcb, Nbuf) != 0) {
763 @param[in, out] Tcb Pointer to the TCP_CB of this TCP instance.
772 IN OUT TCP_CB *Tcb,
784 ASSERT ((Tcb != NULL) && (Tcb->Sk != NULL) && (Tcb->State != TCP_LISTEN));
788 if ((Tcb->State == TCP_CLOSED) || TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT)) {
797 Len = TcpDataToSend (Tcb, Force);
798 Seq = Tcb->SndNxt;
800 ASSERT ((Tcb->State) < (sizeof (mTcpOutFlag) / sizeof (mTcpOutFlag[0])));
801 Flag = mTcpOutFlag[Tcb->State];
805 Seq = Tcb->Iss;
817 Nbuf = TcpGetSegment (Tcb, Seq, Len);
822 "TcpToSendData: failed to get a segment for TCB %p\n",
823 Tcb)
845 if ((TcpGetMaxSndNxt (Tcb) == Tcb->SndNxt) &&
846 (GET_SND_DATASIZE (Tcb->Sk) == 0) &&
847 TCP_SEQ_LT (End + 1, Tcb->SndWnd + Tcb->SndWl2)
851 "TcpToSendData: send FIN to peer for TCB %p in state %s\n",
852 Tcb,
853 mTcpStateName[Tcb->State])
867 ASSERT (TcpCheckSndQue (&Tcb->SndQue) != 0);
875 "TcpToSendData: created a empty segment for TCB %p, free it now\n",
876 Tcb)
883 if (TcpTransmitSegment (Tcb, Nbuf) != 0) {
888 TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT);
907 // Update the status in TCB.
909 Tcb->DelayedAck = 0;
912 TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT);
915 if (TCP_SEQ_GT (End, Tcb->SndNxt)) {
916 Tcb->SndNxt = End;
919 if (!TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT)) {
920 TcpSetTimer (Tcb, TCP_TIMER_REXMIT, Tcb->Rto);
927 if ((Tcb->CongestState == TCP_CONGEST_OPEN) && !TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_RTT_ON)) {
931 "TcpToSendData: set RTT measure sequence %d for TCB %p\n",
933 Tcb)
936 TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_RTT_ON);
937 Tcb->RttSeq = Seq;
938 Tcb->RttMeasure = 0;
941 } while (Len == Tcb->SndMss);
956 @param[in, out] Tcb Pointer to the TCP_CB of this TCP instance.
961 IN OUT TCP_CB *Tcb
976 Seg->Seq = Tcb->SndNxt;
977 Seg->End = Tcb->SndNxt;
980 if (TcpTransmitSegment (Tcb, Nbuf) == 0) {
981 TCP_CLEAR_FLG (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW);
982 Tcb->DelayedAck = 0;
991 @param[in, out] Tcb Pointer to the TCP_CB of this TCP instance.
999 IN OUT TCP_CB *Tcb
1019 Seg->Seq = Tcb->SndNxt - 1;
1020 Seg->End = Tcb->SndNxt - 1;
1023 Result = TcpTransmitSegment (Tcb, Nbuf);
1032 @param[in, out] Tcb Pointer to the TCP_CB of this TCP instance.
1037 IN OUT TCP_CB *Tcb
1048 if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW) || (Tcb->DelayedAck >= 1)) {
1049 TcpSendAck (Tcb);
1053 TcpNow = TcpRcvWinNow (Tcb);
1055 if (TcpNow > TcpRcvWinOld (Tcb)) {
1056 TcpSendAck (Tcb);
1062 "TcpToSendAck: scheduled a delayed ACK for TCB %p\n",
1063 Tcb)
1069 Tcb->DelayedAck++;
1075 @param[in] Tcb Pointer to the TCP_CB of this TCP instance. May be NULL.
1089 IN TCP_CB *Tcb,
1126 // Derive Seq/ACK from the segment if no TCB
1127 // is associated with it, otherwise derive from the Tcb.
1129 if (Tcb == NULL) {
1141 Nhead->Seq = HTONL (Tcb->SndNxt);
1142 Nhead->Ack = HTONL (Tcb->RcvNxt);
1162 TcpSendIpPacket (Tcb, Nbuf, Local, Remote, Version);