A Discrete-Event Network Simulator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013
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
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: Ghada Badawy <gbadawy@gmail.com>
19  */
23 #include <stdint.h>
24 #include "ns3/buffer.h"
25 #include "ns3/attribute-helper.h"
26 #include "ns3/wifi-information-element.h"
32 #define MAX_SUPPORTED_MCS (77)
34 namespace ns3 {
43 {
44 public:
45  HtCapabilities ();
46  void SetLdpc (uint8_t ldpc);
47  void SetSupportedChannelWidth (uint8_t supportedchannelwidth);
48  void SetGreenfield (uint8_t greenfield);
49  void SetShortGuardInterval20(uint8_t shortguardinterval);
50  void SetHtCapabilitiesInfo(uint16_t ctrl);
51  void SetAmpduParameters (uint8_t ctrl);
52  void SetSupportedMcsSet (uint64_t ctrl1, uint64_t ctrl2);
53  void SetHtSupported(uint8_t htsupported);
54  void SetRxMcsBitmask(uint8_t index);
55  bool IsSupportedMcs (uint8_t mcs);
56  //returns the HT Capabilties info field in the HT Capabilities information element
57  uint16_t GetHtCapabilitiesInfo (void) const;
58  //returns the Ampdu parameters field in the HT Capabilities information element
59  uint8_t GetAmpduParameters (void) const;
60  //returns the first 64bytes of the Supported MCS field in the HT Capabilities information element
61  uint64_t GetSupportedMcsSet1 (void) const;
62  //returns the first 64bytes of the Supported MCS field in the HT Capabilities information element
63  uint64_t GetSupportedMcsSet2 (void) const;
64  uint8_t GetLdpc (void) const;
65  uint8_t GetGreenfield (void) const;
66  uint8_t GetShortGuardInterval20 (void) const;
67  uint8_t GetSupportedChannelWidth (void) const; //2040 supported or not
68  uint8_t* GetRxMcsBitmask();
71  uint8_t GetInformationFieldSize () const;
74  uint8_t length);
92  uint16_t GetSerializedSize () const;
94 private:
95  uint8_t m_ldpc;
97  uint8_t m_smPowerSave;
98  uint8_t m_greenField;
101  uint8_t m_txStbc;
102  uint8_t m_rxStbc;
105  uint8_t m_dssMode40;
106  uint8_t m_reserved;
119  uint32_t m_reservedMcsSet3;
121  //this is used to decide if this element should be added to the frame or not
122  uint8_t m_htSupported;
123 };
125 std::ostream &operator << (std::ostream &os, const HtCapabilities &htcapabilities);
126 std::istream &operator >> (std::istream &is, HtCapabilities &htcapabilities);
130 } // namespace ns3
132 #endif /* HT_CAPABILITY_H */
uint8_t m_rxMcsBitmask[MAX_SUPPORTED_MCS]
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
Definition: angles.cc:49
void SetGreenfield(uint8_t greenfield)
uint8_t m_supportedChannelWidth
This defines the maximum number of supported MCSs that a STA is allowed to have.
void SetHtSupported(uint8_t htsupported)
uint64_t GetSupportedMcsSet2(void) const
void SetRxMcsBitmask(uint8_t index)
The Ht Capabilities Information ElementThis class knows how to serialise and deserialise the Ht Capab...
uint8_t GetSupportedChannelWidth(void) const
void SetAmpduParameters(uint8_t ctrl)
iterator in a Buffer instance
Definition: buffer.h:98
Information element, as defined in 802.11-2007 standardThe IEEE 802.11 standard includes the notion o...
void SetShortGuardInterval20(uint8_t shortguardinterval)
uint8_t GetGreenfield(void) const
uint64_t GetSupportedMcsSet1(void) const
uint16_t m_rxHighestSupportedDataRate
uint8_t GetShortGuardInterval20(void) const
bool IsSupportedMcs(uint8_t mcs)
WifiInformationElementId ElementId() const
Own unique Element ID.
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:43
uint8_t GetAmpduParameters(void) const
void SerializeInformationField(Buffer::Iterator start) const
Serialize information (i.e., the body of the IE, not including the Element ID and length octets) ...
void SetSupportedMcsSet(uint64_t ctrl1, uint64_t ctrl2)
uint8_t GetInformationFieldSize() const
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
uint8_t GetLdpc(void) const
void SetHtCapabilitiesInfo(uint16_t ctrl)
uint16_t GetHtCapabilitiesInfo(void) const
void SetLdpc(uint8_t ldpc)
uint8_t * GetRxMcsBitmask()
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
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) ...
uint16_t GetSerializedSize() const
Return the serialized size of this HT capability information element.
uint8_t m_shortGuardInterval20
Buffer::Iterator Serialize(Buffer::Iterator start) const
This information element is a bit special in that it is only included if the STA is an HT STA...
void SetSupportedChannelWidth(uint8_t supportedchannelwidth)