OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2005,2006 INRIA | 3 * Copyright (c) 2005,2006 INRIA |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 NotifyRxEnd (packet); | 787 NotifyRxEnd (packet); |
788 uint32_t rate = event->GetPayloadMode ().GetDataRate () / 500000; | 788 uint32_t rate = event->GetPayloadMode ().GetDataRate () / 500000; |
789 bool isShortPreamble = (WIFI_PREAMBLE_SHORT == event->GetPreambleType ()); | 789 bool isShortPreamble = (WIFI_PREAMBLE_SHORT == event->GetPreambleType ()); |
790 double signalDbm = RatioToDb (event->GetRxPowerW ()) + 30; | 790 double signalDbm = RatioToDb (event->GetRxPowerW ()) + 30; |
791 double noiseDbm = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNo
iseFigure () + 30; | 791 double noiseDbm = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNo
iseFigure () + 30; |
792 uint8_t frameFlags = RadiotapHeader::FRAME_FLAG_NONE; | 792 uint8_t frameFlags = RadiotapHeader::FRAME_FLAG_NONE; |
793 Ptr<Packet> p = packet->Copy (); | 793 Ptr<Packet> p = packet->Copy (); |
794 WifiMacHeader wifimacheader; | 794 WifiMacHeader wifimacheader; |
795 p->RemoveHeader (wifimacheader); | 795 p->RemoveHeader (wifimacheader); |
796 | 796 |
797 if (!wifimacheader.IsCts () || !wifimacheader.IsRts () || !wifimacheader.I
sAck ()) | 797 // The real-time control frames for monitor devices shouldn't have radiota
p headers |
| 798 // Thus, we can check for data and mgt headers for this purpose |
| 799 |
| 800 if (wifimacheader.IsData () || wifimacheader.IsMgt ()) |
798 { | 801 { |
799 RadiotapHeader header; | 802 RadiotapHeader header; |
800 header.SetTsft (Simulator::Now ().GetMicroSeconds ()); | 803 header.SetTsft (Simulator::Now ().GetMicroSeconds ()); |
801 | 804 |
802 frameFlags |= RadiotapHeader::FRAME_FLAG_FCS_INCLUDED; | 805 frameFlags |= RadiotapHeader::FRAME_FLAG_FCS_INCLUDED; |
803 | 806 |
804 if (isShortPreamble) | 807 if (isShortPreamble) |
805 { | 808 { |
806 frameFlags |= RadiotapHeader::FRAME_FLAG_SHORT_PREAMBLE; | 809 frameFlags |= RadiotapHeader::FRAME_FLAG_SHORT_PREAMBLE; |
807 } | 810 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 } | 848 } |
846 } | 849 } |
847 else | 850 else |
848 { | 851 { |
849 /* failure. */ | 852 /* failure. */ |
850 NotifyRxDrop (packet); | 853 NotifyRxDrop (packet); |
851 m_state->SwitchFromRxEndError (packet, snrPer.snr); | 854 m_state->SwitchFromRxEndError (packet, snrPer.snr); |
852 } | 855 } |
853 } | 856 } |
854 } // namespace ns3 | 857 } // namespace ns3 |
OLD | NEW |