TianoCore EDK2 master
|
#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) |
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.
#define TCP_COMP_VAL | ( | Min, | |
Max, | |||
Default, | |||
Val | |||
) | ((((Val) <= (Max)) && ((Val) >= (Min))) ? (Val) : (Default)) |
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.
[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. |
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. |
Clear all TCP timers.
[in,out] | Tcb | Pointer to the TCP_CB of this TCP instance. |
Definition at line 400 of file TcpTimer.c.
Clear one TCP timer.
[in,out] | Tcb | Pointer to the TCP_CB of this TCP instance. |
[in] | Timer | The index of the timer to be cleared. |
Definition at line 384 of file TcpTimer.c.
Clone a TCP_CB from Tcb.
[in] | Tcb | Pointer to the TCP_CB to be cloned. |
Clone a TCP_CB from Tcb.
[in] | Tcb | Pointer to the TCP_CB to be cloned. |
Close the TCP connection.
[in,out] | Tcb | Pointer to the TCP_CB of this TCP instance. |
Definition at line 96 of file TcpTimer.c.
Compute how much data to send.
[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. |
Compute how much data to send.
[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. |
Definition at line 166 of file TcpOutput.c.
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.
[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. |
EFI_SUCCESS | The socket request completed successfully. |
other | The 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.
[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. |
EFI_SUCCESS | The socket request completed successfully. |
other | The error status returned by the corresponding TCP layer function. |
Definition at line 764 of file TcpDispatcher.c.
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>.
[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. |
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>.
[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. |
TRUE | The Tcb which matches the <Addr Port> pair exists. |
FALSE | Otherwise |
Translate the information from the head of the received TCP segment Nbuf contains, and fill it into a TCP_SEG structure.
[in] | Tcb | Pointer to the TCP_CB of this TCP instance. |
[in,out] | Nbuf | Pointer to the buffer contains the TCP segment. |
Translate the information from the head of the received TCP segment Nbuf contents and fill it into a TCP_SEG structure.
[in] | Tcb | Pointer to the TCP_CB of this TCP instance. |
[in,out] | Nbuf | Pointer to the buffer contains the TCP segment. |
Get the maximum SndNxt.
[in] | Tcb | Pointer to the TCP_CB of this TCP instance. |
Definition at line 137 of file TcpOutput.c.
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.
[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.
[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. |
Definition at line 1569 of file TcpInput.c.
EFI_STATUS TcpInitTcbLocal | ( | IN OUT TCP_CB * | Tcb | ) |
Initialize the Tcb locally related members.
[in,out] | Tcb | Pointer to the TCP_CB of this TCP instance. |
EFI_SUCCESS | The operation completed successfully |
others | The underlying functions failed and could not complete the operation |
Initialize the Tcb local related members.
[in,out] | Tcb | Pointer to the TCP_CB of this TCP instance. |
EFI_SUCCESS | The operation completed successfully |
others | The underlying functions failed and could not complete the operation |
Initialize the peer related members.
[in,out] | Tcb | Pointer to the TCP_CB of this TCP instance. |
[in] | Seg | Pointer to the segment that contains the peer's initial information. |
[in] | Opt | Pointer to the options announced by the peer. |
Initialize the peer related members.
[in,out] | Tcb | Pointer to the TCP_CB of this TCP instance. |
[in] | Seg | Pointer to the segment that contains the peer's initial info. |
[in] | Opt | Pointer to the options announced by the peer. |
INTN TcpInput | ( | IN NET_BUF * | Nbuf, |
IN EFI_IP_ADDRESS * | Src, | ||
IN EFI_IP_ADDRESS * | Dst, | ||
IN UINT8 | Version | ||
) |
Process the received TCP segments.
[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. |
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.
[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. |
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. |
Definition at line 710 of file TcpInput.c.
Insert a Tcb into the proper queue.
[in] | Tcb | Pointer to the TCP_CB to be inserted. |
0 | The Tcb was inserted successfully. |
-1 | An error condition occurred. |
Insert a Tcb into the proper queue.
[in] | Tcb | Pointer to the TCP_CB to be inserted. |
0 | The Tcb was inserted successfully. |
-1 | Error condition occurred. |
EFI_STATUS TcpInstallDevicePath | ( | IN SOCKET * | Sock | ) |
Install the device path protocol on the TCP instance.
[in] | Sock | Pointer to the socket representing the TCP instance. |
EFI_SUCCESS | The device path protocol installed. |
other | Failed to install the device path protocol. |
Install the device path protocol on the TCP instance.
[in] | Sock | Pointer to the socket representing the TCP instance. |
EFI_SUCCESS | The device path protocol was installed. |
other | Failed to install the device path protocol. |
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.
[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. |
Abort the connection by sending a reset segment: called when the application wants to abort the connection.
[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.
[in] | Tcb | Pointer to the TCP_CB of the TCP instance. |
EFI_STATUS TcpOnAppConnect | ( | IN OUT TCP_CB * | Tcb | ) |
Initialize an active connection,
[in,out] | Tcb | Pointer to the TCP_CB that wants to initiate a connection. |
EFI_SUCCESS | The operation completed successfully |
others | The underlying functions failed and could not complete the operation |
Initialize an active connection.
[in,out] | Tcb | Pointer to the TCP_CB that wants to initiate a connection. |
EFI_SUCCESS | The operation completed successfully |
others | The underlying functions failed and could not complete the operation |
Application has consumed some data, check whether to send a window update ack or a delayed ack.
[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.
[in] | Tcb | Pointer to the TCP_CB of this TCP instance. |
Check whether the application's newly delivered data can be sent out.
[in,out] | Tcb | Pointer to the TCP_CB of this TCP instance. |
0 | The data has been sent out successfully. |
-1 | The Tcb is not in a state that data is permitted to be sent out. |
Compute the current receive window.
[in] | Tcb | Pointer to the TCP_CB of this TCP instance. |
Definition at line 62 of file TcpOutput.c.
Compute the sequence space left in the old receive window.
[in] | Tcb | Pointer to the TCP_CB of this TCP instance. |
Definition at line 35 of file TcpOutput.c.
Retransmit the segment from sequence Seq.
[in] | Tcb | Pointer to the TCP_CB of this TCP instance. |
[in] | Seq | The sequence number of the segment to be retransmitted. |
0 | The retransmission succeeded. |
-1 | An error condition occurred. |
Retransmit the segment from sequence Seq.
[in] | Tcb | Pointer to the TCP_CB of this TCP instance. |
[in] | Seq | The sequence number of the segment to be retransmitted. |
0 | Retransmission succeeded. |
-1 | Error condition occurred. |
Definition at line 632 of file TcpOutput.c.
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.
[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.
[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. |
Send an ACK immediately.
[in,out] | Tcb | Pointer to the TCP_CB of this TCP instance. |
Definition at line 967 of file TcpOutput.c.
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.
[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 |
0 | The segment was sent out successfully. |
-1 | The segment failed to be sent. |
Send the segment to IP via IpIo function.
[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 |
0 | The segment was sent out successfully. |
-1 | The segment failed to send. |
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.
[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. |
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.
[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. |
0 | A reset was sent or there is no need to send it. |
-1 | No reset is sent. |
Definition at line 1095 of file TcpOutput.c.
Send a zero probe segment. It can be used by keepalive and zero window probe.
[in,out] | Tcb | Pointer to the TCP_CB of this TCP instance. |
0 | The zero probe segment was sent out successfully. |
other | An error condition occurred. |
Definition at line 1005 of file TcpOutput.c.
Enable the keepalive timer and set the timeout value.
[in,out] | Tcb | Pointer to the TCP_CB of this TCP instance. |
Definition at line 442 of file TcpTimer.c.
Enable the window prober timer and set the timeout value.
[in,out] | Tcb | Pointer to the TCP_CB of this TCP instance. |
Definition at line 415 of file TcpTimer.c.
Enable a TCP timer.
[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. |
Definition at line 364 of file TcpTimer.c.
Heart beat timer handler, queues the DPC at TPL_CALLBACK.
[in] | Event | Timer event signaled, ignored. |
[in] | Context | Context of the timer event, ignored. |
Definition at line 563 of file TcpTimer.c.
Check whether to send an ACK or delayed ACK.
[in,out] | Tcb | Pointer to the TCP_CB of this TCP instance. |
Definition at line 1043 of file TcpOutput.c.
Check whether to send data/SYN/FIN and piggyback an ACK.
[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. |
Definition at line 776 of file TcpOutput.c.
Verify that the segment is in good shape.
[in] | Nbuf | Buffer that contains the segment to be checked. |
0 | The segment is broken. |
1 | The segment is in good shape. |
Verify that the segment is in good shape.
[in] | Nbuf | The buffer that contains the segment to be checked. |
0 | The segment is broken. |
1 | The segment is in good shape. |
Definition at line 1184 of file TcpOutput.c.