summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2011-09-12 19:42:20 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-09-12 19:42:20 +0200
commit8f9bb0bc4487aa28ad6cc1ecb3e77eb0b57d8e14 (patch)
tree6a5c5201b6b09d15c7965ee5e28cfa049eaf11d0 /src
parent8a0aef14616e3a3e1ca5ba9ba4295ebf95cf2899 (diff)
downloadconnman-8f9bb0bc4487aa28ad6cc1ecb3e77eb0b57d8e14.tar.gz
connman-8f9bb0bc4487aa28ad6cc1ecb3e77eb0b57d8e14.tar.bz2
connman-8f9bb0bc4487aa28ad6cc1ecb3e77eb0b57d8e14.zip
location: Deleted location support and portal plugin
Diffstat (limited to 'src')
-rw-r--r--src/connman.h11
-rw-r--r--src/location.c294
-rw-r--r--src/main.c2
-rw-r--r--src/service.c15
4 files changed, 0 insertions, 322 deletions
diff --git a/src/connman.h b/src/connman.h
index 4a37b70d..d524df88 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -546,17 +546,6 @@ GSequence *__connman_service_get_list(struct connman_session *session,
void __connman_service_session_inc(struct connman_service *service);
connman_bool_t __connman_service_session_dec(struct connman_service *service);
-#include <connman/location.h>
-
-int __connman_location_init(void);
-void __connman_location_cleanup(void);
-
-struct connman_location *__connman_location_create(struct connman_service *service);
-struct connman_location *__connman_service_get_location(struct connman_service *service);
-
-int __connman_location_detect(struct connman_service *service);
-int __connman_location_finish(struct connman_service *service);
-
#include <connman/notifier.h>
int __connman_technology_init(void);
diff --git a/src/location.c b/src/location.c
deleted file mode 100644
index 2afc640d..00000000
--- a/src/location.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- *
- * Connection Manager
- *
- * Copyright (C) 2007-2010 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <errno.h>
-
-#include "connman.h"
-
-struct connman_location {
- gint refcount;
- struct connman_service *service;
- enum connman_location_result result;
-
- struct connman_location_driver *driver;
- void *driver_data;
-};
-
-/**
- * connman_location_ref:
- * @location: Location structure
- *
- * Increase reference counter of location
- */
-struct connman_location *connman_location_ref(struct connman_location *location)
-{
- g_atomic_int_inc(&location->refcount);
-
- return location;
-}
-
-/**
- * connman_location_unref:
- * @location: Location structure
- *
- * Decrease reference counter of location
- */
-void connman_location_unref(struct connman_location *location)
-{
- if (g_atomic_int_dec_and_test(&location->refcount) == FALSE)
- return;
-
- if (location->driver) {
- location->driver->finish(location);
- location->driver = NULL;
- }
-
- g_free(location);
-}
-
-/**
- * connman_location_get_type:
- * @location: Location structure
- *
- * Get the service type of location
- */
-enum connman_service_type connman_location_get_type(struct connman_location *location)
-{
- if (location == NULL)
- return CONNMAN_SERVICE_TYPE_UNKNOWN;
-
- return connman_service_get_type(location->service);
-}
-
-/**
- * connman_location_get_interface:
- * @location: location structure
- *
- * Get network interface of location
- */
-char *connman_location_get_interface(struct connman_location *location)
-{
- if (location == NULL)
- return NULL;
-
- return connman_service_get_interface(location->service);
-}
-
-struct connman_service *connman_location_get_service(
- struct connman_location *location)
-{
- return location->service;
-}
-/**
- * connman_location_get_data:
- * @location: Location structure
- *
- * Get private location data pointer
- */
-void *connman_location_get_data(struct connman_location *location)
-{
- return location->driver_data;
-}
-
-/**
- * connman_location_set_data:
- * @location: Location structure
- * @data: data pointer
- *
- * Set private location data pointer
- */
-void connman_location_set_data(struct connman_location *location, void *data)
-{
- location->driver_data = data;
-}
-
-static GSList *driver_list = NULL;
-
-static gint compare_priority(gconstpointer a, gconstpointer b)
-{
- const struct connman_location_driver *driver1 = a;
- const struct connman_location_driver *driver2 = b;
-
- return driver2->priority - driver1->priority;
-}
-
-/**
- * connman_location_driver_register:
- * @driver: Location driver definition
- *
- * Register a new Location driver
- *
- * Returns: %0 on success
- */
-int connman_location_driver_register(struct connman_location_driver *driver)
-{
- DBG("driver %p name %s", driver, driver->name);
-
- driver_list = g_slist_insert_sorted(driver_list, driver,
- compare_priority);
-
- return 0;
-}
-
-/**
- * connman_location_driver_unregister:
- * @driver: Location driver definition
- *
- * Remove a previously registered Location driver
- */
-void connman_location_driver_unregister(struct connman_location_driver *driver)
-{
- DBG("driver %p name %s", driver, driver->name);
-
- driver_list = g_slist_remove(driver_list, driver);
-}
-
-/**
- * connman_location_report_result:
- * @location: location structure
- * @result: result information
- *
- * Report result of a location detection
- */
-void connman_location_report_result(struct connman_location *location,
- enum connman_location_result result)
-{
- DBG("location %p result %d", location, result);
-
- if (location == NULL)
- return;
-
- if (location->result == result)
- return;
-
- location->result = result;
-
- switch (location->result) {
- case CONNMAN_LOCATION_RESULT_UNKNOWN:
- return;
- case CONNMAN_LOCATION_RESULT_PORTAL:
- __connman_service_request_login(location->service);
- break;
- case CONNMAN_LOCATION_RESULT_ONLINE:
- __connman_service_ipconfig_indicate_state(location->service,
- CONNMAN_SERVICE_STATE_ONLINE,
- CONNMAN_IPCONFIG_TYPE_IPV4);
- break;
- }
-}
-
-struct connman_location *__connman_location_create(struct connman_service *service)
-{
- struct connman_location *location;
-
- DBG("service %p", service);
-
- if (service == NULL)
- return NULL;
-
- location = g_try_new0(struct connman_location, 1);
- if (location == NULL)
- return NULL;
-
- DBG("location %p", location);
-
- location->refcount = 1;
-
- location->service = service;
- location->result = CONNMAN_LOCATION_RESULT_UNKNOWN;
-
- return location;
-}
-
-int __connman_location_detect(struct connman_service *service)
-{
- struct connman_location *location;
- GSList *list;
-
- DBG("service %p", service);
-
- location = __connman_service_get_location(service);
- if (location == NULL)
- return -EINVAL;
-
- if (location->driver) {
- location->result = CONNMAN_LOCATION_RESULT_UNKNOWN;
- location->driver->finish(location);
-
- if (location->driver->detect(location) == 0)
- return 0;
-
- location->driver = NULL;
- }
-
- for (list = driver_list; list; list = list->next) {
- struct connman_location_driver *driver = list->data;
-
- DBG("driver %p name %s", driver, driver->name);
-
- if (driver->detect(location) == 0) {
- location->driver = driver;
- break;
- }
- }
-
- if (location->driver == NULL)
- connman_location_report_result(location,
- CONNMAN_LOCATION_RESULT_ONLINE);
-
- return 0;
-}
-
-int __connman_location_finish(struct connman_service *service)
-{
- struct connman_location *location;
-
- DBG("service %p", service);
-
- location = __connman_service_get_location(service);
- if (location == NULL)
- return -EINVAL;
-
- location->result = CONNMAN_LOCATION_RESULT_UNKNOWN;
-
- if (location->driver) {
- location->driver->finish(location);
- location->driver = NULL;
- }
-
- return 0;
-}
-
-int __connman_location_init(void)
-{
- DBG("");
-
- return 0;
-}
-
-void __connman_location_cleanup(void)
-{
- DBG("");
-}
diff --git a/src/main.c b/src/main.c
index dc08d13f..aec634dc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -331,7 +331,6 @@ int main(int argc, char *argv[])
__connman_storage_migrate();
__connman_technology_init();
__connman_notifier_init();
- __connman_location_init();
__connman_service_init();
__connman_provider_init();
__connman_network_init();
@@ -400,7 +399,6 @@ int main(int argc, char *argv[])
__connman_device_cleanup();
__connman_network_cleanup();
__connman_service_cleanup();
- __connman_location_cleanup();
__connman_notifier_cleanup();
__connman_technology_cleanup();
diff --git a/src/service.c b/src/service.c
index 03afb39c..195b8e91 100644
--- a/src/service.c
+++ b/src/service.c
@@ -99,7 +99,6 @@ struct connman_service {
char *phase2;
DBusMessage *pending;
guint timeout;
- struct connman_location *location;
struct connman_stats stats;
struct connman_stats stats_roaming;
GHashTable *counter_table;
@@ -3418,9 +3417,6 @@ static void service_free(gpointer user_data)
service->ipconfig_ipv6 = NULL;
}
- if (service->location != NULL)
- connman_location_unref(service->location);
-
g_strfreev(service->nameservers);
g_strfreev(service->nameservers_config);
g_strfreev(service->domains);
@@ -3563,16 +3559,9 @@ struct connman_service *connman_service_create(void)
service_initialize(service);
- service->location = __connman_location_create(service);
-
return service;
}
-struct connman_location *__connman_service_get_location(struct connman_service *service)
-{
- return service->location;
-}
-
/**
* connman_service_ref:
* @service: service structure
@@ -4027,8 +4016,6 @@ static int service_indicate_state(struct connman_service *service)
def_service->provider != NULL)
__connman_provider_disconnect(def_service->provider);
- __connman_location_finish(service);
-
default_changed();
__connman_wpad_stop(service);
@@ -4126,8 +4113,6 @@ int __connman_service_indicate_default(struct connman_service *service)
default_changed();
- __connman_location_detect(service);
-
return 0;
}