wifi: Rename wifi-preamble.h as wifi-phy-common.h
Holds all enums which might be updated upon the addition of a new PHY standard (as suggested by Sebastien) Also cleaned up obsolete modulation classes
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
#include <vector>
|
||||
#include "ns3/object.h"
|
||||
#include "ns3/wifi-mode.h"
|
||||
#include "ns3/wifi-preamble.h"
|
||||
#include "ns3/wifi-phy-common.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "ns3/simulator.h"
|
||||
#include "ns3/config.h"
|
||||
#include "ns3/wifi-mode.h"
|
||||
#include "ns3/wifi-preamble.h"
|
||||
#include "ns3/wifi-phy-common.h"
|
||||
#include "ns3/wifi-phy-state.h"
|
||||
#include "ns3/net-device-container.h"
|
||||
#include "ns3/node-container.h"
|
||||
|
||||
@@ -22,8 +22,9 @@
|
||||
#ifndef WIFI_MODE_H
|
||||
#define WIFI_MODE_H
|
||||
|
||||
#include <vector>
|
||||
#include "wifi-phy-common.h"
|
||||
#include "ns3/attribute-helper.h"
|
||||
#include <vector>
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -31,39 +32,6 @@ namespace ns3 {
|
||||
|
||||
class WifiTxVector;
|
||||
|
||||
/**
|
||||
* This enumeration defines the modulation classes per
|
||||
* (Table 9-4 "Modulation classes"; IEEE 802.11-2012).
|
||||
*/
|
||||
enum WifiModulationClass
|
||||
{
|
||||
/** Modulation class unknown or unspecified. A WifiMode with this
|
||||
WifiModulationClass has not been properly initialised. */
|
||||
WIFI_MOD_CLASS_UNKNOWN = 0,
|
||||
/** Infrared (IR) (Clause 16) */
|
||||
WIFI_MOD_CLASS_IR,
|
||||
/** Frequency-hopping spread spectrum (FHSS) PHY (Clause 14) */
|
||||
WIFI_MOD_CLASS_FHSS,
|
||||
/** DSSS PHY (Clause 15) */
|
||||
WIFI_MOD_CLASS_DSSS,
|
||||
/** HR/DSSS PHY (Clause 18) */
|
||||
WIFI_MOD_CLASS_HR_DSSS,
|
||||
/** ERP-PBCC PHY (19.6) */
|
||||
WIFI_MOD_CLASS_ERP_PBCC,
|
||||
/** DSSS-OFDM PHY (19.7) */
|
||||
WIFI_MOD_CLASS_DSSS_OFDM,
|
||||
/** ERP-OFDM PHY (19.5) */
|
||||
WIFI_MOD_CLASS_ERP_OFDM,
|
||||
/** OFDM PHY (Clause 17) */
|
||||
WIFI_MOD_CLASS_OFDM,
|
||||
/** HT PHY (Clause 20) */
|
||||
WIFI_MOD_CLASS_HT,
|
||||
/** VHT PHY (Clause 22) */
|
||||
WIFI_MOD_CLASS_VHT,
|
||||
/** HE PHY (Clause 26) */
|
||||
WIFI_MOD_CLASS_HE
|
||||
};
|
||||
|
||||
/**
|
||||
* This enumeration defines the various convolutional coding rates
|
||||
* used for the OFDM transmission modes in the IEEE 802.11
|
||||
|
||||
144
src/wifi/model/wifi-phy-common.h
Normal file
144
src/wifi/model/wifi-phy-common.h
Normal file
@@ -0,0 +1,144 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2005,2006,2007 INRIA
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
|
||||
*/
|
||||
|
||||
#ifndef WIFI_PHY_COMMON_H
|
||||
#define WIFI_PHY_COMMON_H
|
||||
|
||||
#include "ns3/fatal-error.h"
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \ingroup wifi
|
||||
* Declaration of the following enums:
|
||||
* - ns3::WifiPreamble
|
||||
* - ns3::WifiModulationClass
|
||||
*/
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup wifi
|
||||
* The type of preamble to be used by an IEEE 802.11 transmission
|
||||
*/
|
||||
enum WifiPreamble
|
||||
{
|
||||
WIFI_PREAMBLE_LONG,
|
||||
WIFI_PREAMBLE_SHORT,
|
||||
WIFI_PREAMBLE_HT_MF,
|
||||
WIFI_PREAMBLE_HT_GF,
|
||||
WIFI_PREAMBLE_VHT_SU,
|
||||
WIFI_PREAMBLE_VHT_MU,
|
||||
WIFI_PREAMBLE_HE_SU,
|
||||
WIFI_PREAMBLE_HE_ER_SU,
|
||||
WIFI_PREAMBLE_HE_MU,
|
||||
WIFI_PREAMBLE_HE_TB
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Stream insertion operator.
|
||||
*
|
||||
* \param os the stream
|
||||
* \param preamble the preamble
|
||||
* \returns a reference to the stream
|
||||
*/
|
||||
inline std::ostream& operator<< (std::ostream &os, const WifiPreamble &preamble)
|
||||
{
|
||||
switch (preamble)
|
||||
{
|
||||
case WIFI_PREAMBLE_LONG:
|
||||
return (os << "LONG");
|
||||
case WIFI_PREAMBLE_SHORT:
|
||||
return (os << "SHORT");
|
||||
case WIFI_PREAMBLE_HT_MF:
|
||||
return (os << "HT_MF");
|
||||
case WIFI_PREAMBLE_HT_GF:
|
||||
return (os << "HT_GF");
|
||||
case WIFI_PREAMBLE_VHT_SU:
|
||||
return (os << "VHT_SU");
|
||||
case WIFI_PREAMBLE_VHT_MU:
|
||||
return (os << "VHT_MU");
|
||||
case WIFI_PREAMBLE_HE_SU:
|
||||
return (os << "HE_SU");
|
||||
case WIFI_PREAMBLE_HE_ER_SU:
|
||||
return (os << "HE_ER_SU");
|
||||
case WIFI_PREAMBLE_HE_MU:
|
||||
return (os << "HE_MU");
|
||||
case WIFI_PREAMBLE_HE_TB:
|
||||
return (os << "HE_TB");
|
||||
default:
|
||||
NS_FATAL_ERROR ("Invalid preamble");
|
||||
return (os << "INVALID");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \ingroup wifi
|
||||
* This enumeration defines the modulation classes per
|
||||
* (Table 10-6 "Modulation classes"; IEEE 802.11-2016, with
|
||||
* updated in 802.11ax/D6.0 as Table 10-9).
|
||||
*/
|
||||
enum WifiModulationClass
|
||||
{
|
||||
/** Modulation class unknown or unspecified. A WifiMode with this
|
||||
WifiModulationClass has not been properly initialized. */
|
||||
WIFI_MOD_CLASS_UNKNOWN = 0,
|
||||
WIFI_MOD_CLASS_DSSS, //!< DSSS (Clause 15)
|
||||
WIFI_MOD_CLASS_HR_DSSS, //!< HR/DSSS (Clause 16)
|
||||
WIFI_MOD_CLASS_ERP_OFDM, //:< ERP-OFDM (18.4)
|
||||
WIFI_MOD_CLASS_OFDM, //!< OFDM (Clause 17)
|
||||
WIFI_MOD_CLASS_HT, //!< HT (Clause 19)
|
||||
WIFI_MOD_CLASS_VHT, //!< VHT (Clause 21)
|
||||
WIFI_MOD_CLASS_HE //!< HE (Clause 27)
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Stream insertion operator.
|
||||
*
|
||||
* \param os the stream
|
||||
* \param modulation the WifiModulationClass
|
||||
* \returns a reference to the stream
|
||||
*/
|
||||
inline std::ostream& operator<< (std::ostream &os, const WifiModulationClass &modulation)
|
||||
{
|
||||
switch (modulation)
|
||||
{
|
||||
case WIFI_MOD_CLASS_DSSS:
|
||||
return (os << "DSSS");
|
||||
case WIFI_MOD_CLASS_HR_DSSS:
|
||||
return (os << "HR/DSSS");
|
||||
case WIFI_MOD_CLASS_ERP_OFDM:
|
||||
return (os << "ERP-OFDM");
|
||||
case WIFI_MOD_CLASS_OFDM:
|
||||
return (os << "OFDM");
|
||||
case WIFI_MOD_CLASS_HT:
|
||||
return (os << "HT");
|
||||
case WIFI_MOD_CLASS_VHT:
|
||||
return (os << "VHT");
|
||||
case WIFI_MOD_CLASS_HE:
|
||||
return (os << "HE");
|
||||
default:
|
||||
NS_FATAL_ERROR ("Unknown modulation");
|
||||
return (os << "unknown");
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace ns3
|
||||
|
||||
#endif /* WIFI_PHY_COMMON_H */
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "ns3/traced-callback.h"
|
||||
#include "ns3/nstime.h"
|
||||
#include "wifi-phy-state.h"
|
||||
#include "wifi-preamble.h"
|
||||
#include "wifi-phy-common.h"
|
||||
#include "wifi-ppdu.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#define WIFI_PHY_TAG_H
|
||||
|
||||
#include "ns3/tag.h"
|
||||
#include "wifi-preamble.h"
|
||||
#include "wifi-phy-common.h"
|
||||
#include "wifi-mode.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2005,2006,2007 INRIA
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation;
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
|
||||
*/
|
||||
|
||||
#ifndef WIFI_PREAMBLE_H
|
||||
#define WIFI_PREAMBLE_H
|
||||
|
||||
#include "ns3/fatal-error.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
/**
|
||||
* \ingroup wifi
|
||||
* The type of preamble to be used by an IEEE 802.11 transmission
|
||||
*/
|
||||
enum WifiPreamble
|
||||
{
|
||||
WIFI_PREAMBLE_LONG,
|
||||
WIFI_PREAMBLE_SHORT,
|
||||
WIFI_PREAMBLE_HT_MF,
|
||||
WIFI_PREAMBLE_HT_GF,
|
||||
WIFI_PREAMBLE_VHT_SU,
|
||||
WIFI_PREAMBLE_VHT_MU,
|
||||
WIFI_PREAMBLE_HE_SU,
|
||||
WIFI_PREAMBLE_HE_ER_SU,
|
||||
WIFI_PREAMBLE_HE_MU,
|
||||
WIFI_PREAMBLE_HE_TB
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Stream insertion operator.
|
||||
*
|
||||
* \param os the stream
|
||||
* \param preamble the preamble
|
||||
* \returns a reference to the stream
|
||||
*/
|
||||
inline std::ostream& operator<< (std::ostream& os, WifiPreamble preamble)
|
||||
{
|
||||
switch (preamble)
|
||||
{
|
||||
case WIFI_PREAMBLE_LONG:
|
||||
return (os << "LONG");
|
||||
case WIFI_PREAMBLE_SHORT:
|
||||
return (os << "SHORT");
|
||||
case WIFI_PREAMBLE_HT_MF:
|
||||
return (os << "HT_MF");
|
||||
case WIFI_PREAMBLE_HT_GF:
|
||||
return (os << "HT_GF");
|
||||
case WIFI_PREAMBLE_VHT_SU:
|
||||
return (os << "VHT_SU");
|
||||
case WIFI_PREAMBLE_VHT_MU:
|
||||
return (os << "VHT_MU");
|
||||
case WIFI_PREAMBLE_HE_SU:
|
||||
return (os << "HE_SU");
|
||||
case WIFI_PREAMBLE_HE_ER_SU:
|
||||
return (os << "HE_ER_SU");
|
||||
case WIFI_PREAMBLE_HE_MU:
|
||||
return (os << "HE_MU");
|
||||
case WIFI_PREAMBLE_HE_TB:
|
||||
return (os << "HE_TB");
|
||||
default:
|
||||
NS_FATAL_ERROR ("Invalid preamble");
|
||||
return (os << "INVALID");
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace ns3
|
||||
|
||||
#endif /* WIFI_PREAMBLE_H */
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <list>
|
||||
#include "wifi-mode.h"
|
||||
#include "wifi-preamble.h"
|
||||
#include "wifi-phy-common.h"
|
||||
#include "he-ru.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#define WIFI_UTILS_H
|
||||
|
||||
#include "block-ack-type.h"
|
||||
#include "wifi-preamble.h"
|
||||
#include "wifi-phy-common.h"
|
||||
#include "wifi-mode.h"
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -154,7 +154,7 @@ def build(bld):
|
||||
'model/wifi-net-device.h',
|
||||
'model/wifi-mode.h',
|
||||
'model/ssid.h',
|
||||
'model/wifi-preamble.h',
|
||||
'model/wifi-phy-common.h',
|
||||
'model/wifi-phy-band.h',
|
||||
'model/wifi-standards.h',
|
||||
'model/yans-wifi-phy.h',
|
||||
|
||||
Reference in New Issue
Block a user