details
[apps/madmutt.git] / imap / auth.h
1 /*
2  * Copyright notice from original mutt:
3  * Copyright (C) 2000-1 Brendan Cully <brendan@kublai.com>
4  *
5  * This file is part of mutt-ng, see http://www.muttng.org/.
6  * It's licensed under the GNU General Public License,
7  * please see the file GPL in the top level source directory.
8  */
9
10 /* common defs for authenticators. A good place to set up a generic callback
11  * system */
12
13 #ifndef _IMAP_AUTH_H
14 #define _IMAP_AUTH_H 1
15
16 typedef enum {
17   IMAP_AUTH_SUCCESS = 0,
18   IMAP_AUTH_FAILURE,
19   IMAP_AUTH_UNAVAIL
20 } imap_auth_res_t;
21
22
23 typedef struct {
24   /* do authentication, using named method or any available if method is NULL */
25   imap_auth_res_t (*authenticate) (IMAP_DATA * idata, const char *method);
26   /* name of authentication method supported, NULL means variable. If this
27    * is not null, authenticate may ignore the second parameter. */
28   const char *method;
29 } imap_auth_t;
30
31 /* external authenticator prototypes */
32 #ifndef USE_SASL
33 imap_auth_res_t imap_auth_anon (IMAP_DATA * idata, const char *method);
34 imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA * idata, const char *method);
35 #endif
36 imap_auth_res_t imap_auth_login (IMAP_DATA * idata, const char *method);
37
38 #ifdef USE_GSS
39 imap_auth_res_t imap_auth_gss (IMAP_DATA * idata, const char *method);
40 #endif
41 #ifdef USE_SASL
42 imap_auth_res_t imap_auth_sasl (IMAP_DATA * idata, const char *method);
43 #endif
44
45 #endif /* _IMAP_AUTH_H */