xref: /netbsd-src/external/ibm-public/postfix/dist/src/master/mail_server.h (revision 413d532bcc3f62d122e56d92e13ac64825a40baf)
1 /*	$NetBSD: mail_server.h,v 1.1.1.4 2013/01/02 18:59:01 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 #define MAIL_SERVER_LONG_TABLE	8
29 
30 #define	MAIL_SERVER_PRE_INIT	10
31 #define MAIL_SERVER_POST_INIT	11
32 #define MAIL_SERVER_LOOP	12
33 #define MAIL_SERVER_EXIT	13
34 #define MAIL_SERVER_PRE_ACCEPT	14
35 #define MAIL_SERVER_SOLITARY	15
36 #define MAIL_SERVER_UNLIMITED	16
37 #define MAIL_SERVER_PRE_DISCONN	17
38 #define MAIL_SERVER_PRIVILEGED	18
39 #define MAIL_SERVER_WATCHDOG	19
40 
41 #define MAIL_SERVER_IN_FLOW_DELAY	20
42 #define MAIL_SERVER_SLOW_EXIT	21
43 
44 typedef void (*MAIL_SERVER_INIT_FN) (char *, char **);
45 typedef int (*MAIL_SERVER_LOOP_FN) (char *, char **);
46 typedef void (*MAIL_SERVER_EXIT_FN) (char *, char **);
47 typedef void (*MAIL_SERVER_ACCEPT_FN) (char *, char **);
48 typedef void (*MAIL_SERVER_DISCONN_FN) (VSTREAM *, char *, char **);
49 typedef void (*MAIL_SERVER_SLOW_EXIT_FN) (char *, char **);
50 
51  /*
52   * single_server.c
53   */
54 typedef void (*SINGLE_SERVER_FN) (VSTREAM *, char *, char **);
55 extern NORETURN single_server_main(int, char **, SINGLE_SERVER_FN,...);
56 
57  /*
58   * multi_server.c
59   */
60 typedef void (*MULTI_SERVER_FN) (VSTREAM *, char *, char **);
61 extern NORETURN multi_server_main(int, char **, MULTI_SERVER_FN,...);
62 extern void multi_server_disconnect(VSTREAM *);
63 extern int multi_server_drain(void);
64 
65  /*
66   * event_server.c
67   */
68 typedef void (*EVENT_SERVER_FN) (VSTREAM *, char *, char **);
69 extern NORETURN event_server_main(int, char **, EVENT_SERVER_FN,...);
70 extern void event_server_disconnect(VSTREAM *);
71 extern int event_server_drain(void);
72 
73  /*
74   * trigger_server.c
75   */
76 typedef void (*TRIGGER_SERVER_FN) (char *, int, char *, char **);
77 extern NORETURN trigger_server_main(int, char **, TRIGGER_SERVER_FN,...);
78 
79 #define TRIGGER_BUF_SIZE	1024
80 
81 /* LICENSE
82 /* .ad
83 /* .fi
84 /*	The Secure Mailer license must be distributed with this software.
85 /* AUTHOR(S)
86 /*	Wietse Venema
87 /*	IBM T.J. Watson Research
88 /*	P.O. Box 704
89 /*	Yorktown Heights, NY 10598, USA
90 /*--*/
91