Microchip® Advanced Software Framework

lwip/lwip-1.4.1-dev/src/core/timers.c File Reference

Stack-internal timers implementation.

This file includes timer callbacks for stack-internal timers as well as functions to set up or stop timers and check for expired timers.

#include "lwip/opt.h"
#include "lwip/timers.h"
#include "lwip/tcp_impl.h"
#include "lwip/def.h"
#include "lwip/memp.h"
#include "lwip/tcpip.h"
#include "lwip/ip_frag.h"
#include "netif/etharp.h"
#include "lwip/dhcp.h"
#include "lwip/autoip.h"
#include "lwip/igmp.h"
#include "lwip/dns.h"
#include "lwip/nd6.h"
#include "lwip/ip6_frag.h"
#include "lwip/mld6.h"
#include "lwip/sys.h"
#include "lwip/pbuf.h"

Functions

static void arp_timer (void *arg)
 Timer callback function that calls etharp_tmr() and reschedules itself. More...
 
static void autoip_timer (void *arg)
 Timer callback function that calls autoip_tmr() and reschedules itself. More...
 
static void dhcp_timer_coarse (void *arg)
 Timer callback function that calls dhcp_coarse_tmr() and reschedules itself. More...
 
static void dhcp_timer_fine (void *arg)
 Timer callback function that calls dhcp_fine_tmr() and reschedules itself. More...
 
static void dns_timer (void *arg)
 Timer callback function that calls dns_tmr() and reschedules itself. More...
 
 if (timeout==NULL)
 
 if (next_timeout==NULL)
 
 if (next_timeout->time > msecs)
 
static void ip6_reass_timer (void *arg)
 Timer callback function that calls ip6_reass_tmr() and reschedules itself. More...
 
static void ip_reass_timer (void *arg)
 Timer callback function that calls ip_reass_tmr() and reschedules itself. More...
 
static void mld6_timer (void *arg)
 Timer callback function that calls mld6_tmr() and reschedules itself. More...
 
static void nd6_timer (void *arg)
 Timer callback function that calls nd6_tmr() and reschedules itself. More...
 
void sys_timeouts_init (void)
 Initialize this module. More...
 
void tcp_timer_needed (void)
 Called from TCP_REG when registering a new PCB: the reason is to have the TCP timer only running when there are active (or time-wait) PCBs. More...
 
static void tcpip_tcp_timer (void *arg)
 Timer callback function that calls tcp_tmr() and reschedules itself. More...
 

Variables

timeout arg = arg
 
timeout h = handler
 
timeout next = NULL
 
static struct sys_timeonext_timeout
 The one and only timeout list. More...
 
static int tcpip_tcp_timer_active
 global variable that shows if the tcp timer is currently scheduled or not More...
 
timeout time = msecs
 
 timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT)
 
 void
 Create a one-shot timer (aka timeout). More...
 

static void arp_timer ( void arg)
static

Timer callback function that calls etharp_tmr() and reschedules itself.

Parameters
argunused argument

References ARP_TMR_INTERVAL, etharp_tmr(), LWIP_DEBUGF, NULL, sys_timeout(), and TIMERS_DEBUG.

Referenced by sys_timeouts_init().

static void autoip_timer ( void arg)
static

Timer callback function that calls autoip_tmr() and reschedules itself.

Parameters
argunused argument

References autoip_tmr(), AUTOIP_TMR_INTERVAL, LWIP_DEBUGF, NULL, sys_timeout(), and TIMERS_DEBUG.

Referenced by sys_timeouts_init().

static void dhcp_timer_coarse ( void arg)
static

Timer callback function that calls dhcp_coarse_tmr() and reschedules itself.

Parameters
argunused argument

References DHCP_COARSE_TIMER_MSECS, dhcp_coarse_tmr(), LWIP_DEBUGF, NULL, sys_timeout(), and TIMERS_DEBUG.

Referenced by sys_timeouts_init().

static void dhcp_timer_fine ( void arg)
static

Timer callback function that calls dhcp_fine_tmr() and reschedules itself.

Parameters
argunused argument

References DHCP_FINE_TIMER_MSECS, dhcp_fine_tmr(), LWIP_DEBUGF, NULL, sys_timeout(), and TIMERS_DEBUG.

Referenced by sys_timeouts_init().

static void dns_timer ( void arg)
static

Timer callback function that calls dns_tmr() and reschedules itself.

Parameters
argunused argument

References dns_tmr(), DNS_TMR_INTERVAL, LWIP_DEBUGF, NULL, sys_timeout(), and TIMERS_DEBUG.

Referenced by sys_timeouts_init().

if ( timeout  = NULL)

References LWIP_ASSERT, and NULL.

if ( next_timeout  = NULL)

References timeout.

if ( next_timeout->  time,
msecs   
)
static void ip6_reass_timer ( void arg)
static

Timer callback function that calls ip6_reass_tmr() and reschedules itself.

Parameters
argunused argument

References ip6_reass_tmr(), IP6_REASS_TMR_INTERVAL, LWIP_DEBUGF, NULL, sys_timeout(), and TIMERS_DEBUG.

Referenced by sys_timeouts_init().

static void ip_reass_timer ( void arg)
static

Timer callback function that calls ip_reass_tmr() and reschedules itself.

Parameters
argunused argument

References ip_reass_tmr(), IP_TMR_INTERVAL, LWIP_DEBUGF, NULL, sys_timeout(), and TIMERS_DEBUG.

Referenced by sys_timeouts_init().

static void mld6_timer ( void arg)
static

Timer callback function that calls mld6_tmr() and reschedules itself.

Parameters
argunused argument

References LWIP_DEBUGF, mld6_tmr(), MLD6_TMR_INTERVAL, NULL, sys_timeout(), and TIMERS_DEBUG.

Referenced by sys_timeouts_init().

static void nd6_timer ( void arg)
static

Timer callback function that calls nd6_tmr() and reschedules itself.

Parameters
argunused argument

References LWIP_DEBUGF, nd6_tmr(), ND6_TMR_INTERVAL, NULL, sys_timeout(), and TIMERS_DEBUG.

Referenced by sys_timeouts_init().

void tcp_timer_needed ( void  )

Called from TCP_REG when registering a new PCB: the reason is to have the TCP timer only running when there are active (or time-wait) PCBs.

External function (implemented in timers.c), called when TCP detects that a timer is needed (i.e.

References NULL, sys_timeout(), tcp_active_pcbs, TCP_TMR_INTERVAL, tcp_tw_pcbs, tcpip_tcp_timer(), and tcpip_tcp_timer_active.

static void tcpip_tcp_timer ( void arg)
static

Timer callback function that calls tcp_tmr() and reschedules itself.

Parameters
argunused argument

References NULL, sys_timeout(), tcp_active_pcbs, tcp_tmr(), TCP_TMR_INTERVAL, tcp_tw_pcbs, and tcpip_tcp_timer_active.

Referenced by tcp_timer_needed().

timeout h = handler

Referenced by tcpip_timeout(), and tcpip_untimeout().

struct sys_timeo* next_timeout
static

The one and only timeout list.

Referenced by if().

int tcpip_tcp_timer_active
static

global variable that shows if the tcp timer is currently scheduled or not

Referenced by tcp_timer_needed(), and tcpip_tcp_timer().

timeout time = msecs
timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT)
void
Initial value:
{
struct sys_timeo *timeout, *t
timeout
Definition: lwip/lwip-1.4.1-dev/src/core/timers.c:333
Definition: lwip/lwip-1.4.1-dev/src/include/lwip/timers.h:67

Create a one-shot timer (aka timeout).

Timeouts are processed in the following cases:

Parameters
msecstime in milliseconds after that the timer should expire
handlercallback function to call when msecs have elapsed
argargument to pass to the callback function

Referenced by nd6_select_router(), netif_null_output_ip6(), pmc_enable_waitmode(), portTASK_FUNCTION(), prvHelpCommand(), prvInitialiseTCBVariables(), prvProcessExpiredTimer(), prvProcessReceivedCommands(), prvSwitchTimerLists(), prvTimerTask(), stdio_serial_init(), vTaskPrioritySet(), xQueueCreateMutex(), xQueueGenericCreate(), xQueueGenericReceive(), and xQueueGenericSend().