Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

/opentcp/include/inet/timers.h File Reference


Detailed Description

Author:
Version:
1.0
Date:
18.7.2002
OpenTCP timers function declarations, constants, etc.

Definition in file timers.h.

Go to the source code of this file.

Defines

#define NUMTIMERS   55
 Number of timers available in the system.

#define TIMERTIC   100
 Frequency of timer interrupt.


Functions

UINT8 get_timer (void)
 Obtain a timer from timer pool.

void free_timer (UINT8)
 Release timer back to free timer pool.

void init_timer (UINT8, UINT32)
 Initialize timer to a given time-out value.

void timer_pool_init (void)
 Initialize timer pool.

UINT32 check_timer (UINT8)
 Return the value of a given timer.

void decrement_timers (void)
 Decrement all timers' values by one.


Define Documentation

#define TIMERTIC   100
 

This value should be changed to reflect the frequency in which timers are decremented. Standard value for this is 100.

Definition at line 86 of file timers.h.

Referenced by arp_init(), arp_manage(), bootpc_run(), dhcpc_init(), dhcpc_run(), dns_retransmit(), get_host_by_name(), tcp_getsocket(), tcp_newstate(), and tcp_poll().


Function Documentation

UINT8 get_timer void   
 

Author:
Date:
18.07.2001
Returns:
Handle to a free timer
Warning:
  • Timers are considered to be critical resources, so if there is no available timer and get_timer is invoked, system will reset.
Invoke this function to obtain a free timer (it's handle that is) from the timer pool.

Definition at line 131 of file timers.c.

References FALSE, NUMTIMERS, RESET_SYSTEM, timer_pool, and TRUE.

Referenced by arp_init(), bootpc_init(), dhcpc_init(), dns_init(), pop3c_init(), smtpc_init(), tcp_init(), and tftps_init().

void free_timer UINT8    nbr
 

Author:
Date:
18.07.2001
Parameters:
nbr  handle to timer beeing released
This function releases the timer who's handle is supplied as parameter. Use this when timer is not needed any more and other applications might use it.

Definition at line 169 of file timers.c.

References NUMTIMERS, timer_pool, and TRUE.

void init_timer UINT8    nbr,
UINT32    tout
 

Author:
Date:
18.07.2001
Parameters:
nbr  handle of timer who's value we're setting
tout  time-out value to set for this timer
Invoke this function to set timeout value for a timer with a given handle.

TIMERTIC defines how quickly the timers' values are decremented so is it to initialize timers to correct timeouts.

Definition at line 194 of file timers.c.

References NUMTIMERS, OS_EnterCritical, OS_ExitCritical, timer_pool, and TRUE.

Referenced by arp_init(), arp_manage(), bootpc_run(), dhcpc_init(), dhcpc_run(), dns_retransmit(), get_host_by_name(), tcp_init(), tcp_newstate(), and tcp_poll().

UINT32 check_timer UINT8    nbr
 

Author:
Date:
18.07.2001
Parameters:
nbr  timer handle who's value is to be returned
Returns:
timer value
Warning:
  • Interrupts are not disabled when fetching the value, therefore returned value possibly has an error component +/- TIMERTIC.
Function simply returns timer value of a given timer. No checks are made in order to make the function as fast as possible.

Definition at line 233 of file timers.c.

References timer_pool.

Referenced by arp_manage(), bootpc_run(), dhcpc_run(), dns_run(), and tcp_poll().

void decrement_timers void   
 

Author:
Date:
18.07.2001
Invoke this function from timer interrupt to decrement timer counter values

Definition at line 248 of file timers.c.

References FALSE, NUMTIMERS, and timer_pool.


Generated on Sun Aug 3 20:33:00 2003 for OpenTCP by doxygen1.2.18