hostapd: Add ctrl iface indications for WDS STA interface
This allows user to get event indication when a new interface is added/removed for 4addr WDS STA and also WDS STA ifname is informed through the STA command. Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
This commit is contained in:
parent
2598e69303
commit
1952b626ba
8 changed files with 77 additions and 0 deletions
|
@ -334,6 +334,13 @@ static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd,
|
|||
len += os_snprintf(buf + len, buflen - len, "\n");
|
||||
}
|
||||
|
||||
if (sta->flags & WLAN_STA_WDS && sta->ifname_wds) {
|
||||
ret = os_snprintf(buf + len, buflen - len,
|
||||
"wds_sta_ifname=%s\n", sta->ifname_wds);
|
||||
if (!os_snprintf_error(buflen - len, ret))
|
||||
len += ret;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
|
|
@ -1481,6 +1481,28 @@ static void hostapd_event_dfs_cac_started(struct hostapd_data *hapd,
|
|||
#endif /* NEED_AP_MLME */
|
||||
|
||||
|
||||
static void hostapd_event_wds_sta_interface_status(struct hostapd_data *hapd,
|
||||
int istatus,
|
||||
const char *ifname,
|
||||
const u8 *addr)
|
||||
{
|
||||
struct sta_info *sta = ap_get_sta(hapd, addr);
|
||||
|
||||
if (sta) {
|
||||
os_free(sta->ifname_wds);
|
||||
if (istatus == INTERFACE_ADDED)
|
||||
sta->ifname_wds = os_strdup(ifname);
|
||||
else
|
||||
sta->ifname_wds = NULL;
|
||||
}
|
||||
|
||||
wpa_msg(hapd->msg_ctx, MSG_INFO, "%sifname=%s sta_addr=" MACSTR,
|
||||
istatus == INTERFACE_ADDED ?
|
||||
WDS_STA_INTERFACE_ADDED : WDS_STA_INTERFACE_REMOVED,
|
||||
ifname, MAC2STR(addr));
|
||||
}
|
||||
|
||||
|
||||
void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
|
||||
union wpa_event_data *data)
|
||||
{
|
||||
|
@ -1695,6 +1717,12 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
|
|||
data->sta_opmode.chan_width,
|
||||
data->sta_opmode.rx_nss);
|
||||
break;
|
||||
case EVENT_WDS_STA_INTERFACE_STATUS:
|
||||
hostapd_event_wds_sta_interface_status(
|
||||
hapd, data->wds_sta_interface.istatus,
|
||||
data->wds_sta_interface.ifname,
|
||||
data->wds_sta_interface.sta_addr);
|
||||
break;
|
||||
default:
|
||||
wpa_printf(MSG_DEBUG, "Unknown event %d", event);
|
||||
break;
|
||||
|
|
|
@ -366,6 +366,8 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
|
|||
eloop_cancel_timeout(ap_sta_reset_steer_flag_timer, hapd, sta);
|
||||
#endif /* CONFIG_WNM_AP */
|
||||
|
||||
os_free(sta->ifname_wds);
|
||||
|
||||
os_free(sta);
|
||||
}
|
||||
|
||||
|
|
|
@ -257,6 +257,7 @@ struct sta_info {
|
|||
#endif /* CONFIG_OWE */
|
||||
|
||||
u8 *ext_capability;
|
||||
char *ifname_wds; /* WDS ifname, if in use */
|
||||
|
||||
#ifdef CONFIG_TESTING_OPTIONS
|
||||
enum wpa_alg last_tk_alg;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue