• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • Directories
  • File List
  • Globals

pt.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Process Table
00005  *
00006  *
00007  *
00008  * Copyright (C) 2001-2003 FhG Fokus
00009  *
00010  * Permission to use, copy, modify, and distribute this software for any
00011  * purpose with or without fee is hereby granted, provided that the above
00012  * copyright notice and this permission notice appear in all copies.
00013  *
00014  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
00015  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
00016  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
00017  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00018  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00019  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
00020  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00021  */
00022 /*
00023  * History:
00024  * --------
00025  *  2003-04-15  added tcp_disable support (andrei)
00026  *  2006-06-14  added process table in shared mem (dragos)
00027  *  2007-07-04  added register_fds() and get_max_open_fds(() (andrei)
00028  */
00035 #ifndef _PT_H
00036 #define _PT_H
00037 
00038 #include <sys/types.h>
00039 #include <unistd.h>
00040 #include <stdlib.h>
00041 
00042 #include "globals.h"
00043 #include "timer.h"
00044 #include "socket_info.h"
00045 #include "locking.h"
00046 
00047 #define MAX_PT_DESC                     128
00048 
00049 struct process_table {
00050         int pid;
00051 #ifdef USE_TCP
00052         int unix_sock;  /* unix socket on which tcp main listens        */
00053         int idx;                /* tcp child index, -1 for other processes      */
00054 #endif
00055         char desc[MAX_PT_DESC];
00056 };
00057 
00058 extern struct process_table *pt;
00059 extern gen_lock_t* process_lock;
00060 extern int *process_count;
00061 extern int process_no;
00062 
00063 extern struct tcp_child* tcp_children;
00064 
00065 int init_pt(int proc_no);
00066 int get_max_procs(void);
00067 int register_procs(int no);
00068 int get_max_open_fds(void);
00069 int register_fds(int no);
00070 
00071 
00072 int close_extra_socks(int proc_id, int proc_no);
00073 
00074 #define get_proc_no() ((process_count)?*process_count:0)
00075 
00076 /* return processes pid */
00077 int my_pid(void);
00078 
00085 int fork_process(int child_id,char *desc,int make_sock);
00086 
00094 #ifdef USE_TCP
00095 int fork_tcp_process(int child_id,char *desc,int r,int *reader_fd_1);
00096 #endif
00097 
00098 #ifdef PKG_MALLOC
00099 void mem_dump_pkg_cb(str *gname, str *name);
00100 #endif
00101 
00102 #ifdef SHM_MEM
00103 int mem_dump_shm_fixup(void *handle, str *gname, str *name, void **val);
00104 #endif
00105 
00106 unsigned int set_fork_delay(unsigned int v);
00107 
00108 #endif

Generated on Tue May 22 2012 13:10:13 for SIP Router by  doxygen 1.7.1