7e45b3c7d5747fc090431e46b6110a4066411846
[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 /* is this connection handled by charon? */
75 int ikev2;
76 struct {
77 char *id;
78 char *cert;
79 char *address;
80 char *subnet;
81 int subnet_mask;
82 } me, other;
83 } add_conn;
84 struct {
85 char *context;
86 char *type;
87 int enable;
88 } logtype;
89 struct {
90 char *context;
91 int level;
92 } loglevel;
93 };
94 u_int8_t buffer[];
95 };
96
97 #endif /* STROKE_H_ */