Main Page | Class List | File List | Class Members | File Members

tcptimer.c File Reference

#include <stdio.h>
#include <pthread.h>
#include <assert.h>
#include <semaphore.h>
#include "misc.h"
#include "tcpproxy.h"
#include "tcp.h"
#include "tcptimer.h"

Go to the source code of this file.

Typedefs

typedef timerq_event Ttimerq_event

Functions

void init_timer ()
void cleanup_timer ()
long clear_timer (void(*func)(void *), void *arg)
void clear_tcp_timers (void *arg)
long left_timer (void(*func)(void *), void *arg)
int add_timer (long mdelay, void(*func)(void *), void *arg)
void tcp_timer (void *sig_mask)

Variables

static const struct timespec tick = { TIMER_MTICK/1000, 1000000*TIMER_MTICK }
static pthread_mutex_t timerq_mut = PTHREAD_MUTEX_INITIALIZER
static Ttimerq_eventtimerq_head = NULL


Typedef Documentation

typedef struct timerq_event Ttimerq_event
 


Function Documentation

int add_timer long  mdelay,
void(*)(void *)  func,
void *  arg
 

Definition at line 137 of file tcptimer.c.

References timerq_event::arg, clear_timer(), timerq_event::func, get_mclock(), mutex_lock(), mutex_unlock(), timerq_event::next, timerq_event::time_left, timerq_event::time_queued, timerq_mut, and xmalloc().

Referenced by add_tcp_sent(), tcps_close_wait(), tcps_closing(), tcps_fin_wait1(), tcps_fin_wait2(), and tcps_new().

void cleanup_timer  ) 
 

Definition at line 41 of file tcptimer.c.

References DPRINT, timerq_event::next, and xfree().

Referenced by main().

void clear_tcp_timers void *  arg  ) 
 

Definition at line 102 of file tcptimer.c.

References clear_timer(), and tcp_timeout().

long clear_timer void(*)(void *)  func,
void *  arg
 

Definition at line 65 of file tcptimer.c.

References timerq_event::arg, timerq_event::func, get_mclock(), mutex_lock(), mutex_unlock(), timerq_event::next, timerq_event::time_left, timerq_event::time_queued, timerq_mut, and xfree().

Referenced by add_timer(), clear_tcp_queue(), clear_tcp_timers(), handle_tcp(), mh_ack_rcvd(), and tcps_syn_sent().

void init_timer  ) 
 

Definition at line 32 of file tcptimer.c.

Referenced by main().

long left_timer void(*)(void *)  func,
void *  arg
 

Definition at line 113 of file tcptimer.c.

References timerq_event::arg, DPRINT, timerq_event::func, mutex_lock(), mutex_unlock(), timerq_event::next, timerq_event::time_left, and timerq_mut.

void tcp_timer void *  sig_mask  ) 
 

Definition at line 191 of file tcptimer.c.

References DPRINT, EPRINT, timerq_event::func, get_mclock(), mutex_lock(), mutex_unlock(), timerq_event::next, request_exit, timerq_event::time_left, timerq_mut, and xfree().

Referenced by main().


Variable Documentation

const struct timespec tick = { TIMER_MTICK/1000, 1000000*TIMER_MTICK } [static]
 

Definition at line 24 of file tcptimer.c.

Ttimerq_event* timerq_head = NULL [static]
 

Definition at line 26 of file tcptimer.c.

pthread_mutex_t timerq_mut = PTHREAD_MUTEX_INITIALIZER [static]
 

Definition at line 25 of file tcptimer.c.

Referenced by add_timer(), clear_timer(), left_timer(), and tcp_timer().


Generated on Sun May 14 13:36:53 2006 by  doxygen 1.4.2