Microchip® Advanced Software Framework

lwip_timers_140.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"

Functions

static void arp_timer (void *arg)
 Timer callback function that calls etharp_tmr() and reschedules itself. More...
 
 if (timeout==NULL)
 
 if (next_timeout==NULL)
 
 if (next_timeout->time > msecs)
 
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, LWIP_UNUSED_ARG, NULL, sys_timeout(), and TIMERS_DEBUG.

Referenced by sys_timeouts_init().

if ( next_timeout  = NULL)

References timeout.

if ( next_timeout->  time,
msecs   
)
void sys_timeouts_init ( void  )

Initialize this module.

References arp_timer(), ARP_TMR_INTERVAL, NULL, sys_now(), and sys_timeout().

Referenced by lwip_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 LWIP_UNUSED_ARG, 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
void
Initial value:
{
struct sys_timeo *timeout, *t
timeout
Definition: lwip_timers_140.c:269
Definition: lwip/lwip-1.4.0/src/include/lwip/timers.h:65

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 host_check_class(), host_disable_all_pipes(), host_get_data(), host_send_data(), host_transfer_control(), low_level_input(), low_level_output(), portTASK_FUNCTION(), prvInitialiseTCBVariables(), pxdatalog_log_alloc_init(), usb_device_task_init(), usb_general_interrupt_non_naked(), usb_host_task(), usb_host_task_init(), usb_set_feature(), usb_user_endpoint_init(), xQueueGenericReceive(), and xQueueGenericSend().