diff --git a/click_binary_file/click_for_AR71xx b/click_binary_file/click_for_AR71xx index 77f7c0f..a2ee4d4 100644 Binary files a/click_binary_file/click_for_AR71xx and b/click_binary_file/click_for_AR71xx differ diff --git a/src/odinagent.cc b/src/odinagent.cc index 82a7208..5f1ce97 100644 --- a/src/odinagent.cc +++ b/src/odinagent.cc @@ -67,8 +67,8 @@ OdinAgent::OdinAgent() _tx_power(0), _hidden(0), _multichannel_agents(1), - _interval_ms_default(100), // Inter-Beacon Interval for normal mode - _interval_ms_burst(10) // Inter-Beacon Interval for burst mode + _interval_ms_default(10), // Inter-Beacon Interval for normal mode + _interval_ms_burst(10) // Inter-Beacon Interval for burst mode { _clean_stats_timer.assign(&cleanup_lvap, (void *) this); _general_timer.assign (&misc_thread, (void *) this); @@ -1456,6 +1456,7 @@ OdinAgent::update_tx_stats(Packet *p) // store the timestamp of this packet as the one of the last packet stat._time_last_packet.assign_now(); + stat._equipment = "AP"; /* if (_debug_level % 10 > 1){ @@ -1531,6 +1532,17 @@ OdinAgent::update_rx_stats(Packet *p) fclose(fp); } */ + + uint8_t fromDs; + + fromDs = w->i_fc[1] & WIFI_FC1_DIR_FROMDS; + + if (fromDs == WIFI_FC1_DIR_FROMDS) { + stat._equipment = "AP"; + + }else{ + stat._equipment = "STA"; + } match_against_subscriptions(stat, src); // update the statistics table @@ -1592,6 +1604,17 @@ OdinAgent::update_scanned_station_stats(Packet *p) // store the timestamp of this packet as the one of the last packet stat._time_last_packet.assign_now(); + uint8_t fromDs; + + fromDs = w->i_fc[1] & WIFI_FC1_DIR_FROMDS; + + if (fromDs == WIFI_FC1_DIR_FROMDS) { + stat._equipment = "AP"; + + }else{ + stat._equipment = "STA"; + } + // update the statistics table _scanned_station_stats.set (src, stat); } @@ -2117,7 +2140,9 @@ OdinAgent::read_handler(Element *e, void *user_data) sa << " air_time:" << n._air_time; // time in seconds sa << " first_received:" << n._time_first_packet; // time in long format - sa << " last_received:" << n._time_last_packet << "\n"; // time in long format + sa << " last_received:" << n._time_last_packet; // time in long format + + sa << " equipment:" << n._equipment << "\n"; // type of equipment stats_time = n._time_last_packet; agent->_tx_stats.find(iter.key()).value() = reset_stats; @@ -2150,7 +2175,9 @@ OdinAgent::read_handler(Element *e, void *user_data) sa << " air_time:" << n._air_time; // time in seconds sa << " first_received:" << n._time_first_packet; // time in long format - sa << " last_received:" << n._time_last_packet << "\n"; // time in long format + sa << " last_received:" << n._time_last_packet; // time in long format + + sa << " equipment:" << n._equipment << "\n"; // type of equipment stats_time = n._time_last_packet; agent->_rx_stats.find(iter.key()).value() = reset_stats; @@ -2219,7 +2246,9 @@ OdinAgent::read_handler(Element *e, void *user_data) sa << " air_time:" << n._air_time; // time in seconds sa << " first_received:" << n._time_first_packet; // time in long format - sa << " last_received:" << n._time_last_packet << "\n"; // time in long format + sa << " last_received:" << n._time_last_packet; // time in long format + + sa << " equipment:" << n._equipment << "\n"; // type of equipment } } @@ -3059,4 +3088,4 @@ OdinAgent::convert_channel_to_frequency(int chan) { CLICK_ENDDECLS EXPORT_ELEMENT(OdinAgent) -ELEMENT_REQUIRES(userlevel) \ No newline at end of file +ELEMENT_REQUIRES(userlevel) diff --git a/src/odinagent.hh b/src/odinagent.hh index 62a97e2..04bdbd0 100644 --- a/src/odinagent.hh +++ b/src/odinagent.hh @@ -155,6 +155,7 @@ public: double _air_time; //airtime consumed by this STA, calculated as 8 * _len_pkt / _rate Timestamp _time_first_packet; //timestamp of the first packet included in the statistics Timestamp _time_last_packet; //timestamp of the last packet included in the statistics + String _equipment; //identify the equipment that transmit StationStats() { memset(this, 0, sizeof(*this)); } @@ -261,4 +262,4 @@ private: CLICK_ENDDECLS -#endif \ No newline at end of file +#endif