A Discrete-Event Network Simulator
API
ht-operation.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_OPERATION_H
22 #define HT_OPERATION_H
23 
25 
30 #define MAX_SUPPORTED_MCS (77)
31 
32 namespace ns3 {
33 
36 {
41 };
42 
53 {
54 public:
55  HtOperation ();
61  void SetHtSupported (uint8_t htsupported);
62 
68  void SetPrimaryChannel (uint8_t ctrl);
74  void SetInformationSubset1 (uint8_t ctrl);
80  void SetInformationSubset2 (uint16_t ctrl);
86  void SetInformationSubset3 (uint16_t ctrl);
93  void SetBasicMcsSet (uint64_t ctrl1, uint64_t ctrl2);
94 
100  void SetSecondaryChannelOffset (uint8_t secondarychanneloffset);
106  void SetStaChannelWidth (uint8_t stachannelwidth);
112  void SetRifsMode (uint8_t rifsmode);
113 
119  void SetHtProtection (uint8_t htprotection);
125  void SetNonGfHtStasPresent (uint8_t nongfhtstaspresent);
131  void SetObssNonHtStasPresent (uint8_t obssnonhtstaspresent);
132 
138  void SetDualBeacon (uint8_t dualbeacon);
144  void SetDualCtsProtection (uint8_t dualctsprotection);
150  void SetStbcBeacon (uint8_t stbcbeacon);
156  void SetLSigTxopProtectionFullSupport (uint8_t lsigtxopprotectionfullsupport);
162  void SetPcoActive (uint8_t pcoactive);
168  void SetPhase (uint8_t pcophase);
169 
175  void SetRxMcsBitmask (uint8_t index);
181  void SetRxHighestSupportedDataRate (uint16_t maxsupportedrate);
187  void SetTxMcsSetDefined (uint8_t txmcssetdefined);
193  void SetTxRxMcsSetUnequal (uint8_t txrxmcssetunequal);
199  void SetTxMaxNSpatialStreams (uint8_t maxtxspatialstreams);
205  void SetTxUnequalModulation (uint8_t txunequalmodulation);
206 
212  uint8_t GetPrimaryChannel (void) const;
218  uint8_t GetInformationSubset1 (void) const;
224  uint16_t GetInformationSubset2 (void) const;
230  uint16_t GetInformationSubset3 (void) const;
236  uint64_t GetBasicMcsSet1 (void) const;
242  uint64_t GetBasicMcsSet2 (void) const;
243 
249  uint8_t GetSecondaryChannelOffset (void) const;
255  uint8_t GetStaChannelWidth (void) const;
261  uint8_t GetRifsMode (void) const;
262 
268  uint8_t GetHtProtection (void) const;
274  uint8_t GetNonGfHtStasPresent (void) const;
280  uint8_t GetObssNonHtStasPresent (void) const;
281 
287  uint8_t GetDualBeacon (void) const;
293  uint8_t GetDualCtsProtection (void) const;
299  uint8_t GetStbcBeacon (void) const;
305  uint8_t GetLSigTxopProtectionFullSupport (void) const;
311  uint8_t GetPcoActive (void) const;
317  uint8_t GetPhase (void) const;
318 
326  bool IsSupportedMcs (uint8_t mcs) const;
332  uint16_t GetRxHighestSupportedDataRate (void) const;
338  uint8_t GetTxMcsSetDefined (void) const;
344  uint8_t GetTxRxMcsSetUnequal (void) const;
350  uint8_t GetTxMaxNSpatialStreams (void) const;
356  uint8_t GetTxUnequalModulation (void) const;
357 
369  uint8_t GetInformationFieldSize () const;
384  uint8_t length);
401  uint16_t GetSerializedSize () const;
402 
403 
404 private:
406 
407  //HT Information Subset 1
410  uint8_t m_rifsMode;
412 
413  //HT Information Subset 2
414  uint8_t m_htProtection;
419 
420  //HT Information Subset 3
422  uint8_t m_dualBeacon;
424  uint8_t m_stbcBeacon;
426  uint8_t m_pcoActive;
427  uint8_t m_pcoPhase;
429 
430  //Basic MCS Set field
438  uint32_t m_reservedMcsSet3;
440 
442  uint8_t m_htSupported;
443 };
444 
445 std::ostream &operator << (std::ostream &os, const HtOperation &htOperation);
446 
447 } //namespace ns3
448 
449 #endif /* HT_OPERATION_H */
void SetRxHighestSupportedDataRate(uint16_t maxsupportedrate)
Set the receive highest supported data rate.
uint8_t GetPcoActive(void) const
Return PCO active.
uint8_t m_reservedInformationSubset3_1
reserved information subset 3-1
Definition: ht-operation.h:421
uint8_t m_reservedInformationSubset1
reserved information subset 1
Definition: ht-operation.h:411
uint16_t GetSerializedSize() const
Return the serialized size of this HT Operation IE.
uint8_t m_txMaxNSpatialStreams
transmit maximum number spatial streams
Definition: ht-operation.h:436
uint8_t GetTxUnequalModulation(void) const
Return transmit unequal modulation.
uint8_t GetSecondaryChannelOffset(void) const
Return the secondary channel offset.
uint8_t GetTxMaxNSpatialStreams(void) const
Return transmit maximum number spatial streams.
uint8_t m_reservedMcsSet2
reserved MCS set2
Definition: ht-operation.h:433
uint8_t m_txUnequalModulation
transmit unequal modulation
Definition: ht-operation.h:437
void SetTxMaxNSpatialStreams(uint8_t maxtxspatialstreams)
Set the transmit maximum number spatial streams.
def start()
Definition: core.py:1858
uint8_t GetLSigTxopProtectionFullSupport(void) const
Return LSIG TXOP protection full support.
uint8_t m_secondaryChannelOffset
secondary channel offset
Definition: ht-operation.h:408
#define MAX_SUPPORTED_MCS
This defines the maximum number of supported MCSs that a STA is allowed to have.
Definition: ht-operation.h:30
void SetSecondaryChannelOffset(uint8_t secondarychanneloffset)
Set the secondary channel offset.
Definition: ht-operation.cc:87
uint8_t m_lSigTxopProtectionFullSupport
LSIG TXOP protection full support.
Definition: ht-operation.h:425
uint8_t GetDualBeacon(void) const
Return dual beacon.
The HT Operation Information ElementThis class knows how to serialise and deserialise the HT Operatio...
Definition: ht-operation.h:52
void SetPhase(uint8_t pcophase)
Set the PCO phase.
uint8_t GetDualCtsProtection(void) const
Return dual CTS protection.
uint8_t m_reservedMcsSet1
reserved MCS set 1
Definition: ht-operation.h:431
uint16_t GetInformationSubset2(void) const
Return the Information Subset 2 field in the HT Operation 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...
void SetHtProtection(uint8_t htprotection)
Set the HT protection.
uint8_t m_txMcsSetDefined
transmit MCS set defined
Definition: ht-operation.h:434
uint8_t m_dualCtsProtection
dual CTS protection
Definition: ht-operation.h:423
uint16_t GetInformationSubset3(void) const
Return the Information Subset 3 field in the HT Operation information element.
uint8_t m_rxMcsBitmask[MAX_SUPPORTED_MCS]
receive MCS bitmask
Definition: ht-operation.h:439
iterator in a Buffer instance
Definition: buffer.h:98
uint8_t m_obssNonHtStasPresent
OBSS NON HT STAs present.
Definition: ht-operation.h:417
void SetStaChannelWidth(uint8_t stachannelwidth)
Set the STA channel width.
Definition: ht-operation.cc:93
uint8_t GetNonGfHtStasPresent(void) const
Return the non GF HT STAs present.
Information element, as defined in 802.11-2007 standardThe IEEE 802.11 standard includes the notion o...
void SetDualBeacon(uint8_t dualbeacon)
Set the dual beacon.
void SetTxUnequalModulation(uint8_t txunequalmodulation)
Set the transmit unequal modulation.
uint8_t GetInformationSubset1(void) const
Return the Information Subset 1 field in the HT Operation information element.
void SetInformationSubset3(uint16_t ctrl)
Set the Information Subset 3 field in the HT Operation information element.
uint8_t m_rifsMode
RIFS mode.
Definition: ht-operation.h:410
uint64_t GetBasicMcsSet1(void) const
Return the first 64 bytes of the Basic MCS Set field in the HT Operation information element...
WifiInformationElementId ElementId() const
Return element ID.
Definition: ht-operation.cc:61
uint8_t GetPhase(void) const
Return phase.
uint16_t m_rxHighestSupportedDataRate
receive highest supported data rate
Definition: ht-operation.h:432
uint8_t GetTxRxMcsSetUnequal(void) const
Return transmit / receive MCS set unequal.
bool IsSupportedMcs(uint8_t mcs) const
Return MCS is supported.
uint8_t GetTxMcsSetDefined(void) const
Return transmit MCS set defined.
void SetRxMcsBitmask(uint8_t index)
Set the receive MCS bitmask.
uint8_t m_pcoActive
PCO active.
Definition: ht-operation.h:426
uint8_t m_nonGfHtStasPresent
non GF HT STAs present
Definition: ht-operation.h:415
uint8_t m_htSupported
This is used to decide whether this element should be added to the frame or not.
Definition: ht-operation.h:442
uint8_t m_htProtection
HT protection.
Definition: ht-operation.h:414
uint16_t GetRxHighestSupportedDataRate(void) const
Return receive highest supported data rate.
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 m_txRxMcsSetUnequal
transmit / receive MCS set unequal
Definition: ht-operation.h:435
uint8_t m_reservedInformationSubset2_1
reserved information subset 2-1
Definition: ht-operation.h:416
void SetTxRxMcsSetUnequal(uint8_t txrxmcssetunequal)
Set the transmit / receive MCS set unequal.
void SetStbcBeacon(uint8_t stbcbeacon)
Set the STBC beacon.
void SetInformationSubset2(uint16_t ctrl)
Set the Information Subset 2 field in the HT Operation information element.
uint8_t GetRifsMode(void) const
Return the RIFS mode.
void SetDualCtsProtection(uint8_t dualctsprotection)
Set the dual CTS protection.
uint8_t DeserializeInformationField(Buffer::Iterator start, uint8_t length)
DeSerialize information field.
uint32_t m_reservedMcsSet3
reserved MCS set 3
Definition: ht-operation.h:438
HtProtectionType
HtProtectionType enumeration.
Definition: ht-operation.h:35
uint8_t m_dualBeacon
dual beacon
Definition: ht-operation.h:422
void SerializeInformationField(Buffer::Iterator start) const
Serialize information field.
uint8_t GetStaChannelWidth(void) const
Return the STA channel width.
void SetPcoActive(uint8_t pcoactive)
Set the PCO active.
uint8_t m_primaryChannel
primary channel
Definition: ht-operation.h:405
void SetNonGfHtStasPresent(uint8_t nongfhtstaspresent)
Set the non GF HT STAs present.
void SetInformationSubset1(uint8_t ctrl)
Set the Information Subset 1 field in the HT Operation information element.
uint8_t GetHtProtection(void) const
Return the HT protection.
uint8_t GetStbcBeacon(void) const
Return STBC beacon.
uint8_t m_reservedInformationSubset2_2
reserved information subset 2-2
Definition: ht-operation.h:418
void SetObssNonHtStasPresent(uint8_t obssnonhtstaspresent)
Set the OBSS non HT STAs present.
uint64_t GetBasicMcsSet2(void) const
Return the last 64 bytes of the Basic MCS Set field in the HT Operation information element...
void SetLSigTxopProtectionFullSupport(uint8_t lsigtxopprotectionfullsupport)
Set the LSIG TXOP protection full support.
uint8_t m_staChannelWidth
STA channel width.
Definition: ht-operation.h:409
void SetRifsMode(uint8_t rifsmode)
Set the RIFS mode.
Definition: ht-operation.cc:99
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
uint8_t m_pcoPhase
PCO phase.
Definition: ht-operation.h:427
uint8_t m_stbcBeacon
STBC beacon.
Definition: ht-operation.h:424
void SetHtSupported(uint8_t htsupported)
Set the HT Supported.
Definition: ht-operation.cc:67
uint8_t GetObssNonHtStasPresent(void) const
Return the OBSS non HT STAs present.
void SetTxMcsSetDefined(uint8_t txmcssetdefined)
Set the transmit MCS set defined.
uint8_t GetPrimaryChannel(void) const
Return the Primary Channel field in the HT Operation information element.
void SetPrimaryChannel(uint8_t ctrl)
Set the Primary Channel field in the HT Operation information element.
Definition: ht-operation.cc:81
uint8_t GetInformationFieldSize() const
Return information field size.
Definition: ht-operation.cc:73
void SetBasicMcsSet(uint64_t ctrl1, uint64_t ctrl2)
Set the Basic MCS Set field in the HT Operation information element.
uint8_t m_reservedInformationSubset3_2
reserved information subset 3-2
Definition: ht-operation.h:428