Release bumped to "gts4".
[tac_plus.git] / choose_authen.h
1 #ifndef CHOOSE_AUTHEN_H
2 #define CHOOSE_AUTHEN_H 1
3
4 #include "tac_plus.h"
5
6 #include <sys/types.h>          /* for u_* */
7
8
9 /*
10  * This structure describes an authentication method.
11  *   authen_name     contains the name of the authentication method.
12  *   authen_func     is a pointer to the authentication function.
13  *   authen_method   numeric value of authentication method
14  */
15
16 #define AUTHEN_NAME_SIZE 128
17
18 struct authen_data;
19
20 struct authen_type {
21     char authen_name[AUTHEN_NAME_SIZE];
22     int (*authen_func) TAC_ARGS((struct authen_data *data));
23     int authen_type;
24 };
25
26 /*
27  * The authen_data structure is the data structure for passing
28  * information to and from the authentication function
29  * (authen_type.authen_func).
30  */
31
32 struct authen_data {
33     struct identity *NAS_id;    /* user identity */
34     char *server_msg;           /* null-terminated output msg */
35
36     int server_dlen;            /* output data length */
37     unsigned char *server_data; /* output data */
38
39     char *client_msg;           /* null-terminated input msg a user typed */
40
41     int client_dlen;            /* input data length */
42     char *client_data;          /* input data */
43
44     void *method_data;          /* opaque private method data */
45     int action;                 /* what's to be done */
46     int service;                /* calling service */
47     int status;                 /* Authen status */
48     int type;                   /* Authen type */
49     u_char flags;               /* input & output flags fields */
50 };
51
52 /* return values for  choose_authen(); */
53
54 #define CHOOSE_FAILED -1     /* failed to choose an authentication function */
55 #define CHOOSE_OK      0     /* successfully chose an authentication function */
56 #define CHOOSE_GETUSER 1     /* need a username before choosing */
57 #define CHOOSE_BADTYPE 2     /* Invalid preferred authen function specified */
58
59
60 extern int choose_authen TAC_ARGS((struct authen_data *data, struct authen_type *type));
61
62
63 #endif /* CHOOSE_AUTHEN_H */