diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2012-10-25 09:16:27 +0300 |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2012-10-25 09:16:27 +0300 |
commit | f3989ced4fc3f16ba3724a2360cd61b793168cb4 (patch) | |
tree | 59638a2ff142a7ce7c15ab5b933c54cbfe151d38 | |
parent | 569fed9045abeaa5bdc8ab3a57c44447288c2938 (diff) | |
download | hostap-f3989ced4fc3f16ba3724a2360cd61b793168cb4.tar.gz |
P2P: Add secondary device types into p2p_peer output
This allows the P2P_PEER command to be used to fetch the list of
secondary device types that each P2P peer has advertised.
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r-- | wpa_supplicant/ctrl_iface.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 8038b9c28..083543ded 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -3790,6 +3790,7 @@ static int p2p_ctrl_peer(struct wpa_supplicant *wpa_s, char *cmd, char *pos, *end; char devtype[WPS_DEV_TYPE_BUFSIZE]; struct wpa_ssid *ssid; + size_t i; if (!wpa_s->global->p2p) return -1; @@ -3843,6 +3844,18 @@ static int p2p_ctrl_peer(struct wpa_supplicant *wpa_s, char *cmd, return pos - buf; pos += res; + for (i = 0; i < info->wps_sec_dev_type_list_len / WPS_DEV_TYPE_LEN; i++) + { + const u8 *t; + t = &info->wps_sec_dev_type_list[i * WPS_DEV_TYPE_LEN]; + res = os_snprintf(pos, end - pos, "sec_dev_type=%s\n", + wps_dev_type_bin2str(t, devtype, + sizeof(devtype))); + if (res < 0 || res >= end - pos) + return pos - buf; + pos += res; + } + ssid = wpas_p2p_get_persistent(wpa_s, info->p2p_device_addr, NULL, 0); if (ssid) { res = os_snprintf(pos, end - pos, "persistent=%d\n", ssid->id); |