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 CRL cache entries */
110 /** purge X509 cache entries */
111 PURGE_CERTS
= 0x0004,
112 /** purge IKE_SAs without a CHILD_SA */
116 typedef enum export_flag_t export_flag_t
;
119 * Definition of the export flags
122 /** export an X509 certificate */
123 EXPORT_X509
= 0x0001,
127 * CRL certificate validation policy
136 typedef struct stroke_end_t stroke_end_t
;
139 * definition of a peer in a stroke message
141 struct stroke_end_t
{
166 typedef struct stroke_msg_t stroke_msg_t
;
169 * @brief A stroke message sent over the unix socket.
171 struct stroke_msg_t
{
172 /* length of this message with all strings */
175 /* type of the message */
177 /* initiate a connection */
179 /* install SPD entries for a policy */
181 /* uninstall SPD entries for a policy */
183 /* add a connection */
185 /* delete a connection */
187 /* terminate connection */
189 /* terminate connection by peers srcip/virtual ip */
191 /* rekey a connection */
193 /* show connection status */
195 /* show verbose connection status */
197 /* add a ca information record */
199 /* delete ca information record */
201 /* set a log type to log/not log */
203 /* configure global options for stroke */
205 /* list various objects */
207 /* reread various objects */
209 /* purge various objects */
211 /* show pool leases */
213 /* export credentials */
215 /* print memory usage details */
220 /* verbosity of output returned from charon (-from -1=silent to 4=private)*/
221 int output_verbosity
;
224 /* data for STR_INITIATE, STR_ROUTE, STR_UP, STR_DOWN, ... */
227 } initiate
, route
, unroute
, terminate
, rekey
, status
, del_conn
, del_ca
;
229 /* data for STR_TERMINATE_SRCIP */
235 /* data for STR_ADD_CONN */
239 /* next three are deprecated, use stroke_end_t.auth instead */
242 u_int32_t eap_vendor
;
255 crl_policy_t crl_policy
;
263 time_t ipsec_lifetime
;
266 u_int64_t life_bytes
;
267 u_int64_t margin_bytes
;
268 u_int64_t life_packets
;
269 u_int64_t margin_packets
;
286 stroke_end_t me
, other
;
289 /* data for STR_ADD_CA */
300 /* data for STR_LOGLEVEL */
306 /* data for STR_CONFIG */
311 /* data for STR_LIST */
317 /* data for STR_REREAD */
322 /* data for STR_PURGE */
327 /* data for STR_EXPORT */
333 /* data for STR_LEASES */
339 char buffer
[STROKE_BUF_LEN
];
342 #endif /* STROKE_MSG_H_ */