TianoCore EDK2 master
Loading...
Searching...
No Matches
TcpFunc.h File Reference
#include "TcpOption.h"

Go to the source code of this file.

Macros

#define TCP_COMP_VAL(Min, Max, Default, Val)    ((((Val) <= (Max)) && ((Val) >= (Min))) ? (Val) : (Default))
 

Typedefs

typedef VOID(* TCP_TIMER_HANDLER) (IN OUT TCP_CB *Tcb)
 

Functions

EFI_STATUS TcpInitTcbLocal (IN OUT TCP_CB *Tcb)
 
VOID TcpInitTcbPeer (IN OUT TCP_CB *Tcb, IN TCP_SEG *Seg, IN TCP_OPTION *Opt)
 
BOOLEAN TcpFindTcbByPeer (IN EFI_IP_ADDRESS *Addr, IN TCP_PORTNO Port, IN UINT8 Version)
 
TCP_CBTcpLocateTcb (IN TCP_PORTNO LocalPort, IN EFI_IP_ADDRESS *LocalIp, IN TCP_PORTNO RemotePort, IN EFI_IP_ADDRESS *RemoteIp, IN UINT8 Version, IN BOOLEAN Syn)
 
INTN TcpInsertTcb (IN TCP_CB *Tcb)
 
TCP_CBTcpCloneTcb (IN TCP_CB *Tcb)
 
UINT16 TcpGetRcvMss (IN SOCKET *Sock)
 
VOID TcpSetState (IN TCP_CB *Tcb, IN UINT8 State)
 
UINT16 TcpChecksum (IN NET_BUF *Nbuf, IN UINT16 HeadSum)
 
TCP_SEGTcpFormatNetbuf (IN TCP_CB *Tcb, IN OUT NET_BUF *Nbuf)
 
EFI_STATUS TcpOnAppConnect (IN OUT TCP_CB *Tcb)
 
VOID TcpOnAppConsume (IN TCP_CB *Tcb)
 
VOID TcpOnAppClose (IN OUT TCP_CB *Tcb)
 
INTN TcpOnAppSend (IN OUT TCP_CB *Tcb)
 
VOID TcpOnAppAbort (IN TCP_CB *Tcb)
 
VOID TcpResetConnection (IN TCP_CB *Tcb)
 
EFI_STATUS TcpInstallDevicePath (IN SOCKET *Sock)
 
UINT32 TcpRcvWinOld (IN TCP_CB *Tcb)
 
UINT32 TcpRcvWinNow (IN TCP_CB *Tcb)
 
TCP_SEQNO TcpGetMaxSndNxt (IN TCP_CB *Tcb)
 
UINT32 TcpDataToSend (IN TCP_CB *Tcb, IN INTN Force)
 
INTN TcpRetransmit (IN TCP_CB *Tcb, IN TCP_SEQNO Seq)
 
INTN TcpToSendData (IN OUT TCP_CB *Tcb, IN INTN Force)
 
VOID TcpToSendAck (IN OUT TCP_CB *Tcb)
 
VOID TcpSendAck (IN OUT TCP_CB *Tcb)
 
INTN TcpSendZeroProbe (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)
 
VOID TcpIcmpInput (IN NET_BUF *Nbuf, IN UINT8 IcmpErr, IN EFI_IP_ADDRESS *Src, IN EFI_IP_ADDRESS *Dst, IN UINT8 Version)
 
INTN TcpInput (IN NET_BUF *Nbuf, IN EFI_IP_ADDRESS *Src, IN EFI_IP_ADDRESS *Dst, IN UINT8 Version)
 
VOID TcpClose (IN OUT TCP_CB *Tcb)
 
VOID EFIAPI TcpTicking (IN EFI_EVENT Event, IN VOID *Context)
 
VOID TcpSetTimer (IN OUT TCP_CB *Tcb, IN UINT16 Timer, IN UINT32 TimeOut)
 
VOID TcpClearTimer (IN OUT TCP_CB *Tcb, IN UINT16 Timer)
 
VOID TcpClearAllTimer (IN OUT TCP_CB *Tcb)
 
VOID TcpSetProbeTimer (IN OUT TCP_CB *Tcb)
 
VOID TcpSetKeepaliveTimer (IN OUT TCP_CB *Tcb)
 
VOID EFIAPI TcpRxCallback (IN EFI_STATUS Status, IN UINT8 IcmpErr, IN EFI_NET_SESSION_DATA *NetSession, IN NET_BUF *Pkt, IN VOID *Context OPTIONAL)
 
INTN TcpSendIpPacket (IN TCP_CB *Tcb, IN NET_BUF *Nbuf, IN EFI_IP_ADDRESS *Src, IN EFI_IP_ADDRESS *Dest, IN UINT8 Version)
 
EFI_STATUS Tcp6RefreshNeighbor (IN TCP_CB *Tcb, IN EFI_IP_ADDRESS *Neighbor, IN UINT32 Timeout)
 
EFI_STATUS TcpDispatcher (IN SOCKET *Sock, IN UINT8 Request, IN VOID *Data OPTIONAL)
 

Detailed Description

Declaration of external functions shared in TCP driver.

Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file TcpFunc.h.

Macro Definition Documentation

◆ TCP_COMP_VAL

#define TCP_COMP_VAL (   Min,
  Max,
  Default,
  Val 
)     ((((Val) <= (Max)) && ((Val) >= (Min))) ? (Val) : (Default))

Definition at line 15 of file TcpFunc.h.

Typedef Documentation

◆ TCP_TIMER_HANDLER

typedef VOID(* TCP_TIMER_HANDLER) (IN OUT TCP_CB *Tcb)

Timeout handler prototype.

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

Definition at line 25 of file TcpFunc.h.

Function Documentation

◆ Tcp6RefreshNeighbor()

EFI_STATUS Tcp6RefreshNeighbor ( IN TCP_CB Tcb,
IN EFI_IP_ADDRESS Neighbor,
IN UINT32  Timeout 
)

Refresh the remote peer's Neighbor Cache State if already exists.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]NeighborSource address of the TCP segment.
[in]TimeoutTime in 100-ns units that this entry will remain in the neighbor cache. A value of zero means that the entry is permanent. A value of non-zero means that the entry is dynamic and will be deleted after Timeout.
Return values
EFI_SUCCESSSuccessfully updated the neighbor relationship.
EFI_NOT_STARTEDThe IpIo is not configured.
EFI_INVALID_PARAMETERAny input parameter is invalid.
EFI_OUT_OF_RESOURCESFailed to allocate some resources.
EFI_NOT_FOUNDThis entry is not in the neighbor table.

Definition at line 157 of file TcpIo.c.

◆ TcpChecksum()

UINT16 TcpChecksum ( IN NET_BUF Nbuf,
IN UINT16  HeadSum 
)

Compute the TCP segment's checksum.

Parameters
[in]NbufPointer to the buffer that contains the TCP segment.
[in]HeadSumThe checksum value of the fixed part of pseudo header.
Returns
The checksum value.

Definition at line 854 of file TcpMisc.c.

◆ TcpClearAllTimer()

VOID TcpClearAllTimer ( IN OUT TCP_CB Tcb)

Clear all TCP timers.

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

Definition at line 400 of file TcpTimer.c.

◆ TcpClearTimer()

VOID TcpClearTimer ( IN OUT TCP_CB Tcb,
IN UINT16  Timer 
)

Clear one TCP timer.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
[in]TimerThe index of the timer to be cleared.

Definition at line 384 of file TcpTimer.c.

◆ TcpCloneTcb()

TCP_CB * TcpCloneTcb ( IN TCP_CB Tcb)

Clone a TCP_CB from Tcb.

Parameters
[in]TcbPointer to the TCP_CB to be cloned.
Returns
Pointer to the new cloned TCP_CB. If NULL, an error condition occurred.

Clone a TCP_CB from Tcb.

Parameters
[in]TcbPointer to the TCP_CB to be cloned.
Returns
Pointer to the new cloned TCP_CB; if NULL, error condition occurred.

Definition at line 534 of file TcpMisc.c.

◆ TcpClose()

VOID TcpClose ( IN OUT TCP_CB Tcb)

Close the TCP connection.

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

Definition at line 96 of file TcpTimer.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, ignore the sender's SWS avoidance algorithm and send out data by force.
Returns
The length of the data that can be sent. If 0, no data can be sent.

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.

◆ TcpDispatcher()

EFI_STATUS TcpDispatcher ( IN SOCKET Sock,
IN UINT8  Request,
IN VOID *Data  OPTIONAL 
)

The protocol handler provided to the socket layer, used to dispatch the socket level requests by calling the corresponding TCP layer functions.

Parameters
[in]SockPointer to the socket of this TCP instance.
[in]RequestThe code of this operation request.
[in]DataPointer to the operation specific data passed in together with the operation request. This is an optional parameter that may be NULL.
Return values
EFI_SUCCESSThe socket request completed successfully.
otherThe error status returned by the corresponding TCP layer function.

The protocol handler provided to the socket layer, which is used to dispatch the socket level requests by calling the corresponding TCP layer functions.

Parameters
[in]SockPointer to the socket of this TCP instance.
[in]RequestThe code of this operation request.
[in]DataPointer to the operation specific data passed in together with the operation request. This is an optional parameter that may be NULL.
Return values
EFI_SUCCESSThe socket request completed successfully.
otherThe error status returned by the corresponding TCP layer function.

Definition at line 764 of file TcpDispatcher.c.

◆ TcpFindTcbByPeer()

BOOLEAN TcpFindTcbByPeer ( IN EFI_IP_ADDRESS Addr,
IN TCP_PORTNO  Port,
IN UINT8  Version 
)

Try to find one Tcb whose <Ip, Port> equals to <IN Addr, IN Port>.

Parameters
[in]AddrPointer to the IP address needs to match.
[in]PortThe port number needs to match.
[in]VersionIP_VERSION_4 indicates TCP is running on IP4 stack. IP_VERSION_6 indicates TCP is running on IP6 stack.
Return values
TRUEThe Tcb which matches the <Addr Port> pairs exists.
FALSEOtherwise

Try to find one Tcb whose <Ip, Port> equals to <IN Addr, IN Port>.

Parameters
[in]AddrPointer to the IP address needs to match.
[in]PortThe port number needs to match.
[in]VersionIP_VERSION_4 indicates TCP is running on IP4 stack, IP_VERSION_6 indicates TCP is running on IP6 stack.
Return values
TRUEThe Tcb which matches the <Addr Port> pair exists.
FALSEOtherwise

Definition at line 364 of file TcpMisc.c.

◆ TcpFormatNetbuf()

TCP_SEG * TcpFormatNetbuf ( IN TCP_CB Tcb,
IN OUT NET_BUF Nbuf 
)

Translate the information from the head of the received TCP segment Nbuf contains, and fill it into a TCP_SEG structure.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in,out]NbufPointer to the buffer contains the TCP segment.
Returns
Pointer to the TCP_SEG that contains the translated TCP head information.

Translate the information from the head of the received TCP segment Nbuf contents and fill it into a TCP_SEG structure.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in,out]NbufPointer to the buffer contains the TCP segment.
Returns
Pointer to the TCP_SEG that contains the translated TCP head information.

Definition at line 883 of file TcpMisc.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.

◆ TcpGetRcvMss()

UINT16 TcpGetRcvMss ( IN SOCKET Sock)

Get the local mss.

Parameters
[in]SockPointer to the socket to get mss.
Returns
The mss size.

Definition at line 737 of file TcpMisc.c.

◆ TcpIcmpInput()

VOID TcpIcmpInput ( IN NET_BUF Nbuf,
IN UINT8  IcmpErr,
IN EFI_IP_ADDRESS Src,
IN EFI_IP_ADDRESS Dst,
IN UINT8  Version 
)

Process the received ICMP error messages for TCP.

Parameters
[in]NbufBuffer that contains part of the TCP segment without IP header truncated from the ICMP error packet.
[in]IcmpErrThe ICMP error code interpreted from an ICMP error packet.
[in]SrcSource address of the ICMP error message.
[in]DstDestination address of the ICMP error message.
[in]VersionIP_VERSION_4 indicates IP4 stack, IP_VERSION_6 indicates IP6 stack.

Process the received ICMP error messages for TCP.

Parameters
[in]NbufThe buffer that contains part of the TCP segment without an IP header truncated from the ICMP error packet.
[in]IcmpErrThe ICMP error code interpreted from an ICMP error packet.
[in]SrcSource address of the ICMP error message.
[in]DstDestination address of the ICMP error message.
[in]VersionIP_VERSION_4 indicates IP4 stack. IP_VERSION_6 indicates IP6 stack.

Definition at line 1569 of file TcpInput.c.

◆ TcpInitTcbLocal()

EFI_STATUS TcpInitTcbLocal ( IN OUT TCP_CB Tcb)

Initialize the Tcb locally related members.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
Return values
EFI_SUCCESSThe operation completed successfully
othersThe underlying functions failed and could not complete the operation

Initialize the Tcb local related members.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
Return values
EFI_SUCCESSThe operation completed successfully
othersThe underlying functions failed and could not complete the operation

Definition at line 76 of file TcpMisc.c.

◆ TcpInitTcbPeer()

VOID TcpInitTcbPeer ( IN OUT TCP_CB Tcb,
IN TCP_SEG Seg,
IN TCP_OPTION Opt 
)

Initialize the peer related members.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
[in]SegPointer to the segment that contains the peer's initial information.
[in]OptPointer to the options announced by the peer.

Initialize the peer related members.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
[in]SegPointer to the segment that contains the peer's initial info.
[in]OptPointer to the options announced by the peer.

Definition at line 157 of file TcpMisc.c.

◆ TcpInput()

INTN TcpInput ( IN NET_BUF Nbuf,
IN EFI_IP_ADDRESS Src,
IN EFI_IP_ADDRESS Dst,
IN UINT8  Version 
)

Process the received TCP segments.

Parameters
[in]NbufBuffer that contains received TCP segment without an IP header.
[in]SrcSource address of the segment, or the peer's IP address.
[in]DstDestination address of the segment, or the local end's IP address.
[in]VersionIP_VERSION_4 indicates IP4 stack, IP_VERSION_6 indicates IP6 stack.
Return values
0The segment processed successfully. It is either accepted or discarded. But no connection is reset by the segment.
-1A connection is reset by the segment.

Process the received TCP segments.

Parameters
[in]NbufBuffer that contains received a TCP segment without an IP header.
[in]SrcSource address of the segment, or the peer's IP address.
[in]DstDestination address of the segment, or the local end's IP address.
[in]VersionIP_VERSION_4 indicates IP4 stack. IP_VERSION_6 indicates IP6 stack.
Return values
0Segment processed successfully. It is either accepted or discarded. However, no connection is reset by the segment.
-1A connection is reset by the segment.

Definition at line 710 of file TcpInput.c.

◆ TcpInsertTcb()

INTN TcpInsertTcb ( IN TCP_CB Tcb)

Insert a Tcb into the proper queue.

Parameters
[in]TcbPointer to the TCP_CB to be inserted.
Return values
0The Tcb was inserted successfully.
-1An error condition occurred.

Insert a Tcb into the proper queue.

Parameters
[in]TcbPointer to the TCP_CB to be inserted.
Return values
0The Tcb was inserted successfully.
-1Error condition occurred.

Definition at line 478 of file TcpMisc.c.

◆ TcpInstallDevicePath()

EFI_STATUS TcpInstallDevicePath ( IN SOCKET Sock)

Install the device path protocol on the TCP instance.

Parameters
[in]SockPointer to the socket representing the TCP instance.
Return values
EFI_SUCCESSThe device path protocol installed.
otherFailed to install the device path protocol.

Install the device path protocol on the TCP instance.

Parameters
[in]SockPointer to the socket representing the TCP instance.
Return values
EFI_SUCCESSThe device path protocol was installed.
otherFailed to install the device path protocol.

Definition at line 1180 of file TcpMisc.c.

◆ TcpLocateTcb()

TCP_CB * TcpLocateTcb ( IN TCP_PORTNO  LocalPort,
IN EFI_IP_ADDRESS LocalIp,
IN TCP_PORTNO  RemotePort,
IN EFI_IP_ADDRESS RemoteIp,
IN UINT8  Version,
IN BOOLEAN  Syn 
)

Locate the TCP_CB related to the socket pair.

Parameters
[in]LocalPortThe local port number.
[in]LocalIpThe local IP address.
[in]RemotePortThe remote port number.
[in]RemoteIpThe remote IP address.
[in]VersionIP_VERSION_4 indicates TCP is running on IP4 stack, IP_VERSION_6 indicates TCP is running on IP6 stack.
[in]SynIf TRUE, the listen sockets are searched.
Returns
Pointer to the related TCP_CB. If NULL, no match is found.

Definition at line 420 of file TcpMisc.c.

◆ TcpOnAppAbort()

VOID TcpOnAppAbort ( IN TCP_CB Tcb)

Abort the connection by sending a reset segment: called when the application wants to abort the connection.

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

Abort the connection by sending a reset segment. Called when the application wants to abort the connection.

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

Definition at line 1098 of file TcpMisc.c.

◆ TcpOnAppClose()

VOID TcpOnAppClose ( IN OUT TCP_CB Tcb)

Initiate the connection close procedure, called when applications want to close the connection.

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

Definition at line 961 of file TcpMisc.c.

◆ TcpOnAppConnect()

EFI_STATUS TcpOnAppConnect ( IN OUT TCP_CB Tcb)

Initialize an active connection,

Parameters
[in,out]TcbPointer to the TCP_CB that wants to initiate a connection.
Return values
EFI_SUCCESSThe operation completed successfully
othersThe underlying functions failed and could not complete the operation

Initialize an active connection.

Parameters
[in,out]TcbPointer to the TCP_CB that wants to initiate a connection.
Return values
EFI_SUCCESSThe operation completed successfully
othersThe underlying functions failed and could not complete the operation

Definition at line 934 of file TcpMisc.c.

◆ TcpOnAppConsume()

VOID TcpOnAppConsume ( IN TCP_CB Tcb)

Application has consumed some data, check whether to send a window update ack or a delayed ack.

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

Application has consumed some data. Check whether to send a window update ack or a delayed ack.

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

Definition at line 1054 of file TcpMisc.c.

◆ TcpOnAppSend()

INTN TcpOnAppSend ( IN OUT TCP_CB Tcb)

Check whether the application's newly delivered data can be sent out.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
Return values
0The data has been sent out successfully.
-1The Tcb is not in a state that data is permitted to be sent out.

Definition at line 1012 of file TcpMisc.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.

◆ TcpResetConnection()

VOID TcpResetConnection ( IN TCP_CB Tcb)

Reset the connection related with Tcb.

Parameters
[in]TcbPointer to the TCP_CB of the connection to be reset.

Definition at line 1130 of file TcpMisc.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
0The retransmission succeeded.
-1An error condition occurred.

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.

◆ TcpRxCallback()

VOID EFIAPI TcpRxCallback ( IN EFI_STATUS  Status,
IN UINT8  IcmpErr,
IN EFI_NET_SESSION_DATA NetSession,
IN NET_BUF Pkt,
IN VOID *Context  OPTIONAL 
)

Packet receive callback function provided to IP_IO. Used to call the proper function to handle the packet received by IP.

Parameters
[in]StatusResult of the receive request.
[in]IcmpErrValid when Status is EFI_ICMP_ERROR.
[in]NetSessionThe IP session for the received packet.
[in]PktPacket received.
[in]ContextThe data provided by the user for the received packet when the callback is registered in IP_IO_OPEN_DATA::RcvdContext. This is an optional parameter that may be NULL.

Packet receive callback function provided to IP_IO, used to call the proper function to handle the packet received by IP.

Parameters
[in]StatusResult of the receive request.
[in]IcmpErrValid when Status is EFI_ICMP_ERROR.
[in]NetSessionThe IP session for the received packet.
[in]PktPacket received.
[in]ContextThe data provided by the user for the received packet when the callback is registered in IP_IO_OPEN_DATA::RcvdContext. This is an optional parameter that may be NULL.

Definition at line 27 of file TcpIo.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.

◆ TcpSendIpPacket()

INTN TcpSendIpPacket ( IN TCP_CB Tcb,
IN NET_BUF Nbuf,
IN EFI_IP_ADDRESS Src,
IN EFI_IP_ADDRESS Dest,
IN UINT8  Version 
)

Send the segment to IP via IpIo function.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]NbufPointer to the TCP segment to be sent.
[in]SrcSource address of the TCP segment.
[in]DestDestination address of the TCP segment.
[in]VersionIP_VERSION_4 or IP_VERSION_6
Return values
0The segment was sent out successfully.
-1The segment failed to be sent.

Send the segment to IP via IpIo function.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]NbufPointer to the TCP segment to be sent.
[in]SrcSource address of the TCP segment.
[in]DestDestination address of the TCP segment.
[in]VersionIP_VERSION_4 or IP_VERSION_6
Return values
0The segment was sent out successfully.
-1The segment failed to send.

Definition at line 62 of file TcpIo.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 is sent or no need to send it.
-1No reset is sent.

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.

◆ TcpSetKeepaliveTimer()

VOID TcpSetKeepaliveTimer ( IN OUT TCP_CB Tcb)

Enable the keepalive timer and set the timeout value.

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

Definition at line 442 of file TcpTimer.c.

◆ TcpSetProbeTimer()

VOID TcpSetProbeTimer ( IN OUT TCP_CB Tcb)

Enable the window prober timer and set the timeout value.

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

Definition at line 415 of file TcpTimer.c.

◆ TcpSetState()

VOID TcpSetState ( IN TCP_CB Tcb,
IN UINT8  State 
)

Set the Tcb's state.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]StateThe state to be set.

Definition at line 801 of file TcpMisc.c.

◆ TcpSetTimer()

VOID TcpSetTimer ( IN OUT TCP_CB Tcb,
IN UINT16  Timer,
IN UINT32  TimeOut 
)

Enable a TCP timer.

Parameters
[in,out]TcbPointer to the TCP_CB of this TCP instance.
[in]TimerThe index of the timer to be enabled.
[in]TimeOutThe timeout value of this timer.

Definition at line 364 of file TcpTimer.c.

◆ TcpTicking()

VOID EFIAPI TcpTicking ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Heart beat timer handler, queues the DPC at TPL_CALLBACK.

Parameters
[in]EventTimer event signaled, ignored.
[in]ContextContext of the timer event, ignored.

Definition at line 563 of file TcpTimer.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.

◆ TcpVerifySegment()

INTN TcpVerifySegment ( IN NET_BUF Nbuf)

Verify that the segment is in good shape.

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

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.