#ifndef _ISAKMP_CFG_H
#define _ISAKMP_CFG_H
#include "racoon_types.h"
#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 "racoon / IPsec-tools"
#define MAXWINS 4
#ifndef MAXNS
#define MAXNS 3
#endif
struct isakmp_cfg_port {
char used;
};
struct isakmp_cfg_config {
in_addr_t network4;
in_addr_t netmask4;
in_addr_t dns4[MAXNS];
int dns4_index;
in_addr_t nbns4[MAXWINS];
int nbns4_index;
struct isakmp_cfg_port *port_pool;
int authsource;
int groupsource;
char **grouplist;
int groupcount;
int confsource;
int accounting;
size_t pool_size;
int auth_throttle;
char default_domain[MAXPATHLEN + 1];
char motd[MAXPATHLEN + 1];
struct unity_netentry *splitnet_list;
int splitnet_count;
int splitnet_type;
char *splitdns_list;
int splitdns_len;
int pfs_group;
int save_passwd;
};
#define TERMSPEC "vpn%d"
#define ISAKMP_CFG_AUTH_SYSTEM 0
#define ISAKMP_CFG_AUTH_RADIUS 1
#define ISAKMP_CFG_AUTH_PAM 2
#define ISAKMP_CFG_AUTH_LDAP 4
#define ISAKMP_CFG_GROUP_SYSTEM 0
#define ISAKMP_CFG_GROUP_LDAP 1
#define ISAKMP_CFG_CONF_LOCAL 0
#define ISAKMP_CFG_CONF_RADIUS 1
#define ISAKMP_CFG_CONF_LDAP 2
#define ISAKMP_CFG_ACCT_NONE 0
#define ISAKMP_CFG_ACCT_RADIUS 1
#define ISAKMP_CFG_ACCT_PAM 2
#define ISAKMP_CFG_ACCT_LDAP 3
#define ISAKMP_CFG_ACCT_SYSTEM 4
#define ISAKMP_CFG_MAX_CNX 255
#define ISAKMP_CFG_MOTD "/etc/motd"
#define ISAKMP_CFG_DEFAULT_DOMAIN ""
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[MAXNS];
int dns4_index;
struct in_addr wins4[MAXWINS];
int wins4_index;
char default_domain[MAXPATHLEN + 1];
struct unity_netentry
*split_include;
int include_count;
struct unity_netentry
*split_local;
int local_count;
struct xauth_state xauth;
struct isakmp_ivm *ivm;
u_int32_t last_msgid;
vchar_t *attr_list;
};
#define ISAKMP_CFG_VENDORID_XAUTH 0x01
#define ISAKMP_CFG_VENDORID_UNITY 0x02
#define ISAKMP_CFG_PORT_ALLOCATED 0x04
#define ISAKMP_CFG_ADDR4_EXTERN 0x08
#define ISAKMP_CFG_MASK4_EXTERN 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
#define ISAKMP_CFG_GOT_DEFAULT_DOMAIN 0x1000
#define ISAKMP_CFG_GOT_SPLIT_INCLUDE 0x2000
#define ISAKMP_CFG_GOT_SPLIT_LOCAL 0x4000
#define ISAKMP_CFG_GOT_REPLY 0x8000
struct isakmp_pl_attr;
struct isakmp_ivm;
void isakmp_cfg_r (phase1_handle_t *, vchar_t *);
int isakmp_cfg_attr_r (phase1_handle_t *, u_int32_t, struct isakmp_pl_attr *, vchar_t *);
int isakmp_cfg_reply (phase1_handle_t *, struct isakmp_pl_attr *);
int isakmp_cfg_request (phase1_handle_t *, struct isakmp_pl_attr *, vchar_t *);
int isakmp_cfg_set (phase1_handle_t *, struct isakmp_pl_attr *, vchar_t *);
int isakmp_cfg_send (phase1_handle_t *, vchar_t *, u_int32_t, int, int, int, vchar_t *);
struct isakmp_ivm *isakmp_cfg_newiv (phase1_handle_t *, u_int32_t);
void isakmp_cfg_rmstate (phase1_handle_t *);
struct isakmp_cfg_state *isakmp_cfg_mkstate (void);
vchar_t *isakmp_cfg_copy (phase1_handle_t *, struct isakmp_data *);
vchar_t *isakmp_cfg_short (phase1_handle_t *, struct isakmp_data *, int);
vchar_t *isakmp_cfg_varlen (phase1_handle_t *, struct isakmp_data *, char *, size_t);
vchar_t *isakmp_cfg_string (phase1_handle_t *, struct isakmp_data *, char *);
int isakmp_cfg_getconfig (phase1_handle_t *);
int isakmp_cfg_resize_pool (int);
int isakmp_cfg_getport (phase1_handle_t *);
int isakmp_cfg_putport (phase1_handle_t *, unsigned int);
int isakmp_cfg_init (int);
#define ISAKMP_CFG_INIT_COLD 1
#define ISAKMP_CFG_INIT_WARM 0
#endif