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/sys.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) | |
static void | ip_reass_timer (void *arg) |
Timer callback function that calls ip_reass_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_timeo * | next_timeout |
Fix lwIP warning in standalone mode. 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) | |
static u32_t | timeouts_last_time |
void | |
Create a one-shot timer (aka timeout). More... | |
Timer callback function that calls etharp_tmr() and reschedules itself.
arg | unused argument |
References ARP_TMR_INTERVAL, etharp_tmr(), LWIP_DEBUGF, LWIP_UNUSED_ARG, NULL, sys_timeout(), and TIMERS_DEBUG.
Referenced by sys_timeouts_init().
References LWIP_ASSERT, and NULL.
Referenced by etharp_query(), icmp_input(), ip_frag(), ip_input(), ip_reass(), ip_reass_chain_frag_into_datagram_and_validate(), ip_reass_free_complete_datagram(), pbuf_header(), tcp_zero_window_probe(), and udp_input().
if | ( | next_timeout | = = NULL | ) |
References timeout.
if | ( | next_timeout-> | time, |
msecs | |||
) |
References sys_timeo::next, next_timeout, sys_timeo::time, and timeout.
Timer callback function that calls ip_reass_tmr() and reschedules itself.
arg | unused argument |
References ip_reass_tmr(), IP_TMR_INTERVAL, LWIP_DEBUGF, LWIP_UNUSED_ARG, NULL, sys_timeout(), and TIMERS_DEBUG.
Referenced by sys_timeouts_init().
Initialize this module.
References arp_timer(), ARP_TMR_INTERVAL, ip_reass_timer(), IP_TMR_INTERVAL, NULL, sys_now(), sys_timeout(), and timeouts_last_time.
Referenced by lwip_init().
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.
Timer callback function that calls tcp_tmr() and reschedules itself.
arg | unused 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 arg = arg |
Referenced by http_conn_err(), http_poll(), http_recv(), http_sent(), and tcp_arg().
timeout h = handler |
Referenced by mem_malloc(), mem_trim(), netif_set_ipaddr(), tcp_fasttmr(), tcp_oos_insert_segment(), tcp_receive(), and tcp_segs_free().
|
static |
|
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) |
Referenced by if(), and usart_set_rx_timeout().
|
static |
Referenced by sys_timeouts_init().
void |
Create a one-shot timer (aka timeout).
Timeouts are processed in the following cases:
msecs | time in milliseconds after that the timer should expire |
handler | callback function to call when msecs have elapsed |
arg | argument to pass to the callback function |
Referenced by stdio_serial_init().