noinst_HEADERS = include/rtnl.h include/task.h \
include/dbus.h include/rfkill.h include/option.h \
- include/profile.h include/provider.h \
+ include/provider.h \
include/utsname.h include/timeserver.h include/proxy.h \
include/location.h include/technology.h \
include/setting.h
src/main.c src/connman.h src/log.c \
src/error.c src/plugin.c src/task.c \
src/device.c src/network.c src/connection.c \
- src/manager.c src/profile.c src/service.c \
+ src/manager.c src/service.c \
src/clock.c src/timezone.c \
src/agent.c src/notifier.c src/provider.c \
src/resolver.c src/ipconfig.c src/detect.c src/inet.c \
+++ /dev/null
-/*
- *
- * 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
- *
- */
-
-#ifndef __CONNMAN_PROFILE_H
-#define __CONNMAN_PROFILE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * SECTION:profile
- * @title: Profile premitives
- * @short_description: Functions for handling profiles
- */
-
-struct connman_profile;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __CONNMAN_PROFILE_H */
#ifndef __CONNMAN_STORAGE_H
#define __CONNMAN_STORAGE_H
-#include <connman/profile.h>
#include <connman/service.h>
#include <connman/device.h>
#include <connman/technology.h>
struct connman_storage {
const char *name;
int priority;
- int (*profile_init) (void);
- int (*profile_load) (struct connman_profile *profile);
- int (*profile_save) (struct connman_profile *profile);
enum connman_service_type service_type;
int (*service_load) (struct connman_service *service);
int (*service_save) (struct connman_service *service);
GKeyFile *keyfile, gboolean save);
void __connman_storage_delete_config(const char *ident);
-int __connman_storage_init_profile(void);
-int __connman_storage_load_profile(struct connman_profile *profile);
-int __connman_storage_save_profile(struct connman_profile *profile);
int __connman_storage_load_service(struct connman_service *service);
int __connman_storage_save_service(struct connman_service *service);
int __connman_storage_load_technology(struct connman_technology *technology);
int __connman_config_provision_service_ident(struct connman_service *service,
const char *ident);
-#include <connman/profile.h>
-
-int __connman_profile_init();
-void __connman_profile_cleanup(void);
-
-connman_bool_t __connman_profile_get_offlinemode(void);
-int __connman_profile_set_offlinemode(connman_bool_t offlinemode);
-int __connman_profile_save_default(void);
-
-void __connman_profile_list(DBusMessageIter *iter, void *user_data);
-const char *__connman_profile_active_ident(void);
-const char *__connman_profile_active_path(void);
-
-int __connman_profile_create(const char *name, const char **path);
-int __connman_profile_remove(const char *path);
-
-void __connman_profile_changed(gboolean delayed);
-
int __connman_tethering_init(void);
void __connman_tethering_cleanup(void);
__connman_tethering_init();
__connman_counter_init();
__connman_manager_init();
- __connman_profile_init();
__connman_config_init();
__connman_stats_init();
__connman_clock_init();
__connman_plugin_init(option_plugin, option_noplugin);
- __connman_storage_init_profile();
-
__connman_rtnl_start();
__connman_dhcp_init();
__connman_wpad_init();
__connman_clock_cleanup();
__connman_stats_cleanup();
__connman_config_cleanup();
- __connman_profile_cleanup();
__connman_manager_cleanup();
__connman_counter_cleanup();
__connman_agent_cleanup();
+++ /dev/null
-/*
- *
- * 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 <string.h>
-
-#include <glib.h>
-#include <gdbus.h>
-
-#include "connman.h"
-
-#define PROFILE_DEFAULT_IDENT "default"
-
-struct connman_profile {
- char *ident;
- char *path;
- char *name;
- connman_bool_t offlinemode;
-};
-
-static struct connman_profile *default_profile = NULL;
-
-static DBusConnection *connection = NULL;
-
-connman_bool_t __connman_profile_get_offlinemode(void)
-{
- if (default_profile == NULL)
- return FALSE;
-
- DBG("offlinemode %d", default_profile->offlinemode);
-
- return default_profile->offlinemode;
-}
-
-int __connman_profile_set_offlinemode(connman_bool_t offlinemode)
-{
- DBG("offlinemode %d", offlinemode);
-
- if (default_profile == NULL)
- return -EINVAL;
-
- if (default_profile->offlinemode == offlinemode)
- return -EALREADY;
-
- default_profile->offlinemode = offlinemode;
- return 0;
-}
-
-int __connman_profile_save_default(void)
-{
- DBG("");
-
- if (default_profile != NULL)
- __connman_storage_save_profile(default_profile);
-
- return 0;
-}
-
-const char *__connman_profile_active_ident(void)
-{
- DBG("");
-
- return PROFILE_DEFAULT_IDENT;
-}
-
-const char *__connman_profile_active_path(void)
-{
- DBG("");
-
- if (default_profile == NULL)
- return NULL;
-
- return default_profile->path;
-}
-
-static void free_profile(struct connman_profile *profile)
-{
- g_free(profile->name);
- g_free(profile->path);
- g_free(profile->ident);
- g_free(profile);
-}
-
-static int profile_init(void)
-{
- DBG("");
-
- default_profile = g_try_new0(struct connman_profile, 1);
- if (default_profile == NULL)
- return -ENOMEM;
-
- default_profile->ident = g_strdup(PROFILE_DEFAULT_IDENT);
- default_profile->path = g_strdup_printf("/profile/%s",
- PROFILE_DEFAULT_IDENT);
-
- if (default_profile->ident == NULL || default_profile->path == NULL) {
- free_profile(default_profile);
- return -ENOMEM;
- }
-
- default_profile->name = g_strdup("Default");
-
- __connman_storage_load_profile(default_profile);
-
- connman_info("Adding default profile");
-
- DBG("profile %p path %s", default_profile, default_profile->path);
-
- return 0;
-}
-
-static int profile_load(struct connman_profile *profile)
-{
- GKeyFile *keyfile;
- GError *error = NULL;
- connman_bool_t offlinemode;
- char *name;
-
- DBG("profile %p", profile);
-
- keyfile = __connman_storage_open_profile(profile->ident);
- if (keyfile == NULL)
- return -EIO;
-
- name = g_key_file_get_string(keyfile, "global", "Name", NULL);
- if (name != NULL) {
- g_free(profile->name);
- profile->name = name;
- }
-
- offlinemode = g_key_file_get_boolean(keyfile, "global",
- "OfflineMode", &error);
- if (error == NULL)
- profile->offlinemode = offlinemode;
- g_clear_error(&error);
-
- __connman_storage_close_profile(profile->ident, keyfile, FALSE);
-
- return 0;
-}
-
-static int profile_save(struct connman_profile *profile)
-{
- GKeyFile *keyfile;
-
- DBG("profile %p", profile);
-
- keyfile = __connman_storage_open_profile(profile->ident);
- if (keyfile == NULL)
- return -EIO;
-
- if (profile->name != NULL)
- g_key_file_set_string(keyfile, "global",
- "Name", profile->name);
-
- g_key_file_set_boolean(keyfile, "global",
- "OfflineMode", profile->offlinemode);
-
- __connman_storage_close_profile(profile->ident, keyfile, TRUE);
-
- return 0;
-}
-
-static struct connman_storage profile_storage = {
- .name = "profile",
- .priority = CONNMAN_STORAGE_PRIORITY_LOW,
- .profile_init = profile_init,
- .profile_load = profile_load,
- .profile_save = profile_save,
-};
-
-int __connman_profile_init(void)
-{
- DBG("");
-
- connection = connman_dbus_get_connection();
- if (connection == NULL)
- return -1;
-
- if (connman_storage_register(&profile_storage) < 0)
- connman_error("Failed to register profile storage");
-
- return 0;
-}
-
-void __connman_profile_cleanup(void)
-{
- DBG("");
-
- if (connection == NULL)
- return;
-
- connman_storage_unregister(&profile_storage);
-
- dbus_connection_unref(connection);
-}
char *name;
char *passphrase;
char *agent_passphrase;
- char *profile;
connman_bool_t roaming;
connman_bool_t login_required;
connman_bool_t network_created;
g_free(service->domainname);
g_free(service->pac);
- g_free(service->profile);
g_free(service->name);
g_free(service->passphrase);
g_free(service->agent_passphrase);
service->identifier = g_strdup(identifier);
- service->profile = g_strdup(__connman_profile_active_ident());
-
iter = g_sequence_insert_sorted(service_list, service,
service_compare, NULL);
static int service_register(struct connman_service *service)
{
- const char *path = __connman_profile_active_path();
GSequenceIter *iter;
DBG("service %p", service);
if (service->path != NULL)
return -EALREADY;
- service->path = g_strdup_printf("%s/%s", path, service->identifier);
+ service->path = g_strdup_printf("%s/service/%s", CONNMAN_PATH,
+ service->identifier);
DBG("path %s", service->path);
void __connman_service_read_ip4config(struct connman_service *service)
{
- const char *ident = service->profile;
+ const char *ident = "default";
GKeyFile *keyfile;
if (ident == NULL)
void __connman_service_read_ip6config(struct connman_service *service)
{
- const char *ident = service->profile;
+ const char *ident = "default";
GKeyFile *keyfile;
if (ident == NULL)
static int service_load(struct connman_service *service)
{
- const char *ident = service->profile;
+ const char *ident = "default";
GKeyFile *keyfile;
GError *error = NULL;
gchar *pathname, *data = NULL;
static int service_save(struct connman_service *service)
{
- const char *ident = service->profile;
+ const char *ident = "default";
GKeyFile *keyfile;
gchar *pathname, *data = NULL;
gsize length;
__connman_storage_delete(ident, CONFIG_SUFFIX);
}
-int __connman_storage_init_profile(void)
-{
- GSList *list;
-
- DBG("");
-
- for (list = storage_list; list; list = list->next) {
- struct connman_storage *storage = list->data;
-
- if (storage->profile_init) {
- if (storage->profile_init() == 0)
- return 0;
- }
- }
-
- return -ENOENT;
-}
-
-int __connman_storage_load_profile(struct connman_profile *profile)
-{
- GSList *list;
-
- DBG("profile %p", profile);
-
- for (list = storage_list; list; list = list->next) {
- struct connman_storage *storage = list->data;
-
- if (storage->profile_load) {
- if (storage->profile_load(profile) == 0)
- return 0;
- }
- }
-
- return -ENOENT;
-}
-
-int __connman_storage_save_profile(struct connman_profile *profile)
-{
- GSList *list;
-
- DBG("profile %p", profile);
-
- for (list = storage_list; list; list = list->next) {
- struct connman_storage *storage = list->data;
-
- if (storage->profile_save) {
- if (storage->profile_save(profile) == 0)
- return 0;
- }
- }
-
- return -ENOENT;
-}
-
int __connman_storage_load_service(struct connman_service *service)
{
GSList *list;