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

Function rt_ieee80211msg

freebsd/net/rtsock.c:2014–2047  ·  view source on GitHub ↗

* This is called to generate routing socket messages indicating * IEEE80211 wireless events. * XXX we piggyback on the RTM_IFANNOUNCE msg format in a clumsy way. */

Source from the content-addressed store, hash-verified

2012 * XXX we piggyback on the RTM_IFANNOUNCE msg format in a clumsy way.
2013 */
2014void
2015rt_ieee80211msg(struct ifnet *ifp, int what, void *data, size_t data_len)
2016{
2017 struct mbuf *m;
2018 struct rt_addrinfo info;
2019
2020 m = rt_makeifannouncemsg(ifp, RTM_IEEE80211, what, &info);
2021 if (m != NULL) {
2022 /*
2023 * Append the ieee80211 data. Try to stick it in the
2024 * mbuf containing the ifannounce msg; otherwise allocate
2025 * a new mbuf and append.
2026 *
2027 * NB: we assume m is a single mbuf.
2028 */
2029 if (data_len > M_TRAILINGSPACE(m)) {
2030 struct mbuf *n = m_get(M_NOWAIT, MT_DATA);
2031 if (n == NULL) {
2032 m_freem(m);
2033 return;
2034 }
2035 bcopy(data, mtod(n, void *), data_len);
2036 n->m_len = data_len;
2037 m->m_next = n;
2038 } else if (data_len > 0) {
2039 bcopy(data, mtod(m, u_int8_t *) + m->m_len, data_len);
2040 m->m_len += data_len;
2041 }
2042 if (m->m_flags & M_PKTHDR)
2043 m->m_pkthdr.len += data_len;
2044 mtod(m, struct if_announcemsghdr *)->ifan_msglen += data_len;
2045 rt_dispatch(m, AF_UNSPEC);
2046 }
2047}
2048
2049/*
2050 * This is called to generate routing socket messages indicating

Callers 10

notify_macaddrFunction · 0.85
ieee80211_notify_csaFunction · 0.85
ieee80211_notify_radarFunction · 0.85
ieee80211_notify_cacFunction · 0.85
ieee80211_notify_countryFunction · 0.85
ieee80211_notify_radioFunction · 0.85

Calls 4

rt_makeifannouncemsgFunction · 0.85
rt_dispatchFunction · 0.85
m_getFunction · 0.50
m_freemFunction · 0.50

Tested by

no test coverage detected