aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/p2p_supplicant_sd.c
diff options
context:
space:
mode:
authorMax Stepanov <Max.Stepanov@intel.com>2015-03-16 05:16:58 (GMT)
committerJouni Malinen <j@w1.fi>2015-03-20 13:56:59 (GMT)
commit6dd51ecbf19e64c7b37d13ad0fb459fe8d5b2713 (patch)
tree338ca989ddb0dbc460652253c67b77d0dd594ba1 /wpa_supplicant/p2p_supplicant_sd.c
parentc40a8918ec005c565279dc76de057b17de4404bd (diff)
downloadhostap-6dd51ecbf19e64c7b37d13ad0fb459fe8d5b2713.zip
hostap-6dd51ecbf19e64c7b37d13ad0fb459fe8d5b2713.tar.gz
hostap-6dd51ecbf19e64c7b37d13ad0fb459fe8d5b2713.tar.bz2
P2PS: Add P2PS advertisements on ALL_SERVICES ANQP query
Add P2PS advertisements to a query response on ANQP query of ALL_SERVICES type. Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
Diffstat (limited to 'wpa_supplicant/p2p_supplicant_sd.c')
-rw-r--r--wpa_supplicant/p2p_supplicant_sd.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/wpa_supplicant/p2p_supplicant_sd.c b/wpa_supplicant/p2p_supplicant_sd.c
index fcf0f64..f4aa3e0 100644
--- a/wpa_supplicant/p2p_supplicant_sd.c
+++ b/wpa_supplicant/p2p_supplicant_sd.c
@@ -671,6 +671,21 @@ static void wpas_sd_req_asp(struct wpa_supplicant *wpa_s,
}
+static void wpas_sd_all_asp(struct wpa_supplicant *wpa_s,
+ struct wpabuf *resp, u8 srv_trans_id)
+{
+ /* Query data to add all P2PS advertisements:
+ * - Service name length: 1
+ * - Service name: '*'
+ * - Service Information Request Length: 0
+ */
+ const u8 q[] = { 1, (const u8) '*', 0 };
+
+ if (p2p_get_p2ps_adv_list(wpa_s->global->p2p))
+ wpas_sd_req_asp(wpa_s, resp, srv_trans_id, q, sizeof(q));
+}
+
+
void wpas_sd_request(void *ctx, int freq, const u8 *sa, u8 dialog_token,
u16 update_indic, const u8 *tlvs, size_t tlvs_len)
{
@@ -735,6 +750,7 @@ void wpas_sd_request(void *ctx, int freq, const u8 *sa, u8 dialog_token,
"response");
wpas_sd_all_bonjour(wpa_s, resp, srv_trans_id);
wpas_sd_all_upnp(wpa_s, resp, srv_trans_id);
+ wpas_sd_all_asp(wpa_s, resp, srv_trans_id);
goto done;
}
@@ -743,7 +759,8 @@ void wpas_sd_request(void *ctx, int freq, const u8 *sa, u8 dialog_token,
wpa_printf(MSG_DEBUG, "P2P: Service Discovery Request "
"for all services");
if (dl_list_empty(&wpa_s->global->p2p_srv_upnp) &&
- dl_list_empty(&wpa_s->global->p2p_srv_bonjour)) {
+ dl_list_empty(&wpa_s->global->p2p_srv_bonjour) &&
+ !p2p_get_p2ps_adv_list(wpa_s->global->p2p)) {
wpa_printf(MSG_DEBUG, "P2P: No service "
"discovery protocols available");
wpas_sd_add_proto_not_avail(
@@ -753,6 +770,7 @@ void wpas_sd_request(void *ctx, int freq, const u8 *sa, u8 dialog_token,
}
wpas_sd_all_bonjour(wpa_s, resp, srv_trans_id);
wpas_sd_all_upnp(wpa_s, resp, srv_trans_id);
+ wpas_sd_all_asp(wpa_s, resp, srv_trans_id);
break;
case P2P_SERV_BONJOUR:
wpas_sd_req_bonjour(wpa_s, resp, srv_trans_id,