Пример #1
0
int uip_poll(struct uip_driver_s *dev, uip_poll_callback_t callback)
{
  int bstop;

  /* Check for pendig IGMP messages */

#ifdef CONFIG_NET_IGMP
  bstop = uip_polligmp(dev, callback);
  if (!bstop)
#endif
    {
      /* Traverse all of the active TCP connections and perform the poll action */

      bstop = uip_polltcpconnections(dev, callback);
      if (!bstop)
        {
#ifdef CONFIG_NET_UDP
          /* Traverse all of the allocated UDP connections and perform the poll action */

          bstop = uip_polludpconnections(dev, callback);
          if (!bstop)
#endif
            {
#if defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING)
              /* Traverse all of the tasks waiting to send an ICMP ECHO request */

              bstop = uip_pollicmp(dev, callback);
#endif
            }
        }
    }

  return bstop;
}
Пример #2
0
int uip_timer(FAR struct uip_driver_s *dev, uip_poll_callback_t callback,
              int hsec)
{
    int bstop;

    /* Increment the timer used by the IP reassembly logic */

#if UIP_REASSEMBLY
    if (uip_reasstmr != 0 && uip_reasstmr < UIP_REASS_MAXAGE)
    {
        uip_reasstmr += hsec;
    }
#endif /* UIP_REASSEMBLY */

    /* Check for pendig IGMP messages */

#ifdef CONFIG_NET_IGMP
    bstop = uip_polligmp(dev, callback);
    if (!bstop)
#endif
    {
        /* Traverse all of the active TCP connections and perform the timer action */

        bstop = uip_polltcptimer(dev, callback, hsec);
        if (!bstop)
        {
            /* Traverse all of the allocated UDP connections and perform the poll action */

#ifdef CONFIG_NET_UDP
            bstop = uip_polludpconnections(dev, callback);
            if (!bstop)
#endif
            {
#if defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING)
                /* Traverse all of the tasks waiting to send an ICMP ECHO request */

                bstop = uip_pollicmp(dev, callback);
#endif
            }
        }
    }

    return bstop;
}