Lines Matching defs:wif

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