/* Match the received packet with the instance receive filters. */
BOOLEAN MnpMatchPacket(IN MNP_INSTANCE_DATA *Instance, IN EFI_MANAGED_NETWORK_RECEIVE_DATA *RxData, IN MNP_GROUP_ADDRESS *GroupAddress OPTIONAL, IN UINT8 PktAttr)
/* Match the received packet with the instance receive filters. */
BOOLEAN MnpMatchPacket(IN MNP_INSTANCE_DATA *Instance, IN EFI_MANAGED_NETWORK_RECEIVE_DATA *RxData, IN MNP_GROUP_ADDRESS *GroupAddress OPTIONAL, IN UINT8 PktAttr)
{
  EFI_MANAGED_NETWORK_CONFIG_DATA  *ConfigData;
  LIST_ENTRY                       *Entry;
  MNP_GROUP_CONTROL_BLOCK          *GroupCtrlBlk;
  NET_CHECK_SIGNATURE (Instance, MNP_INSTANCE_DATA_SIGNATURE);
  ConfigData = &Instance->ConfigData;
  if ((ConfigData->ProtocolTypeFilter != 0) && (ConfigData->ProtocolTypeFilter != RxData->ProtocolType)) {
    return FALSE;
  }
  if (ConfigData->EnablePromiscuousReceive) {
    return TRUE;
  }
  if ((Instance->ReceiveFilter & PktAttr) != 0) {
    return TRUE;
  }
  if (ConfigData->EnableMulticastReceive && RxData->MulticastFlag) {
    ASSERT (GroupAddress != NULL);
    NET_LIST_FOR_EACH (Entry, &Instance->GroupCtrlBlkList) {
      GroupCtrlBlk = NET_LIST_USER_STRUCT (Entry, MNP_GROUP_CONTROL_BLOCK, CtrlBlkEntry);
      if (GroupCtrlBlk->GroupAddress == GroupAddress) {
        return TRUE;
      }
    }
  }
  return FALSE;
}