4 * @brief Definition of stroke_msg_t.
9 * Copyright (C) 2006 Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 #include <sys/types.h>
31 * Socket which is used to communicate between charon and stroke
33 #define STROKE_SOCKET IPSEC_PIDDIR "/charon.ctl"
35 #define STROKE_BUF_LEN 2048
37 typedef enum list_flag_t list_flag_t
;
40 * Definition of the LIST flags, used for
41 * the various stroke list* commands.
44 /** don't list anything */
46 /** list all raw public keys */
47 LIST_PUBKEYS
= 0x0001,
48 /** list all host/user certs */
50 /** list all ca certs */
51 LIST_CACERTS
= 0x0004,
52 /** list all ocsp signer certs */
53 LIST_OCSPCERTS
= 0x0008,
54 /** list all aa certs */
55 LIST_AACERTS
= 0x0010,
56 /** list all attribute certs */
58 /** list all access control groups */
60 /** list all ca information records */
61 LIST_CAINFOS
= 0x0080,
64 /** list all ocsp cache entries */
66 /** list all supported algorithms */
68 /** all list options */
72 typedef enum reread_flag_t reread_flag_t
;
75 * Definition of the REREAD flags, used for
76 * the various stroke reread* commands.
79 /** don't reread anything */
81 /** reread all secret keys */
82 REREAD_SECRETS
= 0x0001,
83 /** reread all ca certs */
84 REREAD_CACERTS
= 0x0002,
85 /** reread all ocsp signer certs */
86 REREAD_OCSPCERTS
= 0x0004,
87 /** reread all aa certs */
88 REREAD_AACERTS
= 0x0008,
89 /** reread all attribute certs */
90 REREAD_ACERTS
= 0x0010,
91 /** reread all crls */
93 /** all reread options */
97 typedef enum purge_flag_t purge_flag_t
;
100 * Definition of the PURGE flags, currently used for
101 * the stroke purgeocsp command.
104 /** don't purge anything */
106 /** purge ocsp cache entries */
108 /** purge IKE_SAs without a CHILD_SA */
113 * CRL certificate validation policy
122 typedef struct stroke_end_t stroke_end_t
;
125 * definition of a peer in a stroke message
127 struct stroke_end_t
{
150 typedef struct stroke_msg_t stroke_msg_t
;
153 * @brief A stroke message sent over the unix socket.
155 struct stroke_msg_t
{
156 /* length of this message with all strings */
159 /* type of the message */
161 /* initiate a connection */
163 /* install SPD entries for a policy */
165 /* uninstall SPD entries for a policy */
167 /* add a connection */
169 /* delete a connection */
171 /* terminate connection */
173 /* terminate connection by peers srcip/virtual ip */
175 /* show connection status */
177 /* show verbose connection status */
179 /* add a ca information record */
181 /* delete ca information record */
183 /* set a log type to log/not log */
185 /* configure global options for stroke */
187 /* list various objects */
189 /* reread various objects */
191 /* purge various objects */
193 /* show pool leases */
198 /* verbosity of output returned from charon (-from -1=silent to 4=private)*/
199 int output_verbosity
;
202 /* data for STR_INITIATE, STR_ROUTE, STR_UP, STR_DOWN, ... */
205 } initiate
, route
, unroute
, terminate
, status
, del_conn
, del_ca
;
207 /* data for STR_TERMINATE_SRCIP */
213 /* data for STR_ADD_CONN */
217 /* next three are deprecated, use stroke_end_t.auth instead */
220 u_int32_t eap_vendor
;
230 crl_policy_t crl_policy
;
238 time_t ipsec_lifetime
;
241 u_int64_t life_bytes
;
242 u_int64_t margin_bytes
;
243 u_int64_t life_packets
;
244 u_int64_t margin_packets
;
257 stroke_end_t me
, other
;
260 /* data for STR_ADD_CA */
271 /* data for STR_LOGLEVEL */
277 /* data for STR_CONFIG */
282 /* data for STR_LIST */
288 /* data for STR_REREAD */
293 /* data for STR_PURGE */
298 /* data for STR_LEASES */
304 char buffer
[STROKE_BUF_LEN
];
307 #endif /* STROKE_MSG_H_ */