implemented mconsole notification to check if guest came up
[strongswan.git] / src / dumm / mconsole.h
1 /*
2 * Copyright (C) 2007 Martin Willi
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 #ifndef MCONSOLE_H
17 #define MCONSOLE_H
18
19 #include <library.h>
20
21 typedef struct mconsole_t mconsole_t;
22
23 /**
24 * @brief UML mconsole, change running UML configuration using mconsole.
25 */
26 struct mconsole_t {
27
28 /**
29 * @brief Create a guest interface and connect it to tap host interface.
30 *
31 * @param guest name of the interface to create in the guest
32 * @param host name of the tap device to connect guest to
33 * @return TRUE if interface created
34 */
35 bool (*add_iface)(mconsole_t *this, char *guest, char *host);
36
37 /**
38 * @brief Delete a guest interface.
39 *
40 * @param guest name of the interface to delete on the guest
41 * @return TRUE if interface deleted
42 */
43 bool (*del_iface)(mconsole_t *this, char *guest);
44
45 /**
46 * @brief Destroy the mconsole instance
47 */
48 void (*destroy) (mconsole_t *this);
49 };
50
51 /**
52 * @brief Create a new mconsole connection to a guest.
53 *
54 * Waits for a notification from the guest through the notify socket and tries
55 * to connect to the mconsole socket supplied in the received notification.
56 *
57 * @param notify unix notify socket path
58 * @return mconsole instance, or NULL if failed
59 */
60 mconsole_t *mconsole_create(char *notify);
61
62 #endif /* MCONSOLE_H */
63