From b9b6bacc5f5af074802080c771e9657edddb8a95 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 11 Jun 2014 20:26:02 -0700 Subject: [PATCH] bug 1923: Patch for disabling active probe requests --- src/wifi/model/sta-wifi-mac.cc | 15 ++++++++++++--- src/wifi/model/sta-wifi-mac.h | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc index aafec75a8..b5d3b4ba7 100644 --- a/src/wifi/model/sta-wifi-mac.cc +++ b/src/wifi/model/sta-wifi-mac.cc @@ -84,7 +84,7 @@ StaWifiMac::GetTypeId (void) MakeUintegerChecker ()) .AddAttribute ("ActiveProbing", "If true, we send probe requests. If false, we don't. NOTE: if more than one STA in your simulation is using active probing, you should enable it at a different simulation time for each STA, otherwise all the STAs will start sending probes at the same time resulting in collisions. See bug 1060 for more info.", BooleanValue (false), - MakeBooleanAccessor (&StaWifiMac::SetActiveProbing), + MakeBooleanAccessor (&StaWifiMac::SetActiveProbing, &StaWifiMac::GetActiveProbing), MakeBooleanChecker ()) .AddTraceSource ("Assoc", "Associated with an access point.", MakeTraceSourceAccessor (&StaWifiMac::m_assocLogger)) @@ -152,6 +152,12 @@ StaWifiMac::SetActiveProbing (bool enable) { m_probeRequestEvent.Cancel (); } + m_activeProbing = enable; +} + +bool StaWifiMac::GetActiveProbing (void) const +{ + return m_activeProbing; } void @@ -250,8 +256,11 @@ StaWifiMac::TryToEnsureAssociated (void) * We try to initiate a probe request now. */ m_linkDown (); - SetState (WAIT_PROBE_RESP); - SendProbeRequest (); + if (m_activeProbing) + { + SetState (WAIT_PROBE_RESP); + SendProbeRequest (); + } break; case WAIT_ASSOC_RESP: /* we have sent an assoc request so we do not need to diff --git a/src/wifi/model/sta-wifi-mac.h b/src/wifi/model/sta-wifi-mac.h index 0d823a714..68d66939e 100644 --- a/src/wifi/model/sta-wifi-mac.h +++ b/src/wifi/model/sta-wifi-mac.h @@ -187,6 +187,7 @@ private: EventId m_beaconWatchdog; Time m_beaconWatchdogEnd; uint32_t m_maxMissedBeacons; + bool m_activeProbing; TracedCallback m_assocLogger; TracedCallback m_deAssocLogger;