From 8c0cc20f3686a299a0abc8ddd8df8a702a26e379 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Fri, 2 Dec 2011 16:18:27 +0200 Subject: agent: If a service is hidden, request either 'Name' or 'SSID' Implement functions to append 'Name' and 'SSID' fields to Agent API RequestInput D-Bus method call. Add these fields if the service is hidden. --- src/agent.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/agent.c') diff --git a/src/agent.c b/src/agent.c index 0bbb2665..ce72d503 100644 --- a/src/agent.c +++ b/src/agent.c @@ -261,6 +261,32 @@ static void request_input_append_wps(DBusMessageIter *iter, void *user_data) DBUS_TYPE_STRING, &str); } +static void request_input_append_name(DBusMessageIter *iter, void *user_data) +{ + const char *str = "string"; + + connman_dbus_dict_append_basic(iter, "Type", + DBUS_TYPE_STRING, &str); + str = "mandatory"; + connman_dbus_dict_append_basic(iter, "Requirement", + DBUS_TYPE_STRING, &str); + connman_dbus_dict_append_array(iter, "Alternates", + DBUS_TYPE_STRING, + request_input_append_alternates, + "SSID"); +} + +static void request_input_append_ssid(DBusMessageIter *iter, void *user_data) +{ + const char *str = "ssid"; + + connman_dbus_dict_append_basic(iter, "Type", + DBUS_TYPE_STRING, &str); + str = "alternate"; + connman_dbus_dict_append_basic(iter, "Requirement", + DBUS_TYPE_STRING, &str); +} + static void request_input_append_password(DBusMessageIter *iter, void *user_data) { @@ -353,6 +379,13 @@ int __connman_agent_request_passphrase_input(struct connman_service *service, connman_dbus_dict_open(&iter, &dict); + if (__connman_service_is_hidden(service)) { + connman_dbus_dict_append_dict(&dict, "Name", + request_input_append_name, NULL); + connman_dbus_dict_append_dict(&dict, "SSID", + request_input_append_ssid, NULL); + } + if (__connman_service_get_security(service) == CONNMAN_SERVICE_SECURITY_8021X) { connman_dbus_dict_append_dict(&dict, "Identity", -- cgit v1.2.3