aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-09-07 19:09:13 (GMT)
committerJouni Malinen <j@w1.fi>2009-09-07 19:09:13 (GMT)
commit2678509dec305ad1953c3007a888bf098996c42c (patch)
treedff818711d1de17098c83e2e663fdad7fb842805 /hostapd
parent52eb293dd25aec61cf0ada27c073b04fde15e563 (diff)
downloadhostap-2678509dec305ad1953c3007a888bf098996c42c.zip
hostap-2678509dec305ad1953c3007a888bf098996c42c.tar.gz
hostap-2678509dec305ad1953c3007a888bf098996c42c.tar.bz2
WPS: Store device info and make it available through AP ctrl_iface
Store a copy of device attributes during WPS protocol run and make it available for external programs via the control interface STA MIB command for associated stations. This gives access to device name and type which can be useful when showing user information about associated stations.
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/ctrl_iface.c4
-rw-r--r--hostapd/eapol_sm.c1
-rw-r--r--hostapd/wps_hostapd.c7
-rw-r--r--hostapd/wps_hostapd.h9
4 files changed, 21 insertions, 0 deletions
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index 6fe401e..bdc02f0 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -155,6 +155,10 @@ static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd,
res = ieee802_1x_get_mib_sta(hapd, sta, buf + len, buflen - len);
if (res >= 0)
len += res;
+ res = hostapd_wps_get_mib_sta(hapd, sta->addr, buf + len,
+ buflen - len);
+ if (res >= 0)
+ len += res;
return len;
}
diff --git a/hostapd/eapol_sm.c b/hostapd/eapol_sm.c
index 5491fc4..ab6598e 100644
--- a/hostapd/eapol_sm.c
+++ b/hostapd/eapol_sm.c
@@ -828,6 +828,7 @@ eapol_auth_alloc(struct eapol_authenticator *eapol, const u8 *addr,
eap_conf.tnc = eapol->conf.tnc;
eap_conf.wps = eapol->conf.wps;
eap_conf.assoc_wps_ie = sta->wps_ie;
+ eap_conf.peer_addr = addr;
sm->eap = eap_server_sm_init(sm, &eapol_cb, &eap_conf);
if (sm->eap == NULL) {
eapol_auth_free(sm);
diff --git a/hostapd/wps_hostapd.c b/hostapd/wps_hostapd.c
index a0c1e3a..5ecf3a4 100644
--- a/hostapd/wps_hostapd.c
+++ b/hostapd/wps_hostapd.c
@@ -1092,3 +1092,10 @@ static void hostapd_wps_upnp_deinit(struct hostapd_data *hapd)
}
#endif /* CONFIG_WPS_UPNP */
+
+
+int hostapd_wps_get_mib_sta(struct hostapd_data *hapd, const u8 *addr,
+ char *buf, size_t buflen)
+{
+ return wps_registrar_get_info(hapd->wps->registrar, addr, buf, buflen);
+}
diff --git a/hostapd/wps_hostapd.h b/hostapd/wps_hostapd.h
index 5f094f5..c4ac246 100644
--- a/hostapd/wps_hostapd.h
+++ b/hostapd/wps_hostapd.h
@@ -25,6 +25,8 @@ int hostapd_wps_add_pin(struct hostapd_data *hapd, const char *uuid,
int hostapd_wps_button_pushed(struct hostapd_data *hapd);
int hostapd_wps_start_oob(struct hostapd_data *hapd, char *device_type,
char *path, char *method, char *name);
+int hostapd_wps_get_mib_sta(struct hostapd_data *hapd, const u8 *addr,
+ char *buf, size_t buflen);
#else /* CONFIG_WPS */
@@ -38,6 +40,13 @@ static inline void hostapd_deinit_wps(struct hostapd_data *hapd)
{
}
+static inline int hostapd_wps_get_mib_sta(struct hostapd_data *hapd,
+ const u8 *addr,
+ char *buf, size_t buflen)
+{
+ return 0;
+}
+
#endif /* CONFIG_WPS */
#endif /* WPS_HOSTAPD_H */