A-MSDU aggregation is not a default feature.
authorMirko Banchi <mk.banchi@gmail.com>
Wed Oct 28 18:27:43 2009 +0100 (3 months ago)
changeset 5513c7aa69502cdd
parent 5512 c206a8ce5644
child 5514 6eebad1fb54d
A-MSDU aggregation is not a default feature.
src/helper/qos-wifi-mac-helper.cc
     1.1 --- a/src/helper/qos-wifi-mac-helper.cc	Wed Oct 28 15:43:43 2009 +0100
     1.2 +++ b/src/helper/qos-wifi-mac-helper.cc	Wed Oct 28 18:27:43 2009 +0100
     1.3 @@ -27,14 +27,7 @@
     1.4  namespace ns3 {
     1.5  
     1.6  QosWifiMacHelper::QosWifiMacHelper ()
     1.7 -{
     1.8 -  ObjectFactory defaultAggregator;
     1.9 -  defaultAggregator.SetTypeId ("ns3::MsduStandardAggregator");
    1.10 -  m_aggregators.insert (std::make_pair (AC_VO, defaultAggregator));
    1.11 -  m_aggregators.insert (std::make_pair (AC_VI, defaultAggregator));
    1.12 -  m_aggregators.insert (std::make_pair (AC_BE, defaultAggregator));
    1.13 -  m_aggregators.insert (std::make_pair (AC_BK, defaultAggregator));
    1.14 -}
    1.15 +{}
    1.16  
    1.17  QosWifiMacHelper::~QosWifiMacHelper ()
    1.18  {}
    1.19 @@ -77,8 +70,7 @@
    1.20                                            std::string n2, const AttributeValue &v2,
    1.21                                            std::string n3, const AttributeValue &v3)
    1.22  {
    1.23 -  std::map<AccessClass, ObjectFactory>::iterator it;
    1.24 -  it = m_aggregators.find (accessClass);
    1.25 +  std::map<AccessClass, ObjectFactory>::iterator it = m_aggregators.find (accessClass);
    1.26    if (it != m_aggregators.end ())
    1.27      {
    1.28        it->second.SetTypeId (type);
    1.29 @@ -87,17 +79,32 @@
    1.30        it->second.Set (n2, v2);
    1.31        it->second.Set (n3, v3);
    1.32      }
    1.33 +  else
    1.34 +    {
    1.35 +      ObjectFactory factory;
    1.36 +      factory.SetTypeId (type);
    1.37 +      factory.Set (n0, v0);
    1.38 +      factory.Set (n1, v1);
    1.39 +      factory.Set (n2, v2);
    1.40 +      factory.Set (n3, v3);
    1.41 +      m_aggregators.insert (std::make_pair (accessClass, factory));
    1.42 +    }
    1.43  }
    1.44  
    1.45  void
    1.46  QosWifiMacHelper::Setup (Ptr<WifiMac> mac, enum AccessClass ac, std::string dcaAttrName) const
    1.47  {
    1.48 -  ObjectFactory factory  = m_aggregators.find (ac)->second;
    1.49 -  PointerValue ptr;
    1.50 -  mac->GetAttribute (dcaAttrName, ptr);
    1.51 -  Ptr<EdcaTxopN> edca = ptr.Get<EdcaTxopN> ();
    1.52 -  Ptr<MsduAggregator> aggregator = factory.Create<MsduAggregator> ();
    1.53 -  edca->SetMsduAggregator (aggregator);
    1.54 +  std::map<AccessClass, ObjectFactory>::const_iterator it = m_aggregators.find (ac);
    1.55 +  if (it != m_aggregators.end ())
    1.56 +    {
    1.57 +      ObjectFactory factory = it->second;
    1.58 +
    1.59 +      PointerValue ptr;
    1.60 +      mac->GetAttribute (dcaAttrName, ptr);
    1.61 +      Ptr<EdcaTxopN> edca = ptr.Get<EdcaTxopN> ();
    1.62 +      Ptr<MsduAggregator> aggregator = factory.Create<MsduAggregator> ();
    1.63 +      edca->SetMsduAggregator (aggregator);
    1.64 +    }
    1.65  }
    1.66  
    1.67