/* The periodical timer function for IGMP. It does the following things: */
VOID Ip4IgmpTicking(IN IP4_SERVICE *IpSb)
/* The periodical timer function for IGMP. It does the following things: */
VOID Ip4IgmpTicking(IN IP4_SERVICE *IpSb)
{
  IGMP_SERVICE_DATA  *IgmpCtrl;
  LIST_ENTRY         *Entry;
  IGMP_GROUP         *Group;
  IgmpCtrl = &IpSb->IgmpCtrl;
  if (IgmpCtrl->Igmpv1QuerySeen > 0) {
    IgmpCtrl->Igmpv1QuerySeen--;
  }
  NET_LIST_FOR_EACH (Entry, &IgmpCtrl->Groups) {
    Group = NET_LIST_USER_STRUCT (Entry, IGMP_GROUP, Link);
    ASSERT (Group->DelayTime >= 0);
    if (Group->DelayTime > 0) {
      Group->DelayTime--;
      if (Group->DelayTime == 0) {
        Ip4SendIgmpReport (IpSb, Group->Address);
        Group->ReportByUs = TRUE;
      }
    }
  }
}