|
@@ -5834,6 +5834,29 @@ static int p2p_ctrl_group_add(struct wpa_supplicant *wpa_s, char *cmd)
|
|
|
}
|
|
|
|
|
|
|
|
|
+static int p2p_ctrl_group_member(struct wpa_supplicant *wpa_s, const char *cmd,
|
|
|
+ char *buf, size_t buflen)
|
|
|
+{
|
|
|
+ u8 dev_addr[ETH_ALEN];
|
|
|
+ struct wpa_ssid *ssid;
|
|
|
+ int res;
|
|
|
+ const u8 *iaddr;
|
|
|
+
|
|
|
+ ssid = wpa_s->current_ssid;
|
|
|
+ if (!wpa_s->global->p2p || !ssid || ssid->mode != WPAS_MODE_P2P_GO ||
|
|
|
+ hwaddr_aton(cmd, dev_addr))
|
|
|
+ return -1;
|
|
|
+
|
|
|
+ iaddr = p2p_group_get_client_interface_addr(wpa_s->p2p_group, dev_addr);
|
|
|
+ if (!iaddr)
|
|
|
+ return -1;
|
|
|
+ res = os_snprintf(buf, buflen, MACSTR, MAC2STR(iaddr));
|
|
|
+ if (os_snprintf_error(buflen, res))
|
|
|
+ return -1;
|
|
|
+ return res;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
static int p2p_ctrl_peer(struct wpa_supplicant *wpa_s, char *cmd,
|
|
|
char *buf, size_t buflen)
|
|
|
{
|
|
@@ -8808,6 +8831,9 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
|
|
|
} else if (os_strncmp(buf, "P2P_GROUP_ADD ", 14) == 0) {
|
|
|
if (p2p_ctrl_group_add(wpa_s, buf + 14))
|
|
|
reply_len = -1;
|
|
|
+ } else if (os_strncmp(buf, "P2P_GROUP_MEMBER ", 17) == 0) {
|
|
|
+ reply_len = p2p_ctrl_group_member(wpa_s, buf + 17, reply,
|
|
|
+ reply_size);
|
|
|
} else if (os_strncmp(buf, "P2P_PROV_DISC ", 14) == 0) {
|
|
|
if (p2p_ctrl_prov_disc(wpa_s, buf + 14))
|
|
|
reply_len = -1;
|
|
@@ -9552,6 +9578,7 @@ static char * wpas_global_ctrl_iface_redir_p2p(struct wpa_global *global,
|
|
|
"P2P_LISTEN ",
|
|
|
"P2P_GROUP_REMOVE ",
|
|
|
"P2P_GROUP_ADD ",
|
|
|
+ "P2P_GROUP_MEMBER ",
|
|
|
"P2P_PROV_DISC ",
|
|
|
"P2P_SERV_DISC_REQ ",
|
|
|
"P2P_SERV_DISC_CANCEL_REQ ",
|