if (config != NULL) {
g_hash_table_remove_all(config->service_table);
load_config(config);
+ __connman_service_provision_changed(ident);
}
}
return 0;
}
+
+int __connman_config_provision_service_ident(struct connman_service *service,
+ const char *ident)
+{
+ enum connman_service_type type;
+ struct connman_config *config;
+
+ DBG("service %p", service);
+
+ /* For now only WiFi services are supported */
+ type = connman_service_get_type(service);
+ if (type != CONNMAN_SERVICE_TYPE_WIFI)
+ return -ENOSYS;
+
+ config = g_hash_table_lookup(config_table, ident);
+ if(config != NULL)
+ g_hash_table_foreach(config->service_table,
+ provision_service, service);
+
+ return 0;
+}
int __connman_config_load_service(GKeyFile *keyfile, const char *group, connman_bool_t persistent);
int __connman_config_provision_service(struct connman_service *service);
+int __connman_config_provision_service_ident(struct connman_service *service,
+ const char *ident);
#include <connman/profile.h>
int __connman_service_provision(DBusMessage *msg);
void __connman_service_auto_connect(void);
+void __connman_service_provision_changed(const char *ident);
+
const char *__connman_service_type2string(enum connman_service_type type);
int __connman_service_nameserver_append(struct connman_service *service,
return err;
}
+static void provision_changed(gpointer value, gpointer user_data)
+{
+ struct connman_service *service = value;
+ char *path = user_data;
+
+ __connman_config_provision_service_ident(service, path);
+}
+
+void __connman_service_provision_changed(const char *ident)
+{
+ g_sequence_foreach(service_list, provision_changed, (void *)ident);
+}
+
int __connman_service_provision(DBusMessage *msg)
{
GKeyFile *keyfile = NULL;