EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index
Functions

MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c File Reference

#include "SockImpl.h"

Go to the source code of this file.

Functions

UINT32 SockTcpDataToRcv (IN SOCK_BUFFER *SockBuffer, OUT BOOLEAN *IsUrg, IN UINT32 BufLen)
VOID SockProcessSndToken (IN OUT SOCKET *Sock)
VOID EFIAPI SockFreeFoo (IN EFI_EVENT Event)
VOID SockSetTcpRxData (IN SOCKET *Sock, IN VOID *TcpRxData, IN UINT32 RcvdBytes, IN BOOLEAN IsOOB)
UINT32 SockProcessRcvToken (IN SOCKET *Sock, IN OUT SOCK_IO_TOKEN *RcvToken)
EFI_STATUS SockProcessTcpSndData (IN SOCKET *Sock, IN VOID *TcpTxData)
VOID SockFlushPendingToken (IN SOCKET *Sock, IN LIST_ENTRY *PendingTokenList)
VOID SockWakeConnToken (IN OUT SOCKET *Sock)
VOID SockWakeListenToken (IN OUT SOCKET *Sock)
VOID SockWakeRcvToken (IN SOCKET *Sock)
SOCKETSockCreate (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)
SOCKETSockClone (IN SOCKET *Sock)
VOID SockConnEstablished (IN SOCKET *Sock)
VOID SockConnClosed (IN OUT SOCKET *Sock)
VOID SockDataSent (IN SOCKET *Sock, IN UINT32 Count)
UINT32 SockGetDataToSend (IN SOCKET *Sock, IN UINT32 Offset, IN UINT32 Len, IN UINT8 *Dest)
VOID SockDataRcvd (IN SOCKET *Sock, IN OUT NET_BUF *NetBuffer, IN UINT32 UrgLen)
UINT32 SockGetFreeSpace (IN SOCKET *Sock, IN UINT32 Which)
VOID SockRcvdErr (IN OUT SOCKET *Sock, IN EFI_STATUS Error)
VOID SockNoMoreData (IN OUT SOCKET *Sock)
NET_BUFSockBufFirst (IN SOCK_BUFFER *Sockbuf)
NET_BUFSockBufNext (IN SOCK_BUFFER *Sockbuf, IN NET_BUF *SockEntry)

Detailed Description

Implementation of the Socket.

Copyright (c) 2005 - 2009, 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.

Definition in file SockImpl.c.


Function Documentation

NET_BUF* SockBufFirst ( IN SOCK_BUFFER Sockbuf)

Get the first buffer block in the specific socket buffer.

Parameters:
SockbufPointer to the socket buffer.
Returns:
Pointer to the first buffer in the queue. NULL if the queue is empty.

Definition at line 1237 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.

Parameters:
SockbufPointer to the socket buffer.
SockEntryPointer to the buffer block prior to the required one.
Returns:
Pointer to the buffer block next to SockEntry. NULL if SockEntry is the tail or head entry.

Definition at line 1265 of file SockImpl.c.

SOCKET* SockClone ( IN SOCKET Sock)

Clone a new socket including its associated protocol control block.

Parameters:
SockPointer to the socket to be cloned.
Returns:
Pointer to the newly cloned socket. If NULL, error condition occurred.

Definition at line 899 of file SockImpl.c.

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.

Parameters:
SockPointer to the socket associated with the closed connection.

Definition at line 976 of file SockImpl.c.

VOID SockConnEstablished ( IN 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.

Parameters:
SockPointer to the socket associated with the established connection.

Definition at line 946 of file SockImpl.c.

VOID SockConnFlush ( IN OUT SOCKET Sock)

Flush the sndBuffer and rcvBuffer of socket.

Parameters:
SockPointer to the socket.

Definition at line 815 of file SockImpl.c.

SOCKET* SockCreate ( IN SOCK_INIT_DATA SockInitData)

Create a socket with initial data SockInitData.

Parameters:
SockInitDataPointer to the initial data of the socket.
Returns:
Pointer to the newly created socket, return NULL when exception occured.

Definition at line 552 of file SockImpl.c.

VOID SockDataRcvd ( IN 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 ther urgent data length and then check if any receive token can be signaled.

Parameters:
SockPointer to the socket.
NetBufferPointer to the buffer that contains the received data.
UrgLenThe length of the urgent data in the received data.

Definition at line 1098 of file SockImpl.c.

VOID SockDataSent ( IN SOCKET Sock,
IN UINT32  Count 
)

Called by low layer protocol to indicate that some data is sent or processed.

This function trims the sent data in the socket send buffer, signals the data token if proper.

Parameters:
SockPointer to the socket.
CountThe length of the data processed or sent, in bytes.

Definition at line 1006 of file SockImpl.c.

VOID SockDestroy ( IN OUT SOCKET Sock)

Destroy a socket.

Parameters:
SockPointer to the socket.

Definition at line 716 of file SockImpl.c.

VOID SockFlushPendingToken ( IN SOCKET Sock,
IN LIST_ENTRY PendingTokenList 
)

Flush the tokens in the specific token list.

Parameters:
SockPointer to the socket.
PendingTokenListPointer to the token list to be flushed.

Definition at line 328 of file SockImpl.c.

VOID EFIAPI SockFreeFoo ( IN EFI_EVENT  Event)

Supporting function for both SockImpl and SockInterface.

Parameters:
EventThe Event this notify function registered to, ignored.

Definition at line 56 of file SockImpl.c.

UINT32 SockGetDataToSend ( IN SOCKET Sock,
IN UINT32  Offset,
IN UINT32  Len,
IN UINT8 Dest 
)

Called by the low layer protocol to copy some data in socket send buffer starting from the specific offset to a buffer provided by the caller.

Parameters:
SockPointer to the socket.
OffsetThe start point of the data to be copied.
LenThe length of the data to be copied.
DestPointer to the destination to copy the data.
Returns:
The data size copied.

Definition at line 1067 of file SockImpl.c.

UINT32 SockGetFreeSpace ( IN SOCKET Sock,
IN UINT32  Which 
)

Get the length of the free space of the specific socket buffer.

Parameters:
SockPointer to the socket.
WhichFlag to indicate which socket buffer to check, either send buffer or receive buffer.
Returns:
The length of the free space, in bytes.

Definition at line 1129 of file SockImpl.c.

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 set the socket's state to SO_NO_MORE_DATA and signal all queued IO tokens with the error status EFI_CONNECTION_FIN.

Parameters:
SockPointer to the socket.

Definition at line 1203 of file SockImpl.c.

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

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

Parameters:
SockPointer to the socket.
RcvTokenPointer to the application provided receive token.
Returns:
The length of data received in this token.

Definition at line 208 of file SockImpl.c.

VOID SockProcessSndToken ( IN OUT SOCKET Sock)

Process the send token.

Parameters:
SockPointer to the socket.

Definition at line 474 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.

Parameters:
SockPointer to the socket.
TcpTxDataPointer to the application provided send buffer.
Return values:
EFI_SUCCESSThe operation is completed successfully.
EFI_OUT_OF_RESOURCESFailed due to resource limit.

Definition at line 254 of file SockImpl.c.

VOID SockRcvdErr ( IN OUT SOCKET Sock,
IN EFI_STATUS  Error 
)

Signal the receive token with the specific error or set socket error code after error is received.

Parameters:
SockPointer to the socket.
ErrorThe error code received.

Definition at line 1165 of file SockImpl.c.

VOID SockSetState ( IN OUT SOCKET Sock,
IN UINT8  State 
)

Set the state of the socket.

Parameters:
SockPointer to the socket.
StateThe new socket state to be set.

Definition at line 881 of file SockImpl.c.

VOID SockSetTcpRxData ( IN SOCKET Sock,
IN VOID *  TcpRxData,
IN UINT32  RcvdBytes,
IN BOOLEAN  IsOOB 
)

Copy data from socket buffer to application provided receive buffer.

Parameters:
SockPointer to the socket.
TcpRxDataPointer to the application provided receive buffer.
RcvdBytesThe maximum length of the data can be copied.
IsOOBIf TURE the data is OOB, FALSE the data is normal.

Definition at line 157 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.

Parameters:
SockBufferPointer to the socket receive buffer.
IsUrgPointer to a BOOLEAN variable. If TRUE the data is OOB.
BufLenThe maximum length of the data buffer to store the received data in socket layer.
Returns:
The length of the data can be retreived.

Definition at line 78 of file SockImpl.c.

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.

Parameters:
SockPointer to the socket.

Definition at line 362 of file SockImpl.c.

VOID SockWakeListenToken ( IN OUT SOCKET Sock)

Wake up the listen token while the connection is established successfully.

Parameters:
SockPointer to the socket.

Definition at line 386 of file SockImpl.c.

VOID SockWakeRcvToken ( IN SOCKET Sock)

Wake up the receive token while some data is received.

Parameters:
SockPointer to the socket.

Definition at line 430 of file SockImpl.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines