WPS ER: Add more AP information into the ctrl_interface message

This allow wpa_gui to show AP BSSID, WPS State (configured/unconfigured),
and primary device type.
This commit is contained in:
Jouni Malinen 2009-11-21 13:34:23 +02:00
parent c3016248f4
commit e694b34474
4 changed files with 55 additions and 14 deletions

View file

@ -413,6 +413,7 @@ union wps_event_data {
struct wps_event_er_ap {
const u8 *uuid;
const u8 *mac_addr;
const char *friendly_name;
const char *manufacturer;
const char *manufacturer_url;
@ -422,6 +423,8 @@ union wps_event_data {
const char *model_url;
const char *serial_number;
const char *upc;
const u8 *pri_dev_type;
u8 wps_state;
} ap;
struct wps_event_er_enrollee {

View file

@ -68,6 +68,7 @@ struct wps_er_ap {
u8 uuid[WPS_UUID_LEN];
u8 pri_dev_type[8];
u8 wps_state;
u8 mac_addr[ETH_ALEN];
char *friendly_name;
char *manufacturer;
char *manufacturer_url;
@ -246,6 +247,9 @@ static void wps_er_ap_event(struct wps_context *wps, struct wps_er_ap *ap,
evap->model_url = ap->model_url;
evap->serial_number = ap->serial_number;
evap->upc = ap->upc;
evap->pri_dev_type = ap->pri_dev_type;
evap->wps_state = ap->wps_state;
evap->mac_addr = ap->mac_addr;
wps->event_cb(wps->cb_ctx, event, &data);
}
@ -396,6 +400,8 @@ static void wps_er_ap_get_m1(struct wps_er_ap *ap, struct wpabuf *m1)
os_memcpy(ap->pri_dev_type, attr.primary_dev_type, 8);
if (attr.wps_state)
ap->wps_state = *attr.wps_state;
if (attr.mac_addr)
os_memcpy(ap->mac_addr, attr.mac_addr, ETH_ALEN);
wps_er_subscribe(ap);
}