Add skeleton for WiFi interface plugin
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 28 Jun 2008 09:09:17 +0000 (11:09 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 28 Jun 2008 09:09:17 +0000 (11:09 +0200)
plugins/Makefile.am
plugins/wifi.c [new file with mode: 0644]

index 7f01896..4084410 100644 (file)
@@ -1,7 +1,8 @@
 
 plugindir = $(libdir)/connman/plugins
 
-plugin_LTLIBRARIES = hal.la ethernet.la bluetooth.la dhclient.la ipv4.la
+plugin_LTLIBRARIES = hal.la ethernet.la wifi.la bluetooth.la \
+                                               dhclient.la ipv4.la
 
 noinst_LTLIBRARIES = 80203.la 80211.la resolvconf.la
 
@@ -11,6 +12,8 @@ hal_la_CFLAGS = @GLIB_CFLAGS@ @HAL_CFLAGS@
 
 ethernet_la_SOURCES = ethernet.c
 
+wifi_la_SOURCES = wifi.c
+
 bluetooth_la_SOURCES = bluetooth.c
 
 dhclient_la_SOURCES = dhclient.c
diff --git a/plugins/wifi.c b/plugins/wifi.c
new file mode 100644 (file)
index 0000000..b31fa9f
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ *
+ *  Connection Manager
+ *
+ *  Copyright (C) 2007-2008  Intel Corporation. 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 <connman/plugin.h>
+#include <connman/driver.h>
+#include <connman/log.h>
+
+static int wifi_probe(struct connman_element *element)
+{
+       DBG("element %p name %s", element, element->name);
+
+       return 0;
+}
+
+static void wifi_remove(struct connman_element *element)
+{
+       DBG("element %p name %s", element, element->name);
+}
+
+static struct connman_driver wifi_driver = {
+       .name           = "wifi",
+       .type           = CONNMAN_ELEMENT_TYPE_DEVICE,
+       .subtype        = CONNMAN_ELEMENT_SUBTYPE_WIFI,
+       .probe          = wifi_probe,
+       .remove         = wifi_remove,
+};
+
+static int wifi_init(void)
+{
+       return connman_driver_register(&wifi_driver);
+}
+
+static void wifi_exit(void)
+{
+       connman_driver_unregister(&wifi_driver);
+}
+
+CONNMAN_PLUGIN_DEFINE("WiFi", "WiFi interface plugin", VERSION,
+                                                       wifi_init, wifi_exit)