]> git.saurik.com Git - apple/ipsec.git/blame - ipsec-tools/racoon/localconf.h
ipsec-34.0.1.tar.gz
[apple/ipsec.git] / ipsec-tools / racoon / localconf.h
CommitLineData
52b7d2ce
A
1/* $Id: localconf.h,v 1.9.2.3 2005/11/06 17:18:26 monas Exp $ */
2
3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the project nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 */
31
32#ifndef _LOCALCONF_H
33#define _LOCALCONF_H
34
35/* local configuration */
36
37#define LC_DEFAULT_CF SYSCONFDIR "/racoon.conf"
38
39#define LC_PATHTYPE_INCLUDE 0
40#define LC_PATHTYPE_PSK 1
41#define LC_PATHTYPE_CERT 2
42#define LC_PATHTYPE_BACKUPSA 3
43#define LC_PATHTYPE_SCRIPT 4
44#define LC_PATHTYPE_PIDFILE 5
45#define LC_PATHTYPE_LOGFILE 6
46#define LC_PATHTYPE_MAX 7
47
48#define LC_DEFAULT_PAD_MAXSIZE 20
49#define LC_DEFAULT_PAD_RANDOM TRUE
50#define LC_DEFAULT_PAD_RANDOMLEN FALSE
51#define LC_DEFAULT_PAD_STRICT FALSE
52#define LC_DEFAULT_PAD_EXCLTAIL TRUE
53#define LC_DEFAULT_RETRY_COUNTER 5
54#define LC_DEFAULT_RETRY_INTERVAL 10
55#define LC_DEFAULT_COUNT_PERSEND 1
56#define LC_DEFAULT_RETRY_CHECKPH1 30
57#define LC_DEFAULT_WAIT_PH2COMPLETE 30
58#define LC_DEFAULT_NATT_KA_INTERVAL 20
59
60#define LC_DEFAULT_SECRETSIZE 16 /* 128 bits */
61
62#define LC_IDENTTYPE_MAX 5 /* XXX */
63
64#define LC_GSSENC_UTF16LE 0 /* GSS ID in UTF-16LE */
65#define LC_GSSENC_LATIN1 1 /* GSS ID in ISO-Latin-1 */
66#define LC_GSSENC_MAX 2
67
68#define LC_AUTOEXITSTATE_SET 0x00000001
69#define LC_AUTOEXITSTATE_CLIENT 0x00000010
70#define LC_AUTOEXITSTATE_ENABLED 0x00000011 /* both VPN client and set */
71
72
73struct vpnctl_socket_elem {
74 LIST_ENTRY(vpnctl_socket_elem) chain;
75 int sock;
76 LIST_HEAD(_bound_addrs, bound_addr) bound_addresses;
77};
78
79struct bound_addr {
80 LIST_ENTRY(bound_addr) chain;
81 u_int32_t address;
82};
83
84struct redirect {
85 LIST_ENTRY(redirect) chain;
86 u_int32_t cluster_address;
87 u_int32_t redirect_address;
88 u_int16_t force;
89};
90
91
92struct localconf {
93 char *racoon_conf; /* configuration filename */
94
95 uid_t uid;
96 gid_t gid;
97 char *chroot; /* chroot path */
98 u_int16_t port_isakmp; /* port for isakmp as default */
99 u_int16_t port_isakmp_natt; /* port for NAT-T use */
100 u_int16_t port_admin; /* port for admin */
101 int default_af; /* default address family */
102
103 int sock_admin;
104 int sock_vpncontrol;
105 int sock_pfkey;
106 int rtsock; /* routing socket */
107 LIST_HEAD(_vpnctl_socket_elem_, vpnctl_socket_elem) vpnctl_comm_socks;
108 LIST_HEAD(_redirect_, redirect) redirect_addresses;
109 int auto_exit_state; /* auto exit state */
110 int auto_exit_delay; /* auto exit delay until exit */
111 struct sched *auto_exit_sched; /* auto exit schedule */
112
113 int autograbaddr;
114 struct myaddrs *myaddrs;
115
116 char *logfile_param; /* from command line */
117 char *pathinfo[LC_PATHTYPE_MAX];
118 vchar_t *ident[LC_IDENTTYPE_MAX]; /* base of Identifier payload. */
119
120 int pad_random;
121 int pad_randomlen;
122 int pad_maxsize;
123 int pad_strict;
124 int pad_excltail;
125
126 int retry_counter; /* times to retry. */
127 int retry_interval; /* interval each retry. */
128 int count_persend; /* the number of packets each retry. */
129 /* above 3 values are copied into a handler. */
130
131 int retry_checkph1;
132 int wait_ph2complete;
133
134 int natt_ka_interval; /* NAT-T keepalive interval. */
05434fec 135 vchar_t *ext_nat_id; /* our address id for our nat address */
52b7d2ce
A
136
137 int secret_size;
138 int strict_address; /* strictly check addresses. */
139
140 int complex_bundle;
141 /*
142 * If we want to make a packet "IP2 AH ESP IP1 ULP",
143 * the SPD in KAME expresses AH transport + ESP tunnel.
144 * So racoon sent the proposal contained such the order.
145 * But lots of implementation interprets AH tunnel + ESP
146 * tunnel in this case. racoon has changed the format,
147 * usually uses this format. If the option, 'complex_bundle'
148 * is enable, racoon uses old format.
149 */
150
151 int gss_id_enc; /* GSS ID encoding to use */
152};
153
154extern struct localconf *lcconf;
155
156extern void initlcconf __P((void));
157extern void flushlcconf __P((void));
158extern vchar_t *getpskbyname __P((vchar_t *));
159extern vchar_t *getpskbyaddr __P((struct sockaddr *));
160#ifdef __APPLE__
161extern vchar_t *getpskfromkeychain __P((const char *, u_int8_t, int, vchar_t *));
162#endif
163extern void getpathname __P((char *, int, int, const char *));
164extern int sittype2doi __P((int));
165extern int doitype2doi __P((int));
166extern vchar_t *getpsk __P((const char *, const int));
167
168#endif /* _LOCALCONF_H */