Functions | |
NET_BUF * | SockBufFirst (IN SOCK_BUFFER *Sockbuf) |
NET_BUF * | SockBufNext (IN SOCK_BUFFER *Sockbuf, IN NET_BUF *SockEntry) |
VOID EFIAPI | SockFreeFoo (IN EFI_EVENT Event) |
UINT32 | SockTcpDataToRcv (IN SOCK_BUFFER *SockBuffer, OUT BOOLEAN *IsUrg, IN UINT32 BufLen) |
VOID | SockSetTcpRxData (IN SOCKET *Sock, IN VOID *TcpRxData, IN UINT32 RcvdBytes, IN BOOLEAN IsUrg) |
VOID | SockProcessSndToken (IN OUT SOCKET *Sock) |
UINT32 | SockProcessRcvToken (IN OUT SOCKET *Sock, IN OUT SOCK_IO_TOKEN *RcvToken) |
EFI_STATUS | SockProcessTcpSndData (IN SOCKET *Sock, IN VOID *TcpTxData) |
VOID | SockFlushPendingToken (IN SOCKET *Sock, IN OUT LIST_ENTRY *PendingTokenList) |
VOID | SockWakeConnToken (IN OUT SOCKET *Sock) |
VOID | SockWakeListenToken (IN OUT SOCKET *Sock) |
VOID | SockWakeRcvToken (IN OUT SOCKET *Sock) |
SOCKET * | SockCreate (IN SOCK_INIT_DATA *SockInitData) |
VOID | SockDestroy (IN OUT SOCKET *Sock) |
VOID | SockConnFlush (IN OUT SOCKET *Sock) |
VOID | SockSetState (IN OUT SOCKET *Sock, IN UINT8 State) |
SOCKET * | SockClone (IN SOCKET *Sock) |
VOID | SockConnEstablished (IN OUT SOCKET *Sock) |
VOID | SockConnClosed (IN OUT SOCKET *Sock) |
VOID | SockDataSent (IN OUT SOCKET *Sock, IN UINT32 Count) |
UINT32 | SockGetDataToSend (IN SOCKET *Sock, IN UINT32 Offset, IN UINT32 Len, OUT UINT8 *Dest) |
VOID | SockDataRcvd (IN OUT SOCKET *Sock, IN OUT NET_BUF *NetBuffer, IN UINT32 UrgLen) |
UINT32 | SockGetFreeSpace (IN SOCKET *Sock, IN UINT32 Which) |
VOID | SockNoMoreData (IN OUT SOCKET *Sock) |
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.
NET_BUF* SockBufFirst | ( | IN SOCK_BUFFER * | Sockbuf | ) |
Get the first buffer block in the specific socket buffer.
[in] | Sockbuf | Pointer to the socket buffer. |
Referenced by SockTcpDataToRcv().
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. |
Referenced by SockTcpDataToRcv().
Clone a new socket, including its associated protocol control block.
[in] | Sock | Pointer to the socket to be cloned. |
References _SOCK_INIT_DATA::BackLog, _TCP_SOCKET::ConfigureState, _SOCK_INIT_DATA::Context, _SOCK_INIT_DATA::CreateCallback, _SOCK_INIT_DATA::DataSize, _SOCK_INIT_DATA::DestroyCallback, _SOCK_INIT_DATA::DriverBinding, _SOCK_INIT_DATA::IpVersion, _SOCK_INIT_DATA::Parent, _SOCK_INIT_DATA::Protocol, _SOCK_INIT_DATA::ProtoData, _SOCK_INIT_DATA::ProtoHandler, _SOCK_INIT_DATA::RcvBufferSize, _SOCK_INIT_DATA::SndBufferSize, SO_CONNECTING, SockCreate(), SockSetState(), _SOCK_INIT_DATA::State, and _SOCK_INIT_DATA::Type.
Referenced by TcpCloneTcb().
VOID SockConnClosed | ( | IN OUT SOCKET * | Sock | ) |
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. |
References SIGNAL_TOKEN, SO_CLOSED, SockConnFlush(), SockDestroyChild(), and SockSetState().
Referenced by TcpSetState().
VOID SockConnEstablished | ( | IN OUT SOCKET * | Sock | ) |
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. |
References SO_CONNECTED, SO_CONNECTING, SockSetState(), SockWakeConnToken(), and SockWakeListenToken().
Referenced by TcpSetState().
VOID SockConnFlush | ( | IN OUT SOCKET * | Sock | ) |
Flush the sndBuffer and rcvBuffer of socket.
[in,out] | Sock | Pointer to the socket. |
References SIGNAL_TOKEN, SOCK_IS_LISTENING, SockDestroyChild(), and SockFlushPendingToken().
Referenced by SockConnClosed(), SockDestroy(), SockDestroyChild(), and SockFlush().
SOCKET* SockCreate | ( | IN SOCK_INIT_DATA * | SockInitData | ) |
Create a socket with initial data SockInitData.
[in] | SockInitData | Pointer to the initial data of the socket. |
References _TCP_SOCKET::BackLog, _TCP_SOCKET::ConnCnt, _TCP_SOCKET::ConnectionList, _TCP_SOCKET::Context, _TCP_SOCKET::CreateCallback, _SOCK_BUFFER::DataQueue, _TCP_SOCKET::DestroyCallback, _TCP_SOCKET::DriverBinding, _SOCK_BUFFER::HighWater, _TCP_SOCKET::IpVersion, _TCP_SOCKET::Link, _TCP_SOCKET::ListenTokenList, _TCP_SOCKET::Lock, _SOCK_BUFFER::LowWater, _TCP_SOCKET::NetProtocol, _TCP_SOCKET::Parent, _TCP_SOCKET::ProcessingSndTokenList, PROTO_RESERVED_LEN, _TCP_SOCKET::ProtoHandler, _TCP_SOCKET::ProtoReserved, _TCP_SOCKET::RcvBuffer, _TCP_SOCKET::RcvTokenList, _TCP_SOCKET::Signature, _TCP_SOCKET::SndBuffer, _TCP_SOCKET::SndTokenList, SOCK_BUFF_LOW_WATER, SOCK_IS_LISTENING, SOCK_SIGNATURE, _TCP_SOCKET::SockError, _TCP_SOCKET::SockHandle, SockStream, _TCP_SOCKET::State, and _TCP_SOCKET::Type.
Referenced by SockClone(), and SockCreateChild().
VOID SockDataRcvd | ( | IN OUT SOCKET * | Sock, | |
IN OUT NET_BUF * | NetBuffer, | |||
IN UINT32 | UrgLen | |||
) |
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. |
References SockWakeRcvToken().
Referenced by TcpDeliverData().
VOID SockDataSent | ( | IN OUT SOCKET * | Sock, | |
IN UINT32 | Count | |||
) |
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. |
References _SOCK_TOKEN::RemainDataLen, SIGNAL_TOKEN, SockProcessSndToken(), _SOCK_TOKEN::Token, and _SOCK_TOKEN::TokenList.
Referenced by TcpGetSegmentSock().
VOID SockDestroy | ( | IN OUT SOCKET * | Sock | ) |
Destroy a socket.
[in,out] | Sock | Pointer to the socket. |
References SO_CLOSED, SO_UNCONFIGURED, SOCK_IS_UNCONFIGURED, SockConnFlush(), SockSetState(), and SockStream.
Referenced by SockCreateChild(), and SockDestroyChild().
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. |
References SIGNAL_TOKEN, _SOCK_TOKEN::Token, and _SOCK_TOKEN::TokenList.
Referenced by SockConnFlush(), and SockNoMoreData().
VOID EFIAPI SockFreeFoo | ( | IN EFI_EVENT | Event | ) |
User provided callback function for NetbufFromExt.
[in] | Event | The Event this notify function registered to, ignored. |
Referenced by SockProcessTcpSndData().
UINT32 SockGetDataToSend | ( | IN SOCKET * | Sock, | |
IN UINT32 | Offset, | |||
IN UINT32 | Len, | |||
OUT UINT8 * | Dest | |||
) |
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. |
References SockStream.
Referenced by TcpGetSegmentSock().
UINT32 SockGetFreeSpace | ( | IN SOCKET * | Sock, | |
IN UINT32 | Which | |||
) |
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. |
References _SOCK_BUFFER::DataQueue, _SOCK_BUFFER::HighWater, SOCK_RCV_BUF, and SOCK_SND_BUF.
Referenced by SockProcessSndToken(), SockSend(), and TcpRcvWinNow().
VOID SockNoMoreData | ( | IN OUT SOCKET * | Sock | ) |
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. |
References GET_RCV_DATASIZE, SOCK_ERROR, SOCK_NO_MORE_DATA, and SockFlushPendingToken().
Referenced by TcpDeliverData().
UINT32 SockProcessRcvToken | ( | IN OUT SOCKET * | Sock, | |
IN OUT SOCK_IO_TOKEN * | RcvToken | |||
) |
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. |
References SIGNAL_TOKEN, SockSetTcpRxData(), SockStream, and SockTcpDataToRcv().
Referenced by SockRcv(), and SockWakeRcvToken().
VOID SockProcessSndToken | ( | IN OUT SOCKET * | Sock | ) |
Process the send token.
[in,out] | Sock | Pointer to the socket. |
References _SOCK_IO_TOKEN::Packet, SIGNAL_TOKEN, SOCK_SND_BUF, SockGetFreeSpace(), SockProcessTcpSndData(), SockStream, _SOCK_TOKEN::Token, _SOCK_TOKEN::TokenList, and SOCK_IO_DATA::TxData.
Referenced by SockDataSent(), and SockWakeConnToken().
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. |
References SOCK_SND, SOCK_SNDPUSH, SOCK_SNDURG, and SockFreeFoo().
Referenced by SockProcessSndToken(), and SockSend().
VOID SockSetState | ( | IN OUT SOCKET * | Sock, | |
IN UINT8 | State | |||
) |
Set the state of the socket.
[in,out] | Sock | Pointer to the socket. |
[in] | State | The new socket state to be set. |
Referenced by SockClone(), SockClose(), SockConnClosed(), SockConnect(), SockConnEstablished(), SockDestroy(), SockDestroyChild(), SockFlush(), and TcpConfigurePcb().
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. |
Referenced by SockProcessRcvToken().
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. |
References SockBufFirst(), SockBufNext(), and _TCP_RSV_DATA::UrgLen.
Referenced by SockProcessRcvToken().
VOID SockWakeConnToken | ( | IN OUT SOCKET * | Sock | ) |
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. |
References SIGNAL_TOKEN, and SockProcessSndToken().
Referenced by SockConnEstablished().
VOID SockWakeListenToken | ( | IN OUT SOCKET * | Sock | ) |
Wake up the listen token while the connection is established successfully.
[in,out] | Sock | Pointer to the socket. |
References _TCP_SOCKET::ConnCnt, _TCP_SOCKET::ListenTokenList, _TCP_SOCKET::Parent, SIGNAL_TOKEN, SOCK_IS_CONNECTED, SOCK_IS_LISTENING, _SOCK_TOKEN::Token, and _SOCK_TOKEN::TokenList.
Referenced by SockConnEstablished().
VOID SockWakeRcvToken | ( | IN OUT SOCKET * | Sock | ) |
Wake up the receive token while some data is received.
[in,out] | Sock | Pointer to the socket. |
References SockProcessRcvToken(), _SOCK_TOKEN::Token, and _SOCK_TOKEN::TokenList.
Referenced by SockDataRcvd().