Release bumped to "gts4".
[tac_plus.git] / do_author.h
1 #ifndef DO_AUTHOR_H
2 #define DO_AUTHOR_H 1
3
4 #include "tac_plus.h"
5
6
7 /*
8  * This structure describes a principal that is to be authenticated.
9  *   username        is the principals name (ASCII, null terminated)
10  *   NAS_name        is the name of the NAS where the user is
11  *   NAS_port        is the port on the NAS where the user is
12  *   NAC_address     is the remote user location.  This may be
13  *                   a remote IP address or a caller-ID or ...
14  *   priv_lvl        user's requested privilege level.
15  */
16
17 struct identity {
18     char *username;
19     char *NAS_name;
20     char *NAS_port;
21     char *NAC_address;
22     int priv_lvl;
23 };
24
25
26 /*
27  * This structure is the data structure for passing information to
28  * and from the authorization function (do_author()).
29  */
30 struct author_data {
31     struct identity *id;        /* user id */
32     int authen_method;          /* authentication method */
33
34 #define AUTHEN_METH_NONE             0x01
35 #define AUTHEN_METH_KRB5             0x02
36 #define AUTHEN_METH_LINE             0x03
37 #define AUTHEN_METH_ENABLE           0x04
38 #define AUTHEN_METH_LOCAL            0x05
39 #define AUTHEN_METH_TACACSPLUS       0x06
40 #define AUTHEN_METH_RCMD             0x20
41
42     int authen_type;            /* authentication type see authen_type */
43     int service;                /* calling service */
44     char *msg;                  /* optional NULL-terminated return message */
45     char *admin_msg;            /* optional NULL-terminated admin message */
46     int status;                 /* return status */
47
48 #define AUTHOR_STATUS_PASS_ADD       0x01
49 #define AUTHOR_STATUS_PASS_REPL      0x02
50 #define AUTHOR_STATUS_FAIL           0x10
51 #define AUTHOR_STATUS_ERROR          0x11
52
53     int num_in_args;            /* input arg count */
54     char **input_args;          /* input arguments */
55     int num_out_args;           /* output arg cnt */
56     char **output_args;         /* output arguments */
57
58 };
59
60
61 extern int do_author TAC_ARGS((struct author_data *data));
62
63
64 #endif /* DO_AUTHOR_H */