/usr/include/ns3.26/ns3/uan-phy-dual.h is in libns3-dev 3.26+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2009 University of Washington
*
* 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: Leonard Tracy <lentracy@gmail.com>
* Andrea Sacco <andrea.sacco85@gmail.com>
*/
#ifndef UAN_PHY_DUAL_H
#define UAN_PHY_DUAL_H
#include "ns3/uan-phy.h"
namespace ns3 {
class UanTxMode;
class UanModesList;
/**
* Default SINR model for UanPhyDual
*
* Considers interfering packet power as additional ambient noise only
* if there is overlap in frequency band as found from supplied UanTxMode.
* If there is no overlap, then the packets are considered not to interfere.
*/
class UanPhyCalcSinrDual : public UanPhyCalcSinr
{
public:
/** Constructor */
UanPhyCalcSinrDual ();
/** Destructor */
virtual ~UanPhyCalcSinrDual ();
/**
* Register this type.
* \return The TypeId.
*/
static TypeId GetTypeId (void);
virtual double CalcSinrDb (Ptr<Packet> pkt,
Time arrTime,
double rxPowerDb,
double ambNoiseDb,
UanTxMode mode,
UanPdp pdp,
const UanTransducer::ArrivalList &arrivalList
) const;
}; // class UanPhyCalcSinrDual
/**
* \ingroup uan
*
* Two channel Phy.
*
* A class that wraps two generic UAN Phy layers (UanPhyGen) into a single PHY.
* This is used to simulate two receivers (and transmitters) that use
* the same front end hardware. When attached to a UanTransducerHd,
* this results in a net device able to transmit on one or two channels
* simultaneously or receive on one or two channels simultaneously but
* that cannot transmit and receive simultaneously.
*
* Many of the standard PHY functions here become ambiguous. In most cases
* information for "Phy1" are returned.
*/
class UanPhyDual : public UanPhy
{
public:
/** Constructor */
UanPhyDual ();
/** Dummy destructor \see DoDispose */
virtual ~UanPhyDual ();
/**
* Register this type.
* \return The TypeId.
*/
static TypeId GetTypeId ();
// Inherited methods:
virtual void SetEnergyModelCallback (DeviceEnergyModel::ChangeStateCallback callback);
virtual void EnergyDepletionHandler (void);
virtual void EnergyRechargeHandler (void);
virtual void SendPacket (Ptr<Packet> pkt, uint32_t modeNum);
/**
* Register a UanPhyListener to be notified of common UanPhy events.
*
* \param listener New listener to register.
*
* \note You may receive duplicate
* messages as underneath there are two generic phys here.
* Each will notify of state changes independently.
*/
virtual void RegisterListener (UanPhyListener *listener);
virtual void StartRxPacket (Ptr<Packet> pkt, double rxPowerDb, UanTxMode txMode, UanPdp pdp);
virtual void SetReceiveOkCallback (RxOkCallback cb);
virtual void SetReceiveErrorCallback (RxErrCallback cb);
virtual void SetRxGainDb (double gain);
virtual void SetTxPowerDb (double txpwr);
NS_DEPRECATED virtual void SetRxThresholdDb (double thresh);
virtual void SetCcaThresholdDb (double thresh);
virtual double GetRxGainDb (void);
virtual double GetTxPowerDb (void);
virtual double GetRxThresholdDb (void);
virtual double GetCcaThresholdDb (void);
virtual bool IsStateSleep (void);
virtual bool IsStateIdle (void);
virtual bool IsStateBusy (void);
virtual bool IsStateRx (void);
virtual bool IsStateTx (void);
virtual bool IsStateCcaBusy (void);
virtual Ptr<UanChannel> GetChannel (void) const;
virtual Ptr<UanNetDevice> GetDevice (void) const;
virtual void SetChannel (Ptr<UanChannel> channel);
virtual void SetDevice (Ptr<UanNetDevice> device);
virtual void SetMac (Ptr<UanMac> mac);
virtual void NotifyTransStartTx (Ptr<Packet> packet, double txPowerDb, UanTxMode txMode);
virtual void NotifyIntChange (void);
virtual void SetTransducer (Ptr<UanTransducer> trans);
virtual Ptr<UanTransducer> GetTransducer (void);
virtual uint32_t GetNModes (void);
virtual UanTxMode GetMode (uint32_t n);
virtual void Clear (void);
virtual void SetSleepMode (bool sleep)
{
/// \todo This method has to be implemented
}
int64_t AssignStreams (int64_t stream);
Ptr<Packet> GetPacketRx (void) const;
/** \copydoc UanPhy::IsStateIdle */
bool IsPhy1Idle (void);
/** \copydoc UanPhy::IsStateIdle */
bool IsPhy2Idle (void);
/** \copydoc UanPhy::IsStateRx */
bool IsPhy1Rx (void);
/** \copydoc UanPhy::IsStateRx */
bool IsPhy2Rx (void);
/** \copydoc UanPhy::IsStateTx */
bool IsPhy1Tx (void);
/** \copydoc UanPhy::IsStateTx */
bool IsPhy2Tx (void);
// Attribute getters and setters
/** \copydoc ns3::UanPhy::GetCcaThresholdDb() */
double GetCcaThresholdPhy1 (void) const;
/** \copydoc UanPhy::GetCcaThresholdDb() */
double GetCcaThresholdPhy2 (void) const;
/** \copydoc UanPhy::SetCcaThresholdDb */
void SetCcaThresholdPhy1 (double thresh);
/** \copydoc UanPhy::SetCcaThresholdDb */
void SetCcaThresholdPhy2 (double thresh);
/** \copydoc UanPhy::GetTxPowerDb */
double GetTxPowerDbPhy1 (void) const;
/** \copydoc UanPhy::GetTxPowerDb */
double GetTxPowerDbPhy2 (void) const;
/** \copydoc UanPhy::SetTxPowerDb */
void SetTxPowerDbPhy1 (double txpwr);
/** \copydoc UanPhy::SetTxPowerDb */
void SetTxPowerDbPhy2 (double txpwr);
/** \copydoc UanPhy::GetRxGainDb */
double GetRxGainDbPhy1 (void) const;
/** \copydoc UanPhy::GetRxGainDb */
double GetRxGainDbPhy2 (void) const;
/** \copydoc UanPhy::SetRxGainDb */
void SetRxGainDbPhy1 (double gain);
/** \copydoc UanPhy::SetRxGainDb */
void SetRxGainDbPhy2 (double gain);
/**
* Get the list of available modes.
*
* \return The mode list.
*/
UanModesList GetModesPhy1 (void) const;
/** \copydoc GetModesPhy1 */
UanModesList GetModesPhy2 (void) const;
/**
* Set the available modes.
*
* \param modes List of modes.
*/
void SetModesPhy1 (UanModesList modes);
/** \copydoc SetModesPhy1 */
void SetModesPhy2 (UanModesList modes);
/**
* Get the error probability model.
*
* \return The error model.
*/
Ptr<UanPhyPer> GetPerModelPhy1 (void) const;
/** \copydoc GetPerModelPhy1() */
Ptr<UanPhyPer> GetPerModelPhy2 (void) const;
/**
* Set the error probability model.
*
* \param per The error model.
*/
void SetPerModelPhy1 (Ptr<UanPhyPer> per);
/** \copydoc SetPerModelPhy1 */
void SetPerModelPhy2 (Ptr<UanPhyPer> per);
/**
* Get the SINR calculator.
*
* \return The SINR calculator.
*/
Ptr<UanPhyCalcSinr> GetSinrModelPhy1 (void) const;
/** \copydoc GetSinrModelPhy1 */
Ptr<UanPhyCalcSinr> GetSinrModelPhy2 (void) const;
/**
* Set the SINR calculator.
*
* \param calcSinr The SINR calculator.
*/
void SetSinrModelPhy1 (Ptr<UanPhyCalcSinr> calcSinr);
/** \copydoc SetSinrModelPhy1 */
void SetSinrModelPhy2 (Ptr<UanPhyCalcSinr> calcSinr);
/** \copydoc UanPhy::GetPacketRx */
Ptr<Packet> GetPhy1PacketRx (void) const;
/** \copydoc UanPhy::GetPacketRx */
Ptr<Packet> GetPhy2PacketRx (void) const;
private:
/** First Phy layer. */
Ptr<UanPhy> m_phy1;
/** Second Phy layer. */
Ptr<UanPhy> m_phy2;
/** A packet was received successfully. */
ns3::TracedCallback<Ptr<const Packet>, double, UanTxMode > m_rxOkLogger;
/** A packet was received unsuccessfully. */
ns3::TracedCallback<Ptr<const Packet>, double, UanTxMode > m_rxErrLogger;
/** A packet was sent from this Phy. */
ns3::TracedCallback<Ptr<const Packet>, double, UanTxMode > m_txLogger;
/** Callback when packet received without errors. */
RxOkCallback m_recOkCb;
/** Callback when packet received with errors. */
RxErrCallback m_recErrCb;
/**
* Handle callback and logger for packets received without error.
*
* \param pkt The packet.
* \param sinr The SINR.
* \param mode The channel mode.
*/
void RxOkFromSubPhy (Ptr<Packet> pkt, double sinr, UanTxMode mode);
/**
* Handle callback and logger for packets received with error.
*
* \param pkt The packet.
* \param sinr The SINR.
*/
void RxErrFromSubPhy (Ptr<Packet> pkt, double sinr);
protected:
virtual void DoDispose ();
}; // class UanPhyDual
} // namespace ns3
#endif /* UAN_PHY_DUAL_H */
|