A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ht-capabilities.h
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
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: Ghada Badawy <gbadawy@gmail.com>
19  */
20 #ifndef HT_CAPABILITIES_H
21 #define HT_CAPABILITIES_H
22 
23 #include <stdint.h>
24 #include "ns3/buffer.h"
25 #include "ns3/attribute-helper.h"
26 #include "ns3/wifi-information-element.h"
27 
32 #define MAX_SUPPORTED_MCS (77)
33 
34 namespace ns3 {
35 
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();
69 
71  uint8_t GetInformationFieldSize () const;
74  uint8_t length);
75  /*
76  * This information element is a bit special in that it is only
77  * included if the STA is an HT STA. To support this we
78  * override the Serialize and GetSerializedSize methods of
79  * WifiInformationElement.
80  */
82  uint16_t GetSerializedSize () const;
83 
84 private:
85  uint8_t m_ldpc;
87  uint8_t m_smPowerSave;
88  uint8_t m_greenField;
91  uint8_t m_txStbc;
92  uint8_t m_rxStbc;
95  uint8_t m_dssMode40;
96  uint8_t m_reserved;
109  uint32_t m_reservedMcsSet3;
111  //this is used to decide if this element should be added to the frame or not
112  uint8_t m_htSupported;
113 };
114 
115 std::ostream &operator << (std::ostream &os, const HtCapabilities &htcapabilities);
116 std::istream &operator >> (std::istream &is, HtCapabilities &htcapabilities);
117 
119 
120 } // namespace ns3
121 
122 #endif /* HT_CAPABILITY_H */
uint8_t m_rxMcsBitmask[MAX_SUPPORTED_MCS]
ATTRIBUTE_HELPER_HEADER(ObjectFactory)
std::istream & operator>>(std::istream &is, Angles &a)
Definition: angles.cc:49
void SetGreenfield(uint8_t greenfield)
uint8_t m_supportedChannelWidth
#define MAX_SUPPORTED_MCS
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
uint8_t m_shortGuardInterval40
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)
Definition: angles.cc:43
uint8_t GetAmpduParameters(void) const
void SerializeInformationField(Buffer::Iterator start) const
void SetSupportedMcsSet(uint64_t ctrl1, uint64_t ctrl2)
uint8_t GetInformationFieldSize() const
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
uint8_t DeserializeInformationField(Buffer::Iterator start, uint8_t length)
uint16_t GetSerializedSize() const
uint8_t m_shortGuardInterval20
Buffer::Iterator Serialize(Buffer::Iterator start) const
uint8_t m_lsigProtectionSupport
void SetSupportedChannelWidth(uint8_t supportedchannelwidth)