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
24#include "ns3/wifi-information-element.h"
25
30#define MAX_SUPPORTED_MCS (77)
31
32namespace ns3 {
33
36{
41};
42
51{
52public:
53 HtOperation ();
54
55 // Implementations of pure virtual methods of WifiInformationElement
56 WifiInformationElementId ElementId () const override;
57 uint8_t GetInformationFieldSize () const override;
60 uint8_t length) override;
61 /* This information element is a bit special in that it is only
62 included if the STA is an HT STA. To support this we
63 override the Serialize and GetSerializedSize methods of
64 WifiInformationElement. */
66 uint16_t GetSerializedSize () const override;
67
73 void SetHtSupported (uint8_t htSupported);
74
80 void SetPrimaryChannel (uint8_t ctrl);
86 void SetInformationSubset1 (uint8_t ctrl);
92 void SetInformationSubset2 (uint16_t ctrl);
98 void SetInformationSubset3 (uint16_t ctrl);
105 void SetBasicMcsSet (uint64_t ctrl1, uint64_t ctrl2);
106
112 void SetSecondaryChannelOffset (uint8_t secondaryChannelOffset);
118 void SetStaChannelWidth (uint8_t staChannelWidth);
124 void SetRifsMode (uint8_t rifsMode);
125
131 void SetHtProtection (uint8_t htProtection);
137 void SetNonGfHtStasPresent (uint8_t nonGfHtStasPresent);
143 void SetObssNonHtStasPresent (uint8_t obssNonHtStasPresent);
144
150 void SetDualBeacon (uint8_t dualBeacon);
156 void SetDualCtsProtection (uint8_t dualCtsProtection);
162 void SetStbcBeacon (uint8_t stbcBeacon);
168 void SetLSigTxopProtectionFullSupport (uint8_t lSigTxopProtectionFullSupport);
174 void SetPcoActive (uint8_t pcoActive);
180 void SetPhase (uint8_t pcoPhase);
181
187 void SetRxMcsBitmask (uint8_t index);
193 void SetRxHighestSupportedDataRate (uint16_t maxSupportedRate);
199 void SetTxMcsSetDefined (uint8_t txMcsSetDefined);
205 void SetTxRxMcsSetUnequal (uint8_t txRxMcsSetUnequal);
211 void SetTxMaxNSpatialStreams (uint8_t maxTxSpatialStreams);
217 void SetTxUnequalModulation (uint8_t txUnequalModulation);
218
224 uint8_t GetPrimaryChannel (void) const;
230 uint8_t GetInformationSubset1 (void) const;
236 uint16_t GetInformationSubset2 (void) const;
242 uint16_t GetInformationSubset3 (void) const;
248 uint64_t GetBasicMcsSet1 (void) const;
254 uint64_t GetBasicMcsSet2 (void) const;
255
261 uint8_t GetSecondaryChannelOffset (void) const;
267 uint8_t GetStaChannelWidth (void) const;
273 uint8_t GetRifsMode (void) const;
274
280 uint8_t GetHtProtection (void) const;
286 uint8_t GetNonGfHtStasPresent (void) const;
292 uint8_t GetObssNonHtStasPresent (void) const;
293
299 uint8_t GetDualBeacon (void) const;
305 uint8_t GetDualCtsProtection (void) const;
311 uint8_t GetStbcBeacon (void) const;
317 uint8_t GetLSigTxopProtectionFullSupport (void) const;
323 uint8_t GetPcoActive (void) const;
329 uint8_t GetPhase (void) const;
330
338 bool IsSupportedMcs (uint8_t mcs) const;
344 uint16_t GetRxHighestSupportedDataRate (void) const;
350 uint8_t GetTxMcsSetDefined (void) const;
356 uint8_t GetTxRxMcsSetUnequal (void) const;
362 uint8_t GetTxMaxNSpatialStreams (void) const;
368 uint8_t GetTxUnequalModulation (void) const;
369
370
371private:
373
374 //HT Information Subset 1
377 uint8_t m_rifsMode;
379
380 //HT Information Subset 2
386
387 //HT Information Subset 3
389 uint8_t m_dualBeacon;
391 uint8_t m_stbcBeacon;
393 uint8_t m_pcoActive;
394 uint8_t m_pcoPhase;
396
397 //Basic MCS Set field
407
410};
411
420std::ostream &operator << (std::ostream &os, const HtOperation &htOperation);
421
422} //namespace ns3
423
424#endif /* HT_OPERATION_H */
iterator in a Buffer instance
Definition: buffer.h:99
The HT Operation Information Element.
Definition: ht-operation.h:51
void SetObssNonHtStasPresent(uint8_t obssNonHtStasPresent)
Set the OBSS non HT STAs present.
uint8_t m_reservedInformationSubset1
reserved information subset 1
Definition: ht-operation.h:378
Buffer::Iterator Serialize(Buffer::Iterator start) const override
Serialize entire IE including Element ID and length fields.
void SetRifsMode(uint8_t rifsMode)
Set the RIFS mode.
Definition: ht-operation.cc:99
uint8_t m_obssNonHtStasPresent
OBSS NON HT STAs present.
Definition: ht-operation.h:384
void SetBasicMcsSet(uint64_t ctrl1, uint64_t ctrl2)
Set the Basic MCS Set field in the HT Operation information element.
void SetSecondaryChannelOffset(uint8_t secondaryChannelOffset)
Set the secondary channel offset.
Definition: ht-operation.cc:87
uint8_t m_htSupported
This is used to decide whether this element should be added to the frame or not.
Definition: ht-operation.h:409
uint8_t m_reservedInformationSubset3_1
reserved information subset 3-1
Definition: ht-operation.h:388
uint8_t m_stbcBeacon
STBC beacon.
Definition: ht-operation.h:391
uint64_t GetBasicMcsSet1(void) const
Return the first 64 bytes of the Basic MCS Set field in the HT Operation information element.
uint16_t GetSerializedSize() const override
Get the size of the serialized IE including Element ID and length fields.
void SetInformationSubset2(uint16_t ctrl)
Set the Information Subset 2 field in the HT Operation information element.
uint8_t GetTxMaxNSpatialStreams(void) const
Return transmit maximum number spatial streams.
uint8_t m_reservedInformationSubset3_2
reserved information subset 3-2
Definition: ht-operation.h:395
void SetPcoActive(uint8_t pcoActive)
Set the PCO active.
void SetTxUnequalModulation(uint8_t txUnequalModulation)
Set the transmit unequal modulation.
uint8_t m_rifsMode
RIFS mode.
Definition: ht-operation.h:377
uint8_t m_secondaryChannelOffset
secondary channel offset
Definition: ht-operation.h:375
uint8_t m_rxMcsBitmask[MAX_SUPPORTED_MCS]
receive MCS bitmask
Definition: ht-operation.h:406
uint16_t m_rxHighestSupportedDataRate
receive highest supported data rate
Definition: ht-operation.h:399
void SetInformationSubset3(uint16_t ctrl)
Set the Information Subset 3 field in the HT Operation information element.
uint64_t GetBasicMcsSet2(void) const
Return the last 64 bytes of the Basic MCS Set field in the HT Operation information element.
uint8_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
Definition: ht-operation.cc:73
void SetHtProtection(uint8_t htProtection)
Set the HT protection.
uint8_t DeserializeInformationField(Buffer::Iterator start, uint8_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint8_t GetLSigTxopProtectionFullSupport(void) const
Return LSIG TXOP protection full support.
uint8_t GetTxRxMcsSetUnequal(void) const
Return transmit / receive MCS set unequal.
uint8_t m_staChannelWidth
STA channel width.
Definition: ht-operation.h:376
uint8_t GetNonGfHtStasPresent(void) const
Return the non GF HT STAs present.
uint8_t GetStbcBeacon(void) const
Return STBC beacon.
void SetTxMaxNSpatialStreams(uint8_t maxTxSpatialStreams)
Set the transmit maximum number spatial streams.
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint8_t m_txUnequalModulation
transmit unequal modulation
Definition: ht-operation.h:404
uint8_t GetPhase(void) const
Return phase.
void SetTxRxMcsSetUnequal(uint8_t txRxMcsSetUnequal)
Set the transmit / receive MCS set unequal.
uint8_t m_reservedMcsSet1
reserved MCS set 1
Definition: ht-operation.h:398
uint8_t GetDualBeacon(void) const
Return dual beacon.
uint8_t m_txMaxNSpatialStreams
transmit maximum number spatial streams
Definition: ht-operation.h:403
WifiInformationElementId ElementId() const override
Definition: ht-operation.cc:61
uint16_t GetInformationSubset3(void) const
Return the Information Subset 3 field in the HT Operation information element.
uint8_t m_reservedInformationSubset2_1
reserved information subset 2-1
Definition: ht-operation.h:383
uint8_t GetTxUnequalModulation(void) const
Return transmit unequal modulation.
void SetDualBeacon(uint8_t dualBeacon)
Set the dual beacon.
uint8_t GetDualCtsProtection(void) const
Return dual CTS protection.
uint8_t m_dualBeacon
dual beacon
Definition: ht-operation.h:389
uint8_t m_txMcsSetDefined
transmit MCS set defined
Definition: ht-operation.h:401
void SetNonGfHtStasPresent(uint8_t nonGfHtStasPresent)
Set the non GF HT STAs present.
uint8_t GetSecondaryChannelOffset(void) const
Return the secondary channel offset.
uint8_t m_dualCtsProtection
dual CTS protection
Definition: ht-operation.h:390
uint8_t m_lSigTxopProtectionFullSupport
L-SIG TXOP protection full support.
Definition: ht-operation.h:392
uint8_t GetPcoActive(void) const
Return PCO active.
uint8_t GetTxMcsSetDefined(void) const
Return transmit MCS set defined.
void SetTxMcsSetDefined(uint8_t txMcsSetDefined)
Set the transmit MCS set defined.
uint8_t m_reservedInformationSubset2_2
reserved information subset 2-2
Definition: ht-operation.h:385
uint8_t GetStaChannelWidth(void) const
Return the STA channel width.
uint8_t m_reservedMcsSet2
reserved MCS set2
Definition: ht-operation.h:400
uint8_t GetObssNonHtStasPresent(void) const
Return the OBSS non HT STAs present.
void SetLSigTxopProtectionFullSupport(uint8_t lSigTxopProtectionFullSupport)
Set the LSIG TXOP protection full support.
void SetStaChannelWidth(uint8_t staChannelWidth)
Set the STA channel width.
Definition: ht-operation.cc:93
uint8_t GetRifsMode(void) const
Return the RIFS mode.
void SetInformationSubset1(uint8_t ctrl)
Set the Information Subset 1 field in the HT Operation information element.
void SetRxHighestSupportedDataRate(uint16_t maxSupportedRate)
Set the receive highest supported data rate.
uint8_t m_pcoActive
PCO active.
Definition: ht-operation.h:393
uint8_t GetPrimaryChannel(void) const
Return the Primary Channel field in the HT Operation information element.
uint8_t GetHtProtection(void) const
Return the HT protection.
void SetRxMcsBitmask(uint8_t index)
Set the receive MCS bitmask.
uint16_t GetRxHighestSupportedDataRate(void) const
Return receive highest supported data rate.
uint32_t m_reservedMcsSet3
reserved MCS set 3
Definition: ht-operation.h:405
uint8_t GetInformationSubset1(void) const
Return the Information Subset 1 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
void SetDualCtsProtection(uint8_t dualCtsProtection)
Set the dual CTS protection.
uint16_t GetInformationSubset2(void) const
Return the Information Subset 2 field in the HT Operation information element.
uint8_t m_htProtection
HT protection.
Definition: ht-operation.h:381
void SetPhase(uint8_t pcoPhase)
Set the PCO phase.
bool IsSupportedMcs(uint8_t mcs) const
Return MCS is supported.
uint8_t m_txRxMcsSetUnequal
transmit / receive MCS set unequal
Definition: ht-operation.h:402
void SetHtSupported(uint8_t htSupported)
Set the HT Supported.
Definition: ht-operation.cc:67
uint8_t m_pcoPhase
PCO phase.
Definition: ht-operation.h:394
uint8_t m_primaryChannel
primary channel
Definition: ht-operation.h:372
void SetStbcBeacon(uint8_t stbcBeacon)
Set the STBC beacon.
uint8_t m_nonGfHtStasPresent
non GF HT STAs present
Definition: ht-operation.h:382
Information element, as defined in 802.11-2007 standard.
#define MAX_SUPPORTED_MCS
This defines the maximum number of supported MCSs that a STA is allowed to have.
Definition: ht-operation.h:30
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:139
HtProtectionType
HtProtectionType enumeration.
Definition: ht-operation.h:36
@ NON_MEMBER_PROTECTION
Definition: ht-operation.h:38
@ NO_PROTECTION
Definition: ht-operation.h:37
@ TWENTY_MHZ_PROTECTION
Definition: ht-operation.h:39
@ MIXED_MODE_PROTECTION
Definition: ht-operation.h:40
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
def start()
Definition: core.py:1853