Changeset View
Changeset View
Standalone View
Standalone View
contrib/wpa/src/ap/ctrl_iface_ap.c
Context not available. | |||||
if (!os_snprintf_error(buflen - len, res)) | if (!os_snprintf_error(buflen - len, res)) | ||||
len += res; | len += res; | ||||
} | } | ||||
if (sta->sae && sta->sae->tmp) { | |||||
const u8 *pos; | |||||
unsigned int j, count; | |||||
struct wpabuf *groups = sta->sae->tmp->peer_rejected_groups; | |||||
res = os_snprintf(buf + len, buflen - len, | |||||
"sae_rejected_groups="); | |||||
if (!os_snprintf_error(buflen - len, res)) | |||||
len += res; | |||||
if (groups) { | |||||
pos = wpabuf_head(groups); | |||||
count = wpabuf_len(groups) / 2; | |||||
} else { | |||||
pos = NULL; | |||||
count = 0; | |||||
} | |||||
for (j = 0; pos && j < count; j++) { | |||||
res = os_snprintf(buf + len, buflen - len, "%s%d", | |||||
j == 0 ? "" : " ", WPA_GET_LE16(pos)); | |||||
if (!os_snprintf_error(buflen - len, res)) | |||||
len += res; | |||||
pos += 2; | |||||
} | |||||
res = os_snprintf(buf + len, buflen - len, "\n"); | |||||
if (!os_snprintf_error(buflen - len, res)) | |||||
len += res; | |||||
} | |||||
#endif /* CONFIG_SAE */ | #endif /* CONFIG_SAE */ | ||||
if (sta->vlan_id > 0) { | if (sta->vlan_id > 0) { | ||||
Context not available. | |||||
} | } | ||||
#endif /* CONFIG_IEEE80211AC */ | #endif /* CONFIG_IEEE80211AC */ | ||||
#ifdef CONFIG_IEEE80211N | |||||
if ((sta->flags & WLAN_STA_HT) && sta->ht_capabilities) { | if ((sta->flags & WLAN_STA_HT) && sta->ht_capabilities) { | ||||
res = os_snprintf(buf + len, buflen - len, | res = os_snprintf(buf + len, buflen - len, | ||||
"ht_caps_info=0x%04x\n", | "ht_caps_info=0x%04x\n", | ||||
Context not available. | |||||
if (!os_snprintf_error(buflen - len, res)) | if (!os_snprintf_error(buflen - len, res)) | ||||
len += res; | len += res; | ||||
} | } | ||||
#endif /* CONFIG_IEEE80211N */ | |||||
if (sta->ext_capability && | if (sta->ext_capability && | ||||
buflen - len > (unsigned) (11 + 2 * sta->ext_capability[0])) { | buflen - len > (unsigned) (11 + 2 * sta->ext_capability[0])) { | ||||
Context not available. | |||||
int ret; | int ret; | ||||
u8 *pos; | u8 *pos; | ||||
if (!hapd->drv_priv || !hapd->driver->send_frame) | |||||
return -1; | |||||
mgmt = os_zalloc(sizeof(*mgmt) + 100); | mgmt = os_zalloc(sizeof(*mgmt) + 100); | ||||
if (mgmt == NULL) | if (mgmt == NULL) | ||||
return -1; | return -1; | ||||
Context not available. | |||||
pos += 2; | pos += 2; | ||||
*pos++ = minor_reason_code; | *pos++ = minor_reason_code; | ||||
ret = hapd->driver->send_frame(hapd->drv_priv, (u8 *) mgmt, | ret = hostapd_drv_send_mlme(hapd, mgmt, pos - (u8 *) mgmt, 0, NULL, 0, | ||||
pos - (u8 *) mgmt, 1); | 0); | ||||
os_free(mgmt); | os_free(mgmt); | ||||
return ret < 0 ? -1 : 0; | return ret < 0 ? -1 : 0; | ||||
Context not available. | |||||
if (pos) { | if (pos) { | ||||
struct ieee80211_mgmt mgmt; | struct ieee80211_mgmt mgmt; | ||||
int encrypt; | int encrypt; | ||||
if (!hapd->drv_priv || !hapd->driver->send_frame) | |||||
return -1; | |||||
pos += 6; | pos += 6; | ||||
encrypt = atoi(pos); | encrypt = atoi(pos); | ||||
os_memset(&mgmt, 0, sizeof(mgmt)); | os_memset(&mgmt, 0, sizeof(mgmt)); | ||||
Context not available. | |||||
os_memcpy(mgmt.sa, hapd->own_addr, ETH_ALEN); | os_memcpy(mgmt.sa, hapd->own_addr, ETH_ALEN); | ||||
os_memcpy(mgmt.bssid, hapd->own_addr, ETH_ALEN); | os_memcpy(mgmt.bssid, hapd->own_addr, ETH_ALEN); | ||||
mgmt.u.deauth.reason_code = host_to_le16(reason); | mgmt.u.deauth.reason_code = host_to_le16(reason); | ||||
if (hapd->driver->send_frame(hapd->drv_priv, (u8 *) &mgmt, | if (hostapd_drv_send_mlme(hapd, (u8 *) &mgmt, | ||||
IEEE80211_HDRLEN + | IEEE80211_HDRLEN + | ||||
sizeof(mgmt.u.deauth), | sizeof(mgmt.u.deauth), | ||||
encrypt) < 0) | 0, NULL, 0, !encrypt) < 0) | ||||
return -1; | return -1; | ||||
return 0; | return 0; | ||||
} | } | ||||
Context not available. | |||||
if (pos) { | if (pos) { | ||||
struct ieee80211_mgmt mgmt; | struct ieee80211_mgmt mgmt; | ||||
int encrypt; | int encrypt; | ||||
if (!hapd->drv_priv || !hapd->driver->send_frame) | |||||
return -1; | |||||
pos += 6; | pos += 6; | ||||
encrypt = atoi(pos); | encrypt = atoi(pos); | ||||
os_memset(&mgmt, 0, sizeof(mgmt)); | os_memset(&mgmt, 0, sizeof(mgmt)); | ||||
Context not available. | |||||
os_memcpy(mgmt.sa, hapd->own_addr, ETH_ALEN); | os_memcpy(mgmt.sa, hapd->own_addr, ETH_ALEN); | ||||
os_memcpy(mgmt.bssid, hapd->own_addr, ETH_ALEN); | os_memcpy(mgmt.bssid, hapd->own_addr, ETH_ALEN); | ||||
mgmt.u.disassoc.reason_code = host_to_le16(reason); | mgmt.u.disassoc.reason_code = host_to_le16(reason); | ||||
if (hapd->driver->send_frame(hapd->drv_priv, (u8 *) &mgmt, | if (hostapd_drv_send_mlme(hapd, (u8 *) &mgmt, | ||||
IEEE80211_HDRLEN + | IEEE80211_HDRLEN + | ||||
sizeof(mgmt.u.deauth), | sizeof(mgmt.u.deauth), | ||||
encrypt) < 0) | 0, NULL, 0, !encrypt) < 0) | ||||
return -1; | return -1; | ||||
return 0; | return 0; | ||||
} | } | ||||
Context not available. | |||||
ret = os_snprintf(buf + len, buflen - len, | ret = os_snprintf(buf + len, buflen - len, | ||||
"channel=%u\n" | "channel=%u\n" | ||||
"edmg_enable=%d\n" | |||||
"edmg_channel=%d\n" | |||||
"secondary_channel=%d\n" | "secondary_channel=%d\n" | ||||
"ieee80211n=%d\n" | "ieee80211n=%d\n" | ||||
"ieee80211ac=%d\n" | "ieee80211ac=%d\n" | ||||
Context not available. | |||||
"beacon_int=%u\n" | "beacon_int=%u\n" | ||||
"dtim_period=%d\n", | "dtim_period=%d\n", | ||||
iface->conf->channel, | iface->conf->channel, | ||||
iface->conf->enable_edmg, | |||||
iface->conf->edmg_channel, | |||||
iface->conf->ieee80211n && !hapd->conf->disable_11n ? | iface->conf->ieee80211n && !hapd->conf->disable_11n ? | ||||
iface->conf->secondary_channel : 0, | iface->conf->secondary_channel : 0, | ||||
iface->conf->ieee80211n && !hapd->conf->disable_11n, | iface->conf->ieee80211n && !hapd->conf->disable_11n, | ||||
iface->conf->ieee80211ac && | iface->conf->ieee80211ac && | ||||
!hapd->conf->disable_11ac, | !hapd->conf->disable_11ac, | ||||
iface->conf->ieee80211ax, | iface->conf->ieee80211ax && | ||||
!hapd->conf->disable_11ax, | |||||
iface->conf->beacon_int, | iface->conf->beacon_int, | ||||
hapd->conf->dtim_period); | hapd->conf->dtim_period); | ||||
if (os_snprintf_error(buflen - len, ret)) | if (os_snprintf_error(buflen - len, ret)) | ||||
return len; | return len; | ||||
len += ret; | len += ret; | ||||
#ifdef CONFIG_IEEE80211AX | |||||
if (iface->conf->ieee80211ax && !hapd->conf->disable_11ax) { | |||||
ret = os_snprintf(buf + len, buflen - len, | |||||
"he_oper_chwidth=%d\n" | |||||
"he_oper_centr_freq_seg0_idx=%d\n" | |||||
"he_oper_centr_freq_seg1_idx=%d\n", | |||||
iface->conf->he_oper_chwidth, | |||||
iface->conf->he_oper_centr_freq_seg0_idx, | |||||
iface->conf->he_oper_centr_freq_seg1_idx); | |||||
if (os_snprintf_error(buflen - len, ret)) | |||||
return len; | |||||
len += ret; | |||||
} | |||||
#endif /* CONFIG_IEEE80211AX */ | |||||
if (iface->conf->ieee80211ac && !hapd->conf->disable_11ac) { | if (iface->conf->ieee80211ac && !hapd->conf->disable_11ac) { | ||||
ret = os_snprintf(buf + len, buflen - len, | ret = os_snprintf(buf + len, buflen - len, | ||||
"vht_oper_chwidth=%d\n" | "vht_oper_chwidth=%d\n" | ||||
Context not available. | |||||
SET_CSA_SETTING(sec_channel_offset); | SET_CSA_SETTING(sec_channel_offset); | ||||
settings->freq_params.ht_enabled = !!os_strstr(pos, " ht"); | settings->freq_params.ht_enabled = !!os_strstr(pos, " ht"); | ||||
settings->freq_params.vht_enabled = !!os_strstr(pos, " vht"); | settings->freq_params.vht_enabled = !!os_strstr(pos, " vht"); | ||||
settings->freq_params.he_enabled = !!os_strstr(pos, " he"); | |||||
settings->block_tx = !!os_strstr(pos, " blocktx"); | settings->block_tx = !!os_strstr(pos, " blocktx"); | ||||
#undef SET_CSA_SETTING | #undef SET_CSA_SETTING | ||||
Context not available. |