003 File Manager
Current Path:
/usr/src/contrib/wpa/src/ap
usr
/
src
/
contrib
/
wpa
/
src
/
ap
/
📁
..
📄
accounting.c
(14.53 KB)
📄
accounting.h
(1.12 KB)
📄
acs.c
(29.71 KB)
📄
acs.h
(764 B)
📄
airtime_policy.c
(6.82 KB)
📄
airtime_policy.h
(1.27 KB)
📄
ap_config.c
(33.39 KB)
📄
ap_config.h
(26.53 KB)
📄
ap_drv_ops.c
(25.84 KB)
📄
ap_drv_ops.h
(13.38 KB)
📄
ap_list.c
(6.82 KB)
📄
ap_list.h
(1.5 KB)
📄
ap_mlme.c
(5.64 KB)
📄
ap_mlme.h
(1007 B)
📄
authsrv.c
(8.72 KB)
📄
authsrv.h
(352 B)
📄
beacon.c
(40.32 KB)
📄
beacon.h
(1.25 KB)
📄
bss_load.c
(2.4 KB)
📄
bss_load.h
(376 B)
📄
ctrl_iface_ap.c
(24.3 KB)
📄
ctrl_iface_ap.h
(1.61 KB)
📄
dfs.c
(29.35 KB)
📄
dfs.h
(1.22 KB)
📄
dhcp_snoop.c
(3.36 KB)
📄
dhcp_snoop.h
(590 B)
📄
dpp_hostapd.c
(48.28 KB)
📄
dpp_hostapd.h
(1.74 KB)
📄
drv_callbacks.c
(51.68 KB)
📄
eap_user_db.c
(7.92 KB)
📄
eth_p_oui.c
(4.44 KB)
📄
eth_p_oui.h
(958 B)
📄
fils_hlp.c
(16.82 KB)
📄
fils_hlp.h
(547 B)
📄
gas_query_ap.c
(19.53 KB)
📄
gas_query_ap.h
(1.24 KB)
📄
gas_serv.c
(50.48 KB)
📄
gas_serv.h
(3.38 KB)
📄
hostapd.c
(89.58 KB)
📄
hostapd.h
(17.99 KB)
📄
hs20.c
(6.27 KB)
📄
hs20.h
(843 B)
📄
hw_features.c
(24.77 KB)
📄
hw_features.h
(1.93 KB)
📄
iapp.c
(14.59 KB)
📄
iapp.h
(833 B)
📄
ieee802_11.c
(148.71 KB)
📄
ieee802_11.h
(7.97 KB)
📄
ieee802_11_auth.c
(18.3 KB)
📄
ieee802_11_auth.h
(1.04 KB)
📄
ieee802_11_he.c
(8.77 KB)
📄
ieee802_11_ht.c
(16.22 KB)
📄
ieee802_11_shared.c
(23.95 KB)
📄
ieee802_11_vht.c
(13.4 KB)
📄
ieee802_1x.c
(83.16 KB)
📄
ieee802_1x.h
(2.84 KB)
📄
mbo_ap.c
(5.22 KB)
📄
mbo_ap.h
(1.16 KB)
📄
ndisc_snoop.c
(4.3 KB)
📄
ndisc_snoop.h
(838 B)
📄
neighbor_db.c
(6.49 KB)
📄
neighbor_db.h
(940 B)
📄
p2p_hostapd.c
(2.57 KB)
📄
p2p_hostapd.h
(888 B)
📄
pmksa_cache_auth.c
(18.79 KB)
📄
pmksa_cache_auth.h
(2.69 KB)
📄
preauth_auth.c
(6.47 KB)
📄
preauth_auth.h
(1.26 KB)
📄
rrm.c
(17.27 KB)
📄
rrm.h
(1.21 KB)
📄
sta_info.c
(41.42 KB)
📄
sta_info.h
(11.63 KB)
📄
taxonomy.c
(7.45 KB)
📄
taxonomy.h
(766 B)
📄
tkip_countermeasures.c
(2.95 KB)
📄
tkip_countermeasures.h
(451 B)
📄
utils.c
(2.29 KB)
📄
vlan.c
(756 B)
📄
vlan.h
(727 B)
📄
vlan_full.c
(18.35 KB)
📄
vlan_ifconfig.c
(1.47 KB)
📄
vlan_init.c
(5.88 KB)
📄
vlan_init.h
(1.09 KB)
📄
vlan_ioctl.c
(3.75 KB)
📄
vlan_util.c
(3.9 KB)
📄
vlan_util.h
(980 B)
📄
wmm.c
(11.47 KB)
📄
wmm.h
(653 B)
📄
wnm_ap.c
(23.69 KB)
📄
wnm_ap.h
(1.08 KB)
📄
wpa_auth.c
(140.03 KB)
📄
wpa_auth.h
(17.89 KB)
📄
wpa_auth_ft.c
(120.89 KB)
📄
wpa_auth_glue.c
(35.42 KB)
📄
wpa_auth_glue.h
(443 B)
📄
wpa_auth_i.h
(8.47 KB)
📄
wpa_auth_ie.c
(32.38 KB)
📄
wpa_auth_ie.h
(1.14 KB)
📄
wpa_auth_kay.c
(12.26 KB)
📄
wpa_auth_kay.h
(1.15 KB)
📄
wps_hostapd.c
(54.66 KB)
📄
wps_hostapd.h
(2.79 KB)
📄
x_snoop.c
(3.21 KB)
📄
x_snoop.h
(1.29 KB)
Editing: mbo_ap.c
/* * hostapd - MBO * Copyright (c) 2016, Qualcomm Atheros, Inc. * * This software may be distributed under the terms of the BSD license. * See README for more details. */ #include "utils/includes.h" #include "utils/common.h" #include "common/ieee802_11_defs.h" #include "common/ieee802_11_common.h" #include "hostapd.h" #include "sta_info.h" #include "mbo_ap.h" void mbo_ap_sta_free(struct sta_info *sta) { struct mbo_non_pref_chan_info *info, *prev; info = sta->non_pref_chan; sta->non_pref_chan = NULL; while (info) { prev = info; info = info->next; os_free(prev); } } static void mbo_ap_parse_non_pref_chan(struct sta_info *sta, const u8 *buf, size_t len) { struct mbo_non_pref_chan_info *info, *tmp; char channels[200], *pos, *end; size_t num_chan, i; int ret; if (len <= 3) return; /* Not enough room for any channels */ num_chan = len - 3; info = os_zalloc(sizeof(*info) + num_chan); if (!info) return; info->op_class = buf[0]; info->pref = buf[len - 2]; info->reason_code = buf[len - 1]; info->num_channels = num_chan; buf++; os_memcpy(info->channels, buf, num_chan); if (!sta->non_pref_chan) { sta->non_pref_chan = info; } else { tmp = sta->non_pref_chan; while (tmp->next) tmp = tmp->next; tmp->next = info; } pos = channels; end = pos + sizeof(channels); *pos = '\0'; for (i = 0; i < num_chan; i++) { ret = os_snprintf(pos, end - pos, "%s%u", i == 0 ? "" : " ", buf[i]); if (os_snprintf_error(end - pos, ret)) { *pos = '\0'; break; } pos += ret; } wpa_printf(MSG_DEBUG, "MBO: STA " MACSTR " non-preferred channel list (op class %u, pref %u, reason code %u, channels %s)", MAC2STR(sta->addr), info->op_class, info->pref, info->reason_code, channels); } void mbo_ap_check_sta_assoc(struct hostapd_data *hapd, struct sta_info *sta, struct ieee802_11_elems *elems) { const u8 *pos, *attr, *end; size_t len; if (!hapd->conf->mbo_enabled || !elems->mbo) return; pos = elems->mbo + 4; len = elems->mbo_len - 4; wpa_hexdump(MSG_DEBUG, "MBO: Association Request attributes", pos, len); attr = get_ie(pos, len, MBO_ATTR_ID_CELL_DATA_CAPA); if (attr && attr[1] >= 1) sta->cell_capa = attr[2]; mbo_ap_sta_free(sta); end = pos + len; while (end - pos > 1) { u8 ie_len = pos[1]; if (2 + ie_len > end - pos) break; if (pos[0] == MBO_ATTR_ID_NON_PREF_CHAN_REPORT) mbo_ap_parse_non_pref_chan(sta, pos + 2, ie_len); pos += 2 + pos[1]; } } int mbo_ap_get_info(struct sta_info *sta, char *buf, size_t buflen) { char *pos = buf, *end = buf + buflen; int ret; struct mbo_non_pref_chan_info *info; u8 i; unsigned int count = 0; if (!sta->cell_capa) return 0; ret = os_snprintf(pos, end - pos, "mbo_cell_capa=%u\n", sta->cell_capa); if (os_snprintf_error(end - pos, ret)) return pos - buf; pos += ret; for (info = sta->non_pref_chan; info; info = info->next) { char *pos2 = pos; ret = os_snprintf(pos2, end - pos2, "non_pref_chan[%u]=%u:%u:%u:", count, info->op_class, info->pref, info->reason_code); count++; if (os_snprintf_error(end - pos2, ret)) break; pos2 += ret; for (i = 0; i < info->num_channels; i++) { ret = os_snprintf(pos2, end - pos2, "%u%s", info->channels[i], i + 1 < info->num_channels ? "," : ""); if (os_snprintf_error(end - pos2, ret)) { pos2 = NULL; break; } pos2 += ret; } if (!pos2) break; ret = os_snprintf(pos2, end - pos2, "\n"); if (os_snprintf_error(end - pos2, ret)) break; pos2 += ret; pos = pos2; } return pos - buf; } static void mbo_ap_wnm_notif_req_cell_capa(struct sta_info *sta, const u8 *buf, size_t len) { if (len < 1) return; wpa_printf(MSG_DEBUG, "MBO: STA " MACSTR " updated cellular data capability: %u", MAC2STR(sta->addr), buf[0]); sta->cell_capa = buf[0]; } static void mbo_ap_wnm_notif_req_elem(struct sta_info *sta, u8 type, const u8 *buf, size_t len, int *first_non_pref_chan) { switch (type) { case WFA_WNM_NOTIF_SUBELEM_NON_PREF_CHAN_REPORT: if (*first_non_pref_chan) { /* * Need to free the previously stored entries now to * allow the update to replace all entries. */ *first_non_pref_chan = 0; mbo_ap_sta_free(sta); } mbo_ap_parse_non_pref_chan(sta, buf, len); break; case WFA_WNM_NOTIF_SUBELEM_CELL_DATA_CAPA: mbo_ap_wnm_notif_req_cell_capa(sta, buf, len); break; default: wpa_printf(MSG_DEBUG, "MBO: Ignore unknown WNM Notification WFA subelement %u", type); break; } } void mbo_ap_wnm_notification_req(struct hostapd_data *hapd, const u8 *addr, const u8 *buf, size_t len) { const u8 *pos, *end; u8 ie_len; struct sta_info *sta; int first_non_pref_chan = 1; if (!hapd->conf->mbo_enabled) return; sta = ap_get_sta(hapd, addr); if (!sta) return; pos = buf; end = buf + len; while (end - pos > 1) { ie_len = pos[1]; if (2 + ie_len > end - pos) break; if (pos[0] == WLAN_EID_VENDOR_SPECIFIC && ie_len >= 4 && WPA_GET_BE24(pos + 2) == OUI_WFA) mbo_ap_wnm_notif_req_elem(sta, pos[5], pos + 6, ie_len - 4, &first_non_pref_chan); else wpa_printf(MSG_DEBUG, "MBO: Ignore unknown WNM Notification element %u (len=%u)", pos[0], pos[1]); pos += 2 + pos[1]; } }
Upload File
Create Folder