TianoCore EDK2 master
|
#include "SockImpl.h"
Go to the source code of this file.
Functions | |
BOOLEAN | SockTokenExistedInList (IN LIST_ENTRY *List, IN EFI_EVENT Event) |
BOOLEAN | SockTokenExisted (IN SOCKET *Sock, IN EFI_EVENT Event) |
SOCK_TOKEN * | SockBufferToken (IN SOCKET *Sock, IN LIST_ENTRY *List, IN VOID *Token, IN UINT32 DataLen) |
EFI_STATUS | SockDestroyChild (IN OUT SOCKET *Sock) |
SOCKET * | SockCreateChild (IN SOCK_INIT_DATA *SockInitData) |
EFI_STATUS | SockConfigure (IN SOCKET *Sock, IN VOID *ConfigData) |
EFI_STATUS | SockConnect (IN SOCKET *Sock, IN VOID *Token) |
EFI_STATUS | SockAccept (IN SOCKET *Sock, IN VOID *Token) |
EFI_STATUS | SockSend (IN SOCKET *Sock, IN VOID *Token) |
EFI_STATUS | SockRcv (IN SOCKET *Sock, IN VOID *Token) |
EFI_STATUS | SockFlush (IN OUT SOCKET *Sock) |
EFI_STATUS | SockClose (IN OUT SOCKET *Sock, IN VOID *Token, IN BOOLEAN OnAbort) |
EFI_STATUS | SockCancel (IN OUT SOCKET *Sock, IN VOID *Token) |
EFI_STATUS | SockGetMode (IN SOCKET *Sock, IN OUT VOID *Mode) |
EFI_STATUS | SockRoute (IN SOCKET *Sock, IN VOID *RouteInfo) |
Interface function of the Socket.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SockInterface.c.
EFI_STATUS SockAccept | ( | IN SOCKET * | Sock, |
IN VOID * | Token | ||
) |
Issue a listen token to get an existed connected network instance or wait for a connection if there is none.
[in] | Sock | Pointer to the socket to accept connections. |
[in] | Token | The token to accept a connection. |
EFI_SUCCESS | Either a connection is accepted or the Token is buffered for further acception. |
EFI_ACCESS_DENIED | Failed to get the lock to access the socket, or the socket is closed, or the socket is not configured to be a passive one, or the token is already in one of this socket's lists. |
EFI_NO_MAPPING | The IP address configuration operation is not finished. |
EFI_NOT_STARTED | The socket is not configured. |
EFI_OUT_OF_RESOURCE | Failed to buffer the Token due to memory limits. |
Definition at line 476 of file SockInterface.c.
SOCK_TOKEN * SockBufferToken | ( | IN SOCKET * | Sock, |
IN LIST_ENTRY * | List, | ||
IN VOID * | Token, | ||
IN UINT32 | DataLen | ||
) |
Buffer a token into the specific list of the socket Sock.
[in] | Sock | Pointer to the instance's socket. |
[in] | List | Pointer to the list to store the token. |
[in] | Token | Pointer to the token to be buffered. |
[in] | DataLen | The data length of the buffer contained in Token. |
Definition at line 95 of file SockInterface.c.
EFI_STATUS SockCancel | ( | IN OUT SOCKET * | Sock, |
IN VOID * | Token | ||
) |
Abort the socket associated connection, listen, transmission or receive request.
[in,out] | Sock | Pointer to the socket to abort. |
[in] | Token | Pointer to a token that has been issued by Connect(), Accept(), Transmit() or Receive(). If NULL, all pending tokens issued by the four functions listed above will be aborted. |
EFI_UNSUPPORTED | The operation is not supported in the current implementation. |
Definition at line 937 of file SockInterface.c.
Close or abort the socket associated connection.
[in,out] | Sock | Pointer to the socket of the connection to close or abort. |
[in] | Token | The token for a close operation. |
[in] | OnAbort | TRUE for aborting the connection; FALSE to close it. |
EFI_SUCCESS | The close or abort operation initialized successfully. |
EFI_ACCESS_DENIED | Failed to get the lock to access the socket, or the socket is closed, or the socket is not in a synchronized state , or the token is already in one of this socket's lists. |
EFI_NO_MAPPING | The IP address configuration operation is not finished. |
EFI_NOT_STARTED | The socket is not configured. |
Definition at line 866 of file SockInterface.c.
EFI_STATUS SockConfigure | ( | IN SOCKET * | Sock, |
IN VOID * | ConfigData | ||
) |
Configure the specific socket Sock using configuration data ConfigData.
[in] | Sock | Pointer to the socket to be configured. |
[in] | ConfigData | Pointer to the configuration data. |
EFI_SUCCESS | The socket configured successfully. |
EFI_ACCESS_DENIED | Failed to get the lock to access the socket, or the socket is already configured. |
Definition at line 354 of file SockInterface.c.
EFI_STATUS SockConnect | ( | IN SOCKET * | Sock, |
IN VOID * | Token | ||
) |
Initiate a connection establishment process.
[in] | Sock | Pointer to the socket to initiate the connection. |
[in] | Token | Pointer to the token used for the connection operation. |
EFI_SUCCESS | The connection initialized successfully. |
EFI_ACCESS_DENIED | Failed to get the lock to access the socket, or the socket is closed, or the socket is not configured to be an active one, or the token is already in one of this socket's lists. |
EFI_NO_MAPPING | The IP address configuration operation is not finished. |
EFI_NOT_STARTED | The socket is not configured. |
Definition at line 406 of file SockInterface.c.
SOCKET * SockCreateChild | ( | IN SOCK_INIT_DATA * | SockInitData | ) |
Create a socket and its associated protocol control block with the initial data SockInitData and protocol specific data ProtoData.
[in] | SockInitData | Initial data to setting the socket. |
Definition at line 260 of file SockInterface.c.
EFI_STATUS SockDestroyChild | ( | IN OUT SOCKET * | Sock | ) |
Destroy the socket Sock and its associated protocol control block.
[in,out] | Sock | The socket to be destroyed. |
EFI_SUCCESS | The socket Sock was destroyed successfully. |
EFI_ACCESS_DENIED | Failed to get the lock to access the socket. |
Definition at line 132 of file SockInterface.c.
EFI_STATUS SockFlush | ( | IN OUT SOCKET * | Sock | ) |
Reset the socket and its associated protocol control block.
[in,out] | Sock | Pointer to the socket to be flushed. |
EFI_SUCCESS | The socket is flushed successfully. |
EFI_ACCESS_DENIED | Failed to get the lock to access the socket. |
Definition at line 800 of file SockInterface.c.
EFI_STATUS SockGetMode | ( | IN SOCKET * | Sock, |
IN OUT VOID * | Mode | ||
) |
Get the mode data of the low layer protocol.
[in] | Sock | Pointer to the socket to get mode data from. |
[in,out] | Mode | Pointer to the data to store the low layer mode information. |
EFI_SUCCESS | The mode data was obtained successfully. |
EFI_NOT_STARTED | The socket is not configured. |
Definition at line 1025 of file SockInterface.c.
EFI_STATUS SockRcv | ( | IN SOCKET * | Sock, |
IN VOID * | Token | ||
) |
Issue a token to get data from the socket.
[in] | Sock | Pointer to the socket to get data from. |
[in] | Token | The token to store the received data from the socket. |
EFI_SUCCESS | The token processed successfully. |
EFI_ACCESS_DENIED | Failed to get the lock to access the socket, or the socket is closed, or the socket is not in a synchronized state , or the token is already in one of this socket's lists. |
EFI_NO_MAPPING | The IP address configuration operation is not finished. |
EFI_NOT_STARTED | The socket is not configured. |
EFI_CONNECTION_FIN | The connection is closed and there is no more data. |
EFI_OUT_OF_RESOURCE | Failed to buffer the token due to memory limit. |
Definition at line 705 of file SockInterface.c.
EFI_STATUS SockRoute | ( | IN SOCKET * | Sock, |
IN VOID * | RouteInfo | ||
) |
Add or remove route information in IP route table associated with this socket.
[in] | Sock | Pointer to the socket associated with the IP route table to operate on. |
[in] | RouteInfo | Pointer to the route information to be processed. |
EFI_SUCCESS | The route table updated successfully. |
EFI_ACCESS_DENIED | Failed to get the lock to access the socket. |
EFI_NO_MAPPING | The IP address configuration operation is not finished. |
EFI_NOT_STARTED | The socket is not configured. |
Definition at line 1049 of file SockInterface.c.
EFI_STATUS SockSend | ( | IN SOCKET * | Sock, |
IN VOID * | Token | ||
) |
Issue a token with data to the socket to send out.
[in] | Sock | Pointer to the socket to process the token with data. |
[in] | Token | The token with data that needs to send out. |
EFI_SUCCESS | The token processed successfully. |
EFI_ACCESS_DENIED | Failed to get the lock to access the socket, or the socket is closed, or the socket is not in a synchronized state , or the token is already in one of this socket's lists. |
EFI_NO_MAPPING | The IP address configuration operation is not finished. |
EFI_NOT_STARTED | The socket is not configured. |
EFI_OUT_OF_RESOURCE | Failed to buffer the token due to memory limits. |
Definition at line 583 of file SockInterface.c.
Call SockTokenExistedInList() to check whether the Event is in the related socket's lists.
[in] | Sock | Pointer to the instance's socket. |
[in] | Event | The event to be checked. |
TRUE | The Event exists in related socket's lists. |
FALSE | The Event is not in related socket's lists. |
Definition at line 58 of file SockInterface.c.
BOOLEAN SockTokenExistedInList | ( | IN LIST_ENTRY * | List, |
IN EFI_EVENT | Event | ||
) |
Check whether the Event is in the List.
[in] | List | Pointer to the token list to be searched. |
[in] | Event | The event to be checked. |
TRUE | The specific Event exists in the List. |
FALSE | The specific Event is not in the List. |
Definition at line 23 of file SockInterface.c.