2 * Dolda Connect - Modular multiuser Direct Connect-style client
3 * Copyright (C) 2004 Fredrik Tolf (fredrik@dolda2000.com)
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #define AUTH_SUCCESS 0 /* Authentication successful and done */
25 #define AUTH_DENIED 1 /* Ultimately failed - reason in handle->text */
26 #define AUTH_PASS 2 /* Pass data - look in handle->prompt */
27 #define AUTH_ERR 3 /* An error occurred that */
29 #define AUTH_PR_AUTO 0
30 #define AUTH_PR_NOECHO 1
31 #define AUTH_PR_ECHO 2
32 #define AUTH_PR_INFO 3
33 #define AUTH_PR_ERROR 4
39 struct authmech *next;
42 int (*inithandle)(struct authhandle *handle, char *username);
43 void (*release)(struct authhandle *handle);
44 int (*authenticate)(struct authhandle *handle, char *data);
45 int (*renewcred)(struct authhandle *handle);
46 int (*opensess)(struct authhandle *handle);
47 int (*closesess)(struct authhandle *handle);
53 struct authmech *mech;
59 int authenticate(struct authhandle *handle, char *data);
60 struct authhandle *initauth(wchar_t *mechname, char *username);
61 void authgethandle(struct authhandle *auth);
62 void authputhandle(struct authhandle *auth);
63 int authrenewcred(struct authhandle *handle);
64 int authopensess(struct authhandle *handle);
65 int authclosesess(struct authhandle *handle);
66 void regmech(struct authmech *mech);
68 extern struct authmech *mechs;