Add support for storing network specific path value
[connman] / include / network.h
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2007-2008  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 #ifndef __CONNMAN_NETWORK_H
23 #define __CONNMAN_NETWORK_H
24
25 #include <connman/types.h>
26 #include <connman/device.h>
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 /**
33  * SECTION:network
34  * @title: Network premitives
35  * @short_description: Functions for handling networks
36  */
37
38 enum connman_network_type {
39         CONNMAN_NETWORK_TYPE_UNKNOWN       = 0,
40         CONNMAN_NETWORK_TYPE_WIFI          = 1,
41         CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN = 8,
42         CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN = 9,
43         CONNMAN_NETWORK_TYPE_HSO           = 23,
44 };
45
46 struct connman_network;
47
48 extern struct connman_network *connman_network_create(const char *identifier,
49                                                 enum connman_network_type type);
50 extern struct connman_network *connman_network_ref(struct connman_network *network);
51 extern void connman_network_unref(struct connman_network *network);
52
53 extern const char *connman_network_get_identifier(struct connman_network *network);
54
55 extern void connman_network_set_path(struct connman_network *network,
56                                                         const char *path);
57 extern const char *connman_network_get_path(struct connman_network *network);
58
59 extern struct connman_device *connman_network_get_device(struct connman_network *network);
60
61 extern void *connman_network_get_data(struct connman_network *network);
62 extern void connman_network_set_data(struct connman_network *network, void *data);
63
64 struct connman_network_driver {
65         const char *name;
66         enum connman_network_type type;
67         int priority;
68         int (*probe) (struct connman_network *network);
69         void (*remove) (struct connman_network *network);
70         int (*connect) (struct connman_network *network);
71         int (*disconnect) (struct connman_network *network);
72 };
73
74 extern int connman_network_driver_register(struct connman_network_driver *driver);
75 extern void connman_network_driver_unregister(struct connman_network_driver *driver);
76
77 #ifdef __cplusplus
78 }
79 #endif
80
81 #endif /* __CONNMAN_NETWORK_H */