summaryrefslogtreecommitdiff
path: root/vpn
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-11-30 11:30:49 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-11-30 15:01:19 +0200
commite70f2a6b7f7ed34099830e92a3cfa7be409ab7e9 (patch)
treee3e102ddfc7f108fb9158752a5b79aefe3f78c4d /vpn
parent93ff3d8dbc99fd53b7a1265b1db8e64e261f672e (diff)
downloadconnman-e70f2a6b7f7ed34099830e92a3cfa7be409ab7e9.tar.gz
connman-e70f2a6b7f7ed34099830e92a3cfa7be409ab7e9.tar.bz2
connman-e70f2a6b7f7ed34099830e92a3cfa7be409ab7e9.zip
vpn-provider: Register agent driver
Diffstat (limited to 'vpn')
-rw-r--r--vpn/vpn-provider.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c
index c6b86de2..9bbb10f8 100644
--- a/vpn/vpn-provider.c
+++ b/vpn/vpn-provider.c
@@ -33,6 +33,7 @@
#include <netdb.h>
#include "../src/connman.h"
+#include "connman/agent.h"
#include "connman/vpn-dbus.h"
#include "vpn-provider.h"
#include "vpn.h"
@@ -2183,12 +2184,39 @@ const char *vpn_provider_get_path(struct vpn_provider *provider)
return provider->path;
}
+static int agent_probe(struct connman_agent *agent)
+{
+ DBG("agent %p", agent);
+ return 0;
+}
+
+static void agent_remove(struct connman_agent *agent)
+{
+ DBG("agent %p", agent);
+}
+
+static struct connman_agent_driver agent_driver = {
+ .name = "vpn",
+ .interface = VPN_AGENT_INTERFACE,
+ .probe = agent_probe,
+ .remove = agent_remove,
+};
+
int __vpn_provider_init(gboolean do_routes)
{
+ int err;
+
DBG("");
handle_routes = do_routes;
+ err = connman_agent_driver_register(&agent_driver);
+ if (err < 0) {
+ connman_error("Cannot register agent driver for %s",
+ agent_driver.name);
+ return err;
+ }
+
connection = connman_dbus_get_connection();
provider_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
@@ -2206,5 +2234,7 @@ void __vpn_provider_cleanup(void)
g_hash_table_destroy(provider_hash);
provider_hash = NULL;
+ connman_agent_driver_unregister(&agent_driver);
+
dbus_connection_unref(connection);
}