2 * Copyright (C) 2015 Tobias Brunner
3 * Copyright (C) 2006 Martin Willi
4 * HSR Hochschule fuer Technik Rapperswil
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 #include <sys/types.h>
25 * Socket which is used to communicate between charon and stroke
27 #define STROKE_SOCKET IPSEC_PIDDIR "/charon.ctl"
30 * Number of bytes by which the buffer is increased as needed
32 #define STROKE_BUF_LEN_INC 1024
34 typedef enum list_flag_t list_flag_t
;
37 * Definition of the LIST flags, used for
38 * the various stroke list* commands.
41 /** don't list anything */
43 /** list all raw public keys */
44 LIST_PUBKEYS
= 0x0001,
45 /** list all host/user certs */
47 /** list all ca certs */
48 LIST_CACERTS
= 0x0004,
49 /** list all ocsp signer certs */
50 LIST_OCSPCERTS
= 0x0008,
51 /** list all aa certs */
52 LIST_AACERTS
= 0x0010,
53 /** list all attribute certs */
55 /** list all access control groups */
57 /** list all ca information records */
58 LIST_CAINFOS
= 0x0080,
61 /** list all ocsp cache entries */
63 /** list all supported algorithms */
65 /** list plugin information */
66 LIST_PLUGINS
= 0x0800,
67 /** all list options */
71 typedef enum reread_flag_t reread_flag_t
;
74 * Definition of the REREAD flags, used for
75 * the various stroke reread* commands.
78 /** don't reread anything */
80 /** reread all secret keys */
81 REREAD_SECRETS
= 0x0001,
82 /** reread all ca certs */
83 REREAD_CACERTS
= 0x0002,
84 /** reread all ocsp signer certs */
85 REREAD_OCSPCERTS
= 0x0004,
86 /** reread all aa certs */
87 REREAD_AACERTS
= 0x0008,
88 /** reread all attribute certs */
89 REREAD_ACERTS
= 0x0010,
90 /** reread all crls */
92 /** all reread options */
96 typedef enum purge_flag_t purge_flag_t
;
99 * Definition of the PURGE flags, currently used for
100 * the stroke purgeocsp command.
103 /** don't purge anything */
105 /** purge ocsp cache entries */
107 /** purge CRL cache entries */
109 /** purge X509 cache entries */
110 PURGE_CERTS
= 0x0004,
111 /** purge IKE_SAs without a CHILD_SA */
115 typedef enum export_flag_t export_flag_t
;
118 * Definition of the export flags
121 /** export an X509 certificate */
122 EXPORT_X509
= 0x0001,
123 /** export an X509 end entity certificate for a connection */
124 EXPORT_CONN_CERT
= 0x0002,
125 /** export the complete trust chain of a connection */
126 EXPORT_CONN_CHAIN
= 0x0004,
130 * CRL certificate validation policy
139 typedef struct stroke_end_t stroke_end_t
;
142 * definition of a peer in a stroke message
144 struct stroke_end_t
{
173 typedef struct stroke_msg_t stroke_msg_t
;
176 * @brief A stroke message sent over the unix socket.
178 struct stroke_msg_t
{
179 /* length of this message with all strings */
182 /* type of the message */
184 /* initiate a connection */
186 /* install SPD entries for a policy */
188 /* uninstall SPD entries for a policy */
190 /* add a connection */
192 /* delete a connection */
194 /* terminate connection */
196 /* terminate connection by peers srcip/virtual ip */
198 /* rekey a connection */
200 /* show connection status */
202 /* show verbose connection status */
204 /* show verbose connection status, non-blocking variant */
205 STR_STATUS_ALL_NOBLK
,
206 /* add a ca information record */
208 /* delete ca information record */
210 /* set a log type to log/not log */
212 /* configure global options for stroke */
214 /* list various objects */
216 /* reread various objects */
218 /* purge various objects */
220 /* show pool leases */
222 /* export credentials */
224 /* print memory usage details */
226 /* set username and password for a connection */
228 /* print/reset counters */
233 /* verbosity of output returned from charon (-from -1=silent to 4=private)*/
234 int output_verbosity
;
237 /* data for STR_INITIATE, STR_ROUTE, STR_UP, STR_DOWN, ... */
240 } initiate
, route
, unroute
, terminate
, rekey
, status
, del_conn
, del_ca
;
242 /* data for STR_TERMINATE_SRCIP */
248 /* data for STR_ADD_CONN */
254 char *xauth_identity
;
270 crl_policy_t crl_policy
;
279 time_t ipsec_lifetime
;
283 uint64_t margin_bytes
;
284 uint64_t life_packets
;
285 uint64_t margin_packets
;
303 stroke_end_t me
, other
;
304 uint32_t replay_window
;
308 /* data for STR_ADD_CA */
319 /* data for STR_LOGLEVEL */
325 /* data for STR_CONFIG */
330 /* data for STR_LIST */
336 /* data for STR_REREAD */
341 /* data for STR_PURGE */
346 /* data for STR_EXPORT */
352 /* data for STR_LEASES */
358 /* data for STR_USER_CREDS */
365 /* data for STR_COUNTERS */
367 /* reset or print counters? */
372 /* length of the string buffer */
378 #endif /* STROKE_MSG_H_ */