Ticket #1019: node-stats-notify.diff
| File node-stats-notify.diff, 1.8 kB (added by matt@mattb.net.nz, 5 years ago) |
|---|
-
net80211/ieee80211_node.c
old new 1967 1967 */ 1968 1968 if (vap->iv_auth->ia_node_leave != NULL) 1969 1969 vap->iv_auth->ia_node_leave(ni); 1970 ieee80211_notify_sta_stats(ni); 1970 1971 1971 1972 IEEE80211_LOCK_IRQ(ic); 1972 1973 if (vap->iv_aid_bitmap != NULL) -
net80211/ieee80211_linux.c
old new 236 236 } 237 237 } 238 238 239 void 240 ieee80211_notify_sta_stats(struct ieee80211_node *ni) 241 { 242 struct ieee80211vap *vap = ni->ni_vap; 243 static const char *tag = "STA-TRAFFIC-STAT"; 244 struct net_device *dev = vap->iv_dev; 245 union iwreq_data wreq; 246 char buf[1024]; 247 248 snprintf(buf, sizeof(buf), "%s\nmac=%s\nrx_packets=%u\nrx_bytes=%llu\n" 249 "tx_packets=%u\ntx_bytes=%llu\n", tag, 250 ether_sprintf(ni->ni_macaddr), ni->ni_stats.ns_rx_data, 251 ni->ni_stats.ns_rx_bytes, ni->ni_stats.ns_tx_data, 252 ni->ni_stats.ns_tx_bytes); 253 memset(&wreq, 0, sizeof(wreq)); 254 wreq.data.length = strlen(buf); 255 wireless_send_event(dev, IWEVCUSTOM, &wreq, buf); 256 } 257 239 258 void 240 259 ieee80211_notify_scan_done(struct ieee80211vap *vap) 241 260 { -
net80211/ieee80211_proto.h
old new 295 295 void ieee80211_notify_node_join(struct ieee80211_node *, int); 296 296 void ieee80211_notify_node_leave(struct ieee80211_node *); 297 297 void ieee80211_notify_scan_done(struct ieee80211vap *); 298 void ieee80211_notify_sta_stats(struct ieee80211_node *ni); 299 298 300 #endif /* _NET80211_IEEE80211_PROTO_H_ */
