MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ieee80211_tmp_node

Function ieee80211_tmp_node

freebsd/net80211/ieee80211_node.c:1443–1488  ·  view source on GitHub ↗

* Craft a temporary node suitable for sending a management frame * to the specified station. We craft only as much state as we * need to do the work since the node will be immediately reclaimed * once the send completes. */

Source from the content-addressed store, hash-verified

1441 * once the send completes.
1442 */
1443struct ieee80211_node *
1444ieee80211_tmp_node(struct ieee80211vap *vap,
1445 const uint8_t macaddr[IEEE80211_ADDR_LEN])
1446{
1447 struct ieee80211com *ic = vap->iv_ic;
1448 struct ieee80211_node *ni;
1449
1450 ni = ic->ic_node_alloc(vap, macaddr);
1451 if (ni != NULL) {
1452 struct ieee80211_node *bss = vap->iv_bss;
1453
1454 IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE,
1455 "%s %p<%s>\n", __func__, ni, ether_sprintf(macaddr));
1456
1457 ni->ni_table = NULL; /* NB: pedantic */
1458 ni->ni_ic = ic; /* NB: needed to set channel */
1459 ni->ni_vap = vap;
1460
1461 IEEE80211_ADDR_COPY(ni->ni_macaddr, macaddr);
1462 IEEE80211_ADDR_COPY(ni->ni_bssid, bss->ni_bssid);
1463 ieee80211_node_initref(ni); /* mark referenced */
1464 /* NB: required by ieee80211_fix_rate */
1465 ieee80211_node_set_chan(ni, bss->ni_chan);
1466 ieee80211_crypto_resetkey(vap, &ni->ni_ucastkey,
1467 IEEE80211_KEYIX_NONE);
1468 ni->ni_txpower = bss->ni_txpower;
1469 /* XXX optimize away */
1470 ieee80211_psq_init(&ni->ni_psq, "unknown");
1471
1472 ieee80211_ratectl_node_init(ni);
1473
1474 /* handle failure; free node state */
1475 if (ic->ic_node_init(ni) != 0) {
1476 vap->iv_stats.is_rx_nodealloc++;
1477 ieee80211_psq_cleanup(&ni->ni_psq);
1478 ieee80211_ratectl_node_deinit(ni);
1479 _ieee80211_free_node(ni);
1480 return NULL;
1481 }
1482
1483 } else {
1484 /* XXX msg */
1485 vap->iv_stats.is_rx_nodealloc++;
1486 }
1487 return ni;
1488}
1489
1490struct ieee80211_node *
1491ieee80211_dup_bss(struct ieee80211vap *vap,

Callers 1

ieee80211_send_errorFunction · 0.85

Calls 8

ether_sprintfFunction · 0.85
ieee80211_node_set_chanFunction · 0.85
ieee80211_psq_initFunction · 0.85
ieee80211_psq_cleanupFunction · 0.85
_ieee80211_free_nodeFunction · 0.85

Tested by

no test coverage detected