/* Count the number of IP4 multicast groups that are mapped to the same MAC address. Several IP4 multicast address may be mapped to the same MAC address. */
INTN Ip4FindMac(IN IGMP_SERVICE_DATA *IgmpCtrl, IN EFI_MAC_ADDRESS *Mac)
/* Count the number of IP4 multicast groups that are mapped to the same MAC address. Several IP4 multicast address may be mapped to the same MAC address. */
INTN Ip4FindMac(IN IGMP_SERVICE_DATA *IgmpCtrl, IN EFI_MAC_ADDRESS *Mac)
{
  LIST_ENTRY  *Entry;
  IGMP_GROUP  *Group;
  INTN        Count;
  Count = 0;
  NET_LIST_FOR_EACH (Entry, &IgmpCtrl->Groups) {
    Group = NET_LIST_USER_STRUCT (Entry, IGMP_GROUP, Link);
    if (NET_MAC_EQUAL (&Group->Mac, Mac, sizeof (EFI_MAC_ADDRESS))) {
      Count++;
    }
  }
  return Count;
}