]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
[Change summary]:
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Mtftp4Dxe / Mtftp4Impl.c
index 4c459b22b88f40a3e54bacc6c243f1498b3a1861..229a35578a155c20d4cec28c18e823341c15bd94 100644 (file)
@@ -50,7 +50,7 @@ Mtftp4CleanOperation (
   }\r
 \r
   ASSERT (Instance->UnicastPort != NULL);\r
-  UdpIoCleanPort (Instance->UnicastPort);\r
+  UdpIoCleanIo (Instance->UnicastPort);\r
 \r
   if (Instance->LastPacket != NULL) {\r
     NetbufFree (Instance->LastPacket);\r
@@ -58,7 +58,7 @@ Mtftp4CleanOperation (
   }\r
 \r
   if (Instance->McastUdpPort != NULL) {\r
-    UdpIoFreePort (Instance->McastUdpPort);\r
+    UdpIoFreeIo (Instance->McastUdpPort);\r
     Instance->McastUdpPort = NULL;\r
   }\r
 \r
@@ -178,7 +178,7 @@ Mtftp4OverrideValid (
   IP4_ADDR                  Gateway;\r
 \r
   CopyMem (&Ip, &Override->ServerIp, sizeof (IP4_ADDR));\r
-  if (!Ip4IsUnicast (NTOHL (Ip), 0)) {\r
+  if (!NetIp4IsUnicast (NTOHL (Ip), 0)) {\r
     return FALSE;\r
   }\r
 \r
@@ -194,7 +194,7 @@ Mtftp4OverrideValid (
     Netmask = NTOHL (Netmask);\r
     Ip      = NTOHL (Ip);\r
 \r
-    if (!Ip4IsUnicast (Gateway, Netmask) || !IP4_NET_EQUAL (Gateway, Ip, Netmask)) {\r
+    if (!NetIp4IsUnicast (Gateway, Netmask) || !IP4_NET_EQUAL (Gateway, Ip, Netmask)) {\r
       return FALSE;\r
     }\r
   }\r
@@ -211,9 +211,8 @@ Mtftp4OverrideValid (
   the UDP is reconfigured.\r
 \r
   @param  Instance               The Mtftp instance\r
-  @param  UdpPort                The UDP port to poll\r
-  @param  UdpCfgData             The UDP configure data to reconfigure the UDP\r
-                                 port.\r
+  @param  UdpIo                  The UDP_IO to poll\r
+  @param  UdpCfgData             The UDP configure data to reconfigure the UDP_IO\r
 \r
   @retval TRUE                   The default address is retrieved and UDP is reconfigured.\r
   @retval FALSE                  Some error occured.\r
@@ -222,7 +221,7 @@ Mtftp4OverrideValid (
 BOOLEAN\r
 Mtftp4GetMapping (\r
   IN MTFTP4_PROTOCOL        *Instance,\r
-  IN UDP_IO_PORT            *UdpPort,\r
+  IN UDP_IO                 *UdpIo,\r
   IN EFI_UDP4_CONFIG_DATA   *UdpCfgData\r
   )\r
 {\r
@@ -234,7 +233,7 @@ Mtftp4GetMapping (
   ASSERT (Instance->Config.UseDefaultSetting);\r
 \r
   Service = Instance->Service;\r
-  Udp     = UdpPort->Udp;\r
+  Udp     = UdpIo->Protocol.Udp4;\r
 \r
   Status = gBS->SetTimer (\r
                   Service->TimerToGetMap,\r
@@ -263,7 +262,7 @@ Mtftp4GetMapping (
 /**\r
   Configure the UDP port for unicast receiving.\r
 \r
-  @param  UdpIo                  The UDP port\r
+  @param  UdpIo                  The UDP_IO instance\r
   @param  Instance               The MTFTP session\r
 \r
   @retval EFI_SUCCESS            The UDP port is successfully configured for the\r
@@ -272,7 +271,7 @@ Mtftp4GetMapping (
 **/\r
 EFI_STATUS\r
 Mtftp4ConfigUnicastPort (\r
-  IN UDP_IO_PORT            *UdpIo,\r
+  IN UDP_IO                 *UdpIo,\r
   IN MTFTP4_PROTOCOL        *Instance\r
   )\r
 {\r
@@ -301,7 +300,7 @@ Mtftp4ConfigUnicastPort (
   Ip = HTONL (Instance->ServerIp);\r
   CopyMem (&UdpConfig.RemoteAddress, &Ip, sizeof (EFI_IPv4_ADDRESS));\r
 \r
-  Status = UdpIo->Udp->Configure (UdpIo->Udp, &UdpConfig);\r
+  Status = UdpIo->Protocol.Udp4->Configure (UdpIo->Protocol.Udp4, &UdpConfig);\r
 \r
   if ((Status == EFI_NO_MAPPING) && Mtftp4GetMapping (Instance, UdpIo, &UdpConfig)) {\r
     return EFI_SUCCESS;\r
@@ -312,9 +311,15 @@ Mtftp4ConfigUnicastPort (
     // The station IP address is manually configured and the Gateway IP is not 0.\r
     // Add the default route for this UDP instance.\r
     //\r
-    Status = UdpIo->Udp->Routes (UdpIo->Udp, FALSE, &mZeroIp4Addr, &mZeroIp4Addr, &Config->GatewayIp);\r
+    Status = UdpIo->Protocol.Udp4->Routes (\r
+                                     UdpIo->Protocol.Udp4,\r
+                                     FALSE,\r
+                                     &mZeroIp4Addr,\r
+                                     &mZeroIp4Addr,\r
+                                     &Config->GatewayIp\r
+                                     );\r
     if (EFI_ERROR (Status)) {\r
-      UdpIo->Udp->Configure (UdpIo->Udp, NULL);\r
+      UdpIo->Protocol.Udp4->Configure (UdpIo->Protocol.Udp4, NULL);\r
     }\r
   }\r
   return Status;\r
@@ -648,18 +653,18 @@ EfiMtftp4Configure (
     Gateway  = NTOHL (Gateway);\r
     ServerIp = NTOHL (ServerIp);\r
 \r
-    if (!Ip4IsUnicast (ServerIp, 0)) {\r
+    if (!NetIp4IsUnicast (ServerIp, 0)) {\r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
     if (!ConfigData->UseDefaultSetting &&\r
-       ((!IP4_IS_VALID_NETMASK (Netmask) || !Ip4IsUnicast (Ip, Netmask)))) {\r
+       ((!IP4_IS_VALID_NETMASK (Netmask) || !NetIp4IsUnicast (Ip, Netmask)))) {\r
 \r
       return EFI_INVALID_PARAMETER;\r
     }\r
 \r
     if ((Gateway != 0) &&\r
-        (!IP4_NET_EQUAL (Gateway, Ip, Netmask) || !Ip4IsUnicast (Gateway, Netmask))) {\r
+        (!IP4_NET_EQUAL (Gateway, Ip, Netmask) || !NetIp4IsUnicast (Gateway, Netmask))) {\r
 \r
       return EFI_INVALID_PARAMETER;\r
     }\r
@@ -1070,7 +1075,7 @@ EfiMtftp4Poll (
     return EFI_DEVICE_ERROR;\r
   }\r
 \r
-  Udp = Instance->UnicastPort->Udp;\r
+  Udp = Instance->UnicastPort->Protocol.Udp4;\r
   return Udp->Poll (Udp);\r
 }\r
 \r