Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

pt.h File Reference

#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include "globals.h"
#include "timer.h"
#include "socket_info.h"
#include "locking.h"

Go to the source code of this file.

Data Structures

struct  process_table

Defines

#define MAX_PT_DESC   128
#define get_proc_no()   ((process_count)?*process_count:0)

Functions

int init_pt ()
int get_max_procs ()
int register_procs (int no)
int get_max_open_fds ()
int register_fds (int no)
int close_extra_socks (int proc_id, int proc_no)
int my_pid ()
int fork_process (int child_id, char *desc, int make_sock)
 Forks a new process.

Variables

process_tablept
gen_lock_t * process_lock
intprocess_count
int process_no
tcp_childtcp_children


Define Documentation

 
#define get_proc_no  )     ((process_count)?*process_count:0)
 

Definition at line 79 of file pt.h.

Referenced by main_loop().

#define MAX_PT_DESC   128
 

Definition at line 52 of file pt.h.

Referenced by fork_process(), main_loop(), and start_fifo_server().


Function Documentation

int close_extra_socks int  proc_id,
int  proc_no
 

Definition at line 199 of file pt.c.

References switchboard_item::next, pt, and si.

Referenced by fork_process(), and main_loop().

int fork_process int  child_id,
char *  desc,
int  make_sock
 

Forks a new process.

Parameters:
child_id - rank, if equal to PROC_NOCHLDINIT init_child will not be called for the new forked process (see sr_module.h)
desc - text description for the process table
make_sock - if to create a unix socket pair for it
Returns:
the pid of the new process

Definition at line 247 of file pt.c.

References close_extra_socks(), estimated_proc_no, fastrand_seed(), init_child(), is_main, L_CRIT, L_ERR, LOG, MAX_PT_DESC, process_table::pid, process_count, process_lock, process_no, pt, and rand.

Referenced by init_unixsock_children(), main_loop(), mod_child(), natpinger_child_init(), and start_fifo_server().

int get_max_open_fds  ) 
 

Definition at line 179 of file pt.c.

References L_CRIT, LOG, and pt.

Referenced by io_listen_loop(), and main_loop().

int get_max_procs  ) 
 

Definition at line 150 of file pt.c.

References L_CRIT, LOG, and pt.

Referenced by fix_domain(), init_sl_stats_child(), init_tls_h(), init_tm_stats_child(), io_listen_loop(), load_ca_list(), load_cert(), load_private_key(), main(), rpc_stats(), set_cipher_list(), set_session_cache(), set_ssl_options(), set_verification(), tls_free_domain(), and tm_rpc_stats().

int init_pt  ) 
 

Referenced by main().

int my_pid  ) 
 

Definition at line 191 of file pt.c.

References process_table::pid, and pt.

int register_fds int  no  ) 
 

Definition at line 169 of file pt.c.

References estimated_fds_no.

Referenced by mod_child(), and mod_init().

int register_procs int  no  ) 
 

Definition at line 137 of file pt.c.

References estimated_proc_no, L_CRIT, and LOG.

Referenced by mod_init(), and natpinger_init().


Variable Documentation

int* process_count
 

Definition at line 311 of file main.c.

Referenced by fork_process(), and init_pt().

gen_lock_t* process_lock
 

Definition at line 313 of file main.c.

Referenced by fork_process(), init_pt(), and kill_all_children().

int process_no
 

Definition at line 314 of file main.c.

struct process_table* pt
 

Definition at line 309 of file main.c.

struct tcp_child* tcp_children
 


Generated on Thu Jul 29 04:16:06 2010 for SIPExpressRouter by  doxygen 1.3.9.1