]> git.saurik.com Git - apple/network_cmds.git/blob - racoon.tproj/localconf.h
network_cmds-201.tar.gz
[apple/network_cmds.git] / racoon.tproj / localconf.h
1 /* $KAME: localconf.h,v 1.28 2001/12/11 23:44:08 sakane 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 /* local configuration */
33
34 #define LC_DEFAULT_CF SYSCONFDIR "/racoon.conf"
35
36 #define LC_PATHTYPE_INCLUDE 0
37 #define LC_PATHTYPE_PSK 1
38 #define LC_PATHTYPE_CERT 2
39 #define LC_PATHTYPE_BACKUPSA 3
40 #define LC_PATHTYPE_MAX 4
41
42 #define LC_DEFAULT_PAD_MAXSIZE 20
43 #define LC_DEFAULT_PAD_RANDOM TRUE
44 #define LC_DEFAULT_PAD_RANDOMLEN FALSE
45 #define LC_DEFAULT_PAD_STRICT FALSE
46 #define LC_DEFAULT_PAD_EXCLTAIL TRUE
47 #define LC_DEFAULT_RETRY_COUNTER 5
48 #define LC_DEFAULT_RETRY_INTERVAL 10
49 #define LC_DEFAULT_COUNT_PERSEND 1
50 #define LC_DEFAULT_RETRY_CHECKPH1 30
51 #define LC_DEFAULT_WAIT_PH2COMPLETE 30
52
53 #define LC_DEFAULT_SECRETSIZE 16 /* 128 bits */
54
55 #define LC_IDENTTYPE_MAX 5 /* XXX */
56
57 struct localconf {
58 char *racoon_conf; /* configuration filename */
59
60 u_int16_t port_isakmp; /* port for isakmp as default */
61 u_int16_t port_admin; /* port for admin */
62 int default_af; /* default address family */
63
64 int sock_admin;
65 int sock_pfkey;
66 int rtsock; /* routing socket */
67
68 int autograbaddr;
69 struct myaddrs *myaddrs;
70
71 char *pathinfo[LC_PATHTYPE_MAX];
72 vchar_t *ident[LC_IDENTTYPE_MAX]; /* base of Identifier payload. */
73
74 int pad_random;
75 int pad_randomlen;
76 int pad_maxsize;
77 int pad_strict;
78 int pad_excltail;
79
80 int retry_counter; /* times to retry. */
81 int retry_interval; /* interval each retry. */
82 int count_persend; /* the number of packets each retry. */
83 /* above 3 values are copied into a handler. */
84
85 int retry_checkph1;
86 int wait_ph2complete;
87
88 int secret_size;
89 int strict_address; /* strictly check addresses. */
90
91 int complex_bundle;
92 /*
93 * If we want to make a packet "IP2 AH ESP IP1 ULP",
94 * the SPD in KAME expresses AH transport + ESP tunnel.
95 * So racoon sent the proposal contained such the order.
96 * But lots of implementation interprets AH tunnel + ESP
97 * tunnel in this case. racoon has changed the format,
98 * usually uses this format. If the option, 'complex_bundle'
99 * is enable, racoon uses old format.
100 */
101 };
102
103 extern struct localconf *lcconf;
104
105 extern void initlcconf __P((void));
106 extern void flushlcconf __P((void));
107 extern vchar_t *getpskbyname __P((vchar_t *));
108 extern vchar_t *getpskbyaddr __P((struct sockaddr *));
109 extern vchar_t *getpsk __P((const char *str, const int len));
110 extern vchar_t *getpskfromkeychain __P((const char *));
111 extern void getpathname __P((char *, int, int, const char *));
112 extern int sittype2doi __P((int));
113 extern int doitype2doi __P((int));