From: Daniel Wagner <[email protected]>
---
Makefile.am | 1 +
Makefile.plugins | 13 +++++
bootstrap-configure | 1 +
configure.ac | 6 ++
plugins/dundee.c | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 162 insertions(+), 0 deletions(-)
create mode 100644 plugins/dundee.c
diff --git a/Makefile.am b/Makefile.am
index ad9f70d..c973009 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -229,6 +229,7 @@ DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc \
--enable-wifi \
--enable-bluetooth \
--enable-ofono \
+ --enable-dundee \
--enable-pacrunner \
--enable-google \
--enable-meego \
diff --git a/Makefile.plugins b/Makefile.plugins
index 58b0494..2cfe790 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -85,6 +85,19 @@ plugins_ofono_la_LDFLAGS = $(plugin_ldflags)
endif
endif
+if DUNDEE
+if DUNDEE_BUILTIN
+builtin_modules += dundee
+builtin_sources += plugins/dundee.c
+else
+plugin_LTLIBRARIES += plugins/dundee.la
+plugin_objects += $(plugins_dundee_la_OBJECTS)
+plugins_dundee_la_SOURCES = plugins/dundee.c
+plugins_dundee_la_CFLAGS = $(plugin_cflags)
+plugins_dundee_la_LDFLAGS = $(plugin_ldflags)
+endif
+endif
+
if OPENCONNECT
if OPENCONNECT_BUILTIN
builtin_modules += openconnect
diff --git a/bootstrap-configure b/bootstrap-configure
index 12646a2..ac0edf6 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
@@ -21,6 +21,7 @@ fi
--enable-wifi=builtin \
--enable-bluetooth=builtin \
--enable-ofono=builtin \
+ --enable-dundee=builtin \
--enable-openconnect=builtin \
--enable-openvpn=builtin \
--enable-pacrunner=builtin \
diff --git a/configure.ac b/configure.ac
index f63fea8..544da14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,6 +95,12 @@ AC_ARG_ENABLE(ofono,
AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
AM_CONDITIONAL(OFONO_BUILTIN, test "${enable_ofono}" = "builtin")
+AC_ARG_ENABLE(dundee,
+ AC_HELP_STRING([--enable-dundee], [enable DUN support]),
+ [enable_dundee=${enableval}], [enable_dundee="no"])
+AM_CONDITIONAL(DUNDEE, test "${enable_dundee}" != "no")
+AM_CONDITIONAL(DUNDEE_BUILTIN, test "${enable_dundee}" = "builtin")
+
AC_ARG_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
[specify location of openconnect binary]),
[path_openconnect=${withval}])
diff --git a/plugins/dundee.c b/plugins/dundee.c
new file mode 100644
index 0000000..089367a
--- /dev/null
+++ b/plugins/dundee.c
@@ -0,0 +1,141 @@
+/*
+ *
+ * Connection Manager
+ *
+ * Copyright (C) 2010 BMW Car IT GmbH. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <errno.h>
+
+#define CONNMAN_API_SUBJECT_TO_CHANGE
+#include <connman/plugin.h>
+#include <connman/device.h>
+#include <connman/network.h>
+#include <connman/dbus.h>
+
+static DBusConnection *connection;
+
+static int network_probe(struct connman_network *network)
+{
+ DBG("network %p", network);
+
+ return 0;
+}
+
+static void network_remove(struct connman_network *network)
+{
+ DBG("network %p", network);
+}
+
+static int network_connect(struct connman_network *network)
+{
+ DBG("network %p", network);
+
+ return 0;
+}
+
+static int network_disconnect(struct connman_network *network)
+{
+ DBG("network %p", network);
+
+ return 0;
+}
+
+static struct connman_network_driver network_driver = {
+ .name = "network",
+ .type = CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN,
+ .probe = network_probe,
+ .remove = network_remove,
+ .connect = network_connect,
+ .disconnect = network_disconnect,
+};
+
+static int dundee_probe(struct connman_device *device)
+{
+ DBG("device %p", device);
+
+ return 0;
+}
+
+static void dundee_remove(struct connman_device *device)
+{
+ DBG("device %p", device);
+}
+
+static int dundee_enable(struct connman_device *device)
+{
+ DBG("device %p", device);
+
+ return 0;
+}
+
+static int dundee_disable(struct connman_device *device)
+{
+ DBG("device %p", device);
+
+ return 0;
+}
+
+static struct connman_device_driver dundee_driver = {
+ .name = "dundee",
+ .type = CONNMAN_DEVICE_TYPE_BLUETOOTH,
+ .probe = dundee_probe,
+ .remove = dundee_remove,
+ .enable = dundee_enable,
+ .disable = dundee_disable,
+};
+
+static int dundee_init(void)
+{
+ int err;
+
+ connection = connman_dbus_get_connection();
+ if (connection == NULL)
+ return -EIO;
+
+ err = connman_network_driver_register(&network_driver);
+ if (err < 0)
+ goto remove;
+
+ err = connman_device_driver_register(&dundee_driver);
+ if (err < 0) {
+ connman_network_driver_unregister(&network_driver);
+ goto remove;
+ }
+
+ return 0;
+
+remove:
+ dbus_connection_unref(connection);
+
+ return err;
+}
+
+static void dundee_exit(void)
+{
+ connman_device_driver_unregister(&dundee_driver);
+ connman_network_driver_unregister(&network_driver);
+
+ dbus_connection_unref(connection);
+}
+
+CONNMAN_PLUGIN_DEFINE(dundee, "Dundee plugin", VERSION,
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, dundee_init, dundee_exit)
--
1.7.8.110.g4cb5d1
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman