TianoCore EDK2 master
Loading...
Searching...
No Matches
SockImpl.h File Reference
#include "Socket.h"
#include "TcpMain.h"

Go to the source code of this file.

Macros

#define SIGNAL_TOKEN(Token, TokenStatus)
 
#define SOCK_HEADER_SPACE   (60 + 60 + 72)
 

Functions

EFI_STATUS SockProcessTcpSndData (IN SOCKET *Sock, IN VOID *TcpTxData)
 
UINT32 SockProcessRcvToken (IN OUT SOCKET *Sock, IN OUT SOCK_IO_TOKEN *RcvToken)
 
VOID SockConnFlush (IN OUT SOCKET *Sock)
 
EFI_STATUS SockCancelToken (IN SOCK_COMPLETION_TOKEN *Token, IN OUT LIST_ENTRY *SpecifiedTokenList)
 
SOCKETSockCreate (IN SOCK_INIT_DATA *SockInitData)
 
VOID SockDestroy (IN OUT SOCKET *Sock)
 

Detailed Description

The function declaration that provided for Socket Interface.

Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file SockImpl.h.

Macro Definition Documentation

◆ SIGNAL_TOKEN

#define SIGNAL_TOKEN (   Token,
  TokenStatus 
)
Value:
do { \
(Token)->Status = (TokenStatus); \
gBS->SignalEvent ((Token)->Event); \
} while (0)
EFI_BOOT_SERVICES * gBS

Signal a event with the given status.

Parameters
[in]TokenThe token's event is to be signaled.
[in]TokenStatusThe status to be sent with the event.

Definition at line 23 of file SockImpl.h.

◆ SOCK_HEADER_SPACE

#define SOCK_HEADER_SPACE   (60 + 60 + 72)

Definition at line 29 of file SockImpl.h.

Function Documentation

◆ SockCancelToken()

EFI_STATUS SockCancelToken ( IN SOCK_COMPLETION_TOKEN Token,
IN OUT LIST_ENTRY SpecifiedTokenList 
)

Cancel the tokens in the specific token list.

Parameters
[in]TokenPointer to the Token. If NULL, all tokens in SpecifiedTokenList will be canceled.
[in,out]SpecifiedTokenListPointer to the token list to be checked.
Return values
EFI_SUCCESSCancel the tokens in the specific token listsuccessfully.
EFI_NOT_FOUNDThe Token is not found in SpecifiedTokenList.

Definition at line 573 of file SockImpl.c.

◆ SockConnFlush()

VOID SockConnFlush ( IN OUT SOCKET Sock)

Flush the sndBuffer and rcvBuffer of socket.

Parameters
[in,out]SockPointer to the socket.

Definition at line 857 of file SockImpl.c.

◆ SockCreate()

SOCKET * SockCreate ( IN SOCK_INIT_DATA SockInitData)

Create a socket with initial data SockInitData.

Parameters
[in]SockInitDataPointer to the initial data of the socket.
Returns
Pointer to the newly created socket, return NULL when exception occurred.

Create a socket with initial data SockInitData.

Parameters
[in]SockInitDataPointer to the initial data of the socket.
Returns
Pointer to the newly created socket, return NULL when an exception occurs.

Definition at line 633 of file SockImpl.c.

◆ SockDestroy()

VOID SockDestroy ( IN OUT SOCKET Sock)

Destroy a socket.

Parameters
[in,out]SockPointer to the socket.

Definition at line 809 of file SockImpl.c.

◆ SockProcessRcvToken()

UINT32 SockProcessRcvToken ( IN OUT SOCKET Sock,
IN OUT SOCK_IO_TOKEN RcvToken 
)

Get received data from the socket layer to the receive token.

Parameters
[in,out]SockPointer to the socket.
[in,out]RcvTokenPointer to the application provided receive token.
Returns
The length of data received in this token.

Definition at line 304 of file SockImpl.c.

◆ SockProcessTcpSndData()

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.

Parameters
[in]SockPointer to the socket.
[in]TcpTxDataPointer to the application provided send buffer.
Return values
EFI_SUCCESSThe operation completed successfully.
EFI_OUT_OF_RESOURCESFailed due to resource limits.

Process the TCP send data, buffer the tcp txdata, and append the buffer to socket send buffer, then try to send it.

Parameters
[in]SockPointer to the socket.
[in]TcpTxDataPointer to the application provided send buffer.
Return values
EFI_SUCCESSThe operation completed successfully.
EFI_OUT_OF_RESOURCESFailed due to resource limits.

Definition at line 349 of file SockImpl.c.