7 /* master process protocol
9 /* #include <master_proto.h>
14 * Transport names. The master passes the transport name on the command
15 * line, and thus the name is part of the master to child protocol.
17 #define MASTER_XPORT_NAME_UNIX "unix" /* local IPC */
18 #define MASTER_XPORT_NAME_FIFO "fifo" /* local IPC */
19 #define MASTER_XPORT_NAME_INET "inet" /* non-local IPC */
20 #define MASTER_XPORT_NAME_PASS "pass" /* local IPC */
23 * Format of a status message sent by a child process to the process
24 * manager. Since this is between processes on the same machine we need not
25 * worry about byte order and word length.
27 typedef struct MASTER_STATUS
{
28 int pid
; /* process ID */
29 unsigned gen
; /* child generation number */
30 int avail
; /* availability */
33 #define MASTER_GEN_NAME "GENERATION" /* passed via environment */
35 #define MASTER_STAT_TAKEN 0 /* this one is occupied */
36 #define MASTER_STAT_AVAIL 1 /* this process is idle */
38 extern int master_notify(int, unsigned, int); /* encapsulate status msg */
41 * File descriptors inherited from the master process. The flow control pipe
42 * is read by receive processes and is written to by send processes. If
43 * receive processes get too far ahead they will pause for a brief moment.
45 #define MASTER_FLOW_READ 3
46 #define MASTER_FLOW_WRITE 4
49 * File descriptors inherited from the master process. All processes that
50 * provide a given service share the same status file descriptor, and listen
51 * on the same service socket(s). The kernel decides what process gets the
52 * next connection. Usually the number of listening processes is small, so
53 * one connection will not cause a "thundering herd" effect. When no process
54 * listens on a given socket, the master process will. MASTER_LISTEN_FD is
55 * actually the lowest-numbered descriptor of a sequence of descriptors to
58 #define MASTER_STATUS_FD 5 /* shared channel to parent */
59 #define MASTER_LISTEN_FD 6 /* accept connections here */
64 /* The Secure Mailer license must be distributed with this software.
67 /* IBM T.J. Watson Research
69 /* Yorktown Heights, NY 10598, USA