ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/sasl.h
Revision: 1.4
Committed: Sun Sep 16 18:54:42 2007 UTC (16 years, 8 months ago) by pippijn
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +9 -4 lines
Log Message:
#defines to enum

File Contents

# User Rev Content
1 pippijn 1.4 /**
2     * sasl.h: Data structures for SASL plugin use.
3     *
4     * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team
5     * Rights to this code are as documented in COPYING.
6     *
7     *
8     * Portions of this file were derived from sources bearing the following license:
9 pippijn 1.3 * Copyright © 2006 Atheme Development Group
10 pippijn 1.2 * Rights to this code are as documented in doc/pod/license.pod.
11 pippijn 1.1 *
12 pippijn 1.4 * $Id: sasl.h,v 1.3 2007-08-28 17:08:07 pippijn Exp $
13 pippijn 1.1 */
14    
15     #ifndef SASL_H
16     #define SASL_H
17    
18     struct sasl_mechanism_t;
19    
20 pippijn 1.3 struct sasl_session_t : zero_initialised
21 pippijn 1.1 {
22     char uid[IDLEN];
23     char *buf, *p;
24     int len, flags;
25    
26     sasl_mechanism_t *mechptr;
27     void *mechdata;
28    
29     char *username;
30     };
31    
32 pippijn 1.3 struct sasl_message_t : zero_initialised
33 pippijn 1.1 {
34     char *uid;
35     char mode;
36     char *buf;
37     };
38    
39 pippijn 1.3 struct sasl_mechanism_t : zero_initialised
40 pippijn 1.1 {
41 pippijn 1.3 char const *name;
42 pippijn 1.1 int (*mech_start) (sasl_session_t *sptr, char **buffer, int *buflen);
43     int (*mech_step) (sasl_session_t *sptr, char *message, int length, char **buffer, int *buflen);
44     void (*mech_finish) (sasl_session_t *sptr);
45 pippijn 1.3
46     sasl_mechanism_t (char const * const mechname,
47     int (*start) (sasl_session_t *sptr, char **buffer, int *buflen),
48     int (*step) (sasl_session_t *sptr, char *message, int length, char **buffer, int *buflen),
49     void (*finish) (sasl_session_t *sptr))
50     : name (mechname), mech_start (start), mech_step (step), mech_finish (finish)
51     {
52     }
53 pippijn 1.1 };
54    
55     #define ASASL_FAIL 0 /* client supplied invalid credentials / screwed up their formatting */
56     #define ASASL_MORE 1 /* everything looks good so far, but we're not done yet */
57     #define ASASL_DONE 2 /* client successfully authenticated */
58    
59     #define ASASL_MARKED_FOR_DELETION 1 /* see delete_stale() in saslserv/main.c */
60     #define ASASL_NEED_LOG 2 /* user auth success needs to be logged still */
61    
62     #endif