]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Common.c
synced function header
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Common.c
index ac339bee5240a315704e6fe7cb26f745155a3526..89a371400b872894b092f6f2f983a9da334f243a 100644 (file)
@@ -23,7 +23,7 @@ Abstract:
 \r
 \r
 /**\r
-  Return the cast type (Unicast/Boradcast) specific to a\r
+  Return the cast type (Unicast/Boradcast) specific to an\r
   interface. All the addresses are host byte ordered.\r
 \r
   @param  IpAddr                The IP address to classify in host byte order\r
@@ -34,6 +34,7 @@ Abstract:
   @retval IP4_SUBNET_BROADCAST  The IpAddr is a directed subnet boradcast to  the\r
                                 interface\r
   @retval IP4_NET_BROADCAST     The IpAddr is a network broadcast to the interface\r
+  @retval 0                     Otherwise.\r
 \r
 **/\r
 INTN\r
@@ -69,8 +70,8 @@ Ip4GetNetCast (
   @param  Src                   The source address in the packet (host byte order)\r
 \r
   @return The cast type for the Dst, it will return on the first non-promiscuous\r
-  @return cast type to a configured interface. If the packet doesn't match any of\r
-  @return the interface, multicast address and local broadcast address are checked.\r
+          cast type to a configured interface. If the packet doesn't match any of\r
+          the interface, multicast address and local broadcast address are checked.\r
 \r
 **/\r
 INTN\r
@@ -80,7 +81,7 @@ Ip4GetHostCast (
   IN  IP4_ADDR          Src\r
   )\r
 {\r
-  NET_LIST_ENTRY        *Entry;\r
+  LIST_ENTRY            *Entry;\r
   IP4_INTERFACE         *IpIf;\r
   INTN                  Type;\r
   INTN                  Class;\r
@@ -119,11 +120,11 @@ Ip4GetHostCast (
   if (Dst == IP4_ALLONE_ADDRESS) {\r
     IpIf = Ip4FindNet (IpSb, Src);\r
 \r
-    if (IpIf && !IP4_IS_BROADCAST (Ip4GetNetCast (Src, IpIf))) {\r
+    if (IpIf != NULL && !IP4_IS_BROADCAST (Ip4GetNetCast (Src, IpIf))) {\r
       return IP4_LOCAL_BROADCAST;\r
     }\r
 \r
-  } else if (IP4_IS_MULTICAST (Dst) && Ip4FindGroup (&IpSb->IgmpCtrl, Dst)) {\r
+  } else if (IP4_IS_MULTICAST (Dst) && Ip4FindGroup (&IpSb->IgmpCtrl, Dst) != NULL) {\r
     return IP4_MULTICAST;\r
   }\r
 \r
@@ -132,7 +133,7 @@ Ip4GetHostCast (
 \r
 \r
 /**\r
-  Find an interface whose configured IP address is Ip\r
+  Find an interface whose configured IP address is Ip.\r
 \r
   @param  IpSb                  The IP4 service binding instance\r
   @param  Ip                    The Ip address (host byte order) to find\r
@@ -146,7 +147,7 @@ Ip4FindInterface (
   IN IP4_ADDR           Ip\r
   )\r
 {\r
-  NET_LIST_ENTRY        *Entry;\r
+  LIST_ENTRY            *Entry;\r
   IP4_INTERFACE         *IpIf;\r
 \r
   NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {\r
@@ -176,7 +177,7 @@ Ip4FindNet (
   IN IP4_ADDR           Ip\r
   )\r
 {\r
-  NET_LIST_ENTRY        *Entry;\r
+  LIST_ENTRY            *Entry;\r
   IP4_INTERFACE         *IpIf;\r
 \r
   NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {\r
@@ -208,7 +209,7 @@ Ip4FindStationAddress (
   IN IP4_ADDR           Netmask\r
   )\r
 {\r
-  NET_LIST_ENTRY  *Entry;\r
+  LIST_ENTRY      *Entry;\r
   IP4_INTERFACE   *IpIf;\r
 \r
   NET_LIST_FOR_EACH (Entry, &IpSb->Interfaces) {\r
@@ -232,8 +233,9 @@ Ip4FindStationAddress (
   @param  Multicast             The multicast IP address to translate.\r
   @param  Mac                   The buffer to hold the translated address.\r
 \r
-  @return Returns EFI_SUCCESS if the multicast IP is successfully\r
-  @return translated to a multicast MAC address. Otherwise some error.\r
+  @retval EFI_SUCCESS if the multicast IP is successfully translated to a\r
+                      multicast MAC address.\r
+  @retval other       Otherwise some error.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -277,9 +279,13 @@ Ip4NtohHead (
 \r
 /**\r
   Set the Ip4 variable data.\r
+  \r
+  Save the list of all of the IPv4 addresses and subnet masks that are currently\r
+  being used to volatile variable storage.\r
 \r
   @param  IpSb                  Ip4 service binding instance\r
 \r
+  @retval EFI_SUCCESS           Successfully set variable.\r
   @retval EFI_OUT_OF_RESOURCES  There are not enough resources to set the variable.\r
   @retval other                 Set variable failed.\r
 \r
@@ -290,7 +296,7 @@ Ip4SetVariableData (
   )\r
 {\r
   UINT32                 NumConfiguredInstance;\r
-  NET_LIST_ENTRY         *Entry;\r
+  LIST_ENTRY             *Entry;\r
   UINTN                  VariableDataSize;\r
   EFI_IP4_VARIABLE_DATA  *Ip4VariableData;\r
   EFI_IP4_ADDRESS_PAIR   *Ip4AddressPair;\r
@@ -322,7 +328,7 @@ Ip4SetVariableData (
     VariableDataSize += sizeof (EFI_IP4_ADDRESS_PAIR) * (NumConfiguredInstance - 1);\r
   }\r
 \r
-  Ip4VariableData = NetAllocatePool (VariableDataSize);\r
+  Ip4VariableData = AllocatePool (VariableDataSize);\r
   if (Ip4VariableData == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
@@ -372,7 +378,7 @@ Ip4SetVariableData (
              );\r
     }\r
 \r
-    NetFreePool (IpSb->MacString);\r
+    gBS->FreePool (IpSb->MacString);\r
   }\r
 \r
   IpSb->MacString = NewMacString;\r
@@ -387,7 +393,7 @@ Ip4SetVariableData (
 \r
 ON_ERROR:\r
 \r
-  NetFreePool (Ip4VariableData);\r
+  gBS->FreePool (Ip4VariableData);\r
 \r
   return Status;\r
 }\r
@@ -416,6 +422,6 @@ Ip4ClearVariableData (
          NULL\r
          );\r
 \r
-  NetFreePool (IpSb->MacString);\r
+  gBS->FreePool (IpSb->MacString);\r
   IpSb->MacString = NULL;\r
 }\r