Lines Matching refs:wif
222 struct wlan_iface *wif; in op_wlan_iface() local
228 if ((wif = wlan_get_snmp_interface(&val->var, sub)) == NULL) in op_wlan_iface()
233 if ((wif = wlan_get_next_snmp_interface(&val->var, sub)) == NULL) in op_wlan_iface()
235 wlan_append_ifindex(&val->var, sub, wif); in op_wlan_iface()
239 if ((wif = wlan_get_snmp_interface(&val->var, sub)) == NULL) { in op_wlan_iface()
244 if ((wif = wlan_new_wif(wname)) == NULL) in op_wlan_iface()
246 wif->internal = 1; in op_wlan_iface()
248 if (wif->status == RowStatus_active && in op_wlan_iface()
262 strlcpy(ctx->scratch->ptr1, wif->wname, IFNAMSIZ); in op_wlan_iface()
263 memcpy(wif->wname, val->v.octetstring.octets, in op_wlan_iface()
265 wif->wname[val->v.octetstring.len] = '\0'; in op_wlan_iface()
273 strlcpy(ctx->scratch->ptr1, wif->pname, IFNAMSIZ); in op_wlan_iface()
274 memcpy(wif->pname, val->v.octetstring.octets, in op_wlan_iface()
276 wif->pname[val->v.octetstring.len] = '\0'; in op_wlan_iface()
280 ctx->scratch->int1 = wif->mode; in op_wlan_iface()
281 wif->mode = val->v.integer; in op_wlan_iface()
285 if (val->v.octetstring.len > sizeof(wif->flags)) in op_wlan_iface()
287 ctx->scratch->ptr1 = malloc(sizeof(wif->flags)); in op_wlan_iface()
290 memcpy(ctx->scratch->ptr1, (uint8_t *)&wif->flags, in op_wlan_iface()
291 sizeof(wif->flags)); in op_wlan_iface()
292 memcpy((uint8_t *)&wif->flags, val->v.octetstring.octets, in op_wlan_iface()
293 sizeof(wif->flags)); in op_wlan_iface()
302 memcpy(ctx->scratch->ptr1, wif->dbssid, in op_wlan_iface()
304 memcpy(wif->dbssid, val->v.octetstring.octets, in op_wlan_iface()
314 memcpy(ctx->scratch->ptr1, wif->dlmac, in op_wlan_iface()
316 memcpy(wif->dlmac, val->v.octetstring.octets, in op_wlan_iface()
321 ctx->scratch->int1 = wif->status; in op_wlan_iface()
322 wif->status = val->v.integer; in op_wlan_iface()
323 if (wif->status == RowStatus_active) { in op_wlan_iface()
324 rc = wlan_iface_create(wif); /* XXX */ in op_wlan_iface()
326 wif->status = ctx->scratch->int1; in op_wlan_iface()
329 } else if (wif->status == RowStatus_destroy) in op_wlan_iface()
330 return (wlan_iface_destroy(wif)); in op_wlan_iface()
332 wif->status = RowStatus_notReady; in op_wlan_iface()
336 ctx->scratch->int1 = wif->state; in op_wlan_iface()
337 wif->state = val->v.integer; in op_wlan_iface()
338 if (wif->status == RowStatus_active) in op_wlan_iface()
339 if (wlan_config_state(wif, 1) < 0) in op_wlan_iface()
346 if ((wif = wlan_get_snmp_interface(&val->var, sub)) == NULL) in op_wlan_iface()
350 strlcpy(wif->wname, ctx->scratch->ptr1, IFNAMSIZ); in op_wlan_iface()
355 strlcpy(wif->pname, ctx->scratch->ptr1, IFNAMSIZ); in op_wlan_iface()
360 wif->mode = ctx->scratch->int1; in op_wlan_iface()
364 memcpy((uint8_t *)&wif->flags, ctx->scratch->ptr1, in op_wlan_iface()
365 sizeof(wif->flags)); in op_wlan_iface()
370 memcpy(wif->dbssid, ctx->scratch->ptr1, in op_wlan_iface()
376 memcpy(wif->dlmac, ctx->scratch->ptr1, in op_wlan_iface()
382 wif->status = ctx->scratch->int1; in op_wlan_iface()
385 else if (wif->internal != 0) in op_wlan_iface()
386 return (wlan_iface_destroy(wif)); in op_wlan_iface()
390 wif->state = ctx->scratch->int1; in op_wlan_iface()
391 if (wif->status == RowStatus_active) in op_wlan_iface()
392 if (wlan_config_state(wif, 1) < 0) in op_wlan_iface()
416 val->v.integer = wif->index; in op_wlan_iface()
419 return (string_get(val, wif->wname, -1)); in op_wlan_iface()
421 return (string_get(val, wif->pname, -1)); in op_wlan_iface()
423 val->v.integer = wif->mode; in op_wlan_iface()
426 return (bits_get(val, (uint8_t *)&wif->flags, in op_wlan_iface()
427 sizeof(wif->flags))); in op_wlan_iface()
429 return (string_get(val, wif->dbssid, IEEE80211_ADDR_LEN)); in op_wlan_iface()
431 return (string_get(val, wif->dlmac, IEEE80211_ADDR_LEN)); in op_wlan_iface()
433 val->v.integer = wif->status; in op_wlan_iface()
436 val->v.integer = wif->state; in op_wlan_iface()
447 struct wlan_iface *wif; in op_wlan_if_parent() local
453 if ((wif = wlan_get_interface(&val->var, sub)) == NULL) in op_wlan_if_parent()
457 if ((wif = wlan_get_next_interface(&val->var, sub)) == NULL) in op_wlan_if_parent()
459 wlan_append_ifindex(&val->var, sub, wif); in op_wlan_if_parent()
473 return (bits_get(val, (uint8_t *)&wif->drivercaps, in op_wlan_if_parent()
474 sizeof(wif->drivercaps))); in op_wlan_if_parent()
476 return (bits_get(val, (uint8_t *)&wif->cryptocaps, in op_wlan_if_parent()
477 sizeof(wif->cryptocaps))); in op_wlan_if_parent()
479 return (bits_get(val, (uint8_t *)&wif->htcaps, in op_wlan_if_parent()
480 sizeof(wif->htcaps))); in op_wlan_if_parent()
492 struct wlan_iface *wif; in op_wlan_iface_config() local
498 if ((wif = wlan_get_interface(&val->var, sub)) == NULL) in op_wlan_iface_config()
503 if ((wif = wlan_get_next_interface(&val->var, sub)) == NULL) in op_wlan_iface_config()
505 wlan_append_ifindex(&val->var, sub, wif); in op_wlan_iface_config()
509 if ((wif = wlan_get_interface(&val->var, sub)) == NULL) in op_wlan_iface_config()
531 ctx->scratch->int1 = wif->packet_burst; in op_wlan_iface_config()
534 ctx->scratch->int1 = wif->reg_domain; in op_wlan_iface_config()
537 ctx->scratch->int1 = wif->desired_channel; in op_wlan_iface_config()
540 ctx->scratch->int1 = wif->dyn_frequency; in op_wlan_iface_config()
543 ctx->scratch->int1 = wif->fast_frames; in op_wlan_iface_config()
546 ctx->scratch->int1 = wif->dturbo; in op_wlan_iface_config()
549 ctx->scratch->int1 = wif->tx_power; in op_wlan_iface_config()
552 ctx->scratch->int1 = wif->frag_threshold; in op_wlan_iface_config()
555 ctx->scratch->int1 = wif->rts_threshold; in op_wlan_iface_config()
558 ctx->scratch->int1 = wif->priv_subscribe; in op_wlan_iface_config()
561 ctx->scratch->int1 = wif->bg_scan; in op_wlan_iface_config()
564 ctx->scratch->int1 = wif->bg_scan_idle; in op_wlan_iface_config()
567 ctx->scratch->int1 = wif->bg_scan_interval; in op_wlan_iface_config()
570 ctx->scratch->int1 = wif->beacons_missed; in op_wlan_iface_config()
573 ctx->scratch->int1 = wif->roam_mode; in op_wlan_iface_config()
576 ctx->scratch->int1 = wif->dot11d; in op_wlan_iface_config()
579 ctx->scratch->int1 = wif->dot11h; in op_wlan_iface_config()
582 ctx->scratch->int1 = wif->dynamic_wds; in op_wlan_iface_config()
585 ctx->scratch->int1 = wif->power_save; in op_wlan_iface_config()
588 ctx->scratch->int1 = wif->ap_bridge; in op_wlan_iface_config()
591 ctx->scratch->int1 = wif->beacon_interval; in op_wlan_iface_config()
594 ctx->scratch->int1 = wif->dtim_period; in op_wlan_iface_config()
597 ctx->scratch->int1 = wif->hide_ssid; in op_wlan_iface_config()
600 ctx->scratch->int1 = wif->inact_process; in op_wlan_iface_config()
603 ctx->scratch->int1 = wif->do11g_protect; in op_wlan_iface_config()
606 ctx->scratch->int1 = wif->dot11g_pure; in op_wlan_iface_config()
609 ctx->scratch->int1 = wif->dot11n_pure; in op_wlan_iface_config()
612 ctx->scratch->int1 = wif->ampdu; in op_wlan_iface_config()
615 ctx->scratch->int1 = wif->ampdu_density; in op_wlan_iface_config()
618 ctx->scratch->int1 = wif->ampdu_limit; in op_wlan_iface_config()
621 ctx->scratch->int1 = wif->amsdu; in op_wlan_iface_config()
624 ctx->scratch->int1 = wif->amsdu_limit; in op_wlan_iface_config()
627 ctx->scratch->int1 = wif->ht_enabled; in op_wlan_iface_config()
630 ctx->scratch->int1 = wif->ht_compatible; in op_wlan_iface_config()
633 ctx->scratch->int1 = wif->ht_prot_mode; in op_wlan_iface_config()
636 ctx->scratch->int1 = wif->rifs; in op_wlan_iface_config()
639 ctx->scratch->int1 = wif->short_gi; in op_wlan_iface_config()
642 ctx->scratch->int1 = wif->smps_mode; in op_wlan_iface_config()
645 ctx->scratch->int1 = wif->tdma_slot; in op_wlan_iface_config()
648 ctx->scratch->int1 = wif->tdma_slot_count; in op_wlan_iface_config()
651 ctx->scratch->int1 = wif->tdma_slot_length; in op_wlan_iface_config()
654 ctx->scratch->int1 = wif->tdma_binterval; in op_wlan_iface_config()
682 if ((wif = wlan_get_interface(&val->var, sub)) == NULL) in op_wlan_iface_config()
711 if (wlan_config_get_ioctl(wif, val->var.subs[sub - 1]) < 0) in op_wlan_iface_config()
716 val->v.integer = wif->packet_burst; in op_wlan_iface_config()
719 return (string_get(val, wif->country_code, in op_wlan_iface_config()
722 val->v.integer = wif->reg_domain; in op_wlan_iface_config()
725 return (string_get(val, wif->desired_ssid, -1)); in op_wlan_iface_config()
727 val->v.integer = wif->desired_channel; in op_wlan_iface_config()
730 val->v.integer = wif->dyn_frequency; in op_wlan_iface_config()
733 val->v.integer = wif->fast_frames; in op_wlan_iface_config()
736 val->v.integer = wif->dturbo; in op_wlan_iface_config()
739 val->v.integer = wif->tx_power; in op_wlan_iface_config()
742 val->v.integer = wif->frag_threshold; in op_wlan_iface_config()
745 val->v.integer = wif->rts_threshold; in op_wlan_iface_config()
748 val->v.integer = wif->priv_subscribe; in op_wlan_iface_config()
751 val->v.integer = wif->bg_scan; in op_wlan_iface_config()
754 val->v.integer = wif->bg_scan_idle; in op_wlan_iface_config()
757 val->v.integer = wif->bg_scan_interval; in op_wlan_iface_config()
760 val->v.integer = wif->beacons_missed; in op_wlan_iface_config()
763 return (string_get(val, wif->desired_bssid, in op_wlan_iface_config()
766 val->v.integer = wif->roam_mode; in op_wlan_iface_config()
769 val->v.integer = wif->dot11d; in op_wlan_iface_config()
772 val->v.integer = wif->dot11h; in op_wlan_iface_config()
775 val->v.integer = wif->dynamic_wds; in op_wlan_iface_config()
778 val->v.integer = wif->power_save; in op_wlan_iface_config()
781 val->v.integer = wif->ap_bridge; in op_wlan_iface_config()
784 val->v.integer = wif->beacon_interval; in op_wlan_iface_config()
787 val->v.integer = wif->dtim_period; in op_wlan_iface_config()
790 val->v.integer = wif->hide_ssid; in op_wlan_iface_config()
793 val->v.integer = wif->inact_process; in op_wlan_iface_config()
796 val->v.integer = wif->do11g_protect; in op_wlan_iface_config()
799 val->v.integer = wif->dot11g_pure; in op_wlan_iface_config()
802 val->v.integer = wif->dot11n_pure; in op_wlan_iface_config()
805 val->v.integer = wif->ampdu; in op_wlan_iface_config()
808 val->v.integer = wif->ampdu_density; in op_wlan_iface_config()
811 val->v.integer = wif->ampdu_limit; in op_wlan_iface_config()
814 val->v.integer = wif->amsdu; in op_wlan_iface_config()
817 val->v.integer = wif->amsdu_limit; in op_wlan_iface_config()
820 val->v.integer = wif->ht_enabled; in op_wlan_iface_config()
823 val->v.integer = wif->ht_compatible; in op_wlan_iface_config()
826 val->v.integer = wif->ht_prot_mode; in op_wlan_iface_config()
829 val->v.integer = wif->rifs; in op_wlan_iface_config()
832 val->v.integer = wif->short_gi; in op_wlan_iface_config()
835 val->v.integer = wif->smps_mode; in op_wlan_iface_config()
838 val->v.integer = wif->tdma_slot; in op_wlan_iface_config()
841 val->v.integer = wif->tdma_slot_count; in op_wlan_iface_config()
844 val->v.integer = wif->tdma_slot_length; in op_wlan_iface_config()
847 val->v.integer = wif->tdma_binterval; in op_wlan_iface_config()
854 rc = wlan_config_set_ioctl(wif, val->var.subs[sub - 1], intval, in op_wlan_iface_config()
880 struct wlan_iface *wif; in op_wlan_if_peer() local
887 if ((wip = wlan_get_peer(&val->var, sub, &wif)) == NULL) in op_wlan_if_peer()
891 if ((wip = wlan_get_next_peer(&val->var, sub, &wif)) == NULL) in op_wlan_if_peer()
893 wlan_append_mac_index(&val->var, sub, wif->wname, wip->pmac); in op_wlan_if_peer()
896 if ((wip = wlan_get_peer(&val->var, sub, &wif)) == NULL) in op_wlan_if_peer()
901 if (wlan_peer_set_vlan(wif, wip, val->v.integer) < 0) in op_wlan_if_peer()
907 if ((wip = wlan_get_peer(&val->var, sub, &wif)) == NULL) in op_wlan_if_peer()
911 if (wlan_peer_set_vlan(wif, wip, ctx->scratch->int1) < 0) in op_wlan_if_peer()
967 struct wlan_iface *wif; in op_wlan_channels() local
974 if ((channel = wlan_get_channel(&val->var, sub, &wif)) == NULL) in op_wlan_channels()
978 channel = wlan_get_next_channel(&val->var, sub, &wif); in op_wlan_channels()
979 if (channel == NULL || wif == NULL) in op_wlan_channels()
981 wlan_append_channel_index(&val->var, sub, wif, channel); in op_wlan_channels()
1035 struct wlan_iface *wif; in op_wlan_roam_params() local
1042 rparam = wlan_get_roam_param(&val->var, sub, &wif); in op_wlan_roam_params()
1047 rparam = wlan_get_next_roam_param(&val->var, sub, &wif, &phy); in op_wlan_roam_params()
1048 if (rparam == NULL || wif == NULL) in op_wlan_roam_params()
1050 wlan_append_phy_index(&val->var, sub, wif->wname, phy); in op_wlan_roam_params()
1082 struct wlan_iface *wif; in op_wlan_tx_params() local
1089 txparam = wlan_get_tx_param(&val->var, sub, &wif, &phy); in op_wlan_tx_params()
1095 txparam = wlan_get_next_tx_param(&val->var, sub, &wif, &phy); in op_wlan_tx_params()
1096 if (txparam == NULL || wif == NULL) in op_wlan_tx_params()
1098 wlan_append_phy_index(&val->var, sub, wif->wname, phy); in op_wlan_tx_params()
1102 txparam = wlan_get_tx_param(&val->var, sub, &wif, &phy); in op_wlan_tx_params()
1103 if (txparam == NULL || wif == NULL) in op_wlan_tx_params()
1125 if (wlan_set_tx_params(wif, phy) < 0) in op_wlan_tx_params()
1133 txparam = wlan_get_tx_param(&val->var, sub, &wif, &phy); in op_wlan_tx_params()
1134 if (txparam == NULL || wif == NULL) in op_wlan_tx_params()
1152 if (wlan_set_tx_params(wif, phy) < 0) in op_wlan_tx_params()
1184 struct wlan_iface *wif; in op_wlan_scan_config() local
1190 if ((wif = wlan_get_interface(&val->var, sub)) == NULL) in op_wlan_scan_config()
1195 if ((wif = wlan_get_next_interface(&val->var, sub)) == NULL) in op_wlan_scan_config()
1197 wlan_append_ifindex(&val->var, sub, wif); in op_wlan_scan_config()
1201 if ((wif = wlan_get_interface(&val->var, sub)) == NULL) in op_wlan_scan_config()
1203 if (wif->scan_status == wlanScanConfigStatus_running in op_wlan_scan_config()
1208 ctx->scratch->int1 = wif->scan_flags; in op_wlan_scan_config()
1209 wif->scan_flags = val->v.integer; in op_wlan_scan_config()
1212 ctx->scratch->int1 = wif->scan_duration; in op_wlan_scan_config()
1213 wif->scan_duration = val->v.integer; in op_wlan_scan_config()
1216 ctx->scratch->int1 = wif->scan_mindwell; in op_wlan_scan_config()
1217 wif->scan_mindwell = val->v.integer; in op_wlan_scan_config()
1220 ctx->scratch->int1 = wif->scan_maxdwell; in op_wlan_scan_config()
1221 wif->scan_maxdwell = val->v.integer; in op_wlan_scan_config()
1226 ctx->scratch->int1 = wif->scan_status; in op_wlan_scan_config()
1227 wif->scan_status = val->v.integer; in op_wlan_scan_config()
1235 if ((wif = wlan_get_interface(&val->var, sub)) == NULL) in op_wlan_scan_config()
1238 if (wif->scan_status == wlanScanConfigStatus_running) in op_wlan_scan_config()
1239 (void)wlan_set_scan_config(wif); /* XXX */ in op_wlan_scan_config()
1243 if ((wif = wlan_get_interface(&val->var, sub)) == NULL) in op_wlan_scan_config()
1247 wif->scan_flags = ctx->scratch->int1; in op_wlan_scan_config()
1250 wif->scan_duration = ctx->scratch->int1; in op_wlan_scan_config()
1253 wif->scan_mindwell = ctx->scratch->int1; in op_wlan_scan_config()
1256 wif->scan_maxdwell = ctx->scratch->int1; in op_wlan_scan_config()
1259 wif->scan_status = ctx->scratch->int1; in op_wlan_scan_config()
1269 val->v.integer = wif->scan_flags; in op_wlan_scan_config()
1272 val->v.integer = wif->scan_duration; in op_wlan_scan_config()
1275 val->v.integer = wif->scan_mindwell; in op_wlan_scan_config()
1278 val->v.integer = wif->scan_maxdwell; in op_wlan_scan_config()
1281 val->v.integer = wif->scan_status; in op_wlan_scan_config()
1293 struct wlan_iface *wif; in op_wlan_scan_results() local
1300 if ((sr = wlan_get_scanr(&val->var, sub, &wif)) == NULL) in op_wlan_scan_results()
1305 if ((sr = wlan_get_next_scanr(&val->var, sub, &wif)) == NULL) in op_wlan_scan_results()
1307 wlan_append_scanr_index(&val->var, sub, wif->wname, sr->ssid, in op_wlan_scan_results()
1351 struct wlan_iface *wif; in op_wlan_iface_stats() local
1357 if ((wif = wlan_get_interface(&val->var, sub)) == NULL) in op_wlan_iface_stats()
1361 if ((wif = wlan_get_next_interface(&val->var, sub)) == NULL) in op_wlan_iface_stats()
1363 wlan_append_ifindex(&val->var, sub, wif); in op_wlan_iface_stats()
1376 if (wlan_get_stats(wif) < 0) in op_wlan_iface_stats()
1381 val->v.uint32 = wif->stats.is_rx_badversion; in op_wlan_iface_stats()
1384 val->v.uint32 = wif->stats.is_rx_tooshort; in op_wlan_iface_stats()
1387 val->v.uint32 = wif->stats.is_rx_wrongbss; in op_wlan_iface_stats()
1390 val->v.uint32 = wif->stats.is_rx_dup; in op_wlan_iface_stats()
1393 val->v.uint32 = wif->stats.is_rx_wrongdir; in op_wlan_iface_stats()
1396 val->v.uint32 = wif->stats.is_rx_mcastecho; in op_wlan_iface_stats()
1399 val->v.uint32 = wif->stats.is_rx_notassoc; in op_wlan_iface_stats()
1402 val->v.uint32 = wif->stats.is_rx_noprivacy; in op_wlan_iface_stats()
1405 val->v.uint32 = wif->stats.is_rx_unencrypted; in op_wlan_iface_stats()
1408 val->v.uint32 = wif->stats.is_rx_wepfail; in op_wlan_iface_stats()
1411 val->v.uint32 = wif->stats.is_rx_decap; in op_wlan_iface_stats()
1414 val->v.uint32 = wif->stats.is_rx_mgtdiscard; in op_wlan_iface_stats()
1417 val->v.uint32 = wif->stats.is_rx_ctl; in op_wlan_iface_stats()
1420 val->v.uint32 = wif->stats.is_rx_beacon; in op_wlan_iface_stats()
1423 val->v.uint32 = wif->stats.is_rx_rstoobig; in op_wlan_iface_stats()
1426 val->v.uint32 = wif->stats.is_rx_elem_missing; in op_wlan_iface_stats()
1429 val->v.uint32 = wif->stats.is_rx_elem_toobig; in op_wlan_iface_stats()
1432 val->v.uint32 = wif->stats.is_rx_elem_toosmall; in op_wlan_iface_stats()
1435 val->v.uint32 = wif->stats.is_rx_elem_unknown; in op_wlan_iface_stats()
1438 val->v.uint32 = wif->stats.is_rx_chanmismatch; in op_wlan_iface_stats()
1441 val->v.uint32 = wif->stats.is_rx_nodealloc; in op_wlan_iface_stats()
1444 val->v.uint32 = wif->stats.is_rx_ssidmismatch; in op_wlan_iface_stats()
1447 val->v.uint32 = wif->stats.is_rx_auth_unsupported; in op_wlan_iface_stats()
1450 val->v.uint32 = wif->stats.is_rx_auth_fail; in op_wlan_iface_stats()
1453 val->v.uint32 = wif->stats.is_rx_auth_countermeasures; in op_wlan_iface_stats()
1456 val->v.uint32 = wif->stats.is_rx_assoc_bss; in op_wlan_iface_stats()
1459 val->v.uint32 = wif->stats.is_rx_assoc_notauth; in op_wlan_iface_stats()
1462 val->v.uint32 = wif->stats.is_rx_assoc_capmismatch; in op_wlan_iface_stats()
1465 val->v.uint32 = wif->stats.is_rx_assoc_norate; in op_wlan_iface_stats()
1468 val->v.uint32 = wif->stats.is_rx_assoc_badwpaie; in op_wlan_iface_stats()
1471 val->v.uint32 = wif->stats.is_rx_deauth; in op_wlan_iface_stats()
1474 val->v.uint32 = wif->stats.is_rx_disassoc; in op_wlan_iface_stats()
1477 val->v.uint32 = wif->stats.is_rx_badsubtype; in op_wlan_iface_stats()
1480 val->v.uint32 = wif->stats.is_rx_nobuf; in op_wlan_iface_stats()
1483 val->v.uint32 = wif->stats.is_rx_bad_auth; in op_wlan_iface_stats()
1486 val->v.uint32 = wif->stats.is_rx_unauth; in op_wlan_iface_stats()
1489 val->v.uint32 = wif->stats.is_rx_badkeyid; in op_wlan_iface_stats()
1492 val->v.uint32 = wif->stats.is_rx_ccmpreplay; in op_wlan_iface_stats()
1495 val->v.uint32 = wif->stats.is_rx_ccmpformat; in op_wlan_iface_stats()
1498 val->v.uint32 = wif->stats.is_rx_ccmpmic; in op_wlan_iface_stats()
1501 val->v.uint32 = wif->stats.is_rx_tkipreplay; in op_wlan_iface_stats()
1504 val->v.uint32 = wif->stats.is_rx_tkipformat; in op_wlan_iface_stats()
1507 val->v.uint32 = wif->stats.is_rx_tkipmic; in op_wlan_iface_stats()
1510 val->v.uint32 = wif->stats.is_rx_tkipicv; in op_wlan_iface_stats()
1513 val->v.uint32 = wif->stats.is_rx_acl; in op_wlan_iface_stats()
1516 val->v.uint32 = wif->stats.is_tx_nobuf; in op_wlan_iface_stats()
1519 val->v.uint32 = wif->stats.is_tx_nonode; in op_wlan_iface_stats()
1522 val->v.uint32 = wif->stats.is_tx_unknownmgt; in op_wlan_iface_stats()
1525 val->v.uint32 = wif->stats.is_tx_badcipher; in op_wlan_iface_stats()
1528 val->v.uint32 = wif->stats.is_tx_nodefkey; in op_wlan_iface_stats()
1531 val->v.uint32 = wif->stats.is_tx_fragframes; in op_wlan_iface_stats()
1534 val->v.uint32 = wif->stats.is_tx_frags; in op_wlan_iface_stats()
1537 val->v.uint32 = wif->stats.is_scan_active; in op_wlan_iface_stats()
1540 val->v.uint32 = wif->stats.is_scan_passive; in op_wlan_iface_stats()
1543 val->v.uint32 = wif->stats.is_node_timeout; in op_wlan_iface_stats()
1546 val->v.uint32 = wif->stats.is_crypto_nomem; in op_wlan_iface_stats()
1549 val->v.uint32 = wif->stats.is_crypto_tkip; in op_wlan_iface_stats()
1552 val->v.uint32 = wif->stats.is_crypto_tkipenmic; in op_wlan_iface_stats()
1555 val->v.uint32 = wif->stats.is_crypto_tkipdemic; in op_wlan_iface_stats()
1558 val->v.uint32 = wif->stats.is_crypto_tkipcm; in op_wlan_iface_stats()
1561 val->v.uint32 = wif->stats.is_crypto_ccmp; in op_wlan_iface_stats()
1564 val->v.uint32 = wif->stats.is_crypto_wep; in op_wlan_iface_stats()
1567 val->v.uint32 = wif->stats.is_crypto_setkey_cipher; in op_wlan_iface_stats()
1570 val->v.uint32 = wif->stats.is_crypto_setkey_nokey; in op_wlan_iface_stats()
1573 val->v.uint32 = wif->stats.is_crypto_delkey; in op_wlan_iface_stats()
1576 val->v.uint32 = wif->stats.is_crypto_badcipher; in op_wlan_iface_stats()
1579 val->v.uint32 = wif->stats.is_crypto_attachfail; in op_wlan_iface_stats()
1582 val->v.uint32 = wif->stats.is_crypto_keyfail; in op_wlan_iface_stats()
1585 val->v.uint32 = wif->stats.is_crypto_enmicfail; in op_wlan_iface_stats()
1588 val->v.uint32 = wif->stats.is_ibss_capmismatch; in op_wlan_iface_stats()
1591 val->v.uint32 = wif->stats.is_ps_unassoc; in op_wlan_iface_stats()
1594 val->v.uint32 = wif->stats.is_ps_badaid; in op_wlan_iface_stats()
1597 val->v.uint32 = wif->stats.is_ps_qempty; in op_wlan_iface_stats()
1600 val->v.uint32 = wif->stats.is_ff_badhdr; in op_wlan_iface_stats()
1603 val->v.uint32 = wif->stats.is_ff_tooshort; in op_wlan_iface_stats()
1606 val->v.uint32 = wif->stats.is_ff_split; in op_wlan_iface_stats()
1609 val->v.uint32 = wif->stats.is_ff_decap; in op_wlan_iface_stats()
1612 val->v.uint32 = wif->stats.is_ff_encap; in op_wlan_iface_stats()
1615 val->v.uint32 = wif->stats.is_rx_badbintval; in op_wlan_iface_stats()
1618 val->v.uint32 = wif->stats.is_rx_demicfail; in op_wlan_iface_stats()
1621 val->v.uint32 = wif->stats.is_rx_defrag; in op_wlan_iface_stats()
1624 val->v.uint32 = wif->stats.is_rx_mgmt; in op_wlan_iface_stats()
1627 val->v.uint32 = wif->stats.is_rx_action; in op_wlan_iface_stats()
1630 val->v.uint32 = wif->stats.is_amsdu_tooshort; in op_wlan_iface_stats()
1633 val->v.uint32 = wif->stats.is_amsdu_split; in op_wlan_iface_stats()
1636 val->v.uint32 = wif->stats.is_amsdu_decap; in op_wlan_iface_stats()
1639 val->v.uint32 = wif->stats.is_amsdu_encap; in op_wlan_iface_stats()
1642 val->v.uint32 = wif->stats.is_ampdu_bar_bad; in op_wlan_iface_stats()
1645 val->v.uint32 = wif->stats.is_ampdu_bar_oow; in op_wlan_iface_stats()
1648 val->v.uint32 = wif->stats.is_ampdu_bar_move; in op_wlan_iface_stats()
1651 val->v.uint32 = wif->stats.is_ampdu_bar_rx; in op_wlan_iface_stats()
1654 val->v.uint32 = wif->stats.is_ampdu_rx_oor; in op_wlan_iface_stats()
1657 val->v.uint32 = wif->stats.is_ampdu_rx_copy; in op_wlan_iface_stats()
1660 val->v.uint32 = wif->stats.is_ampdu_rx_drop; in op_wlan_iface_stats()
1663 val->v.uint32 = wif->stats.is_tx_badstate; in op_wlan_iface_stats()
1666 val->v.uint32 = wif->stats.is_tx_notassoc; in op_wlan_iface_stats()
1669 val->v.uint32 = wif->stats.is_tx_classify; in op_wlan_iface_stats()
1672 val->v.uint32 = wif->stats.is_dwds_mcast; in op_wlan_iface_stats()
1675 val->v.uint32 = wif->stats.is_ht_assoc_nohtcap; in op_wlan_iface_stats()
1678 val->v.uint32 = wif->stats.is_ht_assoc_downgrade; in op_wlan_iface_stats()
1681 val->v.uint32 = wif->stats.is_ht_assoc_norate; in op_wlan_iface_stats()
1684 val->v.uint32 = wif->stats.is_ampdu_rx_age; in op_wlan_iface_stats()
1687 val->v.uint32 = wif->stats.is_ampdu_rx_move; in op_wlan_iface_stats()
1690 val->v.uint32 = wif->stats.is_addba_reject; in op_wlan_iface_stats()
1693 val->v.uint32 = wif->stats.is_addba_norequest; in op_wlan_iface_stats()
1696 val->v.uint32 = wif->stats.is_addba_badtoken; in op_wlan_iface_stats()
1699 val->v.uint32 = wif->stats.is_addba_badpolicy; in op_wlan_iface_stats()
1702 val->v.uint32 = wif->stats.is_ampdu_stop; in op_wlan_iface_stats()
1705 val->v.uint32 = wif->stats.is_ampdu_stop_failed; in op_wlan_iface_stats()
1708 val->v.uint32 = wif->stats.is_ampdu_rx_reorder; in op_wlan_iface_stats()
1711 val->v.uint32 = wif->stats.is_scan_bg; in op_wlan_iface_stats()
1714 val->v.uint32 = wif->stats.is_rx_deauth_code; in op_wlan_iface_stats()
1717 val->v.uint32 = wif->stats.is_rx_disassoc_code; in op_wlan_iface_stats()
1720 val->v.uint32 = wif->stats.is_rx_authfail_code; in op_wlan_iface_stats()
1723 val->v.uint32 = wif->stats.is_beacon_miss; in op_wlan_iface_stats()
1726 val->v.uint32 = wif->stats.is_rx_badstate; in op_wlan_iface_stats()
1729 val->v.uint32 = wif->stats.is_ff_flush; in op_wlan_iface_stats()
1732 val->v.uint32 = wif->stats.is_tx_ctl; in op_wlan_iface_stats()
1735 val->v.uint32 = wif->stats.is_ampdu_rexmt; in op_wlan_iface_stats()
1738 val->v.uint32 = wif->stats.is_ampdu_rexmt_fail; in op_wlan_iface_stats()
1754 struct wlan_iface *wif; in op_wlan_wep_iface() local
1760 if ((wif = wlan_get_interface(&val->var, sub)) == NULL || in op_wlan_wep_iface()
1761 !wif->wepsupported) in op_wlan_wep_iface()
1767 if ((wif = wlan_get_next_interface(&val->var, sub)) == NULL) in op_wlan_wep_iface()
1769 wlan_append_ifindex(&val->var, sub, wif); in op_wlan_wep_iface()
1773 if ((wif = wlan_get_interface(&val->var, sub)) == NULL || in op_wlan_wep_iface()
1774 !wif->wepsupported) in op_wlan_wep_iface()
1781 ctx->scratch->int1 = wif->wepmode; in op_wlan_wep_iface()
1782 wif->wepmode = val->v.integer; in op_wlan_wep_iface()
1783 if (wlan_set_wepmode(wif) < 0) { in op_wlan_wep_iface()
1784 wif->wepmode = ctx->scratch->int1; in op_wlan_wep_iface()
1792 ctx->scratch->int1 = wif->weptxkey; in op_wlan_wep_iface()
1793 wif->weptxkey = val->v.integer; in op_wlan_wep_iface()
1794 if (wlan_set_weptxkey(wif) < 0) { in op_wlan_wep_iface()
1795 wif->weptxkey = ctx->scratch->int1; in op_wlan_wep_iface()
1808 if ((wif = wlan_get_interface(&val->var, sub)) == NULL) in op_wlan_wep_iface()
1812 wif->wepmode = ctx->scratch->int1; in op_wlan_wep_iface()
1813 if (wlan_set_wepmode(wif) < 0) in op_wlan_wep_iface()
1817 wif->weptxkey = ctx->scratch->int1; in op_wlan_wep_iface()
1818 if (wlan_set_weptxkey(wif) < 0) in op_wlan_wep_iface()
1832 if (wlan_get_wepmode(wif) < 0) in op_wlan_wep_iface()
1834 val->v.integer = wif->wepmode; in op_wlan_wep_iface()
1837 if (wlan_get_weptxkey(wif) < 0) in op_wlan_wep_iface()
1839 val->v.integer = wif->weptxkey; in op_wlan_wep_iface()
1860 struct wlan_iface *wif; in op_wlan_mac_access_control() local
1866 if ((wif = wlan_get_interface(&val->var, sub)) == NULL || in op_wlan_mac_access_control()
1867 !wif->macsupported) in op_wlan_mac_access_control()
1873 if ((wif = wlan_get_next_interface(&val->var, sub)) == NULL) in op_wlan_mac_access_control()
1875 wlan_append_ifindex(&val->var, sub, wif); in op_wlan_mac_access_control()
1879 if ((wif = wlan_get_interface(&val->var, sub)) == NULL || in op_wlan_mac_access_control()
1880 !wif->macsupported) in op_wlan_mac_access_control()
1884 ctx->scratch->int1 = wif->mac_policy; in op_wlan_mac_access_control()
1885 wif->mac_policy = val->v.integer; in op_wlan_mac_access_control()
1897 if ((wif = wlan_get_interface(&val->var, sub)) == NULL) in op_wlan_mac_access_control()
1901 if (wlan_set_mac_policy(wif) < 0) { in op_wlan_mac_access_control()
1902 wif->mac_policy = ctx->scratch->int1; in op_wlan_mac_access_control()
1907 if (wlan_flush_mac_mac(wif) < 0) in op_wlan_mac_access_control()
1916 if ((wif = wlan_get_interface(&val->var, sub)) == NULL) in op_wlan_mac_access_control()
1919 wif->mac_policy = ctx->scratch->int1; in op_wlan_mac_access_control()
1926 if (wlan_get_mac_policy(wif) < 0) in op_wlan_mac_access_control()
1931 val->v.integer = wif->mac_policy; in op_wlan_mac_access_control()
1934 val->v.integer = wif->mac_nacls; in op_wlan_mac_access_control()
1950 struct wlan_iface *wif; in op_wlan_mac_acl_mac() local
1958 if ((macl = wlan_get_acl_mac(&val->var, sub, &wif)) == NULL) in op_wlan_mac_acl_mac()
1963 if ((macl = wlan_get_next_acl_mac(&val->var, sub, &wif)) in op_wlan_mac_acl_mac()
1966 wlan_append_mac_index(&val->var, sub, wif->wname, macl->mac); in op_wlan_mac_acl_mac()
1980 if ((macl = wlan_get_acl_mac(&val->var, sub, &wif)) == NULL) in op_wlan_mac_acl_mac()
1983 wlan_mac_delete_mac(wif, macl) < 0) in op_wlan_mac_acl_mac()
1988 if ((macl = wlan_get_acl_mac(&val->var, sub, &wif)) == NULL) in op_wlan_mac_acl_mac()
1991 wlan_mac_delete_mac(wif, macl) < 0) in op_wlan_mac_acl_mac()
2116 struct wlan_iface *wif; in op_wlan_mesh_iface() local
2122 if ((wif = wlan_mesh_get_iface(&val->var, sub)) == NULL) in op_wlan_mesh_iface()
2127 if ((wif = wlan_mesh_get_next_iface(&val->var, sub)) == NULL) in op_wlan_mesh_iface()
2129 wlan_append_ifindex(&val->var, sub, wif); in op_wlan_mesh_iface()
2133 if ((wif = wlan_mesh_get_iface(&val->var, sub)) == NULL) in op_wlan_mesh_iface()
2142 strlcpy(ctx->scratch->ptr1, wif->desired_ssid, in op_wlan_mesh_iface()
2144 ctx->scratch->int1 = strlen(wif->desired_ssid); in op_wlan_mesh_iface()
2145 memcpy(wif->desired_ssid, val->v.octetstring.octets, in op_wlan_mesh_iface()
2147 wif->desired_ssid[val->v.octetstring.len] = '\0'; in op_wlan_mesh_iface()
2150 ctx->scratch->int1 = wif->mesh_ttl; in op_wlan_mesh_iface()
2151 wif->mesh_ttl = val->v.integer; in op_wlan_mesh_iface()
2154 ctx->scratch->int1 = wif->mesh_peering; in op_wlan_mesh_iface()
2155 wif->mesh_peering = val->v.integer; in op_wlan_mesh_iface()
2158 ctx->scratch->int1 = wif->mesh_forwarding; in op_wlan_mesh_iface()
2159 wif->mesh_forwarding = val->v.integer; in op_wlan_mesh_iface()
2162 ctx->scratch->int1 = wif->mesh_metric; in op_wlan_mesh_iface()
2163 wif->mesh_metric = val->v.integer; in op_wlan_mesh_iface()
2166 ctx->scratch->int1 = wif->mesh_path; in op_wlan_mesh_iface()
2167 wif->mesh_path = val->v.integer; in op_wlan_mesh_iface()
2177 rc = wlan_config_set_dssid(wif, in op_wlan_mesh_iface()
2180 rc = wlan_mesh_config_set(wif, val->var.subs[sub - 1]); in op_wlan_mesh_iface()
2186 if ((wif = wlan_mesh_get_iface(&val->var, sub)) == NULL) in op_wlan_mesh_iface()
2189 wlan_mesh_flush_routes(wif) < 0) in op_wlan_mesh_iface()
2196 if ((wif = wlan_mesh_get_iface(&val->var, sub)) == NULL) in op_wlan_mesh_iface()
2200 strlcpy(wif->desired_ssid, ctx->scratch->ptr1, in op_wlan_mesh_iface()
2205 wif->mesh_ttl = ctx->scratch->int1; in op_wlan_mesh_iface()
2208 wif->mesh_peering = ctx->scratch->int1; in op_wlan_mesh_iface()
2211 wif->mesh_forwarding = ctx->scratch->int1; in op_wlan_mesh_iface()
2214 wif->mesh_metric = ctx->scratch->int1; in op_wlan_mesh_iface()
2217 wif->mesh_path = ctx->scratch->int1; in op_wlan_mesh_iface()
2225 rc = wlan_config_set_dssid(wif, wif->desired_ssid, in op_wlan_mesh_iface()
2226 strlen(wif->desired_ssid)); in op_wlan_mesh_iface()
2228 rc = wlan_mesh_config_set(wif, val->var.subs[sub - 1]); in op_wlan_mesh_iface()
2238 rc = wlan_config_get_dssid(wif); in op_wlan_mesh_iface()
2240 rc = wlan_mesh_config_get(wif, val->var.subs[sub - 1]); in op_wlan_mesh_iface()
2246 return (string_get(val, wif->desired_ssid, -1)); in op_wlan_mesh_iface()
2248 val->v.integer = wif->mesh_ttl; in op_wlan_mesh_iface()
2251 val->v.integer = wif->mesh_peering; in op_wlan_mesh_iface()
2254 val->v.integer = wif->mesh_forwarding; in op_wlan_mesh_iface()
2257 val->v.integer = wif->mesh_metric; in op_wlan_mesh_iface()
2260 val->v.integer = wif->mesh_path; in op_wlan_mesh_iface()
2277 struct wlan_iface *wif; in op_wlan_mesh_neighbor() local
2284 if ((wip = wlan_mesh_get_peer(&val->var, sub, &wif)) == NULL) in op_wlan_mesh_neighbor()
2288 wip = wlan_mesh_get_next_peer(&val->var, sub, &wif); in op_wlan_mesh_neighbor()
2291 wlan_append_mac_index(&val->var, sub, wif->wname, in op_wlan_mesh_neighbor()
2346 struct wlan_iface *wif; in op_wlan_mesh_route() local
2353 if ((wmr = wlan_mesh_get_route(&val->var, sub, &wif)) == NULL) in op_wlan_mesh_route()
2358 wmr = wlan_mesh_get_next_route(&val->var, sub, &wif); in op_wlan_mesh_route()
2361 wlan_append_mac_index(&val->var, sub, wif->wname, in op_wlan_mesh_route()
2377 if ((wmr = wlan_mesh_get_route(&val->var, sub, &wif)) == NULL) in op_wlan_mesh_route()
2380 wlan_mesh_delete_route(wif, wmr) < 0) in op_wlan_mesh_route()
2385 if ((wmr = wlan_mesh_get_route(&val->var, sub, &wif)) == NULL) in op_wlan_mesh_route()
2388 wlan_mesh_delete_route(wif, wmr) < 0) in op_wlan_mesh_route()
2437 struct wlan_iface *wif; in op_wlan_mesh_stats() local
2443 if ((wif = wlan_mesh_get_iface(&val->var, sub)) == NULL) in op_wlan_mesh_stats()
2447 if ((wif = wlan_mesh_get_next_iface(&val->var, sub)) == NULL) in op_wlan_mesh_stats()
2449 wlan_append_ifindex(&val->var, sub, wif); in op_wlan_mesh_stats()
2461 if (wlan_get_stats(wif) < 0) in op_wlan_mesh_stats()
2466 val->v.uint32 = wif->stats.is_mesh_wrongmesh; in op_wlan_mesh_stats()
2469 val->v.uint32 = wif->stats.is_mesh_nolink; in op_wlan_mesh_stats()
2472 val->v.uint32 = wif->stats.is_mesh_fwd_ttl; in op_wlan_mesh_stats()
2475 val->v.uint32 = wif->stats.is_mesh_fwd_nobuf; in op_wlan_mesh_stats()
2478 val->v.uint32 = wif->stats.is_mesh_fwd_tooshort; in op_wlan_mesh_stats()
2481 val->v.uint32 = wif->stats.is_mesh_fwd_disabled; in op_wlan_mesh_stats()
2484 val->v.uint32 = wif->stats.is_mesh_fwd_nopath; in op_wlan_mesh_stats()
2487 val->v.uint32 = wif->stats.is_mesh_badae; in op_wlan_mesh_stats()
2490 val->v.uint32 = wif->stats.is_mesh_rtaddfailed; in op_wlan_mesh_stats()
2493 val->v.uint32 = wif->stats.is_mesh_notproxy; in op_wlan_mesh_stats()
2496 val->v.uint32 = wif->stats.is_rx_badalign; in op_wlan_mesh_stats()
2647 struct wlan_iface *wif; in op_wlan_hwmp_iface() local
2653 if ((wif = wlan_mesh_get_iface(&val->var, sub)) == NULL) in op_wlan_hwmp_iface()
2658 if ((wif = wlan_mesh_get_next_iface(&val->var, sub)) == NULL) in op_wlan_hwmp_iface()
2660 wlan_append_ifindex(&val->var, sub, wif); in op_wlan_hwmp_iface()
2664 if ((wif = wlan_mesh_get_iface(&val->var, sub)) == NULL) in op_wlan_hwmp_iface()
2668 ctx->scratch->int1 = wif->hwmp_root_mode; in op_wlan_hwmp_iface()
2669 wif->hwmp_root_mode = val->v.integer; in op_wlan_hwmp_iface()
2672 ctx->scratch->int1 = wif->hwmp_max_hops; in op_wlan_hwmp_iface()
2673 wif->hwmp_max_hops = val->v.integer; in op_wlan_hwmp_iface()
2678 if (wlan_hwmp_config_set(wif, val->var.subs[sub - 1]) < 0) in op_wlan_hwmp_iface()
2686 if ((wif = wlan_mesh_get_iface(&val->var, sub)) == NULL) in op_wlan_hwmp_iface()
2690 wif->hwmp_root_mode = ctx->scratch->int1; in op_wlan_hwmp_iface()
2693 wif->hwmp_max_hops = ctx->scratch->int1; in op_wlan_hwmp_iface()
2698 if (wlan_hwmp_config_set(wif, val->var.subs[sub - 1]) < 0) in op_wlan_hwmp_iface()
2706 if (wlan_hwmp_config_get(wif, val->var.subs[sub - 1]) < 0) in op_wlan_hwmp_iface()
2711 val->v.integer = wif->hwmp_root_mode; in op_wlan_hwmp_iface()
2714 val->v.integer = wif->hwmp_max_hops; in op_wlan_hwmp_iface()
2727 struct wlan_iface *wif; in op_wlan_hwmp_stats() local
2733 if ((wif = wlan_mesh_get_iface(&val->var, sub)) == NULL) in op_wlan_hwmp_stats()
2737 if ((wif = wlan_mesh_get_next_iface(&val->var, sub)) == NULL) in op_wlan_hwmp_stats()
2739 wlan_append_ifindex(&val->var, sub, wif); in op_wlan_hwmp_stats()
2751 if (wlan_get_stats(wif) < 0) in op_wlan_hwmp_stats()
2756 val->v.uint32 = wif->stats.is_hwmp_wrongseq; in op_wlan_hwmp_stats()
2759 val->v.uint32 = wif->stats.is_hwmp_rootreqs; in op_wlan_hwmp_stats()
2762 val->v.uint32 = wif->stats.is_hwmp_rootrann; in op_wlan_hwmp_stats()
2765 val->v.uint32 = wif->stats.is_hwmp_proxy; in op_wlan_hwmp_stats()
2806 wlan_free_interface(struct wlan_iface *wif) in wlan_free_interface() argument
2808 wlan_free_peerlist(wif); in wlan_free_interface()
2809 free(wif->chanlist); in wlan_free_interface()
2810 wlan_scan_free_results(wif); in wlan_free_interface()
2811 wlan_mac_free_maclist(wif); in wlan_free_interface()
2812 wlan_mesh_free_routes(wif); in wlan_free_interface()
2813 free(wif); in wlan_free_interface()
2830 struct wlan_iface *wif; in wlan_find_interface() local
2832 SLIST_FOREACH(wif, &wlan_ifaces, w_if) in wlan_find_interface()
2833 if (strcmp(wif->wname, wname) == 0) { in wlan_find_interface()
2834 if (wif->status != RowStatus_active) in wlan_find_interface()
2839 return (wif); in wlan_find_interface()
2849 wlan_next_interface(struct wlan_iface *wif) in wlan_next_interface() argument
2851 if (wif == NULL) in wlan_next_interface()
2854 return (SLIST_NEXT(wif, w_if)); in wlan_next_interface()
2861 wlan_add_wif(struct wlan_iface *wif) in wlan_add_wif() argument
2867 strcmp(wif->wname, prev->wname) < 0) { in wlan_add_wif()
2868 SLIST_INSERT_HEAD(&wlan_ifaces, wif, w_if); in wlan_add_wif()
2873 if ((cmp = strcmp(wif->wname, temp->wname)) <= 0) in wlan_add_wif()
2879 SLIST_INSERT_AFTER(prev, wif, w_if); in wlan_add_wif()
2881 SLIST_INSERT_AFTER(temp, wif, w_if); in wlan_add_wif()
2883 syslog(LOG_ERR, "Wlan iface %s already in list", wif->wname); in wlan_add_wif()
2893 struct wlan_iface *wif; in wlan_new_wif() local
2896 for (wif = wlan_first_interface(); wif != NULL; in wlan_new_wif()
2897 wif = wlan_next_interface(wif)) in wlan_new_wif()
2898 if (strcmp(wname, wif->wname) == 0) { in wlan_new_wif()
2899 wif->internal = 0; in wlan_new_wif()
2900 return (wif); in wlan_new_wif()
2903 if ((wif = (struct wlan_iface *)malloc(sizeof(*wif))) == NULL) in wlan_new_wif()
2906 memset(wif, 0, sizeof(struct wlan_iface)); in wlan_new_wif()
2907 strlcpy(wif->wname, wname, IFNAMSIZ); in wlan_new_wif()
2908 wif->status = RowStatus_notReady; in wlan_new_wif()
2909 wif->state = wlanIfaceState_down; in wlan_new_wif()
2910 wif->mode = WlanIfaceOperatingModeType_station; in wlan_new_wif()
2912 if (wlan_add_wif(wif) < 0) { in wlan_new_wif()
2913 free(wif); in wlan_new_wif()
2917 return (wif); in wlan_new_wif()
2921 wlan_delete_wif(struct wlan_iface *wif) in wlan_delete_wif() argument
2923 SLIST_REMOVE(&wlan_ifaces, wif, wlan_iface, w_if); in wlan_delete_wif()
2924 wlan_free_interface(wif); in wlan_delete_wif()
2930 struct wlan_iface *wif; in wlan_attach_newif() local
2936 if ((wif = wlan_new_wif(mif->name)) == NULL) in wlan_attach_newif()
2939 (void)wlan_get_opmode(wif); in wlan_attach_newif()
2940 wif->index = mif->index; in wlan_attach_newif()
2941 wif->status = RowStatus_active; in wlan_attach_newif()
2942 (void)wlan_update_interface(wif); in wlan_attach_newif()
2948 wlan_iface_create(struct wlan_iface *wif) in wlan_iface_create() argument
2952 if ((rc = wlan_clone_create(wif)) == SNMP_ERR_NOERROR) { in wlan_iface_create()
2957 wif->status = RowStatus_active; in wlan_iface_create()
2958 if (wif->state == wlanIfaceState_up) in wlan_iface_create()
2959 (void)wlan_config_state(wif, 1); in wlan_iface_create()
2966 wlan_iface_destroy(struct wlan_iface *wif) in wlan_iface_destroy() argument
2970 if (wif->internal == 0) in wlan_iface_destroy()
2971 rc = wlan_clone_destroy(wif); in wlan_iface_destroy()
2974 wlan_delete_wif(wif); in wlan_iface_destroy()
2980 wlan_update_interface(struct wlan_iface *wif) in wlan_update_interface() argument
2984 (void)wlan_config_state(wif, 0); in wlan_update_interface()
2985 (void)wlan_get_driver_caps(wif); in wlan_update_interface()
2988 (void)wlan_config_get_ioctl(wif, i); in wlan_update_interface()
2989 (void)wlan_get_stats(wif); in wlan_update_interface()
2994 (void)wlan_get_channel_list(wif); in wlan_update_interface()
2995 (void)wlan_get_roam_params(wif); in wlan_update_interface()
2996 (void)wlan_get_tx_params(wif); in wlan_update_interface()
2997 (void)wlan_get_scan_results(wif); in wlan_update_interface()
2998 (void)wlan_get_wepmode(wif); in wlan_update_interface()
2999 (void)wlan_get_weptxkey(wif); in wlan_update_interface()
3000 (void)wlan_get_mac_policy(wif); in wlan_update_interface()
3001 (void)wlan_get_mac_acl_macs(wif); in wlan_update_interface()
3002 (void)wlan_get_peerinfo(wif); in wlan_update_interface()
3004 if (wif->mode == WlanIfaceOperatingModeType_meshPoint) { in wlan_update_interface()
3006 (void)wlan_mesh_config_get(wif, i); in wlan_update_interface()
3007 (void)wlan_mesh_get_routelist(wif); in wlan_update_interface()
3009 (void)wlan_hwmp_config_get(wif, i); in wlan_update_interface()
3018 struct wlan_iface *wif, *twif; in wlan_update_interface_list() local
3027 SLIST_FOREACH_SAFE(wif, &wlan_ifaces, w_if, twif) in wlan_update_interface_list()
3028 if (wif->status == RowStatus_active && wlan_get_opmode(wif) < 0) in wlan_update_interface_list()
3029 wlan_delete_wif(wif); in wlan_update_interface_list()
3078 struct wlan_iface *wif; in wlan_get_next_interface() local
3081 for (wif = wlan_first_interface(); wif != NULL; in wlan_get_next_interface()
3082 wif = wlan_next_interface(wif)) in wlan_get_next_interface()
3083 if (wif->status == RowStatus_active) in wlan_get_next_interface()
3085 return (wif); in wlan_get_next_interface()
3095 if ((wif = wlan_find_interface(wname)) == NULL) in wlan_get_next_interface()
3098 while ((wif = wlan_next_interface(wif)) != NULL) in wlan_get_next_interface()
3099 if (wif->status == RowStatus_active) in wlan_get_next_interface()
3102 return (wif); in wlan_get_next_interface()
3109 struct wlan_iface *wif; in wlan_get_snmp_interface() local
3114 for (wif = wlan_first_interface(); wif != NULL; in wlan_get_snmp_interface()
3115 wif = wlan_next_interface(wif)) in wlan_get_snmp_interface()
3116 if (strcmp(wif->wname, wname) == 0) in wlan_get_snmp_interface()
3119 return (wif); in wlan_get_snmp_interface()
3127 struct wlan_iface *wif; in wlan_get_next_snmp_interface() local
3140 for (wif = wlan_first_interface(); wif != NULL; in wlan_get_next_snmp_interface()
3141 wif = wlan_next_interface(wif)) in wlan_get_next_snmp_interface()
3142 if (strcmp(wif->wname, wname) == 0) in wlan_get_next_snmp_interface()
3145 return (wlan_next_interface(wif)); in wlan_get_next_snmp_interface()
3229 wlan_free_peerlist(struct wlan_iface *wif) in wlan_free_peerlist() argument
3233 while ((wip = SLIST_FIRST(&wif->peerlist)) != NULL) { in wlan_free_peerlist()
3234 SLIST_REMOVE_HEAD(&wif->peerlist, wp); in wlan_free_peerlist()
3238 SLIST_INIT(&wif->peerlist); in wlan_free_peerlist()
3242 wlan_find_peer(struct wlan_iface *wif, uint8_t *peermac) in wlan_find_peer() argument
3246 SLIST_FOREACH(wip, &wif->peerlist, wp) in wlan_find_peer()
3274 wlan_add_peer(struct wlan_iface *wif, struct wlan_peer *wip) in wlan_add_peer() argument
3278 SLIST_FOREACH(temp, &wif->peerlist, wp) in wlan_add_peer()
3282 if ((prev = SLIST_FIRST(&wif->peerlist)) == NULL || in wlan_add_peer()
3284 SLIST_INSERT_HEAD(&wif->peerlist, wip, wp); in wlan_add_peer()
3288 SLIST_FOREACH(temp, &wif->peerlist, wp) { in wlan_add_peer()
3301 struct wlan_iface *wif; in wlan_update_peers() local
3306 for (wif = wlan_first_interface(); wif != NULL; in wlan_update_peers()
3307 wif = wlan_next_interface(wif)) { in wlan_update_peers()
3308 if (wif->status != RowStatus_active) in wlan_update_peers()
3310 wlan_free_peerlist(wif); in wlan_update_peers()
3311 (void)wlan_get_peerinfo(wif); in wlan_update_peers()
3317 wlan_get_peer(const struct asn_oid *oid, uint sub, struct wlan_iface **wif) in wlan_get_peer() argument
3325 if ((*wif = wlan_find_interface(wname)) == NULL) in wlan_get_peer()
3328 return (wlan_find_peer(*wif, pmac)); in wlan_get_peer()
3332 wlan_get_next_peer(const struct asn_oid *oid, uint sub, struct wlan_iface **wif) in wlan_get_next_peer() argument
3339 for (*wif = wlan_first_interface(); *wif != NULL; in wlan_get_next_peer()
3340 *wif = wlan_next_interface(*wif)) { in wlan_get_next_peer()
3341 if ((*wif)->mode == in wlan_get_next_peer()
3344 wip = SLIST_FIRST(&(*wif)->peerlist); in wlan_get_next_peer()
3352 (*wif = wlan_find_interface(wname)) == NULL || in wlan_get_next_peer()
3353 (wip = wlan_find_peer(*wif, pmac)) == NULL) in wlan_get_next_peer()
3359 while ((*wif = wlan_next_interface(*wif)) != NULL) { in wlan_get_next_peer()
3360 if ((*wif)->mode == WlanIfaceOperatingModeType_meshPoint) in wlan_get_next_peer()
3362 if ((wip = SLIST_FIRST(&(*wif)->peerlist)) != NULL) in wlan_get_next_peer()
3375 struct wlan_iface *wif; in wlan_update_channels() local
3380 for (wif = wlan_first_interface(); wif != NULL; in wlan_update_channels()
3381 wif = wlan_next_interface(wif)) { in wlan_update_channels()
3382 if (wif->status != RowStatus_active) in wlan_update_channels()
3384 (void)wlan_get_channel_list(wif); in wlan_update_channels()
3408 const struct wlan_iface *wif, const struct ieee80211_channel *channel) in wlan_append_channel_index() argument
3412 oid->len = sub + strlen(wif->wname) + 2; in wlan_append_channel_index()
3413 oid->subs[sub] = strlen(wif->wname); in wlan_append_channel_index()
3414 for (i = 1; i <= strlen(wif->wname); i++) in wlan_append_channel_index()
3415 oid->subs[sub + i] = wif->wname[i - 1]; in wlan_append_channel_index()
3416 oid->subs[sub + strlen(wif->wname) + 1] = (channel - wif->chanlist) + 1; in wlan_append_channel_index()
3443 wlan_find_channel(struct wlan_iface *wif, uint32_t cindex) in wlan_find_channel() argument
3445 if (wif->chanlist == NULL || cindex > wif->nchannels) in wlan_find_channel()
3448 return (wif->chanlist + cindex - 1); in wlan_find_channel()
3452 wlan_get_channel(const struct asn_oid *oid, uint sub, struct wlan_iface **wif) in wlan_get_channel() argument
3460 if ((*wif = wlan_find_interface(wname)) == NULL) in wlan_get_channel()
3463 return (wlan_find_channel(*wif, cindex)); in wlan_get_channel()
3468 struct wlan_iface **wif) in wlan_get_next_channel() argument
3474 for (*wif = wlan_first_interface(); *wif != NULL; in wlan_get_next_channel()
3475 *wif = wlan_next_interface(*wif)) { in wlan_get_next_channel()
3476 if ((*wif)->status != RowStatus_active) in wlan_get_next_channel()
3478 if ((*wif)->nchannels != 0 && (*wif)->chanlist != NULL) in wlan_get_next_channel()
3479 return ((*wif)->chanlist); in wlan_get_next_channel()
3487 if ((*wif = wlan_find_interface(wname)) == NULL) in wlan_get_next_channel()
3490 if (cindex < (*wif)->nchannels) in wlan_get_next_channel()
3491 return ((*wif)->chanlist + cindex); in wlan_get_next_channel()
3493 while ((*wif = wlan_next_interface(*wif)) != NULL) in wlan_get_next_channel()
3494 if ((*wif)->status == RowStatus_active) in wlan_get_next_channel()
3495 if ((*wif)->nchannels != 0 && (*wif)->chanlist != NULL) in wlan_get_next_channel()
3496 return ((*wif)->chanlist); in wlan_get_next_channel()
3507 struct wlan_iface *wif; in wlan_update_roam_params() local
3512 for (wif = wlan_first_interface(); wif != NULL; in wlan_update_roam_params()
3513 wif = wlan_next_interface(wif)) { in wlan_update_roam_params()
3514 if (wif->status != RowStatus_active) in wlan_update_roam_params()
3516 (void)wlan_get_roam_params(wif); in wlan_update_roam_params()
3522 wlan_get_roam_param(const struct asn_oid *oid, uint sub, struct wlan_iface **wif) in wlan_get_roam_param() argument
3530 if ((*wif = wlan_find_interface(wname)) == NULL) in wlan_get_roam_param()
3536 return ((*wif)->roamparams.params + phy - 1); in wlan_get_roam_param()
3541 struct wlan_iface **wif, uint32_t *phy) in wlan_get_next_roam_param() argument
3546 for (*wif = wlan_first_interface(); *wif != NULL; in wlan_get_next_roam_param()
3547 *wif = wlan_next_interface(*wif)) { in wlan_get_next_roam_param()
3548 if ((*wif)->status != RowStatus_active) in wlan_get_next_roam_param()
3551 return ((*wif)->roamparams.params); in wlan_get_next_roam_param()
3559 if (*phy == 0 || (*wif = wlan_find_interface(wname)) == NULL) in wlan_get_next_roam_param()
3563 return ((*wif)->roamparams.params + *phy - 1); in wlan_get_next_roam_param()
3566 while ((*wif = wlan_next_interface(*wif)) != NULL) in wlan_get_next_roam_param()
3567 if ((*wif)->status == RowStatus_active) in wlan_get_next_roam_param()
3568 return ((*wif)->roamparams.params); in wlan_get_next_roam_param()
3579 struct wlan_iface *wif; in wlan_update_tx_params() local
3584 for (wif = wlan_first_interface(); wif != NULL; in wlan_update_tx_params()
3585 wif = wlan_next_interface(wif)) { in wlan_update_tx_params()
3586 if (wif->status != RowStatus_active) in wlan_update_tx_params()
3588 (void)wlan_get_tx_params(wif); in wlan_update_tx_params()
3595 wlan_get_tx_param(const struct asn_oid *oid, uint sub, struct wlan_iface **wif, in wlan_get_tx_param() argument
3603 if ((*wif = wlan_find_interface(wname)) == NULL) in wlan_get_tx_param()
3609 return ((*wif)->txparams.params + *phy - 1); in wlan_get_tx_param()
3614 struct wlan_iface **wif, uint32_t *phy) in wlan_get_next_tx_param() argument
3619 for (*wif = wlan_first_interface(); *wif != NULL; in wlan_get_next_tx_param()
3620 *wif = wlan_next_interface(*wif)) { in wlan_get_next_tx_param()
3621 if ((*wif)->status != RowStatus_active) in wlan_get_next_tx_param()
3624 return ((*wif)->txparams.params); in wlan_get_next_tx_param()
3632 if (*phy == 0 || (*wif = wlan_find_interface(wname)) == NULL) in wlan_get_next_tx_param()
3636 return ((*wif)->txparams.params + *phy - 1); in wlan_get_next_tx_param()
3639 while ((*wif = wlan_next_interface(*wif)) != NULL) in wlan_get_next_tx_param()
3640 if ((*wif)->status == RowStatus_active) in wlan_get_next_tx_param()
3641 return ((*wif)->txparams.params); in wlan_get_next_tx_param()
3650 wlan_scan_free_results(struct wlan_iface *wif) in wlan_scan_free_results() argument
3654 while ((sr = SLIST_FIRST(&wif->scanlist)) != NULL) { in wlan_scan_free_results()
3655 SLIST_REMOVE_HEAD(&wif->scanlist, wsr); in wlan_scan_free_results()
3659 SLIST_INIT(&wif->scanlist); in wlan_scan_free_results()
3663 wlan_scan_find_result(struct wlan_iface *wif, uint8_t *ssid, uint8_t *bssid) in wlan_scan_find_result() argument
3667 SLIST_FOREACH(sr, &wif->scanlist, wsr) in wlan_scan_find_result()
3728 wlan_scan_add_result(struct wlan_iface *wif, struct wlan_scan_result *sr) in wlan_scan_add_result() argument
3732 SLIST_FOREACH(temp, &wif->scanlist, wsr) in wlan_scan_add_result()
3738 if ((prev = SLIST_FIRST(&wif->scanlist)) == NULL || in wlan_scan_add_result()
3740 SLIST_INSERT_HEAD(&wif->scanlist, sr, wsr); in wlan_scan_add_result()
3744 SLIST_FOREACH(temp, &wif->scanlist, wsr) { in wlan_scan_add_result()
3757 struct wlan_iface *wif; in wlan_scan_update_results() local
3762 for (wif = wlan_first_interface(); wif != NULL; in wlan_scan_update_results()
3763 wif = wlan_next_interface(wif)) { in wlan_scan_update_results()
3764 if (wif->status != RowStatus_active) in wlan_scan_update_results()
3766 wlan_scan_free_results(wif); in wlan_scan_update_results()
3767 (void)wlan_get_scan_results(wif); in wlan_scan_update_results()
3824 wlan_get_scanr(const struct asn_oid *oid, uint sub, struct wlan_iface **wif) in wlan_get_scanr() argument
3833 if ((*wif = wlan_find_interface(wname)) == NULL) in wlan_get_scanr()
3836 return (wlan_scan_find_result(*wif, ssid, bssid)); in wlan_get_scanr()
3841 struct wlan_iface **wif) in wlan_get_next_scanr() argument
3849 for (*wif = wlan_first_interface(); *wif != NULL; in wlan_get_next_scanr()
3850 *wif = wlan_next_interface(*wif)) { in wlan_get_next_scanr()
3851 sr = SLIST_FIRST(&(*wif)->scanlist); in wlan_get_next_scanr()
3859 (*wif = wlan_find_interface(wname)) == NULL || in wlan_get_next_scanr()
3860 (sr = wlan_scan_find_result(*wif, ssid, bssid)) == NULL) in wlan_get_next_scanr()
3866 while ((*wif = wlan_next_interface(*wif)) != NULL) in wlan_get_next_scanr()
3867 if ((sr = SLIST_FIRST(&(*wif)->scanlist)) != NULL) in wlan_get_next_scanr()
3877 wlan_mac_free_maclist(struct wlan_iface *wif) in wlan_mac_free_maclist() argument
3881 while ((wmm = SLIST_FIRST(&wif->mac_maclist)) != NULL) { in wlan_mac_free_maclist()
3882 SLIST_REMOVE_HEAD(&wif->mac_maclist, wm); in wlan_mac_free_maclist()
3886 SLIST_INIT(&wif->mac_maclist); in wlan_mac_free_maclist()
3890 wlan_mac_find_mac(struct wlan_iface *wif, uint8_t *mac) in wlan_mac_find_mac() argument
3894 SLIST_FOREACH(wmm, &wif->mac_maclist, wm) in wlan_mac_find_mac()
3923 wlan_mac_add_mac(struct wlan_iface *wif, struct wlan_mac_mac *wmm) in wlan_mac_add_mac() argument
3927 SLIST_FOREACH(temp, &wif->mac_maclist, wm) in wlan_mac_add_mac()
3931 if ((prev = SLIST_FIRST(&wif->mac_maclist)) == NULL || in wlan_mac_add_mac()
3933 SLIST_INSERT_HEAD(&wif->mac_maclist, wmm, wm); in wlan_mac_add_mac()
3937 SLIST_FOREACH(temp, &wif->mac_maclist, wm) { in wlan_mac_add_mac()
3948 wlan_mac_delete_mac(struct wlan_iface *wif, struct wlan_mac_mac *wmm) in wlan_mac_delete_mac() argument
3951 wlan_del_mac_acl_mac(wif, wmm) < 0) in wlan_mac_delete_mac()
3954 SLIST_REMOVE(&wif->mac_maclist, wmm, wlan_mac_mac, wm); in wlan_mac_delete_mac()
3963 struct wlan_iface *wif; in wlan_mac_update_aclmacs() local
3969 for (wif = wlan_first_interface(); wif != NULL; in wlan_mac_update_aclmacs()
3970 wif = wlan_next_interface(wif)) { in wlan_mac_update_aclmacs()
3971 if (wif->status != RowStatus_active) in wlan_mac_update_aclmacs()
3977 SLIST_FOREACH_SAFE(wmm, &wif->mac_maclist, wm, twmm) in wlan_mac_update_aclmacs()
3979 SLIST_REMOVE(&wif->mac_maclist, wmm, in wlan_mac_update_aclmacs()
3983 (void)wlan_get_mac_acl_macs(wif); in wlan_mac_update_aclmacs()
3989 wlan_get_acl_mac(const struct asn_oid *oid, uint sub, struct wlan_iface **wif) in wlan_get_acl_mac() argument
3997 if ((*wif = wlan_find_interface(wname)) == NULL) in wlan_get_acl_mac()
4000 return (wlan_mac_find_mac(*wif, mac)); in wlan_get_acl_mac()
4005 struct wlan_iface **wif) in wlan_get_next_acl_mac() argument
4012 for (*wif = wlan_first_interface(); *wif != NULL; in wlan_get_next_acl_mac()
4013 *wif = wlan_next_interface(*wif)) { in wlan_get_next_acl_mac()
4014 wmm = SLIST_FIRST(&(*wif)->mac_maclist); in wlan_get_next_acl_mac()
4022 (*wif = wlan_find_interface(wname)) == NULL || in wlan_get_next_acl_mac()
4023 (wmm = wlan_mac_find_mac(*wif, mac)) == NULL) in wlan_get_next_acl_mac()
4029 while ((*wif = wlan_next_interface(*wif)) != NULL) in wlan_get_next_acl_mac()
4030 if ((wmm = SLIST_FIRST(&(*wif)->mac_maclist)) != NULL) in wlan_get_next_acl_mac()
4042 struct wlan_iface *wif; in wlan_acl_mac_set_status() local
4047 macl = wlan_get_acl_mac(&val->var, sub, &wif); in wlan_acl_mac_set_status()
4064 if (wif == NULL || !wif->macsupported) in wlan_acl_mac_set_status()
4072 if (wlan_mac_add_mac(wif, macl) < 0) { in wlan_acl_mac_set_status()
4078 if (wlan_add_mac_acl_mac(wif, macl) < 0) { in wlan_acl_mac_set_status()
4079 (void)wlan_mac_delete_mac(wif, macl); in wlan_acl_mac_set_status()
4092 struct wlan_iface *wif; in wlan_mesh_first_interface() local
4094 SLIST_FOREACH(wif, &wlan_ifaces, w_if) in wlan_mesh_first_interface()
4095 if (wif->mode == WlanIfaceOperatingModeType_meshPoint && in wlan_mesh_first_interface()
4096 wif->status == RowStatus_active) in wlan_mesh_first_interface()
4099 return (wif); in wlan_mesh_first_interface()
4103 wlan_mesh_next_interface(struct wlan_iface *wif) in wlan_mesh_next_interface() argument
4107 while ((nwif = wlan_next_interface(wif)) != NULL) { in wlan_mesh_next_interface()
4111 wif = nwif; in wlan_mesh_next_interface()
4120 struct wlan_iface *wif; in wlan_mesh_get_iface() local
4122 if ((wif = wlan_get_interface(oid, sub)) == NULL) in wlan_mesh_get_iface()
4125 if (wif->mode != WlanIfaceOperatingModeType_meshPoint) in wlan_mesh_get_iface()
4128 return (wif); in wlan_mesh_get_iface()
4136 struct wlan_iface *wif; in wlan_mesh_get_next_iface() local
4149 if ((wif = wlan_find_interface(wname)) == NULL) in wlan_mesh_get_next_iface()
4152 return (wlan_mesh_next_interface(wif)); in wlan_mesh_get_next_iface()
4159 wlan_mesh_get_peer(const struct asn_oid *oid, uint sub, struct wlan_iface **wif) in wlan_mesh_get_peer() argument
4167 if ((*wif = wlan_find_interface(wname)) == NULL || in wlan_mesh_get_peer()
4168 (*wif)->mode != WlanIfaceOperatingModeType_meshPoint) in wlan_mesh_get_peer()
4171 return (wlan_find_peer(*wif, pmac)); in wlan_mesh_get_peer()
4175 wlan_mesh_get_next_peer(const struct asn_oid *oid, uint sub, struct wlan_iface **wif) in wlan_mesh_get_next_peer() argument
4182 for (*wif = wlan_mesh_first_interface(); *wif != NULL; in wlan_mesh_get_next_peer()
4183 *wif = wlan_mesh_next_interface(*wif)) { in wlan_mesh_get_next_peer()
4184 wip = SLIST_FIRST(&(*wif)->peerlist); in wlan_mesh_get_next_peer()
4192 (*wif = wlan_find_interface(wname)) == NULL || in wlan_mesh_get_next_peer()
4193 (*wif)->mode != WlanIfaceOperatingModeType_meshPoint || in wlan_mesh_get_next_peer()
4194 (wip = wlan_find_peer(*wif, pmac)) == NULL) in wlan_mesh_get_next_peer()
4200 while ((*wif = wlan_mesh_next_interface(*wif)) != NULL) in wlan_mesh_get_next_peer()
4201 if ((wip = SLIST_FIRST(&(*wif)->peerlist)) != NULL) in wlan_mesh_get_next_peer()
4211 wlan_mesh_free_routes(struct wlan_iface *wif) in wlan_mesh_free_routes() argument
4215 while ((wmr = SLIST_FIRST(&wif->mesh_routelist)) != NULL) { in wlan_mesh_free_routes()
4216 SLIST_REMOVE_HEAD(&wif->mesh_routelist, wr); in wlan_mesh_free_routes()
4220 SLIST_INIT(&wif->mesh_routelist); in wlan_mesh_free_routes()
4224 wlan_mesh_find_route(struct wlan_iface *wif, uint8_t *dstmac) in wlan_mesh_find_route() argument
4228 if (wif->mode != WlanIfaceOperatingModeType_meshPoint) in wlan_mesh_find_route()
4231 SLIST_FOREACH(wmr, &wif->mesh_routelist, wr) in wlan_mesh_find_route()
4261 wlan_mesh_add_rtentry(struct wlan_iface *wif, struct wlan_mesh_route *wmr) in wlan_mesh_add_rtentry() argument
4265 SLIST_FOREACH(temp, &wif->mesh_routelist, wr) in wlan_mesh_add_rtentry()
4270 if ((prev = SLIST_FIRST(&wif->mesh_routelist)) == NULL || in wlan_mesh_add_rtentry()
4273 SLIST_INSERT_HEAD(&wif->mesh_routelist, wmr, wr); in wlan_mesh_add_rtentry()
4277 SLIST_FOREACH(temp, &wif->mesh_routelist, wr) { in wlan_mesh_add_rtentry()
4289 wlan_mesh_delete_route(struct wlan_iface *wif, struct wlan_mesh_route *wmr) in wlan_mesh_delete_route() argument
4292 wlan_mesh_del_route(wif, wmr) < 0) in wlan_mesh_delete_route()
4295 SLIST_REMOVE(&wif->mesh_routelist, wmr, wlan_mesh_route, wr); in wlan_mesh_delete_route()
4304 struct wlan_iface *wif; in wlan_mesh_update_routes() local
4310 for (wif = wlan_mesh_first_interface(); wif != NULL; in wlan_mesh_update_routes()
4311 wif = wlan_mesh_next_interface(wif)) { in wlan_mesh_update_routes()
4316 SLIST_FOREACH_SAFE(wmr, &wif->mesh_routelist, wr, twmr) in wlan_mesh_update_routes()
4318 SLIST_REMOVE(&wif->mesh_routelist, wmr, in wlan_mesh_update_routes()
4322 (void)wlan_mesh_get_routelist(wif); in wlan_mesh_update_routes()
4328 wlan_mesh_get_route(const struct asn_oid *oid, uint sub, struct wlan_iface **wif) in wlan_mesh_get_route() argument
4336 if ((*wif = wlan_find_interface(wname)) == NULL) in wlan_mesh_get_route()
4339 return (wlan_mesh_find_route(*wif, dstmac)); in wlan_mesh_get_route()
4344 struct wlan_iface **wif) in wlan_mesh_get_next_route() argument
4351 for (*wif = wlan_mesh_first_interface(); *wif != NULL; in wlan_mesh_get_next_route()
4352 *wif = wlan_mesh_next_interface(*wif)) { in wlan_mesh_get_next_route()
4353 wmr = SLIST_FIRST(&(*wif)->mesh_routelist); in wlan_mesh_get_next_route()
4361 (*wif = wlan_find_interface(wname)) == NULL || in wlan_mesh_get_next_route()
4362 (wmr = wlan_mesh_find_route(*wif, dstmac)) == NULL) in wlan_mesh_get_next_route()
4368 while ((*wif = wlan_mesh_next_interface(*wif)) != NULL) in wlan_mesh_get_next_route()
4369 if ((wmr = SLIST_FIRST(&(*wif)->mesh_routelist)) != NULL) in wlan_mesh_get_next_route()
4382 struct wlan_iface *wif; in wlan_mesh_route_set_status() local
4386 wmr = wlan_mesh_get_route(&val->var, sub, &wif); in wlan_mesh_route_set_status()
4402 if ((wif = wlan_find_interface(wname)) == NULL) in wlan_mesh_route_set_status()
4408 if (wlan_mesh_add_rtentry(wif, wmr) < 0) { in wlan_mesh_route_set_status()
4414 if (wlan_mesh_add_route(wif, wmr) < 0) { in wlan_mesh_route_set_status()
4415 (void)wlan_mesh_delete_route(wif, wmr); in wlan_mesh_route_set_status()
4495 struct wlan_iface *wif; in wlan_dump() local
4497 for (wif = wlan_first_interface(); wif != NULL; in wlan_dump()
4498 wif = wlan_next_interface(wif)) in wlan_dump()
4499 syslog(LOG_ERR, "wlan iface %s", wif->wname); in wlan_dump()