Changeset View
Changeset View
Standalone View
Standalone View
sys/net80211/ieee80211_monitor.c
| Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
| #include <net/bpf.h> | #include <net/bpf.h> | ||||
| #include <net80211/ieee80211_var.h> | #include <net80211/ieee80211_var.h> | ||||
| #include <net80211/ieee80211_monitor.h> | #include <net80211/ieee80211_monitor.h> | ||||
| static void monitor_vattach(struct ieee80211vap *); | static void monitor_vattach(struct ieee80211vap *); | ||||
| static int monitor_newstate(struct ieee80211vap *, enum ieee80211_state, int); | static int monitor_newstate(struct ieee80211vap *, enum ieee80211_state, int); | ||||
| static int monitor_input(struct ieee80211_node *ni, struct mbuf *m, | static int monitor_input(struct ieee80211_node *ni, struct mbuf *m, | ||||
| const struct ieee80211_rx_stats *rxs, int rssi, int nf); | const struct ieee80211_rx_stats *rxs, net80211_rssi_t rssi, int nf); | ||||
| void | void | ||||
| ieee80211_monitor_attach(struct ieee80211com *ic) | ieee80211_monitor_attach(struct ieee80211com *ic) | ||||
| { | { | ||||
| ic->ic_vattach[IEEE80211_M_MONITOR] = monitor_vattach; | ic->ic_vattach[IEEE80211_M_MONITOR] = monitor_vattach; | ||||
| } | } | ||||
| void | void | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | monitor_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| /* | /* | ||||
| * Process a received frame in monitor mode. | * Process a received frame in monitor mode. | ||||
| */ | */ | ||||
| static int | static int | ||||
| monitor_input(struct ieee80211_node *ni, struct mbuf *m, | monitor_input(struct ieee80211_node *ni, struct mbuf *m, | ||||
| const struct ieee80211_rx_stats *rxs, int rssi, int nf) | const struct ieee80211_rx_stats *rxs, net80211_rssi_t rssi, int nf) | ||||
| { | { | ||||
| struct ieee80211vap *vap = ni->ni_vap; | struct ieee80211vap *vap = ni->ni_vap; | ||||
| struct ifnet *ifp = vap->iv_ifp; | struct ifnet *ifp = vap->iv_ifp; | ||||
| if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); | if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); | ||||
| if (ieee80211_radiotap_active_vap(vap)) | if (ieee80211_radiotap_active_vap(vap)) | ||||
| ieee80211_radiotap_rx(vap, m); | ieee80211_radiotap_rx(vap, m); | ||||
| m_freem(m); | m_freem(m); | ||||
| return -1; | return -1; | ||||
| } | } | ||||