A Discrete-Event Network Simulator
API
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  * Authors: Ghada Badawy <gbadawy@gmail.com>
19  * Sébastien Deronne <sebastien.deronne@gmail.com>
20  */
21 
22 #ifndef HT_CAPABILITIES_H
23 #define HT_CAPABILITIES_H
24 
25 #include <stdint.h>
26 #include "ns3/buffer.h"
27 #include "ns3/attribute-helper.h"
28 #include "ns3/wifi-information-element.h"
29 
34 #define MAX_SUPPORTED_MCS (77)
35 
36 namespace ns3 {
37 
47 {
48 public:
49  HtCapabilities ();
50  void SetHtSupported (uint8_t htsupported);
51 
57  void SetHtCapabilitiesInfo (uint16_t ctrl);
63  void SetAmpduParameters (uint8_t ctrl);
70  void SetSupportedMcsSet (uint64_t ctrl1, uint64_t ctrl2);
76  void SetExtendedHtCapabilities (uint16_t ctrl);
82  void SetTxBfCapabilities (uint32_t ctrl);
88  void SetAntennaSelectionCapabilities (uint8_t ctrl);
89 
90  void SetLdpc (uint8_t ldpc);
91  void SetSupportedChannelWidth (uint8_t supportedchannelwidth);
92  void SetGreenfield (uint8_t greenfield);
93  void SetShortGuardInterval20 (uint8_t shortguardinterval);
94  void SetShortGuardInterval40 (uint8_t shortguardinterval);
95  void SetMaxAmsduLength (uint8_t maxamsdulength);
96  void SetLSigProtectionSupport (uint8_t lsigprotection);
97 
98  void SetMaxAmpduLength (uint8_t maxampdulength);
99 
100  void SetRxMcsBitmask (uint8_t index);
101  void SetRxHighestSupportedDataRate (uint16_t maxsupportedrate);
102  void SetTxMcsSetDefined (uint8_t txmcssetdefined);
103  void SetTxRxMcsSetUnequal (uint8_t txrxmcssetunequal);
104  void SetTxMaxNSpatialStreams (uint8_t maxtxspatialstreams);
105  void SetTxUnequalModulation (uint8_t txunequalmodulation);
106 
107  /*
108  * Return the HT Capabilties Info field in the HT Capabilities information element.
109  *
110  * \return the HT Capabilties Info field in the HT Capabilities information element
111  */
112  uint16_t GetHtCapabilitiesInfo (void) const;
113  /*
114  * Return the A-MPDU Parameters field in the HT Capabilities information element.
115  *
116  * \return the A-MPDU Parameters field in the HT Capabilities information element
117  */
118  uint8_t GetAmpduParameters (void) const;
119  /*
120  * Return the first 64 bytes of the Supported MCS Set field in the HT Capabilities information element.
121  *
122  * \return the first 64 bytes of the Supported MCS Set field in the HT Capabilities information element
123  */
124  uint64_t GetSupportedMcsSet1 (void) const;
125  /*
126  * Return the last 64 bytes of the Supported MCS Set field in the HT Capabilities information element.
127  *
128  * \return the last 64 bytes of the Supported MCS Set field in the HT Capabilities information element
129  */
130  uint64_t GetSupportedMcsSet2 (void) const;
131  /*
132  * Return the Extended HT Capabilties field in the HT Capabilities information element.
133  *
134  * \return the Extended HT Capabilties field in the HT Capabilities information element
135  */
136  uint16_t GetExtendedHtCapabilities (void) const;
137  /*
138  * Return the Transmit Beamforming (TxBF) Capabilties field in the HT Capabilities information element.
139  *
140  * \return the Transmit Beamforming (TxBF) Capabilties field in the HT Capabilities information element
141  */
142  uint32_t GetTxBfCapabilities (void) const;
143  /*
144  * Return the Antenna Selection (ASEL) Capabilties field in the HT Capabilities information element.
145  *
146  * \return the Antenna Selection (ASEL) Capabilties field in the HT Capabilities information element
147  */
148  uint8_t GetAntennaSelectionCapabilities (void) const;
149 
150  uint8_t GetLdpc (void) const;
151  uint8_t GetSupportedChannelWidth (void) const;
152  uint8_t GetGreenfield (void) const;
153  uint8_t GetShortGuardInterval20 (void) const;
154  uint8_t GetShortGuardInterval40 (void) const;
155  uint8_t GetMaxAmsduLength (void) const;
156  uint8_t GetLSigProtectionSupport (void) const;
157 
158  uint8_t GetMaxAmpduLength (void) const;
159 
160  uint8_t* GetRxMcsBitmask ();
161  bool IsSupportedMcs (uint8_t mcs) const;
162  uint8_t GetRxHighestSupportedAntennas (void) const;
163  uint16_t GetRxHighestSupportedDataRate (void) const;
164  uint8_t GetTxMcsSetDefined (void) const;
165  uint8_t GetTxRxMcsSetUnequal (void) const;
166  uint8_t GetTxMaxNSpatialStreams (void) const;
167  uint8_t GetTxUnequalModulation (void) const;
168 
170  uint8_t GetInformationFieldSize () const;
173  uint8_t length);
191  uint16_t GetSerializedSize () const;
192 
193 
194 private:
195  //HT Capabilties Info field
196  uint8_t m_ldpc;
198  uint8_t m_smPowerSave;
199  uint8_t m_greenField;
202  uint8_t m_txStbc;
203  uint8_t m_rxStbc;
206  uint8_t m_dssMode40;
207  uint8_t m_psmpSupport;
210 
211  //A-MPDU Parameters field
215 
216  //Supported MCS Set field
226 
227  //HT Extended Capabilties field
228  uint8_t m_pco;
231  uint8_t m_mcsFeedback;
232  uint8_t m_htcSupport;
235 
236  //Transmit Beamforming Capabilities field
240  uint8_t m_rxNdpCapable;
241  uint8_t m_txNdpCapable;
243  uint8_t m_calibration;
256  uint8_t m_reservedTxBf;
257 
258  //ASEL Capabilities field
266  uint8_t m_reservedASel;
267 
268  //This is used to decide whether this element should be added to the frame or not
269  uint8_t m_htSupported;
270 };
271 
272 std::ostream &operator << (std::ostream &os, const HtCapabilities &htcapabilities);
273 std::istream &operator >> (std::istream &is, HtCapabilities &htcapabilities);
274 
276 
277 } //namespace ns3
278 
279 #endif /* HT_CAPABILITY_H */
uint8_t GetMaxAmsduLength(void) const
uint8_t m_rxMcsBitmask[MAX_SUPPORTED_MCS]
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
Definition: angles.cc:48
void SetTxMcsSetDefined(uint8_t txmcssetdefined)
uint8_t GetTxRxMcsSetUnequal(void) const
uint8_t m_rxStaggeredSoundingCapable
uint8_t GetLSigProtectionSupport(void) const
void SetGreenfield(uint8_t greenfield)
void SetTxBfCapabilities(uint32_t ctrl)
Set the Transmit Beamforming (TxBF) Capabilties field in the HT Capabilities information element...
uint8_t m_explicitNoncompressedSteeringCapable
#define MAX_SUPPORTED_MCS
This defines the maximum number of supported MCSs that a STA is allowed to have.
uint8_t m_antennaIndicesFeedbackCapable
void SetHtSupported(uint8_t htsupported)
uint8_t m_reservedExtendedCapabilities2
uint64_t GetSupportedMcsSet2(void) const
void SetRxMcsBitmask(uint8_t index)
def start()
Definition: core.py:1482
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)
Set the A-MPDU Parameters field in the HT Capabilities information element.
uint8_t GetShortGuardInterval40(void) const
uint8_t m_txSoundingPpdusCapable
iterator in a Buffer instance
Definition: buffer.h:98
uint8_t GetTxUnequalModulation(void) const
void SetLSigProtectionSupport(uint8_t lsigprotection)
Information element, as defined in 802.11-2007 standardThe IEEE 802.11 standard includes the notion o...
uint8_t m_txStaggeredSoundingCapable
void SetShortGuardInterval20(uint8_t shortguardinterval)
uint8_t GetGreenfield(void) const
uint8_t m_csiNBfAntennasSupported
uint64_t GetSupportedMcsSet1(void) const
uint16_t m_rxHighestSupportedDataRate
void SetMaxAmsduLength(uint8_t maxamsdulength)
uint8_t m_antennaSelectionCapability
uint32_t GetTxBfCapabilities(void) const
uint8_t GetShortGuardInterval20(void) const
void SetMaxAmpduLength(uint8_t maxampdulength)
uint16_t GetRxHighestSupportedDataRate(void) const
uint8_t m_channelEstimationCapability
uint8_t GetTxMaxNSpatialStreams(void) const
WifiInformationElementId ElementId() const
Own unique Element ID.
uint8_t GetTxMcsSetDefined(void) const
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
void SetRxHighestSupportedDataRate(uint16_t maxsupportedrate)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t m_explicitCompressedBfFeedbackCapable
bool IsSupportedMcs(uint8_t mcs) const
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 SetTxUnequalModulation(uint8_t txunequalmodulation)
void SetSupportedMcsSet(uint64_t ctrl1, uint64_t ctrl2)
Set the Supported MCS Set field in the HT Capabilities information element.
void SetExtendedHtCapabilities(uint16_t ctrl)
Set the Extended HT Capabilties field in the HT Capabilities information element. ...
uint8_t GetInformationFieldSize() const
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
void SetAntennaSelectionCapabilities(uint8_t ctrl)
Set the the Antenna Selection (ASEL) Capabilties field in the HT Capabilities information element...
uint8_t GetLdpc(void) const
void SetHtCapabilitiesInfo(uint16_t ctrl)
Set the HT Capabilties Info field in the HT Capabilities information element.
uint16_t GetHtCapabilitiesInfo(void) const
uint8_t m_noncompressedSteeringNBfAntennasSupported
uint8_t m_explicitCsiTxBfCapable
uint8_t m_compressedSteeringNBfAntennasSupported
uint8_t m_explicitCsiFeedbackBasedTxASelCapable
uint8_t m_explicitCsiFeedbackCapable
void SetLdpc(uint8_t ldpc)
void SetTxRxMcsSetUnequal(uint8_t txrxmcssetunequal)
uint8_t m_csiMaxNRowsBfSupported
uint8_t * GetRxMcsBitmask()
uint8_t GetRxHighestSupportedAntennas(void) const
uint8_t m_explicitTxBfCsiFeedback
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
void SetTxMaxNSpatialStreams(uint8_t maxtxspatialstreams)
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_reservedExtendedCapabilities
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 SetShortGuardInterval40(uint8_t shortguardinterval)
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type.
uint8_t GetAntennaSelectionCapabilities(void) const
void SetSupportedChannelWidth(uint8_t supportedchannelwidth)
uint8_t m_reverzeDirectionResponder
uint8_t GetMaxAmpduLength(void) const
uint8_t m_explicitNoncompressedBfFeedbackCapable
uint8_t m_explicitCompressedSteeringCapable
uint8_t m_antennaIndicesFeedbackBasedTxASelCapable
uint16_t GetExtendedHtCapabilities(void) const