]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Igmp.c
Scrubbed some files for IP4
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Igmp.c
index 70fbebdc44e0d886f2f61f1b84ea4cd0852aac70..029b365eac78c411b6989c11ab1b4e4d9ade4727 100644 (file)
@@ -36,14 +36,14 @@ UINT32  mRouteAlertOption = 0x00000494;
 \r
   @param  IpSb                   The IP4 service whose IGMP is to be initialized.\r
 \r
+  @retval EFI_SUCCESS            IGMP of the IpSb is successfully initialized.\r
   @retval EFI_OUT_OF_RESOURCES   Failed to allocate resource to initialize IGMP.\r
   @retval Others                 Failed to initialize the IGMP of IpSb.\r
-  @retval EFI_SUCCESS            IGMP of the IpSb is successfully initialized.\r
 \r
 **/\r
 EFI_STATUS\r
 Ip4InitIgmp (\r
-  IN IP4_SERVICE            *IpSb\r
+  IN OUT IP4_SERVICE            *IpSb\r
   )\r
 {\r
   IGMP_SERVICE_DATA             *IgmpCtrl;\r
@@ -56,7 +56,7 @@ Ip4InitIgmp (
   //\r
   // Configure MNP to receive ALL_SYSTEM multicast\r
   //\r
-  Group    = NetAllocatePool (sizeof (IGMP_GROUP));\r
+  Group    = AllocatePool (sizeof (IGMP_GROUP));\r
 \r
   if (Group == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
@@ -81,11 +81,11 @@ Ip4InitIgmp (
     goto ON_ERROR;\r
   }\r
 \r
-  NetListInsertHead (&IgmpCtrl->Groups, &Group->Link);\r
+  InsertHeadList (&IgmpCtrl->Groups, &Group->Link);\r
   return EFI_SUCCESS;\r
 \r
 ON_ERROR:\r
-  NetFreePool (Group);\r
+  gBS->FreePool (Group);\r
   return Status;\r
 }\r
 \r
@@ -98,8 +98,8 @@ ON_ERROR:
   @param  Address                The multicast address to search\r
 \r
   @return NULL if the multicast address isn't in the IGMP control block. Otherwise\r
-  @return the point to the IGMP_GROUP which contains the status of multicast group\r
-  @return for Address.\r
+          the point to the IGMP_GROUP which contains the status of multicast group\r
+          for Address.\r
 \r
 **/\r
 IGMP_GROUP *\r
@@ -108,7 +108,7 @@ Ip4FindGroup (
   IN IP4_ADDR               Address\r
   )\r
 {\r
-  NET_LIST_ENTRY            *Entry;\r
+  LIST_ENTRY                *Entry;\r
   IGMP_GROUP                *Group;\r
 \r
   NET_LIST_FOR_EACH (Entry, &IgmpCtrl->Groups) {\r
@@ -132,7 +132,7 @@ Ip4FindGroup (
   @param  Mac                    The MAC address to search\r
 \r
   @return The number of the IP4 multicast group that mapped to the same\r
-  @return multicast group Mac.\r
+          multicast group Mac.\r
 \r
 **/\r
 INTN\r
@@ -141,7 +141,7 @@ Ip4FindMac (
   IN EFI_MAC_ADDRESS        *Mac\r
   )\r
 {\r
-  NET_LIST_ENTRY            *Entry;\r
+  LIST_ENTRY                *Entry;\r
   IGMP_GROUP                *Group;\r
   INTN                      Count;\r
 \r
@@ -165,7 +165,7 @@ Ip4FindMac (
   @param  IpSb                   The IP4 service instance that requests the\r
                                  transmission\r
   @param  Dst                    The destinaton to send to\r
-  @param  Type                   The IGMP message type, such as IGMP v2 membership\r
+  @param  Type                   The IGMP message type, such as IGMP v1 membership\r
                                  report\r
   @param  Group                  The group address in the IGMP message head.\r
 \r
@@ -257,7 +257,7 @@ Ip4SendIgmpReport (
 \r
 \r
 /**\r
-  Join the multicast group on behavior of this IP4 child\r
+  Join the multicast group on behalf of this IP4 child\r
 \r
   @param  IpInstance             The IP4 child that wants to join the group\r
   @param  Address                The group to join\r
@@ -298,7 +298,7 @@ Ip4JoinGroup (
   // Otherwise, create a new IGMP_GROUP,  Get the multicast's MAC address,\r
   // send a report, then direct MNP to receive the multicast.\r
   //\r
-  Group = NetAllocatePool (sizeof (IGMP_GROUP));\r
+  Group = AllocatePool (sizeof (IGMP_GROUP));\r
 \r
   if (Group == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
@@ -327,17 +327,17 @@ Ip4JoinGroup (
     goto ON_ERROR;\r
   }\r
 \r
-  NetListInsertHead (&IgmpCtrl->Groups, &Group->Link);\r
+  InsertHeadList (&IgmpCtrl->Groups, &Group->Link);\r
   return EFI_SUCCESS;\r
 \r
 ON_ERROR:\r
-  NetFreePool (Group);\r
+  gBS->FreePool (Group);\r
   return Status;\r
 }\r
 \r
 \r
 /**\r
-  Leave the IP4 multicast group on behavior of IpInstance.\r
+  Leave the IP4 multicast group on behalf of IpInstance.\r
 \r
   @param  IpInstance             The IP4 child that wants to leave the group\r
                                  address\r
@@ -395,12 +395,12 @@ Ip4LeaveGroup (
   // Send a leave report if the membership is reported by us\r
   // and we are talking IGMPv2.\r
   //\r
-  if (Group->ReportByUs && !IgmpCtrl->Igmpv1QuerySeen) {\r
+  if (Group->ReportByUs && IgmpCtrl->Igmpv1QuerySeen == 0) {\r
     Ip4SendIgmpMessage (IpSb, IP4_ALLROUTER_ADDRESS, IGMP_LEAVE_GROUP, Group->Address);\r
   }\r
 \r
-  NetListRemoveEntry (&Group->Link);\r
-  NetFreePool (Group);\r
+  RemoveEntryList (&Group->Link);\r
+  gBS->FreePool (Group);\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -428,7 +428,7 @@ Ip4IgmpHandle (
   IGMP_HEAD                 Igmp;\r
   IGMP_GROUP                *Group;\r
   IP4_ADDR                  Address;\r
-  NET_LIST_ENTRY            *Entry;\r
+  LIST_ENTRY                *Entry;\r
 \r
   IgmpCtrl = &IpSb->IgmpCtrl;\r
 \r
@@ -450,7 +450,7 @@ Ip4IgmpHandle (
   switch (Igmp.Type) {\r
   case IGMP_MEMBERSHIP_QUERY:\r
     //\r
-    // If MaxRespTIme is zero, it is most likely that we are\r
+    // If MaxRespTime is zero, it is most likely that we are\r
     // talking to a V1 router\r
     //\r
     if (Igmp.MaxRespTime == 0) {\r
@@ -511,9 +511,9 @@ Ip4IgmpHandle (
   The periodical timer function for IGMP. It does the following\r
   things:\r
   1. Decrease the Igmpv1QuerySeen to make it possible to refresh\r
-  the IGMP server type.\r
+     the IGMP server type.\r
   2. Decrease the report timer for each IGMP group in "delaying\r
-  member" state.\r
+     member" state.\r
 \r
   @param  IpSb                   The IP4 service instance that is ticking\r
 \r
@@ -526,7 +526,7 @@ Ip4IgmpTicking (
   )\r
 {\r
   IGMP_SERVICE_DATA         *IgmpCtrl;\r
-  NET_LIST_ENTRY            *Entry;\r
+  LIST_ENTRY                *Entry;\r
   IGMP_GROUP                *Group;\r
 \r
   IgmpCtrl = &IpSb->IgmpCtrl;\r
@@ -566,7 +566,7 @@ Ip4IgmpTicking (
   @param  Addr                   The IP4 multicast address to add\r
 \r
   @return NULL if failed to allocate memory for the new groups,\r
-  @return otherwise the new combined group addresses.\r
+          otherwise the new combined group addresses.\r
 \r
 **/\r
 IP4_ADDR *\r
@@ -578,13 +578,13 @@ Ip4CombineGroups (
 {\r
   IP4_ADDR                  *Groups;\r
 \r
-  Groups = NetAllocatePool (sizeof (IP4_ADDR) * (Count + 1));\r
+  Groups = AllocatePool (sizeof (IP4_ADDR) * (Count + 1));\r
 \r
   if (Groups == NULL) {\r
     return NULL;\r
   }\r
 \r
-  NetCopyMem (Groups, Source, Count * sizeof (IP4_ADDR));\r
+  CopyMem (Groups, Source, Count * sizeof (IP4_ADDR));\r
   Groups[Count] = Addr;\r
 \r
   return Groups;\r
@@ -592,7 +592,7 @@ Ip4CombineGroups (
 \r
 \r
 /**\r
-  Remove a group address frome the array of group addresses.\r
+  Remove a group address from the array of group addresses.\r
   Although the function doesn't assume the byte order of the\r
   both Groups and Addr, the network byte order is used by\r
   the caller.\r
@@ -602,14 +602,14 @@ Ip4CombineGroups (
   @param  Addr                   The IP4 multicast address to remove\r
 \r
   @return The nubmer of group addresses in the Groups after remove.\r
-  @return It is Count if the Addr isn't in the Groups.\r
+          It is Count if the Addr isn't in the Groups.\r
 \r
 **/\r
 INTN\r
 Ip4RemoveGroupAddr (\r
-  IN IP4_ADDR               *Groups,\r
-  IN UINT32                 Count,\r
-  IN IP4_ADDR               Addr\r
+  IN OUT IP4_ADDR               *Groups,\r
+  IN     UINT32                 Count,\r
+  IN     IP4_ADDR               Addr\r
   )\r
 {\r
   UINT32                    Index;\r