A Discrete-Event Network Simulator
API
wifi-standards.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007 INRIA
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
18 */
19
20#ifndef WIFI_STANDARD_H
21#define WIFI_STANDARD_H
22
23#include "wifi-phy-band.h"
24
25#include "ns3/abort.h"
26
27#include <list>
28#include <map>
29
30namespace ns3
31{
32
38{
49};
50
58inline std::ostream&
59operator<<(std::ostream& os, WifiStandard standard)
60{
61 switch (standard)
62 {
64 return (os << "802.11a");
66 return (os << "802.11b");
68 return (os << "802.11g");
70 return (os << "802.11p");
72 return (os << "802.11n");
74 return (os << "802.11ac");
76 return (os << "802.11ad");
78 return (os << "802.11ax");
80 return (os << "802.11be");
81 default:
82 return (os << "UNSPECIFIED");
83 }
84}
85
89const std::map<WifiStandard, std::list<WifiPhyBand>> wifiStandards = {
99
105{
110
119{
120 switch (standard)
121 {
126 default:
128 }
129}
130
137inline uint16_t
139{
140 switch (standard)
141 {
143 return 22;
145 return 10;
148 return 20;
150 return 40;
154 return 160;
156 return 2160;
157 default:
158 NS_ABORT_MSG("Unknown standard: " << standard);
159 return 0;
160 }
161}
162
170inline uint16_t
172{
173 switch (standard)
174 {
176 return 22;
178 return 10;
180 return 80;
182 return 2160;
185 return (band == WIFI_PHY_BAND_2_4GHZ ? 20 : 80);
186 default:
187 return 20;
188 }
189}
190
197inline WifiPhyBand
199{
200 switch (standard)
201 {
207 return WIFI_PHY_BAND_5GHZ;
209 return WIFI_PHY_BAND_60GHZ;
210 default:
212 }
213}
214
215} // namespace ns3
216
217#endif /* WIFI_STANDARD_H */
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition: abort.h:49
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
FrequencyChannelType
Enumeration of frequency channel types.
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
@ WIFI_STANDARD_80211a
@ WIFI_STANDARD_80211ad
@ WIFI_STANDARD_80211p
@ WIFI_STANDARD_80211be
@ WIFI_STANDARD_80211n
@ WIFI_STANDARD_80211g
@ WIFI_STANDARD_80211ax
@ WIFI_STANDARD_UNSPECIFIED
@ WIFI_STANDARD_80211ac
@ WIFI_STANDARD_80211b
@ WIFI_PHY_80211p_CHANNEL
@ WIFI_PHY_OFDM_CHANNEL
@ WIFI_PHY_DSSS_CHANNEL
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
Definition: wifi-phy-band.h:39
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
Definition: wifi-phy-band.h:35
@ WIFI_PHY_BAND_60GHZ
The 60 GHz band.
Definition: wifi-phy-band.h:41
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Definition: wifi-phy-band.h:37
Every class exported by the ns3 library is enclosed in the ns3 namespace.
const std::map< WifiStandard, std::list< WifiPhyBand > > wifiStandards
map a given standard configured by the user to the allowed PHY bands
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:129
WifiPhyBand GetDefaultPhyBand(WifiStandard standard)
Get the default PHY band for the given standard.
uint16_t GetDefaultChannelWidth(WifiStandard standard, WifiPhyBand band)
Get the default channel width for the given PHY standard and band.
FrequencyChannelType GetFrequencyChannelType(WifiStandard standard)
Get the type of the frequency channel for the given standard.
uint16_t GetMaximumChannelWidth(WifiStandard standard)
Get the maximum channel width in MHz allowed for the given standard.