aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ap.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-12-14 18:03:54 (GMT)
committerJouni Malinen <j@w1.fi>2014-12-14 18:14:30 (GMT)
commite77007132ead824bb83429e7e1f8dc0890789bcb (patch)
tree4ffae644f8b63159707465c808b4f424daebeaeb /wpa_supplicant/ap.c
parent5881873b865fc24a060efb56d4214c830e0986d9 (diff)
downloadhostap-e77007132ead824bb83429e7e1f8dc0890789bcb.zip
hostap-e77007132ead824bb83429e7e1f8dc0890789bcb.tar.gz
hostap-e77007132ead824bb83429e7e1f8dc0890789bcb.tar.bz2
Extend wpa_supplicant STA* ctrl_iface commands for mesh
Since mesh functionality uses struct hostapd_data to maintain peer state, the existing STA* control interface commands can be used to display information about the peers. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/ap.c')
-rw-r--r--wpa_supplicant/ap.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index 8c3d3b8..64a0120 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -994,30 +994,45 @@ int wpas_ap_wps_nfc_report_handover(struct wpa_supplicant *wpa_s,
int ap_ctrl_iface_sta_first(struct wpa_supplicant *wpa_s,
char *buf, size_t buflen)
{
- if (wpa_s->ap_iface == NULL)
+ struct hostapd_data *hapd;
+
+ if (wpa_s->ap_iface)
+ hapd = wpa_s->ap_iface->bss[0];
+ else if (wpa_s->ifmsh)
+ hapd = wpa_s->ifmsh->bss[0];
+ else
return -1;
- return hostapd_ctrl_iface_sta_first(wpa_s->ap_iface->bss[0],
- buf, buflen);
+ return hostapd_ctrl_iface_sta_first(hapd, buf, buflen);
}
int ap_ctrl_iface_sta(struct wpa_supplicant *wpa_s, const char *txtaddr,
char *buf, size_t buflen)
{
- if (wpa_s->ap_iface == NULL)
+ struct hostapd_data *hapd;
+
+ if (wpa_s->ap_iface)
+ hapd = wpa_s->ap_iface->bss[0];
+ else if (wpa_s->ifmsh)
+ hapd = wpa_s->ifmsh->bss[0];
+ else
return -1;
- return hostapd_ctrl_iface_sta(wpa_s->ap_iface->bss[0], txtaddr,
- buf, buflen);
+ return hostapd_ctrl_iface_sta(hapd, txtaddr, buf, buflen);
}
int ap_ctrl_iface_sta_next(struct wpa_supplicant *wpa_s, const char *txtaddr,
char *buf, size_t buflen)
{
- if (wpa_s->ap_iface == NULL)
+ struct hostapd_data *hapd;
+
+ if (wpa_s->ap_iface)
+ hapd = wpa_s->ap_iface->bss[0];
+ else if (wpa_s->ifmsh)
+ hapd = wpa_s->ifmsh->bss[0];
+ else
return -1;
- return hostapd_ctrl_iface_sta_next(wpa_s->ap_iface->bss[0], txtaddr,
- buf, buflen);
+ return hostapd_ctrl_iface_sta_next(hapd, txtaddr, buf, buflen);
}