]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c
Use Mde library and definition instead of some native definitions in NetLib, to simpl...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Dhcp4Dxe / Dhcp4Option.c
index cf811998396769a1cb7869858be2e948f5930f94..04a40074e3cd060e8ca920d9a81418c48590ca0f 100644 (file)
@@ -526,7 +526,7 @@ DhcpFillOption (
     Options[Index].Data = Buf + OptCount[Tag].Offset;\r
   }\r
 \r
-  NetCopyMem (Buf + OptCount[Tag].Offset, Data, Len);\r
+  CopyMem (Buf + OptCount[Tag].Offset, Data, Len);\r
 \r
   OptCount[Tag].Offset  = (UINT16) (OptCount[Tag].Offset + Len);\r
   Options[Index].Len    = (UINT16) (Options[Index].Len + Len);\r
@@ -582,7 +582,7 @@ DhcpParseOption (
   // First compute how many options and how long each option is\r
   // with the "Key indexed counting" algorithms.\r
   //\r
-  OptCount = NetAllocateZeroPool (DHCP_MAX_OPTIONS * sizeof (DHCP_OPTION_COUNT));\r
+  OptCount = AllocateZeroPool (DHCP_MAX_OPTIONS * sizeof (DHCP_OPTION_COUNT));\r
 \r
   if (OptCount == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
@@ -624,7 +624,7 @@ DhcpParseOption (
   // Allocate a buffer to hold the DHCP options, and after that, a\r
   // continuous buffer to put all the options' data.\r
   //\r
-  Options = NetAllocateZeroPool (OptNum * sizeof (DHCP_OPTION) + TotalLen);\r
+  Options = AllocateZeroPool (OptNum * sizeof (DHCP_OPTION) + TotalLen);\r
 \r
   if (Options == NULL) {\r
     Status = EFI_OUT_OF_RESOURCES;\r
@@ -638,14 +638,14 @@ DhcpParseOption (
   Status          = DhcpIterateOptions (Packet, DhcpFillOption, &Context);\r
 \r
   if (EFI_ERROR (Status)) {\r
-    NetFreePool (Options);\r
+    gBS->FreePool (Options);\r
     goto ON_EXIT;\r
   }\r
 \r
   *OptionPoint = Options;\r
 \r
 ON_EXIT:\r
-  NetFreePool (OptCount);\r
+  gBS->FreePool (OptCount);\r
   return Status;\r
 }\r
 \r
@@ -689,7 +689,7 @@ DhcpValidateOptions (
   }\r
 \r
   Updated = FALSE;\r
-  NetZeroMem (&Parameter, sizeof (Parameter));\r
+  ZeroMem (&Parameter, sizeof (Parameter));\r
 \r
   for (Index = 0; Index < Count; Index++) {\r
     Option = &AllOption[Index];\r
@@ -722,7 +722,7 @@ DhcpValidateOptions (
   }\r
 \r
   if (Updated && (Para != NULL)) {\r
-    if ((*Para = NetAllocatePool (sizeof (DHCP_PARAMETER))) == NULL) {\r
+    if ((*Para = AllocatePool (sizeof (DHCP_PARAMETER))) == NULL) {\r
       Status = EFI_OUT_OF_RESOURCES;\r
       goto ON_EXIT;\r
     }\r
@@ -731,7 +731,7 @@ DhcpValidateOptions (
   }\r
 \r
 ON_EXIT:\r
-  NetFreePool (AllOption);\r
+  gBS->FreePool (AllOption);\r
   return Status;\r
 }\r
 \r
@@ -767,7 +767,7 @@ DhcpAppendOption (
 \r
     *(Buf++) = Tag;\r
     *(Buf++) = (UINT8) Len;\r
-    NetCopyMem (Buf, Data + Index * 255, Len);\r
+    CopyMem (Buf, Data + Index * 255, Len);\r
 \r
     Buf     += Len;\r
   }\r
@@ -815,7 +815,7 @@ DhcpBuild (
   // Use an array of DHCP_OPTION to mark the existance\r
   // and position of each valid options.\r
   //\r
-  Mark = NetAllocatePool (sizeof (DHCP_OPTION) * DHCP_MAX_OPTIONS);\r
+  Mark = AllocatePool (sizeof (DHCP_OPTION) * DHCP_MAX_OPTIONS);\r
 \r
   if (Mark == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
@@ -871,7 +871,7 @@ DhcpBuild (
   }\r
 \r
   Status  = EFI_OUT_OF_RESOURCES;\r
-  Packet  = (EFI_DHCP4_PACKET *) NetAllocatePool (Len);\r
+  Packet  = (EFI_DHCP4_PACKET *) AllocatePool (Len);\r
 \r
   if (Packet == NULL) {\r
     goto ON_ERROR;\r
@@ -898,9 +898,9 @@ DhcpBuild (
 \r
 ON_ERROR:\r
   if (SeedOptions != NULL) {\r
-    NetFreePool (SeedOptions);\r
+    gBS->FreePool (SeedOptions);\r
   }\r
 \r
-  NetFreePool (Mark);\r
+  gBS->FreePool (Mark);\r
   return Status;\r
 }\r