[PATCH v2 08/15] storage: Add function to load provider configuration file

Jukka Rissanen jukka.rissanen at linux.intel.com
Tue Nov 27 06:10:18 PST 2012


---
 src/connman.h |  1 +
 src/storage.c | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/src/connman.h b/src/connman.h
index 70178d8..5cf9648 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -207,6 +207,7 @@ int __connman_storage_save_global(GKeyFile *keyfile);
 void __connman_storage_delete_global(void);
 
 GKeyFile *__connman_storage_load_config(const char *ident);
+GKeyFile *__connman_storage_load_provider_config(const char *ident);
 
 GKeyFile *__connman_storage_open_service(const char *ident);
 int __connman_storage_save_service(GKeyFile *keyfile, const char *ident);
diff --git a/src/storage.c b/src/storage.c
index 3c3ce41..77d0c95 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -147,6 +147,22 @@ GKeyFile *__connman_storage_load_config(const char *ident)
 	return keyfile;
 }
 
+GKeyFile *__connman_storage_load_provider_config(const char *ident)
+{
+	gchar *pathname;
+	GKeyFile *keyfile = NULL;
+
+	pathname = g_strdup_printf("%s/vpn/%s.config", STORAGEDIR, ident);
+	if (pathname == NULL)
+		return NULL;
+
+	keyfile = storage_load(pathname);
+
+	g_free(pathname);
+
+	return keyfile;
+}
+
 GKeyFile *__connman_storage_open_service(const char *service_id)
 {
 	gchar *pathname;
-- 
1.7.11.4




More information about the connman mailing list