#ifdef HAVE_LIBPAM
#ifdef __APPLE__
#include <pam/pam_appl.h>
#else
#include <security/pam_appl.h>
#endif
#endif
#define INTERNAL_IP4_ADDRESS 1
#define INTERNAL_IP4_NETMASK 2
#define INTERNAL_IP4_DNS 3
#define INTERNAL_IP4_NBNS 4
#define INTERNAL_ADDRESS_EXPIRY 5
#define INTERNAL_IP4_DHCP 6
#define APPLICATION_VERSION 7
#define INTERNAL_IP6_ADDRESS 8
#define INTERNAL_IP6_NETMASK 9
#define INTERNAL_IP6_DNS 10
#define INTERNAL_IP6_NBNS 11
#define INTERNAL_IP6_DHCP 12
#define INTERNAL_IP4_SUBNET 13
#define SUPPORTED_ATTRIBUTES 14
#define INTERNAL_IP6_SUBNET 15
#define ISAKMP_CFG_RACOON_VERSION "KAME/racoon " \
"+ Hybrid auth Patches <manu@netbsd.org>"
struct isakmp_cfg_port {
char used;
#ifdef HAVE_LIBPAM
pam_handle_t *pam;
#endif
};
struct isakmp_cfg_config {
in_addr_t network4;
in_addr_t netmask4;
in_addr_t dns4;
in_addr_t nbns4;
struct isakmp_cfg_port *port_pool;
int authsource;
int confsource;
int accounting;
size_t pool_size;
int auth_throttle;
char motd[MAXPATHLEN + 1];
int pfs_group;
int save_passwd;
};
#define ISAKMP_CFG_AUTH_SYSTEM 0
#define ISAKMP_CFG_AUTH_RADIUS 1
#define ISAKMP_CFG_AUTH_PAM 2
#define ISAKMP_CFG_CONF_LOCAL 0
#define ISAKMP_CFG_CONF_RADIUS 1
#define ISAKMP_CFG_ACCT_NONE 0
#define ISAKMP_CFG_ACCT_RADIUS 1
#define ISAKMP_CFG_ACCT_PAM 2
#define ISAKMP_CFG_MAX_CNX 255
#define ISAKMP_CFG_MOTD "/etc/motd"
extern struct isakmp_cfg_config isakmp_cfg_config;
#define LOGINLEN 31
struct isakmp_cfg_state {
int flags;
unsigned int port;
char login[LOGINLEN + 1];
struct in_addr addr4;
struct in_addr mask4;
struct in_addr dns4;
struct in_addr wins4;
struct xauth_state xauth;
struct isakmp_ivm *ivm;
};
#define ISAKMP_CFG_VENDORID_XAUTH 0x01
#define ISAKMP_CFG_VENDORID_UNITY 0x02
#define ISAKMP_CFG_PORT_ALLOCATED 0x04
#define ISAKMP_CFG_ADDR4_RADIUS 0x08
#define ISAKMP_CFG_MASK4_RADIUS 0x10
#define ISAKMP_CFG_ADDR4_LOCAL 0x20
#define ISAKMP_CFG_MASK4_LOCAL 0x40
#define ISAKMP_CFG_GOT_ADDR4 0x80
#define ISAKMP_CFG_GOT_MASK4 0x100
#define ISAKMP_CFG_GOT_DNS4 0x200
#define ISAKMP_CFG_GOT_WINS4 0x400
#define ISAKMP_CFG_DELETE_PH1 0x800
struct isakmp_pl_attr;
struct ph1handle;
struct isakmp_ivm;
void isakmp_cfg_r(struct ph1handle *, vchar_t *);
int isakmp_cfg_attr_r(struct ph1handle *, u_int32_t, struct isakmp_pl_attr *);
int isakmp_cfg_reply(struct ph1handle *, struct isakmp_pl_attr *);
int isakmp_cfg_request(struct ph1handle *, struct isakmp_pl_attr *);
int isakmp_cfg_set(struct ph1handle *, struct isakmp_pl_attr *);
int isakmp_cfg_send(struct ph1handle *, vchar_t *, u_int32_t, int, int);
struct isakmp_ivm *isakmp_cfg_newiv(struct ph1handle *, u_int32_t);
void isakmp_cfg_rmstate(struct ph1handle *);
struct isakmp_cfg_state *isakmp_cfg_mkstate(void);
vchar_t *isakmp_cfg_copy(struct ph1handle *, struct isakmp_data *);
vchar_t *isakmp_cfg_short(struct ph1handle *, struct isakmp_data *, int);
vchar_t *isakmp_cfg_string(struct ph1handle *, struct isakmp_data *, char *);
int isakmp_cfg_getconfig(struct ph1handle *);
int isakmp_cfg_setenv(struct ph1handle *, char ***, int *);
int isakmp_cfg_getport(struct ph1handle *);
int isakmp_cfg_putport(struct ph1handle *, unsigned int);
#ifdef HAVE_LIBRADIUS
struct rad_handle;
extern struct rad_handle *radius_acct_state;
int isakmp_cfg_radius_common(struct rad_handle *, int);
#endif
#ifdef HAVE_LIBPAM
int isakmp_cfg_accounting_pam(int, int);
void cleanup_pam(int);
#endif