- applied patch from andreas, which allows certificate listing via stroke
[strongswan.git] / src / stroke / stroke.h
1 /**
2 * @file stroke.h
3 *
4 * @brief Definition of stroke_msg_t.
5 *
6 */
7
8 /*
9 * Copyright (C) 2006 Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
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>.
16 *
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
20 * for more details.
21 */
22
23 #ifndef STROKE_H_
24 #define STROKE_H_
25
26 /**
27 * Socket which is used to communicate between charon and stroke
28 */
29 #define STROKE_SOCKET "/var/run/charon.ctl"
30
31
32 typedef struct stroke_msg_t stroke_msg_t;
33
34 /**
35 * @brief A stroke message sent over the unix socket.
36 */
37 struct stroke_msg_t {
38 /* length of this message with all strings */
39 u_int16_t length;
40
41 /* type of the message */
42 enum {
43 /* initiate a connection */
44 STR_INITIATE,
45 /* install SPD entries for a connection */
46 STR_INSTALL,
47 /* add a connection */
48 STR_ADD_CONN,
49 /* delete a connection */
50 STR_DEL_CONN,
51 /* terminate connection */
52 STR_TERMINATE,
53 /* show connection status */
54 STR_STATUS,
55 /* show verbose connection status */
56 STR_STATUS_ALL,
57 /* set a log type to log/not log */
58 STR_LOGTYPE,
59 /* set the verbosity of a logging context */
60 STR_LOGLEVEL,
61 /* show list of locally loaded certificates */
62 STR_LIST_CERTS
63 /* more to come */
64 } type;
65
66 union {
67 /* data for STR_INITIATE, STR_INSTALL, STR_UP, STR_DOWN */
68 struct {
69 char *name;
70 } initiate, install, terminate, status;
71 /* data for STR_ADD_CONN */
72 struct {
73 char *name;
74 struct {
75 char *id;
76 char *cert;
77 char *address;
78 char *subnet;
79 u_int8_t subnet_mask;
80 } me, other;
81 } add_conn;
82 struct {
83 char *context;
84 char *type;
85 int enable;
86 } logtype;
87 struct {
88 char *context;
89 u_int level;
90 } loglevel;
91 };
92
93 u_int8_t buffer[];
94 };
95
96 #endif /* STROKE_H_ */