- startet importing pluto ASN1 stuff
[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 #define STROKE_SOCKET "/var/run/charon.ctl"
27
28 /**
29 * @brief A stroke message sent over the unix socket.
30 *
31 */
32 typedef struct stroke_msg_t stroke_msg_t;
33
34 struct stroke_msg_t {
35 /* length of this message with all strings */
36 u_int16_t length;
37 /* type of the message */
38 enum {
39 /* initiate a connection */
40 STR_INITIATE,
41 /* install SPD entries for a connection */
42 STR_INSTALL,
43 /* add a connection */
44 STR_ADD_CONN,
45 /* delete a connection */
46 STR_DEL_CONN,
47 /* terminate connection */
48 STR_TERMINATE,
49 /* show connection status */
50 STR_STATUS,
51 /* set a log type to log/not log */
52 STR_LOGTYPE,
53 /* set the verbosity of a logging context */
54 STR_LOGLEVEL,
55 /* more to come */
56 } type;
57 union {
58 /* data for STR_INITIATE, STR_INSTALL, STR_UP, STR_DOWN */
59 struct {
60 char *name;
61 } initiate, install, terminate;
62 /* data for STR_ADD_CONN */
63 struct {
64 char *name;
65 struct {
66 char *id;
67 char *cert;
68 char *address;
69 char *subnet;
70 u_int8_t subnet_mask;
71 } me, other;
72 } add_conn;
73 struct {
74 char *context;
75 char *type;
76 int enable;
77 } logtype;
78 struct {
79 char *context;
80 u_int level;
81 } loglevel;
82 };
83 u_int8_t buffer[];
84 };
85
86 #endif /* STROKE_H_ */