globals.h File Reference


Detailed Description

CDiameterPeer Global functions.

These are usefull mainly if you use the CDiameterPeer without SER

Author:
Dragos Vingarzan vingarzan -at- fokus dot fraunhofer dot de

Definition in file globals.h.

#include "utils.h"
#include <sys/types.h>

Go to the source code of this file.

Defines

#define DPNAME   "CDiameterPeer"
#define DPVERSION   "0.0.2"
#define PEER_MANAGER_TIMER   3
 timer interval for the peer manager to re-evaluate the peer situation
#define ANSI_GRAY   "\033[01;30m"
#define ANSI_BLINK_RED   "\033[00;31m"
#define ANSI_RED   "\033[01;31m"
#define ANSI_GREEN   "\033[01;32m"
#define ANSI_YELLOW   "\033[01;33m"
#define ANSI_BLUE   "\033[01;34m"
#define ANSI_MAGENTA   "\033[01;35m"
#define ANSI_CYAN   "\033[01;36m"
#define ANSI_WHITE   "\033[01;37m"

Functions

int init_memory (int show_status)
 initialized the pkg and shm memory
void destroy_memory (int show_status)
 call it before exiting; if show_status==1, mem status is displayed

Variables

int process_no
unsigned int * listening_socks
 array of sockets listening for connections
int * shutdownx
 whether a shutdown is in progress
gen_lock_t * shutdownx_lock
 lock used on shutdown
pid_t * dp_first_pid
 first pid that we started from


Define Documentation

#define DPNAME   "CDiameterPeer"

Definition at line 62 of file globals.h.

#define DPVERSION   "0.0.2"

Definition at line 63 of file globals.h.

#define PEER_MANAGER_TIMER   3

timer interval for the peer manager to re-evaluate the peer situation

Definition at line 66 of file globals.h.

Referenced by peer_manager_init().

#define ANSI_GRAY   "\033[01;30m"

Definition at line 89 of file globals.h.

#define ANSI_BLINK_RED   "\033[00;31m"

Definition at line 90 of file globals.h.

#define ANSI_RED   "\033[01;31m"

Definition at line 91 of file globals.h.

Referenced by log_peer_list(), print_p_dialogs(), print_r(), and print_s_dialogs().

#define ANSI_GREEN   "\033[01;32m"

Definition at line 92 of file globals.h.

Referenced by log_peer_list(), print_p_dialogs(), print_r(), print_s_dialogs(), and print_subs().

#define ANSI_YELLOW   "\033[01;33m"

Definition at line 93 of file globals.h.

Referenced by log_peer_list(), print_p_dialogs(), and print_r().

#define ANSI_BLUE   "\033[01;34m"

Definition at line 94 of file globals.h.

Referenced by log_peer_list(), print_p_dialogs(), print_r(), print_s_dialogs(), and print_subs().

#define ANSI_MAGENTA   "\033[01;35m"

Definition at line 95 of file globals.h.

Referenced by print_p_dialogs(), print_r(), print_s_dialogs(), and print_subs().

#define ANSI_CYAN   "\033[01;36m"

Definition at line 96 of file globals.h.

Referenced by print_r(), and print_subs().

#define ANSI_WHITE   "\033[01;37m"

Definition at line 97 of file globals.h.


Function Documentation

int init_memory ( int  show_status  ) 

initialized the pkg and shm memory

Definition at line 79 of file globals.c.

References memlog.

00080 {
00081 #ifdef PKG_MALLOC
00082     if (init_pkg_mallocs()==-1)
00083         goto error;
00084     if (show_status){
00085         LOG(memlog, "Memory status (pkg):\n");
00086         pkg_status();
00087     }
00088 #endif
00089 
00090 #ifdef SHM_MEM
00091     if (init_shm_mallocs()==-1)
00092         goto error;
00093     if (show_status){
00094         LOG(memlog, "Memory status (shm):\n");
00095         shm_status();
00096     }
00097 #endif
00098     return 1;
00099 error:
00100     return 0;
00101 }   

void destroy_memory ( int  show_status  ) 

call it before exiting; if show_status==1, mem status is displayed

Definition at line 104 of file globals.c.

References memlog.

00105 {
00106     /*clean-up*/
00107     if (mem_lock)
00108         shm_unlock(); /* hack: force-unlock the shared memory lock in case
00109                                  some process crashed and let it locked; this will
00110                                  allow an almost gracious shutdown */
00111 #ifdef SHM_MEM
00112     if (show_status){
00113         LOG(memlog, "Memory status (shm):\n");
00114         //shm_status();
00115         shm_sums();
00116     }
00117     /* zero all shmem alloc vars that we still use */
00118     shm_mem_destroy();
00119 #endif
00120 #ifdef PKG_MALLOC
00121     if (show_status){
00122         LOG(memlog, "Memory status (pkg):\n");
00123         //pkg_status();
00124         pkg_sums();
00125     }
00126 #endif
00127 }


Variable Documentation

int process_no

Referenced by diameter_peer_start(), and icscf_mod_child_init().

unsigned int* listening_socks

array of sockets listening for connections

Definition at line 79 of file tcp_accept.c.

Referenced by accept_connection(), accept_loop(), and acceptor_process().

int* shutdownx

whether a shutdown is in progress

Definition at line 78 of file diameter_peer.c.

Referenced by accept_loop(), cdp_lock_get(), cdp_lock_release(), diameter_peer_destroy(), diameter_peer_init(), put_task(), receive_loop(), select_recv(), take_task(), timer_loop(), and worker_process().

gen_lock_t* shutdownx_lock

lock used on shutdown

Definition at line 79 of file diameter_peer.c.

Referenced by diameter_peer_destroy(), and diameter_peer_init().

pid_t* dp_first_pid

first pid that we started from

Definition at line 81 of file diameter_peer.c.

Referenced by diameter_peer_destroy(), and diameter_peer_init().


Generated on Tue Jul 29 04:19:13 2008 for Open IMS Core CSCFs by  doxygen 1.5.2