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 
59  void SetSupportedRates (SupportedRates *rates);
60 
70  uint8_t GetInformationFieldSize () const;
85  uint8_t length);
86 
105  uint16_t GetSerializedSize () const;
106 
107 
108 private:
115 };
116 
117 
129 {
130 public:
131  SupportedRates ();
132 
134  SupportedRates (const SupportedRates &);
142 
149  static const uint8_t MAX_SUPPORTED_RATES = 32;
150 
156  void AddSupportedRate (uint64_t bs);
162  void SetBasicRate (uint64_t bs);
169  void AddBssMembershipSelectorRate (uint64_t bs);
179  bool IsSupportedRate (uint64_t bs) const;
189  bool IsBasicRate (uint64_t bs) const;
199  bool IsBssMembershipSelectorRate (uint64_t bs) const;
205  uint8_t GetNRates (void) const;
213  uint32_t GetRate (uint8_t i) const;
225  uint8_t GetInformationFieldSize () const;
240  uint8_t length);
241 
251 
252 
253 private:
254  uint8_t m_nRates;
256 };
257 
258 std::ostream &operator << (std::ostream &os, const SupportedRates &rates);
259 
260 } //namespace ns3
261 
262 #endif /* SUPPORTED_RATES_H */
SupportedRates & operator=(const SupportedRates &rates)
assignment operator
bool IsBssMembershipSelectorRate(uint64_t bs) const
Check if the given rate is a BSS membership selector value.
bool IsSupportedRate(uint64_t bs) const
Check if the given rate is supported.
uint8_t DeserializeInformationField(Buffer::Iterator start, uint8_t length)
Deserialize information field.
def start()
Definition: core.py:1844
void SetBasicRate(uint64_t bs)
Set the given rate to basic rates.
uint32_t GetRate(uint8_t i) const
Return the rate at the given index.
bool IsBasicRate(uint64_t bs) const
Check if the given rate is a basic rate.
uint16_t GetSerializedSize() const
Return the serialized size of this supported rates information element.
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
Buffer::Iterator Serialize(Buffer::Iterator start) const
This information element is a bit special in that it is only included if there are more than 8 rates...
void AddSupportedRate(uint64_t bs)
Add the given rate to the supported rates.
iterator in a Buffer instance
Definition: buffer.h:98
ExtendedSupportedRatesIE extended
extended supported rates info element
Information element, as defined in 802.11-2007 standardThe IEEE 802.11 standard includes the notion o...
WifiInformationElementId ElementId() const
Get the ElementID.
WifiInformationElementId ElementId() const
Get element ID.
uint8_t GetInformationFieldSize() const
Get the information field size.
void SetSupportedRates(SupportedRates *rates)
Set supported rates.
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
uint8_t m_nRates
Number of supported rates.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void AddBssMembershipSelectorRate(uint64_t bs)
Add a special value to the supported rate set, corresponding to a BSS membership selector.
The Extended Supported Rates Information ElementThis class knows how to serialise and deserialise the...
uint8_t m_rates[MAX_SUPPORTED_RATES]
List of supported bitrate (divided by 500000)
uint8_t DeserializeInformationField(Buffer::Iterator start, uint8_t length)
Get the information field size.
uint8_t GetInformationFieldSize() const
Get information field size.
void SerializeInformationField(Buffer::Iterator start) const
Serialize information field.
SupportedRates * m_supportedRates
This member points to the SupportedRates object that contains the actual rate details.
void SerializeInformationField(Buffer::Iterator start) const
Get the information field size.
uint8_t GetNRates(void) const
Return the number of supported rates.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
static const uint8_t MAX_SUPPORTED_RATES
This defines the maximum number of supported rates that a STA is allowed to have. ...