From 7ba9c777c7755dc380443f29f41fcd2a61e1b7df Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 16 Mar 2007 19:58:29 +0000 Subject: Add minimal support for bridge creation and removal --- network/manager.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'network/manager.c') 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(); } -- cgit