TianoCore EDK2 master
Loading...
Searching...
No Matches
TcpOutput.c File Reference
#include "TcpMain.h"

Go to the source code of this file.

Functions

UINT32 TcpRcvWinOld (IN TCP_CB *Tcb)
 
UINT32 TcpRcvWinNow (IN TCP_CB *Tcb)
 
UINT16 TcpComputeWnd (IN OUT TCP_CB *Tcb, IN BOOLEAN Syn)
 
TCP_SEQNO TcpGetMaxSndNxt (IN TCP_CB *Tcb)
 
UINT32 TcpDataToSend (IN TCP_CB *Tcb, IN INTN Force)
 
INTN TcpTransmitSegment (IN OUT TCP_CB *Tcb, IN NET_BUF *Nbuf)
 
NET_BUFTcpGetSegmentSndQue (IN TCP_CB *Tcb, IN TCP_SEQNO Seq, IN UINT32 Len)
 
NET_BUFTcpGetSegmentSock (IN TCP_CB *Tcb, IN TCP_SEQNO Seq, IN UINT32 Len)
 
NET_BUFTcpGetSegment (IN TCP_CB *Tcb, IN TCP_SEQNO Seq, IN UINT32 Len)
 
INTN TcpRetransmit (IN TCP_CB *Tcb, IN TCP_SEQNO Seq)
 
INTN TcpCheckSndQue (IN LIST_ENTRY *Head)
 
INTN TcpToSendData (IN OUT TCP_CB *Tcb, IN INTN Force)
 
VOID TcpSendAck (IN OUT TCP_CB *Tcb)
 
INTN TcpSendZeroProbe (IN OUT TCP_CB *Tcb)
 
VOID TcpToSendAck (IN OUT TCP_CB *Tcb)
 
INTN TcpSendReset (IN TCP_CB *Tcb, IN TCP_HEAD *Head, IN INT32 Len, IN EFI_IP_ADDRESS *Local, IN EFI_IP_ADDRESS *Remote, IN UINT8 Version)
 
INTN TcpVerifySegment (IN NET_BUF *Nbuf)
 

Variables

UINT8 mTcpOutFlag []
 

Detailed Description

TCP output process routines.

Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file TcpOutput.c.

Function Documentation

◆ TcpCheckSndQue()

INTN TcpCheckSndQue ( IN LIST_ENTRY Head)

Verify that all the segments in SndQue are in good shape.

Parameters
[in]HeadPointer to the head node of the SndQue.
Return values
0At least one segment is broken.
1All segments in the specific queue are in good shape.

Definition at line 725 of file TcpOutput.c.

◆ TcpComputeWnd()

UINT16 TcpComputeWnd ( IN OUT TCP_CB Tcb,
IN BOOLEAN  Syn 
)

Compute the value to fill in the window size field of the outgoing segment.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
[in]SynThe flag to indicate whether the outgoing segment is a SYN segment.
Returns
The value of the local receive window size used to fill the outgoing segment.

Definition at line 106 of file TcpOutput.c.

◆ TcpDataToSend()

UINT32 TcpDataToSend ( IN TCP_CB Tcb,
IN INTN  Force 
)

Compute how much data to send.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]ForceIf TRUE, to ignore the sender's SWS avoidance algorithm and send out data by force.
Returns
The length of the data can be sent. If 0, no data can be sent.

Definition at line 166 of file TcpOutput.c.

◆ TcpGetMaxSndNxt()

TCP_SEQNO TcpGetMaxSndNxt ( IN TCP_CB Tcb)

Get the maximum SndNxt.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
Returns
The sequence number of the maximum SndNxt.

Definition at line 137 of file TcpOutput.c.

◆ TcpGetSegment()

NET_BUF * TcpGetSegment ( IN TCP_CB Tcb,
IN TCP_SEQNO  Seq,
IN UINT32  Len 
)

Get a segment starting from sequence Seq of a maximum length of Len.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]SeqThe sequence number of the segment.
[in]LenThe maximum length of the segment.
Returns
Pointer to the segment. If NULL, some error occurred.

Definition at line 594 of file TcpOutput.c.

◆ TcpGetSegmentSndQue()

NET_BUF * TcpGetSegmentSndQue ( IN TCP_CB Tcb,
IN TCP_SEQNO  Seq,
IN UINT32  Len 
)

Get a segment from the Tcb's SndQue.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]SeqThe sequence number of the segment.
[in]LenThe maximum length of the segment.
Returns
Pointer to the segment. If NULL, some error occurred.

Definition at line 391 of file TcpOutput.c.

◆ TcpGetSegmentSock()

NET_BUF * TcpGetSegmentSock ( IN TCP_CB Tcb,
IN TCP_SEQNO  Seq,
IN UINT32  Len 
)

Get a segment from the Tcb's socket buffer.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]SeqThe sequence number of the segment.
[in]LenThe maximum length of the segment.
Returns
Pointer to the segment. If NULL, some error occurred.

Definition at line 530 of file TcpOutput.c.

◆ TcpRcvWinNow()

UINT32 TcpRcvWinNow ( IN TCP_CB Tcb)

Compute the current receive window.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
Returns
The size of the current receive window, in bytes.

Definition at line 62 of file TcpOutput.c.

◆ TcpRcvWinOld()

UINT32 TcpRcvWinOld ( IN TCP_CB Tcb)

Compute the sequence space left in the old receive window.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
Returns
The sequence space left in the old receive window.

Definition at line 35 of file TcpOutput.c.

◆ TcpRetransmit()

INTN TcpRetransmit ( IN TCP_CB Tcb,
IN TCP_SEQNO  Seq 
)

Retransmit the segment from sequence Seq.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]SeqThe sequence number of the segment to be retransmitted.
Return values
0Retransmission succeeded.
-1Error condition occurred.

Definition at line 632 of file TcpOutput.c.

◆ TcpSendAck()

VOID TcpSendAck ( IN OUT TCP_CB Tcb)

Send an ACK immediately.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.

Definition at line 967 of file TcpOutput.c.

◆ TcpSendReset()

INTN TcpSendReset ( IN TCP_CB Tcb,
IN TCP_HEAD Head,
IN INT32  Len,
IN EFI_IP_ADDRESS Local,
IN EFI_IP_ADDRESS Remote,
IN UINT8  Version 
)

Send a RESET segment in response to the segment received.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance. May be NULL.
[in]HeadTCP header of the segment that triggers the reset.
[in]LenLength of the segment that triggers the reset.
[in]LocalLocal IP address.
[in]RemoteRemote peer's IP address.
[in]VersionIP_VERSION_4 indicates TCP is running on IP4 stack, IP_VERSION_6 indicates TCP is running on IP6 stack.
Return values
0A reset was sent or there is no need to send it.
-1No reset is sent.

Definition at line 1095 of file TcpOutput.c.

◆ TcpSendZeroProbe()

INTN TcpSendZeroProbe ( IN OUT TCP_CB Tcb)

Send a zero probe segment. It can be used by keepalive and zero window probe.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
Return values
0The zero probe segment was sent out successfully.
otherAn error condition occurred.

Definition at line 1005 of file TcpOutput.c.

◆ TcpToSendAck()

VOID TcpToSendAck ( IN OUT TCP_CB Tcb)

Check whether to send an ACK or delayed ACK.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.

Definition at line 1043 of file TcpOutput.c.

◆ TcpToSendData()

INTN TcpToSendData ( IN OUT TCP_CB Tcb,
IN INTN  Force 
)

Check whether to send data/SYN/FIN and piggyback an ACK.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
[in]ForceIf TRUE, ignore the sender's SWS avoidance algorithm and send out data by force.
Returns
The number of bytes sent.

Definition at line 776 of file TcpOutput.c.

◆ TcpTransmitSegment()

INTN TcpTransmitSegment ( IN OUT TCP_CB Tcb,
IN NET_BUF Nbuf 
)

Build the TCP header of the TCP segment and transmit the segment by IP.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
[in]NbufPointer to the buffer containing the segment to be sent out.
Return values
0The segment was sent out successfully.
-1An error condition occurred.

Definition at line 271 of file TcpOutput.c.

◆ TcpVerifySegment()

INTN TcpVerifySegment ( IN NET_BUF Nbuf)

Verify that the segment is in good shape.

Parameters
[in]NbufThe buffer that contains the segment to be checked.
Return values
0The segment is broken.
1The segment is in good shape.

Definition at line 1184 of file TcpOutput.c.

Variable Documentation

◆ mTcpOutFlag

UINT8 mTcpOutFlag[]
Initial value:
= {
0,
0,
TCP_FLG_SYN,
TCP_FLG_SYN | TCP_FLG_ACK,
TCP_FLG_ACK,
TCP_FLG_FIN | TCP_FLG_ACK,
TCP_FLG_ACK,
TCP_FLG_ACK | TCP_FLG_FIN,
TCP_FLG_ACK,
TCP_FLG_ACK,
TCP_FLG_FIN | TCP_FLG_ACK
}
#define TCP_FLG_FIN
Definition: TcpProto.h:32

Definition at line 12 of file TcpOutput.c.