5 * Copyright (C) 2007-2009 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
28 #define CONNMAN_API_SUBJECT_TO_CHANGE
29 #include <connman/plugin.h>
30 #include <connman/device.h>
31 #include <connman/log.h>
33 static void create_network(struct connman_device *device, const char *name)
35 struct connman_network *network;
37 network = connman_network_create(name, CONNMAN_NETWORK_TYPE_VENDOR);
41 connman_device_add_network(device, network);
42 connman_network_unref(network);
45 static int device_probe(struct connman_device *device)
52 static void device_remove(struct connman_device *device)
57 static int device_enable(struct connman_device *device)
61 create_network(device, "network_one");
62 create_network(device, "network_two");
67 static int device_disable(struct connman_device *device)
74 static struct connman_device_driver device_driver = {
76 .type = CONNMAN_DEVICE_TYPE_VENDOR,
77 .probe = device_probe,
78 .remove = device_remove,
79 .enable = device_enable,
80 .disable = device_disable,
83 static void create_device(const char *name)
85 struct connman_device *device;
87 device = connman_device_create(name, CONNMAN_DEVICE_TYPE_VENDOR);
91 connman_device_set_mode(device, CONNMAN_DEVICE_MODE_NETWORK_SINGLE);
93 connman_device_register(device);
94 connman_device_unref(device);
97 static int fake_init(void)
99 create_device("fake");
101 return connman_device_driver_register(&device_driver);
104 static void fake_exit(void)
106 connman_device_driver_unregister(&device_driver);
109 CONNMAN_PLUGIN_DEFINE(fake, "Tesing plugin", VERSION, fake_init, fake_exit)