#ifndef DO_AUTHOR_H #define DO_AUTHOR_H 1 #include "tac_plus.h" /* * This structure describes a principal that is to be authenticated. * username is the principals name (ASCII, null terminated) * NAS_name is the name of the NAS where the user is * NAS_port is the port on the NAS where the user is * NAC_address is the remote user location. This may be * a remote IP address or a caller-ID or ... * priv_lvl user's requested privilege level. */ struct identity { char *username; char *NAS_name; char *NAS_port; char *NAC_address; int priv_lvl; }; /* * This structure is the data structure for passing information to * and from the authorization function (do_author()). */ struct author_data { struct identity *id; /* user id */ int authen_method; /* authentication method */ #define AUTHEN_METH_NONE 0x01 #define AUTHEN_METH_KRB5 0x02 #define AUTHEN_METH_LINE 0x03 #define AUTHEN_METH_ENABLE 0x04 #define AUTHEN_METH_LOCAL 0x05 #define AUTHEN_METH_TACACSPLUS 0x06 #define AUTHEN_METH_RCMD 0x20 int authen_type; /* authentication type see authen_type */ int service; /* calling service */ char *msg; /* optional NULL-terminated return message */ char *admin_msg; /* optional NULL-terminated admin message */ int status; /* return status */ #define AUTHOR_STATUS_PASS_ADD 0x01 #define AUTHOR_STATUS_PASS_REPL 0x02 #define AUTHOR_STATUS_FAIL 0x10 #define AUTHOR_STATUS_ERROR 0x11 int num_in_args; /* input arg count */ char **input_args; /* input arguments */ int num_out_args; /* output arg cnt */ char **output_args; /* output arguments */ }; extern int do_author TAC_ARGS((struct author_data *data)); #endif /* DO_AUTHOR_H */