From: Marcel Holtmann Date: Sat, 22 Dec 2007 21:10:30 +0000 (+0100) Subject: Add skeletons for 802.03 and 802.11 interface plugins X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~4992 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=369edde7e8054b798f9a70d20f98864a1f324e05;p=profile%2Fivi%2Fconnman.git Add skeletons for 802.03 and 802.11 interface plugins --- diff --git a/plugins/80203.c b/plugins/80203.c new file mode 100644 index 0000000..7921d9c --- /dev/null +++ b/plugins/80203.c @@ -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 +#endif + +#include + +#include +#include + +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 index 0000000..eea416b --- /dev/null +++ b/plugins/80211.c @@ -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 +#endif + +#include + +#include +#include + +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) diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 0274292..aa9ed77 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -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