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
77
};
78
88
class
WifiMode
89
{
90
public
:
94
uint32_t
GetBandwidth
(
void
)
const
;
101
uint64_t
GetPhyRate
(
void
)
const
;
105
uint64_t
GetDataRate
(
void
)
const
;
109
enum
WifiCodeRate
GetCodeRate
(
void
)
const
;
113
uint8_t
GetConstellationSize
(
void
)
const
;
114
119
std::string
GetUniqueName
(
void
)
const
;
120
125
bool
IsMandatory
(
void
)
const
;
126
134
uint32_t
GetUid
(
void
)
const
;
135
141
enum
WifiModulationClass
GetModulationClass
()
const
;
142
149
WifiMode
();
150
WifiMode
(std::string name);
151
private
:
152
friend
class
WifiModeFactory
;
153
WifiMode
(uint32_t uid);
154
uint32_t
m_uid
;
155
};
156
157
bool
operator ==
(
const
WifiMode
&a,
const
WifiMode
&b);
158
std::ostream &
operator <<
(std::ostream & os,
const
WifiMode
&mode);
159
std::istream &
operator >>
(std::istream &is,
WifiMode
&mode);
160
166
ATTRIBUTE_HELPER_HEADER
(
WifiMode
);
167
174
typedef
std::vector<WifiMode>
WifiModeList
;
175
typedef
WifiModeList::const_iterator
WifiModeListIterator
;
176
183
class
WifiModeFactory
184
{
185
public
:
203
static
WifiMode
CreateWifiMode
(std::string uniqueName,
204
enum
WifiModulationClass
modClass,
205
bool
isMandatory,
206
uint32_t bandwidth,
207
uint32_t dataRate,
208
enum
WifiCodeRate
codingRate,
209
uint8_t constellationSize);
210
211
private
:
212
friend
class
WifiMode
;
213
friend
std::istream &
operator >>
(std::istream &is,
WifiMode
&mode);
214
static
WifiModeFactory
*
GetFactory
();
215
WifiModeFactory
();
216
222
struct
WifiModeItem
223
{
224
std::string
uniqueUid
;
225
uint32_t
bandwidth
;
226
uint32_t
dataRate
;
227
uint32_t
phyRate
;
228
enum
WifiModulationClass
modClass
;
229
uint8_t
constellationSize
;
230
enum
WifiCodeRate
codingRate
;
231
bool
isMandatory
;
232
};
233
234
WifiMode
Search
(std::string name);
235
uint32_t
AllocateUid
(std::string uniqueName);
236
WifiModeItem
*
Get
(uint32_t uid);
237
238
typedef
std::vector<struct WifiModeItem>
WifiModeItemList
;
239
WifiModeItemList
m_itemList
;
240
};
241
242
}
// namespace ns3
243
244
#endif
/* WIFI_MODE_H */
src
wifi
model
wifi-mode.h
Generated on Tue May 14 2013 11:08:36 for ns-3 by
1.8.1.2