summaryrefslogtreecommitdiffstats
path: root/network/manager.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-03-16 19:58:29 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-03-16 19:58:29 +0000
commit7ba9c777c7755dc380443f29f41fcd2a61e1b7df (patch)
tree193345ab4e9c568c4df7545abbc2152c2e57dce1 /network/manager.c
parent57821cca7bfdb47cd3ddc32e70b6779a4a6cca2d (diff)
Add minimal support for bridge creation and removal
Diffstat (limited to 'network/manager.c')
-rw-r--r--network/manager.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/network/manager.c b/network/manager.c
index 8487bbb1..26ebf57b 100644
--- a/network/manager.c
+++ b/network/manager.c
@@ -38,6 +38,7 @@
#define NETWORK_MANAGER_INTERFACE "org.bluez.network.Manager"
#define NETWORK_ERROR_INTERFACE "org.bluez.Error"
+#include "bridge.h"
#include "manager.h"
struct manager {
@@ -262,10 +263,26 @@ void internal_service(const char *identifier)
int network_init(void)
{
network_dbus_init();
+
+ if (bridge_init() < 0) {
+ error("Can't init bridge module");
+ return -1;
+ }
+
+ if (bridge_create("pan0") < 0) {
+ error("Can't create bridge");
+ return -1;
+ }
+
return 0;
}
void network_exit(void)
{
+ if (bridge_remove("pan0") < 0)
+ error("Can't remove bridge");
+
+ bridge_cleanup();
+
network_dbus_exit();
}