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 /** list plugin information */
69 LIST_PLUGINS
= 0x0800,
70 /** all list options */
74 typedef enum reread_flag_t reread_flag_t
;
77 * Definition of the REREAD flags, used for
78 * the various stroke reread* commands.
81 /** don't reread anything */
83 /** reread all secret keys */
84 REREAD_SECRETS
= 0x0001,
85 /** reread all ca certs */
86 REREAD_CACERTS
= 0x0002,
87 /** reread all ocsp signer certs */
88 REREAD_OCSPCERTS
= 0x0004,
89 /** reread all aa certs */
90 REREAD_AACERTS
= 0x0008,
91 /** reread all attribute certs */
92 REREAD_ACERTS
= 0x0010,
93 /** reread all crls */
95 /** all reread options */
99 typedef enum purge_flag_t purge_flag_t
;
102 * Definition of the PURGE flags, currently used for
103 * the stroke purgeocsp command.
106 /** don't purge anything */
108 /** purge ocsp cache entries */
110 /** purge CRL cache entries */
112 /** purge X509 cache entries */
113 PURGE_CERTS
= 0x0004,
114 /** purge IKE_SAs without a CHILD_SA */
118 typedef enum export_flag_t export_flag_t
;
121 * Definition of the export flags
124 /** export an X509 certificate */
125 EXPORT_X509
= 0x0001,
129 * CRL certificate validation policy
138 typedef struct stroke_end_t stroke_end_t
;
141 * definition of a peer in a stroke message
143 struct stroke_end_t
{
170 typedef struct stroke_msg_t stroke_msg_t
;
173 * @brief A stroke message sent over the unix socket.
175 struct stroke_msg_t
{
176 /* length of this message with all strings */
179 /* type of the message */
181 /* initiate a connection */
183 /* install SPD entries for a policy */
185 /* uninstall SPD entries for a policy */
187 /* add a connection */
189 /* delete a connection */
191 /* terminate connection */
193 /* terminate connection by peers srcip/virtual ip */
195 /* rekey a connection */
197 /* show connection status */
199 /* show verbose connection status */
201 /* show verbose connection status, non-blocking variant */
202 STR_STATUS_ALL_NOBLK
,
203 /* add a ca information record */
205 /* delete ca information record */
207 /* set a log type to log/not log */
209 /* configure global options for stroke */
211 /* list various objects */
213 /* reread various objects */
215 /* purge various objects */
217 /* show pool leases */
219 /* export credentials */
221 /* print memory usage details */
223 /* set username and password for a connection */
228 /* verbosity of output returned from charon (-from -1=silent to 4=private)*/
229 int output_verbosity
;
232 /* data for STR_INITIATE, STR_ROUTE, STR_UP, STR_DOWN, ... */
235 } initiate
, route
, unroute
, terminate
, rekey
, status
, del_conn
, del_ca
;
237 /* data for STR_TERMINATE_SRCIP */
243 /* data for STR_ADD_CONN */
249 char *xauth_identity
;
262 crl_policy_t crl_policy
;
270 time_t ipsec_lifetime
;
273 u_int64_t life_bytes
;
274 u_int64_t margin_bytes
;
275 u_int64_t life_packets
;
276 u_int64_t margin_packets
;
294 stroke_end_t me
, other
;
297 /* data for STR_ADD_CA */
308 /* data for STR_LOGLEVEL */
314 /* data for STR_CONFIG */
319 /* data for STR_LIST */
325 /* data for STR_REREAD */
330 /* data for STR_PURGE */
335 /* data for STR_EXPORT */
341 /* data for STR_LEASES */
347 /* data for STR_USER_CREDS */
354 char buffer
[STROKE_BUF_LEN
];
357 #endif /* STROKE_MSG_H_ */