aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/ap.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-10-16 15:35:45 (GMT)
committerJouni Malinen <j@w1.fi>2009-10-16 15:35:45 (GMT)
commit43fb529750c0126f2bbbe29e3574b3c614ab6631 (patch)
treefec84cec51b376d00426585e78dd6537a51cd77e /wpa_supplicant/ap.c
parentf730b421e90ad8e6d851646fc8c976fa92758014 (diff)
downloadhostap-43fb529750c0126f2bbbe29e3574b3c614ab6631.zip
hostap-43fb529750c0126f2bbbe29e3574b3c614ab6631.tar.gz
hostap-43fb529750c0126f2bbbe29e3574b3c614ab6631.tar.bz2
Add AP mode WPA status into ctrl_iface
Diffstat (limited to 'wpa_supplicant/ap.c')
-rw-r--r--wpa_supplicant/ap.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index fc10f68..a2c9e5a 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -473,6 +473,7 @@ int wpa_supplicant_create_ap(struct wpa_supplicant *wpa_s,
}
wpa_s->current_ssid = ssid;
+ os_memcpy(wpa_s->bssid, wpa_s->own_addr, ETH_ALEN);
wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
return 0;
@@ -587,4 +588,33 @@ int ap_ctrl_iface_sta_next(struct wpa_supplicant *wpa_s, const char *txtaddr,
buf, buflen);
}
+
+int ap_ctrl_iface_wpa_get_status(struct wpa_supplicant *wpa_s, char *buf,
+ size_t buflen, int verbose)
+{
+ char *pos = buf, *end = buf + buflen;
+ int ret;
+ struct hostapd_bss_config *conf;
+
+ if (wpa_s->ap_iface == NULL)
+ return -1;
+
+ conf = wpa_s->ap_iface->bss[0]->conf;
+ if (conf->wpa == 0)
+ return 0;
+
+ ret = os_snprintf(pos, end - pos,
+ "pairwise_cipher=%s\n"
+ "group_cipher=%s\n"
+ "key_mgmt=%s\n",
+ wpa_cipher_txt(conf->rsn_pairwise),
+ wpa_cipher_txt(conf->wpa_group),
+ wpa_key_mgmt_txt(conf->wpa_key_mgmt,
+ conf->wpa));
+ if (ret < 0 || ret >= end - pos)
+ return pos - buf;
+ pos += ret;
+ return pos - buf;
+}
+
#endif /* CONFIG_CTRL_IFACE */