00001 /* $Id: ha.h 5003 2008-09-26 11:01:51Z henningw $ 00002 * 00003 * Copyright (C) 2006-2007 VozTelecom Sistemas S.L 00004 * 00005 * This file is part of Kamailio, a free SIP server. 00006 * 00007 * Kamailio is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version 00011 * 00012 * Kamailio is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 */ 00021 00022 00023 #ifndef HA_H 00024 #define HA_H 00025 #include "../../locking.h"/* for get_lock_t define*/ 00026 #include <time.h> 00027 struct ping{ 00028 unsigned int id; 00029 struct timeval sent; 00030 struct ping *next; 00031 }; 00032 00033 struct ha{ 00034 int timed_out_pings; 00035 int timeout; 00036 gen_lock_t *mutex; 00037 struct ping *pings; 00038 int begin; 00039 int end; 00040 int count; 00041 int size; 00042 }; 00043 00044 extern char *jain_ping_config; 00045 extern int jain_ping_period; 00046 extern int jain_ping_timeout; 00047 extern struct ping *jain_pings; 00048 00049 extern pid_t pinger_pid; 00050 00051 extern char *servlet_ping_config; 00052 extern int servlet_ping_period; 00053 extern int servlet_ping_timeout; 00054 extern struct ping *servlet_pings; 00055 00056 extern int use_ha; 00057 00058 char * create_ping_event(int *evt_len,int flags,unsigned int *seqno); 00059 int prepare_ha(void); 00060 int spawn_pinger(void); 00061 int print_pingtable(struct ha *ta,int idx,int lock); 00062 inline int init_pingtable(struct ha *table,int timeout,int maxpings); 00063 inline void destroy_pingtable(struct ha *table); 00064 #endif
1.5.6