5 * Copyright (C) 2007-2010 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
22 #ifndef __CONNMAN_LOCATION_H
23 #define __CONNMAN_LOCATION_H
25 #include <connman/service.h>
31 #define CONNMAN_LOCATION_PRIORITY_LOW -100
32 #define CONNMAN_LOCATION_PRIORITY_DEFAULT 0
33 #define CONNMAN_LOCATION_PRIORITY_HIGH 100
37 * @title: Location premitives
38 * @short_description: Functions for detecting locations
41 enum connman_location_result {
42 CONNMAN_LOCATION_RESULT_UNKNOWN = 0,
43 CONNMAN_LOCATION_RESULT_PORTAL = 1,
44 CONNMAN_LOCATION_RESULT_ONLINE = 2,
47 struct connman_location;
49 struct connman_location *connman_location_ref(struct connman_location *location);
50 void connman_location_unref(struct connman_location *location);
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);
57 void *connman_location_get_data(struct connman_location *location);
58 void connman_location_set_data(struct connman_location *location, void *data);
60 struct connman_location_driver {
62 enum connman_service_type type;
64 int (*detect) (struct connman_location *location);
65 int (*finish) (struct connman_location *location);
68 int connman_location_driver_register(struct connman_location_driver *driver);
69 void connman_location_driver_unregister(struct connman_location_driver *driver);
75 #endif /* __CONNMAN_LOCATION_H */