Add callbacks for storage of IP configuration of services
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 30 Jun 2009 15:21:02 +0000 (08:21 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 30 Jun 2009 15:21:02 +0000 (08:21 -0700)
src/connman.h
src/ipconfig.c
src/service.c

index 0af5814..2273769 100644 (file)
@@ -95,6 +95,11 @@ void __connman_ipconfig_append_ipv4(struct connman_ipconfig *ipconfig,
 int __connman_ipconfig_set_ipv4(struct connman_ipconfig *ipconfig,
                                const char *key, DBusMessageIter *value);
 
+int __connman_ipconfig_load(struct connman_ipconfig *ipconfig,
+               GKeyFile *keyfile, const char *identifier, const char *prefix);
+int __connman_ipconfig_save(struct connman_ipconfig *ipconfig,
+               GKeyFile *keyfile, const char *identifier, const char *prefix);
+
 #include <connman/inet.h>
 
 #include <connman/rfkill.h>
index bd52fc3..13e1d41 100644 (file)
@@ -159,6 +159,22 @@ int __connman_ipconfig_set_ipv4(struct connman_ipconfig *ipconfig,
        return 0;
 }
 
+int __connman_ipconfig_load(struct connman_ipconfig *ipconfig,
+               GKeyFile *keyfile, const char *identifier, const char *prefix)
+{
+       DBG("ipconfig %p identifier %s", ipconfig, identifier);
+
+       return 0;
+}
+
+int __connman_ipconfig_save(struct connman_ipconfig *ipconfig,
+               GKeyFile *keyfile, const char *identifier, const char *prefix)
+{
+       DBG("ipconfig %p identifier %s", ipconfig, identifier);
+
+       return 0;
+}
+
 static GSList *driver_list = NULL;
 
 static gint compare_priority(gconstpointer a, gconstpointer b)
index 4a6efae..5323768 100644 (file)
@@ -1330,6 +1330,9 @@ static int service_load(struct connman_service *service)
                service->passphrase = str;
        }
 
+       __connman_ipconfig_load(service->ipconfig, keyfile,
+                                       service->identifier, "IPv4.");
+
        g_key_file_free(keyfile);
 
        return 0;
@@ -1393,6 +1396,9 @@ update:
                g_key_file_set_string(keyfile, service->identifier,
                                        "Passphrase", service->passphrase);
 
+       __connman_ipconfig_save(service->ipconfig, keyfile,
+                                       service->identifier, "IPv4.");
+
        data = g_key_file_to_data(keyfile, &length, NULL);
 
        if (g_file_set_contents(pathname, data, length, NULL) == FALSE)