1 #ifndef CHOOSE_AUTHEN_H
2 #define CHOOSE_AUTHEN_H 1
6 #include <sys/types.h> /* for u_* */
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
16 #define AUTHEN_NAME_SIZE 128
21 char authen_name[AUTHEN_NAME_SIZE];
22 int (*authen_func) TAC_ARGS((struct authen_data *data));
27 * The authen_data structure is the data structure for passing
28 * information to and from the authentication function
29 * (authen_type.authen_func).
33 struct identity *NAS_id; /* user identity */
34 char *server_msg; /* null-terminated output msg */
36 int server_dlen; /* output data length */
37 unsigned char *server_data; /* output data */
39 char *client_msg; /* null-terminated input msg a user typed */
41 int client_dlen; /* input data length */
42 char *client_data; /* input data */
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 */
52 /* return values for choose_authen(); */
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 */
60 extern int choose_authen TAC_ARGS((struct authen_data *data, struct authen_type *type));
63 #endif /* CHOOSE_AUTHEN_H */