/* Enqueue a received packet to all the IP children that share the same interface. */
INTN Ip6InterfaceEnquePacket(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet, IN IP6_INTERFACE *IpIf)
/* Enqueue a received packet to all the IP children that share the same interface. */
INTN Ip6InterfaceEnquePacket(IN IP6_SERVICE *IpSb, IN EFI_IP6_HEADER *Head, IN NET_BUF *Packet, IN IP6_INTERFACE *IpIf)
{
  IP6_PROTOCOL   *IpInstance;
  IP6_CLIP_INFO  *Info;
  LIST_ENTRY     *Entry;
  INTN           Enqueued;
  INTN           LocalType;
  INTN           SavedType;
  LocalType = 0;
  Info      = IP6_GET_CLIP_INFO (Packet);
  if (IpIf->PromiscRecv) {
    LocalType = Ip6Promiscuous;
  } else {
    LocalType = Info->CastType;
  }
  SavedType      = Info->CastType;
  Info->CastType = (UINT32)LocalType;
  Enqueued = 0;
  NET_LIST_FOR_EACH (Entry, &IpIf->IpInstances) {
    IpInstance = NET_LIST_USER_STRUCT (Entry, IP6_PROTOCOL, AddrLink);
    NET_CHECK_SIGNATURE (IpInstance, IP6_PROTOCOL_SIGNATURE);
    if (Ip6InstanceEnquePacket (IpInstance, Head, Packet) == EFI_SUCCESS) {
      Enqueued++;
    }
  }
  Info->CastType = (UINT32)SavedType;
  return Enqueued;
}