GSS_S_PROMPTING_NEEDED is a bit
[cyrus-sasl.git] / saslauthd / saslauthd-main.h
1 /****************************************************************************
2  *
3  * saslauthd-main.h
4  *
5  * Description:  Header file for saslauthd-main.c
6  *               
7  *
8  * Copyright (c) 1997-2000 Messaging Direct Ltd.
9  * All rights reserved.
10  *
11  * Portions Copyright (c) 2003 Jeremy Rumpf
12  * jrumpf@heavyload.net
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions
16  * are met:
17  *
18  * 1. Redistributions of source code must retain the above copyright
19  *    notice, this list of conditions and the following disclaimer.
20  *
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.
24  *
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
35  *
36  * HISTORY
37  * 
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.
40  *
41  * This source file created using 8 space tabs.
42  *
43  ****************************************************************************/
44
45 #ifndef _SASLAUTHDMAIN_H
46 #define _SASLAUTHDMAIN_H
47
48 #include <sys/types.h>
49 #include "saslauthd.h"
50
51 /****************************************************************
52  * Plug in some autoconf magic to determine what IPC method
53  * to use.
54  ****************************************************************/
55 #ifdef USE_DOORS
56 # define USE_DOORS_IPC
57 #else
58 # define USE_UNIX_IPC
59 #endif
60
61 /* AIX uses a slight variant of this */
62 #ifdef _AIX
63 # define SALEN_TYPE size_t
64 #else 
65 # define SALEN_TYPE int
66 #endif 
67
68 /* Define some macros. These help keep the ifdefs out of the
69  * mainline code. */
70 #ifdef AUTH_SIA
71 #define SET_AUTH_PARAMETERS(argc, argv) set_auth_parameters(argc, argv)
72 #else
73 #define SET_AUTH_PARAMETERS(argc, argv)
74 #endif
75
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"              
82
83 /* login, pw, service, realm buffer size */
84 #define MAX_REQ_LEN             256     
85
86 /* socket backlog when supported */
87 #define SOCKET_BACKLOG          32
88
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();
101
102 /* ipc api delcarations */
103 extern void     ipc_init();
104 extern void     ipc_loop();
105 extern void     ipc_cleanup();
106
107 #endif  /* _SASLAUTHDMAIN_H */