/** * sasl.h: Data structures for SASL plugin use. * * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team * Rights to this code are as documented in COPYING. * * * Portions of this file were derived from sources bearing the following license: * Copyright © 2006 Atheme Development Group * Rights to this code are as documented in doc/pod/license.pod. * * $Id: sasl.h,v 1.4 2007/09/16 18:54:42 pippijn Exp $ */ #ifndef SASL_H #define SASL_H struct sasl_mechanism_t; struct sasl_session_t : zero_initialised { char uid[IDLEN]; char *buf, *p; int len, flags; sasl_mechanism_t *mechptr; void *mechdata; char *username; }; struct sasl_message_t : zero_initialised { char *uid; char mode; char *buf; }; struct sasl_mechanism_t : zero_initialised { char const *name; int (*mech_start) (sasl_session_t *sptr, char **buffer, int *buflen); int (*mech_step) (sasl_session_t *sptr, char *message, int length, char **buffer, int *buflen); void (*mech_finish) (sasl_session_t *sptr); sasl_mechanism_t (char const * const mechname, int (*start) (sasl_session_t *sptr, char **buffer, int *buflen), int (*step) (sasl_session_t *sptr, char *message, int length, char **buffer, int *buflen), void (*finish) (sasl_session_t *sptr)) : name (mechname), mech_start (start), mech_step (step), mech_finish (finish) { } }; #define ASASL_FAIL 0 /* client supplied invalid credentials / screwed up their formatting */ #define ASASL_MORE 1 /* everything looks good so far, but we're not done yet */ #define ASASL_DONE 2 /* client successfully authenticated */ #define ASASL_MARKED_FOR_DELETION 1 /* see delete_stale() in saslserv/main.c */ #define ASASL_NEED_LOG 2 /* user auth success needs to be logged still */ #endif