TianoCore EDK2 master
|
#include "SockImpl.h"
Go to the source code of this file.
Implementation of the Socket.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SockImpl.c.
NET_BUF * SockBufFirst | ( | IN SOCK_BUFFER * | Sockbuf | ) |
Get the first buffer block in the specific socket buffer.
[in] | Sockbuf | Pointer to the socket buffer. |
Definition at line 21 of file SockImpl.c.
NET_BUF * SockBufNext | ( | IN SOCK_BUFFER * | Sockbuf, |
IN NET_BUF * | SockEntry | ||
) |
Get the next buffer block in the specific socket buffer.
[in] | Sockbuf | Pointer to the socket buffer. |
[in] | SockEntry | Pointer to the buffer block prior to the required one. |
Definition at line 47 of file SockImpl.c.
EFI_STATUS SockCancelToken | ( | IN SOCK_COMPLETION_TOKEN * | Token, |
IN OUT LIST_ENTRY * | SpecifiedTokenList | ||
) |
Cancel the tokens in the specific token list.
[in] | Token | Pointer to the Token. If NULL, all tokens in SpecifiedTokenList will be canceled. |
[in,out] | SpecifiedTokenList | Pointer to the token list to be checked. |
EFI_SUCCESS | Cancel the tokens in the specific token listsuccessfully. |
EFI_NOT_FOUND | The Token is not found in SpecifiedTokenList. |
Definition at line 573 of file SockImpl.c.
Clone a new socket, including its associated protocol control block.
[in] | Sock | Pointer to the socket to be cloned. |
Definition at line 937 of file SockImpl.c.
Called by the low layer protocol to indicate the connection is closed.
This function flushes the socket, sets the state to SO_CLOSED, and signals the close token.
[in,out] | Sock | Pointer to the socket associated with the closed connection. |
Definition at line 1011 of file SockImpl.c.
Called by the low layer protocol to indicate the socket a connection is established.
This function just changes the socket's state to SO_CONNECTED and signals the token used for connection establishment.
[in,out] | Sock | Pointer to the socket associated with the established connection. |
Definition at line 985 of file SockImpl.c.
Flush the sndBuffer and rcvBuffer of socket.
[in,out] | Sock | Pointer to the socket. |
Definition at line 857 of file SockImpl.c.
SOCKET * SockCreate | ( | IN SOCK_INIT_DATA * | SockInitData | ) |
Create a socket with initial data SockInitData.
[in] | SockInitData | Pointer to the initial data of the socket. |
Definition at line 633 of file SockImpl.c.
Called by the low layer protocol to deliver received data to socket layer.
This function will append the data to the socket receive buffer, set the urgent data length, and then check if any receive token can be signaled.
[in,out] | Sock | Pointer to the socket. |
[in,out] | NetBuffer | Pointer to the buffer that contains the received data. |
[in] | UrgLen | The length of the urgent data in the received data. |
Definition at line 1125 of file SockImpl.c.
Called by low layer protocol to indicate that some data was sent or processed.
This function trims the sent data in the socket send buffer, and signals the data token if proper.
[in,out] | Sock | Pointer to the socket. |
[in] | Count | The length of the data processed or sent, in bytes. |
Definition at line 1039 of file SockImpl.c.
Destroy a socket.
[in,out] | Sock | Pointer to the socket. |
Definition at line 809 of file SockImpl.c.
VOID SockFlushPendingToken | ( | IN SOCKET * | Sock, |
IN OUT LIST_ENTRY * | PendingTokenList | ||
) |
Flush the tokens in the specific token list.
[in] | Sock | Pointer to the socket. |
[in,out] | PendingTokenList | Pointer to the token list to be flushed. |
Definition at line 424 of file SockImpl.c.
VOID EFIAPI SockFreeFoo | ( | IN VOID * | Arg | ) |
User provided callback function for NetbufFromExt.
[in] | Arg | The Arg parameter forwarded by NetbufFromExt(). Ignored. |
Definition at line 75 of file SockImpl.c.
Called by the low layer protocol to copy some data in the socket send buffer starting from the specific offset to a buffer provided by the caller.
[in] | Sock | Pointer to the socket. |
[in] | Offset | The start point of the data to be copied. |
[in] | Len | The length of the data to be copied. |
[out] | Dest | Pointer to the destination to copy the data. |
Definition at line 1096 of file SockImpl.c.
Get the length of the free space of the specific socket buffer.
[in] | Sock | Pointer to the socket. |
[in] | Which | Flag to indicate which socket buffer to check: either send buffer or receive buffer. |
Definition at line 1156 of file SockImpl.c.
Called by the low layer protocol to indicate that there will be no more data from the communication peer.
This function sets the socket's state to SO_NO_MORE_DATA and signals all queued IO tokens with the error status EFI_CONNECTION_FIN.
[in,out] | Sock | Pointer to the socket. |
Definition at line 1192 of file SockImpl.c.
Get received data from the socket layer to the receive token.
[in,out] | Sock | Pointer to the socket. |
[in,out] | RcvToken | Pointer to the application provided receive token. |
Definition at line 304 of file SockImpl.c.
Process the send token.
[in,out] | Sock | Pointer to the socket. |
Definition at line 230 of file SockImpl.c.
EFI_STATUS SockProcessTcpSndData | ( | IN SOCKET * | Sock, |
IN VOID * | TcpTxData | ||
) |
Process the TCP send data, buffer the tcp txdata, and append the buffer to socket send buffer, then try to send it.
[in] | Sock | Pointer to the socket. |
[in] | TcpTxData | Pointer to the application provided send buffer. |
EFI_SUCCESS | The operation completed successfully. |
EFI_OUT_OF_RESOURCES | Failed due to resource limits. |
Definition at line 349 of file SockImpl.c.
Set the state of the socket.
[in,out] | Sock | Pointer to the socket. |
[in] | State | The new socket state to be set. |
Definition at line 920 of file SockImpl.c.
VOID SockSetTcpRxData | ( | IN SOCKET * | Sock, |
IN VOID * | TcpRxData, | ||
IN UINT32 | RcvdBytes, | ||
IN BOOLEAN | IsUrg | ||
) |
Copy data from socket buffer to an application provided receive buffer.
[in] | Sock | Pointer to the socket. |
[in] | TcpRxData | Pointer to the application provided receive buffer. |
[in] | RcvdBytes | The maximum length of the data can be copied. |
[in] | IsUrg | If TRUE the data is Out of Bound, FALSE the data is normal. |
Definition at line 181 of file SockImpl.c.
UINT32 SockTcpDataToRcv | ( | IN SOCK_BUFFER * | SockBuffer, |
OUT BOOLEAN * | IsUrg, | ||
IN UINT32 | BufLen | ||
) |
Get the length of the data that can be retrieved from the socket receive buffer.
[in] | SockBuffer | Pointer to the socket receive buffer. |
[out] | IsUrg | Pointer to a BOOLEAN variable. If TRUE the data is OOB. |
[in] | BufLen | The maximum length of the data buffer to store the received data in the socket layer. |
Definition at line 96 of file SockImpl.c.
Wake up the connection token while the connection is successfully established, then try to process any pending send token.
[in,out] | Sock | Pointer to the socket. |
Definition at line 457 of file SockImpl.c.
Wake up the listen token while the connection is established successfully.
[in,out] | Sock | Pointer to the socket. |
Definition at line 479 of file SockImpl.c.
Wake up the receive token while some data is received.
[in,out] | Sock | Pointer to the socket. |
Definition at line 526 of file SockImpl.c.