eea416ba39b0ad84a8a311bcdff30a281d769140
[connman] / plugins / 80211.c
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2007  Intel Corporation. All rights reserved.
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include <stdio.h>
27
28 #include <connman/plugin.h>
29 #include <connman/iface.h>
30
31 static int iface_probe(struct connman_iface *iface)
32 {
33         printf("[802.11] probe interface %s\n", iface->udi);
34
35         iface->type = CONNMAN_IFACE_TYPE_80211;
36
37         iface->flags = CONNMAN_IFACE_FLAGS_IPV4;
38
39         return 0;
40 }
41
42 static void iface_remove(struct connman_iface *iface)
43 {
44         printf("[802.11] remove interface %s\n", iface->udi);
45 }
46
47 static struct connman_iface_driver iface_driver = {
48         .name           = "80211",
49         .capability     = "net.80211",
50         .probe          = iface_probe,
51         .remove         = iface_remove,
52 };
53
54 static int plugin_init(void)
55 {
56         connman_iface_register(&iface_driver);
57
58         return 0;
59 }
60
61 static void plugin_exit(void)
62 {
63         connman_iface_unregister(&iface_driver);
64 }
65
66 CONNMAN_PLUGIN_DEFINE("80211", "IEEE 802.11 interface plugin", VERSION,
67                                                 plugin_init, plugin_exit)