Home | History | Annotate | Download | only in Tcp4Dxe

Lines Matching refs:Tcb

35   @param  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
64 @param Tcb Pointer to the TCP_CB of this TCP instance.
71 IN TCP_CB *Tcb
79 Sk = Tcb->Sk;
82 OldWin = TcpRcvWinOld (Tcb);
96 if ((Increase > Tcb->SndMss) ||
109 @param Tcb Pointer to the TCP_CB of this TCP instance.
118 IN OUT TCP_CB *Tcb,
129 Wnd = GET_RCV_BUFFSIZE (Tcb->Sk);
132 Wnd = TcpRcvWinNow (Tcb);
134 Tcb->RcvWnd = Wnd;
137 Wnd = MIN (Wnd >> Tcb->RcvWndScale, 0xffff);
145 @param Tcb Pointer to the TCP_CB of this TCP instance.
152 IN TCP_CB *Tcb
158 if (IsListEmpty (&Tcb->SndQue)) {
159 return Tcb->SndNxt;
162 Entry = Tcb->SndQue.BackLink;
165 ASSERT (TCP_SEQ_GEQ (TCPSEG_NETBUF (Nbuf)->End, Tcb->SndNxt));
173 @param Tcb Pointer to the TCP_CB of this TCP instance.
182 IN TCP_CB *Tcb,
192 Sk = Tcb->Sk;
203 Limit = Tcb->SndWl2 + Tcb->SndWnd;
205 if (TCP_SEQ_GT (Limit, Tcb->SndUna + Tcb->CWnd)) {
207 Limit = Tcb->SndUna + Tcb->CWnd;
210 if (TCP_SEQ_GT (Limit, Tcb->SndNxt)) {
211 Win = TCP_SUB_SEQ (Limit, Tcb->SndNxt);
216 // socket send queue, and the data on the TCB's send
221 TCP_SUB_SEQ (TcpGetMaxSndNxt (Tcb), Tcb->SndNxt);
225 if (Len > Tcb->SndMss) {
226 Len = Tcb->SndMss;
245 if ((Len == Tcb->SndMss) || (2 * Len >= Tcb->SndWndMax)) {
251 ((Tcb->SndNxt == Tcb->SndUna) ||
252 TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_NO_NAGLE))) {
262 if (!TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT)) {
266 "TcpDataToSend: enter persistent state for TCB %p\n",
267 Tcb)
270 if (!Tcb->ProbeTimerOn) {
271 TcpSetProbeTimer (Tcb);
282 @param Tcb Pointer to the TCP_CB of this TCP instance.
291 IN OUT TCP_CB *Tcb,
310 Len = TcpSynBuildOption (Tcb, Nbuf);
313 Len = TcpBuildOption (Tcb, Nbuf);
330 Head->SrcPort = Tcb->LocalEnd.Port;
331 Head->DstPort = Tcb->RemoteEnd.Port;
333 Head->Ack = NTOHL (Tcb->RcvNxt);
336 Head->Wnd = TcpComputeWnd (Tcb, Syn);
345 if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_SND_PSH) &&
346 TCP_SEQ_BETWEEN (Seg->Seq, Tcb->SndPsh, Seg->End)) {
349 TCP_CLEAR_FLG (Tcb->CtrlFlag, TCP_CTRL_SND_PSH);
351 } else if ((Seg->End == Tcb->SndNxt) &&
352 (GET_SND_DATASIZE (Tcb->Sk) == 0)) {
363 if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_SND_URG) &&
364 TCP_SEQ_LEQ (Seg->Seq, Tcb->SndUp)) {
368 if (TCP_SEQ_LT (Tcb->SndUp, Seg->End)) {
370 Seg->Urg = (UINT16) TCP_SUB_SEQ (Tcb->SndUp, Seg->Seq);
374 TCP_SUB_SEQ (Tcb->SndUp,
383 Head->Checksum = TcpChecksum (Nbuf, Tcb->HeadSum);
388 Tcb->RcvWl2 = Tcb->RcvNxt;
390 Tcb->RcvWnd = NTOHS (Head->Wnd);
396 Tcb->DelayedAck = 0;
398 return TcpSendIpPacket (Tcb, Nbuf, Tcb->LocalEnd.Ip, Tcb->RemoteEnd.Ip);
403 Get a segment from the Tcb's SndQue.
405 @param Tcb Pointer to the TCP_CB of this TCP instance.
414 IN TCP_CB *Tcb,
430 ASSERT ((Tcb != NULL) && TCP_SEQ_LEQ (Seq, Tcb->SndNxt) && (Len > 0));
435 Head = &Tcb->SndQue;
549 Get a segment from the Tcb's socket buffer.
551 @param Tcb Pointer to the TCP_CB of this TCP instance.
560 IN TCP_CB *Tcb,
569 ASSERT ((Tcb != NULL) && (Tcb->Sk != NULL));
575 "a netbuf for TCB %p\n",Tcb));
591 DataGet = SockGetDataToSend (Tcb->Sk, 0, Len, Data);
599 InsertTailList (&(Tcb->SndQue), &(Nbuf->List));
603 SockDataSent (Tcb->Sk, DataGet);
614 @param Tcb Pointer to the TCP_CB of this TCP instance.
623 IN TCP_CB *Tcb,
630 ASSERT (Tcb != NULL);
635 if ((Len != 0) && TCP_SEQ_LT (Seq, TcpGetMaxSndNxt (Tcb))) {
637 Nbuf = TcpGetSegmentSndQue (Tcb, Seq, Len);
640 Nbuf = TcpGetSegmentSock (Tcb, Seq, Len);
651 @param Tcb Pointer to the TCP_CB of this TCP instance.
660 IN TCP_CB *Tcb,
674 if (TCP_SEQ_LT (Tcb->SndWl2 + Tcb->SndWnd, Seq)) {
676 "because send window too small for TCB %p\n", Tcb));
681 Len = TCP_SUB_SEQ (Tcb->SndWl2 + Tcb->SndWnd, Seq);
682 Len = MIN (Len, Tcb->SndMss);
684 Nbuf = TcpGetSegmentSndQue (Tcb, Seq, Len);
691 if (TcpTransmitSegment (Tcb, Nbuf) != 0) {
719 @param Tcb Pointer to the TCP_CB of this TCP instance.
728 IN OUT TCP_CB *Tcb,
740 ASSERT ((Tcb != NULL) && (TcbTcb->State != TCP_LISTEN));
744 if ((Tcb->State == TCP_CLOSED) ||
745 TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT)) {
754 Len = TcpDataToSend (Tcb, Force);
755 Seq = Tcb->SndNxt;
757 ASSERT ((Tcb->State) < (sizeof (mTcpOutFlag) / sizeof (mTcpOutFlag[0])));
758 Flag = mTcpOutFlag[Tcb->State];
762 Seq = Tcb->Iss;
775 Nbuf = TcpGetSegment (Tcb, Seq, Len);
780 "TcpToSendData: failed to get a segment for TCB %p\n",
781 Tcb)
803 if ((TcpGetMaxSndNxt (Tcb) == Tcb->SndNxt) &&
804 (GET_SND_DATASIZE (Tcb->Sk) == 0) &&
805 TCP_SEQ_LT (End + 1, Tcb->SndWnd + Tcb->SndWl2)) {
810 "to peer for TCB %p in state %s\n",
811 Tcb,
812 mTcpStateName[Tcb->State])
826 ASSERT (TcpCheckSndQue (&Tcb->SndQue) != 0);
833 " segment for TCB %p, free it now\n", Tcb));
839 if (TcpTransmitSegment (Tcb, Nbuf) != 0) {
844 TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT);
863 // update status in TCB
865 Tcb->DelayedAck = 0;
868 TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT);
871 if (TCP_SEQ_GT (End, Tcb->SndNxt)) {
872 Tcb->SndNxt = End;
875 if (!TCP_TIMER_ON (Tcb->EnabledTimer, TCP_TIMER_REXMIT)) {
876 TcpSetTimer (Tcb, TCP_TIMER_REXMIT, Tcb->Rto);
883 if ((Tcb->CongestState == TCP_CONGEST_OPEN) &&
884 !TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_RTT_ON)) {
887 "sequence %d for TCB %p\n", Seq, Tcb));
889 TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_RTT_ON);
890 Tcb->RttSeq = Seq;
891 Tcb->RttMeasure = 0;
894 if (Len == Tcb->SndMss) {
912 @param Tcb Pointer to the TCP_CB of this TCP instance.
917 IN OUT TCP_CB *Tcb
932 Seg->Seq = Tcb->SndNxt;
933 Seg->End = Tcb->SndNxt;
936 if (TcpTransmitSegment (Tcb, Nbuf) == 0) {
937 TCP_CLEAR_FLG (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW);
938 Tcb->DelayedAck = 0;
948 @param Tcb Pointer to the TCP_CB of this TCP instance.
956 IN OUT TCP_CB *Tcb
976 Seg->Seq = Tcb->SndNxt - 1;
977 Seg->End = Tcb->SndNxt - 1;
980 Result = TcpTransmitSegment (Tcb, Nbuf);
990 @param Tcb Pointer to the TCP_CB of this TCP instance.
995 IN OUT TCP_CB *Tcb
1000 TcpNow = TcpRcvWinNow (Tcb);
1007 if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW) ||
1008 (Tcb->DelayedAck >= 1) ||
1009 (TcpNow > TcpRcvWinOld (Tcb))) {
1010 TcpSendAck (Tcb);
1015 " ACK for TCB %p\n", Tcb));
1020 Tcb->DelayedAck++;
1027 @param Tcb Pointer to the TCP_CB of this TCP instance, may be NULL.
1039 IN TCP_CB *Tcb,
1075 // Derive Seq/ACK from the segment if no TCB
1076 // associated with it, otherwise from the Tcb
1078 if (Tcb == NULL) {
1090 Nhead->Seq = HTONL (Tcb->SndNxt);
1091 Nhead->Ack = HTONL (Tcb->RcvNxt);
1106 TcpSendIpPacket (Tcb, Nbuf, Local, Remote);