ha.h File Reference

#include "../../locking.h"
#include <time.h>

Include dependency graph for ha.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ha
struct  ping

Functions

char * create_ping_event (int *evt_len, int flags, unsigned int *seqno)
void destroy_pingtable (struct ha *table)
int init_pingtable (struct ha *table, int timeout, int maxpings)
int prepare_ha (void)
int print_pingtable (struct ha *ta, int idx, int lock)
int spawn_pinger (void)

Variables

char * jain_ping_config
int jain_ping_period
int jain_ping_timeout
struct pingjain_pings
pid_t pinger_pid
char * servlet_ping_config
int servlet_ping_period
int servlet_ping_timeout
struct pingservlet_pings
int use_ha


Function Documentation

char* create_ping_event ( int *  evt_len,
int  flags,
unsigned int *  seqno 
)

event_length(4) UNSIGNED INT includes the length 4 bytes itself type(1), processor_id(1), 0 means nobody, 0xFF means everybody, 0<N<0xFF means processor with id=N flags(4), ping_num(4),

NOT REENTRANT (uses static local var to store ping seqno.)

returns 0 on error pointer to the buffer on success

Definition at line 371 of file ha.c.

References LM_ERR, PING_AC, and shm_malloc().

Referenced by send_ping().

void destroy_pingtable ( struct ha table  )  [inline]

Definition at line 345 of file ha.c.

References ha::mutex, ha::pings, and shm_free.

Referenced by add_new_as(), dispatcher_main_loop(), and init_pingtable().

int init_pingtable ( struct ha table,
int  timeout,
int  maxpings 
) [inline]

Initializes the high availability (ha) structure

returns 0 on success -1 on error

Definition at line 317 of file ha.c.

References ha::begin, destroy_pingtable(), ha::end, LM_ERR, ha::mutex, ha::pings, shm_malloc(), ha::size, ha::timed_out_pings, and ha::timeout.

Referenced by add_new_as().

int prepare_ha ( void   ) 

returns: 0 if no High Availability 1 if High Availability -1 if config error

Definition at line 55 of file ha.c.

References jain_ping_config, jain_ping_period, jain_ping_timeout, jain_pings_lost, LM_DBG, parse_ping(), servlet_ping_config, servlet_ping_period, servlet_ping_timeout, servlet_pings_lost, and use_ha.

Referenced by seas_init().

int print_pingtable ( struct ha ta,
int  idx,
int  lock 
)

Definition at line 76 of file ha.c.

References ha::begin, ha::count, ha::mutex, and ha::size.

Referenced by dispatch_actions(), process_pings(), and process_pong().

int spawn_pinger ( void   ) 

we spawn a pinger process.

some day we could spawn a pinger-thread instead of a process..

returns: -1 on error;

Definition at line 170 of file ha.c.

References as_entry::as, as_list, AS_TYPE, as_entry::connected, is_dispatcher, jain_ping_period, LM_ERR, my_as, as_entry::next, NULL, pinger_pid, send_ping(), servlet_ping_period, timeout, as_entry::type, and whoami.

Referenced by dispatcher_main_loop().


Variable Documentation

if any of these global ping vars is set to 0, then this kind of ping is DISABLED

Definition at line 34 of file ha.c.

Referenced by prepare_ha().

Definition at line 35 of file ha.c.

Referenced by add_new_as(), prepare_ha(), and spawn_pinger().

Definition at line 37 of file ha.c.

Referenced by add_new_as(), dispatch_actions(), and prepare_ha().

struct ping* jain_pings

pid_t pinger_pid

Definition at line 45 of file ha.c.

Referenced by spawn_pinger().

Definition at line 39 of file ha.c.

Referenced by prepare_ha().

Definition at line 40 of file ha.c.

Referenced by add_new_as(), prepare_ha(), and spawn_pinger().

Definition at line 42 of file ha.c.

Referenced by add_new_as(), dispatch_actions(), and prepare_ha().

int use_ha

Definition at line 44 of file ha.c.

Referenced by add_new_as(), dispatch_actions(), dispatcher_main_loop(), and prepare_ha().


Generated on Wed May 23 06:01:04 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6