aboutsummaryrefslogtreecommitdiffstats
path: root/src/dumm/guest.h
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2007-07-25 13:23:45 +0000
committerMartin Willi <martin@strongswan.org>2007-07-25 13:23:45 +0000
commitf85fdda83598cdfde287ee0acb5581d9cb2f261b (patch)
treeb83ef7735a7eb81b9ae447b8045b0e011eb92bba /src/dumm/guest.h
parent5c7da9d402a71992a5dc47c5ab25fd6f1479f5a7 (diff)
downloadstrongswan-f85fdda83598cdfde287ee0acb5581d9cb2f261b.tar.bz2
strongswan-f85fdda83598cdfde287ee0acb5581d9cb2f261b.tar.xz
added dynamic interface manipulation for guests
management of tap devices on the host
Diffstat (limited to 'src/dumm/guest.h')
-rw-r--r--src/dumm/guest.h65
1 files changed, 63 insertions, 2 deletions
diff --git a/src/dumm/guest.h b/src/dumm/guest.h
index 39a72c081..f4e9f50c6 100644
--- a/src/dumm/guest.h
+++ b/src/dumm/guest.h
@@ -1,23 +1,84 @@
+/*
+ * Copyright (C) 2007 Martin Willi
+ * Hochschule fuer Technik Rapperswil
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
#ifndef GUEST_H
#define GUEST_H
#include <library.h>
-#include <utils/linked_list.h>
+#include <utils/iterator.h>
+
+#include "iface.h"
typedef struct guest_t guest_t;
+/**
+ * @brief A guest is a UML instance running on the host.
+ **/
struct guest_t {
+ /**
+ * @brief Get the name of this guest.
+ *
+ * @return name of the guest
+ */
char* (*get_name) (guest_t *this);
+ /**
+ * @brief Start the guest.
+ *
+ * @return TRUE if guest successfully started
+ */
bool (*start) (guest_t *this);
+ /**
+ * @brief Kill the guest.
+ *
+ * @return TRUE if guest was running and killed
+ */
bool (*stop) (guest_t *this);
+ /**
+ * @brief Create a new interface for that host.
+ *
+ * @param name name of the interface in the guest
+ * @return created interface, or NULL if failed
+ */
+ iface_t* (*create_iface)(guest_t *this, char *name);
+
+ /**
+ * @brief Create an iterator over all guest interfaces.
+ *
+ * @return iterator over iface_t's
+ */
+ iterator_t* (*create_iface_iterator)(guest_t *this);
+
+ /**
+ * @brief Close and destroy a guest with all interfaces
+ */
void (*destroy) (guest_t *this);
};
+/**
+ * @brief Create a new, unstarted guest.
+ *
+ * @param name name of the guest
+ * @param kernel kernel to boot for this guest
+ * @param master read-only master filesystem for guest
+ * @param mem amount of memory to give the guest
+ */
guest_t *guest_create(char *name, char *kernel, char *master, int mem);
-
#endif /* GUEST_H */
+