A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
42
class
HtCapabilities
:
public
WifiInformationElement
43
{
44
public
:
45
HtCapabilities
();
46
void
SetLdpc
(uint8_t ldpc);
47
void
SetSupportedChannelWidth
(uint8_t supportedchannelwidth);
48
void
SetGreenfield
(uint8_t greenfield);
49
void
SetShortGuardInterval20
(uint8_t shortguardinterval);
50
void
SetHtCapabilitiesInfo
(uint16_t ctrl);
51
void
SetAmpduParameters
(uint8_t ctrl);
52
void
SetSupportedMcsSet
(uint64_t ctrl1, uint64_t ctrl2);
53
void
SetHtSupported
(uint8_t htsupported);
54
void
SetRxMcsBitmask
(uint8_t index);
55
bool
IsSupportedMcs
(uint8_t mcs);
56
//returns the HT Capabilties info field in the HT Capabilities information element
57
uint16_t
GetHtCapabilitiesInfo
(
void
)
const
;
58
//returns the Ampdu parameters field in the HT Capabilities information element
59
uint8_t
GetAmpduParameters
(
void
)
const
;
60
//returns the first 64bytes of the Supported MCS field in the HT Capabilities information element
61
uint64_t
GetSupportedMcsSet1
(
void
)
const
;
62
//returns the first 64bytes of the Supported MCS field in the HT Capabilities information element
63
uint64_t
GetSupportedMcsSet2
(
void
)
const
;
64
uint8_t
GetLdpc
(
void
)
const
;
65
uint8_t
GetGreenfield
(
void
)
const
;
66
uint8_t
GetShortGuardInterval20
(
void
)
const
;
67
uint8_t
GetSupportedChannelWidth
(
void
)
const
;
//2040 supported or not
68
uint8_t*
GetRxMcsBitmask
();
69
70
WifiInformationElementId
ElementId
()
const
;
71
uint8_t
GetInformationFieldSize
()
const
;
72
void
SerializeInformationField
(
Buffer::Iterator
start
)
const
;
73
uint8_t
DeserializeInformationField
(
Buffer::Iterator
start,
74
uint8_t length);
75
/*
76
* This information element is a bit special in that it is only
77
* included if the STA is an HT STA. To support this we
78
* override the Serialize and GetSerializedSize methods of
79
* WifiInformationElement.
80
*/
81
Buffer::Iterator
Serialize
(
Buffer::Iterator
start)
const
;
82
uint16_t
GetSerializedSize
()
const
;
83
84
private
:
85
uint8_t
m_ldpc
;
86
uint8_t
m_supportedChannelWidth
;
87
uint8_t
m_smPowerSave
;
88
uint8_t
m_greenField
;
89
uint8_t
m_shortGuardInterval20
;
90
uint8_t
m_shortGuardInterval40
;
91
uint8_t
m_txStbc
;
92
uint8_t
m_rxStbc
;
93
uint8_t
m_htDelayedBlockAck
;
94
uint8_t
m_maxAmsduLength
;
95
uint8_t
m_dssMode40
;
96
uint8_t
m_reserved
;
97
uint8_t
m_fortyMhzIntolerant
;
98
uint8_t
m_lsigProtectionSupport
;
99
uint8_t
m_maxAmpduLength
;
100
uint8_t
m_minMpduStartSpace
;
101
uint8_t
m_ampduReserved
;
102
uint8_t
m_reservedMcsSet1
;
103
uint16_t
m_rxHighestSupportedDataRate
;
104
uint8_t
m_reservedMcsSet2
;
105
uint8_t
m_txMcsSetDefined
;
106
uint8_t
m_txRxMcsSetUnequal
;
107
uint8_t
m_txMaxNSpatialStreams
;
108
uint8_t
m_txUnequalModulation
;
109
uint32_t
m_reservedMcsSet3
;
110
uint8_t
m_rxMcsBitmask
[
MAX_SUPPORTED_MCS
];
111
//this is used to decide if this element should be added to the frame or not
112
uint8_t
m_htSupported
;
113
};
114
115
std::ostream &
operator <<
(std::ostream &os,
const
HtCapabilities
&htcapabilities);
116
std::istream &
operator >>
(std::istream &is,
HtCapabilities
&htcapabilities);
117
118
ATTRIBUTE_HELPER_HEADER
(
HtCapabilities
)
119
120
}
// namespace ns3
121
122
#endif
/* HT_CAPABILITY_H */
src
wifi
model
ht-capabilities.h
Generated on Fri Aug 30 2013 01:43:04 for ns-3 by
1.8.1.2