network: Use setter/getters for connman_network_set/get_uint16()
[framework/connectivity/connman.git] / include / location.h
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2007-2010  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_LOCATION_H
23 #define __CONNMAN_LOCATION_H
24
25 #include <connman/service.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 #define CONNMAN_LOCATION_PRIORITY_LOW          -100
32 #define CONNMAN_LOCATION_PRIORITY_DEFAULT      0
33 #define CONNMAN_LOCATION_PRIORITY_HIGH         100
34
35 /**
36  * SECTION:location
37  * @title: Location premitives
38  * @short_description: Functions for detecting locations
39  */
40
41 enum connman_location_result {
42         CONNMAN_LOCATION_RESULT_UNKNOWN = 0,
43         CONNMAN_LOCATION_RESULT_PORTAL  = 1,
44         CONNMAN_LOCATION_RESULT_ONLINE  = 2,
45 };
46
47 struct connman_location;
48
49 struct connman_location *connman_location_ref(struct connman_location *location);
50 void connman_location_unref(struct connman_location *location);
51
52 enum connman_service_type connman_location_get_type(struct connman_location *location);
53 char *connman_location_get_interface(struct connman_location *location);
54 void connman_location_report_result(struct connman_location *location,
55                                         enum connman_location_result result);
56
57 void *connman_location_get_data(struct connman_location *location);
58 void connman_location_set_data(struct connman_location *location, void *data);
59
60 struct connman_service *connman_location_get_service(
61                                         struct connman_location *location);
62
63 struct connman_location_driver {
64         const char *name;
65         enum connman_service_type type;
66         int priority;
67         int (*detect) (struct connman_location *location);
68         int (*finish) (struct connman_location *location);
69 };
70
71 int connman_location_driver_register(struct connman_location_driver *driver);
72 void connman_location_driver_unregister(struct connman_location_driver *driver);
73
74 #ifdef __cplusplus
75 }
76 #endif
77
78 #endif /* __CONNMAN_LOCATION_H */