- add connection names to connections
[strongswan.git] / Source / 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 /* type of the message */
41 enum {
42 /* initiate a connection */
43 STR_INITIATE,
44 /* install SPD entries for a connection */
45 STR_INSTALL,
46 /* add a connection */
47 STR_ADD_CONN,
48 /* delete a connection */
49 STR_DEL_CONN,
50 /* terminate connection */
51 STR_TERMINATE,
52 /* show connection status */
53 STR_STATUS,
54 /* show verbose connection status */
55 STR_STATUS_ALL,
56 /* set a log type to log/not log */
57 STR_LOGTYPE,
58 /* set the verbosity of a logging context */
59 STR_LOGLEVEL,
60 /* more to come */
61 } type;
62 union {
63 /* data for STR_INITIATE, STR_INSTALL, STR_UP, STR_DOWN */
64 struct {
65 char *name;
66 } initiate, install, terminate, status;
67 /* data for STR_ADD_CONN */
68 struct {
69 char *name;
70 struct {
71 char *id;
72 char *cert;
73 char *address;
74 char *subnet;
75 u_int8_t subnet_mask;
76 } me, other;
77 } add_conn;
78 struct {
79 char *context;
80 char *type;
81 int enable;
82 } logtype;
83 struct {
84 char *context;
85 u_int level;
86 } loglevel;
87 };
88 u_int8_t buffer[];
89 };
90
91 #endif /* STROKE_H_ */