Skip to content
Snippets Groups Projects
Commit c48fd092 authored by Filip Matusiak's avatar Filip Matusiak Committed by Jakob Olsson
Browse files

Handle Association Status Notification TLV

parent cf1a8c02
No related branches found
No related tags found
1 merge request!441Handle Association Status Notification TLV
Pipeline #199251 passed
......@@ -580,7 +580,7 @@ struct wifi_bss_element *cntlr_alloc_wifi_bss(struct controller *c,
return NULL;
memcpy(bss->bssid, macaddr, 6);
bss->sta_assoc_allowed = 1;
bss->sta_assoc_allowed = true;
return bss;
}
......
......@@ -3212,6 +3212,38 @@ int handle_assoc_status_notification(void *cntlr, struct cmdu_buff *cmdu,
struct node *n)
{
trace("%s: --->\n", __func__);
struct controller *c = (struct controller *) cntlr;
struct tlv *tv[ASSOC_STATUS_NOTIF_NUM_OF_TLV_TYPES][TLV_MAXNUM] = {0};
struct tlv_assoc_status_notif *notif;
int i;
if (!map_cmdu_validate_parse(cmdu, tv, ARRAY_SIZE(tv), n->map_profile)) {
dbg("%s: map_cmdu_validate_parse( ..,EMP=%d) failed, err = (%d) '%s'\n",
__func__, n->map_profile, map_error, map_strerror(map_error));
return -1;
}
/* One Association Status TLV */
notif = (struct tlv_assoc_status_notif *)
tv[ASSOC_STATUS_NOTIF_ASSOCIATION_STATUS_IDX][0]->data;
for (i = 0; i < notif->num_bss; i++) {
struct netif_iface *ap = NULL;
ap = cntlr_find_bss(c, notif->bss[i].bssid);
if (!ap) {
dbg("No BSS found for " MACFMT "\n",
MAC2STR(notif->bss[i].bssid));
continue;
}
if (notif->bss[i].allowance & STA_ASSOC_ALLOWED)
ap->bss->sta_assoc_allowed = true;
else
ap->bss->sta_assoc_allowed = false;
}
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment