NetworkPkg/TcpDxe/TcpFunc.h File Reference


Defines

#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

VOID 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)
TCP_SEQNO TcpGetIss (VOID)
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)
VOID 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)
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)

Detailed Description

Declaration of external functions shared in TCP driver.

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

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Define Documentation

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

Referenced by TcpConfigurePcb().


Typedef Documentation

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

Timeout handler prototype.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.


Function Documentation

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] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Neighbor Source address of the TCP segment.
[in] Timeout Time 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_SUCCESS Successfully updated the neighbor relationship.
EFI_NOT_STARTED The IpIo is not configured.
EFI_INVALID_PARAMETER Any input parameter is invalid.
EFI_OUT_OF_RESOURCES Failed to allocate some resources.
EFI_NOT_FOUND This entry is not in the neighbor table.
Refresh the remote peer's Neighbor Cache State if already exists.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Neighbor Source address of the TCP segment.
[in] Timeout Time 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_SUCCESS Successfully updated the neighbor relationship.
EFI_NOT_STARTED The IpIo is not configured.
EFI_INVALID_PARAMETER Any input parameter is invalid.
EFI_OUT_OF_RESOURCES Failed to allocate some resources.
EFI_NOT_FOUND This entry is not in the neighbor table.

References _TCP_SERVICE_DATA::IpIo, _TCP_SOCKET::ProtoReserved, and _TCP_PROTO_DATA::TcpService.

Referenced by TcpInput().

UINT16 TcpChecksum ( IN NET_BUF *  Nbuf,
IN UINT16  HeadSum 
)

Compute the TCP segment's checksum.

Parameters:
[in] Nbuf Pointer to the buffer that contains the TCP segment.
[in] HeadSum The checksum value of the fixed part of pseudo header.
Returns:
The checksum value.

Referenced by TcpInput(), TcpResetConnection(), TcpSendReset(), and TcpTransmitSegment().

VOID TcpClearAllTimer ( IN OUT TCP_CB Tcb  ) 

Clear all TCP timers.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.

References TcpUpdateTimer().

Referenced by TcpDeliverData(), and TcpInput().

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

Clear one TCP timer.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Timer The index of the timer to be cleared.

References TCP_CLEAR_TIMER, and TcpUpdateTimer().

Referenced by TcpInput().

TCP_CB* TcpCloneTcb ( IN TCP_CB Tcb  ) 

Clone a TCP_CB from Tcb.

Parameters:
[in] Tcb Pointer 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] Tcb Pointer to the TCP_CB to be cloned.
Returns:
Pointer to the new cloned TCP_CB; if NULL, error condition occurred.

References _TCP_CONTROL_BLOCK::List, _TCP_SOCKET::ProtoReserved, _TCP_CONTROL_BLOCK::RcvQue, _TCP_CONTROL_BLOCK::Sk, _TCP_CONTROL_BLOCK::SndQue, and SockClone().

Referenced by TcpInput().

VOID TcpClose ( IN OUT TCP_CB Tcb  ) 

Close the TCP connection.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.

References TCP_CLOSED, and TcpSetState().

Referenced by Tcp2MSLTimeout(), TcpConnectTimeout(), TcpDeliverData(), TcpFinwait2Timeout(), TcpIcmpInput(), TcpInput(), TcpKeepaliveTimeout(), TcpOnAppClose(), and TcpRexmitTimeout().

UINT32 TcpDataToSend ( IN TCP_CB Tcb,
IN INTN  Force 
)

Compute how much data to send.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Force If 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] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Force If 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.

References GET_SND_DATASIZE, TCP_CTRL_NO_NAGLE, TCP_FLG_ON, TCP_SEQ_GT, TCP_SUB_SEQ, TCP_TIMER_ON, TCP_TIMER_REXMIT, TcpGetMaxSndNxt(), and TcpSetProbeTimer().

Referenced by TcpProbeTimeout(), and TcpToSendData().

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

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

Parameters:
[in] Sock Pointer to the socket of this TCP instance.
[in] Request The code of this operation request.
[in] Data Pointer to the operation specific data passed in together with the operation request. This is an optional parameter that may be NULL.
Return values:
EFI_SUCCESS The socket request completed successfully.
other The error status returned by the corresponding TCP layer function.
The procotol handler provided to the socket layer, which is used to dispatch the socket level requests by calling the corresponding TCP layer functions.

Parameters:
[in] Sock Pointer to the socket of this TCP instance.
[in] Request The code of this operation request.
[in] Data Pointer to the operation specific data passed in together with the operation request. This is an optional parameter that may be NULL.
Return values:
EFI_SUCCESS The socket request completed successfully.
other The error status returned by the corresponding TCP layer function.

References _TCP_CONTROL_BLOCK::CtrlFlag, GET_SND_DATASIZE, _TCP_SERVICE_DATA::IpIo, _TCP_SOCKET::IpVersion, _TCP_CONTROL_BLOCK::Sk, _TCP_CONTROL_BLOCK::SndPsh, _TCP_CONTROL_BLOCK::SndUp, SOCK_ABORT, SOCK_ATTACH, SOCK_CLOSE, SOCK_CONFIGURE, SOCK_CONNECT, SOCK_CONSUMED, SOCK_DETACH, SOCK_FLUSH, SOCK_MODE, SOCK_POLL, SOCK_ROUTE, SOCK_SND, SOCK_SNDPUSH, SOCK_SNDURG, Tcp4GetMode(), Tcp4Route(), Tcp6GetMode(), TCP_CTRL_SND_PSH, TCP_CTRL_SND_URG, TCP_SET_FLG, TcpAttachPcb(), TcpConfigurePcb(), TcpDetachPcb(), TcpFlushPcb(), TcpGetMaxSndNxt(), TcpOnAppAbort(), TcpOnAppClose(), TcpOnAppConnect(), TcpOnAppConsume(), TcpOnAppSend(), _TCP_PROTO_DATA::TcpPcb, and _TCP_PROTO_DATA::TcpService.

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] Addr Pointer to the IP address needs to match.
[in] Port The port number needs to match.
[in] Version IP_VERSION_4 indicates TCP is running on IP4 stack. IP_VERSION_6 indicates TCP is running on IP6 stack.
Return values:
TRUE The Tcb which matches the <Addr port>=""> pairs exists.
FALSE Otherwise
Try to find one Tcb whose <Ip, Port> equals to <IN Addr, IN Port>.

Parameters:
[in] Addr Pointer to the IP address needs to match.
[in] Port The port number needs to match.
[in] Version IP_VERSION_4 indicates TCP is running on IP4 stack, IP_VERSION_6 indicates TCP is running on IP6 stack.
Return values:
TRUE The Tcb which matches the <Addr port>=""> pair exists.
FALSE Otherwise

References _TCP_PEER::Ip, _TCP_SOCKET::IpVersion, _TCP_CONTROL_BLOCK::LocalEnd, mTcpListenQue, mTcpRunQue, _TCP_PEER::Port, _TCP_CONTROL_BLOCK::Sk, and TcpIsIpEqual().

Referenced by TcpBind().

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] Tcb Pointer to the TCP_CB of this TCP instance.
[in,out] Nbuf Pointer 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] Tcb Pointer to the TCP_CB of this TCP instance.
[in,out] Nbuf Pointer to the buffer contains the TCP segment.
Returns:
Pointer to the TCP_SEG that contains the translated TCP head information.

References _TCP_SEG::Ack, _TCP_SEG::End, _TCP_SEG::Flag, _TCP_SEG::Seq, TCP_FLG_FIN, TCP_FLG_ON, TCP_FLG_SYN, TCPSEG_NETBUF, _TCP_SEG::Urg, and _TCP_SEG::Wnd.

Referenced by TcpInput().

TCP_SEQNO TcpGetIss ( VOID   ) 

Compute an ISS to be used by a new connection.

Returns:
The result ISS.
Compute an ISS to be used by a new connection.

Returns:
The resulting ISS.

References mTcpGlobalIss, and TCP_ISS_INCREMENT_1.

Referenced by TcpInitTcbLocal().

TCP_SEQNO TcpGetMaxSndNxt ( IN TCP_CB Tcb  ) 

Get the maximum SndNxt.

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

References TCP_SEQ_GEQ, and TCPSEG_NETBUF.

Referenced by TcpDataToSend(), TcpDispatcher(), TcpGetSegment(), and TcpToSendData().

UINT16 TcpGetRcvMss ( IN SOCKET Sock  ) 

Get the local mss.

Parameters:
[in] Sock Pointer to the socket to get mss.
Returns:
The mss size.

References _TCP_SERVICE_DATA::IpIo, and _TCP_PROTO_DATA::TcpService.

Referenced by TcpConfigurePcb(), and TcpInitTcbPeer().

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] Nbuf Buffer that contains part of the TCP segment without IP header truncated from the ICMP error packet.
[in] IcmpErr The ICMP error code interpreted from an ICMP error packet.
[in] Src Source address of the ICMP error message.
[in] Dst Destination address of the ICMP error message.
[in] Version IP_VERSION_4 indicates IP4 stack, IP_VERSION_6 indicates IP6 stack.
Process the received ICMP error messages for TCP.

Parameters:
[in] Nbuf The buffer that contains part of the TCP segment without an IP header truncated from the ICMP error packet.
[in] IcmpErr The ICMP error code interpreted from an ICMP error packet.
[in] Src Source address of the ICMP error message.
[in] Dst Destination address of the ICMP error message.
[in] Version IP_VERSION_4 indicates IP4 stack. IP_VERSION_6 indicates IP6 stack.

References _TCP_SOCKET::IpVersion, _TCP_CONTROL_BLOCK::Sk, _TCP_CONTROL_BLOCK::SndNxt, _TCP_CONTROL_BLOCK::SndUna, SOCK_ERROR, _TCP_CONTROL_BLOCK::State, TCP_CLOSED, TCP_SEQ_LEQ, TCP_SEQ_LT, TcpClose(), and TcpLocateTcb().

Referenced by TcpRxCallback().

VOID TcpInitTcbLocal ( IN OUT TCP_CB Tcb  ) 

Initialize the Tcb locally related members.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.
Initialize the Tcb local related members.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.

References GET_RCV_BUFFSIZE, and TcpGetIss().

Referenced by TcpInput(), and TcpOnAppConnect().

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

Initialize the peer related members.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Seg Pointer to the segment that contains the peer's intial information.
[in] Opt Pointer to the options announced by the peer.
Initialize the peer related members.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Seg Pointer to the segment that contains the peer's intial info.
[in] Opt Pointer to the options announced by the peer.

References TCP_CTRL_NO_TS, TCP_CTRL_NO_WS, TCP_CTRL_RCVD_TS, TCP_CTRL_RCVD_WS, TCP_CTRL_SND_TS, TCP_FLG_ACK, TCP_FLG_ON, TCP_FLG_SYN, TCP_OPTION_RCVD_MSS, TCP_OPTION_RCVD_TS, TCP_OPTION_RCVD_WS, TCP_OPTION_TS_ALIGNED_LEN, TCP_SET_FLG, TcpComputeScale(), and TcpGetRcvMss().

Referenced by 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] Nbuf Buffer that contains received TCP segment without an IP header.
[in] Src Source address of the segment, or the peer's IP address.
[in] Dst Destination address of the segment, or the local end's IP address.
[in] Version IP_VERSION_4 indicates IP4 stack, IP_VERSION_6 indicates IP6 stack.
Return values:
0 The segment processed successfully. It is either accepted or discarded. But no connection is reset by the segment.
-1 A connection is reset by the segment.
Process the received TCP segments.

Parameters:
[in] Nbuf Buffer that contains received a TCP segment without an IP header.
[in] Src Source address of the segment, or the peer's IP address.
[in] Dst Destination address of the segment, or the local end's IP address.
[in] Version IP_VERSION_4 indicates IP4 stack. IP_VERSION_6 indicates IP6 stack.
Return values:
0 Segment processed successfully. It is either accepted or discarded. However, no connection is reset by the segment.
-1 A connection is reset by the segment.

References _TCP_SEG::Ack, _TCP_CONTROL_BLOCK::CongestState, _TCP_CONTROL_BLOCK::ConnectTimeout, _TCP_CONTROL_BLOCK::CtrlFlag, _TCP_CONTROL_BLOCK::CWnd, _TCP_CONTROL_BLOCK::DupAck, _TCP_SEG::End, _TCP_CONTROL_BLOCK::FinWait2Timeout, _TCP_OPTION::Flag, _TCP_SEG::Flag, _TCP_CONTROL_BLOCK::Idle, _TCP_PEER::Ip, _TCP_CONTROL_BLOCK::IpInfo, _TCP_CONTROL_BLOCK::Iss, _TCP_CONTROL_BLOCK::LocalEnd, _TCP_CONTROL_BLOCK::LossRecover, mTcpTick, _TCP_CONTROL_BLOCK::Parent, _TCP_PEER::Port, _TCP_CONTROL_BLOCK::ProbeTimerOn, _TCP_CONTROL_BLOCK::RcvQue, _TCP_CONTROL_BLOCK::RcvUp, _TCP_CONTROL_BLOCK::RcvWl2, _TCP_CONTROL_BLOCK::Recover, _TCP_CONTROL_BLOCK::RemoteEnd, _TCP_CONTROL_BLOCK::Rto, _TCP_CONTROL_BLOCK::RttMeasure, _TCP_SEG::Seq, _TCP_CONTROL_BLOCK::Sk, _TCP_CONTROL_BLOCK::SndMss, _TCP_CONTROL_BLOCK::SndNxt, _TCP_CONTROL_BLOCK::SndUna, _TCP_CONTROL_BLOCK::SndUp, _TCP_CONTROL_BLOCK::SndWl1, _TCP_CONTROL_BLOCK::SndWl2, _TCP_CONTROL_BLOCK::SndWnd, _TCP_CONTROL_BLOCK::SndWndMax, _TCP_CONTROL_BLOCK::SndWndScale, SOCK_ERROR, _TCP_CONTROL_BLOCK::Ssthresh, _TCP_CONTROL_BLOCK::State, TCP6_KEEP_NEIGHBOR_TIME, TCP6_REFRESH_NEIGHBOR_TICK, Tcp6RefreshNeighbor(), TCP_CLEAR_FLG, TCP_CLOSE_WAIT, TCP_CLOSED, TCP_CLOSING, TCP_CONGEST_LOSS, TCP_CONGEST_OPEN, TCP_CONGEST_RECOVER, TCP_CTRL_ACK_NOW, TCP_CTRL_FIN_ACKED, TCP_CTRL_FIN_SENT, TCP_CTRL_RCVD_URG, TCP_CTRL_RTT_ON, TCP_CTRL_SND_URG, TCP_ESTABLISHED, TCP_FIN_RCVD, TCP_FIN_WAIT_1, TCP_FIN_WAIT_2, TCP_FLG_ACK, TCP_FLG_FIN, TCP_FLG_ON, TCP_FLG_RST, TCP_FLG_SYN, TCP_FLG_URG, TCP_LAST_ACK, TCP_LISTEN, TCP_LOCAL_CLOSED, TCP_MAX_WIN, TCP_OPTION_RCVD_TS, TCP_SEQ_GT, TCP_SEQ_LEQ, TCP_SEQ_LT, TCP_SET_FLG, TCP_SUB_TIME, TCP_SYN_RCVD, TCP_SYN_SENT, TCP_TIME_WAIT, TCP_TIMER_2MSL, TCP_TIMER_CONNECT, TCP_TIMER_FINWAIT2, TCP_TIMER_PROBE, TCP_TIMER_REXMIT, TcpAdjustSndQue(), TcpChecksum(), TcpClearAllTimer(), TcpClearTimer(), TcpCloneTcb(), TcpClose(), TcpComputeRtt(), TcpDeliverData(), TcpFastLossRecover(), TcpFastRecover(), TcpFormatNetbuf(), TcpInitTcbLocal(), TcpInitTcbPeer(), TcpInsertTcb(), TcpLocateTcb(), TcpParseOption(), TcpQueueData(), TcpSendAck(), TcpSendReset(), TcpSeqAcceptable(), TcpSetKeepaliveTimer(), TcpSetProbeTimer(), TcpSetState(), TcpSetTimer(), TcpToSendAck(), TcpToSendData(), TcpTrimInWnd(), _TCP_CONTROL_BLOCK::Tick, _TCP_CONTROL_BLOCK::TimeWaitTimeout, _TCP_OPTION::TSEcr, _TCP_CONTROL_BLOCK::TsRecent, _TCP_CONTROL_BLOCK::TsRecentAge, _TCP_OPTION::TSVal, _TCP_SEG::Urg, and _TCP_SEG::Wnd.

Referenced by TcpRxCallback().

INTN TcpInsertTcb ( IN TCP_CB Tcb  ) 

Insert a Tcb into the proper queue.

Parameters:
[in] Tcb Pointer to the TCP_CB to be inserted.
Return values:
0 The Tcb was inserted successfully.
-1 An error condition occurred.
Insert a Tcb into the proper queue.

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

References _TCP_CONTROL_BLOCK::LocalEnd, mTcpListenQue, mTcpRunQue, _TCP_CONTROL_BLOCK::RemoteEnd, TCP_CLOSED, TCP_LISTEN, TCP_PEER_EQUAL, TCP_SYN_RCVD, and TCP_SYN_SENT.

Referenced by TcpConfigurePcb(), and TcpInput().

EFI_STATUS TcpInstallDevicePath ( IN SOCKET Sock  ) 

Install the device path protocol on the TCP instance.

Parameters:
[in] Sock Pointer to the socket representing the TCP instance.
Return values:
EFI_SUCCESS The device path protocol installed.
other Failed to install the device path protocol.
Install the device path protocol on the TCP instance.

Parameters:
[in] Sock Pointer to the socket representing the TCP instance.
Return values:
EFI_SUCCESS The device path protocol was installed.
other Failed to install the device path protocol.

References _TCP_SERVICE_DATA::ControllerHandle, _TCP_PEER::Ip, _TCP_CONTROL_BLOCK::LocalEnd, _TCP_PEER::Port, _TCP_CONTROL_BLOCK::RemoteEnd, _TCP_CONTROL_BLOCK::SubnetMask, _TCP_PROTO_DATA::TcpPcb, _TCP_PROTO_DATA::TcpService, and _TCP_CONTROL_BLOCK::UseDefaultAddr.

Referenced by TcpConfigurePcb(), and TcpSetState().

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] LocalPort The local port number.
[in] LocalIp The local IP address.
[in] RemotePort The remote port number.
[in] RemoteIp The remote IP address.
[in] Version IP_VERSION_4 indicates TCP is running on IP4 stack, IP_VERSION_6 indicates TCP is running on IP6 stack.
[in] Syn If TRUE, the listen sockets are searched.
Returns:
Pointer to the related TCP_CB. If NULL, no match is found.

References _TCP_PEER::Ip, _TCP_SOCKET::IpVersion, _TCP_CONTROL_BLOCK::List, _TCP_CONTROL_BLOCK::LocalEnd, mTcpRunQue, _TCP_PEER::Port, _TCP_CONTROL_BLOCK::RemoteEnd, _TCP_CONTROL_BLOCK::Sk, TCP_PEER_EQUAL, and TcpLocateListenTcb().

Referenced by TcpIcmpInput(), and TcpInput().

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] Tcb Pointer 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] Tcb Pointer to the TCP_CB of the TCP instance.

References TCP_CLOSE_WAIT, TCP_CLOSED, TCP_ESTABLISHED, TCP_FIN_WAIT_1, TCP_FIN_WAIT_2, TCP_SYN_RCVD, TcpResetConnection(), and TcpSetState().

Referenced by TcpDispatcher().

VOID TcpOnAppClose ( IN OUT TCP_CB Tcb  ) 

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

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.

References GET_RCV_DATASIZE, TCP_CLOSE_WAIT, TCP_CLOSED, TCP_ESTABLISHED, TCP_FIN_WAIT_1, TCP_LAST_ACK, TCP_LISTEN, TCP_SYN_RCVD, TCP_SYN_SENT, TcpClose(), TcpResetConnection(), TcpSetState(), and TcpToSendData().

Referenced by TcpDispatcher().

VOID TcpOnAppConnect ( IN OUT TCP_CB Tcb  ) 

Initialize an active connection,

Parameters:
[in,out] Tcb Pointer to the TCP_CB that wants to initiate a connection.
Initialize an active connection.

Parameters:
[in,out] Tcb Pointer to the TCP_CB that wants to initiate a connection.

References TCP_SYN_SENT, TCP_TIMER_CONNECT, TcpInitTcbLocal(), TcpSetState(), TcpSetTimer(), and TcpToSendData().

Referenced by TcpDispatcher().

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] Tcb Pointer 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] Tcb Pointer to the TCP_CB of this TCP instance.

References TCP_ESTABLISHED, TcpRcvWinNow(), TcpRcvWinOld(), and TcpSendAck().

Referenced by TcpDispatcher().

INTN TcpOnAppSend ( IN OUT TCP_CB Tcb  ) 

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

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

References TCP_CLOSE_WAIT, TCP_CLOSED, TCP_CLOSING, TCP_ESTABLISHED, TCP_FIN_WAIT_1, TCP_FIN_WAIT_2, TCP_LAST_ACK, TCP_LISTEN, TCP_SYN_RCVD, TCP_SYN_SENT, TCP_TIME_WAIT, and TcpToSendData().

Referenced by TcpDispatcher().

UINT32 TcpRcvWinNow ( IN TCP_CB Tcb  ) 

Compute the current receive window.

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

References GET_RCV_BUFFSIZE, SOCK_RCV_BUF, SockGetFreeSpace(), and TcpRcvWinOld().

Referenced by TcpComputeWnd(), TcpOnAppConsume(), and TcpToSendAck().

UINT32 TcpRcvWinOld ( IN TCP_CB Tcb  ) 

Compute the sequence space left in the old receive window.

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

References TCP_SEQ_GT, and TCP_SUB_SEQ.

Referenced by TcpOnAppConsume(), TcpRcvWinNow(), and TcpToSendAck().

VOID TcpResetConnection ( IN TCP_CB Tcb  ) 

Reset the connection related with Tcb.

Parameters:
[in] Tcb Pointer to the TCP_CB of the connection to be reset.

References TCP_FLG_RST, TCP_MAX_HEAD, TcpChecksum(), and TcpSendIpPacket().

Referenced by TcpConnectTimeout(), TcpOnAppAbort(), and TcpOnAppClose().

INTN TcpRetransmit ( IN TCP_CB Tcb,
IN TCP_SEQNO  Seq 
)

Retransmit the segment from sequence Seq.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Seq The sequence number of the segment to be retransmitted.
Return values:
0 The retransmission succeeded.
-1 An error condition occurred.
Retransmit the segment from sequence Seq.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Seq The sequence number of the segment to be retransmitted.
Return values:
0 Retransmission succeeded.
-1 Error condition occurred.

References TCP_SEQ_LT, TCP_SUB_SEQ, TcpGetSegmentSndQue(), TcpTransmitSegment(), and TcpVerifySegment().

Referenced by TcpFastLossRecover(), TcpFastRecover(), and TcpRexmitTimeout().

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

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

Parameters:
[in] Status Result of the receive request.
[in] IcmpErr Valid when Status is EFI_ICMP_ERROR.
[in] NetSession The IP session for the received packet.
[in] Pkt Packet received.
[in] Context The 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] Status Result of the receive request.
[in] IcmpErr Valid when Status is EFI_ICMP_ERROR.
[in] NetSession The IP session for the received packet.
[in] Pkt Packet received.
[in] Context The 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.

References TcpIcmpInput(), and TcpInput().

Referenced by TcpCreateService().

VOID TcpSendAck ( IN OUT TCP_CB Tcb  ) 

Send an ACK immediately.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.

References _TCP_SEG::End, _TCP_SEG::Flag, _TCP_SEG::Seq, TCP_CLEAR_FLG, TCP_CTRL_ACK_NOW, TCP_FLG_ACK, TCP_MAX_HEAD, TCPSEG_NETBUF, and TcpTransmitSegment().

Referenced by TcpDeliverData(), TcpInput(), TcpOnAppConsume(), TcpTickingDpc(), and TcpToSendAck().

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] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Nbuf Pointer to the TCP segment to be sent.
[in] Src Source address of the TCP segment.
[in] Dest Destination address of the TCP segment.
[in] Version IP_VERSION_4 or IP_VERSION_6
Return values:
0 The segment was sent out successfully.
-1 The segment failed to be sent.
Send the segment to IP via IpIo function.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Nbuf Pointer to the TCP segment to be sent.
[in] Src Source address of the TCP segment.
[in] Dest Destination address of the TCP segment.
[in] Version IP_VERSION_4 or IP_VERSION_6
Return values:
0 The segment was sent out successfully.
-1 The segment failed to send.

References _TCP_SERVICE_DATA::IpIo, _TCP_SOCKET::ProtoReserved, and _TCP_PROTO_DATA::TcpService.

Referenced by TcpResetConnection(), TcpSendReset(), and TcpTransmitSegment().

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] Tcb Pointer to the TCP_CB of this TCP instance, may be NULL.
[in] Head TCP header of the segment that triggers the reset.
[in] Len Length of the segment that triggers the reset.
[in] Local Local IP address.
[in] Remote Remote peer's IP address.
[in] Version IP_VERSION_4 indicates TCP is running on IP4 stack, IP_VERSION_6 indicates TCP is running on IP6 stack.
Return values:
0 A reset is sent or no need to send it.
-1 No reset is sent.
Send a RESET segment in response to the segment received.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance. May be NULL.
[in] Head TCP header of the segment that triggers the reset.
[in] Len Length of the segment that triggers the reset.
[in] Local Local IP address.
[in] Remote Remote peer's IP address.
[in] Version IP_VERSION_4 indicates TCP is running on IP4 stack, IP_VERSION_6 indicates TCP is running on IP6 stack.
Return values:
0 A reset was sent or there is no need to send it.
-1 No reset is sent.

References TCP_FLG_ACK, TCP_FLG_ON, TCP_FLG_RST, TCP_MAX_HEAD, TCP_SET_FLG, TcpChecksum(), and TcpSendIpPacket().

Referenced by TcpInput().

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] Tcb Pointer to the TCP_CB of this TCP instance.
Return values:
0 The zero probe segment was sent out successfully.
other An error condition occurred.

References _TCP_SEG::End, _TCP_SEG::Flag, _TCP_SEG::Seq, TCP_FLG_ACK, TCP_MAX_HEAD, TCPSEG_NETBUF, and TcpTransmitSegment().

Referenced by TcpKeepaliveTimeout(), and TcpProbeTimeout().

VOID TcpSetKeepaliveTimer ( IN OUT TCP_CB Tcb  ) 

Enable the keepalive timer and set the timeout value.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.

References TCP_CTRL_NO_KEEPALIVE, TCP_FLG_ON, TCP_TIMER_KEEPALIVE, TCP_TIMER_ON, and TcpSetTimer().

Referenced by TcpInput(), and TcpKeepaliveTimeout().

VOID TcpSetProbeTimer ( IN OUT TCP_CB Tcb  ) 

Enable the window prober timer and set the timeout value.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.

References TCP_RTO_MAX, TCP_RTO_MIN, TCP_TIMER_PROBE, and TcpSetTimer().

Referenced by TcpDataToSend(), TcpInput(), and TcpProbeTimeout().

VOID TcpSetState ( IN TCP_CB Tcb,
IN UINT8  State 
)

Set the Tcb's state.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in] State The state to be set.

References mTcpStateName, SockConnClosed(), SockConnEstablished(), TCP_CLOSED, TCP_ESTABLISHED, and TcpInstallDevicePath().

Referenced by TcpClose(), TcpConfigurePcb(), TcpDeliverData(), TcpInput(), TcpOnAppAbort(), TcpOnAppClose(), and TcpOnAppConnect().

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

Enable a TCP timer.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.
[in] Timer The index of the timer to be enabled.
[in] TimeOut The timeout value of this timer.

References mTcpTick, TCP_SET_TIMER, and TcpUpdateTimer().

Referenced by TcpDeliverData(), TcpInput(), TcpOnAppConnect(), TcpRexmitTimeout(), TcpSetKeepaliveTimer(), TcpSetProbeTimer(), and TcpToSendData().

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

Heart beat timer handler, queues the DPC at TPL_CALLBACK.

Parameters:
[in] Event Timer event signaled, ignored.
[in] Context Context of the timer event, ignored.

References TcpTickingDpc().

Referenced by TcpCreateTimer().

VOID TcpToSendAck ( IN OUT TCP_CB Tcb  ) 

Check whether to send an ACK or delayed ACK.

Parameters:
[in,out] Tcb Pointer to the TCP_CB of this TCP instance.

References TCP_CTRL_ACK_NOW, TCP_FLG_ON, TcpRcvWinNow(), TcpRcvWinOld(), and TcpSendAck().

Referenced by TcpInput().

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

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

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

References _TCP_SEG::End, _TCP_SEG::Flag, GET_SND_DATASIZE, mTcpOutFlag, mTcpStateName, _TCP_SEG::Seq, TCP_CLEAR_FLG, TCP_CLOSED, TCP_CONGEST_OPEN, TCP_CTRL_FIN_SENT, TCP_CTRL_RTT_ON, TCP_FLG_FIN, TCP_FLG_ON, TCP_FLG_SYN, TCP_LISTEN, TCP_SEQ_GT, TCP_SEQ_LT, TCP_SET_FLG, TCP_SUB_SEQ, TCP_TIMER_ON, TCP_TIMER_REXMIT, TcpCheckSndQue(), TcpDataToSend(), TcpGetMaxSndNxt(), TcpGetSegment(), TCPSEG_NETBUF, TcpSetTimer(), TcpTransmitSegment(), and TcpVerifySegment().

Referenced by TcpInput(), TcpOnAppClose(), TcpOnAppConnect(), TcpOnAppSend(), and TcpProbeTimeout().

INTN TcpVerifySegment ( IN NET_BUF *  Nbuf  ) 

Verify that the segment is in good shape.

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

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

References _TCP_SEG::End, _TCP_SEG::Flag, _TCP_SEG::Seq, TCP_FLG_FIN, TCP_FLG_ON, TCP_FLG_SYN, and TCPSEG_NETBUF.

Referenced by TcpCheckSndQue(), TcpDeliverData(), TcpGetSegment(), TcpRetransmit(), TcpToSendData(), TcpTransmitSegment(), and TcpTrimSegment().


Generated on Mon Sep 28 08:49:06 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1