Add skeletons for 802.03 and 802.11 interface plugins
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 22 Dec 2007 21:10:30 +0000 (22:10 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 22 Dec 2007 21:10:30 +0000 (22:10 +0100)
plugins/80203.c [new file with mode: 0644]
plugins/80211.c [new file with mode: 0644]
plugins/Makefile.am

diff --git a/plugins/80203.c b/plugins/80203.c
new file mode 100644 (file)
index 0000000..7921d9c
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ *
+ *  Connection Manager
+ *
+ *  Copyright (C) 2007  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 <stdio.h>
+
+#include <connman/plugin.h>
+#include <connman/iface.h>
+
+static int iface_probe(struct connman_iface *iface)
+{
+       printf("[802.03] probe interface %s\n", iface->udi);
+
+       iface->type = CONNMAN_IFACE_TYPE_80203;
+
+       iface->flags = CONNMAN_IFACE_FLAGS_CARRIER_DETECT |
+                                               CONNMAN_IFACE_FLAGS_IPV4;
+
+       return 0;
+}
+
+static void iface_remove(struct connman_iface *iface)
+{
+       printf("[802.03] remove interface %s\n", iface->udi);
+}
+
+static struct connman_iface_driver iface_driver = {
+       .name           = "80203",
+       .capability     = "net.80203",
+       .probe          = iface_probe,
+       .remove         = iface_remove,
+};
+
+static int plugin_init(void)
+{
+       connman_iface_register(&iface_driver);
+
+       return 0;
+}
+
+static void plugin_exit(void)
+{
+       connman_iface_unregister(&iface_driver);
+}
+
+CONNMAN_PLUGIN_DEFINE("80203", "IEEE 802.03 interface plugin", VERSION,
+                                               plugin_init, plugin_exit)
diff --git a/plugins/80211.c b/plugins/80211.c
new file mode 100644 (file)
index 0000000..eea416b
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ *
+ *  Connection Manager
+ *
+ *  Copyright (C) 2007  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 <stdio.h>
+
+#include <connman/plugin.h>
+#include <connman/iface.h>
+
+static int iface_probe(struct connman_iface *iface)
+{
+       printf("[802.11] probe interface %s\n", iface->udi);
+
+       iface->type = CONNMAN_IFACE_TYPE_80211;
+
+       iface->flags = CONNMAN_IFACE_FLAGS_IPV4;
+
+       return 0;
+}
+
+static void iface_remove(struct connman_iface *iface)
+{
+       printf("[802.11] remove interface %s\n", iface->udi);
+}
+
+static struct connman_iface_driver iface_driver = {
+       .name           = "80211",
+       .capability     = "net.80211",
+       .probe          = iface_probe,
+       .remove         = iface_remove,
+};
+
+static int plugin_init(void)
+{
+       connman_iface_register(&iface_driver);
+
+       return 0;
+}
+
+static void plugin_exit(void)
+{
+       connman_iface_unregister(&iface_driver);
+}
+
+CONNMAN_PLUGIN_DEFINE("80211", "IEEE 802.11 interface plugin", VERSION,
+                                               plugin_init, plugin_exit)
index 0274292..aa9ed77 100644 (file)
@@ -1,2 +1,14 @@
 
+plugindir = $(libdir)/connman/plugins
+
+plugin_LTLIBRARIES = libconnman-80203.la libconnman-80211.la
+
+libconnman_80203_la_SOURCES = 80203.c
+
+libconnman_80211_la_SOURCES = 80211.c
+
+AM_LDFLAGS = -module -avoid-version -export-symbols-regex connman_plugin_desc
+
+INCLUDES = -I$(top_builddir)/include
+
 MAINTAINERCLEANFILES = Makefile.in