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 | SockGetMode (IN SOCKET *Sock, IN OUT VOID *Mode) |
EFI_STATUS | SockGroup (IN SOCKET *Sock, IN VOID *GroupInfo) |
EFI_STATUS | SockRoute (IN SOCKET *Sock, IN VOID *RouteInfo) |
Copyright (c) 2009 - 2012, 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.
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 accpeted 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. |
References _TCP_SOCKET::ConnCnt, _TCP_SOCKET::Parent, SIGNAL_TOKEN, SOCK_IS_CONNECTED, SOCK_IS_LISTENING, SOCK_IS_NO_MAPPING, SOCK_IS_UNCONFIGURED, SockBufferToken(), _TCP_SOCKET::SockHandle, SockStream, and SockTokenExisted().
Referenced by Tcp4Accept(), and Tcp6Accept().
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. |
References _SOCK_TOKEN::RemainDataLen, _SOCK_TOKEN::Sock, _SOCK_TOKEN::Token, and _SOCK_TOKEN::TokenList.
Referenced by SockAccept(), SockRcv(), and SockSend().
EFI_STATUS SockClose | ( | IN OUT SOCKET * | Sock, | |
IN VOID * | Token, | |||
IN BOOLEAN | OnAbort | |||
) |
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. |
References SO_DISCONNECTING, SOCK_ABORT, SOCK_CLOSE, SOCK_IS_DISCONNECTING, SOCK_IS_NO_MAPPING, SOCK_IS_UNCONFIGURED, SockSetState(), SockStream, and SockTokenExisted().
Referenced by Tcp4Close(), and Tcp6Close().
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. |
References SO_CLOSED, SOCK_CONFIGURE, and SOCK_IS_CONFIGURED.
Referenced by Tcp4Configure(), and Tcp6Configure().
EFI_STATUS SockConnect | ( | IN SOCKET * | Sock, | |
IN VOID * | Token | |||
) |
Initiate a connection establishment process.
[in] | Sock | Pointer to the socket to initiate the initate 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. |
References SO_CONNECTING, SOCK_CONNECT, SOCK_IS_CLOSED, SOCK_IS_CONFIGURED_ACTIVE, SOCK_IS_NO_MAPPING, SOCK_IS_UNCONFIGURED, SockSetState(), and SockTokenExisted().
Referenced by Tcp4Connect(), and Tcp6Connect().
SOCKET* SockCreateChild | ( | IN SOCK_INIT_DATA * | SockInitData | ) |
Create a socket and its associated protocol control block with the intial data SockInitData and protocol specific data ProtoData.
[in] | SockInitData | Inital data to setting the socket. |
References _TCP_SOCKET::Lock, _TCP_SOCKET::ProtoHandler, SOCK_ATTACH, SockCreate(), and SockDestroy().
Referenced by TcpServiceBindingCreateChild().
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. |
References SO_CLOSED, SO_UNCONFIGURED, SOCK_DETACH, SOCK_IS_CONFIGURED, SockConnFlush(), SockDestroy(), and SockSetState().
Referenced by SockConnClosed(), SockConnFlush(), and TcpServiceBindingDestroyChild().
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. |
References SO_CLOSED, SO_UNCONFIGURED, SOCK_ERROR, SOCK_FLUSH, SOCK_IS_CONFIGURED, SockConnFlush(), SockSetState(), and SockStream.
Referenced by Tcp4Configure(), and Tcp6Configure().
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. |
References SOCK_MODE.
Referenced by Tcp4GetModeData(), and Tcp6GetModeData().
EFI_STATUS SockGroup | ( | IN SOCKET * | Sock, | |
IN VOID * | GroupInfo | |||
) |
Configure the low level protocol to join a multicast group for this socket's connection.
[in] | Sock | Pointer to the socket of the connection to join the specific multicast group. |
[in] | GroupInfo | Pointer to the multicast group info. |
EFI_SUCCESS | The configuration completed successfully. | |
EFI_ACCESS_DENIED | Failed to get the lock to access the socket. | |
EFI_NOT_STARTED | The socket is not configured. |
References SOCK_GROUP, and SOCK_IS_UNCONFIGURED.
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. |
References _SOCK_COMPLETION_TOKEN::Event, GET_RCV_DATASIZE, SIGNAL_TOKEN, SOCK_CONSUMED, SOCK_IS_CONNECTED, SOCK_IS_CONNECTING, SOCK_IS_NO_MAPPING, SOCK_IS_NO_MORE_DATA, SOCK_IS_UNCONFIGURED, SockBufferToken(), SockProcessRcvToken(), SockStream, SockTokenExisted(), and _SOCK_IO_TOKEN::Token.
Referenced by Tcp4Receive(), and Tcp6Receive().
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. |
References SOCK_IS_NO_MAPPING, SOCK_IS_UNCONFIGURED, and SOCK_ROUTE.
Referenced by Tcp4Routes().
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. |
References _SOCK_COMPLETION_TOKEN::Event, _SOCK_IO_TOKEN::Packet, SOCK_IS_CONNECTED, SOCK_IS_CONNECTING, SOCK_IS_NO_MAPPING, SOCK_IS_UNCONFIGURED, SOCK_SND_BUF, SockBufferToken(), SockGetFreeSpace(), SockProcessTcpSndData(), SockStream, SockTokenExisted(), _SOCK_IO_TOKEN::Token, _SOCK_TOKEN::TokenList, and SOCK_IO_DATA::TxData.
Referenced by Tcp4Transmit(), and Tcp6Transmit().
BOOLEAN SockTokenExisted | ( | IN SOCKET * | Sock, | |
IN EFI_EVENT | Event | |||
) |
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. |
References SockTokenExistedInList().
Referenced by SockAccept(), SockClose(), SockConnect(), SockRcv(), and SockSend().
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. |
References _SOCK_COMPLETION_TOKEN::Event, and _SOCK_TOKEN::Token.
Referenced by SockTokenExisted().