A Discrete-Event Network Simulator
API
supported-rates.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2006 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
21 #ifndef SUPPORTED_RATES_H
22 #define SUPPORTED_RATES_H
23 
25 
26 namespace ns3 {
27 
28 class SupportedRates;
29 
43 {
44 public:
53 
54  // Implementations of pure virtual methods of WifiInformationElement
55  WifiInformationElementId ElementId () const override;
56  uint8_t GetInformationFieldSize () const override;
57  void SerializeInformationField (Buffer::Iterator start) const override;
59  uint8_t length) override;
60  /* This information element is a bit special in that it is only
61  included if there are more than 8 rates. To support this we
62  override the Serialize and GetSerializedSize methods of
63  WifiInformationElement. */
65  uint16_t GetSerializedSize () const override;
66 
72  void SetSupportedRates (SupportedRates *rates);
73 
74 
75 private:
82 };
83 
84 
96 {
97 public:
98  SupportedRates ();
99 
105  SupportedRates (const SupportedRates & rates);
106 
107  // Implementations of pure virtual methods of WifiInformationElement
109  uint8_t GetInformationFieldSize () const;
112  uint8_t length);
113 
121 
128  static const uint8_t MAX_SUPPORTED_RATES = 32;
129 
135  void AddSupportedRate (uint64_t bs);
141  void SetBasicRate (uint64_t bs);
148  void AddBssMembershipSelectorRate (uint64_t bs);
158  bool IsSupportedRate (uint64_t bs) const;
168  bool IsBasicRate (uint64_t bs) const;
178  bool IsBssMembershipSelectorRate (uint64_t bs) const;
184  uint8_t GetNRates (void) const;
192  uint32_t GetRate (uint8_t i) const;
193 
203 
204 
205 private:
206  uint8_t m_nRates;
208 };
209 
218 std::ostream &operator << (std::ostream &os, const SupportedRates &rates);
219 
220 } //namespace ns3
221 
222 #endif /* SUPPORTED_RATES_H */
ns3::SupportedRates::m_rates
uint8_t m_rates[MAX_SUPPORTED_RATES]
List of supported bit rates (divided by 500000)
Definition: supported-rates.h:207
ns3::SupportedRates::IsBssMembershipSelectorRate
bool IsBssMembershipSelectorRate(uint64_t bs) const
Check if the given rate is a BSS membership selector value.
Definition: supported-rates.cc:149
ns3::SupportedRates::DeserializeInformationField
uint8_t DeserializeInformationField(Buffer::Iterator start, uint8_t length)
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
Definition: supported-rates.cc:198
ns3::SupportedRates::ElementId
WifiInformationElementId ElementId() const
Definition: supported-rates.cc:174
ns3::ExtendedSupportedRatesIE::DeserializeInformationField
uint8_t DeserializeInformationField(Buffer::Iterator start, uint8_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
Definition: supported-rates.cc:287
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::ExtendedSupportedRatesIE::m_supportedRates
SupportedRates * m_supportedRates
This member points to the SupportedRates object that contains the actual rate details.
Definition: supported-rates.h:81
ns3::WifiInformationElement
Information element, as defined in 802.11-2007 standard.
Definition: wifi-information-element.h:232
ns3::SupportedRates::m_nRates
uint8_t m_nRates
Number of supported rates.
Definition: supported-rates.h:206
wifi-information-element.h
ns3::ExtendedSupportedRatesIE::SetSupportedRates
void SetSupportedRates(SupportedRates *rates)
Set supported rates.
Definition: supported-rates.cc:223
ns3::WifiInformationElementId
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
Definition: wifi-information-element.h:40
ns3::SupportedRates::SetBasicRate
void SetBasicRate(uint64_t bs)
Set the given rate to basic rates.
Definition: supported-rates.cc:74
ns3::SupportedRates::IsSupportedRate
bool IsSupportedRate(uint64_t bs) const
Check if the given rate is supported.
Definition: supported-rates.cc:133
ns3::SupportedRates
The Supported Rates Information Element.
Definition: supported-rates.h:96
ns3::ExtendedSupportedRatesIE::GetSerializedSize
uint16_t GetSerializedSize() const override
Get the size of the serialized IE including Element ID and length fields.
Definition: supported-rates.cc:272
visualizer.core.start
def start()
Definition: core.py:1855
ns3::SupportedRates::operator=
SupportedRates & operator=(const SupportedRates &rates)
Assignment operator.
Definition: supported-rates.cc:49
ns3::ExtendedSupportedRatesIE::ExtendedSupportedRatesIE
ExtendedSupportedRatesIE()
Definition: supported-rates.cc:207
ns3::ExtendedSupportedRatesIE
The Extended Supported Rates Information Element.
Definition: supported-rates.h:43
ns3::SupportedRates::IsBasicRate
bool IsBasicRate(uint64_t bs) const
Check if the given rate is a basic rate.
Definition: supported-rates.cc:118
ns3::SupportedRates::SupportedRates
SupportedRates()
Definition: supported-rates.cc:32
ns3::SupportedRates::GetNRates
uint8_t GetNRates(void) const
Return the number of supported rates.
Definition: supported-rates.cc:162
ns3::SupportedRates::GetInformationFieldSize
uint8_t GetInformationFieldSize() const
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
Definition: supported-rates.cc:180
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition: buffer.h:99
ns3::SupportedRates::extended
ExtendedSupportedRatesIE extended
extended supported rates info element
Definition: supported-rates.h:202
ns3::SupportedRates::GetRate
uint32_t GetRate(uint8_t i) const
Return the rate at the given index.
Definition: supported-rates.cc:168
ns3::ExtendedSupportedRatesIE::GetInformationFieldSize
uint8_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
Definition: supported-rates.cc:229
ns3::SupportedRates::MAX_SUPPORTED_RATES
static const uint8_t MAX_SUPPORTED_RATES
This defines the maximum number of supported rates that a STA is allowed to have.
Definition: supported-rates.h:128
ns3::ExtendedSupportedRatesIE::SerializeInformationField
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
Definition: supported-rates.cc:244
ns3::SupportedRates::SerializeInformationField
void SerializeInformationField(Buffer::Iterator start) const
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
Definition: supported-rates.cc:189
ns3::SupportedRates::AddSupportedRate
void AddSupportedRate(uint64_t bs)
Add the given rate to the supported rates.
Definition: supported-rates.cc:59
ns3::SupportedRates::AddBssMembershipSelectorRate
void AddBssMembershipSelectorRate(uint64_t bs)
Add a special value to the supported rate set, corresponding to a BSS membership selector.
Definition: supported-rates.cc:97
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137
ns3::ExtendedSupportedRatesIE::Serialize
Buffer::Iterator Serialize(Buffer::Iterator start) const override
Serialize entire IE including Element ID and length fields.
Definition: supported-rates.cc:258
ns3::ExtendedSupportedRatesIE::ElementId
WifiInformationElementId ElementId() const override
Definition: supported-rates.cc:217