xref: /netbsd-src/external/ibm-public/postfix/dist/src/master/mail_server.h (revision a5847cc334d9a7029f6352b847e9e8d71a0f9e0c)
1 /*	$NetBSD: mail_server.h,v 1.1.1.3 2011/03/02 19:32:20 tron Exp $	*/
2 
3 /*++
4 /* NAME
5 /*	mail_server 3h
6 /* SUMMARY
7 /*	skeleton servers
8 /* SYNOPSIS
9 /*	#include <mail_server.h>
10 /* DESCRIPTION
11 /* .nf
12 
13  /*
14   * Utility library.
15   */
16 #include <vstream.h>
17 
18  /*
19   * External interface. Tables are defined in mail_conf.h.
20   */
21 #define MAIL_SERVER_INT_TABLE	1
22 #define MAIL_SERVER_STR_TABLE	2
23 #define MAIL_SERVER_BOOL_TABLE	3
24 #define MAIL_SERVER_TIME_TABLE	4
25 #define MAIL_SERVER_RAW_TABLE	5
26 #define MAIL_SERVER_NINT_TABLE	6
27 #define MAIL_SERVER_NBOOL_TABLE	7
28 
29 #define	MAIL_SERVER_PRE_INIT	10
30 #define MAIL_SERVER_POST_INIT	11
31 #define MAIL_SERVER_LOOP	12
32 #define MAIL_SERVER_EXIT	13
33 #define MAIL_SERVER_PRE_ACCEPT	14
34 #define MAIL_SERVER_SOLITARY	15
35 #define MAIL_SERVER_UNLIMITED	16
36 #define MAIL_SERVER_PRE_DISCONN	17
37 #define MAIL_SERVER_PRIVILEGED	18
38 #define MAIL_SERVER_WATCHDOG	19
39 
40 #define MAIL_SERVER_IN_FLOW_DELAY	20
41 #define MAIL_SERVER_SLOW_EXIT	21
42 
43 typedef void (*MAIL_SERVER_INIT_FN) (char *, char **);
44 typedef int (*MAIL_SERVER_LOOP_FN) (char *, char **);
45 typedef void (*MAIL_SERVER_EXIT_FN) (char *, char **);
46 typedef void (*MAIL_SERVER_ACCEPT_FN) (char *, char **);
47 typedef void (*MAIL_SERVER_DISCONN_FN) (VSTREAM *, char *, char **);
48 typedef void (*MAIL_SERVER_SLOW_EXIT_FN) (char *, char **);
49 
50  /*
51   * single_server.c
52   */
53 typedef void (*SINGLE_SERVER_FN) (VSTREAM *, char *, char **);
54 extern NORETURN single_server_main(int, char **, SINGLE_SERVER_FN, ...);
55 
56  /*
57   * multi_server.c
58   */
59 typedef void (*MULTI_SERVER_FN) (VSTREAM *, char *, char **);
60 extern NORETURN multi_server_main(int, char **, MULTI_SERVER_FN,...);
61 extern void multi_server_disconnect(VSTREAM *);
62 extern int multi_server_drain(void);
63 
64  /*
65   * event_server.c
66   */
67 typedef void (*EVENT_SERVER_FN) (VSTREAM *, char *, char **);
68 extern NORETURN event_server_main(int, char **, EVENT_SERVER_FN,...);
69 extern void event_server_disconnect(VSTREAM *);
70 extern int event_server_drain(void);
71 
72  /*
73   * trigger_server.c
74   */
75 typedef void (*TRIGGER_SERVER_FN) (char *, int, char *, char **);
76 extern NORETURN trigger_server_main(int, char **, TRIGGER_SERVER_FN, ...);
77 
78 #define TRIGGER_BUF_SIZE	1024
79 
80 /* LICENSE
81 /* .ad
82 /* .fi
83 /*	The Secure Mailer license must be distributed with this software.
84 /* AUTHOR(S)
85 /*	Wietse Venema
86 /*	IBM T.J. Watson Research
87 /*	P.O. Box 704
88 /*	Yorktown Heights, NY 10598, USA
89 /*--*/
90