added dynamic interface manipulation for guests
[strongswan.git] / src / dumm / dumm.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 DUMM_H
17 #define DUMM_H
18
19 #include <library.h>
20 #include <utils/linked_list.h>
21
22 #include "guest.h"
23
24 #define HOST_DIR "host"
25 #define MOUNT_DIR "mount"
26 #define RUN_DIR "run"
27
28
29 typedef struct dumm_t dumm_t;
30
31 /**
32 * @brief dumm - Dynamic Uml Mesh Modeler
33 *
34 * Controls a group of UML guests and their networks.
35 */
36 struct dumm_t {
37
38 /**
39 * @brief Starts a new UML guest
40 *
41 * @param name name of the guest
42 * @param kernel kernel to boot
43 * @param master mounted read only master filesystem
44 * @param mem amount of memory for guest, in MB
45 * @return guest if started, NULL if failed
46 */
47 guest_t* (*start_guest) (dumm_t *this, char *name, char *kernel,
48 char *master, int mem);
49
50 /**
51 * @brief Create an iterator over all guests.
52 *
53 * @return iteraotor over guest_t's
54 */
55 iterator_t* (*create_guest_iterator) (dumm_t *this);
56
57 /**
58 * @brief stop all guests and destroy the modeler
59 */
60 void (*destroy) (dumm_t *this);
61 };
62
63 /**
64 * @brief Create a new group of UML hosts and networks.
65 *
66 * Dumm uses its working dir to create folders and files it works with.
67 *
68 * @return created UML group, or NULL if failed.
69 */
70 dumm_t *dumm_create();
71
72 #endif /* DUMM_H */
73