TianoCore EDK2 master
Loading...
Searching...
No Matches
TcpDispatcher.c File Reference
#include "TcpMain.h"

Go to the source code of this file.

Functions

EFI_STATUS Tcp4Route (IN TCP_CB *Tcb, IN TCP4_ROUTE_INFO *RouteInfo)
 
EFI_STATUS Tcp4GetMode (IN TCP_CB *Tcb, IN OUT TCP4_MODE_DATA *Mode)
 
EFI_STATUS Tcp6GetMode (IN TCP_CB *Tcb, IN OUT TCP6_MODE_DATA *Mode)
 
EFI_STATUS TcpBind (IN TCP_ACCESS_POINT *TcpAp, IN UINT8 IpVersion)
 
VOID TcpFlushPcb (IN OUT TCP_CB *Tcb)
 
EFI_STATUS TcpAttachPcb (IN SOCKET *Sk)
 
VOID TcpDetachPcb (IN OUT SOCKET *Sk)
 
EFI_STATUS TcpConfigurePcb (IN SOCKET *Sk, IN TCP_CONFIG_DATA *CfgData)
 
EFI_STATUS TcpDispatcher (IN SOCKET *Sock, IN UINT8 Request, IN VOID *Data OPTIONAL)
 

Detailed Description

The implementation of a dispatch routine for processing TCP requests.

(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.

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

Definition in file TcpDispatcher.c.

Function Documentation

◆ Tcp4GetMode()

EFI_STATUS Tcp4GetMode ( IN TCP_CB Tcb,
IN OUT TCP4_MODE_DATA Mode 
)

Get the operational settings of this TCPv4 instance.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in,out]ModePointer to the buffer to store the operational settings.
Return values
EFI_SUCCESSThe mode data was read.
EFI_NOT_STARTEDNo configuration data is available because this instance hasn't been started.

Definition at line 63 of file TcpDispatcher.c.

◆ Tcp4Route()

EFI_STATUS Tcp4Route ( IN TCP_CB Tcb,
IN TCP4_ROUTE_INFO RouteInfo 
)

Add or remove a route entry in the IP route table associated with this TCP instance.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in]RouteInfoPointer to the route information to be processed.
Return values
EFI_SUCCESSThe operation completed successfully.
EFI_NOT_STARTEDThe driver instance has not been started.
EFI_NO_MAPPINGWhen using the default address, configuration(DHCP, BOOTP, RARP, etc.) is not finished yet.
EFI_OUT_OF_RESOURCESCould not add the entry to the routing table.
EFI_NOT_FOUNDThis route is not in the routing table (when RouteInfo->DeleteRoute is TRUE).
EFI_ACCESS_DENIEDThe route is already defined in the routing table (when RouteInfo->DeleteRoute is FALSE).

Definition at line 30 of file TcpDispatcher.c.

◆ Tcp6GetMode()

EFI_STATUS Tcp6GetMode ( IN TCP_CB Tcb,
IN OUT TCP6_MODE_DATA Mode 
)

Get the operational settings of this TCPv6 instance.

Parameters
[in]TcbPointer to the TCP_CB of this TCP instance.
[in,out]ModePointer to the buffer to store the operational settings.
Return values
EFI_SUCCESSThe mode data was read.
EFI_NOT_STARTEDNo configuration data is available because this instance hasn't been started.

Definition at line 145 of file TcpDispatcher.c.

◆ TcpAttachPcb()

EFI_STATUS TcpAttachPcb ( IN SOCKET Sk)

Attach a Pcb to the socket.

Parameters
[in]SkPointer to the socket of this TCP instance.
Return values
EFI_SUCCESSThe operation completed successfully.
EFI_OUT_OF_RESOURCESFailed due to resource limits.

Definition at line 337 of file TcpDispatcher.c.

◆ TcpBind()

EFI_STATUS TcpBind ( IN TCP_ACCESS_POINT TcpAp,
IN UINT8  IpVersion 
)

If TcpAp->StationPort isn't zero, check whether the access point is registered, else generate a random station port for this access point.

Parameters
[in]TcpApPointer to the access point.
[in]IpVersionIP_VERSION_4 or IP_VERSION_6
Return values
EFI_SUCCESSThe check passed or the port is assigned.
EFI_INVALID_PARAMETERThe non-zero station port is already used.
EFI_OUT_OF_RESOURCESNo port can be allocated.

Definition at line 223 of file TcpDispatcher.c.

◆ TcpConfigurePcb()

EFI_STATUS TcpConfigurePcb ( IN SOCKET Sk,
IN TCP_CONFIG_DATA CfgData 
)

Configure the Pcb using CfgData.

Parameters
[in]SkPointer to the socket of this TCP instance.
[in]CfgDataPointer to the TCP configuration data.
Return values
EFI_SUCCESSThe operation completed successfully.
EFI_INVALID_PARAMETERA same access point has been configured in another TCP instance.
EFI_OUT_OF_RESOURCESFailed due to resource limits.

Definition at line 443 of file TcpDispatcher.c.

◆ TcpDetachPcb()

VOID TcpDetachPcb ( IN OUT SOCKET Sk)

Detach the Pcb of the socket.

Parameters
[in,out]SkPointer to the socket of this TCP instance.

Definition at line 409 of file TcpDispatcher.c.

◆ TcpDispatcher()

EFI_STATUS TcpDispatcher ( IN SOCKET Sock,
IN UINT8  Request,
IN VOID *Data  OPTIONAL 
)

The protocol handler provided to the socket layer, which is used to dispatch the socket level requests by calling the corresponding TCP layer functions.

Parameters
[in]SockPointer to the socket of this TCP instance.
[in]RequestThe code of this operation request.
[in]DataPointer to the operation specific data passed in together with the operation request. This is an optional parameter that may be NULL.
Return values
EFI_SUCCESSThe socket request completed successfully.
otherThe error status returned by the corresponding TCP layer function.

Definition at line 764 of file TcpDispatcher.c.

◆ TcpFlushPcb()

VOID TcpFlushPcb ( IN OUT TCP_CB Tcb)

Flush the Tcb add its associated protocols.

Parameters
[in,out]TcbPointer to the TCP_CB to be flushed.

Definition at line 293 of file TcpDispatcher.c.