summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Xu <martin.xu@intel.com>2009-11-23 15:56:55 +0800
committerMarcel Holtmann <marcel@holtmann.org>2009-11-23 09:18:22 +0100
commit66101a531e2b230d9f1c799cd816b26d53377385 (patch)
treea56d0c9cedcdd67ef9ab72823f2fc37124217cb5
parent81f3ed3963cc2edab503afaca4f611f370125181 (diff)
downloadconnman-66101a531e2b230d9f1c799cd816b26d53377385.tar.gz
connman-66101a531e2b230d9f1c799cd816b26d53377385.tar.bz2
connman-66101a531e2b230d9f1c799cd816b26d53377385.zip
Add function connman_device_remove_all_networks
-rw-r--r--include/device.h1
-rw-r--r--src/device.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/include/device.h b/include/device.h
index 726eab3d..5267e25e 100644
--- a/include/device.h
+++ b/include/device.h
@@ -109,6 +109,7 @@ struct connman_network *connman_device_get_network(struct connman_device *device
const char *identifier);
int connman_device_remove_network(struct connman_device *device,
const char *identifier);
+void connman_device_remove_all_networks(struct connman_device *device);
int connman_device_register(struct connman_device *device);
void connman_device_unregister(struct connman_device *device);
diff --git a/src/device.c b/src/device.c
index b58e8ada..41eb07c0 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1775,6 +1775,11 @@ int connman_device_remove_network(struct connman_device *device,
return 0;
}
+void connman_device_remove_all_networks(struct connman_device *device)
+{
+ g_hash_table_remove_all(device->networks);
+}
+
void __connman_device_set_network(struct connman_device *device,
struct connman_network *network)
{