NetworkPkg/TcpDxe/TcpDispatcher.c File Reference


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)

Detailed Description

The implementation of a dispatch routine for processing TCP requests.

(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
Copyright (c) 2009 - 2014, 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.


Function Documentation

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

Get the operational settings of this TCPv4 instance.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in,out] Mode Pointer to the buffer to store the operational settings.
Return values:
EFI_SUCCESS The mode data was read.
EFI_NOT_STARTED No configuration data is available because this instance hasn't been started.

References GET_BACKLOG, GET_RCV_BUFFSIZE, GET_SND_BUFFSIZE, SOCK_IS_CONFIGURED, _TCP_SOCKET::State, TCP_CTRL_NO_NAGLE, TCP_CTRL_NO_TS, TCP_CTRL_NO_WS, TCP_FLG_ON, TCP_LISTEN, and TCP_TICK_HZ.

Referenced by TcpDispatcher().

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] Tcb Pointer to the TCP_CB of this TCP instance.
[in] RouteInfo Pointer to the route information to be processed.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_NOT_STARTED The driver instance has not been started.
EFI_NO_MAPPING When using the default address, configuration(DHCP, BOOTP, RARP, etc.) is not finished yet.
EFI_OUT_OF_RESOURCES Could not add the entry to the routing table.
EFI_NOT_FOUND This route is not in the routing table (when RouteInfo->DeleteRoute is TRUE).
EFI_ACCESS_DENIED The route is already defined in the routing table (when RouteInfo->DeleteRoute is FALSE).

Referenced by TcpDispatcher().

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

Get the operational settings of this TCPv6 instance.

Parameters:
[in] Tcb Pointer to the TCP_CB of this TCP instance.
[in,out] Mode Pointer to the buffer to store the operational settings.
Return values:
EFI_SUCCESS The mode data was read.
EFI_NOT_STARTED No configuration data is available because this instance hasn't been started.

References GET_BACKLOG, GET_RCV_BUFFSIZE, GET_SND_BUFFSIZE, SOCK_IS_CONFIGURED, TCP_CTRL_NO_NAGLE, TCP_CTRL_NO_TS, TCP_CTRL_NO_WS, TCP_FLG_ON, TCP_LISTEN, and TCP_TICK_HZ.

Referenced by TcpDispatcher().

EFI_STATUS TcpAttachPcb ( IN SOCKET Sk  ) 

Attach a Pcb to the socket.

Parameters:
[in] Sk Pointer to the socket of this TCP instance.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_OUT_OF_RESOURCES Failed due to resource limits.

References _TCP_CONTROL_BLOCK::IpInfo, _TCP_SERVICE_DATA::IpIo, _TCP_CONTROL_BLOCK::List, _TCP_CONTROL_BLOCK::RcvQue, _TCP_CONTROL_BLOCK::Sk, _TCP_CONTROL_BLOCK::SndQue, _TCP_CONTROL_BLOCK::State, TCP_CLOSED, _TCP_PROTO_DATA::TcpPcb, and _TCP_PROTO_DATA::TcpService.

Referenced by TcpDispatcher().

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] TcpAp Pointer to the access point.
[in] IpVersion IP_VERSION_4 or IP_VERSION_6
Return values:
EFI_SUCCESS The check passed or the port is assigned.
EFI_INVALID_PARAMETER The non-zero station port is already used.
EFI_OUT_OF_RESOURCES No port can be allocated.

References mTcp4RandomPort, mTcp6RandomPort, TCP_PORT_KNOWN, TCP_PORT_USER_RESERVED, and TcpFindTcbByPeer().

Referenced by TcpConfigurePcb().

EFI_STATUS TcpConfigurePcb ( IN SOCKET Sk,
IN TCP_CONFIG_DATA CfgData 
)

Configure the Pcb using CfgData.

Parameters:
[in] Sk Pointer to the socket of this TCP instance.
[in] CfgData Pointer to the TCP configuration data.
Return values:
EFI_SUCCESS The operation completed successfully.
EFI_INVALID_PARAMETER A same access point has been configured in another TCP instance.
EFI_OUT_OF_RESOURCES Failed due to resource limits.

References _TCP_CONTROL_BLOCK::CongestState, _TCP_CONTROL_BLOCK::ConnectTimeout, _TCP_CONTROL_BLOCK::CtrlFlag, _TCP_CONTROL_BLOCK::CWnd, _TCP_CONTROL_BLOCK::FinWait2Timeout, _TCP_PEER::Ip, _TCP_CONTROL_BLOCK::IpInfo, _TCP_CONTROL_BLOCK::KeepAliveIdle, _TCP_CONTROL_BLOCK::KeepAlivePeriod, _TCP_CONTROL_BLOCK::LocalEnd, _TCP_CONTROL_BLOCK::MaxKeepAlive, _TCP_CONTROL_BLOCK::MaxRexmit, _TCP_PEER::Port, _TCP_CONTROL_BLOCK::RcvMss, _TCP_CONTROL_BLOCK::RcvQue, _TCP_CONTROL_BLOCK::RemoteEnd, _TCP_CONTROL_BLOCK::RemoteIpZero, _TCP_CONTROL_BLOCK::Rto, SET_BACKLOG, SET_RCV_BUFFSIZE, SET_SND_BUFFSIZE, _TCP_CONTROL_BLOCK::SndMss, _TCP_CONTROL_BLOCK::SndQue, SO_CONFIGURED_ACTIVE, SO_CONFIGURED_PASSIVE, SO_LISTENING, SockSetState(), _TCP_CONTROL_BLOCK::SRtt, _TCP_CONTROL_BLOCK::Ssthresh, _TCP_CONTROL_BLOCK::State, _TCP_CONTROL_BLOCK::SubnetMask, TCP6_REFRESH_NEIGHBOR_TICK, TCP_BACKLOG, TCP_BACKLOG_MIN, TCP_CLEAR_FLG, TCP_CLOSED, TCP_COMP_VAL, TCP_CONGEST_OPEN, TCP_CONNECT_TIME, TCP_CONNECT_TIME_MIN, TCP_CTRL_NO_KEEPALIVE, TCP_CTRL_NO_NAGLE, TCP_CTRL_NO_TS, TCP_CTRL_NO_WS, TCP_FIN_WAIT2_TIME, TCP_FIN_WAIT2_TIME_MAX, TCP_KEEPALIVE_IDLE_MAX, TCP_KEEPALIVE_IDLE_MIN, TCP_KEEPALIVE_PERIOD, TCP_KEEPALIVE_PERIOD_MIN, TCP_LISTEN, TCP_MAX_KEEPALIVE, TCP_MAX_KEEPALIVE_MIN, TCP_MAX_LOSS, TCP_MAX_LOSS_MIN, TCP_RCV_BUF_SIZE, TCP_RCV_BUF_SIZE_MIN, TCP_SET_FLG, TCP_SND_BUF_SIZE, TCP_SND_BUF_SIZE_MIN, TCP_TICK_HZ, TCP_TIME_WAIT_TIME, TCP_TIME_WAIT_TIME_MAX, TcpBind(), TcpGetRcvMss(), TcpInsertTcb(), TcpInstallDevicePath(), _TCP_PROTO_DATA::TcpPcb, TcpSetState(), _TCP_CONTROL_BLOCK::Tick, _TCP_CONTROL_BLOCK::TimeWaitTimeout, _TCP_CONTROL_BLOCK::Tos, _TCP_CONTROL_BLOCK::Ttl, and _TCP_CONTROL_BLOCK::UseDefaultAddr.

Referenced by TcpDispatcher().

VOID TcpDetachPcb ( IN OUT SOCKET Sk  ) 

Detach the Pcb of the socket.

Parameters:
[in,out] Sk Pointer to the socket of this TCP instance.

References _TCP_CONTROL_BLOCK::IpInfo, _TCP_SERVICE_DATA::IpIo, TcpFlushPcb(), _TCP_PROTO_DATA::TcpPcb, and _TCP_PROTO_DATA::TcpService.

Referenced by TcpDispatcher().

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

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

Parameters:
[in] Sock Pointer to the socket of this TCP instance.
[in] Request The code of this operation request.
[in] Data Pointer to the operation specific data passed in together with the operation request. This is an optional parameter that may be NULL.
Return values:
EFI_SUCCESS The socket request completed successfully.
other The error status returned by the corresponding TCP layer function.

References _TCP_CONTROL_BLOCK::CtrlFlag, GET_SND_DATASIZE, _TCP_SERVICE_DATA::IpIo, _TCP_SOCKET::IpVersion, _TCP_CONTROL_BLOCK::Sk, _TCP_CONTROL_BLOCK::SndPsh, _TCP_CONTROL_BLOCK::SndUp, SOCK_ABORT, SOCK_ATTACH, SOCK_CLOSE, SOCK_CONFIGURE, SOCK_CONNECT, SOCK_CONSUMED, SOCK_DETACH, SOCK_FLUSH, SOCK_MODE, SOCK_POLL, SOCK_ROUTE, SOCK_SND, SOCK_SNDPUSH, SOCK_SNDURG, Tcp4GetMode(), Tcp4Route(), Tcp6GetMode(), TCP_CTRL_SND_PSH, TCP_CTRL_SND_URG, TCP_SET_FLG, TcpAttachPcb(), TcpConfigurePcb(), TcpDetachPcb(), TcpFlushPcb(), TcpGetMaxSndNxt(), TcpOnAppAbort(), TcpOnAppClose(), TcpOnAppConnect(), TcpOnAppConsume(), TcpOnAppSend(), _TCP_PROTO_DATA::TcpPcb, and _TCP_PROTO_DATA::TcpService.

VOID TcpFlushPcb ( IN OUT TCP_CB Tcb  ) 

Flush the Tcb add its associated protocols.

Parameters:
[in,out] Tcb Pointer to the TCP_CB to be flushed.

References _TCP_SOCKET::DevicePath, SOCK_IS_CONFIGURED, _TCP_SOCKET::SockHandle, and TCP_CLOSED.

Referenced by TcpDetachPcb(), and TcpDispatcher().


Generated on Mon Sep 28 08:49:06 2015 for NetworkPkg[ALL] by  doxygen 1.5.7.1