A Discrete-Event Network Simulator
API
ht-operations.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2016 Sébastien Deronne
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: Sébastien Deronne <sebastien.deronne@gmail.com>
19  */
20 
21 #ifndef HT_OPERATIONS_H
22 #define HT_OPERATIONS_H
23 
24 #include <stdint.h>
25 #include "ns3/buffer.h"
26 #include "ns3/attribute-helper.h"
27 #include "ns3/wifi-information-element.h"
28 
33 #define MAX_SUPPORTED_MCS (77)
34 
35 namespace ns3 {
36 
38 {
43 };
44 
55 {
56 public:
57  HtOperations ();
58  void SetHtSupported (uint8_t htsupported);
59 
65  void SetPrimaryChannel (uint8_t ctrl);
71  void SetInformationSubset1 (uint8_t ctrl);
77  void SetInformationSubset2 (uint16_t ctrl);
83  void SetInformationSubset3 (uint16_t ctrl);
90  void SetBasicMcsSet (uint64_t ctrl1, uint64_t ctrl2);
91 
92  void SetSecondaryChannelOffset (uint8_t secondarychanneloffset);
93  void SetStaChannelWidth (uint8_t stachannelwidth);
94  void SetRifsMode (uint8_t rifsmode);
95 
96  void SetHtProtection (uint8_t htprotection);
97  void SetNonGfHtStasPresent (uint8_t nongfhtstaspresent);
98  void SetObssNonHtStasPresent (uint8_t obssnonhtstaspresent);
99 
100  void SetDualBeacon (uint8_t dualbeacon);
101  void SetDualCtsProtection (uint8_t dualctsprotection);
102  void SetStbcBeacon (uint8_t stbcbeacon);
103  void SetLSigTxopProtectionFullSupport (uint8_t lsigtxopprotectionfullsupport);
104  void SetPcoActive (uint8_t pcoactive);
105  void SetPhase (uint8_t pcophase);
106 
107  void SetRxMcsBitmask (uint8_t index);
108  void SetRxHighestSupportedDataRate (uint16_t maxsupportedrate);
109  void SetTxMcsSetDefined (uint8_t txmcssetdefined);
110  void SetTxRxMcsSetUnequal (uint8_t txrxmcssetunequal);
111  void SetTxMaxNSpatialStreams (uint8_t maxtxspatialstreams);
112  void SetTxUnequalModulation (uint8_t txunequalmodulation);
113 
114  /*
115  * Return the Primary Channel field in the HT Operations information element.
116  *
117  * \return the Primary Channel field in the HT Operations information element
118  */
119  uint8_t GetPrimaryChannel (void) const;
120  /*
121  * Return the Information Subset 1 field in the HT Operations information element.
122  *
123  * \return the Information Subset 1 field in the HT Operations information element
124  */
125  uint8_t GetInformationSubset1 (void) const;
126  /*
127  * Return the Information Subset 2 field in the HT Operations information element.
128  *
129  * \return the Information Subset 2 field in the HT Operations information element
130  */
131  uint16_t GetInformationSubset2 (void) const;
132  /*
133  * Return the Information Subset 3 field in the HT Operations information element.
134  *
135  * \return the Information Subset 3 field in the HT Operations information element
136  */
137  uint16_t GetInformationSubset3 (void) const;
138  /*
139  * Return the first 64 bytes of the Basic MCS Set field in the HT Operations information element.
140  *
141  * \return the first 64 bytes of the Basic MCS Set field in the HT Operations information element
142  */
143  uint64_t GetBasicMcsSet1 (void) const;
144  /*
145  * Return the last 64 bytes of the Basic MCS Set field in the HT Operations information element.
146  *
147  * \return the last 64 bytes of the Basic MCS Set field in the HT Operations information element
148  */
149  uint64_t GetBasicMcsSet2 (void) const;
150 
151  uint8_t GetSecondaryChannelOffset (void) const;
152  uint8_t GetStaChannelWidth (void) const;
153  uint8_t GetRifsMode (void) const;
154 
155  uint8_t GetHtProtection (void) const;
156  uint8_t GetNonGfHtStasPresent (void) const;
157  uint8_t GetObssNonHtStasPresent (void) const;
158 
159  uint8_t GetDualBeacon (void) const;
160  uint8_t GetDualCtsProtection (void) const;
161  uint8_t GetStbcBeacon (void) const;
162  uint8_t GetLSigTxopProtectionFullSupport (void) const;
163  uint8_t GetPcoActive (void) const;
164  uint8_t GetPhase (void) const;
165 
166  bool IsSupportedMcs (uint8_t mcs);
167  uint16_t GetRxHighestSupportedDataRate (void) const;
168  uint8_t GetTxMcsSetDefined (void) const;
169  uint8_t GetTxRxMcsSetUnequal (void) const;
170  uint8_t GetTxMaxNSpatialStreams (void) const;
171  uint8_t GetTxUnequalModulation (void) const;
172 
174  uint8_t GetInformationFieldSize () const;
177  uint8_t length);
194  uint16_t GetSerializedSize () const;
195 
196 
197 private:
199 
200  //HT Information Subset 1
203  uint8_t m_rifsMode;
205 
206  //HT Information Subset 2
207  uint8_t m_htProtection;
212 
213  //HT Information Subset 3
215  uint8_t m_dualBeacon;
217  uint8_t m_stbcBeacon;
219  uint8_t m_pcoActive;
220  uint8_t m_pcoPhase;
222 
223  //Basic MCS Set field
233 
234  //This is used to decide whether this element should be added to the frame or not
235  uint8_t m_htSupported;
236 };
237 
238 std::ostream &operator << (std::ostream &os, const HtOperations &htoperations);
239 std::istream &operator >> (std::istream &is, HtOperations &htoperations);
240 
242 
243 } //namespace ns3
244 
245 #endif /* HT_OPERATIONS_H */
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...
The HT Operations Information ElementThis class knows how to serialise and deserialise the HT Operati...
Definition: ht-operations.h:54
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
Definition: angles.cc:48
uint8_t m_txRxMcsSetUnequal
uint64_t GetBasicMcsSet1(void) const
uint8_t m_primaryChannel
uint8_t GetStaChannelWidth(void) const
uint8_t m_reservedInformationSubset2_1
uint8_t GetNonGfHtStasPresent(void) const
void SetTxRxMcsSetUnequal(uint8_t txrxmcssetunequal)
uint8_t m_nonGfHtStasPresent
uint8_t m_reservedMcsSet2
def start()
Definition: core.py:1482
void SetStbcBeacon(uint8_t stbcbeacon)
void SetTxMcsSetDefined(uint8_t txmcssetdefined)
void SerializeInformationField(Buffer::Iterator start) const
Serialize information (i.e., the body of the IE, not including the Element ID and length octets) ...
uint8_t m_lSigTxopProtectionFullSupport
uint8_t GetTxRxMcsSetUnequal(void) const
void SetStaChannelWidth(uint8_t stachannelwidth)
void SetHtProtection(uint8_t htprotection)
uint8_t GetLSigTxopProtectionFullSupport(void) const
uint8_t GetPcoActive(void) const
void SetLSigTxopProtectionFullSupport(uint8_t lsigtxopprotectionfullsupport)
iterator in a Buffer instance
Definition: buffer.h:98
uint16_t GetSerializedSize() const
Return the serialized size of this HT Operations IE.
bool IsSupportedMcs(uint8_t mcs)
void SetInformationSubset3(uint16_t ctrl)
Set the Information Subset 3 field in the HT Operations information element.
Information element, as defined in 802.11-2007 standardThe IEEE 802.11 standard includes the notion o...
void SetSecondaryChannelOffset(uint8_t secondarychanneloffset)
#define MAX_SUPPORTED_MCS
This defines the maximum number of supported MCSs that a STA is allowed to have.
Definition: ht-operations.h:33
void SetRxHighestSupportedDataRate(uint16_t maxsupportedrate)
uint8_t GetTxUnequalModulation(void) const
uint8_t m_txMaxNSpatialStreams
void SetTxMaxNSpatialStreams(uint8_t maxtxspatialstreams)
uint8_t GetInformationSubset1(void) const
uint8_t GetDualCtsProtection(void) const
void SetPcoActive(uint8_t pcoactive)
void SetNonGfHtStasPresent(uint8_t nongfhtstaspresent)
uint8_t m_secondaryChannelOffset
uint8_t GetInformationFieldSize() const
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
WifiInformationElementId ElementId() const
Own unique Element ID.
uint8_t m_reservedInformationSubset1
uint16_t GetInformationSubset3(void) const
void SetRxMcsBitmask(uint8_t index)
uint8_t m_dualCtsProtection
void SetTxUnequalModulation(uint8_t txunequalmodulation)
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
uint8_t m_staChannelWidth
uint8_t m_obssNonHtStasPresent
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetHtSupported(uint8_t htsupported)
uint8_t GetTxMaxNSpatialStreams(void) const
HtProtectionType
Definition: ht-operations.h:37
uint8_t m_txMcsSetDefined
void SetDualCtsProtection(uint8_t dualctsprotection)
uint8_t GetPhase(void) const
void SetDualBeacon(uint8_t dualbeacon)
uint8_t m_rxMcsBitmask[MAX_SUPPORTED_MCS]
uint8_t GetPrimaryChannel(void) const
uint8_t m_txUnequalModulation
void SetInformationSubset1(uint8_t ctrl)
Set the Information Subset 1 field in the HT Operations information element.
uint8_t GetStbcBeacon(void) const
uint8_t GetHtProtection(void) const
uint8_t m_reservedInformationSubset3_1
uint8_t m_reservedInformationSubset3_2
void SetRifsMode(uint8_t rifsmode)
uint8_t GetRifsMode(void) const
uint32_t m_reservedMcsSet3
void SetPrimaryChannel(uint8_t ctrl)
Set the Primary Channel field in the HT Operations information element.
void SetInformationSubset2(uint16_t ctrl)
Set the Information Subset 2 field in the HT Operations information element.
uint16_t GetRxHighestSupportedDataRate(void) const
void SetBasicMcsSet(uint64_t ctrl1, uint64_t ctrl2)
Set the Basic MCS Set field in the HT Operations information element.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
uint16_t GetInformationSubset2(void) const
uint8_t GetSecondaryChannelOffset(void) const
void SetPhase(uint8_t pcophase)
void SetObssNonHtStasPresent(uint8_t obssnonhtstaspresent)
#define ATTRIBUTE_HELPER_HEADER(type)
Declare the attribute value, accessor and checkers for class type.
uint8_t GetObssNonHtStasPresent(void) const
uint8_t GetDualBeacon(void) const
uint8_t m_reservedMcsSet1
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 m_rxHighestSupportedDataRate
uint8_t m_reservedInformationSubset2_2
uint64_t GetBasicMcsSet2(void) const
uint8_t GetTxMcsSetDefined(void) const