1 /* strongSwan IPsec config file parser
2 * Copyright (C) 2001-2002 Mathieu Lafon
3 * Arkoon Network Security
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 #ifndef _IPSEC_CONFREAD_H_
17 #define _IPSEC_CONFREAD_H_
20 #include "../pluto/constants.h"
22 #include "ipsec-parser.h"
40 /* shared with ike_version_t */
42 KEY_EXCHANGE_IKEV1
= 1,
43 KEY_EXCHANGE_IKEV2
= 2,
52 typedef struct starter_end starter_end_t
;
73 bool has_client_wildcard
;
74 bool has_port_wildcard
;
78 certpolicy_t sendcert
;
90 typedef struct also also_t
;
98 typedef struct starter_conn starter_conn_t
;
100 struct starter_conn
{
107 starter_state_t state
;
109 keyexchange_t keyexchange
;
112 char *xauth_identity
;
115 time_t sa_ike_life_seconds
;
116 time_t sa_ipsec_life_seconds
;
117 time_t sa_rekey_margin
;
118 u_int64_t sa_ipsec_life_bytes
;
119 u_int64_t sa_ipsec_margin_bytes
;
120 u_int64_t sa_ipsec_life_packets
;
121 u_int64_t sa_ipsec_margin_packets
;
122 unsigned long sa_keying_tries
;
123 unsigned long sa_rekey_fuzz
;
128 sa_family_t addr_family
;
129 sa_family_t tunnel_addr_family
;
132 starter_end_t left
, right
;
142 dpd_action_t dpd_action
;
145 dpd_action_t close_action
;
150 char *me_mediated_by
;
153 starter_conn_t
*next
;
156 typedef struct starter_ca starter_ca_t
;
165 starter_state_t state
;
181 typedef struct starter_config starter_config_t
;
183 struct starter_config
{
191 /* pluto/charon keywords */
196 char *plutostderrlog
;
199 time_t crlcheckinterval
;
201 strict_t strictcrlpolicy
;
205 u_int force_keepalive
;
206 char *virtual_private
;
208 char *pkcs11initargs
;
209 bool pkcs11keepstate
;
219 /* number of encountered parsing errors */
223 /* do we parse also statements */
227 starter_ca_t ca_default
;
229 /* connections list (without %default) */
230 starter_ca_t
*ca_first
, *ca_last
;
233 starter_conn_t conn_default
;
235 /* connections list (without %default) */
236 starter_conn_t
*conn_first
, *conn_last
;
239 extern starter_config_t
*confread_load(const char *file
);
240 extern void confread_free(starter_config_t
*cfg
);
242 #endif /* _IPSEC_CONFREAD_H_ */