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

(-)a/src/mesh/model/mesh-information-element-vector.cc (-7 lines)
 Lines 22-28    Link Here 
22
#include "ns3/packet.h"
22
#include "ns3/packet.h"
23
#include <algorithm>
23
#include <algorithm>
24
#include "ns3/hwmp-protocol.h"
24
#include "ns3/hwmp-protocol.h"
25
// All information elements:
26
#include "ns3/ie-dot11s-beacon-timing.h"
25
#include "ns3/ie-dot11s-beacon-timing.h"
27
#include "ns3/ie-dot11s-configuration.h"
26
#include "ns3/ie-dot11s-configuration.h"
28
#include "ns3/ie-dot11s-id.h"
27
#include "ns3/ie-dot11s-id.h"
 Lines 46-52    Link Here 
46
{
45
{
47
}
46
}
48
47
49
50
TypeId
48
TypeId
51
MeshInformationElementVector::GetTypeId ()
49
MeshInformationElementVector::GetTypeId ()
52
{
50
{
 Lines 108-122    Link Here 
108
      i.Prev (2);
106
      i.Prev (2);
109
      return WifiInformationElementVector::DeserializeSingleIe (i);
107
      return WifiInformationElementVector::DeserializeSingleIe (i);
110
    }
108
    }
111
  if (GetSize () + length > m_maxSize)
112
    {
113
      NS_FATAL_ERROR ("Check max size for information element!");
114
    }
115
  newElement->DeserializeInformationField (i, length);
109
  newElement->DeserializeInformationField (i, length);
116
  i.Next (length);
110
  i.Next (length);
117
  m_elements.push_back (newElement);
111
  m_elements.push_back (newElement);
118
  return i.GetDistanceFrom (start);
112
  return i.GetDistanceFrom (start);
119
}
113
}
120
114
121
122
} // namespace ns3
115
} // namespace ns3
(-)a/src/wifi/model/ap-wifi-mac.cc (-156 / +176 lines)
 Lines 442-456    Link Here 
442
  return rates;
442
  return rates;
443
}
443
}
444
444
445
DsssParameterSet
445
Ptr<DsssParameterSet>
446
ApWifiMac::GetDsssParameterSet (void) const
446
ApWifiMac::GetDsssParameterSet (void) const
447
{
447
{
448
  NS_LOG_FUNCTION (this);
448
  NS_LOG_FUNCTION (this);
449
  DsssParameterSet dsssParameters;
449
  Ptr<DsssParameterSet> dsssParameters = Create<DsssParameterSet> ();
450
  if (GetDsssSupported ())
450
  if (GetDsssSupported ())
451
    {
451
    {
452
      dsssParameters.SetDsssSupported (1);
452
      dsssParameters->SetDsssSupported (1);
453
      dsssParameters.SetCurrentChannel (m_phy->GetChannelNumber ());
453
      dsssParameters->SetCurrentChannel (m_phy->GetChannelNumber ());
454
    }
454
    }
455
  return dsssParameters;
455
  return dsssParameters;
456
}
456
}
 Lines 470-583    Link Here 
470
  return capabilities;
470
  return capabilities;
471
}
471
}
472
472
473
ErpInformation
473
Ptr<ErpInformation>
474
ApWifiMac::GetErpInformation (void) const
474
ApWifiMac::GetErpInformation (void) const
475
{
475
{
476
  NS_LOG_FUNCTION (this);
476
  NS_LOG_FUNCTION (this);
477
  ErpInformation information;
477
  Ptr<ErpInformation> information = Create<ErpInformation> ();
478
  information.SetErpSupported (1);
478
  information->SetErpSupported (1);
479
  if (GetErpSupported ())
479
  if (GetErpSupported ())
480
    {
480
    {
481
      information.SetNonErpPresent (!m_nonErpStations.empty ());
481
      information->SetNonErpPresent (!m_nonErpStations.empty ());
482
      information.SetUseProtection (GetUseNonErpProtection ());
482
      information->SetUseProtection (GetUseNonErpProtection ());
483
      if (GetShortPreambleEnabled ())
483
      if (GetShortPreambleEnabled ())
484
        {
484
        {
485
          information.SetBarkerPreambleMode (0);
485
          information->SetBarkerPreambleMode (0);
486
        }
486
        }
487
      else
487
      else
488
        {
488
        {
489
          information.SetBarkerPreambleMode (1);
489
          information->SetBarkerPreambleMode (1);
490
        }
490
        }
491
    }
491
    }
492
  return information;
492
  return information;
493
}
493
}
494
494
495
EdcaParameterSet
495
Ptr<EdcaParameterSet>
496
ApWifiMac::GetEdcaParameterSet (void) const
496
ApWifiMac::GetEdcaParameterSet (void) const
497
{
497
{
498
  NS_LOG_FUNCTION (this);
498
  NS_LOG_FUNCTION (this);
499
  EdcaParameterSet edcaParameters;
499
  Ptr<EdcaParameterSet> edcaParameters = Create<EdcaParameterSet> ();
500
  if (GetQosSupported ())
500
  if (GetQosSupported ())
501
    {
501
    {
502
      edcaParameters.SetQosSupported (1);
502
      edcaParameters->SetQosSupported (1);
503
      Ptr<QosTxop> edca;
503
      Ptr<QosTxop> edca;
504
      Time txopLimit;
504
      Time txopLimit;
505
505
506
      edca = m_edca.find (AC_BE)->second;
506
      edca = m_edca.find (AC_BE)->second;
507
      txopLimit = edca->GetTxopLimit ();
507
      txopLimit = edca->GetTxopLimit ();
508
      edcaParameters.SetBeAci (0);
508
      edcaParameters->SetBeAci (0);
509
      edcaParameters.SetBeCWmin (edca->GetMinCw ());
509
      edcaParameters->SetBeCWmin (edca->GetMinCw ());
510
      edcaParameters.SetBeCWmax (edca->GetMaxCw ());
510
      edcaParameters->SetBeCWmax (edca->GetMaxCw ());
511
      edcaParameters.SetBeAifsn (edca->GetAifsn ());
511
      edcaParameters->SetBeAifsn (edca->GetAifsn ());
512
      edcaParameters.SetBeTXOPLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
512
      edcaParameters->SetBeTXOPLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
513
513
514
      edca = m_edca.find (AC_BK)->second;
514
      edca = m_edca.find (AC_BK)->second;
515
      txopLimit = edca->GetTxopLimit ();
515
      txopLimit = edca->GetTxopLimit ();
516
      edcaParameters.SetBkAci (1);
516
      edcaParameters->SetBkAci (1);
517
      edcaParameters.SetBkCWmin (edca->GetMinCw ());
517
      edcaParameters->SetBkCWmin (edca->GetMinCw ());
518
      edcaParameters.SetBkCWmax (edca->GetMaxCw ());
518
      edcaParameters->SetBkCWmax (edca->GetMaxCw ());
519
      edcaParameters.SetBkAifsn (edca->GetAifsn ());
519
      edcaParameters->SetBkAifsn (edca->GetAifsn ());
520
      edcaParameters.SetBkTXOPLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
520
      edcaParameters->SetBkTXOPLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
521
521
522
      edca = m_edca.find (AC_VI)->second;
522
      edca = m_edca.find (AC_VI)->second;
523
      txopLimit = edca->GetTxopLimit ();
523
      txopLimit = edca->GetTxopLimit ();
524
      edcaParameters.SetViAci (2);
524
      edcaParameters->SetViAci (2);
525
      edcaParameters.SetViCWmin (edca->GetMinCw ());
525
      edcaParameters->SetViCWmin (edca->GetMinCw ());
526
      edcaParameters.SetViCWmax (edca->GetMaxCw ());
526
      edcaParameters->SetViCWmax (edca->GetMaxCw ());
527
      edcaParameters.SetViAifsn (edca->GetAifsn ());
527
      edcaParameters->SetViAifsn (edca->GetAifsn ());
528
      edcaParameters.SetViTXOPLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
528
      edcaParameters->SetViTXOPLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
529
529
530
      edca = m_edca.find (AC_VO)->second;
530
      edca = m_edca.find (AC_VO)->second;
531
      txopLimit = edca->GetTxopLimit ();
531
      txopLimit = edca->GetTxopLimit ();
532
      edcaParameters.SetVoAci (3);
532
      edcaParameters->SetVoAci (3);
533
      edcaParameters.SetVoCWmin (edca->GetMinCw ());
533
      edcaParameters->SetVoCWmin (edca->GetMinCw ());
534
      edcaParameters.SetVoCWmax (edca->GetMaxCw ());
534
      edcaParameters->SetVoCWmax (edca->GetMaxCw ());
535
      edcaParameters.SetVoAifsn (edca->GetAifsn ());
535
      edcaParameters->SetVoAifsn (edca->GetAifsn ());
536
      edcaParameters.SetVoTXOPLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
536
      edcaParameters->SetVoTXOPLimit (static_cast<uint16_t> (txopLimit.GetMicroSeconds () / 32));
537
537
538
      edcaParameters.SetQosInfo (0);
538
      edcaParameters->SetQosInfo (0);
539
    }
539
    }
540
  return edcaParameters;
540
  return edcaParameters;
541
}
541
}
542
542
543
CfParameterSet
543
Ptr<CfParameterSet>
544
ApWifiMac::GetCfParameterSet (void) const
544
ApWifiMac::GetCfParameterSet (void) const
545
{
545
{
546
  CfParameterSet cfParameterSet;
546
  Ptr<CfParameterSet> cfParameterSet = Create<CfParameterSet> ();
547
  if (GetPcfSupported () && !m_cfPollingList.empty ())
547
  if (GetPcfSupported ())
548
    {
548
    {
549
      cfParameterSet.SetPcfSupported (1);
549
      cfParameterSet->SetPcfSupported (1);
550
      cfParameterSet.SetCFPCount (0);
550
      if (!m_cfPollingList.empty ())
551
      cfParameterSet.SetCFPPeriod (1);
551
        {
552
      cfParameterSet.SetCFPMaxDurationUs (GetCfpMaxDuration ().GetMicroSeconds ());
552
          cfParameterSet->SetCFPCount (0);
553
      cfParameterSet.SetCFPDurRemainingUs (GetCfpMaxDuration ().GetMicroSeconds ());
553
          cfParameterSet->SetCFPPeriod (1);
554
          cfParameterSet->SetCFPMaxDurationUs (GetCfpMaxDuration ().GetMicroSeconds ());
555
          cfParameterSet->SetCFPDurRemainingUs (GetCfpMaxDuration ().GetMicroSeconds ());
556
        }
554
    }
557
    }
555
  return cfParameterSet;
558
  return cfParameterSet;
556
}
559
}
557
560
558
HtOperation
561
Ptr<HtOperation>
559
ApWifiMac::GetHtOperation (void) const
562
ApWifiMac::GetHtOperation (void) const
560
{
563
{
561
  NS_LOG_FUNCTION (this);
564
  NS_LOG_FUNCTION (this);
562
  HtOperation operation;
565
  Ptr<HtOperation> operation = Create<HtOperation> ();
563
  if (GetHtSupported ())
566
  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
564
    {
567
    {
565
      operation.SetHtSupported (1);
568
      operation->SetHtSupported (1);
566
      operation.SetPrimaryChannel (m_phy->GetChannelNumber ());
569
      operation->SetPrimaryChannel (m_phy->GetChannelNumber ());
567
      operation.SetRifsMode (GetRifsMode ());
570
      operation->SetRifsMode (GetRifsMode ());
568
      operation.SetNonGfHtStasPresent (IsNonGfHtStasPresent ());
571
      operation->SetNonGfHtStasPresent (IsNonGfHtStasPresent ());
569
      if (m_phy->GetChannelWidth () > 20)
572
      if (m_phy->GetChannelWidth () > 20)
570
        {
573
        {
571
          operation.SetSecondaryChannelOffset (1);
574
          operation->SetSecondaryChannelOffset (1);
572
          operation.SetStaChannelWidth (1);
575
          operation->SetStaChannelWidth (1);
573
        }
576
        }
574
      if (m_nonHtStations.empty ())
577
      if (m_nonHtStations.empty ())
575
        {
578
        {
576
          operation.SetHtProtection (NO_PROTECTION);
579
          operation->SetHtProtection (NO_PROTECTION);
577
        }
580
        }
578
      else
581
      else
579
        {
582
        {
580
          operation.SetHtProtection (MIXED_MODE_PROTECTION);
583
          operation->SetHtProtection (MIXED_MODE_PROTECTION);
581
        }
584
        }
582
      uint64_t maxSupportedRate = 0; //in bit/s
585
      uint64_t maxSupportedRate = 0; //in bit/s
583
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
586
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
 Lines 632-675    Link Here 
632
                }
635
                }
633
            }
636
            }
634
        }
637
        }
635
      operation.SetRxHighestSupportedDataRate (static_cast<uint16_t> (maxSupportedRate / 1e6)); //in Mbit/s
638
      operation->SetRxHighestSupportedDataRate (static_cast<uint16_t> (maxSupportedRate / 1e6)); //in Mbit/s
636
      operation.SetTxMcsSetDefined (nMcs > 0);
639
      operation->SetTxMcsSetDefined (nMcs > 0);
637
      operation.SetTxMaxNSpatialStreams (maxSpatialStream);
640
      operation->SetTxMaxNSpatialStreams (maxSpatialStream);
638
      //To be filled in once supported
641
      //To be filled in once supported
639
      operation.SetObssNonHtStasPresent (0);
642
      operation->SetObssNonHtStasPresent (0);
640
      operation.SetDualBeacon (0);
643
      operation->SetDualBeacon (0);
641
      operation.SetDualCtsProtection (0);
644
      operation->SetDualCtsProtection (0);
642
      operation.SetStbcBeacon (0);
645
      operation->SetStbcBeacon (0);
643
      operation.SetLSigTxopProtectionFullSupport (0);
646
      operation->SetLSigTxopProtectionFullSupport (0);
644
      operation.SetPcoActive (0);
647
      operation->SetPcoActive (0);
645
      operation.SetPhase (0);
648
      operation->SetPhase (0);
646
      operation.SetRxMcsBitmask (0);
649
      operation->SetRxMcsBitmask (0);
647
      operation.SetTxRxMcsSetUnequal (0);
650
      operation->SetTxRxMcsSetUnequal (0);
648
      operation.SetTxUnequalModulation (0);
651
      operation->SetTxUnequalModulation (0);
649
    }
652
    }
650
  return operation;
653
  return operation;
651
}
654
}
652
655
653
VhtOperation
656
Ptr<VhtOperation>
654
ApWifiMac::GetVhtOperation (void) const
657
ApWifiMac::GetVhtOperation (void) const
655
{
658
{
656
  NS_LOG_FUNCTION (this);
659
  NS_LOG_FUNCTION (this);
657
  VhtOperation operation;
660
  Ptr<VhtOperation> operation = Create<VhtOperation> ();
658
  if (GetVhtSupported ())
661
  if (GetVhtSupported () || GetHeSupported ())
659
    {
662
    {
660
      operation.SetVhtSupported (1);
663
      operation->SetVhtSupported (1);
661
      uint16_t channelWidth = GetVhtOperationalChannelWidth ();
664
      uint16_t channelWidth = GetVhtOperationalChannelWidth ();
662
      if (channelWidth == 160)
665
      if (channelWidth == 160)
663
        {
666
        {
664
          operation.SetChannelWidth (2);
667
          operation->SetChannelWidth (2);
665
        }
668
        }
666
      else if (channelWidth == 80)
669
      else if (channelWidth == 80)
667
        {
670
        {
668
          operation.SetChannelWidth (1);
671
          operation->SetChannelWidth (1);
669
        }
672
        }
670
      else
673
      else
671
        {
674
        {
672
          operation.SetChannelWidth (0);
675
          operation->SetChannelWidth (0);
673
        }
676
        }
674
      for (uint8_t nss = 1; nss <= 8; nss++)
677
      for (uint8_t nss = 1; nss <= 8; nss++)
675
        {
678
        {
 Lines 682-704    Link Here 
682
            {
685
            {
683
              maxMcs = 0;
686
              maxMcs = 0;
684
            }
687
            }
685
          operation.SetMaxVhtMcsPerNss (nss, maxMcs);
688
          operation->SetMaxVhtMcsPerNss (nss, maxMcs);
686
        }
689
        }
687
    }
690
    }
688
  return operation;
691
  return operation;
689
}
692
}
690
693
691
HeOperation
694
Ptr<HeOperation>
692
ApWifiMac::GetHeOperation (void) const
695
ApWifiMac::GetHeOperation (void) const
693
{
696
{
694
  NS_LOG_FUNCTION (this);
697
  NS_LOG_FUNCTION (this);
695
  HeOperation operation;
698
  Ptr<HeOperation> operation = Create<HeOperation> ();
696
  if (GetHeSupported ())
699
  if (GetHeSupported ())
697
    {
700
    {
698
      operation.SetHeSupported (1);
701
      operation->SetHeSupported (1);
699
      for (uint8_t nss = 1; nss <= m_phy->GetMaxSupportedRxSpatialStreams (); nss++)
702
      for (uint8_t nss = 1; nss <= m_phy->GetMaxSupportedRxSpatialStreams (); nss++)
700
        {
703
        {
701
          operation.SetMaxHeMcsPerNss (nss, 11); //TBD: hardcode to 11 for now since we assume all MCS values are supported
704
          operation->SetMaxHeMcsPerNss (nss, 11); //TBD: hardcode to 11 for now since we assume all MCS values are supported
702
        }
705
        }
703
    }
706
    }
704
  return operation;
707
  return operation;
 Lines 725-755    Link Here 
725
  m_stationManager->SetShortSlotTimeEnabled (GetShortSlotTimeEnabled ());
728
  m_stationManager->SetShortSlotTimeEnabled (GetShortSlotTimeEnabled ());
726
  if (GetDsssSupported ())
729
  if (GetDsssSupported ())
727
    {
730
    {
728
      probe.SetDsssParameterSet (GetDsssParameterSet ());
731
      probe.AddWifiInformationElement (GetDsssParameterSet ());
729
    }
732
    }
730
  if (GetErpSupported ())
733
  if (GetErpSupported ())
731
    {
734
    {
732
      probe.SetErpInformation (GetErpInformation ());
735
      probe.AddWifiInformationElement (GetErpInformation ());
733
    }
736
    }
734
  if (GetQosSupported ())
737
  if (GetQosSupported ())
735
    {
738
    {
736
      probe.SetEdcaParameterSet (GetEdcaParameterSet ());
739
      probe.AddWifiInformationElement (GetEdcaParameterSet ());
737
    }
740
    }
738
  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
741
  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
739
    {
742
    {
740
      probe.SetExtendedCapabilities (GetExtendedCapabilities ());
743
      probe.AddWifiInformationElement (GetExtendedCapabilities ());
741
      probe.SetHtCapabilities (GetHtCapabilities ());
744
      probe.AddWifiInformationElement (GetHtCapabilities ());
742
      probe.SetHtOperation (GetHtOperation ());
745
      probe.AddWifiInformationElement (GetHtOperation ());
743
    }
746
    }
744
  if (GetVhtSupported () || GetHeSupported ())
747
  if (GetVhtSupported () || GetHeSupported ())
745
    {
748
    {
746
      probe.SetVhtCapabilities (GetVhtCapabilities ());
749
      probe.AddWifiInformationElement (GetVhtCapabilities ());
747
      probe.SetVhtOperation (GetVhtOperation ());
750
      probe.AddWifiInformationElement (GetVhtOperation ());
748
    }
751
    }
749
  if (GetHeSupported ())
752
  if (GetHeSupported ())
750
    {
753
    {
751
      probe.SetHeCapabilities (GetHeCapabilities ());
754
      probe.AddWifiInformationElement (GetHeCapabilities ());
752
      probe.SetHeOperation (GetHeOperation ());
755
      probe.AddWifiInformationElement (GetHeOperation ());
753
    }
756
    }
754
  packet->AddHeader (probe);
757
  packet->AddHeader (probe);
755
758
 Lines 807-833    Link Here 
807
  assoc.SetCapabilities (GetCapabilities ());
810
  assoc.SetCapabilities (GetCapabilities ());
808
  if (GetErpSupported ())
811
  if (GetErpSupported ())
809
    {
812
    {
810
      assoc.SetErpInformation (GetErpInformation ());
813
      assoc.AddWifiInformationElement (GetErpInformation ());
811
    }
814
    }
812
  if (GetQosSupported ())
815
  if (GetQosSupported ())
813
    {
816
    {
814
      assoc.SetEdcaParameterSet (GetEdcaParameterSet ());
817
      assoc.AddWifiInformationElement (GetEdcaParameterSet ());
815
    }
818
    }
816
  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
819
  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
817
    {
820
    {
818
      assoc.SetExtendedCapabilities (GetExtendedCapabilities ());
821
      assoc.AddWifiInformationElement (GetExtendedCapabilities ());
819
      assoc.SetHtCapabilities (GetHtCapabilities ());
822
      assoc.AddWifiInformationElement (GetHtCapabilities ());
820
      assoc.SetHtOperation (GetHtOperation ());
823
      assoc.AddWifiInformationElement (GetHtOperation ());
821
    }
824
    }
822
  if (GetVhtSupported () || GetHeSupported ())
825
  if (GetVhtSupported () || GetHeSupported ())
823
    {
826
    {
824
      assoc.SetVhtCapabilities (GetVhtCapabilities ());
827
      assoc.AddWifiInformationElement (GetVhtCapabilities ());
825
      assoc.SetVhtOperation (GetVhtOperation ());
828
      assoc.AddWifiInformationElement (GetVhtOperation ());
826
    }
829
    }
827
  if (GetHeSupported ())
830
  if (GetHeSupported ())
828
    {
831
    {
829
      assoc.SetHeCapabilities (GetHeCapabilities ());
832
      assoc.AddWifiInformationElement (GetHeCapabilities ());
830
      assoc.SetHeOperation (GetHeOperation ());
833
      assoc.AddWifiInformationElement (GetHeOperation ());
831
    }
834
    }
832
  packet->AddHeader (assoc);
835
  packet->AddHeader (assoc);
833
836
 Lines 859-893    Link Here 
859
  m_stationManager->SetShortSlotTimeEnabled (GetShortSlotTimeEnabled ());
862
  m_stationManager->SetShortSlotTimeEnabled (GetShortSlotTimeEnabled ());
860
  if (GetPcfSupported ())
863
  if (GetPcfSupported ())
861
    {
864
    {
862
      beacon.SetCfParameterSet (GetCfParameterSet ());
865
      beacon.AddWifiInformationElement (GetCfParameterSet ());
863
    }
866
    }
864
  if (GetDsssSupported ())
867
  if (GetDsssSupported ())
865
    {
868
    {
866
      beacon.SetDsssParameterSet (GetDsssParameterSet ());
869
      beacon.AddWifiInformationElement (GetDsssParameterSet ());
867
    }
870
    }
868
  if (GetErpSupported ())
871
  if (GetErpSupported ())
869
    {
872
    {
870
      beacon.SetErpInformation (GetErpInformation ());
873
      beacon.AddWifiInformationElement (GetErpInformation ());
871
    }
874
    }
872
  if (GetQosSupported ())
875
  if (GetQosSupported ())
873
    {
876
    {
874
      beacon.SetEdcaParameterSet (GetEdcaParameterSet ());
877
      beacon.AddWifiInformationElement (GetEdcaParameterSet ());
875
    }
878
    }
876
  if (GetHtSupported () || GetVhtSupported ())
879
  if (GetHtSupported () || GetVhtSupported ())
877
    {
880
    {
878
      beacon.SetExtendedCapabilities (GetExtendedCapabilities ());
881
      beacon.AddWifiInformationElement (GetExtendedCapabilities ());
879
      beacon.SetHtCapabilities (GetHtCapabilities ());
882
      beacon.AddWifiInformationElement (GetHtCapabilities ());
880
      beacon.SetHtOperation (GetHtOperation ());
883
      beacon.AddWifiInformationElement (GetHtOperation ());
881
    }
884
    }
882
  if (GetVhtSupported () || GetHeSupported ())
885
  if (GetVhtSupported () || GetHeSupported ())
883
    {
886
    {
884
      beacon.SetVhtCapabilities (GetVhtCapabilities ());
887
      beacon.AddWifiInformationElement (GetVhtCapabilities ());
885
      beacon.SetVhtOperation (GetVhtOperation ());
888
      beacon.AddWifiInformationElement (GetVhtOperation ());
886
    }
889
    }
887
  if (GetHeSupported ())
890
  if (GetHeSupported ())
888
    {
891
    {
889
      beacon.SetHeCapabilities (GetHeCapabilities ());
892
      beacon.AddWifiInformationElement (GetHeCapabilities ());
890
      beacon.SetHeOperation (GetHeOperation ());
893
      beacon.AddWifiInformationElement (GetHeOperation ());
891
    }
894
    }
892
  packet->AddHeader (beacon);
895
  packet->AddHeader (beacon);
893
896
 Lines 1136-1149    Link Here 
1136
              if (GetHtSupported ())
1139
              if (GetHtSupported ())
1137
                {
1140
                {
1138
                  //check whether the HT STA supports all MCSs in Basic MCS Set
1141
                  //check whether the HT STA supports all MCSs in Basic MCS Set
1139
                  HtCapabilities htcapabilities = assocReq.GetHtCapabilities ();
1142
                  Ptr<HtCapabilities> htcapabilities =
1140
                  if (htcapabilities.IsSupportedMcs (0))
1143
                      StaticCast<HtCapabilities> (assocReq.GetInformationElement (IE_HT_CAPABILITIES));
1144
                  if (htcapabilities != 0)
1141
                    {
1145
                    {
1142
                      isHtStation = true;
1146
                      isHtStation = true;
1143
                      for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1147
                      for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1144
                        {
1148
                        {
1145
                          WifiMode mcs = m_stationManager->GetBasicMcs (i);
1149
                          WifiMode mcs = m_stationManager->GetBasicMcs (i);
1146
                          if (!htcapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1150
                          if (!htcapabilities->IsSupportedMcs (mcs.GetMcsValue ()))
1147
                            {
1151
                            {
1148
                              problem = true;
1152
                              problem = true;
1149
                              break;
1153
                              break;
 Lines 1154-1166    Link Here 
1154
              if (GetVhtSupported ())
1158
              if (GetVhtSupported ())
1155
                {
1159
                {
1156
                  //check whether the VHT STA supports all MCSs in Basic MCS Set
1160
                  //check whether the VHT STA supports all MCSs in Basic MCS Set
1157
                  VhtCapabilities vhtcapabilities = assocReq.GetVhtCapabilities ();
1161
                  Ptr<VhtCapabilities> vhtcapabilities =
1158
                  if (vhtcapabilities.GetVhtCapabilitiesInfo () != 0)
1162
                      StaticCast<VhtCapabilities> (assocReq.GetInformationElement (IE_VHT_CAPABILITIES));
1163
                  if (vhtcapabilities != 0)
1159
                    {
1164
                    {
1160
                      for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1165
                      for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1161
                        {
1166
                        {
1162
                          WifiMode mcs = m_stationManager->GetBasicMcs (i);
1167
                          WifiMode mcs = m_stationManager->GetBasicMcs (i);
1163
                          if (!vhtcapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1168
                          if (!vhtcapabilities->IsSupportedTxMcs (mcs.GetMcsValue ()))
1164
                            {
1169
                            {
1165
                              problem = true;
1170
                              problem = true;
1166
                              break;
1171
                              break;
 Lines 1171-1183    Link Here 
1171
              if (GetHeSupported ())
1176
              if (GetHeSupported ())
1172
                {
1177
                {
1173
                  //check whether the HE STA supports all MCSs in Basic MCS Set
1178
                  //check whether the HE STA supports all MCSs in Basic MCS Set
1174
                  HeCapabilities hecapabilities = assocReq.GetHeCapabilities ();
1179
                  Ptr<HeCapabilities> hecapabilities =
1175
                  if (hecapabilities.GetSupportedMcsAndNss () != 0)
1180
                      StaticCast<HeCapabilities> (assocReq.GetInformationElement (IE_HE_CAPABILITIES));
1181
                  if (hecapabilities != 0)
1176
                    {
1182
                    {
1177
                      for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1183
                      for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1178
                        {
1184
                        {
1179
                          WifiMode mcs = m_stationManager->GetBasicMcs (i);
1185
                          WifiMode mcs = m_stationManager->GetBasicMcs (i);
1180
                          if (!hecapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1186
                          if (!hecapabilities->IsSupportedTxMcs (mcs.GetMcsValue ()))
1181
                            {
1187
                            {
1182
                              problem = true;
1188
                              problem = true;
1183
                              break;
1189
                              break;
 Lines 1212-1234    Link Here 
1212
                    }
1218
                    }
1213
                  if (GetHtSupported ())
1219
                  if (GetHtSupported ())
1214
                    {
1220
                    {
1215
                      HtCapabilities htCapabilities = assocReq.GetHtCapabilities ();
1221
                      Ptr<HtCapabilities> htCapabilities =
1216
                      if (htCapabilities.IsSupportedMcs (0))
1222
                          StaticCast<HtCapabilities> (assocReq.GetInformationElement (IE_HT_CAPABILITIES));
1223
                      if (htCapabilities != 0)
1217
                        {
1224
                        {
1218
                          m_stationManager->AddStationHtCapabilities (from, htCapabilities);
1225
                          m_stationManager->AddStationHtCapabilities (from, htCapabilities);
1219
                        }
1226
                        }
1220
                    }
1227
                    }
1221
                  if (GetVhtSupported ())
1228
                  if (GetVhtSupported ())
1222
                    {
1229
                    {
1223
                      VhtCapabilities vhtCapabilities = assocReq.GetVhtCapabilities ();
1230
                      Ptr<VhtCapabilities> vhtCapabilities =
1224
                      //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
1231
                          StaticCast<VhtCapabilities> (assocReq.GetInformationElement (IE_VHT_CAPABILITIES));
1225
                      if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
1232
                      if (vhtCapabilities != 0)
1226
                        {
1233
                        {
1227
                          m_stationManager->AddStationVhtCapabilities (from, vhtCapabilities);
1234
                          m_stationManager->AddStationVhtCapabilities (from, vhtCapabilities);
1228
                          for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1235
                          for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1229
                            {
1236
                            {
1230
                              WifiMode mcs = m_phy->GetMcs (i);
1237
                              WifiMode mcs = m_phy->GetMcs (i);
1231
                              if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1238
                              if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities->IsSupportedTxMcs (mcs.GetMcsValue ()))
1232
                                {
1239
                                {
1233
                                  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1240
                                  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1234
                                  //here should add a control to add basic MCS when it is implemented
1241
                                  //here should add a control to add basic MCS when it is implemented
 Lines 1238-1258    Link Here 
1238
                    }
1245
                    }
1239
                  if (GetHtSupported () || GetVhtSupported ())
1246
                  if (GetHtSupported () || GetVhtSupported ())
1240
                    {
1247
                    {
1241
                      ExtendedCapabilities extendedCapabilities = assocReq.GetExtendedCapabilities ();
1248
                      Ptr<ExtendedCapabilities> extendedCapabilities =
1249
                          StaticCast<ExtendedCapabilities> (assocReq.GetInformationElement (IE_EXTENDED_CAPABILITIES));
1242
                      //TODO: to be completed
1250
                      //TODO: to be completed
1243
                    }
1251
                    }
1244
                  if (GetHeSupported ())
1252
                  if (GetHeSupported ())
1245
                    {
1253
                    {
1246
                      HeCapabilities heCapabilities = assocReq.GetHeCapabilities ();
1254
                      Ptr<HeCapabilities> heCapabilities =
1247
                      //todo: once we support non constant rate managers, we should add checks here whether HE is supported by the peer
1255
                          StaticCast<HeCapabilities> (assocReq.GetInformationElement (IE_HE_CAPABILITIES));
1248
                      m_stationManager->AddStationHeCapabilities (from, heCapabilities);
1256
                      if (heCapabilities != 0)
1249
                      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1250
                        {
1257
                        {
1251
                          WifiMode mcs = m_phy->GetMcs (i);
1258
                          m_stationManager->AddStationHeCapabilities (from, heCapabilities);
1252
                          if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1259
                          for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1253
                            {
1260
                            {
1254
                              m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1261
                              WifiMode mcs = m_phy->GetMcs (i);
1255
                              //here should add a control to add basic MCS when it is implemented
1262
                              if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities->IsSupportedTxMcs (mcs.GetMcsValue ()))
1263
                                {
1264
                                  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1265
                                  //here should add a control to add basic MCS when it is implemented
1266
                                }
1256
                            }
1267
                            }
1257
                        }
1268
                        }
1258
                    }
1269
                    }
 Lines 1330-1343    Link Here 
1330
              if (GetHtSupported ())
1341
              if (GetHtSupported ())
1331
                {
1342
                {
1332
                  //check whether the HT STA supports all MCSs in Basic MCS Set
1343
                  //check whether the HT STA supports all MCSs in Basic MCS Set
1333
                  HtCapabilities htcapabilities = reassocReq.GetHtCapabilities ();
1344
                  Ptr<HtCapabilities> htcapabilities =
1334
                  if (htcapabilities.IsSupportedMcs (0))
1345
                      StaticCast<HtCapabilities> (reassocReq.GetInformationElement (IE_HT_CAPABILITIES));
1346
                  if (htcapabilities != 0)
1335
                    {
1347
                    {
1336
                      isHtStation = true;
1348
                      isHtStation = true;
1337
                      for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1349
                      for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1338
                        {
1350
                        {
1339
                          WifiMode mcs = m_stationManager->GetBasicMcs (i);
1351
                          WifiMode mcs = m_stationManager->GetBasicMcs (i);
1340
                          if (!htcapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1352
                          if (!htcapabilities->IsSupportedMcs (mcs.GetMcsValue ()))
1341
                            {
1353
                            {
1342
                              problem = true;
1354
                              problem = true;
1343
                              break;
1355
                              break;
 Lines 1348-1360    Link Here 
1348
              if (GetVhtSupported ())
1360
              if (GetVhtSupported ())
1349
                {
1361
                {
1350
                  //check whether the VHT STA supports all MCSs in Basic MCS Set
1362
                  //check whether the VHT STA supports all MCSs in Basic MCS Set
1351
                  VhtCapabilities vhtcapabilities = reassocReq.GetVhtCapabilities ();
1363
                  Ptr<VhtCapabilities> vhtcapabilities =
1352
                  if (vhtcapabilities.GetVhtCapabilitiesInfo () != 0)
1364
                      StaticCast<VhtCapabilities> (reassocReq.GetInformationElement (IE_VHT_CAPABILITIES));
1365
                  if (vhtcapabilities != 0)
1353
                    {
1366
                    {
1354
                      for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1367
                      for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1355
                        {
1368
                        {
1356
                          WifiMode mcs = m_stationManager->GetBasicMcs (i);
1369
                          WifiMode mcs = m_stationManager->GetBasicMcs (i);
1357
                          if (!vhtcapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1370
                          if (!vhtcapabilities->IsSupportedTxMcs (mcs.GetMcsValue ()))
1358
                            {
1371
                            {
1359
                              problem = true;
1372
                              problem = true;
1360
                              break;
1373
                              break;
 Lines 1365-1377    Link Here 
1365
              if (GetHeSupported ())
1378
              if (GetHeSupported ())
1366
                {
1379
                {
1367
                  //check whether the HE STA supports all MCSs in Basic MCS Set
1380
                  //check whether the HE STA supports all MCSs in Basic MCS Set
1368
                  HeCapabilities hecapabilities = reassocReq.GetHeCapabilities ();
1381
                  Ptr<HeCapabilities> hecapabilities =
1369
                  if (hecapabilities.GetSupportedMcsAndNss () != 0)
1382
                      StaticCast<HeCapabilities> (reassocReq.GetInformationElement (IE_HE_CAPABILITIES));
1383
                  if (hecapabilities != 0)
1370
                    {
1384
                    {
1371
                      for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1385
                      for (uint8_t i = 0; i < m_stationManager->GetNBasicMcs (); i++)
1372
                        {
1386
                        {
1373
                          WifiMode mcs = m_stationManager->GetBasicMcs (i);
1387
                          WifiMode mcs = m_stationManager->GetBasicMcs (i);
1374
                          if (!hecapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1388
                          if (!hecapabilities->IsSupportedTxMcs (mcs.GetMcsValue ()))
1375
                            {
1389
                            {
1376
                              problem = true;
1390
                              problem = true;
1377
                              break;
1391
                              break;
 Lines 1398-1420    Link Here 
1398
                    }
1412
                    }
1399
                  if (GetHtSupported ())
1413
                  if (GetHtSupported ())
1400
                    {
1414
                    {
1401
                      HtCapabilities htCapabilities = reassocReq.GetHtCapabilities ();
1415
                      Ptr<HtCapabilities> htCapabilities =
1402
                      if (htCapabilities.IsSupportedMcs (0))
1416
                          StaticCast<HtCapabilities> (reassocReq.GetInformationElement (IE_HT_CAPABILITIES));
1417
                      if (htCapabilities != 0)
1403
                        {
1418
                        {
1404
                          m_stationManager->AddStationHtCapabilities (from, htCapabilities);
1419
                          m_stationManager->AddStationHtCapabilities (from, htCapabilities);
1405
                        }
1420
                        }
1406
                    }
1421
                    }
1407
                  if (GetVhtSupported ())
1422
                  if (GetVhtSupported ())
1408
                    {
1423
                    {
1409
                      VhtCapabilities vhtCapabilities = reassocReq.GetVhtCapabilities ();
1424
                      Ptr<VhtCapabilities> vhtCapabilities =
1425
                          StaticCast<VhtCapabilities> (reassocReq.GetInformationElement (IE_VHT_CAPABILITIES));
1410
                      //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
1426
                      //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
1411
                      if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
1427
                      if (vhtCapabilities != 0)
1412
                        {
1428
                        {
1413
                          m_stationManager->AddStationVhtCapabilities (from, vhtCapabilities);
1429
                          m_stationManager->AddStationVhtCapabilities (from, vhtCapabilities);
1414
                          for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1430
                          for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1415
                            {
1431
                            {
1416
                              WifiMode mcs = m_phy->GetMcs (i);
1432
                              WifiMode mcs = m_phy->GetMcs (i);
1417
                              if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1433
                              if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities->IsSupportedTxMcs (mcs.GetMcsValue ()))
1418
                                {
1434
                                {
1419
                                  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1435
                                  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1420
                                  //here should add a control to add basic MCS when it is implemented
1436
                                  //here should add a control to add basic MCS when it is implemented
 Lines 1424-1444    Link Here 
1424
                    }
1440
                    }
1425
                  if (GetHtSupported () || GetVhtSupported ())
1441
                  if (GetHtSupported () || GetVhtSupported ())
1426
                    {
1442
                    {
1427
                      ExtendedCapabilities extendedCapabilities = reassocReq.GetExtendedCapabilities ();
1443
                      Ptr<ExtendedCapabilities> extendedCapabilities =
1444
                          StaticCast<ExtendedCapabilities> (reassocReq.GetInformationElement (IE_EXTENDED_CAPABILITIES));
1428
                      //TODO: to be completed
1445
                      //TODO: to be completed
1429
                    }
1446
                    }
1430
                  if (GetHeSupported ())
1447
                  if (GetHeSupported ())
1431
                    {
1448
                    {
1432
                      HeCapabilities heCapabilities = reassocReq.GetHeCapabilities ();
1449
                      Ptr<HeCapabilities> heCapabilities =
1433
                      //todo: once we support non constant rate managers, we should add checks here whether HE is supported by the peer
1450
                          StaticCast<HeCapabilities> (reassocReq.GetInformationElement (IE_HE_CAPABILITIES));
1434
                      m_stationManager->AddStationHeCapabilities (from, heCapabilities);
1451
                      if (heCapabilities != 0)
1435
                      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1436
                        {
1452
                        {
1437
                          WifiMode mcs = m_phy->GetMcs (i);
1453
                          m_stationManager->AddStationHeCapabilities (from, heCapabilities);
1438
                          if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities.IsSupportedTxMcs (mcs.GetMcsValue ()))
1454
                          for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1439
                            {
1455
                            {
1440
                              m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1456
                              WifiMode mcs = m_phy->GetMcs (i);
1441
                              //here should add a control to add basic MCS when it is implemented
1457
                              if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities->IsSupportedTxMcs (mcs.GetMcsValue ()))
1458
                                {
1459
                                  m_stationManager->AddSupportedMcs (hdr->GetAddr2 (), mcs);
1460
                                  //here should add a control to add basic MCS when it is implemented
1461
                                }
1442
                            }
1462
                            }
1443
                        }
1463
                        }
1444
                    }
1464
                    }
(-)a/src/wifi/model/ap-wifi-mac.h (-7 / +7 lines)
 Lines 248-284    Link Here 
248
   *
248
   *
249
   * \return the ERP information that we support
249
   * \return the ERP information that we support
250
   */
250
   */
251
  ErpInformation GetErpInformation (void) const;
251
  Ptr<ErpInformation> GetErpInformation (void) const;
252
  /**
252
  /**
253
   * Return the EDCA Parameter Set of the current AP.
253
   * Return the EDCA Parameter Set of the current AP.
254
   *
254
   *
255
   * \return the EDCA Parameter Set that we support
255
   * \return the EDCA Parameter Set that we support
256
   */
256
   */
257
  EdcaParameterSet GetEdcaParameterSet (void) const;
257
  Ptr<EdcaParameterSet> GetEdcaParameterSet (void) const;
258
  /**
258
  /**
259
   * Return the CF parameter set of the current AP.
259
   * Return the CF parameter set of the current AP.
260
   *
260
   *
261
   * \return the CF parameter set that we support
261
   * \return the CF parameter set that we support
262
   */
262
   */
263
  CfParameterSet GetCfParameterSet (void) const;
263
  Ptr<CfParameterSet> GetCfParameterSet (void) const;
264
  /**
264
  /**
265
   * Return the HT operation of the current AP.
265
   * Return the HT operation of the current AP.
266
   *
266
   *
267
   * \return the HT operation that we support
267
   * \return the HT operation that we support
268
   */
268
   */
269
  HtOperation GetHtOperation (void) const;
269
  Ptr<HtOperation> GetHtOperation (void) const;
270
  /**
270
  /**
271
   * Return the VHT operation of the current AP.
271
   * Return the VHT operation of the current AP.
272
   *
272
   *
273
   * \return the VHT operation that we support
273
   * \return the VHT operation that we support
274
   */
274
   */
275
  VhtOperation GetVhtOperation (void) const;
275
  Ptr<VhtOperation> GetVhtOperation (void) const;
276
  /**
276
  /**
277
   * Return the HE operation of the current AP.
277
   * Return the HE operation of the current AP.
278
   *
278
   *
279
   * \return the HE operation that we support
279
   * \return the HE operation that we support
280
   */
280
   */
281
  HeOperation GetHeOperation (void) const;
281
  Ptr<HeOperation> GetHeOperation (void) const;
282
  /**
282
  /**
283
   * Return an instance of SupportedRates that contains all rates that we support
283
   * Return an instance of SupportedRates that contains all rates that we support
284
   * including HT rates.
284
   * including HT rates.
 Lines 291-297    Link Here 
291
   *
291
   *
292
   * \return the DSSS Parameter Set that we support
292
   * \return the DSSS Parameter Set that we support
293
   */
293
   */
294
  DsssParameterSet GetDsssParameterSet (void) const;
294
  Ptr<DsssParameterSet> GetDsssParameterSet (void) const;
295
  /**
295
  /**
296
   * Enable or disable beacon generation of the AP.
296
   * Enable or disable beacon generation of the AP.
297
   *
297
   *
(-)a/src/wifi/model/cf-parameter-set.cc (-7 / +12 lines)
 Lines 146-167    Link Here 
146
  m_CFPDurRemaining = durRemaining;
146
  m_CFPDurRemaining = durRemaining;
147
}
147
}
148
148
149
void
150
CfParameterSet::Print (std::ostream& os) const
151
{
152
  os <<  +GetCFPCount ()
153
     << "|" << +GetCFPPeriod ()
154
     << "|" << GetCFPMaxDurationUs ()
155
     << "|" << GetCFPDurRemainingUs ();
156
}
157
149
/**
158
/**
150
 * output operator
159
 * output operator
151
 *
160
 *
152
 * \param os output stream
161
 * \param os output stream
153
 * \param cfParameterSet
162
 * \param cfparameterset the CF parameter set
154
 *
163
 *
155
 * \return output stream
164
 * \return output stream
156
 */
165
 */
157
std::ostream &
166
std::ostream &
158
operator << (std::ostream &os, const CfParameterSet &cfParameterSet)
167
operator << (std::ostream &os, const CfParameterSet &cfparameterset)
159
{
168
{
160
  os <<  (uint16_t)cfParameterSet.GetCFPCount ()
169
  cfparameterset.Print (os);
161
     << "|" << (uint16_t)cfParameterSet.GetCFPPeriod ()
162
     << "|" << cfParameterSet.GetCFPMaxDurationUs ()
163
     << "|" << cfParameterSet.GetCFPDurRemainingUs ();
164
165
  return os;
170
  return os;
166
}
171
}
167
172
(-)a/src/wifi/model/cf-parameter-set.h (-3 / +10 lines)
 Lines 126-137    Link Here 
126
   */
126
   */
127
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
127
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
128
  /**
128
  /**
129
   * Return the serialized size of this EDCA Parameter Set.
129
   * Return the serialized size of this CF Parameter Set.
130
   *
130
   *
131
   * \return the serialized size of this EDCA Parameter Set
131
   * \return the serialized size of this CF Parameter Set
132
   */
132
   */
133
  uint16_t GetSerializedSize () const;
133
  uint16_t GetSerializedSize () const;
134
134
135
  /**
136
   * Generate human-readable form of CF Parameter Set
137
   *
138
   * \param os output stream
139
   */
140
  void Print (std::ostream& os) const;
141
135
142
136
private:
143
private:
137
  uint8_t m_CFPCount;                 ///< CFP Count
144
  uint8_t m_CFPCount;                 ///< CFP Count
 Lines 143-149    Link Here 
143
  uint8_t m_pcfSupported;
150
  uint8_t m_pcfSupported;
144
};
151
};
145
152
146
std::ostream &operator << (std::ostream &os, const CfParameterSet &cfParameterSet);
153
std::ostream &operator << (std::ostream &os, const CfParameterSet &cfparameterset);
147
154
148
} //namespace ns3
155
} //namespace ns3
149
156
(-)a/src/wifi/model/dsss-parameter-set.cc (+21 lines)
 Lines 90-93    Link Here 
90
  return length;
90
  return length;
91
}
91
}
92
92
93
void
94
DsssParameterSet::Print (std::ostream& os) const
95
{
96
  os << +m_currentChannel;
97
}
98
99
/**
100
 * output stream output operator
101
 *
102
 * \param os output stream
103
 * \param dsssparameterset the DSSS parameter set
104
 *
105
 * \returns output stream
106
 */
107
std::ostream &
108
operator << (std::ostream &os, const DsssParameterSet &dsssparameterset)
109
{
110
  dsssparameterset.Print (os);
111
  return os;
112
}
113
93
} //namespace ns3
114
} //namespace ns3
(-)a/src/wifi/model/dsss-parameter-set.h (+9 lines)
 Lines 90-95    Link Here 
90
   */
90
   */
91
  uint16_t GetSerializedSize () const;
91
  uint16_t GetSerializedSize () const;
92
92
93
  /**
94
   * Generate human-readable form of DSSS Parameter Set
95
   *
96
   * \param os output stream
97
   */
98
  void Print (std::ostream& os) const;
99
93
100
94
private:
101
private:
95
  uint8_t m_currentChannel; ///< current channel number
102
  uint8_t m_currentChannel; ///< current channel number
 Lines 98-103    Link Here 
98
  bool m_dsssSupported;
105
  bool m_dsssSupported;
99
};
106
};
100
107
108
std::ostream &operator << (std::ostream &os, const DsssParameterSet &dsssparameterset);
109
101
} //namespace ns3
110
} //namespace ns3
102
111
103
#endif /* DSSS_PARAMETER_SET_H */
112
#endif /* DSSS_PARAMETER_SET_H */
(-)a/src/wifi/model/edca-parameter-set.cc (+25 lines)
 Lines 350-353    Link Here 
350
  return length;
350
  return length;
351
}
351
}
352
352
353
void
354
EdcaParameterSet::Print (std::ostream& os) const
355
{
356
  os << +m_qosInfo << "|"
357
     << m_acBE << "|"
358
     << m_acBK << "|"
359
     << m_acVI << "|"
360
     << m_acVO;
361
}
362
363
/**
364
 * output stream output operator
365
 *
366
 * \param os output stream
367
 * \param edcaparameterset the EDCA parameter set
368
 *
369
 * \returns output stream
370
 */
371
std::ostream &
372
operator << (std::ostream &os, const EdcaParameterSet &edcaparameterset)
373
{
374
  edcaparameterset.Print (os);
375
  return os;
376
}
377
353
} //namespace ns3
378
} //namespace ns3
(-)a/src/wifi/model/edca-parameter-set.h (-2 / +11 lines)
 Lines 311-322    Link Here 
311
   */
311
   */
312
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
312
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
313
  /**
313
  /**
314
   * Return the serialized size of this EDCA Parameter Set.
314
   * Return the serialized size of this EDCA Parameter Set IE.
315
   *
315
   *
316
   * \return the serialized size of this EDCA Parameter Set
316
   * \return the serialized size of this EDCA Parameter Set IE
317
   */
317
   */
318
  uint16_t GetSerializedSize () const;
318
  uint16_t GetSerializedSize () const;
319
319
320
  /**
321
   * Generate human-readable form of EDCA Parameter Set IE
322
   *
323
   * \param os output stream
324
   */
325
  void Print (std::ostream& os) const;
326
320
327
321
private:
328
private:
322
  uint8_t m_qosInfo;  ///< QOS info
329
  uint8_t m_qosInfo;  ///< QOS info
 Lines 330-335    Link Here 
330
  bool m_qosSupported;
337
  bool m_qosSupported;
331
};
338
};
332
339
340
std::ostream &operator << (std::ostream &os, const EdcaParameterSet &edcaparameterset);
341
333
} //namespace ns3
342
} //namespace ns3
334
343
335
#endif /* EDCA_PARAMETER_SET_H */
344
#endif /* EDCA_PARAMETER_SET_H */
(-)a/src/wifi/model/erp-information.cc (-5 / +10 lines)
 Lines 121-141    Link Here 
121
  return length;
121
  return length;
122
}
122
}
123
123
124
void
125
ErpInformation::Print (std::ostream& os) const
126
{
127
  os <<  bool (GetBarkerPreambleMode ())
128
     << "|" << bool (GetUseProtection ())
129
     << "|" << bool (GetNonErpPresent ());
130
}
131
124
/**
132
/**
125
 * output stream output operator
133
 * output stream output operator
126
 *
134
 *
127
 * \param os output stream
135
 * \param os output stream
128
 * \param erpinformation
136
 * \param erpinformation the ERP information
129
 *
137
 *
130
 * \returns output stream
138
 * \returns output stream
131
 */
139
 */
132
std::ostream &
140
std::ostream &
133
operator << (std::ostream &os, const ErpInformation &erpinformation)
141
operator << (std::ostream &os, const ErpInformation &erpinformation)
134
{
142
{
135
  os <<  bool (erpinformation.GetBarkerPreambleMode ())
143
  erpinformation.Print (os);
136
     << "|" << bool (erpinformation.GetUseProtection ())
137
     << "|" << bool (erpinformation.GetNonErpPresent ());
138
139
  return os;
144
  return os;
140
}
145
}
141
146
(-)a/src/wifi/model/erp-information.h (-10 / +10 lines)
 Lines 121-132    Link Here 
121
   */
121
   */
122
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
122
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
123
  /**
123
  /**
124
   * Return the serialized size of this ErpInformation information element.
124
   * Return the serialized size of this ERP Information IE.
125
   *
125
   *
126
   * \return the serialized size of this ErpInformation information element
126
   * \return the serialized size of this ERP Information IE
127
   */
127
   */
128
  uint16_t GetSerializedSize () const;
128
  uint16_t GetSerializedSize () const;
129
129
130
  /**
131
   * Generate human-readable form of ERP Information IE
132
   *
133
   * \param os output stream
134
   */
135
  void Print (std::ostream& os) const;
136
137
130
private:
138
private:
131
  uint8_t m_erpInformation; ///< ERP information
139
  uint8_t m_erpInformation; ///< ERP information
132
140
 Lines 134-147    Link Here 
134
  bool m_erpSupported;
142
  bool m_erpSupported;
135
};
143
};
136
144
137
/**
138
 * output stream output operator
139
 *
140
 * \param os output stream
141
 * \param erpinformation
142
 *
143
 * \returns output stream
144
 */
145
std::ostream &operator << (std::ostream &os, const ErpInformation &erpinformation);
145
std::ostream &operator << (std::ostream &os, const ErpInformation &erpinformation);
146
146
147
} //namespace ns3
147
} //namespace ns3
(-)a/src/wifi/model/extended-capabilities.cc (-1 / +7 lines)
 Lines 393-398    Link Here 
393
  return length;
393
  return length;
394
}
394
}
395
395
396
void
397
ExtendedCapabilities::Print (std::ostream& os) const
398
{
399
  os << +GetExtendedCapabilitiesByte1 ();
400
}
401
396
/**
402
/**
397
 * output stream output operator
403
 * output stream output operator
398
 *
404
 *
 Lines 404-410    Link Here 
404
std::ostream &
410
std::ostream &
405
operator << (std::ostream &os, const ExtendedCapabilities &extendedcapabilities)
411
operator << (std::ostream &os, const ExtendedCapabilities &extendedcapabilities)
406
{
412
{
407
  os << +extendedcapabilities.GetExtendedCapabilitiesByte1 ();
413
  extendedcapabilities.Print (os);
408
  return os;
414
  return os;
409
}
415
}
410
416
(-)a/src/wifi/model/extended-capabilities.h (+7 lines)
 Lines 194-199    Link Here 
194
   */
194
   */
195
  uint16_t GetSerializedSize () const;
195
  uint16_t GetSerializedSize () const;
196
196
197
  /**
198
   * Generate human-readable form of extended capabilities information element
199
   *
200
   * \param os output stream
201
   */
202
  void Print (std::ostream& os) const;
203
197
204
198
private:
205
private:
199
  //fields supported by HT and VHT
206
  //fields supported by HT and VHT
(-)a/src/wifi/model/he-capabilities.cc (-7 / +13 lines)
 Lines 469-488    Link Here 
469
  return m_highestNssSupportedM1 + 1;
469
  return m_highestNssSupportedM1 + 1;
470
}
470
}
471
471
472
void
473
HeCapabilities::Print (std::ostream& os) const
474
{
475
  os << GetHeMacCapabilitiesInfo1 () << "|"
476
     << +GetHeMacCapabilitiesInfo2 () << "|"
477
     << GetHePhyCapabilitiesInfo1 () << "|"
478
     << +GetHePhyCapabilitiesInfo2 () << "|"
479
     << GetSupportedMcsAndNss ();
480
}
481
472
/**
482
/**
473
 * output stream output operator
483
 * output stream output operator
474
 * \param os the output stream
484
 * \param os the output stream
475
 * \param HeCapabilities the HE capabilities
485
 * \param hecapabilities the HE capabilities
476
 * \returns the output stream
486
 * \returns the output stream
477
 */
487
 */
478
std::ostream &
488
std::ostream &
479
operator << (std::ostream &os, const HeCapabilities &HeCapabilities)
489
operator << (std::ostream &os, const HeCapabilities &hecapabilities)
480
{
490
{
481
  os << HeCapabilities.GetHeMacCapabilitiesInfo1 () << "|"
491
  hecapabilities.Print (os);
482
     << +HeCapabilities.GetHeMacCapabilitiesInfo2 () << "|"
483
     << HeCapabilities.GetHePhyCapabilitiesInfo1 () << "|"
484
     << +HeCapabilities.GetHePhyCapabilitiesInfo2 () << "|"
485
     << HeCapabilities.GetSupportedMcsAndNss ();
486
  return os;
492
  return os;
487
}
493
}
488
494
(-)a/src/wifi/model/he-capabilities.h (-1 / +8 lines)
 Lines 210-215    Link Here 
210
   */
210
   */
211
  uint16_t GetSerializedSize () const;
211
  uint16_t GetSerializedSize () const;
212
212
213
  /**
214
   * Generate human-readable form of HE capabilities information element
215
   *
216
   * \param os output stream
217
   */
218
  void Print (std::ostream& os) const;
219
213
220
214
private:
221
private:
215
  //MAC Capabilities Info fields
222
  //MAC Capabilities Info fields
 Lines 285-291    Link Here 
285
  uint8_t m_heSupported;
292
  uint8_t m_heSupported;
286
};
293
};
287
294
288
std::ostream &operator << (std::ostream &os, const HeCapabilities &HeCapabilities);
295
std::ostream &operator << (std::ostream &os, const HeCapabilities &hecapabilities);
289
296
290
} //namespace ns3
297
} //namespace ns3
291
298
(-)a/src/wifi/model/he-operation.cc (-4 / +10 lines)
 Lines 150-168    Link Here 
150
  return length;
150
  return length;
151
}
151
}
152
152
153
void
154
HeOperation::Print (std::ostream& os) const
155
{
156
  os << GetHeOperationParameters () << "|"
157
     << GetBasicHeMcsAndNssSet ();
158
}
159
153
/**
160
/**
154
 * output stream output operator
161
 * output stream output operator
155
 *
162
 *
156
 * \param os output stream
163
 * \param os output stream
157
 * \param HeOperation the HE operation
164
 * \param heoperation the HE operation
158
 *
165
 *
159
 * \returns output stream
166
 * \returns output stream
160
 */
167
 */
161
std::ostream &
168
std::ostream &
162
operator << (std::ostream &os, const HeOperation &HeOperation)
169
operator << (std::ostream &os, const HeOperation &heoperation)
163
{
170
{
164
  os << HeOperation.GetHeOperationParameters () << "|"
171
  heoperation.Print (os);
165
     << HeOperation.GetBasicHeMcsAndNssSet ();
166
  return os;
172
  return os;
167
}
173
}
168
174
(-)a/src/wifi/model/he-operation.h (+7 lines)
 Lines 117-122    Link Here 
117
   */
117
   */
118
  uint16_t GetSerializedSize () const;
118
  uint16_t GetSerializedSize () const;
119
119
120
  /**
121
   * Generate human-readable form of HE Operations IE
122
   *
123
   * \param os output stream
124
   */
125
  void Print (std::ostream& os) const;
126
120
127
121
private:
128
private:
122
  //HE Operation Parameters fields
129
  //HE Operation Parameters fields
(-)a/src/wifi/model/ht-capabilities.cc (-8 / +14 lines)
 Lines 523-528    Link Here 
523
  return length;
523
  return length;
524
}
524
}
525
525
526
void
527
HtCapabilities::Print (std::ostream& os) const
528
{
529
  os << bool (GetLdpc ())
530
     << "|" << bool (GetSupportedChannelWidth ())
531
     << "|" << bool (GetGreenfield ())
532
     << "|" << bool (GetShortGuardInterval20 ()) << "|";
533
  for (uint8_t i = 0; i < MAX_SUPPORTED_MCS; i++)
534
    {
535
      os << IsSupportedMcs (i) << " ";
536
    }
537
}
538
526
/**
539
/**
527
 * output stream output operator
540
 * output stream output operator
528
 *
541
 *
 Lines 534-547    Link Here 
534
std::ostream &
547
std::ostream &
535
operator << (std::ostream &os, const HtCapabilities &htcapabilities)
548
operator << (std::ostream &os, const HtCapabilities &htcapabilities)
536
{
549
{
537
  os << bool (htcapabilities.GetLdpc ())
550
  htcapabilities.Print (os);
538
     << "|" << bool (htcapabilities.GetSupportedChannelWidth ())
539
     << "|" << bool (htcapabilities.GetGreenfield ())
540
     << "|" << bool (htcapabilities.GetShortGuardInterval20 ()) << "|";
541
  for (uint8_t i = 0; i < MAX_SUPPORTED_MCS; i++)
542
    {
543
      os << htcapabilities.IsSupportedMcs (i) << " ";
544
    }
545
  return os;
551
  return os;
546
}
552
}
547
553
(-)a/src/wifi/model/ht-capabilities.h (-3 / +10 lines)
 Lines 298-310    Link Here 
298
   */
298
   */
299
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
299
  Buffer::Iterator Serialize (Buffer::Iterator start) const;
300
  /**
300
  /**
301
   * Return the serialized size of this HT capability
301
   * Return the serialized size of this HT capabilities
302
   * information element.
302
   * information element.
303
   *
303
   *
304
   * \return the serialized size of this HT capability information element
304
   * \return the serialized size of this HT capabilities information element
305
   */
305
   */
306
  uint16_t GetSerializedSize () const;
306
  uint16_t GetSerializedSize () const;
307
307
308
  /**
309
   * Generate human-readable form of HT capabilities information element
310
   *
311
   * \param os output stream
312
   */
313
  void Print (std::ostream& os) const;
314
308
315
309
private:
316
private:
310
  //HT Capabilities Info field
317
  //HT Capabilities Info field
 Lines 388-391    Link Here 
388
395
389
} //namespace ns3
396
} //namespace ns3
390
397
391
#endif /* HT_CAPABILITY_H */
398
#endif /* HT_CAPABILITIES_H */
(-)a/src/wifi/model/ht-operation.cc (-22 / +28 lines)
 Lines 489-494    Link Here 
489
  return length;
489
  return length;
490
}
490
}
491
491
492
void
493
HtOperation::Print (std::ostream& os) const
494
{
495
  os << bool (GetPrimaryChannel ())
496
     << "|" << +GetSecondaryChannelOffset ()
497
     << "|" << bool (GetStaChannelWidth ())
498
     << "|" << bool (GetRifsMode ())
499
     << "|" << +GetHtProtection ()
500
     << "|" << bool (GetNonGfHtStasPresent ())
501
     << "|" << bool (GetObssNonHtStasPresent ())
502
     << "|" << bool (GetDualBeacon ())
503
     << "|" << bool (GetDualCtsProtection ())
504
     << "|" << bool (GetStbcBeacon ())
505
     << "|" << bool (GetLSigTxopProtectionFullSupport ())
506
     << "|" << bool (GetPcoActive ())
507
     << "|" << bool (GetPhase ())
508
     << "|" << GetRxHighestSupportedDataRate ()
509
     << "|" << bool (GetTxMcsSetDefined ())
510
     << "|" << bool (GetTxRxMcsSetUnequal ())
511
     << "|" << +GetTxMaxNSpatialStreams ()
512
     << "|" << bool (GetTxUnequalModulation ()) << "|";
513
  for (uint8_t i = 0; i < MAX_SUPPORTED_MCS; i++)
514
    {
515
      os << IsSupportedMcs (i) << " ";
516
    }
517
}
518
492
/**
519
/**
493
 * output stream output operator
520
 * output stream output operator
494
 *
521
 *
 Lines 500-527    Link Here 
500
std::ostream &
527
std::ostream &
501
operator << (std::ostream &os, const HtOperation &htOperation)
528
operator << (std::ostream &os, const HtOperation &htOperation)
502
{
529
{
503
  os << bool (htOperation.GetPrimaryChannel ())
530
  htOperation.Print (os);
504
     << "|" << +htOperation.GetSecondaryChannelOffset ()
505
     << "|" << bool (htOperation.GetStaChannelWidth ())
506
     << "|" << bool (htOperation.GetRifsMode ())
507
     << "|" << +htOperation.GetHtProtection ()
508
     << "|" << bool (htOperation.GetNonGfHtStasPresent ())
509
     << "|" << bool (htOperation.GetObssNonHtStasPresent ())
510
     << "|" << bool (htOperation.GetDualBeacon ())
511
     << "|" << bool (htOperation.GetDualCtsProtection ())
512
     << "|" << bool (htOperation.GetStbcBeacon ())
513
     << "|" << bool (htOperation.GetLSigTxopProtectionFullSupport ())
514
     << "|" << bool (htOperation.GetPcoActive ())
515
     << "|" << bool (htOperation.GetPhase ())
516
     << "|" << htOperation.GetRxHighestSupportedDataRate ()
517
     << "|" << bool (htOperation.GetTxMcsSetDefined ())
518
     << "|" << bool (htOperation.GetTxRxMcsSetUnequal ())
519
     << "|" << +htOperation.GetTxMaxNSpatialStreams ()
520
     << "|" << bool (htOperation.GetTxUnequalModulation ()) << "|";
521
  for (uint8_t i = 0; i < MAX_SUPPORTED_MCS; i++)
522
    {
523
      os << htOperation.IsSupportedMcs (i) << " ";
524
    }
525
  return os;
531
  return os;
526
}
532
}
527
533
(-)a/src/wifi/model/ht-operation.h (+7 lines)
 Lines 400-405    Link Here 
400
   */
400
   */
401
  uint16_t GetSerializedSize () const;
401
  uint16_t GetSerializedSize () const;
402
402
403
  /**
404
   * Generate human-readable form of HT Operation IE
405
   *
406
   * \param os output stream
407
   */
408
  void Print (std::ostream& os) const;
409
403
410
404
private:
411
private:
405
  uint8_t m_primaryChannel; ///< primary channel
412
  uint8_t m_primaryChannel; ///< primary channel
(-)a/src/wifi/model/mgt-headers.cc (-525 / +198 lines)
 Lines 26-33    Link Here 
26
26
27
namespace ns3 {
27
namespace ns3 {
28
28
29
void
30
MgtCommonHeader::AddWifiInformationElement (Ptr<WifiInformationElement> element)
31
{
32
  m_map[element->ElementId ()] = element;
33
}
34
35
Ptr<WifiInformationElement>
36
MgtCommonHeader::GetInformationElement (WifiInformationElementId id)
37
{
38
  WifiInformationElementMap::const_iterator it = m_map.find (id);
39
  if (it != m_map.end())
40
    {
41
      return it->second;
42
    }
43
  else
44
    {
45
      return 0;
46
    }
47
}
48
49
uint32_t
50
MgtCommonHeader::GetInformationElementsSerializedSize (void) const
51
{
52
  Ptr<WifiInformationElement> element;
53
  uint32_t size = 0;
54
  for (WifiInformationElementMap::const_iterator elem = m_map.begin (); elem != m_map.end (); elem++)
55
    {
56
      element = elem->second;
57
      size += element->GetSerializedSize ();
58
    }
59
  return size;
60
}
61
62
WifiInformationElementMap
63
MgtCommonHeader::GetListOfInformationElement (void) const
64
{
65
  return m_map;
66
}
67
68
void
69
MgtCommonHeader::PrintInformationElements (std::ostream &os) const
70
{
71
  Ptr<WifiInformationElement> element;
72
  for (WifiInformationElementMap::const_iterator elem = m_map.begin (); elem != m_map.end ();)
73
    {
74
      switch (elem->first)
75
        {
76
          case IE_HT_CAPABILITIES:
77
              os << "HT Capabilities=";
78
              break;
79
          case IE_VHT_CAPABILITIES:
80
              os << "VHT Capabilities=";
81
              break;
82
          case IE_HE_CAPABILITIES:
83
              os << "HE Capabilities=";
84
              break;
85
          case IE_EXTENDED_CAPABILITIES:
86
              os << "Extended Capabilities=";
87
              break;
88
          case IE_HT_OPERATION:
89
              os << "HT Operation=";
90
              break;
91
          case IE_VHT_OPERATION:
92
              os << "VHT Operation=";
93
              break;
94
          case IE_HE_OPERATION:
95
              os << "HE Operation=";
96
              break;
97
          case IE_ERP_INFORMATION:
98
              os << "ERP information=";
99
              break;
100
          case IE_EDCA_PARAMETER_SET:
101
              os << "EDCA parameter set=";
102
              break;
103
          case IE_DSSS_PARAMETER_SET:
104
              os << "DSSS parameter set=";
105
              break;
106
          case IE_CF_PARAMETER_SET:
107
              os << "CF parameter set=";
108
              break;
109
          default:
110
              os << "Unknown IE=";
111
              break;
112
        }
113
      elem->second->Print (os);
114
      ++elem;
115
      if (elem != m_map.end ())
116
        {
117
          os << " , ";
118
        }
119
    }
120
}
121
122
Buffer::Iterator
123
MgtCommonHeader::SerializeInformationElements (Buffer::Iterator start) const
124
{
125
  Buffer::Iterator i = start;
126
  Ptr<WifiInformationElement> element;
127
  for (WifiInformationElementMap::const_iterator elem = m_map.begin (); elem != m_map.end (); elem++)
128
    {
129
      element = elem->second;
130
      i = element->Serialize (i);
131
    }
132
  return i;
133
}
134
135
Buffer::Iterator
136
MgtCommonHeader::DeserializeInformationElements (Buffer::Iterator start)
137
{
138
  Buffer::Iterator i = start;
139
  Ptr<WifiInformationElement> element;
140
  uint8_t id, length;
141
  while ((!i.IsEnd ()) && (i.GetRemainingSize() > 2))
142
    {
143
      id = i.ReadU8 ();
144
      length = i.ReadU8 ();
145
      switch (id)
146
        {
147
          case IE_HT_CAPABILITIES:
148
              element = Create<HtCapabilities> ();
149
              break;
150
          case IE_VHT_CAPABILITIES:
151
              element = Create<VhtCapabilities> ();
152
              break;
153
          case IE_HE_CAPABILITIES:
154
              element = Create<HeCapabilities> ();
155
              break;
156
          case IE_EXTENDED_CAPABILITIES:
157
              element = Create<ExtendedCapabilities> ();
158
              break;
159
          case IE_HT_OPERATION:
160
              element = Create<HtOperation> ();
161
              break;
162
          case IE_VHT_OPERATION:
163
              element = Create<VhtOperation> ();
164
              break;
165
          case IE_HE_OPERATION:
166
              element = Create<HeOperation> ();
167
              break;
168
          case IE_ERP_INFORMATION:
169
              element = Create<ErpInformation> ();
170
              break;
171
          case IE_EDCA_PARAMETER_SET:
172
              element = Create<EdcaParameterSet> ();
173
              break;
174
          case IE_DSSS_PARAMETER_SET:
175
              element = Create<DsssParameterSet> ();
176
              break;
177
          case IE_CF_PARAMETER_SET:
178
              element = Create<CfParameterSet> ();
179
              break;
180
          default:
181
              // We peeked at the ID and length, so we need to back up the
182
              // pointer before deferring to our parent.
183
              i.Prev (2);
184
              return i;
185
        }
186
      i = element->DeserializeElementBody (i, length);
187
      m_map[id] = element;
188
    }
189
  return i;
190
}
191
29
/***********************************************************
192
/***********************************************************
30
 *          Probe Request
193
 *                    Probe Request
31
 ***********************************************************/
194
 ***********************************************************/
32
195
33
NS_OBJECT_ENSURE_REGISTERED (MgtProbeRequestHeader);
196
NS_OBJECT_ENSURE_REGISTERED (MgtProbeRequestHeader);
 Lines 60-113    Link Here 
60
  m_rates = rates;
223
  m_rates = rates;
61
}
224
}
62
225
63
void
64
MgtProbeRequestHeader::SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities)
65
{
66
  m_extendedCapability = extendedcapabilities;
67
}
68
69
ExtendedCapabilities
70
MgtProbeRequestHeader::GetExtendedCapabilities (void) const
71
{
72
  return m_extendedCapability;
73
}
74
75
void
76
MgtProbeRequestHeader::SetHtCapabilities (HtCapabilities htcapabilities)
77
{
78
  m_htCapability = htcapabilities;
79
}
80
81
HtCapabilities
82
MgtProbeRequestHeader::GetHtCapabilities (void) const
83
{
84
  return m_htCapability;
85
}
86
87
void
88
MgtProbeRequestHeader::SetVhtCapabilities (VhtCapabilities vhtcapabilities)
89
{
90
  m_vhtCapability = vhtcapabilities;
91
}
92
93
VhtCapabilities
94
MgtProbeRequestHeader::GetVhtCapabilities (void) const
95
{
96
  return m_vhtCapability;
97
}
98
99
void
100
MgtProbeRequestHeader::SetHeCapabilities (HeCapabilities hecapabilities)
101
{
102
  m_heCapability = hecapabilities;
103
}
104
105
HeCapabilities
106
MgtProbeRequestHeader::GetHeCapabilities (void) const
107
{
108
  return m_heCapability;
109
}
110
111
SupportedRates
226
SupportedRates
112
MgtProbeRequestHeader::GetSupportedRates (void) const
227
MgtProbeRequestHeader::GetSupportedRates (void) const
113
{
228
{
 Lines 121-130    Link Here 
121
  size += m_ssid.GetSerializedSize ();
236
  size += m_ssid.GetSerializedSize ();
122
  size += m_rates.GetSerializedSize ();
237
  size += m_rates.GetSerializedSize ();
123
  size += m_rates.extended.GetSerializedSize ();
238
  size += m_rates.extended.GetSerializedSize ();
124
  size += m_extendedCapability.GetSerializedSize ();
239
  size += GetInformationElementsSerializedSize ();
125
  size += m_htCapability.GetSerializedSize ();
126
  size += m_vhtCapability.GetSerializedSize ();
127
  size += m_heCapability.GetSerializedSize ();
128
  return size;
240
  return size;
129
}
241
}
130
242
 Lines 149-159    Link Here 
149
MgtProbeRequestHeader::Print (std::ostream &os) const
261
MgtProbeRequestHeader::Print (std::ostream &os) const
150
{
262
{
151
  os << "ssid=" << m_ssid << ", "
263
  os << "ssid=" << m_ssid << ", "
152
     << "rates=" << m_rates << ", "
264
     << "rates=" << m_rates << ", ";
153
     << "Extended Capabilities=" << m_extendedCapability << " , "
265
  PrintInformationElements (os);
154
     << "HT Capabilities=" << m_htCapability << " , "
155
     << "VHT Capabilities=" << m_vhtCapability << " , "
156
     << "HE Capabilities=" << m_heCapability;
157
}
266
}
158
267
159
void
268
void
 Lines 163-172    Link Here 
163
  i = m_ssid.Serialize (i);
272
  i = m_ssid.Serialize (i);
164
  i = m_rates.Serialize (i);
273
  i = m_rates.Serialize (i);
165
  i = m_rates.extended.Serialize (i);
274
  i = m_rates.extended.Serialize (i);
166
  i = m_extendedCapability.Serialize (i);
275
  i = SerializeInformationElements (i);
167
  i = m_htCapability.Serialize (i);
168
  i = m_vhtCapability.Serialize (i);
169
  i = m_heCapability.Serialize (i);
170
}
276
}
171
277
172
uint32_t
278
uint32_t
 Lines 176-191    Link Here 
176
  i = m_ssid.Deserialize (i);
282
  i = m_ssid.Deserialize (i);
177
  i = m_rates.Deserialize (i);
283
  i = m_rates.Deserialize (i);
178
  i = m_rates.extended.DeserializeIfPresent (i);
284
  i = m_rates.extended.DeserializeIfPresent (i);
179
  i = m_extendedCapability.DeserializeIfPresent (i);
285
  i = DeserializeInformationElements (i);
180
  i = m_htCapability.DeserializeIfPresent (i);
181
  i = m_vhtCapability.DeserializeIfPresent (i);
182
  i = m_heCapability.DeserializeIfPresent (i);
183
  return i.GetDistanceFrom (start);
286
  return i.GetDistanceFrom (start);
184
}
287
}
185
288
186
289
187
/***********************************************************
290
/***********************************************************
188
 *          Probe Response
291
 *                    Probe Response
189
 ***********************************************************/
292
 ***********************************************************/
190
293
191
NS_OBJECT_ENSURE_REGISTERED (MgtProbeResponseHeader);
294
NS_OBJECT_ENSURE_REGISTERED (MgtProbeResponseHeader);
 Lines 235-336    Link Here 
235
}
338
}
236
339
237
void
340
void
238
MgtProbeResponseHeader::SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities)
239
{
240
  m_extendedCapability = extendedcapabilities;
241
}
242
243
ExtendedCapabilities
244
MgtProbeResponseHeader::GetExtendedCapabilities (void) const
245
{
246
  return m_extendedCapability;
247
}
248
249
void
250
MgtProbeResponseHeader::SetHtCapabilities (HtCapabilities htcapabilities)
251
{
252
  m_htCapability = htcapabilities;
253
}
254
255
HtCapabilities
256
MgtProbeResponseHeader::GetHtCapabilities (void) const
257
{
258
  return m_htCapability;
259
}
260
261
void
262
MgtProbeResponseHeader::SetHtOperation (HtOperation htoperation)
263
{
264
  m_htOperation = htoperation;
265
}
266
267
HtOperation
268
MgtProbeResponseHeader::GetHtOperation (void) const
269
{
270
  return m_htOperation;
271
}
272
273
void
274
MgtProbeResponseHeader::SetVhtCapabilities (VhtCapabilities vhtcapabilities)
275
{
276
  m_vhtCapability = vhtcapabilities;
277
}
278
279
VhtCapabilities
280
MgtProbeResponseHeader::GetVhtCapabilities (void) const
281
{
282
  return m_vhtCapability;
283
}
284
285
void
286
MgtProbeResponseHeader::SetVhtOperation (VhtOperation vhtoperation)
287
{
288
  m_vhtOperation = vhtoperation;
289
}
290
291
VhtOperation
292
MgtProbeResponseHeader::GetVhtOperation (void) const
293
{
294
  return m_vhtOperation;
295
}
296
297
void
298
MgtProbeResponseHeader::SetHeCapabilities (HeCapabilities hecapabilities)
299
{
300
  m_heCapability = hecapabilities;
301
}
302
303
HeCapabilities
304
MgtProbeResponseHeader::GetHeCapabilities (void) const
305
{
306
  return m_heCapability;
307
}
308
309
void
310
MgtProbeResponseHeader::SetHeOperation (HeOperation heoperation)
311
{
312
  m_heOperation = heoperation;
313
}
314
315
HeOperation
316
MgtProbeResponseHeader::GetHeOperation (void) const
317
{
318
  return m_heOperation;
319
}
320
321
void
322
MgtProbeResponseHeader::SetCfParameterSet (CfParameterSet cfparameterset)
323
{
324
  m_cfParameterSet = cfparameterset;
325
}
326
327
CfParameterSet
328
MgtProbeResponseHeader::GetCfParameterSet (void) const
329
{
330
  return m_cfParameterSet;
331
}
332
333
void
334
MgtProbeResponseHeader::SetSsid (Ssid ssid)
341
MgtProbeResponseHeader::SetSsid (Ssid ssid)
335
{
342
{
336
  m_ssid = ssid;
343
  m_ssid = ssid;
 Lines 348-389    Link Here 
348
  m_rates = rates;
355
  m_rates = rates;
349
}
356
}
350
357
351
void
352
MgtProbeResponseHeader::SetDsssParameterSet (DsssParameterSet dsssParameterSet)
353
{
354
  m_dsssParameterSet = dsssParameterSet;
355
}
356
357
DsssParameterSet
358
MgtProbeResponseHeader::GetDsssParameterSet (void) const
359
{
360
  return m_dsssParameterSet;
361
}
362
363
void
364
MgtProbeResponseHeader::SetErpInformation (ErpInformation erpInformation)
365
{
366
  m_erpInformation = erpInformation;
367
}
368
369
ErpInformation
370
MgtProbeResponseHeader::GetErpInformation (void) const
371
{
372
  return m_erpInformation;
373
}
374
375
void
376
MgtProbeResponseHeader::SetEdcaParameterSet (EdcaParameterSet edcaparameters)
377
{
378
  m_edcaParameterSet = edcaparameters;
379
}
380
381
EdcaParameterSet
382
MgtProbeResponseHeader::GetEdcaParameterSet (void) const
383
{
384
  return m_edcaParameterSet;
385
}
386
387
TypeId
358
TypeId
388
MgtProbeResponseHeader::GetTypeId (void)
359
MgtProbeResponseHeader::GetTypeId (void)
389
{
360
{
 Lines 410-443    Link Here 
410
  size += m_capability.GetSerializedSize ();
381
  size += m_capability.GetSerializedSize ();
411
  size += m_ssid.GetSerializedSize ();
382
  size += m_ssid.GetSerializedSize ();
412
  size += m_rates.GetSerializedSize ();
383
  size += m_rates.GetSerializedSize ();
413
  size += m_cfParameterSet.GetSerializedSize ();
414
  size += m_dsssParameterSet.GetSerializedSize ();
415
  size += m_erpInformation.GetSerializedSize ();
416
  size += m_rates.extended.GetSerializedSize ();
384
  size += m_rates.extended.GetSerializedSize ();
417
  size += m_edcaParameterSet.GetSerializedSize ();
385
  size += GetInformationElementsSerializedSize ();
418
  size += m_extendedCapability.GetSerializedSize ();
419
  size += m_htCapability.GetSerializedSize ();
420
  size += m_htOperation.GetSerializedSize ();
421
  size += m_vhtCapability.GetSerializedSize ();
422
  size += m_vhtOperation.GetSerializedSize ();
423
  size += m_heCapability.GetSerializedSize ();
424
  size += m_heOperation.GetSerializedSize ();
425
  return size;
386
  return size;
426
}
387
}
427
388
428
void
389
void
429
MgtProbeResponseHeader::Print (std::ostream &os) const
390
MgtProbeResponseHeader::Print (std::ostream &os) const
430
{
391
{
431
  os << "ssid=" << m_ssid << ", "
392
  os << "Timestamp=" << m_timestamp << ", " <<
432
     << "rates=" << m_rates << ", "
393
        "BeaconInterval=" << m_beaconInterval  << ", " <<
433
     << "ERP information=" << m_erpInformation << ", "
394
        "rates=" << m_rates << ", "
434
     << "Extended Capabilities=" << m_extendedCapability << " , "
395
        "ssid=" << m_ssid << ", ";
435
     << "HT Capabilities=" << m_htCapability << " , "
396
  PrintInformationElements (os);
436
     << "HT Operation=" << m_htOperation << " , "
437
     << "VHT Capabilities=" << m_vhtCapability << " , "
438
     << "VHT Operation=" << m_vhtOperation << " , "
439
     << "HE Capabilities=" << m_heCapability << " , "
440
     << "HE Operation=" << m_heOperation;
441
}
397
}
442
398
443
void
399
void
 Lines 448-475    Link Here 
448
  //capability information
404
  //capability information
449
  //ssid
405
  //ssid
450
  //supported rates
406
  //supported rates
451
  //fh parameter set
452
  //ds parameter set
453
  //cf parameter set
454
  //ibss parameter set
455
  Buffer::Iterator i = start;
407
  Buffer::Iterator i = start;
456
  i.WriteHtolsbU64 (Simulator::Now ().GetMicroSeconds ());
408
  i.WriteHtolsbU64 (Simulator::Now ().GetMicroSeconds ());
457
  i.WriteHtolsbU16 (static_cast<uint16_t> (m_beaconInterval / 1024));
409
  i.WriteHtolsbU16 (static_cast<uint16_t> (m_beaconInterval / 1024));
458
  i = m_capability.Serialize (i);
410
  i = m_capability.Serialize (i);
459
  i = m_ssid.Serialize (i);
411
  i = m_ssid.Serialize (i);
460
  i = m_rates.Serialize (i);
412
  i = m_rates.Serialize (i);
461
  i = m_cfParameterSet.Serialize (i);
462
  i = m_dsssParameterSet.Serialize (i);
463
  i = m_erpInformation.Serialize (i);
464
  i = m_rates.extended.Serialize (i);
413
  i = m_rates.extended.Serialize (i);
465
  i = m_edcaParameterSet.Serialize (i);
414
  i = SerializeInformationElements (i);
466
  i = m_extendedCapability.Serialize (i);
467
  i = m_htCapability.Serialize (i);
468
  i = m_htOperation.Serialize (i);
469
  i = m_vhtCapability.Serialize (i);
470
  i = m_vhtOperation.Serialize (i);
471
  i = m_heCapability.Serialize (i);
472
  i = m_heOperation.Serialize (i);
473
}
415
}
474
416
475
uint32_t
417
uint32_t
 Lines 482-499    Link Here 
482
  i = m_capability.Deserialize (i);
424
  i = m_capability.Deserialize (i);
483
  i = m_ssid.Deserialize (i);
425
  i = m_ssid.Deserialize (i);
484
  i = m_rates.Deserialize (i);
426
  i = m_rates.Deserialize (i);
485
  i = m_cfParameterSet.DeserializeIfPresent (i);
486
  i = m_dsssParameterSet.DeserializeIfPresent (i);
487
  i = m_erpInformation.DeserializeIfPresent (i);
488
  i = m_rates.extended.DeserializeIfPresent (i);
427
  i = m_rates.extended.DeserializeIfPresent (i);
489
  i = m_edcaParameterSet.DeserializeIfPresent (i);
428
  i = DeserializeInformationElements (i);
490
  i = m_extendedCapability.DeserializeIfPresent (i);
491
  i = m_htCapability.DeserializeIfPresent (i);
492
  i = m_htOperation.DeserializeIfPresent (i);
493
  i = m_vhtCapability.DeserializeIfPresent (i);
494
  i = m_vhtOperation.DeserializeIfPresent (i);
495
  i = m_heCapability.DeserializeIfPresent (i);
496
  i = m_heOperation.DeserializeIfPresent (i);
497
  return i.GetDistanceFrom (start);
429
  return i.GetDistanceFrom (start);
498
}
430
}
499
431
 Lines 518-524    Link Here 
518
450
519
451
520
/***********************************************************
452
/***********************************************************
521
 *          Assoc Request
453
 *                    Assoc Request
522
 ***********************************************************/
454
 ***********************************************************/
523
455
524
NS_OBJECT_ENSURE_REGISTERED (MgtAssocRequestHeader);
456
NS_OBJECT_ENSURE_REGISTERED (MgtAssocRequestHeader);
 Lines 562-615    Link Here 
562
  return m_capability;
494
  return m_capability;
563
}
495
}
564
496
565
void
566
MgtAssocRequestHeader::SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities)
567
{
568
  m_extendedCapability = extendedcapabilities;
569
}
570
571
ExtendedCapabilities
572
MgtAssocRequestHeader::GetExtendedCapabilities (void) const
573
{
574
  return m_extendedCapability;
575
}
576
577
void
578
MgtAssocRequestHeader::SetHtCapabilities (HtCapabilities htcapabilities)
579
{
580
  m_htCapability = htcapabilities;
581
}
582
583
HtCapabilities
584
MgtAssocRequestHeader::GetHtCapabilities (void) const
585
{
586
  return m_htCapability;
587
}
588
589
void
590
MgtAssocRequestHeader::SetVhtCapabilities (VhtCapabilities vhtcapabilities)
591
{
592
  m_vhtCapability = vhtcapabilities;
593
}
594
595
VhtCapabilities
596
MgtAssocRequestHeader::GetVhtCapabilities (void) const
597
{
598
  return m_vhtCapability;
599
}
600
601
void
602
MgtAssocRequestHeader::SetHeCapabilities (HeCapabilities hecapabilities)
603
{
604
  m_heCapability = hecapabilities;
605
}
606
607
HeCapabilities
608
MgtAssocRequestHeader::GetHeCapabilities (void) const
609
{
610
  return m_heCapability;
611
}
612
613
Ssid
497
Ssid
614
MgtAssocRequestHeader::GetSsid (void) const
498
MgtAssocRequestHeader::GetSsid (void) const
615
{
499
{
 Lines 654-675    Link Here 
654
  size += m_ssid.GetSerializedSize ();
538
  size += m_ssid.GetSerializedSize ();
655
  size += m_rates.GetSerializedSize ();
539
  size += m_rates.GetSerializedSize ();
656
  size += m_rates.extended.GetSerializedSize ();
540
  size += m_rates.extended.GetSerializedSize ();
657
  size += m_extendedCapability.GetSerializedSize ();
541
  size += GetInformationElementsSerializedSize ();
658
  size += m_htCapability.GetSerializedSize ();
659
  size += m_vhtCapability.GetSerializedSize ();
660
  size += m_heCapability.GetSerializedSize ();
661
  return size;
542
  return size;
662
}
543
}
663
544
664
void
545
void
665
MgtAssocRequestHeader::Print (std::ostream &os) const
546
MgtAssocRequestHeader::Print (std::ostream &os) const
666
{
547
{
667
  os << "ssid=" << m_ssid << ", "
548
  os << "ssid=" << m_ssid  << ", "
668
     << "rates=" << m_rates << ", "
549
     << "rates=" << m_rates << ", ";
669
     << "Extended Capabilities=" << m_extendedCapability << " , "
550
  PrintInformationElements (os);
670
     << "HT Capabilities=" << m_htCapability << " , "
671
     << "VHT Capabilities=" << m_vhtCapability << " , "
672
     << "HE Capabilities=" << m_heCapability;
673
}
551
}
674
552
675
void
553
void
 Lines 681-690    Link Here 
681
  i = m_ssid.Serialize (i);
559
  i = m_ssid.Serialize (i);
682
  i = m_rates.Serialize (i);
560
  i = m_rates.Serialize (i);
683
  i = m_rates.extended.Serialize (i);
561
  i = m_rates.extended.Serialize (i);
684
  i = m_extendedCapability.Serialize (i);
562
  i = SerializeInformationElements (i);
685
  i = m_htCapability.Serialize (i);
686
  i = m_vhtCapability.Serialize (i);
687
  i = m_heCapability.Serialize (i);
688
}
563
}
689
564
690
uint32_t
565
uint32_t
 Lines 696-711    Link Here 
696
  i = m_ssid.Deserialize (i);
571
  i = m_ssid.Deserialize (i);
697
  i = m_rates.Deserialize (i);
572
  i = m_rates.Deserialize (i);
698
  i = m_rates.extended.DeserializeIfPresent (i);
573
  i = m_rates.extended.DeserializeIfPresent (i);
699
  i = m_extendedCapability.DeserializeIfPresent (i);
574
  i = DeserializeInformationElements (i);
700
  i = m_htCapability.DeserializeIfPresent (i);
701
  i = m_vhtCapability.DeserializeIfPresent (i);
702
  i = m_heCapability.DeserializeIfPresent (i);
703
  return i.GetDistanceFrom (start);
575
  return i.GetDistanceFrom (start);
704
}
576
}
705
577
706
578
707
/***********************************************************
579
/***********************************************************
708
 *          Ressoc Request
580
 *                     Ressoc Request
709
 ***********************************************************/
581
 ***********************************************************/
710
582
711
NS_OBJECT_ENSURE_REGISTERED (MgtReassocRequestHeader);
583
NS_OBJECT_ENSURE_REGISTERED (MgtReassocRequestHeader);
 Lines 749-802    Link Here 
749
  return m_capability;
621
  return m_capability;
750
}
622
}
751
623
752
void
753
MgtReassocRequestHeader::SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities)
754
{
755
  m_extendedCapability = extendedcapabilities;
756
}
757
758
ExtendedCapabilities
759
MgtReassocRequestHeader::GetExtendedCapabilities (void) const
760
{
761
  return m_extendedCapability;
762
}
763
764
void
765
MgtReassocRequestHeader::SetHtCapabilities (HtCapabilities htcapabilities)
766
{
767
  m_htCapability = htcapabilities;
768
}
769
770
HtCapabilities
771
MgtReassocRequestHeader::GetHtCapabilities (void) const
772
{
773
  return m_htCapability;
774
}
775
776
void
777
MgtReassocRequestHeader::SetVhtCapabilities (VhtCapabilities vhtcapabilities)
778
{
779
  m_vhtCapability = vhtcapabilities;
780
}
781
782
VhtCapabilities
783
MgtReassocRequestHeader::GetVhtCapabilities (void) const
784
{
785
  return m_vhtCapability;
786
}
787
788
void
789
MgtReassocRequestHeader::SetHeCapabilities (HeCapabilities hecapabilities)
790
{
791
  m_heCapability = hecapabilities;
792
}
793
794
HeCapabilities
795
MgtReassocRequestHeader::GetHeCapabilities (void) const
796
{
797
  return m_heCapability;
798
}
799
800
Ssid
624
Ssid
801
MgtReassocRequestHeader::GetSsid (void) const
625
MgtReassocRequestHeader::GetSsid (void) const
802
{
626
{
 Lines 848-857    Link Here 
848
  size += m_ssid.GetSerializedSize ();
672
  size += m_ssid.GetSerializedSize ();
849
  size += m_rates.GetSerializedSize ();
673
  size += m_rates.GetSerializedSize ();
850
  size += m_rates.extended.GetSerializedSize ();
674
  size += m_rates.extended.GetSerializedSize ();
851
  size += m_extendedCapability.GetSerializedSize ();
675
  size += GetInformationElementsSerializedSize ();
852
  size += m_htCapability.GetSerializedSize ();
853
  size += m_vhtCapability.GetSerializedSize ();
854
  size += m_heCapability.GetSerializedSize ();
855
  return size;
676
  return size;
856
}
677
}
857
678
 Lines 860-870    Link Here 
860
{
681
{
861
  os << "current AP address=" << m_currentApAddr << ", "
682
  os << "current AP address=" << m_currentApAddr << ", "
862
     << "ssid=" << m_ssid << ", "
683
     << "ssid=" << m_ssid << ", "
863
     << "rates=" << m_rates << ", "
684
     << "rates=" << m_rates << ", ";
864
     << "Extended Capabilities=" << m_extendedCapability << " , "
685
  PrintInformationElements (os);
865
     << "HT Capabilities=" << m_htCapability << " , "
866
     << "VHT Capabilities=" << m_vhtCapability << " , "
867
     << "HE Capabilities=" << m_heCapability;
868
}
686
}
869
687
870
void
688
void
 Lines 877-886    Link Here 
877
  i = m_ssid.Serialize (i);
695
  i = m_ssid.Serialize (i);
878
  i = m_rates.Serialize (i);
696
  i = m_rates.Serialize (i);
879
  i = m_rates.extended.Serialize (i);
697
  i = m_rates.extended.Serialize (i);
880
  i = m_extendedCapability.Serialize (i);
698
  i = SerializeInformationElements (i);
881
  i = m_htCapability.Serialize (i);
882
  i = m_vhtCapability.Serialize (i);
883
  i = m_heCapability.Serialize (i);
884
}
699
}
885
700
886
uint32_t
701
uint32_t
 Lines 893-908    Link Here 
893
  i = m_ssid.Deserialize (i);
708
  i = m_ssid.Deserialize (i);
894
  i = m_rates.Deserialize (i);
709
  i = m_rates.Deserialize (i);
895
  i = m_rates.extended.DeserializeIfPresent (i);
710
  i = m_rates.extended.DeserializeIfPresent (i);
896
  i = m_extendedCapability.DeserializeIfPresent (i);
711
  i = DeserializeInformationElements (i);
897
  i = m_htCapability.DeserializeIfPresent (i);
898
  i = m_vhtCapability.DeserializeIfPresent (i);
899
  i = m_heCapability.DeserializeIfPresent (i);
900
  return i.GetDistanceFrom (start);
712
  return i.GetDistanceFrom (start);
901
}
713
}
902
714
903
715
904
/***********************************************************
716
/***********************************************************
905
 *          Assoc/Reassoc Response
717
 *                Assoc/Reassoc Response
906
 ***********************************************************/
718
 ***********************************************************/
907
719
908
NS_OBJECT_ENSURE_REGISTERED (MgtAssocResponseHeader);
720
NS_OBJECT_ENSURE_REGISTERED (MgtAssocResponseHeader);
 Lines 952-1065    Link Here 
952
  return m_capability;
764
  return m_capability;
953
}
765
}
954
766
955
void
956
MgtAssocResponseHeader::SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities)
957
{
958
  m_extendedCapability = extendedcapabilities;
959
}
960
961
ExtendedCapabilities
962
MgtAssocResponseHeader::GetExtendedCapabilities (void) const
963
{
964
  return m_extendedCapability;
965
}
966
967
void
968
MgtAssocResponseHeader::SetHtCapabilities (HtCapabilities htcapabilities)
969
{
970
  m_htCapability = htcapabilities;
971
}
972
973
HtCapabilities
974
MgtAssocResponseHeader::GetHtCapabilities (void) const
975
{
976
  return m_htCapability;
977
}
978
979
void
980
MgtAssocResponseHeader::SetHtOperation (HtOperation htoperation)
981
{
982
  m_htOperation = htoperation;
983
}
984
985
HtOperation
986
MgtAssocResponseHeader::GetHtOperation (void) const
987
{
988
  return m_htOperation;
989
}
990
991
void
992
MgtAssocResponseHeader::SetVhtCapabilities (VhtCapabilities vhtcapabilities)
993
{
994
  m_vhtCapability = vhtcapabilities;
995
}
996
997
VhtCapabilities
998
MgtAssocResponseHeader::GetVhtCapabilities (void) const
999
{
1000
  return m_vhtCapability;
1001
}
1002
1003
void
1004
MgtAssocResponseHeader::SetVhtOperation (VhtOperation vhtoperation)
1005
{
1006
  m_vhtOperation = vhtoperation;
1007
}
1008
1009
VhtOperation
1010
MgtAssocResponseHeader::GetVhtOperation (void) const
1011
{
1012
  return m_vhtOperation;
1013
}
1014
1015
void
1016
MgtAssocResponseHeader::SetHeCapabilities (HeCapabilities hecapabilities)
1017
{
1018
  m_heCapability = hecapabilities;
1019
}
1020
1021
HeCapabilities
1022
MgtAssocResponseHeader::GetHeCapabilities (void) const
1023
{
1024
  return m_heCapability;
1025
}
1026
1027
void
1028
MgtAssocResponseHeader::SetHeOperation (HeOperation heoperation)
1029
{
1030
  m_heOperation = heoperation;
1031
}
1032
1033
HeOperation
1034
MgtAssocResponseHeader::GetHeOperation (void) const
1035
{
1036
  return m_heOperation;
1037
}
1038
1039
void
1040
MgtAssocResponseHeader::SetErpInformation (ErpInformation erpInformation)
1041
{
1042
  m_erpInformation = erpInformation;
1043
}
1044
1045
ErpInformation
1046
MgtAssocResponseHeader::GetErpInformation (void) const
1047
{
1048
  return m_erpInformation;
1049
}
1050
1051
void
1052
MgtAssocResponseHeader::SetEdcaParameterSet (EdcaParameterSet edcaparameters)
1053
{
1054
  m_edcaParameterSet = edcaparameters;
1055
}
1056
1057
EdcaParameterSet
1058
MgtAssocResponseHeader::GetEdcaParameterSet (void) const
1059
{
1060
  return m_edcaParameterSet;
1061
}
1062
1063
TypeId
767
TypeId
1064
MgtAssocResponseHeader::GetTypeId (void)
768
MgtAssocResponseHeader::GetTypeId (void)
1065
{
769
{
 Lines 1085-1100    Link Here 
1085
  size += m_code.GetSerializedSize ();
789
  size += m_code.GetSerializedSize ();
1086
  size += 2; //aid
790
  size += 2; //aid
1087
  size += m_rates.GetSerializedSize ();
791
  size += m_rates.GetSerializedSize ();
1088
  size += m_erpInformation.GetSerializedSize ();
1089
  size += m_rates.extended.GetSerializedSize ();
792
  size += m_rates.extended.GetSerializedSize ();
1090
  size += m_edcaParameterSet.GetSerializedSize ();
793
  size += GetInformationElementsSerializedSize ();
1091
  size += m_extendedCapability.GetSerializedSize ();
1092
  size += m_htCapability.GetSerializedSize ();
1093
  size += m_htOperation.GetSerializedSize ();
1094
  size += m_vhtCapability.GetSerializedSize ();
1095
  size += m_vhtOperation.GetSerializedSize ();
1096
  size += m_heCapability.GetSerializedSize ();
1097
  size += m_heOperation.GetSerializedSize ();
1098
  return size;
794
  return size;
1099
}
795
}
1100
796
 Lines 1103-1117    Link Here 
1103
{
799
{
1104
  os << "status code=" << m_code << ", "
800
  os << "status code=" << m_code << ", "
1105
     << "aid=" << m_aid << ", "
801
     << "aid=" << m_aid << ", "
1106
     << "rates=" << m_rates << ", "
802
     << "rates=" << m_rates << ", ";
1107
     << "ERP information=" << m_erpInformation << ", "
803
  PrintInformationElements (os);
1108
     << "Extended Capabilities=" << m_extendedCapability << " , "
1109
     << "HT Capabilities=" << m_htCapability << " , "
1110
     << "HT Operation=" << m_htOperation << " , "
1111
     << "VHT Capabilities=" << m_vhtCapability << " , "
1112
     << "VHT Operation=" << m_vhtOperation << " , "
1113
     << "HE Capabilities=" << m_heCapability << " , "
1114
     << "HE Operation=" << m_heOperation;
1115
}
804
}
1116
805
1117
void
806
void
 Lines 1122-1137    Link Here 
1122
  i = m_code.Serialize (i);
811
  i = m_code.Serialize (i);
1123
  i.WriteHtolsbU16 (m_aid);
812
  i.WriteHtolsbU16 (m_aid);
1124
  i = m_rates.Serialize (i);
813
  i = m_rates.Serialize (i);
1125
  i = m_erpInformation.Serialize (i);
1126
  i = m_rates.extended.Serialize (i);
814
  i = m_rates.extended.Serialize (i);
1127
  i = m_edcaParameterSet.Serialize (i);
815
  i = SerializeInformationElements (i);
1128
  i = m_extendedCapability.Serialize (i);
1129
  i = m_htCapability.Serialize (i);
1130
  i = m_htOperation.Serialize (i);
1131
  i = m_vhtCapability.Serialize (i);
1132
  i = m_vhtOperation.Serialize (i);
1133
  i = m_heCapability.Serialize (i);
1134
  i = m_heOperation.Serialize (i);
1135
}
816
}
1136
817
1137
uint32_t
818
uint32_t
 Lines 1142-1163    Link Here 
1142
  i = m_code.Deserialize (i);
823
  i = m_code.Deserialize (i);
1143
  m_aid = i.ReadLsbtohU16 ();
824
  m_aid = i.ReadLsbtohU16 ();
1144
  i = m_rates.Deserialize (i);
825
  i = m_rates.Deserialize (i);
1145
  i = m_erpInformation.DeserializeIfPresent (i);
1146
  i = m_rates.extended.DeserializeIfPresent (i);
826
  i = m_rates.extended.DeserializeIfPresent (i);
1147
  i = m_edcaParameterSet.DeserializeIfPresent (i);
827
  i = DeserializeInformationElements (i);
1148
  i = m_extendedCapability.DeserializeIfPresent (i);
1149
  i = m_htCapability.DeserializeIfPresent (i);
1150
  i = m_htOperation.DeserializeIfPresent (i);
1151
  i = m_vhtCapability.DeserializeIfPresent (i);
1152
  i = m_vhtOperation.DeserializeIfPresent (i);
1153
  i = m_heCapability.DeserializeIfPresent (i);
1154
  i = m_heOperation.DeserializeIfPresent (i);
1155
  return i.GetDistanceFrom (start);
828
  return i.GetDistanceFrom (start);
1156
}
829
}
1157
830
1158
831
1159
/**********************************************************
832
/**********************************************************
1160
 *   ActionFrame
833
 *                     ActionFrame
1161
 **********************************************************/
834
 **********************************************************/
1162
WifiActionHeader::WifiActionHeader ()
835
WifiActionHeader::WifiActionHeader ()
1163
{
836
{
(-)a/src/wifi/model/mgt-headers.h (-421 / +45 lines)
 Lines 23-28    Link Here 
23
#ifndef MGT_HEADERS_H
23
#ifndef MGT_HEADERS_H
24
#define MGT_HEADERS_H
24
#define MGT_HEADERS_H
25
25
26
#include <map>
26
#include "ns3/mac48-address.h"
27
#include "ns3/mac48-address.h"
27
#include "status-code.h"
28
#include "status-code.h"
28
#include "capability-information.h"
29
#include "capability-information.h"
 Lines 42-52    Link Here 
42
43
43
namespace ns3 {
44
namespace ns3 {
44
45
46
typedef std::vector<Ptr<WifiInformationElement> > WifiInfoElementList;
47
typedef std::vector<WifiInformationElementId> WifiInformationElementIdList;
48
typedef std::map<WifiInformationElementId, Ptr<WifiInformationElement> > WifiInformationElementMap;
49
50
/**
51
 * \ingroup wifi
52
 * Implement the common header for management frames.
53
 */
54
class MgtCommonHeader : public Header {
55
public:
56
  /**
57
   * Add new Wifi Information Element that is not vendor specific.
58
   * \param element the Wifi Information Element to be added to the management frame header.
59
   */
60
  void AddWifiInformationElement (Ptr<WifiInformationElement> element);
61
  /**
62
   * Get a specific Wifi information element by ID.
63
   * \param id The ID of the Wifi Information Element.
64
   * \return
65
   */
66
  Ptr<WifiInformationElement> GetInformationElement (WifiInformationElementId id);
67
  /**
68
   * Get List of Information Element associated with this frame.
69
   * \return
70
   */
71
  WifiInformationElementMap GetListOfInformationElement (void) const;
72
73
74
protected:
75
  void PrintInformationElements (std::ostream &os) const;
76
  uint32_t GetInformationElementsSerializedSize (void) const;
77
  Buffer::Iterator SerializeInformationElements (Buffer::Iterator start) const;
78
  Buffer::Iterator DeserializeInformationElements (Buffer::Iterator start);
79
80
81
private:
82
  WifiInformationElementMap m_map; //!< Map of Wifi Information Element.
83
};
84
45
/**
85
/**
46
 * \ingroup wifi
86
 * \ingroup wifi
47
 * Implement the header for management frames of type association request.
87
 * Implement the header for management frames of type association request.
48
 */
88
 */
49
class MgtAssocRequestHeader : public Header
89
class MgtAssocRequestHeader : public MgtCommonHeader
50
{
90
{
51
public:
91
public:
52
  MgtAssocRequestHeader ();
92
  MgtAssocRequestHeader ();
 Lines 77-136    Link Here 
77
   */
117
   */
78
  void SetCapabilities (CapabilityInformation capabilities);
118
  void SetCapabilities (CapabilityInformation capabilities);
79
  /**
119
  /**
80
   * Set the Extended Capabilities.
81
   *
82
   * \param extendedcapabilities the Extended Capabilities
83
   */
84
  void SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities);
85
  /**
86
   * Set the HT capabilities.
87
   *
88
   * \param htcapabilities HT capabilities
89
   */
90
  void SetHtCapabilities (HtCapabilities htcapabilities);
91
  /**
92
   * Set the VHT capabilities.
93
   *
94
   * \param vhtcapabilities VHT capabilities
95
   */
96
  void SetVhtCapabilities (VhtCapabilities vhtcapabilities);
97
  /**
98
   * Set the HE capabilities.
99
   *
100
   * \param hecapabilities HE capabilities
101
   */
102
  void SetHeCapabilities (HeCapabilities hecapabilities);
103
  /**
104
   * Return the Capability information.
120
   * Return the Capability information.
105
   *
121
   *
106
   * \return Capability information
122
   * \return Capability information
107
   */
123
   */
108
  CapabilityInformation GetCapabilities (void) const;
124
  CapabilityInformation GetCapabilities (void) const;
109
  /**
125
  /**
110
   * Return the extended capabilities.
111
   *
112
   * \return the extended capabilities
113
   */
114
  ExtendedCapabilities GetExtendedCapabilities (void) const;
115
  /**
116
   * Return the HT capabilities.
117
   *
118
   * \return HT capabilities
119
   */
120
  HtCapabilities GetHtCapabilities (void) const;
121
  /**
122
   * Return the VHT capabilities.
123
   *
124
   * \return VHT capabilities
125
   */
126
  VhtCapabilities GetVhtCapabilities (void) const;
127
  /**
128
   * Return the HE capabilities.
129
   *
130
   * \return HE capabilities
131
   */
132
  HeCapabilities GetHeCapabilities (void) const;
133
  /**
134
   * Return the Service Set Identifier (SSID).
126
   * Return the Service Set Identifier (SSID).
135
   *
127
   *
136
   * \return SSID
128
   * \return SSID
 Lines 165-174    Link Here 
165
  Ssid m_ssid;                        //!< Service Set ID (SSID)
157
  Ssid m_ssid;                        //!< Service Set ID (SSID)
166
  SupportedRates m_rates;             //!< List of supported rates
158
  SupportedRates m_rates;             //!< List of supported rates
167
  CapabilityInformation m_capability; //!< Capability information
159
  CapabilityInformation m_capability; //!< Capability information
168
  ExtendedCapabilities m_extendedCapability; //!< Extended capabilities
169
  HtCapabilities m_htCapability;      //!< HT capabilities
170
  VhtCapabilities m_vhtCapability;    //!< VHT capabilities
171
  HeCapabilities m_heCapability;      //!< HE capabilities
172
  uint16_t m_listenInterval;          //!< listen interval
160
  uint16_t m_listenInterval;          //!< listen interval
173
};
161
};
174
162
 Lines 177-183    Link Here 
177
 * \ingroup wifi
165
 * \ingroup wifi
178
 * Implement the header for management frames of type reassociation request.
166
 * Implement the header for management frames of type reassociation request.
179
 */
167
 */
180
class MgtReassocRequestHeader : public Header
168
class MgtReassocRequestHeader : public MgtCommonHeader
181
{
169
{
182
public:
170
public:
183
  MgtReassocRequestHeader ();
171
  MgtReassocRequestHeader ();
 Lines 208-267    Link Here 
208
   */
196
   */
209
  void SetCapabilities (CapabilityInformation capabilities);
197
  void SetCapabilities (CapabilityInformation capabilities);
210
  /**
198
  /**
211
   * Set the Extended Capabilities.
212
   *
213
   * \param extendedcapabilities the Extended Capabilities
214
   */
215
  void SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities);
216
  /**
217
   * Set the HT capabilities.
218
   *
219
   * \param htcapabilities HT capabilities
220
   */
221
  void SetHtCapabilities (HtCapabilities htcapabilities);
222
  /**
223
   * Set the VHT capabilities.
224
   *
225
   * \param vhtcapabilities VHT capabilities
226
   */
227
  void SetVhtCapabilities (VhtCapabilities vhtcapabilities);
228
  /**
229
   * Set the HE capabilities.
230
   *
231
   * \param hecapabilities HE capabilities
232
   */
233
  void SetHeCapabilities (HeCapabilities hecapabilities);
234
  /**
235
   * Return the Capability information.
199
   * Return the Capability information.
236
   *
200
   *
237
   * \return Capability information
201
   * \return Capability information
238
   */
202
   */
239
  CapabilityInformation GetCapabilities (void) const;
203
  CapabilityInformation GetCapabilities (void) const;
240
  /**
204
  /**
241
   * Return the extended capabilities.
242
   *
243
   * \return the extended capabilities
244
   */
245
  ExtendedCapabilities GetExtendedCapabilities (void) const;
246
  /**
247
   * Return the HT capabilities.
248
   *
249
   * \return HT capabilities
250
   */
251
  HtCapabilities GetHtCapabilities (void) const;
252
  /**
253
   * Return the VHT capabilities.
254
   *
255
   * \return VHT capabilities
256
   */
257
  VhtCapabilities GetVhtCapabilities (void) const;
258
  /**
259
   * Return the HE capabilities.
260
   *
261
   * \return HE capabilities
262
   */
263
  HeCapabilities GetHeCapabilities (void) const;
264
  /**
265
   * Return the Service Set Identifier (SSID).
205
   * Return the Service Set Identifier (SSID).
266
   *
206
   *
267
   * \return SSID
207
   * \return SSID
 Lines 303-312    Link Here 
303
  Ssid m_ssid;                        //!< Service Set ID (SSID)
243
  Ssid m_ssid;                        //!< Service Set ID (SSID)
304
  SupportedRates m_rates;             //!< List of supported rates
244
  SupportedRates m_rates;             //!< List of supported rates
305
  CapabilityInformation m_capability; //!< Capability information
245
  CapabilityInformation m_capability; //!< Capability information
306
  ExtendedCapabilities m_extendedCapability; //!< Extended capabilities
307
  HtCapabilities m_htCapability;      //!< HT capabilities
308
  VhtCapabilities m_vhtCapability;    //!< VHT capabilities
309
  HeCapabilities m_heCapability;      //!< HE capabilities
310
  uint16_t m_listenInterval;          //!< listen interval
246
  uint16_t m_listenInterval;          //!< listen interval
311
};
247
};
312
248
 Lines 315-321    Link Here 
315
 * \ingroup wifi
251
 * \ingroup wifi
316
 * Implement the header for management frames of type association and reassociation response.
252
 * Implement the header for management frames of type association and reassociation response.
317
 */
253
 */
318
class MgtAssocResponseHeader : public Header
254
class MgtAssocResponseHeader : public MgtCommonHeader
319
{
255
{
320
public:
256
public:
321
  MgtAssocResponseHeader ();
257
  MgtAssocResponseHeader ();
 Lines 340-435    Link Here 
340
   */
276
   */
341
  CapabilityInformation GetCapabilities (void) const;
277
  CapabilityInformation GetCapabilities (void) const;
342
  /**
278
  /**
343
   * Return the extended capabilities.
344
   *
345
   * \return the extended capabilities
346
   */
347
  ExtendedCapabilities GetExtendedCapabilities (void) const;
348
  /**
349
   * Return the HT capabilities.
350
   *
351
   * \return HT capabilities
352
   */
353
  HtCapabilities GetHtCapabilities (void) const;
354
  /**
355
   * Return the HT operation.
356
   *
357
   * \return HT operation
358
   */
359
  HtOperation GetHtOperation (void) const;
360
  /**
361
   * Return the VHT capabilities.
362
   *
363
   * \return VHT capabilities
364
   */
365
  VhtCapabilities GetVhtCapabilities (void) const;
366
  /**
367
   * Return the VHT operation.
368
   *
369
   * \return VHT operation
370
   */
371
  VhtOperation GetVhtOperation (void) const;
372
  /**
373
   * Return the HE capabilities.
374
   *
375
   * \return HE capabilities
376
   */
377
  HeCapabilities GetHeCapabilities (void) const;
378
  /**
379
   * Return the HE operation.
380
   *
381
   * \return HE operation
382
   */
383
  HeOperation GetHeOperation (void) const;
384
  /**
385
   * Return the ERP information.
386
   *
387
   * \return the ERP information
388
   */
389
  ErpInformation GetErpInformation (void) const;
390
  /**
391
   * Return the EDCA Parameter Set.
392
   *
393
   * \return the EDCA Parameter Set
394
   */
395
  EdcaParameterSet GetEdcaParameterSet (void) const;
396
  /**
397
   * Set the Capability information.
279
   * Set the Capability information.
398
   *
280
   *
399
   * \param capabilities Capability information
281
   * \param capabilities Capability information
400
   */
282
   */
401
  void SetCapabilities (CapabilityInformation capabilities);
283
  void SetCapabilities (CapabilityInformation capabilities);
402
  /**
284
  /**
403
   * Set the extended capabilities.
404
   *
405
   * \param extendedcapabilities the extended capabilities
406
   */
407
  void SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities);
408
  /**
409
   * Set the VHT operation.
410
   *
411
   * \param vhtoperation VHT operation
412
   */
413
  void SetVhtOperation (VhtOperation vhtoperation);
414
  /**
415
   * Set the VHT capabilities.
416
   *
417
   * \param vhtcapabilities VHT capabilities
418
   */
419
  void SetVhtCapabilities (VhtCapabilities vhtcapabilities);
420
  /**
421
   * Set the HT capabilities.
422
   *
423
   * \param htcapabilities HT capabilities
424
   */
425
  void SetHtCapabilities (HtCapabilities htcapabilities);
426
  /**
427
   * Set the HT operation.
428
   *
429
   * \param htoperation HT operation
430
   */
431
  void SetHtOperation (HtOperation htoperation);
432
  /**
433
   * Set the supported rates.
285
   * Set the supported rates.
434
   *
286
   *
435
   * \param rates the supported rates
287
   * \param rates the supported rates
 Lines 447-476    Link Here 
447
   * \param aid the association ID
299
   * \param aid the association ID
448
   */
300
   */
449
  void SetAssociationId (uint16_t aid);
301
  void SetAssociationId (uint16_t aid);
450
  /**
451
   * Set the ERP information.
452
   *
453
   * \param erpInformation the ERP information
454
   */
455
  void SetErpInformation (ErpInformation erpInformation);
456
  /**
457
   * Set the EDCA Parameter Set.
458
   *
459
   * \param edcaParameterSet the EDCA Parameter Set
460
   */
461
  void SetEdcaParameterSet (EdcaParameterSet edcaParameterSet);
462
  /**
463
   * Set the HE capabilities.
464
   *
465
   * \param hecapabilities HE capabilities
466
   */
467
  void SetHeCapabilities (HeCapabilities hecapabilities);
468
  /**
469
   * Set the HE operation.
470
   *
471
   * \param heoperation HE operation
472
   */
473
  void SetHeOperation (HeOperation heoperation);
474
302
475
  /**
303
  /**
476
   * Register this type.
304
   * Register this type.
 Lines 489-503    Link Here 
489
  CapabilityInformation m_capability; //!< Capability information
317
  CapabilityInformation m_capability; //!< Capability information
490
  StatusCode m_code; //!< Status code
318
  StatusCode m_code; //!< Status code
491
  uint16_t m_aid; //!< aid
319
  uint16_t m_aid; //!< aid
492
  ExtendedCapabilities m_extendedCapability; //!< extended capabilities
493
  HtCapabilities m_htCapability; //!< HT capabilities
494
  HtOperation m_htOperation; //!< HT operation
495
  VhtCapabilities m_vhtCapability; //!< VHT capabilities
496
  VhtOperation m_vhtOperation; //!< VHT operation
497
  ErpInformation m_erpInformation; //!< ERP information
498
  EdcaParameterSet m_edcaParameterSet; //!< EDCA Parameter Set
499
  HeCapabilities m_heCapability; //!< HE capabilities
500
  HeOperation m_heOperation; //!< HE operation
501
};
320
};
502
321
503
322
 Lines 505-511    Link Here 
505
 * \ingroup wifi
324
 * \ingroup wifi
506
 * Implement the header for management frames of type probe request.
325
 * Implement the header for management frames of type probe request.
507
 */
326
 */
508
class MgtProbeRequestHeader : public Header
327
class MgtProbeRequestHeader : public MgtCommonHeader
509
{
328
{
510
public:
329
public:
511
  ~MgtProbeRequestHeader ();
330
  ~MgtProbeRequestHeader ();
 Lines 523-552    Link Here 
523
   */
342
   */
524
  void SetSupportedRates (SupportedRates rates);
343
  void SetSupportedRates (SupportedRates rates);
525
  /**
344
  /**
526
   * Set the extended capabilities.
527
   *
528
   * \param extendedcapabilities the extended capabilities
529
   */
530
  void SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities);
531
  /**
532
   * Set the HT capabilities.
533
   *
534
   * \param htcapabilities HT capabilities
535
   */
536
  void SetHtCapabilities (HtCapabilities htcapabilities);
537
  /**
538
   * Set the VHT capabilities.
539
   *
540
   * \param vhtcapabilities VHT capabilities
541
   */
542
  void SetVhtCapabilities (VhtCapabilities vhtcapabilities);
543
  /**
544
   * Set the HE capabilities.
545
   *
546
   * \param hecapabilities HE capabilities
547
   */
548
  void SetHeCapabilities (HeCapabilities hecapabilities);
549
  /**
550
   * Return the Service Set Identifier (SSID).
345
   * Return the Service Set Identifier (SSID).
551
   *
346
   *
552
   * \return SSID
347
   * \return SSID
 Lines 558-587    Link Here 
558
   * \return the supported rates
353
   * \return the supported rates
559
   */
354
   */
560
  SupportedRates GetSupportedRates (void) const;
355
  SupportedRates GetSupportedRates (void) const;
561
  /**
562
   * Return the extended capabilities.
563
   *
564
   * \return the extended capabilities
565
   */
566
  ExtendedCapabilities GetExtendedCapabilities (void) const;
567
  /**
568
   * Return the HT capabilities.
569
   *
570
   * \return HT capabilities
571
   */
572
  HtCapabilities GetHtCapabilities (void) const;
573
  /**
574
   * Return the VHT capabilities.
575
   *
576
   * \return VHT capabilities
577
   */
578
  VhtCapabilities GetVhtCapabilities (void) const;
579
  /**
580
   * Return the HE capabilities.
581
   *
582
   * \return HE capabilities
583
   */
584
  HeCapabilities GetHeCapabilities (void) const;
585
356
586
  /**
357
  /**
587
   * Register this type.
358
   * Register this type.
 Lines 598-607    Link Here 
598
private:
369
private:
599
  Ssid m_ssid;                     //!< Service Set ID (SSID)
370
  Ssid m_ssid;                     //!< Service Set ID (SSID)
600
  SupportedRates m_rates;          //!< List of supported rates
371
  SupportedRates m_rates;          //!< List of supported rates
601
  ExtendedCapabilities m_extendedCapability; //!< extended capabilities
602
  HtCapabilities m_htCapability;   //!< HT capabilities
603
  VhtCapabilities m_vhtCapability; //!< VHT capabilities
604
  HeCapabilities m_heCapability; //!< HE capabilities
605
};
372
};
606
373
607
374
 Lines 609-615    Link Here 
609
 * \ingroup wifi
376
 * \ingroup wifi
610
 * Implement the header for management frames of type probe response.
377
 * Implement the header for management frames of type probe response.
611
 */
378
 */
612
class MgtProbeResponseHeader : public Header
379
class MgtProbeResponseHeader : public MgtCommonHeader
613
{
380
{
614
public:
381
public:
615
  MgtProbeResponseHeader ();
382
  MgtProbeResponseHeader ();
 Lines 640-759    Link Here 
640
   */
407
   */
641
  CapabilityInformation GetCapabilities (void) const;
408
  CapabilityInformation GetCapabilities (void) const;
642
  /**
409
  /**
643
   * Return the DSSS Parameter Set.
644
   *
645
   * \return the DSSS Parameter Set
646
   */
647
  DsssParameterSet GetDsssParameterSet (void) const;
648
  /**
649
   * Return the extended capabilities.
650
   *
651
   * \return the extended capabilities
652
   */
653
  ExtendedCapabilities GetExtendedCapabilities (void) const;
654
  /**
655
   * Return the HT capabilities.
656
   *
657
   * \return HT capabilities
658
   */
659
  HtCapabilities GetHtCapabilities (void) const;
660
  /**
661
   * Return the HT operation.
662
   *
663
   * \return HT operation
664
   */
665
  HtOperation GetHtOperation (void) const;
666
  /**
667
   * Return the VHT capabilities.
668
   *
669
   * \return VHT capabilities
670
   */
671
  VhtCapabilities GetVhtCapabilities (void) const;
672
  /**
673
   * Return the VHT operation.
674
   *
675
   * \return VHT operation
676
   */
677
  VhtOperation GetVhtOperation (void) const;
678
  /**
679
   * Return the HE capabilities.
680
   *
681
   * \return HE capabilities
682
   */
683
  HeCapabilities GetHeCapabilities (void) const;
684
  /**
685
   * Return the HE operation.
686
   *
687
   * \return HE operation
688
   */
689
  HeOperation GetHeOperation (void) const;
690
  /**
691
   * Return the ERP information.
692
   *
693
   * \return the ERP information
694
   */
695
  ErpInformation GetErpInformation (void) const;
696
  /**
697
   * Return the EDCA Parameter Set.
698
   *
699
   * \return the EDCA Parameter Set
700
   */
701
  EdcaParameterSet GetEdcaParameterSet (void) const;
702
  /**
703
   * Return the CF parameter set.
704
   *
705
   * \return CF parameter set
706
   */
707
  CfParameterSet GetCfParameterSet (void) const;
708
  /**
709
   * Set the Capability information.
410
   * Set the Capability information.
710
   *
411
   *
711
   * \param capabilities Capability information
412
   * \param capabilities Capability information
712
   */
413
   */
713
  void SetCapabilities (CapabilityInformation capabilities);
414
  void SetCapabilities (CapabilityInformation capabilities);
714
  /**
415
  /**
715
   * Set the extended capabilities.
716
   *
717
   * \param extendedcapabilities the extended capabilities
718
   */
719
  void SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities);
720
  /**
721
   * Set the HT capabilities.
722
   *
723
   * \param htcapabilities HT capabilities
724
   */
725
  void SetHtCapabilities (HtCapabilities htcapabilities);
726
  /**
727
   * Set the HT operation.
728
   *
729
   * \param htoperation HT operation
730
   */
731
  void SetHtOperation (HtOperation htoperation);
732
  /**
733
   * Set the VHT capabilities.
734
   *
735
   * \param vhtcapabilities VHT capabilities
736
   */
737
  void SetVhtCapabilities (VhtCapabilities vhtcapabilities);
738
  /**
739
   * Set the VHT operation.
740
   *
741
   * \param vhtoperation VHT operation
742
   */
743
  void SetVhtOperation (VhtOperation vhtoperation);
744
  /**
745
   * Set the HE capabilities.
746
   *
747
   * \param hecapabilities HE capabilities
748
   */
749
  void SetHeCapabilities (HeCapabilities hecapabilities);
750
  /**
751
   * Set the HE operation.
752
   *
753
   * \param heoperation HE operation
754
   */
755
  void SetHeOperation (HeOperation heoperation);
756
  /**
757
   * Set the Service Set Identifier (SSID).
416
   * Set the Service Set Identifier (SSID).
758
   *
417
   *
759
   * \param ssid SSID
418
   * \param ssid SSID
 Lines 772-801    Link Here 
772
   */
431
   */
773
  void SetSupportedRates (SupportedRates rates);
432
  void SetSupportedRates (SupportedRates rates);
774
  /**
433
  /**
775
   * Set the DSSS Parameter Set.
776
   *
777
   * \param dsssParameterSet the DSSS Parameter Set
778
   */
779
  void SetDsssParameterSet (DsssParameterSet dsssParameterSet);
780
  /**
781
   * Set the ERP information.
782
   *
783
   * \param erpInformation the ERP information
784
   */
785
  void SetErpInformation (ErpInformation erpInformation);
786
  /**
787
   * Set the EDCA Parameter Set.
788
   *
789
   * \param edcaParameterSet the EDCA Parameter Set
790
   */
791
  void SetEdcaParameterSet (EdcaParameterSet edcaParameterSet);
792
  /**
793
   * Set the CF parameter set.
794
   *
795
   * \param cfparameterset CF parameter set
796
   */
797
  void SetCfParameterSet (CfParameterSet cfparameterset);
798
  /**
799
   * Return the time stamp.
434
   * Return the time stamp.
800
   *
435
   *
801
   * \return time stamp
436
   * \return time stamp
 Lines 820-836    Link Here 
820
  uint64_t m_beaconInterval;           //!< Beacon interval
455
  uint64_t m_beaconInterval;           //!< Beacon interval
821
  SupportedRates m_rates;              //!< List of supported rates
456
  SupportedRates m_rates;              //!< List of supported rates
822
  CapabilityInformation m_capability;  //!< Capability information
457
  CapabilityInformation m_capability;  //!< Capability information
823
  DsssParameterSet m_dsssParameterSet; //!< DSSS Parameter Set
824
  ExtendedCapabilities m_extendedCapability; //!< extended capabilities
825
  HtCapabilities m_htCapability;       //!< HT capabilities
826
  HtOperation m_htOperation;           //!< HT operation
827
  VhtCapabilities m_vhtCapability;     //!< VHT capabilities
828
  VhtOperation m_vhtOperation;         //!< VHT operation
829
  HeCapabilities m_heCapability;       //!< HE capabilities
830
  HeOperation m_heOperation;         //!< HE operation
831
  ErpInformation m_erpInformation;     //!< ERP information
832
  EdcaParameterSet m_edcaParameterSet; //!< EDCA Parameter Set
833
  CfParameterSet m_cfParameterSet;     //!< CF parameter set
834
};
458
};
835
459
836
460
(-)a/src/wifi/model/regular-wifi-mac.cc (-47 / +53 lines)
 Lines 143-191    Link Here 
143
  return m_stationManager;
143
  return m_stationManager;
144
}
144
}
145
145
146
ExtendedCapabilities
146
Ptr<ExtendedCapabilities>
147
RegularWifiMac::GetExtendedCapabilities (void) const
147
RegularWifiMac::GetExtendedCapabilities (void) const
148
{
148
{
149
  NS_LOG_FUNCTION (this);
149
  NS_LOG_FUNCTION (this);
150
  ExtendedCapabilities capabilities;
150
  Ptr<ExtendedCapabilities> capabilities = Create<ExtendedCapabilities> ();
151
  if (m_htSupported || m_vhtSupported)
151
  if (m_htSupported || m_vhtSupported)
152
    {
152
    {
153
      if (m_htSupported)
153
      if (m_htSupported)
154
        {
154
        {
155
          capabilities.SetHtSupported (1);
155
          capabilities->SetHtSupported (1);
156
        }
156
        }
157
      if (m_vhtSupported)
157
      if (m_vhtSupported)
158
        {
158
        {
159
          capabilities.SetVhtSupported (1);
159
          capabilities->SetVhtSupported (1);
160
        }
160
        }
161
    }
161
    }
162
  //TODO: to be completed
162
  //TODO: to be completed
163
  return capabilities;
163
  return capabilities;
164
}
164
}
165
165
166
HtCapabilities
166
Ptr<HtCapabilities>
167
RegularWifiMac::GetHtCapabilities (void) const
167
RegularWifiMac::GetHtCapabilities (void) const
168
{
168
{
169
  NS_LOG_FUNCTION (this);
169
  NS_LOG_FUNCTION (this);
170
  HtCapabilities capabilities;
170
  Ptr<HtCapabilities> capabilities = Create<HtCapabilities> ();
171
  if (m_htSupported)
171
  if (m_htSupported || m_vhtSupported || m_heSupported)
172
    {
172
    {
173
      capabilities.SetHtSupported (1);
173
      capabilities->SetHtSupported (1);
174
      capabilities.SetLdpc (m_phy->GetLdpc ());
174
      capabilities->SetLdpc (m_phy->GetLdpc ());
175
      capabilities.SetSupportedChannelWidth (m_phy->GetChannelWidth () >= 40);
175
      capabilities->SetSupportedChannelWidth (m_phy->GetChannelWidth () >= 40);
176
      capabilities.SetShortGuardInterval20 (m_phy->GetShortGuardInterval ());
176
      capabilities->SetShortGuardInterval20 (m_phy->GetShortGuardInterval ());
177
      capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () >= 40 && m_phy->GetShortGuardInterval ());
177
      capabilities->SetShortGuardInterval40 (m_phy->GetChannelWidth () >= 40 && m_phy->GetShortGuardInterval ());
178
      capabilities.SetGreenfield (m_phy->GetGreenfield ());
178
      capabilities->SetGreenfield (m_phy->GetGreenfield ());
179
      uint32_t maxAmsduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize));
179
      uint32_t maxAmsduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize));
180
      capabilities.SetMaxAmsduLength (maxAmsduLength > 3839); //0 if 3839 and 1 if 7935
180
      capabilities->SetMaxAmsduLength (maxAmsduLength > 3839); //0 if 3839 and 1 if 7935
181
      capabilities.SetLSigProtectionSupport (!m_phy->GetGreenfield ());
181
      capabilities->SetLSigProtectionSupport (!m_phy->GetGreenfield ());
182
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
182
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
183
                                                                      + 1.0)
183
                                                                      + 1.0)
184
                                                            / std::log (2.0))
184
                                                            / std::log (2.0))
185
                                                           - 13.0),
185
                                                           - 13.0),
186
                                                0.0);
186
                                                0.0);
187
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
187
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
188
      capabilities.SetMaxAmpduLength (std::max<uint8_t> (3, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 3 for HT
188
      capabilities->SetMaxAmpduLength (std::max<uint8_t> (3, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 3 for HT
189
      uint64_t maxSupportedRate = 0; //in bit/s
189
      uint64_t maxSupportedRate = 0; //in bit/s
190
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
190
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
191
        {
191
        {
 Lines 194-200    Link Here 
194
            {
194
            {
195
              continue;
195
              continue;
196
            }
196
            }
197
          capabilities.SetRxMcsBitmask (mcs.GetMcsValue ());
197
          capabilities->SetRxMcsBitmask (mcs.GetMcsValue ());
198
          uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
198
          uint8_t nss = (mcs.GetMcsValue () / 8) + 1;
199
          NS_ASSERT (nss > 0 && nss < 5);
199
          NS_ASSERT (nss > 0 && nss < 5);
200
          uint64_t dataRate = mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetShortGuardInterval () ? 400 : 800, nss);
200
          uint64_t dataRate = mcs.GetDataRate (m_phy->GetChannelWidth (), m_phy->GetShortGuardInterval () ? 400 : 800, nss);
 Lines 204-243    Link Here 
204
              NS_LOG_DEBUG ("Updating maxSupportedRate to " << maxSupportedRate);
204
              NS_LOG_DEBUG ("Updating maxSupportedRate to " << maxSupportedRate);
205
            }
205
            }
206
        }
206
        }
207
      capabilities.SetRxHighestSupportedDataRate (static_cast<uint16_t> (maxSupportedRate / 1e6)); //in Mbit/s
207
      capabilities->SetRxHighestSupportedDataRate (static_cast<uint16_t> (maxSupportedRate / 1e6)); //in Mbit/s
208
      capabilities.SetTxMcsSetDefined (m_phy->GetNMcs () > 0);
208
      capabilities->SetTxMcsSetDefined (m_phy->GetNMcs () > 0);
209
      capabilities.SetTxMaxNSpatialStreams (m_phy->GetMaxSupportedTxSpatialStreams ());
209
      capabilities->SetTxMaxNSpatialStreams (m_phy->GetMaxSupportedTxSpatialStreams ());
210
      //we do not support unequal modulations
210
      //we do not support unequal modulations
211
      capabilities.SetTxRxMcsSetUnequal (0);
211
      capabilities->SetTxRxMcsSetUnequal (0);
212
      capabilities.SetTxUnequalModulation (0);
212
      capabilities->SetTxUnequalModulation (0);
213
    }
213
    }
214
  return capabilities;
214
  return capabilities;
215
}
215
}
216
216
217
VhtCapabilities
217
Ptr<VhtCapabilities>
218
RegularWifiMac::GetVhtCapabilities (void) const
218
RegularWifiMac::GetVhtCapabilities (void) const
219
{
219
{
220
  NS_LOG_FUNCTION (this);
220
  NS_LOG_FUNCTION (this);
221
  VhtCapabilities capabilities;
221
  Ptr<VhtCapabilities> capabilities = Create<VhtCapabilities> ();
222
  if (m_vhtSupported)
222
  if (m_vhtSupported || m_heSupported)
223
    {
223
    {
224
      capabilities.SetVhtSupported (1);
224
      capabilities->SetVhtSupported (1);
225
      if (m_phy->GetChannelWidth () == 160)
225
      if (m_phy->GetChannelWidth () == 160)
226
        {
226
        {
227
          capabilities.SetSupportedChannelWidthSet (1);
227
          capabilities->SetSupportedChannelWidthSet (1);
228
        }
228
        }
229
      else
229
      else
230
        {
230
        {
231
          capabilities.SetSupportedChannelWidthSet (0);
231
          capabilities->SetSupportedChannelWidthSet (0);
232
        }
232
        }
233
      uint32_t maxMpduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize)) + 56; //see section 9.11 of 11ac standard
233
      uint32_t maxMpduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize)) + 56; //see section 9.11 of 11ac standard
234
      capabilities.SetMaxMpduLength (uint8_t (maxMpduLength > 3895) + uint8_t (maxMpduLength > 7991)); //0 if 3895, 1 if 7991, 2 for 11454
234
      capabilities->SetMaxMpduLength (uint8_t (maxMpduLength > 3895) + uint8_t (maxMpduLength > 7991)); //0 if 3895, 1 if 7991, 2 for 11454
235
      capabilities.SetRxLdpc (m_phy->GetLdpc ());
235
      capabilities->SetRxLdpc (m_phy->GetLdpc ());
236
      capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && m_phy->GetShortGuardInterval ());
236
      capabilities->SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && m_phy->GetShortGuardInterval ());
237
      capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && m_phy->GetShortGuardInterval ());
237
      capabilities->SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && m_phy->GetShortGuardInterval ());
238
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize)) + 1.0) / std::log (2.0)) - 13.0), 0.0);
238
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize)) + 1.0) / std::log (2.0)) - 13.0), 0.0);
239
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
239
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
240
      capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 7 for VHT
240
      capabilities->SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 7 for VHT
241
      uint8_t maxMcs = 0;
241
      uint8_t maxMcs = 0;
242
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
242
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
243
        {
243
        {
 Lines 248-261    Link Here 
248
              maxMcs = mcs.GetMcsValue ();
248
              maxMcs = mcs.GetMcsValue ();
249
            }
249
            }
250
        }
250
        }
251
      //This is a workaround, a bug should be opened for this!
252
      //TODO: HE shall support VHT and HT rates!
253
      if (m_heSupported)
254
        {
255
          maxMcs = 9;
256
        }
251
      // Support same MaxMCS for each spatial stream
257
      // Support same MaxMCS for each spatial stream
252
      for (uint8_t nss = 1; nss <= m_phy->GetMaxSupportedRxSpatialStreams (); nss++)
258
      for (uint8_t nss = 1; nss <= m_phy->GetMaxSupportedRxSpatialStreams (); nss++)
253
        {
259
        {
254
          capabilities.SetRxMcsMap (maxMcs, nss);
260
          capabilities->SetRxMcsMap (maxMcs, nss);
255
        }
261
        }
256
      for (uint8_t nss = 1; nss <= m_phy->GetMaxSupportedTxSpatialStreams (); nss++)
262
      for (uint8_t nss = 1; nss <= m_phy->GetMaxSupportedTxSpatialStreams (); nss++)
257
        {
263
        {
258
          capabilities.SetTxMcsMap (maxMcs, nss);
264
          capabilities->SetTxMcsMap (maxMcs, nss);
259
        }
265
        }
260
      uint64_t maxSupportedRateLGI = 0; //in bit/s
266
      uint64_t maxSupportedRateLGI = 0; //in bit/s
261
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
267
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
 Lines 271-293    Link Here 
271
              NS_LOG_DEBUG ("Updating maxSupportedRateLGI to " << maxSupportedRateLGI);
277
              NS_LOG_DEBUG ("Updating maxSupportedRateLGI to " << maxSupportedRateLGI);
272
            }
278
            }
273
        }
279
        }
274
      capabilities.SetRxHighestSupportedLgiDataRate (static_cast<uint16_t> (maxSupportedRateLGI / 1e6)); //in Mbit/s
280
      capabilities->SetRxHighestSupportedLgiDataRate (static_cast<uint16_t> (maxSupportedRateLGI / 1e6)); //in Mbit/s
275
      capabilities.SetTxHighestSupportedLgiDataRate (static_cast<uint16_t> (maxSupportedRateLGI / 1e6)); //in Mbit/s
281
      capabilities->SetTxHighestSupportedLgiDataRate (static_cast<uint16_t> (maxSupportedRateLGI / 1e6)); //in Mbit/s
276
      //To be filled in once supported
282
      //To be filled in once supported
277
      capabilities.SetRxStbc (0);
283
      capabilities->SetRxStbc (0);
278
      capabilities.SetTxStbc (0);
284
      capabilities->SetTxStbc (0);
279
    }
285
    }
280
  return capabilities;
286
  return capabilities;
281
}
287
}
282
288
283
HeCapabilities
289
Ptr<HeCapabilities>
284
RegularWifiMac::GetHeCapabilities (void) const
290
RegularWifiMac::GetHeCapabilities (void) const
285
{
291
{
286
  NS_LOG_FUNCTION (this);
292
  NS_LOG_FUNCTION (this);
287
  HeCapabilities capabilities;
293
  Ptr<HeCapabilities> capabilities = Create<HeCapabilities> ();
288
  if (m_heSupported)
294
  if (m_heSupported)
289
    {
295
    {
290
      capabilities.SetHeSupported (1);
296
      capabilities->SetHeSupported (1);
291
      uint8_t channelWidthSet = 0;
297
      uint8_t channelWidthSet = 0;
292
      if (m_phy->GetChannelWidth () >= 40 && Is2_4Ghz (m_phy->GetFrequency ()))
298
      if (m_phy->GetChannelWidth () >= 40 && Is2_4Ghz (m_phy->GetFrequency ()))
293
        {
299
        {
 Lines 301-307    Link Here 
301
        {
307
        {
302
          channelWidthSet |= 0x04;
308
          channelWidthSet |= 0x04;
303
        }
309
        }
304
      capabilities.SetChannelWidthSet (channelWidthSet);
310
      capabilities->SetChannelWidthSet (channelWidthSet);
305
      uint8_t gi = 0;
311
      uint8_t gi = 0;
306
      if (m_phy->GetGuardInterval () <= NanoSeconds (1600))
312
      if (m_phy->GetGuardInterval () <= NanoSeconds (1600))
307
        {
313
        {
 Lines 312-325    Link Here 
312
        {
318
        {
313
          gi |= 0x02;
319
          gi |= 0x02;
314
        }
320
        }
315
      capabilities.SetHeLtfAndGiForHePpdus (gi);
321
      capabilities->SetHeLtfAndGiForHePpdus (gi);
316
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
322
      double maxAmpduLengthExponent = std::max (std::ceil ((std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
317
                                                                      + 1.0)
323
                                                                      + 1.0)
318
                                                            / std::log (2.0))
324
                                                            / std::log (2.0))
319
                                                           - 13.0),
325
                                                           - 13.0),
320
                                                0.0);
326
                                                0.0);
321
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
327
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
322
      capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //assume 0 to 7 for HE
328
      capabilities->SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //assume 0 to 7 for HE
323
      uint8_t maxMcs = 0;
329
      uint8_t maxMcs = 0;
324
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
330
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
325
        {
331
        {
 Lines 330-337    Link Here 
330
              maxMcs = mcs.GetMcsValue ();
336
              maxMcs = mcs.GetMcsValue ();
331
            }
337
            }
332
        }
338
        }
333
      capabilities.SetHighestMcsSupported (maxMcs);
339
      capabilities->SetHighestMcsSupported (maxMcs);
334
      capabilities.SetHighestNssSupported (m_phy->GetMaxSupportedTxSpatialStreams ());
340
      capabilities->SetHighestNssSupported (m_phy->GetMaxSupportedTxSpatialStreams ());
335
    }
341
    }
336
  return capabilities;
342
  return capabilities;
337
}
343
}
(-)a/src/wifi/model/regular-wifi-mac.h (-4 / +4 lines)
 Lines 230-254    Link Here 
230
   *
230
   *
231
   * \return the extended capabilities that we support
231
   * \return the extended capabilities that we support
232
   */
232
   */
233
  ExtendedCapabilities GetExtendedCapabilities (void) const;
233
  Ptr<ExtendedCapabilities> GetExtendedCapabilities (void) const;
234
  /**
234
  /**
235
   * Return the HT capabilities of the device.
235
   * Return the HT capabilities of the device.
236
   *
236
   *
237
   * \return the HT capabilities that we support
237
   * \return the HT capabilities that we support
238
   */
238
   */
239
  HtCapabilities GetHtCapabilities (void) const;
239
  Ptr<HtCapabilities> GetHtCapabilities (void) const;
240
  /**
240
  /**
241
   * Return the VHT capabilities of the device.
241
   * Return the VHT capabilities of the device.
242
   *
242
   *
243
   * \return the VHT capabilities that we support
243
   * \return the VHT capabilities that we support
244
   */
244
   */
245
  VhtCapabilities GetVhtCapabilities (void) const;
245
  Ptr<VhtCapabilities> GetVhtCapabilities (void) const;
246
  /**
246
  /**
247
   * Return the HE capabilities of the device.
247
   * Return the HE capabilities of the device.
248
   *
248
   *
249
   * \return the HE capabilities that we support
249
   * \return the HE capabilities that we support
250
   */
250
   */
251
  HeCapabilities GetHeCapabilities (void) const;
251
  Ptr<HeCapabilities> GetHeCapabilities (void) const;
252
252
253
  /**
253
  /**
254
   * This type defines the callback of a higher layer that a
254
   * This type defines the callback of a higher layer that a
(-)a/src/wifi/model/sta-wifi-mac.cc (-87 / +111 lines)
 Lines 156-171    Link Here 
156
  probe.SetSupportedRates (GetSupportedRates ());
156
  probe.SetSupportedRates (GetSupportedRates ());
157
  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
157
  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
158
    {
158
    {
159
      probe.SetExtendedCapabilities (GetExtendedCapabilities ());
159
      probe.AddWifiInformationElement (GetExtendedCapabilities ());
160
      probe.SetHtCapabilities (GetHtCapabilities ());
160
      probe.AddWifiInformationElement (GetHtCapabilities ());
161
    }
161
    }
162
  if (GetVhtSupported () || GetHeSupported ())
162
  if (GetVhtSupported () || GetHeSupported ())
163
    {
163
    {
164
      probe.SetVhtCapabilities (GetVhtCapabilities ());
164
      probe.AddWifiInformationElement (GetVhtCapabilities ());
165
    }
165
    }
166
  if (GetHeSupported ())
166
  if (GetHeSupported ())
167
    {
167
    {
168
      probe.SetHeCapabilities (GetHeCapabilities ());
168
      probe.AddWifiInformationElement (GetHeCapabilities ());
169
    }
169
    }
170
  packet->AddHeader (probe);
170
  packet->AddHeader (probe);
171
171
 Lines 197-212    Link Here 
197
      assoc.SetListenInterval (0);
197
      assoc.SetListenInterval (0);
198
      if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
198
      if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
199
        {
199
        {
200
          assoc.SetExtendedCapabilities (GetExtendedCapabilities ());
200
          assoc.AddWifiInformationElement (GetExtendedCapabilities ());
201
          assoc.SetHtCapabilities (GetHtCapabilities ());
201
          assoc.AddWifiInformationElement (GetHtCapabilities ());
202
        }
202
        }
203
      if (GetVhtSupported () || GetHeSupported ())
203
      if (GetVhtSupported () || GetHeSupported ())
204
        {
204
        {
205
          assoc.SetVhtCapabilities (GetVhtCapabilities ());
205
          assoc.AddWifiInformationElement (GetVhtCapabilities ());
206
        }
206
        }
207
      if (GetHeSupported ())
207
      if (GetHeSupported ())
208
        {
208
        {
209
          assoc.SetHeCapabilities (GetHeCapabilities ());
209
          assoc.AddWifiInformationElement (GetHeCapabilities ());
210
        }
210
        }
211
      packet->AddHeader (assoc);
211
      packet->AddHeader (assoc);
212
    }
212
    }
 Lines 220-235    Link Here 
220
      reassoc.SetListenInterval (0);
220
      reassoc.SetListenInterval (0);
221
      if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
221
      if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
222
        {
222
        {
223
          reassoc.SetExtendedCapabilities (GetExtendedCapabilities ());
223
          reassoc.AddWifiInformationElement (GetExtendedCapabilities ());
224
          reassoc.SetHtCapabilities (GetHtCapabilities ());
224
          reassoc.AddWifiInformationElement (GetHtCapabilities ());
225
        }
225
        }
226
      if (GetVhtSupported () || GetHeSupported ())
226
      if (GetVhtSupported () || GetHeSupported ())
227
        {
227
        {
228
          reassoc.SetVhtCapabilities (GetVhtCapabilities ());
228
          reassoc.AddWifiInformationElement (GetVhtCapabilities ());
229
        }
229
        }
230
      if (GetHeSupported ())
230
      if (GetHeSupported ())
231
        {
231
        {
232
          reassoc.SetHeCapabilities (GetHeCapabilities ());
232
          reassoc.AddWifiInformationElement (GetHeCapabilities ());
233
        }
233
        }
234
      packet->AddHeader (reassoc);
234
      packet->AddHeader (reassoc);
235
    }
235
    }
 Lines 568-584    Link Here 
568
          NS_LOG_LOGIC ("Beacon is for our SSID");
568
          NS_LOG_LOGIC ("Beacon is for our SSID");
569
          goodBeacon = true;
569
          goodBeacon = true;
570
        }
570
        }
571
      CfParameterSet cfParameterSet = beacon.GetCfParameterSet ();
571
      Ptr<CfParameterSet> cfParameterSet = StaticCast<CfParameterSet> (beacon.GetInformationElement (IE_CF_PARAMETER_SET));
572
      if (cfParameterSet.GetCFPCount () == 0)
572
      if (cfParameterSet != 0 && cfParameterSet->GetCFPCount () == 0)
573
        {
573
        {
574
          //see section 9.3.2.2 802.11-1999
574
          //see section 9.3.2.2 802.11-1999
575
          if (GetPcfSupported ())
575
          if (GetPcfSupported ())
576
            {
576
            {
577
              m_low->DoNavStartNow (MicroSeconds (cfParameterSet.GetCFPMaxDurationUs ()));
577
              m_low->DoNavStartNow (MicroSeconds (cfParameterSet->GetCFPMaxDurationUs ()));
578
            }
578
            }
579
          else
579
          else
580
            {
580
            {
581
              m_low->DoNavStartNow (MicroSeconds (cfParameterSet.GetCFPDurRemainingUs ()));
581
              m_low->DoNavStartNow (MicroSeconds (cfParameterSet->GetCFPDurRemainingUs ()));
582
            }
582
            }
583
        }
583
        }
584
      SupportedRates rates = beacon.GetSupportedRates ();
584
      SupportedRates rates = beacon.GetSupportedRates ();
 Lines 742-756    Link Here 
742
  bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
742
  bool isShortPreambleEnabled = capabilities.IsShortPreamble ();
743
  if (GetErpSupported ())
743
  if (GetErpSupported ())
744
    {
744
    {
745
      ErpInformation erpInformation = beacon.GetErpInformation ();
745
      Ptr<ErpInformation> erpInformation = StaticCast<ErpInformation> (beacon.GetInformationElement (IE_ERP_INFORMATION));
746
      isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
746
      if (erpInformation != 0)
747
      if (erpInformation.GetUseProtection () != 0)
748
        {
747
        {
749
          m_stationManager->SetUseNonErpProtection (true);
748
          isShortPreambleEnabled &= !erpInformation->GetBarkerPreambleMode ();
750
        }
749
          if (erpInformation->GetUseProtection () != 0)
751
      else
750
            {
752
        {
751
              m_stationManager->SetUseNonErpProtection (true);
753
          m_stationManager->SetUseNonErpProtection (false);
752
            }
753
          else
754
            {
755
              m_stationManager->SetUseNonErpProtection (false);
756
            }
754
        }
757
        }
755
      if (capabilities.IsShortSlotTime () == true)
758
      if (capabilities.IsShortSlotTime () == true)
756
        {
759
        {
 Lines 766-795    Link Here 
766
  if (GetQosSupported ())
769
  if (GetQosSupported ())
767
    {
770
    {
768
      bool qosSupported = false;
771
      bool qosSupported = false;
769
      EdcaParameterSet edcaParameters = beacon.GetEdcaParameterSet ();
772
      Ptr<EdcaParameterSet> edcaParameters = StaticCast<EdcaParameterSet> (beacon.GetInformationElement (IE_EDCA_PARAMETER_SET));
770
      if (edcaParameters.IsQosSupported ())
773
      if (edcaParameters != 0 && edcaParameters->IsQosSupported ())
771
        {
774
        {
772
          qosSupported = true;
775
          qosSupported = true;
773
          //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.
776
          //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.
774
          SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin (), edcaParameters.GetBeCWmax (), edcaParameters.GetBeAifsn (), 32 * MicroSeconds (edcaParameters.GetBeTXOPLimit ()));
777
          SetEdcaParameters (AC_BE, edcaParameters->GetBeCWmin (), edcaParameters->GetBeCWmax (), edcaParameters->GetBeAifsn (), 32 * MicroSeconds (edcaParameters->GetBeTXOPLimit ()));
775
          SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin (), edcaParameters.GetBkCWmax (), edcaParameters.GetBkAifsn (), 32 * MicroSeconds (edcaParameters.GetBkTXOPLimit ()));
778
          SetEdcaParameters (AC_BK, edcaParameters->GetBkCWmin (), edcaParameters->GetBkCWmax (), edcaParameters->GetBkAifsn (), 32 * MicroSeconds (edcaParameters->GetBkTXOPLimit ()));
776
          SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin (), edcaParameters.GetViCWmax (), edcaParameters.GetViAifsn (), 32 * MicroSeconds (edcaParameters.GetViTXOPLimit ()));
779
          SetEdcaParameters (AC_VI, edcaParameters->GetViCWmin (), edcaParameters->GetViCWmax (), edcaParameters->GetViAifsn (), 32 * MicroSeconds (edcaParameters->GetViTXOPLimit ()));
777
          SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin (), edcaParameters.GetVoCWmax (), edcaParameters.GetVoAifsn (), 32 * MicroSeconds (edcaParameters.GetVoTXOPLimit ()));
780
          SetEdcaParameters (AC_VO, edcaParameters->GetVoCWmin (), edcaParameters->GetVoCWmax (), edcaParameters->GetVoAifsn (), 32 * MicroSeconds (edcaParameters->GetVoTXOPLimit ()));
778
        }
781
        }
779
      m_stationManager->SetQosSupport (apAddr, qosSupported);
782
      m_stationManager->SetQosSupport (apAddr, qosSupported);
780
    }
783
    }
781
  if (GetHtSupported ())
784
  if (GetHtSupported ())
782
    {
785
    {
783
      HtCapabilities htCapabilities = beacon.GetHtCapabilities ();
786
      Ptr<HtCapabilities> htCapabilities = StaticCast<HtCapabilities> (beacon.GetInformationElement (IE_HT_CAPABILITIES));
784
      if (!htCapabilities.IsSupportedMcs (0))
787
      if (htCapabilities == 0)
785
        {
788
        {
786
          m_stationManager->RemoveAllSupportedMcs (apAddr);
789
          m_stationManager->RemoveAllSupportedMcs (apAddr);
787
        }
790
        }
788
      else
791
      else
789
        {
792
        {
790
          m_stationManager->AddStationHtCapabilities (apAddr, htCapabilities);
793
          m_stationManager->AddStationHtCapabilities (apAddr, htCapabilities);
791
          HtOperation htOperation = beacon.GetHtOperation ();
794
          Ptr<HtOperation> htOperation = StaticCast<HtOperation> (beacon.GetInformationElement (IE_HT_OPERATION));
792
          if (htOperation.GetNonGfHtStasPresent ())
795
          NS_ASSERT (htOperation != 0);
796
          if (htOperation->GetNonGfHtStasPresent ())
793
            {
797
            {
794
              m_stationManager->SetUseGreenfieldProtection (true);
798
              m_stationManager->SetUseGreenfieldProtection (true);
795
            }
799
            }
 Lines 797-803    Link Here 
797
            {
801
            {
798
              m_stationManager->SetUseGreenfieldProtection (false);
802
              m_stationManager->SetUseGreenfieldProtection (false);
799
            }
803
            }
800
          if (!GetVhtSupported () && GetRifsSupported () && htOperation.GetRifsMode ())
804
          if (!GetVhtSupported () && GetRifsSupported () && htOperation->GetRifsMode ())
801
            {
805
            {
802
              m_stationManager->SetRifsPermitted (true);
806
              m_stationManager->SetRifsPermitted (true);
803
            }
807
            }
 Lines 809-824    Link Here 
809
    }
813
    }
810
  if (GetVhtSupported ())
814
  if (GetVhtSupported ())
811
    {
815
    {
812
      VhtCapabilities vhtCapabilities = beacon.GetVhtCapabilities ();
816
      Ptr<VhtCapabilities> vhtCapabilities = StaticCast<VhtCapabilities> (beacon.GetInformationElement (IE_VHT_CAPABILITIES));
813
      //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
817
      //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
814
      if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
818
      if (vhtCapabilities != 0)
815
        {
819
        {
816
          m_stationManager->AddStationVhtCapabilities (apAddr, vhtCapabilities);
820
          m_stationManager->AddStationVhtCapabilities (apAddr, vhtCapabilities);
817
          VhtOperation vhtOperation = beacon.GetVhtOperation ();
821
          Ptr<VhtOperation> vhtOperation = StaticCast<VhtOperation> (beacon.GetInformationElement (IE_VHT_OPERATION));
822
          NS_ASSERT (vhtOperation != 0);
818
          for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
823
          for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
819
            {
824
            {
820
              WifiMode mcs = m_phy->GetMcs (i);
825
              WifiMode mcs = m_phy->GetMcs (i);
821
              if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
826
              if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities->IsSupportedRxMcs (mcs.GetMcsValue ()))
822
                {
827
                {
823
                  m_stationManager->AddSupportedMcs (apAddr, mcs);
828
                  m_stationManager->AddSupportedMcs (apAddr, mcs);
824
                }
829
                }
 Lines 827-847    Link Here 
827
    }
832
    }
828
  if (GetHtSupported () || GetVhtSupported ())
833
  if (GetHtSupported () || GetVhtSupported ())
829
    {
834
    {
830
      ExtendedCapabilities extendedCapabilities = beacon.GetExtendedCapabilities ();
835
      Ptr<ExtendedCapabilities> extendedCapabilities = StaticCast<ExtendedCapabilities> (beacon.GetInformationElement (IE_EXTENDED_CAPABILITIES));
831
      //TODO: to be completed
836
      //TODO: to be completed
832
    }
837
    }
833
  if (GetHeSupported ())
838
  if (GetHeSupported ())
834
    {
839
    {
835
      HeCapabilities heCapabilities = beacon.GetHeCapabilities ();
840
      Ptr<HeCapabilities> heCapabilities = StaticCast<HeCapabilities> (beacon.GetInformationElement (IE_HE_CAPABILITIES));
836
      //todo: once we support non constant rate managers, we should add checks here whether HE is supported by the peer
841
      if (heCapabilities != 0)
837
      m_stationManager->AddStationHeCapabilities (apAddr, heCapabilities);
838
      HeOperation heOperation = beacon.GetHeOperation ();
839
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
840
        {
842
        {
841
          WifiMode mcs = m_phy->GetMcs (i);
843
          m_stationManager->AddStationHeCapabilities (apAddr, heCapabilities);
842
          if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
844
          Ptr<HeOperation> heOperation = StaticCast<HeOperation> (beacon.GetInformationElement (IE_HE_OPERATION));
845
          NS_ASSERT (heOperation != 0);
846
          for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
843
            {
847
            {
844
              m_stationManager->AddSupportedMcs (apAddr, mcs);
848
              WifiMode mcs = m_phy->GetMcs (i);
849
              if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities->IsSupportedRxMcs (mcs.GetMcsValue ()))
850
                {
851
                  m_stationManager->AddSupportedMcs (apAddr, mcs);
852
                }
845
            }
853
            }
846
        }
854
        }
847
    }
855
    }
 Lines 898-905    Link Here 
898
        }
906
        }
899
      else
907
      else
900
        {
908
        {
901
          ErpInformation erpInformation = probeResp.GetErpInformation ();
909
          Ptr<ErpInformation> erpInformation = StaticCast<ErpInformation> (probeResp.GetInformationElement (IE_ERP_INFORMATION));
902
          isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
910
          if (erpInformation != 0)
911
            {
912
              isShortPreambleEnabled &= !erpInformation->GetBarkerPreambleMode ();
913
            }
903
          if (m_stationManager->GetShortSlotTimeEnabled ())
914
          if (m_stationManager->GetShortSlotTimeEnabled ())
904
            {
915
            {
905
              //enable short slot time
916
              //enable short slot time
 Lines 945-952    Link Here 
945
        }
956
        }
946
      else
957
      else
947
        {
958
        {
948
          ErpInformation erpInformation = assocResp.GetErpInformation ();
959
          Ptr<ErpInformation> erpInformation = StaticCast<ErpInformation> (assocResp.GetInformationElement (IE_ERP_INFORMATION));
949
          isShortPreambleEnabled &= !erpInformation.GetBarkerPreambleMode ();
960
          if (erpInformation != 0)
961
            {
962
              isShortPreambleEnabled &= !erpInformation->GetBarkerPreambleMode ();
963
            }
950
          if (m_stationManager->GetShortSlotTimeEnabled ())
964
          if (m_stationManager->GetShortSlotTimeEnabled ())
951
            {
965
            {
952
              //enable short slot time
966
              //enable short slot time
 Lines 965-994    Link Here 
965
  if (GetQosSupported ())
979
  if (GetQosSupported ())
966
    {
980
    {
967
      bool qosSupported = false;
981
      bool qosSupported = false;
968
      EdcaParameterSet edcaParameters = assocResp.GetEdcaParameterSet ();
982
      Ptr<EdcaParameterSet> edcaParameters = StaticCast<EdcaParameterSet> (assocResp.GetInformationElement (IE_EDCA_PARAMETER_SET));
969
      if (edcaParameters.IsQosSupported ())
983
      if (edcaParameters != 0 && edcaParameters->IsQosSupported ())
970
        {
984
        {
971
          qosSupported = true;
985
          qosSupported = true;
972
          //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.
986
          //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.
973
          SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin (), edcaParameters.GetBeCWmax (), edcaParameters.GetBeAifsn (), 32 * MicroSeconds (edcaParameters.GetBeTXOPLimit ()));
987
          SetEdcaParameters (AC_BE, edcaParameters->GetBeCWmin (), edcaParameters->GetBeCWmax (), edcaParameters->GetBeAifsn (), 32 * MicroSeconds (edcaParameters->GetBeTXOPLimit ()));
974
          SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin (), edcaParameters.GetBkCWmax (), edcaParameters.GetBkAifsn (), 32 * MicroSeconds (edcaParameters.GetBkTXOPLimit ()));
988
          SetEdcaParameters (AC_BK, edcaParameters->GetBkCWmin (), edcaParameters->GetBkCWmax (), edcaParameters->GetBkAifsn (), 32 * MicroSeconds (edcaParameters->GetBkTXOPLimit ()));
975
          SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin (), edcaParameters.GetViCWmax (), edcaParameters.GetViAifsn (), 32 * MicroSeconds (edcaParameters.GetViTXOPLimit ()));
989
          SetEdcaParameters (AC_VI, edcaParameters->GetViCWmin (), edcaParameters->GetViCWmax (), edcaParameters->GetViAifsn (), 32 * MicroSeconds (edcaParameters->GetViTXOPLimit ()));
976
          SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin (), edcaParameters.GetVoCWmax (), edcaParameters.GetVoAifsn (), 32 * MicroSeconds (edcaParameters.GetVoTXOPLimit ()));
990
          SetEdcaParameters (AC_VO, edcaParameters->GetVoCWmin (), edcaParameters->GetVoCWmax (), edcaParameters->GetVoAifsn (), 32 * MicroSeconds (edcaParameters->GetVoTXOPLimit ()));
977
        }
991
        }
978
      m_stationManager->SetQosSupport (apAddr, qosSupported);
992
      m_stationManager->SetQosSupport (apAddr, qosSupported);
979
    }
993
    }
980
  if (GetHtSupported ())
994
  if (GetHtSupported ())
981
    {
995
    {
982
      HtCapabilities htCapabilities = assocResp.GetHtCapabilities ();
996
      Ptr<HtCapabilities> htCapabilities = StaticCast<HtCapabilities> (assocResp.GetInformationElement (IE_HT_CAPABILITIES));
983
      if (!htCapabilities.IsSupportedMcs (0))
997
      if (htCapabilities == 0)
984
        {
998
        {
985
          m_stationManager->RemoveAllSupportedMcs (apAddr);
999
          m_stationManager->RemoveAllSupportedMcs (apAddr);
986
        }
1000
        }
987
      else
1001
      else
988
        {
1002
        {
989
          m_stationManager->AddStationHtCapabilities (apAddr, htCapabilities);
1003
          m_stationManager->AddStationHtCapabilities (apAddr, htCapabilities);
990
          HtOperation htOperation = assocResp.GetHtOperation ();
1004
          Ptr<HtOperation> htOperation = StaticCast<HtOperation> (assocResp.GetInformationElement (IE_HT_OPERATION));
991
          if (htOperation.GetNonGfHtStasPresent ())
1005
          NS_ASSERT (htOperation != 0);
1006
          if (htOperation->GetNonGfHtStasPresent ())
992
            {
1007
            {
993
              m_stationManager->SetUseGreenfieldProtection (true);
1008
              m_stationManager->SetUseGreenfieldProtection (true);
994
            }
1009
            }
 Lines 996-1002    Link Here 
996
            {
1011
            {
997
              m_stationManager->SetUseGreenfieldProtection (false);
1012
              m_stationManager->SetUseGreenfieldProtection (false);
998
            }
1013
            }
999
          if (!GetVhtSupported () && GetRifsSupported () && htOperation.GetRifsMode ())
1014
          if (!GetVhtSupported () && GetRifsSupported () && htOperation->GetRifsMode ())
1000
            {
1015
            {
1001
              m_stationManager->SetRifsPermitted (true);
1016
              m_stationManager->SetRifsPermitted (true);
1002
            }
1017
            }
 Lines 1008-1027    Link Here 
1008
    }
1023
    }
1009
  if (GetVhtSupported ())
1024
  if (GetVhtSupported ())
1010
    {
1025
    {
1011
      VhtCapabilities vhtCapabilities = assocResp.GetVhtCapabilities ();
1026
      Ptr<VhtCapabilities> vhtCapabilities = StaticCast<VhtCapabilities> (assocResp.GetInformationElement (IE_VHT_CAPABILITIES));
1012
      //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
1027
      //we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
1013
      if (vhtCapabilities.GetRxHighestSupportedLgiDataRate () > 0)
1028
      if (vhtCapabilities != 0)
1014
        {
1029
        {
1015
          m_stationManager->AddStationVhtCapabilities (apAddr, vhtCapabilities);
1030
          m_stationManager->AddStationVhtCapabilities (apAddr, vhtCapabilities);
1016
          VhtOperation vhtOperation = assocResp.GetVhtOperation ();
1031
          Ptr<VhtOperation> vhtOperation = StaticCast<VhtOperation> (assocResp.GetInformationElement (IE_VHT_OPERATION));
1017
        }
1032
        }
1018
    }
1033
    }
1019
  if (GetHeSupported ())
1034
  if (GetHeSupported ())
1020
    {
1035
    {
1021
      HeCapabilities hecapabilities = assocResp.GetHeCapabilities ();
1036
      Ptr<HeCapabilities> hecapabilities = StaticCast<HeCapabilities> (assocResp.GetInformationElement (IE_HE_CAPABILITIES));
1022
      //todo: once we support non constant rate managers, we should add checks here whether HE is supported by the peer
1037
      //todo: once we support non constant rate managers, we should add checks here whether HE is supported by the peer
1023
      m_stationManager->AddStationHeCapabilities (apAddr, hecapabilities);
1038
      m_stationManager->AddStationHeCapabilities (apAddr, hecapabilities);
1024
      HeOperation heOperation = assocResp.GetHeOperation ();
1039
      Ptr<HeOperation> heOperation = StaticCast<HeOperation> (assocResp.GetInformationElement (IE_HE_OPERATION));
1025
    }
1040
    }
1026
  for (uint8_t i = 0; i < m_phy->GetNModes (); i++)
1041
  for (uint8_t i = 0; i < m_phy->GetNModes (); i++)
1027
    {
1042
    {
 Lines 1037-1081    Link Here 
1037
    }
1052
    }
1038
  if (GetHtSupported ())
1053
  if (GetHtSupported ())
1039
    {
1054
    {
1040
      HtCapabilities htCapabilities = assocResp.GetHtCapabilities ();
1055
      Ptr<HtCapabilities> htCapabilities = StaticCast<HtCapabilities> (assocResp.GetInformationElement (IE_HT_CAPABILITIES));
1041
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1056
      if (htCapabilities != 0)
1042
        {
1057
        {
1043
          WifiMode mcs = m_phy->GetMcs (i);
1058
          for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1044
          if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htCapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1045
            {
1059
            {
1046
              m_stationManager->AddSupportedMcs (apAddr, mcs);
1060
              WifiMode mcs = m_phy->GetMcs (i);
1047
              //here should add a control to add basic MCS when it is implemented
1061
              if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htCapabilities->IsSupportedMcs (mcs.GetMcsValue ()))
1062
                {
1063
                  m_stationManager->AddSupportedMcs (apAddr, mcs);
1064
                  //here should add a control to add basic MCS when it is implemented
1065
                }
1048
            }
1066
            }
1049
        }
1067
        }
1050
    }
1068
    }
1051
  if (GetVhtSupported ())
1069
  if (GetVhtSupported ())
1052
    {
1070
    {
1053
      VhtCapabilities vhtcapabilities = assocResp.GetVhtCapabilities ();
1071
      Ptr<VhtCapabilities> vhtcapabilities = StaticCast<VhtCapabilities> (assocResp.GetInformationElement (IE_VHT_CAPABILITIES));
1054
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1072
      if (vhtcapabilities != 0)
1055
        {
1073
        {
1056
          WifiMode mcs = m_phy->GetMcs (i);
1074
          for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1057
          if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtcapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
1058
            {
1075
            {
1059
              m_stationManager->AddSupportedMcs (apAddr, mcs);
1076
              WifiMode mcs = m_phy->GetMcs (i);
1060
              //here should add a control to add basic MCS when it is implemented
1077
              if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtcapabilities->IsSupportedRxMcs (mcs.GetMcsValue ()))
1078
                {
1079
                  m_stationManager->AddSupportedMcs (apAddr, mcs);
1080
                  //here should add a control to add basic MCS when it is implemented
1081
                }
1061
            }
1082
            }
1062
        }
1083
        }
1063
    }
1084
    }
1064
  if (GetHtSupported () || GetVhtSupported ())
1085
  if (GetHtSupported () || GetVhtSupported ())
1065
    {
1086
    {
1066
      ExtendedCapabilities extendedCapabilities = assocResp.GetExtendedCapabilities ();
1087
      Ptr<ExtendedCapabilities> extendedCapabilities = StaticCast<ExtendedCapabilities> (assocResp.GetInformationElement (IE_EXTENDED_CAPABILITIES));
1067
      //TODO: to be completed
1088
      //TODO: to be completed
1068
    }
1089
    }
1069
  if (GetHeSupported ())
1090
  if (GetHeSupported ())
1070
    {
1091
    {
1071
      HeCapabilities heCapabilities = assocResp.GetHeCapabilities ();
1092
      Ptr<HeCapabilities> heCapabilities = StaticCast<HeCapabilities> (assocResp.GetInformationElement (IE_HE_CAPABILITIES));
1072
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1093
      if (heCapabilities != 0)
1073
        {
1094
        {
1074
          WifiMode mcs = m_phy->GetMcs (i);
1095
          for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
1075
          if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities.IsSupportedRxMcs (mcs.GetMcsValue ()))
1076
            {
1096
            {
1077
              m_stationManager->AddSupportedMcs (apAddr, mcs);
1097
              WifiMode mcs = m_phy->GetMcs (i);
1078
              //here should add a control to add basic MCS when it is implemented
1098
              if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE && heCapabilities->IsSupportedRxMcs (mcs.GetMcsValue ()))
1099
                {
1100
                  m_stationManager->AddSupportedMcs (apAddr, mcs);
1101
                  //here should add a control to add basic MCS when it is implemented
1102
                }
1079
            }
1103
            }
1080
        }
1104
        }
1081
    }
1105
    }
(-)a/src/wifi/model/vht-capabilities.cc (-2 / +8 lines)
 Lines 370-375    Link Here 
370
  return m_rxHighestSupportedLongGuardIntervalDataRate;
370
  return m_rxHighestSupportedLongGuardIntervalDataRate;
371
}
371
}
372
372
373
void
374
VhtCapabilities::Print (std::ostream& os) const
375
{
376
  os << GetVhtCapabilitiesInfo ()
377
     << "|" << GetSupportedMcsAndNssSet ();
378
}
379
373
/**
380
/**
374
 * output stream output operator
381
 * output stream output operator
375
 *
382
 *
 Lines 381-388    Link Here 
381
std::ostream &
388
std::ostream &
382
operator << (std::ostream &os, const VhtCapabilities &VhtCapabilities)
389
operator << (std::ostream &os, const VhtCapabilities &VhtCapabilities)
383
{
390
{
384
  os <<  VhtCapabilities.GetVhtCapabilitiesInfo () << "|" << VhtCapabilities.GetSupportedMcsAndNssSet ();
391
  VhtCapabilities.Print (os);
385
386
  return os;
392
  return os;
387
}
393
}
388
394
(-)a/src/wifi/model/vht-capabilities.h (+7 lines)
 Lines 240-245    Link Here 
240
   */
240
   */
241
  uint16_t GetSerializedSize () const;
241
  uint16_t GetSerializedSize () const;
242
242
243
  /**
244
   * Generate human-readable form of VHT capabilities information element
245
   *
246
   * \param os output stream
247
   */
248
  void Print (std::ostream& os) const;
249
243
250
244
private:
251
private:
245
  //Capabilities Info fields
252
  //Capabilities Info fields
(-)a/src/wifi/model/vht-operation.cc (-4 / +10 lines)
 Lines 161-166    Link Here 
161
  return length;
161
  return length;
162
}
162
}
163
163
164
void
165
VhtOperation::Print (std::ostream& os) const
166
{
167
  os << +GetChannelWidth () << "|"
168
     << +GetChannelCenterFrequencySegment0 () << "|"
169
     << +GetChannelCenterFrequencySegment1 () << "|"
170
     << GetBasicVhtMcsAndNssSet ();
171
}
172
164
/**
173
/**
165
 * output stream output operator
174
 * output stream output operator
166
 *
175
 *
 Lines 172-181    Link Here 
172
std::ostream &
181
std::ostream &
173
operator << (std::ostream &os, const VhtOperation &VhtOperation)
182
operator << (std::ostream &os, const VhtOperation &VhtOperation)
174
{
183
{
175
  os << +VhtOperation.GetChannelWidth () << "|"
184
  VhtOperation.Print (os);
176
     << +VhtOperation.GetChannelCenterFrequencySegment0 () << "|"
177
     << +VhtOperation.GetChannelCenterFrequencySegment1 () << "|"
178
     << VhtOperation.GetBasicVhtMcsAndNssSet ();
179
  return os;
185
  return os;
180
}
186
}
181
187
(-)a/src/wifi/model/vht-operation.h (+7 lines)
 Lines 147-152    Link Here 
147
   */
147
   */
148
  uint16_t GetSerializedSize () const;
148
  uint16_t GetSerializedSize () const;
149
149
150
  /**
151
   * Generate human-readable form of VHT Operations IE
152
   *
153
   * \param os output stream
154
   */
155
  void Print (std::ostream& os) const;
156
150
157
151
private:
158
private:
152
  //VHT Operation Information
159
  //VHT Operation Information
(-)a/src/wifi/model/wifi-information-element-vector.cc (-17 / +1 lines)
 Lines 25-31    Link Here 
25
NS_OBJECT_ENSURE_REGISTERED (WifiInformationElementVector);
25
NS_OBJECT_ENSURE_REGISTERED (WifiInformationElementVector);
26
26
27
WifiInformationElementVector::WifiInformationElementVector ()
27
WifiInformationElementVector::WifiInformationElementVector ()
28
  : m_maxSize (1500)
29
{
28
{
30
}
29
}
31
30
 Lines 108-123    Link Here 
108
      NS_FATAL_ERROR ("Information element " << +id << " is not implemented");
107
      NS_FATAL_ERROR ("Information element " << +id << " is not implemented");
109
      return 0;
108
      return 0;
110
    }
109
    }
111
  /*  unreachable:  b/c switch is guaranteed to return from this function
112
  if (GetSize () + length > m_maxSize)
113
    {
114
      NS_FATAL_ERROR ("Check max size for information element!");
115
    }
116
  newElement->DeserializeInformationField (i, length);
117
  i.Next (length);
118
  m_elements.push_back (newElement);
119
  return i.GetDistanceFrom (start);
120
  */
121
}
110
}
122
111
123
void
112
void
 Lines 143-157    Link Here 
143
  return m_elements.end ();
132
  return m_elements.end ();
144
}
133
}
145
134
146
bool
135
void
147
WifiInformationElementVector::AddInformationElement (Ptr<WifiInformationElement> element)
136
WifiInformationElementVector::AddInformationElement (Ptr<WifiInformationElement> element)
148
{
137
{
149
  if (element->GetInformationFieldSize () + 2 + GetSize () > m_maxSize)
150
    {
151
      return false;
152
    }
153
  m_elements.push_back (element);
138
  m_elements.push_back (element);
154
  return true;
155
}
139
}
156
140
157
Ptr<WifiInformationElement>
141
Ptr<WifiInformationElement>
(-)a/src/wifi/model/wifi-information-element-vector.h (-5 / +2 lines)
 Lines 91-102    Link Here 
91
   */
91
   */
92
  Iterator End ();
92
  Iterator End ();
93
  /**
93
  /**
94
   * add an IE, if maxSize has exceeded, returns false
94
   * add an IE
95
   *
95
   *
96
   * \param element wifi information element to add
96
   * \param element wifi information element to add
97
   * \returns true is added
98
   */
97
   */
99
  bool AddInformationElement (Ptr<WifiInformationElement> element);
98
  void AddInformationElement (Ptr<WifiInformationElement> element);
100
  /**
99
  /**
101
   * vector of pointers to information elements is the body of IeVector
100
   * vector of pointers to information elements is the body of IeVector
102
   *
101
   *
 Lines 127-134    Link Here 
127
   */
126
   */
128
  uint32_t GetSize () const;
127
  uint32_t GetSize () const;
129
  IE_VECTOR m_elements; //!< Information element vector
128
  IE_VECTOR m_elements; //!< Information element vector
130
  /// Size in bytes (actually, max packet length)
131
  uint16_t m_maxSize;
132
};
129
};
133
130
134
} //namespace ns3
131
} //namespace ns3
(-)a/src/wifi/model/wifi-information-element.cc (+8 lines)
 Lines 84-89    Link Here 
84
  return i;
84
  return i;
85
}
85
}
86
86
87
Buffer::Iterator
88
WifiInformationElement::DeserializeElementBody (Buffer::Iterator i, uint8_t length)
89
{
90
  DeserializeInformationField (i, length);
91
  i.Next (length);
92
  return i;
93
}
94
87
bool
95
bool
88
WifiInformationElement::operator== (WifiInformationElement const & a) const
96
WifiInformationElement::operator== (WifiInformationElement const & a) const
89
{
97
{
(-)a/src/wifi/model/wifi-information-element.h (-1 / +10 lines)
 Lines 186-192    Link Here 
186
// 200 to 220 are reserved
186
// 200 to 220 are reserved
187
#define IE_VENDOR_SPECIFIC                      ((WifiInformationElementId)221)
187
#define IE_VENDOR_SPECIFIC                      ((WifiInformationElementId)221)
188
// 222 to 255 are reserved
188
// 222 to 255 are reserved
189
#define IE_HE_CAPABILITIES                      ((WifiInformationElementId)255) //todo: not defined yet in the standard!
189
#define IE_HE_CAPABILITIES                      ((WifiInformationElementId)254) //todo: not defined yet in the standard!
190
#define IE_HE_OPERATION                         ((WifiInformationElementId)255) //todo: not defined yet in the standard!
190
#define IE_HE_OPERATION                         ((WifiInformationElementId)255) //todo: not defined yet in the standard!
191
191
192
192
 Lines 262-267    Link Here 
262
   */
262
   */
263
  Buffer::Iterator DeserializeIfPresent (Buffer::Iterator i);
263
  Buffer::Iterator DeserializeIfPresent (Buffer::Iterator i);
264
  /**
264
  /**
265
   * Deserialize IE Body. The iterator passed in must be pointing at
266
   * the Element Body of an information element.
267
   *
268
   * \param i an iterator which points to where the IE body should be read.
269
   *
270
   * \return an iterator
271
   */
272
  Buffer::Iterator DeserializeElementBody (Buffer::Iterator i, uint8_t length);
273
  /**
265
   * Get the size of the serialized IE including Element ID and
274
   * Get the size of the serialized IE including Element ID and
266
   * length fields.
275
   * length fields.
267
   *
276
   *
(-)a/src/wifi/model/wifi-remote-station-manager.cc (-19 / +19 lines)
 Lines 1720-1733    Link Here 
1720
}
1720
}
1721
1721
1722
void
1722
void
1723
WifiRemoteStationManager::AddStationHtCapabilities (Mac48Address from, HtCapabilities htCapabilities)
1723
WifiRemoteStationManager::AddStationHtCapabilities (Mac48Address from, Ptr<HtCapabilities> htCapabilities)
1724
{
1724
{
1725
  //Used by all stations to record HT capabilities of remote stations
1725
  //Used by all stations to record HT capabilities of remote stations
1726
  NS_LOG_FUNCTION (this << from << htCapabilities);
1726
  NS_LOG_FUNCTION (this << from << htCapabilities);
1727
  WifiRemoteStationState *state;
1727
  WifiRemoteStationState *state;
1728
  state = LookupState (from);
1728
  state = LookupState (from);
1729
  state->m_shortGuardInterval = htCapabilities.GetShortGuardInterval20 ();
1729
  state->m_shortGuardInterval = htCapabilities->GetShortGuardInterval20 ();
1730
  if (htCapabilities.GetSupportedChannelWidth () == 1)
1730
  if (htCapabilities->GetSupportedChannelWidth () == 1)
1731
    {
1731
    {
1732
      state->m_channelWidth = 40;
1732
      state->m_channelWidth = 40;
1733
    }
1733
    }
 Lines 1736-1747    Link Here 
1736
      state->m_channelWidth = 20;
1736
      state->m_channelWidth = 20;
1737
    }
1737
    }
1738
  SetQosSupport (from, true);
1738
  SetQosSupport (from, true);
1739
  state->m_greenfield = htCapabilities.GetGreenfield ();
1739
  state->m_greenfield = htCapabilities->GetGreenfield ();
1740
  state->m_streams = htCapabilities.GetRxHighestSupportedAntennas ();
1740
  state->m_streams = htCapabilities->GetRxHighestSupportedAntennas ();
1741
  for (uint8_t j = 0; j < m_wifiPhy->GetNMcs (); j++)
1741
  for (uint8_t j = 0; j < m_wifiPhy->GetNMcs (); j++)
1742
    {
1742
    {
1743
      WifiMode mcs = m_wifiPhy->GetMcs (j);
1743
      WifiMode mcs = m_wifiPhy->GetMcs (j);
1744
      if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htCapabilities.IsSupportedMcs (mcs.GetMcsValue ()))
1744
      if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HT && htCapabilities->IsSupportedMcs (mcs.GetMcsValue ()))
1745
        {
1745
        {
1746
          AddSupportedMcs (from, mcs);
1746
          AddSupportedMcs (from, mcs);
1747
        }
1747
        }
 Lines 1750-1762    Link Here 
1750
}
1750
}
1751
1751
1752
void
1752
void
1753
WifiRemoteStationManager::AddStationVhtCapabilities (Mac48Address from, VhtCapabilities vhtCapabilities)
1753
WifiRemoteStationManager::AddStationVhtCapabilities (Mac48Address from, Ptr<VhtCapabilities> vhtCapabilities)
1754
{
1754
{
1755
  //Used by all stations to record VHT capabilities of remote stations
1755
  //Used by all stations to record VHT capabilities of remote stations
1756
  NS_LOG_FUNCTION (this << from << vhtCapabilities);
1756
  NS_LOG_FUNCTION (this << from << vhtCapabilities);
1757
  WifiRemoteStationState *state;
1757
  WifiRemoteStationState *state;
1758
  state = LookupState (from);
1758
  state = LookupState (from);
1759
  if (vhtCapabilities.GetSupportedChannelWidthSet () == 1)
1759
  if (vhtCapabilities->GetSupportedChannelWidthSet () == 1)
1760
    {
1760
    {
1761
      state->m_channelWidth = 160;
1761
      state->m_channelWidth = 160;
1762
    }
1762
    }
 Lines 1770-1783    Link Here 
1770
    {
1770
    {
1771
      state->m_channelWidth = m_wifiPhy->GetChannelWidth ();
1771
      state->m_channelWidth = m_wifiPhy->GetChannelWidth ();
1772
    }
1772
    }
1773
  state->m_ldpc = (vhtCapabilities.GetRxLdpc () != 0);
1773
  state->m_ldpc = (vhtCapabilities->GetRxLdpc () != 0);
1774
  state->m_stbc = (vhtCapabilities.GetTxStbc () != 0 || vhtCapabilities.GetRxStbc () != 0);
1774
  state->m_stbc = (vhtCapabilities->GetTxStbc () != 0 || vhtCapabilities->GetRxStbc () != 0);
1775
  for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1775
  for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams (); i++)
1776
    {
1776
    {
1777
      for (uint8_t j = 0; j < m_wifiPhy->GetNMcs (); j++)
1777
      for (uint8_t j = 0; j < m_wifiPhy->GetNMcs (); j++)
1778
        {
1778
        {
1779
          WifiMode mcs = m_wifiPhy->GetMcs (j);
1779
          WifiMode mcs = m_wifiPhy->GetMcs (j);
1780
          if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities.IsSupportedMcs (mcs.GetMcsValue (), i))
1780
          if (mcs.GetModulationClass () == WIFI_MOD_CLASS_VHT && vhtCapabilities->IsSupportedMcs (mcs.GetMcsValue (), i))
1781
            {
1781
            {
1782
              AddSupportedMcs (from, mcs);
1782
              AddSupportedMcs (from, mcs);
1783
            }
1783
            }
 Lines 1787-1793    Link Here 
1787
}
1787
}
1788
1788
1789
void
1789
void
1790
WifiRemoteStationManager::AddStationHeCapabilities (Mac48Address from, HeCapabilities heCapabilities)
1790
WifiRemoteStationManager::AddStationHeCapabilities (Mac48Address from, Ptr<HeCapabilities> heCapabilities)
1791
{
1791
{
1792
  //Used by all stations to record HE capabilities of remote stations
1792
  //Used by all stations to record HE capabilities of remote stations
1793
  NS_LOG_FUNCTION (this << from << heCapabilities);
1793
  NS_LOG_FUNCTION (this << from << heCapabilities);
 Lines 1795-1805    Link Here 
1795
  state = LookupState (from);
1795
  state = LookupState (from);
1796
  if (Is5Ghz (m_wifiPhy->GetFrequency ()))
1796
  if (Is5Ghz (m_wifiPhy->GetFrequency ()))
1797
    {
1797
    {
1798
      if (heCapabilities.GetChannelWidthSet () & 0x04)
1798
      if (heCapabilities->GetChannelWidthSet () & 0x04)
1799
        {
1799
        {
1800
          state->m_channelWidth = 160;
1800
          state->m_channelWidth = 160;
1801
        }
1801
        }
1802
      else if (heCapabilities.GetChannelWidthSet () & 0x02)
1802
      else if (heCapabilities->GetChannelWidthSet () & 0x02)
1803
        {
1803
        {
1804
          state->m_channelWidth = 80;
1804
          state->m_channelWidth = 80;
1805
        }
1805
        }
 Lines 1807-1813    Link Here 
1807
    }
1807
    }
1808
  else if (Is2_4Ghz (m_wifiPhy->GetFrequency ()))
1808
  else if (Is2_4Ghz (m_wifiPhy->GetFrequency ()))
1809
    {
1809
    {
1810
      if (heCapabilities.GetChannelWidthSet () & 0x01)
1810
      if (heCapabilities->GetChannelWidthSet () & 0x01)
1811
        {
1811
        {
1812
          state->m_channelWidth = 40;
1812
          state->m_channelWidth = 40;
1813
        }
1813
        }
 Lines 1816-1826    Link Here 
1816
          state->m_channelWidth = 20;
1816
          state->m_channelWidth = 20;
1817
        }
1817
        }
1818
    }
1818
    }
1819
  if (heCapabilities.GetHeLtfAndGiForHePpdus () >= 2)
1819
  if (heCapabilities->GetHeLtfAndGiForHePpdus () >= 2)
1820
    {
1820
    {
1821
      state->m_guardInterval = 800;
1821
      state->m_guardInterval = 800;
1822
    }
1822
    }
1823
  else if (heCapabilities.GetHeLtfAndGiForHePpdus () == 1)
1823
  else if (heCapabilities->GetHeLtfAndGiForHePpdus () == 1)
1824
    {
1824
    {
1825
      state->m_guardInterval = 1600;
1825
      state->m_guardInterval = 1600;
1826
    }
1826
    }
 Lines 1834-1841    Link Here 
1834
        {
1834
        {
1835
          WifiMode mcs = m_wifiPhy->GetMcs (j);
1835
          WifiMode mcs = m_wifiPhy->GetMcs (j);
1836
          if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE
1836
          if (mcs.GetModulationClass () == WIFI_MOD_CLASS_HE
1837
              && heCapabilities.GetHighestNssSupported () >= i
1837
              && heCapabilities->GetHighestNssSupported () >= i
1838
              && heCapabilities.GetHighestMcsSupported () >= j)
1838
              && heCapabilities->GetHighestMcsSupported () >= j)
1839
            {
1839
            {
1840
              AddSupportedMcs (from, mcs);
1840
              AddSupportedMcs (from, mcs);
1841
            }
1841
            }
(-)a/src/wifi/model/wifi-remote-station-manager.h (-3 / +3 lines)
 Lines 175-195    Link Here 
175
   * \param from the address of the station being recorded
175
   * \param from the address of the station being recorded
176
   * \param htcapabilities the HT capabilities of the station
176
   * \param htcapabilities the HT capabilities of the station
177
   */
177
   */
178
  void AddStationHtCapabilities (Mac48Address from, HtCapabilities htcapabilities);
178
  void AddStationHtCapabilities (Mac48Address from, Ptr<HtCapabilities> htcapabilities);
179
  /**
179
  /**
180
   * Records VHT capabilities of the remote station.
180
   * Records VHT capabilities of the remote station.
181
   *
181
   *
182
   * \param from the address of the station being recorded
182
   * \param from the address of the station being recorded
183
   * \param vhtcapabilities the VHT capabilities of the station
183
   * \param vhtcapabilities the VHT capabilities of the station
184
   */
184
   */
185
  void AddStationVhtCapabilities (Mac48Address from, VhtCapabilities vhtcapabilities);
185
  void AddStationVhtCapabilities (Mac48Address from, Ptr<VhtCapabilities> vhtcapabilities);
186
  /**
186
  /**
187
   * Records HE capabilities of the remote station.
187
   * Records HE capabilities of the remote station.
188
   *
188
   *
189
   * \param from the address of the station being recorded
189
   * \param from the address of the station being recorded
190
   * \param hecapabilities the HE capabilities of the station
190
   * \param hecapabilities the HE capabilities of the station
191
   */
191
   */
192
  void AddStationHeCapabilities (Mac48Address from, HeCapabilities hecapabilities);
192
  void AddStationHeCapabilities (Mac48Address from, Ptr<HeCapabilities> hecapabilities);
193
  /**
193
  /**
194
   * Enable or disable HT capability support.
194
   * Enable or disable HT capability support.
195
   *
195
   *
(-)a/src/wifi/test/wifi-test.cc (-2 / +2 lines)
 Lines 1422-1429    Link Here 
1422
    {
1422
    {
1423
      MgtBeaconHeader beacon;
1423
      MgtBeaconHeader beacon;
1424
      packet->RemoveHeader (beacon);
1424
      packet->RemoveHeader (beacon);
1425
      HtOperation htOperation = beacon.GetHtOperation ();
1425
      Ptr<HtOperation> htOperation = StaticCast<HtOperation> (beacon.GetInformationElement (IE_HT_OPERATION));
1426
      if (htOperation.GetStaChannelWidth () > 0)
1426
      if (htOperation->GetStaChannelWidth () > 0)
1427
        {
1427
        {
1428
          m_countOperationalChannelWidth40++;
1428
          m_countOperationalChannelWidth40++;
1429
        }
1429
        }

Return to bug 2945