summaryrefslogtreecommitdiff
path: root/src/agent.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-08-29 23:28:32 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-08-29 23:28:32 -0700
commit34225749825dfb45beee52457994f39f44b1be55 (patch)
tree173d371e92f939d0373862a6dcca124285840dfc /src/agent.c
parent2177c96c21ac75d09ad66fa878b58322a7d9de30 (diff)
downloadconnman-34225749825dfb45beee52457994f39f44b1be55.tar.gz
connman-34225749825dfb45beee52457994f39f44b1be55.tar.bz2
connman-34225749825dfb45beee52457994f39f44b1be55.zip
Add basic hookup of passphrase agent callback
Diffstat (limited to 'src/agent.c')
-rw-r--r--src/agent.c40
1 files changed, 33 insertions, 7 deletions
diff --git a/src/agent.c b/src/agent.c
index 82f6146e..5b2b77c2 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -85,6 +85,34 @@ int __connman_agent_unregister(const char *sender, const char *path)
return 0;
}
+int __connman_agent_request_passphrase(struct connman_service *service,
+ passphrase_cb_t callback, void *user_data)
+{
+ DBusMessage *message;
+ const char *path;
+
+ DBG("service %p", service);
+
+ if (agent_path == NULL)
+ return -ESRCH;
+
+ message = dbus_message_new_method_call(agent_sender, agent_path,
+ CONNMAN_AGENT_INTERFACE, "RequestPassphrase");
+ if (message == NULL)
+ return -ENOMEM;
+
+ dbus_message_set_no_reply(message, TRUE);
+
+ path = __connman_service_get_path(service);
+
+ dbus_message_append_args(message, DBUS_TYPE_OBJECT_PATH, &path,
+ DBUS_TYPE_INVALID);
+
+ g_dbus_send_message(connection, message);
+
+ return -EIO;
+}
+
int __connman_agent_init(void)
{
DBG("");
@@ -98,7 +126,7 @@ int __connman_agent_init(void)
void __connman_agent_cleanup(void)
{
- DBusMessage *msg;
+ DBusMessage *message;
DBG("");
@@ -111,16 +139,14 @@ void __connman_agent_cleanup(void)
if (agent_path == NULL)
return;
- msg = dbus_message_new_method_call(agent_sender, agent_path,
+ message = dbus_message_new_method_call(agent_sender, agent_path,
CONNMAN_AGENT_INTERFACE, "Release");
- if (msg == NULL)
+ if (message == NULL)
return;
- dbus_message_set_no_reply(msg, TRUE);
-
- dbus_connection_send(connection, msg, NULL);
+ dbus_message_set_no_reply(message, TRUE);
- dbus_message_unref(msg);
+ g_dbus_send_message(connection, message);
agent_free();