]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/TcpDxe/TcpDispatcher.c
MdeModulePkg-DxeCore: rename CoreGetMemoryMapPropertiesTable
[mirror_edk2.git] / NetworkPkg / TcpDxe / TcpDispatcher.c
index d3d2cb1c3a7d0359c9daef4d2589deccefd77ecd..d4bc8ace5597604a0b6e0279efdaa64289690307 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
   The implementation of a dispatch routine for processing TCP requests.\r
 \r
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
+  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -98,12 +99,12 @@ Tcp4GetMode (
 \r
     AccessPoint->UseDefaultAddress   = Tcb->UseDefaultAddr;\r
 \r
-    CopyMem (&AccessPoint->StationAddress, &Tcb->LocalEnd.Ip, sizeof (EFI_IPv4_ADDRESS));\r
+    IP4_COPY_ADDRESS (&AccessPoint->StationAddress, &Tcb->LocalEnd.Ip);\r
 \r
-    AccessPoint->SubnetMask          = Tcb->SubnetMask;\r
+    IP4_COPY_ADDRESS (&AccessPoint->SubnetMask, &Tcb->SubnetMask);\r
     AccessPoint->StationPort         = NTOHS (Tcb->LocalEnd.Port);\r
 \r
-    CopyMem (&AccessPoint->RemoteAddress, &Tcb->RemoteEnd.Ip, sizeof (EFI_IPv4_ADDRESS));\r
+    IP4_COPY_ADDRESS (&AccessPoint->RemoteAddress, &Tcb->RemoteEnd.Ip);\r
 \r
     AccessPoint->RemotePort          = NTOHS (Tcb->RemoteEnd.Port);\r
     AccessPoint->ActiveFlag          = (BOOLEAN) (Tcb->State != TCP_LISTEN);\r
@@ -239,7 +240,7 @@ TcpBind (
   UINT16          *RandomPort;\r
 \r
   if (IpVersion == IP_VERSION_4) {\r
-    CopyMem (&Local, &TcpAp->Tcp4Ap.StationAddress, sizeof (EFI_IPv4_ADDRESS));\r
+    IP4_COPY_ADDRESS (&Local, &TcpAp->Tcp4Ap.StationAddress);\r
     Port       = &TcpAp->Tcp4Ap.StationPort;\r
     RandomPort = &mTcp4RandomPort;\r
   } else {\r
@@ -304,12 +305,10 @@ TcpFlushPcb (
   )\r
 {\r
   SOCKET                    *Sock;\r
-  TCP_PROTO_DATA            *TcpProto;\r
 \r
   IpIoConfigIp (Tcb->IpInfo, NULL);\r
 \r
   Sock     = Tcb->Sk;\r
-  TcpProto = (TCP_PROTO_DATA *) Sock->ProtoReserved;\r
 \r
   if (SOCK_IS_CONFIGURED (Sock)) {\r
     RemoveEntryList (&Tcb->List);\r
@@ -327,8 +326,6 @@ TcpFlushPcb (
       FreePool (Sock->DevicePath);\r
       Sock->DevicePath = NULL;\r
     }\r
-\r
-    TcpSetVariableData (TcpProto->TcpService);\r
   }\r
 \r
   NetbufFreeList (&Tcb->SndQue);\r
@@ -499,12 +496,14 @@ TcpConfigurePcb (
     IpCfgData.Ip4CfgData.TypeOfService      = CfgData->Tcp4CfgData.TypeOfService;\r
     IpCfgData.Ip4CfgData.TimeToLive         = CfgData->Tcp4CfgData.TimeToLive;\r
     IpCfgData.Ip4CfgData.UseDefaultAddress  = CfgData->Tcp4CfgData.AccessPoint.UseDefaultAddress;\r
-    IpCfgData.Ip4CfgData.SubnetMask         = CfgData->Tcp4CfgData.AccessPoint.SubnetMask;\r
+    IP4_COPY_ADDRESS (\r
+      &IpCfgData.Ip4CfgData.SubnetMask,\r
+      &CfgData->Tcp4CfgData.AccessPoint.SubnetMask\r
+      );\r
     IpCfgData.Ip4CfgData.ReceiveTimeout     = (UINT32) (-1);\r
-    CopyMem (\r
+    IP4_COPY_ADDRESS (\r
       &IpCfgData.Ip4CfgData.StationAddress,\r
-      &CfgData->Tcp4CfgData.AccessPoint.StationAddress,\r
-      sizeof (EFI_IPv4_ADDRESS)\r
+      &CfgData->Tcp4CfgData.AccessPoint.StationAddress\r
       );\r
 \r
   } else {\r
@@ -537,8 +536,14 @@ TcpConfigurePcb (
     //\r
     // Get the default address information if the instance is configured to use default address.\r
     //\r
-    CfgData->Tcp4CfgData.AccessPoint.StationAddress = IpCfgData.Ip4CfgData.StationAddress;\r
-    CfgData->Tcp4CfgData.AccessPoint.SubnetMask     = IpCfgData.Ip4CfgData.SubnetMask;\r
+    IP4_COPY_ADDRESS (\r
+      &CfgData->Tcp4CfgData.AccessPoint.StationAddress,\r
+      &IpCfgData.Ip4CfgData.StationAddress\r
+      );\r
+    IP4_COPY_ADDRESS (\r
+      &CfgData->Tcp4CfgData.AccessPoint.SubnetMask,\r
+      &IpCfgData.Ip4CfgData.SubnetMask\r
+      );\r
 \r
     TcpAp = (TCP_ACCESS_POINT *) &CfgData->Tcp4CfgData.AccessPoint;\r
   } else {\r
@@ -605,7 +610,7 @@ TcpConfigurePcb (
 \r
     CopyMem (&Tcb->LocalEnd.Ip, &CfgData->Tcp4CfgData.AccessPoint.StationAddress, sizeof (IP4_ADDR));\r
     Tcb->LocalEnd.Port  = HTONS (CfgData->Tcp4CfgData.AccessPoint.StationPort);\r
-    Tcb->SubnetMask     = CfgData->Tcp4CfgData.AccessPoint.SubnetMask;\r
+    IP4_COPY_ADDRESS (&Tcb->SubnetMask, &CfgData->Tcp4CfgData.AccessPoint.SubnetMask);\r
 \r
     CopyMem (&Tcb->RemoteEnd.Ip, &CfgData->Tcp4CfgData.AccessPoint.RemoteAddress, sizeof (IP4_ADDR));\r
     Tcb->RemoteEnd.Port = HTONS (CfgData->Tcp4CfgData.AccessPoint.RemotePort);\r