Add skeleton for core connection driver
[framework/connectivity/connman.git] / src / connection.c
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2007-2009  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 "connman.h"
27
28 static int connection_probe(struct connman_element *element)
29 {
30         DBG("element %p name %s", element, element->name);
31
32         return 0;
33 }
34
35 static void connection_remove(struct connman_element *element)
36 {
37         DBG("element %p name %s", element, element->name);
38 }
39
40 static struct connman_driver connection_driver = {
41         .name           = "connection",
42         .type           = CONNMAN_ELEMENT_TYPE_CONNECTION,
43         .priority       = CONNMAN_DRIVER_PRIORITY_LOW,
44         .probe          = connection_probe,
45         .remove         = connection_remove,
46 };
47
48 static DBusConnection *connection;
49
50 int __connman_connection_init(void)
51 {
52         DBG("");
53
54         connection = connman_dbus_get_connection();
55
56         return connman_driver_register(&connection_driver);
57 }
58
59 void __connman_connection_cleanup(void)
60 {
61         DBG("");
62
63         connman_driver_unregister(&connection_driver);
64
65         dbus_connection_unref(connection);
66 }