2 * Copyright (C) 2007 Martin Willi
3 * Hochschule fuer Technik Rapperswil
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>.
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
20 #include <utils/iterator.h>
22 typedef struct bridge_t bridge_t
;
27 * @brief Interface in a guest, connected to a tap device on the host.
32 * @brief Get the name of the bridge.
34 * @return name of the bridge
36 char* (*get_name
)(bridge_t
*this);
39 * @brief Add an interface to a bridge.
41 * @param iface interface to add
42 * @return TRUE if interface added
44 bool (*connect_iface
)(bridge_t
*this, iface_t
*iface
);
47 * @brief Remove an interface from a bridge.
49 * @param iface interface to remove
50 * @return TRUE if interface removed
52 bool (*disconnect_iface
)(bridge_t
*this, iface_t
*iface
);
55 * @brief Create an iterator over all interfaces.
57 * @return iterator over iface_t's
59 iterator_t
* (*create_iface_iterator
)(bridge_t
*this);
62 * @brief Destroy a bridge
64 void (*destroy
) (bridge_t
*this);
68 * @brief Create a new bridge.
70 * @param name name of the bridge to create
71 * @return bridge, NULL if failed
73 bridge_t
*bridge_create(char *name
);