int __connman_iface_load(struct connman_iface *iface);
int __connman_iface_store(struct connman_iface *iface);
int __connman_iface_store_current_network(struct connman_iface *iface);
+int __connman_iface_load_networks(struct connman_iface *iface);
const char *__connman_iface_type2string(enum connman_iface_type type);
const char *__connman_iface_state2string(enum connman_iface_state state);
return 0;
}
+
+int __connman_iface_load_networks(struct connman_iface *iface)
+{
+ GKeyFile *keyfile;
+ gchar *pathname;
+ gchar **list;
+ gsize list_len;
+ int i;
+
+ if (iface->identifier == NULL)
+ return -1;
+
+ pathname = g_strdup_printf("%s/%s.conf", STORAGEDIR,
+ iface->identifier);
+ if (pathname == NULL)
+ return -1;
+
+ keyfile = g_key_file_new();
+
+ g_key_file_set_list_separator(keyfile, ',');
+
+ if (g_key_file_load_from_file(keyfile, pathname, 0, NULL) == FALSE)
+ goto done;
+
+ if (g_key_file_has_group(keyfile, GROUP_CONFIG) == FALSE)
+ goto done;
+
+ list = g_key_file_get_string_list(keyfile, GROUP_CONFIG,
+ "KnownNetworks", &list_len, NULL);
+ for (i = 0; i < list_len; i++) {
+ DBG("Known network %s", list[i]);
+ }
+
+ g_strfreev(list);
+
+done:
+ g_key_file_free(keyfile);
+
+ g_free(pathname);
+
+ return 0;
+}
DBUS_TYPE_OBJECT_PATH, &iface->path,
DBUS_TYPE_INVALID);
+ __connman_iface_load_networks(iface);
+
switch_policy(iface);
state_changed(iface);