A Discrete-Event Network Simulator
API
wifi-standards.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 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
21#ifndef WIFI_STANDARD_H
22#define WIFI_STANDARD_H
23
24#include <map>
25#include <list>
26#include "wifi-phy-band.h"
27#include "ns3/abort.h"
28
29namespace ns3 {
30
36{
46};
47
55inline std::ostream& operator<< (std::ostream& os, WifiStandard standard)
56{
57 switch (standard)
58 {
60 return (os << "802.11a");
62 return (os << "802.11b");
64 return (os << "802.11g");
66 return (os << "802.11p");
68 return (os << "802.11n");
70 return (os << "802.11ac");
72 return (os << "802.11ax");
74 return (os << "802.11be");
75 default:
76 return (os << "UNSPECIFIED");
77 }
78}
79
80
84const std::map<WifiStandard, std::list<WifiPhyBand>> wifiStandards =
85{
94};
95
101{
106
114{
115 switch (standard)
116 {
121 default:
123 }
124}
125
132inline uint16_t GetMaximumChannelWidth (WifiStandard standard)
133{
134 switch (standard)
135 {
137 return 22;
139 return 10;
142 return 20;
144 return 40;
148 return 160;
149 default:
150 NS_ABORT_MSG ("Unknown standard: " << standard);
151 return 0;
152 }
153}
154
162inline uint16_t GetDefaultChannelWidth (WifiStandard standard, WifiPhyBand band)
163{
164 switch (standard)
165 {
167 return 22;
169 return 10;
171 return 80;
174 return (band == WIFI_PHY_BAND_2_4GHZ ? 20 : 80);
175 default:
176 return 20;
177 }
178}
179
187{
188 switch (standard)
189 {
195 return WIFI_PHY_BAND_5GHZ;
196 default:
198 }
199}
200
201} //namespace ns3
202
203#endif /* WIFI_STANDARD_H */
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition: abort.h:50
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_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_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:139
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.