/*
* The mrouted program is covered by the license in the accompanying file
* named "LICENSE". Use of the mrouted program represents acceptance of
* the terms and conditions listed in that file.
*
* The mrouted program is COPYRIGHT 1989 by The Board of Trustees of
* Leland Stanford Junior University.
*/
#include "defs.h"
/* the code below implements a callout queue */
static int id = 0;
static struct timeout_q *Q = 0; /* pointer to the beginning of timeout queue */
static int in_callout = 0;
struct timeout_q {
struct timeout_q *next; /* next event */
int id;
cfunc_t func; /* function to call */
char *data; /* func's data */
int time; /* time offset to next event*/
};
/*
* sets the timer
*
* delay: number of units for timeout
* action: function to be called on timeout
* data: what to call the timeout function with
*/
int
timer_setTimer(int delay, cfunc_t action, char *data)
{
struct timeout_q *ptr, *node, *prev;