1 /* $OpenBSD: virtual.h,v 1.3 2002/03/27 14:08:43 camield Exp $ */
2 
3 /*
4  * Virtual domain support.
5  */
6 
7 #ifndef _POP_VIRTUAL_H
8 #define _POP_VIRTUAL_H
9 
10 #include <pwd.h>
11 #include <sys/types.h>
12 
13 /*
14  * These are set by the authentication routine, below.
15  */
16 extern char *virtual_domain;
17 extern char *virtual_spool;
18 
19 /*
20  * Initializes the virtual domain support at startup. Note that this will
21  * only be called once in standalone mode, so don't expect an open socket
22  * here. Returns a non-zero value on error.
23  */
24 extern int virtual_startup(void);
25 
26 /*
27  * Tries to authenticate a username/password pair for the virtual domain
28  * indicated either by the connected IP address (the socket is available
29  * on fd 0), or as a part of the username. If the virtual domain is known,
30  * virtual_domain and virtual_spool are set appropriately. If the username
31  * is known as well, known is set. Returns the template user to run as if
32  * authentication succeeds, or NULL otherwise.
33  */
34 extern struct passwd *virtual_userpass(char *user, char *pass, int *known);
35 
36 #endif
37