View | Details | Raw Unified | Return to bug 2771
Collapse All | Expand All

(-)a/.gitignore (+3 lines)
 Lines 35-37    Link Here 
35
35
36
build-dir/
36
build-dir/
37
build/
37
build/
38
.hg/*
39
bindings/*
40
doc/*
(-)a/src/wifi/model/dca-txop.cc (+1 lines)
 Lines 253-258    Link Here 
253
void
253
void
254
DcaTxop::SetAifsn (uint32_t aifsn)
254
DcaTxop::SetAifsn (uint32_t aifsn)
255
{
255
{
256
    std::cout << "1aifsn " << aifsn << std::endl;
256
  NS_LOG_FUNCTION (this << aifsn);
257
  NS_LOG_FUNCTION (this << aifsn);
257
  m_dcf->SetAifsn (aifsn);
258
  m_dcf->SetAifsn (aifsn);
258
}
259
}
(-)a/src/wifi/model/dcf-manager.cc (+10 lines)
 Lines 55-60    Link Here 
55
void
55
void
56
DcfState::SetAifsn (uint32_t aifsn)
56
DcfState::SetAifsn (uint32_t aifsn)
57
{
57
{
58
    std::cout << "aifsn " << aifsn << std::endl;
58
  m_aifsn = aifsn;
59
  m_aifsn = aifsn;
59
}
60
}
60
61
 Lines 614-619    Link Here 
614
           * the result of the calculations.
615
           * the result of the calculations.
615
           */
616
           */
616
          state->NotifyAccessGranted ();
617
          state->NotifyAccessGranted ();
618
619
          std::cout << "SIFS " << m_sifs.GetNanoSeconds() <<
620
                  " AIFS " << state->GetAifsn () << " slot " << m_slotTimeUs*1000 <<
621
                   " DIFS " << m_sifs.GetNanoSeconds() + MicroSeconds (state->GetAifsn () * m_slotTimeUs).GetNanoSeconds() <<
622
                  "Backoff start: " << GetBackoffStartFor (state).As (Time::NS) <<
623
              " end: " << (GetBackoffStartFor (state) +
624
              NanoSeconds (state->GetBackoffSlots () * m_slotTimeUs * 1000)).As (Time::NS)  << " m_slotTimeNs " << m_slotTimeUs * 1000
625
			  << " backoffslots " << state->GetBackoffSlots () << std::endl;
626
617
          for (std::vector<DcfState *>::const_iterator k = internalCollisionStates.begin ();
627
          for (std::vector<DcfState *>::const_iterator k = internalCollisionStates.begin ();
618
               k != internalCollisionStates.end (); k++)
628
               k != internalCollisionStates.end (); k++)
619
            {
629
            {
(-)a/src/wifi/model/edca-txop-n.cc (-1 / +6 lines)
 Lines 405-410    Link Here 
405
void
405
void
406
EdcaTxopN::SetAifsn (uint32_t aifsn)
406
EdcaTxopN::SetAifsn (uint32_t aifsn)
407
{
407
{
408
    std::cout << "2aifsn " << aifsn << std::endl;
408
  NS_LOG_FUNCTION (this << aifsn);
409
  NS_LOG_FUNCTION (this << aifsn);
409
  m_dcf->SetAifsn (aifsn);
410
  m_dcf->SetAifsn (aifsn);
410
}
411
}
 Lines 1466-1474    Link Here 
1466
    {
1467
    {
1467
      retval = hdr.GetAddr2 ();
1468
      retval = hdr.GetAddr2 ();
1468
    }
1469
    }
1470
  else if (m_typeOfStation == AP)
1471
    {
1472
      retval = hdr.GetAddr3 ();
1473
    }
1469
  else
1474
  else
1470
    {
1475
    {
1471
      retval = hdr.GetAddr3 ();
1476
      retval = hdr.GetAddr4 ();
1472
    }
1477
    }
1473
  return retval;
1478
  return retval;
1474
}
1479
}
(-)a/src/wifi/model/edca-txop-n.h (+1 lines)
 Lines 64-69    Link Here 
64
  AP,
64
  AP,
65
  ADHOC_STA,
65
  ADHOC_STA,
66
  MESH,
66
  MESH,
67
  WDS,
67
  HT_STA,
68
  HT_STA,
68
  HT_AP,
69
  HT_AP,
69
  HT_ADHOC_STA,
70
  HT_ADHOC_STA,
(-)a/src/wifi/model/sta-wifi-mac.cc (+3 lines)
 Lines 552-557    Link Here 
552
              EdcaParameterSet edcaParameters = beacon.GetEdcaParameterSet ();
552
              EdcaParameterSet edcaParameters = beacon.GetEdcaParameterSet ();
553
              //The value of the TXOP Limit field is specified as an unsigned integer, with the least significant octet transmitted first, in units of 32 μs.
553
              //The value of the TXOP Limit field is specified as an unsigned integer, with the least significant octet transmitted first, in units of 32 μs.
554
              SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin(), edcaParameters.GetBeCWmax(), edcaParameters.GetBeAifsn(), 32 * MicroSeconds (edcaParameters.GetBeTXOPLimit()));
554
              SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin(), edcaParameters.GetBeCWmax(), edcaParameters.GetBeAifsn(), 32 * MicroSeconds (edcaParameters.GetBeTXOPLimit()));
555
555
              SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin(), edcaParameters.GetBkCWmax(), edcaParameters.GetBkAifsn(), 32 * MicroSeconds (edcaParameters.GetBkTXOPLimit()));
556
              SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin(), edcaParameters.GetBkCWmax(), edcaParameters.GetBkAifsn(), 32 * MicroSeconds (edcaParameters.GetBkTXOPLimit()));
556
              SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin(), edcaParameters.GetViCWmax(), edcaParameters.GetViAifsn(), 32 * MicroSeconds (edcaParameters.GetViTXOPLimit()));
557
              SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin(), edcaParameters.GetViCWmax(), edcaParameters.GetViAifsn(), 32 * MicroSeconds (edcaParameters.GetViTXOPLimit()));
557
              SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin(), edcaParameters.GetVoCWmax(), edcaParameters.GetVoAifsn(), 32 * MicroSeconds (edcaParameters.GetVoTXOPLimit()));
558
              SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin(), edcaParameters.GetVoCWmax(), edcaParameters.GetVoAifsn(), 32 * MicroSeconds (edcaParameters.GetVoTXOPLimit()));
 Lines 838-845    Link Here 
838
  Ptr<EdcaTxopN> edca = m_edca.find (ac)->second;
839
  Ptr<EdcaTxopN> edca = m_edca.find (ac)->second;
839
  edca->SetMinCw (cwMin);
840
  edca->SetMinCw (cwMin);
840
  edca->SetMaxCw (cwMax);
841
  edca->SetMaxCw (cwMax);
842
  std::cout << "3aifsn " << aifsn << std::endl;
841
  edca->SetAifsn (aifsn);
843
  edca->SetAifsn (aifsn);
842
  edca->SetTxopLimit (txopLimit);
844
  edca->SetTxopLimit (txopLimit);
845
  std::cout << "edca parameters ac " << ac << " cwMin " << uint32_t(cwMin) << " cwMax " << uint32_t(cwMax) << " aifsn " << uint32_t(aifsn) << " txopLimit " << txopLimit.GetNanoSeconds() << std::endl;
843
}
846
}
844
847
845
} //namespace ns3
848
} //namespace ns3
(-)a/src/wifi/model/wifi-phy.cc (+3 lines)
 Lines 836-841    Link Here 
836
    }
836
    }
837
  if (htFound)
837
  if (htFound)
838
    {
838
    {
839
//	  std::cout << "ht is found " << std::endl;
839
      // erase all HtMcs modes from deviceMcsSet
840
      // erase all HtMcs modes from deviceMcsSet
840
      size_t index = m_deviceMcsSet.size () - 1;
841
      size_t index = m_deviceMcsSet.size () - 1;
841
      for (std::vector<WifiMode>::reverse_iterator rit = m_deviceMcsSet.rbegin (); rit != m_deviceMcsSet.rend(); ++rit, --index)
842
      for (std::vector<WifiMode>::reverse_iterator rit = m_deviceMcsSet.rbegin (); rit != m_deviceMcsSet.rend(); ++rit, --index)
 Lines 845-850    Link Here 
845
              m_deviceMcsSet.erase (m_deviceMcsSet.begin () + index);
846
              m_deviceMcsSet.erase (m_deviceMcsSet.begin () + index);
846
            }
847
            }
847
        }
848
        }
849
      std::cout << "GetSupportedTxSpatialStreams " << int(GetSupportedTxSpatialStreams()) << std::endl;
848
      m_deviceMcsSet.push_back (WifiPhy::GetHtMcs0 ());
850
      m_deviceMcsSet.push_back (WifiPhy::GetHtMcs0 ());
849
      m_deviceMcsSet.push_back (WifiPhy::GetHtMcs1 ());
851
      m_deviceMcsSet.push_back (WifiPhy::GetHtMcs1 ());
850
      m_deviceMcsSet.push_back (WifiPhy::GetHtMcs2 ());
852
      m_deviceMcsSet.push_back (WifiPhy::GetHtMcs2 ());
 Lines 1163-1168    Link Here 
1163
WifiPhy::SetNumberOfTransmitAntennas (uint32_t tx)
1165
WifiPhy::SetNumberOfTransmitAntennas (uint32_t tx)
1164
{
1166
{
1165
  m_numberOfTransmitters = tx;
1167
  m_numberOfTransmitters = tx;
1168
//  std::cout << "tx " << tx << "GetSupportedTxSpatialStreams " << int(GetSupportedTxSpatialStreams()) << std::endl;
1166
  ConfigureHtDeviceMcsSet ();
1169
  ConfigureHtDeviceMcsSet ();
1167
}
1170
}
1168
1171
(-)a/src/wifi/model/yans-wifi-phy.cc (+62 lines)
 Lines 28-35    Link Here 
28
#include "ns3/assert.h"
28
#include "ns3/assert.h"
29
#include "ns3/log.h"
29
#include "ns3/log.h"
30
#include "ns3/double.h"
30
#include "ns3/double.h"
31
#include "ns3/pointer.h"
32
#include "ns3/trace-source-accessor.h"
31
#include "ampdu-tag.h"
33
#include "ampdu-tag.h"
32
#include <cmath>
34
#include <cmath>
35
#include <fstream>
36
33
37
34
namespace ns3 {
38
namespace ns3 {
35
39
 Lines 44-56    Link Here 
44
    .SetParent<WifiPhy> ()
48
    .SetParent<WifiPhy> ()
45
    .SetGroupName ("Wifi")
49
    .SetGroupName ("Wifi")
46
    .AddConstructor<YansWifiPhy> ()
50
    .AddConstructor<YansWifiPhy> ()
51
    .AddTraceSource ("MonitorSnifferTxwDuration",
52
                     "Trace source simulating the capability of a wifi device "
53
                     "in monitor mode to sniff all frames being transmitted",
54
                     MakeTraceSourceAccessor (&YansWifiPhy::m_phyMonitorSniffTxTracewDuration),
55
                     "ns3::YansWifiPhy::MonitorSnifferTxTracedCallbackwDuration")
56
    .AddTraceSource ("MonitorSnifferRxwDuration",
57
                     "Trace source simulating the capability of a wifi device "
58
                     "in monitor mode to sniff all frames being transmitted",
59
                     MakeTraceSourceAccessor (&YansWifiPhy::m_phyMonitorSniffRxTracewDuration),
60
                     "ns3::YansWifiPhy::MonitorSnifferRxTracedCallbackwDuration")
47
  ;
61
  ;
48
  return tid;
62
  return tid;
49
}
63
}
50
64
51
YansWifiPhy::YansWifiPhy ()
65
YansWifiPhy::YansWifiPhy ()
52
{
66
{
67
	std::cout << "YansWifiPhy" << std::endl;
53
  NS_LOG_FUNCTION (this);
68
  NS_LOG_FUNCTION (this);
69
  m_firstWrite = true;
54
}
70
}
55
71
56
YansWifiPhy::~YansWifiPhy ()
72
YansWifiPhy::~YansWifiPhy ()
 Lines 508-513    Link Here 
508
  aMpdu.type = mpdutype;
524
  aMpdu.type = mpdutype;
509
  aMpdu.mpduRefNumber = m_txMpduReferenceNumber;
525
  aMpdu.mpduRefNumber = m_txMpduReferenceNumber;
510
  NotifyMonitorSniffTx (packet, (uint16_t)GetFrequency (), GetChannelNumber (), dataRate500KbpsUnits, preamble, txVector, aMpdu);
526
  NotifyMonitorSniffTx (packet, (uint16_t)GetFrequency (), GetChannelNumber (), dataRate500KbpsUnits, preamble, txVector, aMpdu);
527
  NotifyMonitorSniffTxwDuration (packet, this->GetDevice()->GetNode()->GetId(), GetChannelNumber (), dataRate500KbpsUnits, preamble, txVector, aMpdu, txDuration);
511
  m_state->SwitchToTx (txDuration, packet, GetPowerDbm (txVector.GetTxPowerLevel ()), txVector, preamble);
528
  m_state->SwitchToTx (txDuration, packet, GetPowerDbm (txVector.GetTxPowerLevel ()), txVector, preamble);
512
  m_channel->Send (this, packet, GetPowerDbm (txVector.GetTxPowerLevel ()) + GetTxGain (), txVector, preamble, mpdutype, txDuration);
529
  m_channel->Send (this, packet, GetPowerDbm (txVector.GetTxPowerLevel ()) + GetTxGain (), txVector, preamble, mpdutype, txDuration);
513
}
530
}
 Lines 531-536    Link Here 
531
  NS_ASSERT (IsStateRx ());
548
  NS_ASSERT (IsStateRx ());
532
  NS_ASSERT (event->GetEndTime () == Simulator::Now ());
549
  NS_ASSERT (event->GetEndTime () == Simulator::Now ());
533
550
551
  std::ofstream RssiThroughputTraceFile;
552
534
  struct InterferenceHelper::SnrPer snrPer;
553
  struct InterferenceHelper::SnrPer snrPer;
535
  snrPer = m_interference.CalculatePlcpPayloadSnrPer (event);
554
  snrPer = m_interference.CalculatePlcpPayloadSnrPer (event);
536
  m_interference.NotifyRxEnd ();
555
  m_interference.NotifyRxEnd ();
 Lines 555-564    Link Here 
555
          struct signalNoiseDbm signalNoise;
574
          struct signalNoiseDbm signalNoise;
556
          signalNoise.signal = RatioToDb (event->GetRxPowerW ()) + 30;
575
          signalNoise.signal = RatioToDb (event->GetRxPowerW ()) + 30;
557
          signalNoise.noise = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNoiseFigure () + 30;
576
          signalNoise.noise = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNoiseFigure () + 30;
577
          NS_LOG_DEBUG ("linear rxpower=" << event->GetRxPowerW() << " linear noise " << event->GetRxPowerW () / snrPer.snr);
578
          NS_LOG_DEBUG ("db rxpower=" << signalNoise.signal << " db noise " << signalNoise.noise);
579
          if (preamble >= 4) {
580
        	  std::string filename = "RssiVsThroughputminstrelap3sta2.txt";
581
        	  if (m_firstWrite == true)
582
        	    {
583
        		  RssiThroughputTraceFile.open (filename.c_str());
584
        	      if (!RssiThroughputTraceFile.is_open ())
585
        	        {
586
        	          NS_LOG_ERROR ("Can't open file " << filename.c_str ());
587
        	          return;
588
        	        }
589
        	      m_firstWrite = false;
590
        	      RssiThroughputTraceFile.close ();
591
        	    }
592
        	  else {
593
        		  RssiThroughputTraceFile.open (filename.c_str (), std::ios_base::app);
594
        	      if (!RssiThroughputTraceFile.is_open ())
595
        	        {
596
        	          NS_LOG_ERROR ("Can't open file " << filename.c_str ());
597
        	          return;
598
        	        }
599
        	      RssiThroughputTraceFile<< signalNoise.signal << " " << (event->GetPayloadMode ().GetDataRate (event->GetTxVector ())) << std::endl;
600
        	  }
601
//        	  std::cout << signalNoise.signal << " " << (event->GetPayloadMode ().GetDataRate (event->GetTxVector ())) << std::endl;
602
        	  RssiThroughputTraceFile.close ();
603
          }
558
          struct mpduInfo aMpdu;
604
          struct mpduInfo aMpdu;
559
          aMpdu.type = mpdutype;
605
          aMpdu.type = mpdutype;
560
          aMpdu.mpduRefNumber = m_rxMpduReferenceNumber;
606
          aMpdu.mpduRefNumber = m_rxMpduReferenceNumber;
561
          NotifyMonitorSniffRx (packet, (uint16_t)GetFrequency (), GetChannelNumber (), dataRate500KbpsUnits, event->GetPreambleType (), event->GetTxVector (), aMpdu, signalNoise);
607
          NotifyMonitorSniffRx (packet, (uint16_t)GetFrequency (), GetChannelNumber (), dataRate500KbpsUnits, event->GetPreambleType (), event->GetTxVector (), aMpdu, signalNoise);
608
          Time txDuration = CalculateTxDuration (packet->GetSize (), event->GetTxVector (), preamble, GetFrequency (), mpdutype, 1);
609
          NS_ASSERT (txDuration > NanoSeconds (0));
610
          NotifyMonitorSniffRxwDuration (packet, this->GetDevice()->GetNode()->GetId(), GetChannelNumber (), dataRate500KbpsUnits, preamble, event->GetTxVector (), aMpdu, txDuration);
562
          m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetTxVector (), event->GetPreambleType ());
611
          m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetTxVector (), event->GetPreambleType ());
563
        }
612
        }
564
      else
613
      else
 Lines 579-582    Link Here 
579
    }
628
    }
580
}
629
}
581
630
631
void
632
YansWifiPhy::NotifyMonitorSniffTxwDuration (Ptr<const Packet> packet, uint32_t id, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu, Time txDuration)
633
{
634
  m_phyMonitorSniffTxTracewDuration (packet, id, channelNumber, rate, preamble, txVector, aMpdu, txDuration);
635
}
636
637
void
638
YansWifiPhy::NotifyMonitorSniffRxwDuration (Ptr<const Packet> packet, uint32_t id, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu, Time txDuration)
639
{
640
  m_phyMonitorSniffRxTracewDuration (packet, id, channelNumber, rate, preamble, txVector, aMpdu, txDuration);
641
}
642
643
582
} //namespace ns3
644
} //namespace ns3
(-)a/src/wifi/model/yans-wifi-phy.h (+111 lines)
 Lines 100-105    Link Here 
100
  virtual void ResumeFromSleep (void);
100
  virtual void ResumeFromSleep (void);
101
  virtual Ptr<WifiChannel> GetChannel (void) const;
101
  virtual Ptr<WifiChannel> GetChannel (void) const;
102
102
103
  /**
104
   * Public method used to fire a MonitorSniffer trace for a wifi packet being transmitted.
105
   * Implemented for encapsulation purposes.
106
   *
107
   * \param packet the packet being transmitted
108
   * \param channelFreqMhz the frequency in MHz at which the packet is
109
   *        transmitted.
110
   * \param channelNumber the channel on which the packet is transmitted
111
   * \param rate the PHY data rate in units of 500kbps (i.e., the same
112
   *        units used both for the radiotap and for the prism header)
113
   * \param preamble the preamble of the packet
114
   * \param txVector the TXVECTOR that holds tx parameters
115
   * \param aMpdu the type of the packet (0 is not A-MPDU, 1 is a MPDU that is part of an A-MPDU and 2 is the last MPDU in an A-MPDU)
116
   *        and the A-MPDU reference number (must be a different value for each A-MPDU but the same for each subframe within one A-MPDU)
117
   */
118
  void NotifyMonitorSniffTxwDuration (Ptr<const Packet> packet, uint32_t id,
119
                             uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
120
                             WifiTxVector txVector, struct mpduInfo aMpdu, Time txDuration);
121
122
  /**
123
   * TracedCallback signature for monitor mode transmit events.
124
   *
125
   * \param packet the packet being transmitted
126
   * \param channelFreqMhz the frequency in MHz at which the packet is
127
   *        transmitted.
128
   * \param channelNumber the channel on which the packet is transmitted
129
   * \param rate the PHY data rate in units of 500kbps (i.e., the same
130
   *        units used both for the radiotap and for the prism header)
131
   * \param preamble the preamble of the packet
132
   * \param txVector the TXVECTOR that holds tx parameters
133
   * \param aMpdu the type of the packet (0 is not A-MPDU, 1 is a MPDU that is part of an A-MPDU and 2 is the last MPDU in an A-MPDU)
134
   *        and the A-MPDU reference number (must be a different value for each A-MPDU but the same for each subframe within one A-MPDU)
135
   * \todo WifiTxVector should be passed by const reference because
136
   * of its size.
137
   */
138
  typedef void (* MonitorSnifferTxCallbackwDuration)(const Ptr<const Packet> packet, uint32_t id,
139
                                            uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
140
                                            WifiTxVector txVector, struct mpduInfo aMpdu, Time txDuration);
141
142
  /**
143
   * A trace source that emulates a wifi device in monitor mode
144
   * sniffing a packet being transmitted.
145
   *
146
   * As a reference with the real world, firing this trace
147
   * corresponds in the madwifi driver to calling the function
148
   * ieee80211_input_monitor()
149
   *
150
   * \see class CallBackTraceSource
151
   * \todo WifiTxVector should be passed by const reference because
152
   * of its size.
153
   */
154
  TracedCallback<Ptr<const Packet>, uint32_t, uint16_t, uint32_t,
155
                 WifiPreamble, WifiTxVector, struct mpduInfo, Time> m_phyMonitorSniffTxTracewDuration;
156
157
  /**
158
   * Public method used to fire a MonitorSniffer trace for a wifi packet being transmitted.
159
   * Implemented for encapsulation purposes.
160
   *
161
   * \param packet the packet being transmitted
162
   * \param channelFreqMhz the frequency in MHz at which the packet is
163
   *        transmitted.
164
   * \param channelNumber the channel on which the packet is transmitted
165
   * \param rate the PHY data rate in units of 500kbps (i.e., the same
166
   *        units used both for the radiotap and for the prism header)
167
   * \param preamble the preamble of the packet
168
   * \param txVector the TXVECTOR that holds tx parameters
169
   * \param aMpdu the type of the packet (0 is not A-MPDU, 1 is a MPDU that is part of an A-MPDU and 2 is the last MPDU in an A-MPDU)
170
   *        and the A-MPDU reference number (must be a different value for each A-MPDU but the same for each subframe within one A-MPDU)
171
   */
172
  void NotifyMonitorSniffRxwDuration (Ptr<const Packet> packet, uint32_t id,
173
                             uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
174
                             WifiTxVector txVector, struct mpduInfo aMpdu, Time txDuration);
175
176
  /**
177
   * TracedCallback signature for monitor mode transmit events.
178
   *
179
   * \param packet the packet being transmitted
180
   * \param channelFreqMhz the frequency in MHz at which the packet is
181
   *        transmitted.
182
   * \param channelNumber the channel on which the packet is transmitted
183
   * \param rate the PHY data rate in units of 500kbps (i.e., the same
184
   *        units used both for the radiotap and for the prism header)
185
   * \param preamble the preamble of the packet
186
   * \param txVector the TXVECTOR that holds tx parameters
187
   * \param aMpdu the type of the packet (0 is not A-MPDU, 1 is a MPDU that is part of an A-MPDU and 2 is the last MPDU in an A-MPDU)
188
   *        and the A-MPDU reference number (must be a different value for each A-MPDU but the same for each subframe within one A-MPDU)
189
   * \todo WifiTxVector should be passed by const reference because
190
   * of its size.
191
   */
192
  typedef void (* MonitorSnifferRxCallbackwDuration)(const Ptr<const Packet> packet, uint32_t id,
193
                                            uint16_t channelNumber, uint32_t rate, WifiPreamble preamble,
194
                                            WifiTxVector txVector, struct mpduInfo aMpdu, Time txDuration);
195
196
  /**
197
   * A trace source that emulates a wifi device in monitor mode
198
   * sniffing a packet being transmitted.
199
   *
200
   * As a reference with the real world, firing this trace
201
   * corresponds in the madwifi driver to calling the function
202
   * ieee80211_input_monitor()
203
   *
204
   * \see class CallBackTraceSource
205
   * \todo WifiTxVector should be passed by const reference because
206
   * of its size.
207
   */
208
  TracedCallback<Ptr<const Packet>, uint32_t, uint16_t, uint32_t,
209
                 WifiPreamble, WifiTxVector, struct mpduInfo, Time> m_phyMonitorSniffRxTracewDuration;
210
211
  Ptr<WifiPhyStateHelper> m_YansState;     //!< Pointer to WifiPhyStateHelper
103
protected:
212
protected:
104
  // Inherited
213
  // Inherited
105
  virtual void DoDispose (void);
214
  virtual void DoDispose (void);
 Lines 118-123    Link Here 
118
  void EndReceive (Ptr<Packet> packet, enum WifiPreamble preamble, enum mpduType mpdutype, Ptr<InterferenceHelper::Event> event);
227
  void EndReceive (Ptr<Packet> packet, enum WifiPreamble preamble, enum mpduType mpdutype, Ptr<InterferenceHelper::Event> event);
119
228
120
  Ptr<YansWifiChannel> m_channel;        //!< YansWifiChannel that this YansWifiPhy is connected to
229
  Ptr<YansWifiChannel> m_channel;        //!< YansWifiChannel that this YansWifiPhy is connected to
230
231
  bool m_firstWrite;
121
};
232
};
122
233
123
} //namespace ns3
234
} //namespace ns3
(-)a/src/wifi/wscript (+2 lines)
 Lines 40-45    Link Here 
40
        'model/ap-wifi-mac.cc',
40
        'model/ap-wifi-mac.cc',
41
        'model/sta-wifi-mac.cc',
41
        'model/sta-wifi-mac.cc',
42
        'model/adhoc-wifi-mac.cc',
42
        'model/adhoc-wifi-mac.cc',
43
        'model/wds-wifi-mac.cc',
43
        'model/wifi-net-device.cc',
44
        'model/wifi-net-device.cc',
44
        'model/arf-wifi-manager.cc',
45
        'model/arf-wifi-manager.cc',
45
        'model/aarf-wifi-manager.cc',
46
        'model/aarf-wifi-manager.cc',
 Lines 127-132    Link Here 
127
        'model/ap-wifi-mac.h',
128
        'model/ap-wifi-mac.h',
128
        'model/sta-wifi-mac.h',
129
        'model/sta-wifi-mac.h',
129
        'model/adhoc-wifi-mac.h',
130
        'model/adhoc-wifi-mac.h',
131
        'model/wds-wifi-mac.h',
130
        'model/arf-wifi-manager.h',
132
        'model/arf-wifi-manager.h',
131
        'model/aarf-wifi-manager.h',
133
        'model/aarf-wifi-manager.h',
132
        'model/ideal-wifi-manager.h',
134
        'model/ideal-wifi-manager.h',

Return to bug 2771