dlg_timer.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2006 Voice System SRL
00003  *
00004  * This file is part of Kamailio, a free SIP server.
00005  *
00006  * Kamailio is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version
00010  *
00011  * Kamailio is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License 
00017  * along with this program; if not, write to the Free Software 
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  * History:
00021  * --------
00022  * 2006-04-14  initial version (bogdan)
00023  */
00024 
00032 #ifndef _DIALOG_DLG_TIMER_H_
00033 #define _DIALOG_DLG_TIMER_H_
00034 
00035 
00036 #include "../../locking.h"
00037 
00038 
00040 typedef struct dlg_tl
00041 {
00042         struct dlg_tl     *next;
00043         struct dlg_tl     *prev;
00044         volatile unsigned int  timeout; 
00045 } dlg_tl_t;
00046 
00047 
00049 typedef struct dlg_timer
00050 {
00051         struct dlg_tl   first; 
00052         gen_lock_t      *lock; 
00053 } dlg_timer_t;
00054 
00055 
00057 typedef void (*dlg_timer_handler)(struct dlg_tl *);
00058 
00059 
00067 int init_dlg_timer(dlg_timer_handler);
00068 
00069 
00073 void destroy_dlg_timer(void);
00074 
00075 
00082 int insert_dlg_timer(struct dlg_tl *tl, int interval);
00083 
00084 
00091 int remove_dialog_timer(struct dlg_tl *tl);
00092 
00093 
00101 int update_dlg_timer(struct dlg_tl *tl, int timeout);
00102 
00103 
00110 void dlg_timer_routine(unsigned int ticks , void * attr);
00111 
00112 #endif