From e61188bfd0bf715afd472ab04867ae53cf38c647 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 25 Dec 2007 09:50:33 +0100 Subject: [PATCH] Add skeleton for supplicant infrastructure --- plugins/80211.c | 7 +++++++ plugins/Makefile.am | 3 ++- plugins/supplicant.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ plugins/supplicant.h | 27 +++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 plugins/supplicant.c create mode 100644 plugins/supplicant.h diff --git a/plugins/80211.c b/plugins/80211.c index 5630686..5d52ed9 100644 --- a/plugins/80211.c +++ b/plugins/80211.c @@ -30,6 +30,7 @@ #include #include "net.h" +#include "supplicant.h" static int iface_probe(struct connman_iface *iface) { @@ -48,12 +49,16 @@ static void iface_remove(struct connman_iface *iface) printf("[802.11] remove interface index %d\n", iface->index); __net_clear(iface->index); + + __supplicant_stop(iface); } static int iface_activate(struct connman_iface *iface) { printf("[802.11] activate interface index %d\n", iface->index); + __supplicant_start(iface); + connman_iface_update(iface, CONNMAN_IFACE_STATE_ACTIVE); return 0; @@ -96,6 +101,8 @@ static int iface_connect(struct connman_iface *iface, { printf("[802.11] connect interface index %d\n", iface->index); + __supplicant_connect(iface); + return 0; } diff --git a/plugins/Makefile.am b/plugins/Makefile.am index a0a387d..24e4433 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -6,7 +6,8 @@ plugin_LTLIBRARIES = libconnman-80203.la libconnman-80211.la \ libconnman_80203_la_SOURCES = 80203.c net.h net.c -libconnman_80211_la_SOURCES = 80211.c net.h net.c +libconnman_80211_la_SOURCES = 80211.c net.h net.c \ + supplicant.h supplicant.c libconnman_dhclient_la_SOURCES = dhclient.c net.h net.c libconnman_dhclient_la_LIBADD = @GDBUS_LIBS@ diff --git a/plugins/supplicant.c b/plugins/supplicant.c new file mode 100644 index 0000000..b83f290 --- /dev/null +++ b/plugins/supplicant.c @@ -0,0 +1,49 @@ +/* + * + * 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 "supplicant.h" + +int __supplicant_start(struct connman_iface *iface) +{ + printf("[SUPPLICANT] start for index %d\n", iface->index); + + return 0; +} + +int __supplicant_stop(struct connman_iface *iface) +{ + printf("[SUPPLICANT] stop for index %d\n", iface->index); + + return 0; +} + +int __supplicant_connect(struct connman_iface *iface) +{ + printf("[SUPPLICANT] connect for index %d\n", iface->index); + + return 0; +} diff --git a/plugins/supplicant.h b/plugins/supplicant.h new file mode 100644 index 0000000..ed753a8 --- /dev/null +++ b/plugins/supplicant.h @@ -0,0 +1,27 @@ +/* + * + * 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 + * + */ + +#include + +int __supplicant_start(struct connman_iface *iface); +int __supplicant_stop(struct connman_iface *iface); + +int __supplicant_connect(struct connman_iface *iface); -- 2.7.4