#ifndef _TACLIB_H_
#define _TACLIB_H_
#include <sys/types.h>
struct tac_handle;
#define TAC_SRVR_SINGLE_CONNECT 0x04
#define TAC_AUTHEN_STATUS(s) ((s) & 0xff)
#define TAC_AUTHEN_NOECHO(s) ((s) & (1<<8))
#define TAC_AUTHOR_STATUS(s) ((s) & 0xff)
#define TAC_AUTHEN_AV_COUNT(s) (((s)>>8) & 0xff)
#define TAC_PRIV_LVL_MIN 0x00
#define TAC_PRIV_LVL_USER 0x01
#define TAC_PRIV_LVL_ROOT 0x0f
#define TAC_PRIV_LVL_MAX 0x0f
#define TAC_AUTHEN_LOGIN 0x01
#define TAC_AUTHEN_CHPASS 0x02
#define TAC_AUTHEN_SENDPASS 0x03
#define TAC_AUTHEN_SENDAUTH 0x04
#define TAC_AUTHEN_TYPE_NOT_SET 0x00
#define TAC_AUTHEN_TYPE_ASCII 0x01
#define TAC_AUTHEN_TYPE_PAP 0x02
#define TAC_AUTHEN_TYPE_CHAP 0x03
#define TAC_AUTHEN_TYPE_ARAP 0x04
#define TAC_AUTHEN_TYPE_MSCHAP 0x05
#define TAC_AUTHEN_SVC_NONE 0x00
#define TAC_AUTHEN_SVC_LOGIN 0x01
#define TAC_AUTHEN_SVC_ENABLE 0x02
#define TAC_AUTHEN_SVC_PPP 0x03
#define TAC_AUTHEN_SVC_ARAP 0x04
#define TAC_AUTHEN_SVC_PT 0x05
#define TAC_AUTHEN_SVC_RCMD 0x06
#define TAC_AUTHEN_SVC_X25 0x07
#define TAC_AUTHEN_SVC_NASI 0x08
#define TAC_AUTHEN_SVC_FWPROXY 0x09
#define TAC_AUTHEN_STATUS_PASS 0x01
#define TAC_AUTHEN_STATUS_FAIL 0x02
#define TAC_AUTHEN_STATUS_GETDATA 0x03
#define TAC_AUTHEN_STATUS_GETUSER 0x04
#define TAC_AUTHEN_STATUS_GETPASS 0x05
#define TAC_AUTHEN_STATUS_RESTART 0x06
#define TAC_AUTHEN_STATUS_ERROR 0x07
#define TAC_AUTHEN_STATUS_FOLLOW 0x21
#define TAC_AUTHEN_METH_NOT_SET 0x00
#define TAC_AUTHEN_METH_NONE 0x01
#define TAC_AUTHEN_METH_KRB5 0x02
#define TAC_AUTHEN_METH_LINE 0x03
#define TAC_AUTHEN_METH_ENABLE 0x04
#define TAC_AUTHEN_METH_LOCAL 0x05
#define TAC_AUTHEN_METH_TACACSPLUS 0x06
#define TAC_AUTHEN_METH_RCMD 0x20
#define TAC_AUTHOR_STATUS_PASS_ADD 0x01
#define TAC_AUTHOR_STATUS_PASS_REPL 0x02
#define TAC_AUTHOR_STATUS_FAIL 0x10
#define TAC_AUTHOR_STATUS_ERROR 0x11
#define TAC_ACCT_MORE 0x1
#define TAC_ACCT_START 0x2
#define TAC_ACCT_STOP 0x4
#define TAC_ACCT_WATCHDOG 0x8
#define TAC_ACCT_STATUS_SUCCESS 0x1
#define TAC_ACCT_STATUS_ERROR 0x2
#define TAC_ACCT_STATUS_FOLLOW 0x21
__BEGIN_DECLS
int tac_add_server(struct tac_handle *,
const char *, int, const char *, int, int);
void tac_close(struct tac_handle *);
int tac_config(struct tac_handle *, const char *);
int tac_create_authen(struct tac_handle *, int, int, int);
void *tac_get_data(struct tac_handle *, size_t *);
char *tac_get_msg(struct tac_handle *);
struct tac_handle *tac_open(void);
int tac_send_authen(struct tac_handle *);
int tac_set_data(struct tac_handle *,
const void *, size_t);
int tac_set_msg(struct tac_handle *, const char *);
int tac_set_port(struct tac_handle *, const char *);
int tac_set_priv(struct tac_handle *, int);
int tac_set_rem_addr(struct tac_handle *, const char *);
int tac_set_user(struct tac_handle *, const char *);
const char *tac_strerror(struct tac_handle *);
int tac_send_author(struct tac_handle *);
int tac_create_author(struct tac_handle *, int, int, int);
int tac_set_av(struct tac_handle *, u_int, const char *);
char *tac_get_av(struct tac_handle *, u_int);
char *tac_get_av_value(struct tac_handle *, const char *);
void tac_clear_avs(struct tac_handle *);
int tac_create_acct(struct tac_handle *, int, int, int, int);
int tac_send_acct(struct tac_handle *);
__END_DECLS
#endif