summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-03-07 18:13:41 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-03-08 13:50:07 +0200
commitb009ede1dbc6b9831a33bff87f73f1c917784fa0 (patch)
tree4acdece6fef51631525515e59d57f2758a4df6b8
parenta05e7e7f23667603f1d58b58c92623a6d701607d (diff)
downloadconnman-b009ede1dbc6b9831a33bff87f73f1c917784fa0.tar.gz
connman-b009ede1dbc6b9831a33bff87f73f1c917784fa0.tar.bz2
connman-b009ede1dbc6b9831a33bff87f73f1c917784fa0.zip
provider: New provider removal function callable from vpn plugin
-rw-r--r--include/provider.h1
-rw-r--r--src/provider.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/include/provider.h b/include/provider.h
index bfefaed3..fdd8ae0d 100644
--- a/include/provider.h
+++ b/include/provider.h
@@ -79,6 +79,7 @@ void connman_provider_unref_debug(struct connman_provider *provider,
const char *file, int line, const char *caller);
int connman_provider_disconnect(struct connman_provider *provider);
+int connman_provider_remove(struct connman_provider *provider);
int connman_provider_set_string(struct connman_provider *provider,
const char *key, const char *value);
diff --git a/src/provider.c b/src/provider.c
index b86e7d67..f7bb4e10 100644
--- a/src/provider.c
+++ b/src/provider.c
@@ -150,6 +150,19 @@ int connman_provider_disconnect(struct connman_provider *provider)
return 0;
}
+int connman_provider_remove(struct connman_provider *provider)
+{
+ DBG("Removing VPN %s", provider->identifier);
+
+ provider_remove(provider);
+
+ connman_provider_set_state(provider, CONNMAN_PROVIDER_STATE_IDLE);
+
+ g_hash_table_remove(provider_hash, provider->identifier);
+
+ return 0;
+}
+
int __connman_provider_connect(struct connman_provider *provider)
{
int err;