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
26 #define AUTH_SUCCESS 0 /* Authentication successful and done */
27 #define AUTH_DENIED 1 /* Ultimately failed - reason in handle->text */
28 #define AUTH_PASS 2 /* Pass data - look in handle->prompt */
29 #define AUTH_ERR 3 /* An error occurred that */
31 #define AUTH_PR_AUTO 0
32 #define AUTH_PR_NOECHO 1
33 #define AUTH_PR_ECHO 2
34 #define AUTH_PR_INFO 3
35 #define AUTH_PR_ERROR 4
41 struct authmech *next;
44 int (*inithandle)(struct authhandle *handle, char *username);
45 void (*release)(struct authhandle *handle);
46 int (*authenticate)(struct authhandle *handle, struct socket *sk, char *data);
47 int (*renewcred)(struct authhandle *handle);
48 int (*opensess)(struct authhandle *handle);
49 int (*closesess)(struct authhandle *handle);
50 int (*available)(struct socket *sk);
56 struct authmech *mech;
62 int authenticate(struct authhandle *handle, struct socket *sk, char *data);
63 struct authhandle *initauth(wchar_t *mechname, char *username);
64 void authgethandle(struct authhandle *auth);
65 void authputhandle(struct authhandle *auth);
66 int authrenewcred(struct authhandle *handle);
67 int authopensess(struct authhandle *handle);
68 int authclosesess(struct authhandle *handle);
69 void regmech(struct authmech *mech);
70 int authavailable(struct authmech *mech, struct socket *sk);
72 extern struct authmech *mechs;