1 /****************************************************************************
5 * Description: Header file for saslauthd-main.c
8 * Copyright (c) 1997-2000 Messaging Direct Ltd.
11 * Portions Copyright (c) 2003 Jeremy Rumpf
12 * jrumpf@heavyload.net
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution.
25 * THIS SOFTWARE IS PROVIDED ``AS IS''. ANY EXPRESS OR IMPLIED WARRANTIES,
26 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27 * IN NO EVENT SHALL JEREMY RUMPF OR ANY CONTRIBUTER TO THIS SOFTWARE BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
34 * THE POSSIBILITY OF SUCH DAMAGE
38 * Feb 2004: Partial rewrite and cleanup by Jeremy Rumpf jrumpf@heavyload.net
39 * - Merge the doors and unix IPC methods under a common framework.
41 * This source file created using 8 space tabs.
43 ****************************************************************************/
45 #ifndef _SASLAUTHDMAIN_H
46 #define _SASLAUTHDMAIN_H
48 #include <sys/types.h>
49 #include "saslauthd.h"
51 /****************************************************************
52 * Plug in some autoconf magic to determine what IPC method
54 ****************************************************************/
56 # define USE_DOORS_IPC
61 /* AIX uses a slight variant of this */
63 # define SALEN_TYPE size_t
65 # define SALEN_TYPE int
68 /* Define some macros. These help keep the ifdefs out of the
71 #define SET_AUTH_PARAMETERS(argc, argv) set_auth_parameters(argc, argv)
73 #define SET_AUTH_PARAMETERS(argc, argv)
76 /* file name defines - don't forget the '/' in these! */
77 #define PID_FILE "/saslauthd.pid"
78 #define PID_FILE_LOCK "/saslauthd.pid.lock"
79 #define ACCEPT_LOCK_FILE "/mux.accept"
80 #define SOCKET_FILE "/mux"
81 #define DOOR_FILE "/mux"
83 /* login, pw, service, realm buffer size */
84 #define MAX_REQ_LEN 256
86 /* socket backlog when supported */
87 #define SOCKET_BACKLOG 32
89 /* saslauthd-main.c */
90 extern char *do_auth(const char *, const char *,
91 const char *, const char *);
92 extern void set_auth_mech(const char *);
93 extern void set_max_procs(const char *);
94 extern void set_mech_option(const char *);
95 extern void set_run_path(const char *);
96 extern void signal_setup();
97 extern void detach_tty();
98 extern void handle_sigchld();
99 extern void server_exit();
100 extern pid_t have_baby();
102 /* ipc api delcarations */
103 extern void ipc_init();
104 extern void ipc_loop();
105 extern void ipc_cleanup();
107 #endif /* _SASLAUTHDMAIN_H */