]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c
1. Update the UdpIo to a combined UdpIo to support both v4 and v6 stack.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Mtftp4Dxe / Mtftp4Support.c
index 5c8516f6307496fb60dabb078beaeb3ded02cbb2..a758f4bb0c998c3e9ba24c802ce83481e617331e 100644 (file)
@@ -359,7 +359,7 @@ Mtftp4SendError (
   It simply frees the packet.\r
 \r
   @param  Packet                The transmitted (or failed to) packet\r
-  @param  Points                The local and remote UDP access point\r
+  @param  EndPoint              The local and remote UDP access point\r
   @param  IoStatus              The result of the transmission\r
   @param  Context               Opaque parameter to the callback\r
 \r
@@ -367,7 +367,7 @@ Mtftp4SendError (
 VOID\r
 Mtftp4OnPacketSent (\r
   IN NET_BUF                   *Packet,\r
-  IN UDP_POINTS                *Points,\r
+  IN UDP_END_POINT             *EndPoint,\r
   IN EFI_STATUS                IoStatus,\r
   IN VOID                      *Context\r
   )\r
@@ -415,7 +415,7 @@ Mtftp4SendPacket (
   IN OUT NET_BUF                *Packet\r
   )\r
 {\r
-  UDP_POINTS                UdpPoint;\r
+  UDP_END_POINT             UdpPoint;\r
   EFI_STATUS                Status;\r
   UINT16                    OpCode;\r
   UINT16                    Value;\r
@@ -427,14 +427,13 @@ Mtftp4SendPacket (
     NetbufFree (Instance->LastPacket);\r
   }\r
 \r
-  Instance->LastPacket  = Packet;\r
+  Instance->LastPacket        = Packet;\r
 \r
-  Instance->CurRetry    = 0;\r
+  Instance->CurRetry          = 0;\r
   Mtftp4SetTimeout (Instance);\r
 \r
-  UdpPoint.LocalAddr    = 0;\r
-  UdpPoint.LocalPort    = 0;\r
-  UdpPoint.RemoteAddr   = Instance->ServerIp;\r
+  ZeroMem (&UdpPoint, sizeof (UdpPoint));\r
+  UdpPoint.RemoteAddr.Addr[0] = Instance->ServerIp;\r
 \r
   //\r
   // Send the requests to the listening port, other packets\r
@@ -457,7 +456,7 @@ Mtftp4SendPacket (
              Instance->UnicastPort,\r
              Packet,\r
              &UdpPoint,\r
-             0,\r
+             NULL,\r
              Mtftp4OnPacketSent,\r
              Instance\r
              );\r
@@ -484,16 +483,15 @@ Mtftp4Retransmit (
   IN MTFTP4_PROTOCOL        *Instance\r
   )\r
 {\r
-  UDP_POINTS                UdpPoint;\r
+  UDP_END_POINT             UdpPoint;\r
   EFI_STATUS                Status;\r
   UINT16                    OpCode;\r
   UINT16                    Value;\r
 \r
   ASSERT (Instance->LastPacket != NULL);\r
 \r
-  UdpPoint.LocalAddr  = 0;\r
-  UdpPoint.LocalPort  = 0;\r
-  UdpPoint.RemoteAddr = Instance->ServerIp;\r
+  ZeroMem (&UdpPoint, sizeof (UdpPoint));\r
+  UdpPoint.RemoteAddr.Addr[0] = Instance->ServerIp;\r
 \r
   //\r
   // Set the requests to the listening port, other packets to the connected port\r
@@ -514,7 +512,7 @@ Mtftp4Retransmit (
              Instance->UnicastPort,\r
              Instance->LastPacket,\r
              &UdpPoint,\r
-             0,\r
+             NULL,\r
              Mtftp4OnPacketSent,\r
              Instance\r
              );\r