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  * 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 
45 {
46 public:
47  HtCapabilities ();
48  void SetLdpc (uint8_t ldpc);
49  void SetSupportedChannelWidth (uint8_t supportedchannelwidth);
50  void SetGreenfield (uint8_t greenfield);
51  void SetShortGuardInterval20(uint8_t shortguardinterval);
52  void SetHtCapabilitiesInfo(uint16_t ctrl);
53  void SetAmpduParameters (uint8_t ctrl);
54  void SetSupportedMcsSet (uint64_t ctrl1, uint64_t ctrl2);
55  void SetHtSupported(uint8_t htsupported);
56  void SetRxMcsBitmask(uint8_t index);
57  bool IsSupportedMcs (uint8_t mcs);
58  //returns the HT Capabilties info field in the HT Capabilities information element
59  uint16_t GetHtCapabilitiesInfo (void) const;
60  //returns the Ampdu parameters field in the HT Capabilities information element
61  uint8_t GetAmpduParameters (void) const;
62  //returns the first 64bytes of the Supported MCS field in the HT Capabilities information element
63  uint64_t GetSupportedMcsSet1 (void) const;
64  //returns the first 64bytes of the Supported MCS field in the HT Capabilities information element
65  uint64_t GetSupportedMcsSet2 (void) const;
66  uint8_t GetLdpc (void) const;
67  uint8_t GetGreenfield (void) const;
68  uint8_t GetShortGuardInterval20 (void) const;
69  uint8_t GetSupportedChannelWidth (void) const;
70  uint8_t* GetRxMcsBitmask();
71 
73  uint8_t GetInformationFieldSize () const;
76  uint8_t length);
94  uint16_t GetSerializedSize () const;
95 
96 private:
97  uint8_t m_ldpc;
99  uint8_t m_smPowerSave;
100  uint8_t m_greenField;
103  uint8_t m_txStbc;
104  uint8_t m_rxStbc;
107  uint8_t m_dssMode40;
108  uint8_t m_reserved;
121  uint32_t m_reservedMcsSet3;
123  //this is used to decide if this element should be added to the frame or not
124  uint8_t m_htSupported;
125 };
126 
127 std::ostream &operator << (std::ostream &os, const HtCapabilities &htcapabilities);
128 std::istream &operator >> (std::istream &is, HtCapabilities &htcapabilities);
129 
131 
132 } // namespace ns3
133 
134 #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:48
void SetGreenfield(uint8_t greenfield)
uint8_t m_supportedChannelWidth
#define MAX_SUPPORTED_MCS
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)
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)
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:42
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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.
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...
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type.
void SetSupportedChannelWidth(uint8_t supportedchannelwidth)