lwip-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-members] timers setup question


From: Jani Monoses
Subject: [lwip-members] timers setup question
Date: Tue, 19 Nov 2002 11:51:46 +0200

Hi
would there be a drawback to having timer setups already written inside DHCP 
and etharp?
Both require the user to call them at specified intervals but the code to do 
that IMHO
is arch independent.
this is how they look in my code:

in the netif setting up the etharp timer:

....
 sys_timeout(ARP_TMR_INTERVAL, (sys_timeout_handler)arp_timer, NULL);
...
and 

static void
arp_timer(void *arg)
{
  etharp_tmr();
  sys_timeout(ARP_TMR_INTERVAL, (sys_timeout_handler)arp_timer, NULL);
}

and in misc init code setting un the DHCP timers:

static void dhcp_fine_timer(void *arg)
{
        dhcp_fine_tmr();
        sys_timeout(DHCP_FINE_TIMER_MSECS, 
(sys_timeout_handler)dhcp_fine_timer, NULL);
}

static void dhcp_coarse_timer(void *arg)
{
        dhcp_coarse_tmr();
        sys_timeout(DHCP_COARSE_TIMER_SECS, 
(sys_timeout_handler)dhcp_coarse_timer, NULL);
}

void setup_dhcp_timers()
{
  sys_timeout(DHCP_FINE_TIMER_MSECS, (sys_timeout_handler)dhcp_fine_timer, 
NULL);
  sys_timeout(DHCP_COARSE_TIMER_SECS, (sys_timeout_handler)dhcp_coarse_timer, 
NULL);
}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]