void connman_network_update(struct connman_network *network);
-int connman_network_register(struct connman_network *network);
-void connman_network_unregister(struct connman_network *network);
-
struct connman_network_driver {
const char *name;
enum connman_network_type type;
dbus_pending_call_unref(call);
- connman_network_unregister(network);
connman_network_unref(network);
}
if (network == NULL)
goto done;
- connman_network_register(network);
-
connman_network_set_string(network, "Path", path);
connman_network_set_name(network, name);
if (network == NULL)
return;
- connman_network_register(network);
-
index = connman_device_get_index(device);
connman_network_set_index(network, index);
connman_network_set_name(network, "Wired");
if (connman_device_add_network(device, network) < 0) {
- connman_network_unregister(network);
connman_network_unref(network);
return;
}
{
struct network_info *info = data;
- connman_network_unregister(info->network);
connman_network_unref(info->network);
g_free(info);
if (network == NULL)
return -ENOMEM;
- connman_network_register(network);
-
info = g_try_new0(struct network_info, 1);
if (info == NULL) {
- connman_network_unregister(network);
connman_network_unref(network);
return -ENOMEM;
}
if (network == NULL)
return;
- connman_network_register(network);
-
connman_network_set_index(network, wifi->index);
if (connman_device_add_network(wifi->device, network) < 0) {
if (wifi != NULL) {
connman_network = connman_device_get_network(wifi->device, identifier);
- if (connman_network != NULL)
- connman_network_unregister(connman_network);
connman_device_remove_network(wifi->device, identifier);
+
+ if (connman_network != NULL)
+ connman_network_unref(connman_network);
+
}
}
remove_driver(driver);
}
-static void unregister_network(gpointer data)
+static void free_network(gpointer data)
{
struct connman_network *network = data;
__connman_network_set_device(network, NULL);
- connman_network_unregister(network);
connman_network_unref(network);
}
}
device->networks = g_hash_table_new_full(g_str_hash, g_str_equal,
- g_free, unregister_network);
+ g_free, free_network);
device_list = g_slist_append(device_list, device);
}
}
-int connman_network_register(struct connman_network *network)
-{
- network_list = g_slist_append(network_list, network);
-
- return network_probe(network);
-}
-
-
-void connman_network_unregister(struct connman_network *network)
-{
- network_list = g_slist_remove(network_list, network);
-
- network_remove(network);
-}
-
static void remove_driver(struct connman_network_driver *driver)
{
GSList *list;
network->type = type;
network->identifier = ident;
+ network_list = g_slist_append(network_list, network);
+
return network;
}
if (g_atomic_int_dec_and_test(&network->refcount) == FALSE)
return;
+ network_list = g_slist_remove(network_list, network);
+
network_destruct(network);
}
if (service->network != NULL) {
if (service->network_created == TRUE)
- connman_network_unregister(service->network);
- connman_network_unref(service->network);
+ connman_network_unref(service->network);
}
if (service->provider != NULL)
if (network == NULL)
return NULL;
- connman_network_register(network);
-
connman_network_set_blob(network, "WiFi.SSID",
(unsigned char *) ssid, ssid_len);
name = g_try_malloc0(ssid_len + 1);
if (name == NULL) {
- connman_network_unregister(network);
connman_network_unref(network);
return NULL;
}
connman_network_set_index(network, index);
if (connman_device_add_network(device, network) < 0) {
- connman_network_unregister(network);
connman_network_unref(network);
return NULL;
}