diff options
Diffstat (limited to 'vpn/vpn-provider.c')
-rw-r--r-- | vpn/vpn-provider.c | 30 |
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); } |