5 * Copyright (C) 2007 Intel Corporation. All rights reserved.
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.
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.
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
30 #include <connman/plugin.h>
31 #include <connman/iface.h>
32 #include <connman/log.h>
34 static int ethernet_probe(struct connman_iface *iface)
36 char sysfs_path[PATH_MAX];
39 DBG("iface %p", iface);
41 snprintf(sysfs_path, PATH_MAX, "%s/bridge", iface->sysfs);
43 if (stat(sysfs_path, &st) == 0 && (st.st_mode & S_IFDIR))
46 iface->type = CONNMAN_IFACE_TYPE_80203;
48 iface->flags = CONNMAN_IFACE_FLAG_RTNL |
49 CONNMAN_IFACE_FLAG_IPV4;
54 static void ethernet_remove(struct connman_iface *iface)
56 DBG("iface %p", iface);
59 static struct connman_iface_driver ethernet_driver = {
61 .capability = "net.80203",
62 .probe = ethernet_probe,
63 .remove = ethernet_remove,
66 static int ethernet_init(void)
68 return connman_iface_register(ðernet_driver);
71 static void ethernet_exit(void)
73 connman_iface_unregister(ðernet_driver);
76 CONNMAN_PLUGIN_DEFINE("80203", "IEEE 802.03 interface plugin", VERSION,
77 ethernet_init, ethernet_exit)