/** @file\r
Tcp request dispatcher implementation.\r
\r
-Copyright (c) 2005 - 2009, Intel Corporation<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php<BR>\r
IN TCP4_ROUTE_INFO *RouteInfo\r
)\r
{\r
- EFI_IP4_PROTOCOL *Ip;\r
+ EFI_IP4_PROTOCOL *Ip4;\r
\r
- Ip = Tcb->IpInfo->Ip;\r
+ Ip4 = Tcb->IpInfo->Ip.Ip4;\r
\r
- ASSERT (Ip != NULL);\r
+ ASSERT (Ip4 != NULL);\r
\r
- return Ip->Routes (\r
- Ip,\r
+ return Ip4->Routes (\r
+ Ip4,\r
RouteInfo->DeleteRoute,\r
RouteInfo->SubnetAddress,\r
RouteInfo->SubnetMask,\r
RouteInfo->GatewayAddress\r
);\r
- \r
+\r
}\r
\r
\r
}\r
}\r
\r
- Ip = Tcb->IpInfo->Ip;\r
+ Ip = Tcb->IpInfo->Ip.Ip4;\r
ASSERT (Ip != NULL);\r
\r
return Ip->GetModeData (Ip, Mode->Ip4ModeData, Mode->MnpConfigData, Mode->SnpModeData);\r
RemoveEntryList (&Tcb->List);\r
\r
//\r
- // Uninstall the device path protocl.\r
+ // Uninstall the device path protocol.\r
//\r
- gBS->UninstallProtocolInterface (\r
- Sock->SockHandle,\r
- &gEfiDevicePathProtocolGuid,\r
- Sock->DevicePath\r
- );\r
- gBS->FreePool (Sock->DevicePath);\r
+ if (Sock->DevicePath != NULL) {\r
+ gBS->UninstallProtocolInterface (\r
+ Sock->SockHandle,\r
+ &gEfiDevicePathProtocolGuid,\r
+ Sock->DevicePath\r
+ );\r
+ FreePool (Sock->DevicePath);\r
+ }\r
\r
TcpSetVariableData (TcpProto->TcpService);\r
}\r
Attach a Pcb to the socket.\r
\r
@param Sk Pointer to the socket of this TCP instance.\r
- \r
+\r
@retval EFI_SUCCESS The operation is completed successfully.\r
@retval EFI_OUT_OF_RESOURCES Failed due to resource limit.\r
\r
Tcb->IpInfo = IpIoAddIp (IpIo);\r
if (Tcb->IpInfo == NULL) {\r
\r
- gBS->FreePool (Tcb);\r
+ FreePool (Tcb);\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
Detach the Pcb of the socket.\r
\r
@param Sk Pointer to the socket of this TCP instance.\r
- \r
+\r
**/\r
VOID\r
Tcp4DetachPcb (\r
\r
IpIoRemoveIp (ProtoData->TcpService->IpIo, Tcb->IpInfo);\r
\r
- gBS->FreePool (Tcb);\r
+ FreePool (Tcb);\r
\r
ProtoData->TcpPcb = NULL;\r
}\r
(UINT32) (Option->ConnectionTimeout * TCP_TICK_HZ)\r
);\r
\r
- if (Option->EnableNagle == FALSE) {\r
+ if (!Option->EnableNagle) {\r
TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_NO_NAGLE);\r
}\r
\r
- if (Option->EnableTimeStamp == FALSE) {\r
+ if (!Option->EnableTimeStamp) {\r
TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_NO_TS);\r
}\r
\r
- if (Option->EnableWindowScaling == FALSE) {\r
+ if (!Option->EnableWindowScaling) {\r
TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_NO_WS);\r
}\r
}\r
//\r
// update state of Tcb and socket\r
//\r
- if (CfgData->AccessPoint.ActiveFlag == FALSE) {\r
+ if (!CfgData->AccessPoint.ActiveFlag) {\r
\r
TcpSetState (Tcb, TCP_LISTEN);\r
SockSetState (Sk, SO_LISTENING);\r
EFI_STATUS\r
Tcp4Dispatcher (\r
IN SOCKET *Sock,\r
- IN SOCK_REQUEST Request,\r
+ IN UINT8 Request,\r
IN VOID *Data OPTIONAL\r
)\r
{\r
\r
switch (Request) {\r
case SOCK_POLL:\r
- Ip = (EFI_IP4_PROTOCOL *) (ProtoData->TcpService->IpIo->Ip);\r
+ Ip = ProtoData->TcpService->IpIo->Ip.Ip4;\r
Ip->Poll (Ip);\r
break;\r
\r