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
wifi-mode.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2005,2006,2007 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
#ifndef WIFI_MODE_H
21
#define WIFI_MODE_H
22
23
#include <stdint.h>
24
#include <string>
25
#include <vector>
26
#include <ostream>
27
#include "ns3/attribute-helper.h"
28
#include "ns3/wifi-phy-standard.h"
29
30
namespace
ns3 {
31
36
enum
WifiModulationClass
37
{
40
WIFI_MOD_CLASS_UNKNOWN
= 0,
42
WIFI_MOD_CLASS_IR
,
44
WIFI_MOD_CLASS_FHSS
,
46
WIFI_MOD_CLASS_DSSS
,
48
WIFI_MOD_CLASS_ERP_PBCC
,
50
WIFI_MOD_CLASS_DSSS_OFDM
,
52
WIFI_MOD_CLASS_ERP_OFDM
,
54
WIFI_MOD_CLASS_OFDM
,
56
WIFI_MOD_CLASS_HT
57
};
58
59
67
enum
WifiCodeRate
68
{
70
WIFI_CODE_RATE_UNDEFINED
,
72
WIFI_CODE_RATE_3_4
,
74
WIFI_CODE_RATE_2_3
,
76
WIFI_CODE_RATE_1_2
,
78
WIFI_CODE_RATE_5_6
79
80
};
81
91
class
WifiMode
92
{
93
public
:
97
uint32_t
GetBandwidth
(
void
)
const
;
104
uint64_t
GetPhyRate
(
void
)
const
;
108
uint64_t
GetDataRate
(
void
)
const
;
112
enum
WifiCodeRate
GetCodeRate
(
void
)
const
;
116
uint8_t
GetConstellationSize
(
void
)
const
;
117
122
std::string
GetUniqueName
(
void
)
const
;
123
128
bool
IsMandatory
(
void
)
const
;
129
137
uint32_t
GetUid
(
void
)
const
;
138
144
enum
WifiModulationClass
GetModulationClass
()
const
;
145
152
WifiMode
();
153
WifiMode
(std::string name);
154
private
:
155
friend
class
WifiModeFactory
;
156
WifiMode
(uint32_t uid);
157
uint32_t
m_uid
;
158
};
159
160
bool
operator ==
(
const
WifiMode
&a,
const
WifiMode
&b);
161
std::ostream &
operator <<
(std::ostream & os,
const
WifiMode
&mode);
162
std::istream &
operator >>
(std::istream &is,
WifiMode
&mode);
163
169
ATTRIBUTE_HELPER_HEADER
(
WifiMode
);
170
177
typedef
std::vector<WifiMode>
WifiModeList
;
178
typedef
WifiModeList::const_iterator
WifiModeListIterator
;
179
180
typedef
std::vector<uint8_t>
WifiMcsList
;
181
typedef
WifiMcsList::const_iterator
WifiMcsListIterator
;
182
189
class
WifiModeFactory
190
{
191
public
:
209
static
WifiMode
CreateWifiMode
(std::string uniqueName,
210
enum
WifiModulationClass
modClass,
211
bool
isMandatory,
212
uint32_t bandwidth,
213
uint32_t dataRate,
214
enum
WifiCodeRate
codingRate,
215
uint8_t constellationSize);
216
217
private
:
218
friend
class
WifiMode
;
219
friend
std::istream &
operator >>
(std::istream &is,
WifiMode
&mode);
220
static
WifiModeFactory
*
GetFactory
();
221
WifiModeFactory
();
222
228
struct
WifiModeItem
229
{
230
std::string
uniqueUid
;
231
uint32_t
bandwidth
;
232
uint32_t
dataRate
;
233
uint32_t
phyRate
;
234
enum
WifiModulationClass
modClass
;
235
uint8_t
constellationSize
;
236
enum
WifiCodeRate
codingRate
;
237
bool
isMandatory
;
238
};
239
240
WifiMode
Search
(std::string name);
241
uint32_t
AllocateUid
(std::string uniqueName);
242
WifiModeItem
*
Get
(uint32_t uid);
243
244
typedef
std::vector<struct WifiModeItem>
WifiModeItemList
;
245
WifiModeItemList
m_itemList
;
246
};
247
248
}
// namespace ns3
249
250
#endif
/* WIFI_MODE_H */
src
wifi
model
wifi-mode.h
Generated on Fri Aug 30 2013 01:43:05 for ns-3 by
1.8.1.2