diff --git a/src/devices/wifi/mac-high-nqap.cc b/src/devices/wifi/mac-high-nqap.cc index ec2a72ba5..e236c5509 100644 --- a/src/devices/wifi/mac-high-nqap.cc +++ b/src/devices/wifi/mac-high-nqap.cc @@ -90,20 +90,9 @@ MacHighNqap::Queue (Packet packet, Mac48Address to) { ForwardDown (packet, m_device->GetSelfAddress (), to); } -void -MacHighNqap::SendProbeResp (Mac48Address to) +SupportedRates +MacHighNqap::GetSupportedRates (void) const { - TRACE ("send probe response to="<GetSelfAddress ()); - hdr.SetAddr3 (m_device->GetSelfAddress ()); - hdr.SetDsNotFrom (); - hdr.SetDsNotTo (); - Packet packet; - MgtProbeResponseHeader probe; - probe.SetSsid (m_device->GetSsid ()); // send the set of supported rates and make sure that we indicate // the Basic Rate set in this set of supported rates. SupportedRates rates; @@ -118,10 +107,26 @@ MacHighNqap::SendProbeResp (Mac48Address to) WifiMode mode = m_stations->GetBasicMode (j); rates.SetBasicRate (mode.GetPhyRate ()); } - probe.SetSupportedRates (rates); + return rates; +} +void +MacHighNqap::SendProbeResp (Mac48Address to) +{ + TRACE ("send probe response to="<GetSelfAddress ()); + hdr.SetAddr3 (m_device->GetSelfAddress ()); + hdr.SetDsNotFrom (); + hdr.SetDsNotTo (); + Packet packet; + MgtProbeResponseHeader probe; + probe.SetSsid (m_device->GetSsid ()); + probe.SetSupportedRates (GetSupportedRates ()); probe.SetBeaconIntervalUs (m_beaconIntervalUs); packet.AddHeader (probe); - + m_dca->Queue (packet, hdr); } void @@ -146,6 +151,7 @@ MacHighNqap::SendAssocResp (Mac48Address to, bool success) { code.SetFailure (); } + assoc.SetSupportedRates (GetSupportedRates ()); assoc.SetStatusCode (code); packet.AddHeader (assoc); diff --git a/src/devices/wifi/mac-high-nqap.h b/src/devices/wifi/mac-high-nqap.h index cde8aad1a..289f850c8 100644 --- a/src/devices/wifi/mac-high-nqap.h +++ b/src/devices/wifi/mac-high-nqap.h @@ -24,6 +24,7 @@ #include "ns3/mac48-address.h" #include "ns3/callback.h" #include "ns3/packet.h" +#include "supported-rates.h" namespace ns3 { @@ -56,6 +57,7 @@ private: void TxFailed (WifiMacHeader const &hdr); void SendProbeResp (Mac48Address to); void SendAssocResp (Mac48Address to, bool success); + SupportedRates GetSupportedRates (void) const; DcaTxop *m_dca; WifiNetDevice *m_device;