85 if (!
m_phy->IsStateTx())
137 <<
" Received packet in error with sinr " << sinr);
a polymophic address class
A class used for addressing MAC8 MAC's.
static Mac8Address GetBroadcast()
Get the broadcast address (255).
static Mac8Address ConvertFrom(const Address &address)
Convert a generic address to a Mac8Address.
virtual void DoDispose()
Destructor implementation.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void AddHeader(const Header &header)
Add header to this packet.
static Time Now()
Return the current simulation virtual time.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
ALOHA MAC Protocol, the simplest MAC protocol for wireless networks.
static TypeId GetTypeId()
Register this type.
Ptr< UanPhy > m_phy
PHY layer attached to this MAC.
void DoDispose() override
Destructor implementation.
bool m_cleared
Flag when we've been cleared.
bool Enqueue(Ptr< Packet > pkt, uint16_t protocolNumber, const Address &dest) override
Enqueue packet to be transmitted.
UanMacAloha()
Default constructor.
void AttachPhy(Ptr< UanPhy > phy) override
Attach PHY layer to this MAC.
void SetForwardUpCb(Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > cb) override
Set the callback to forward packets up to higher layers.
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
Callback< void, Ptr< Packet >, uint16_t, const Mac8Address & > m_forUpCb
Forwarding up callback.
void RxPacketGood(Ptr< Packet > pkt, double sinr, UanTxMode txMode)
Receive packet from lower layer (passed to PHY as callback).
~UanMacAloha() override
Dummy destructor, see DoDispose.
void RxPacketError(Ptr< Packet > pkt, double sinr)
Packet received at lower layer in error.
void Clear() override
Clears all pointer references.
Virtual base class for all UAN MAC protocols.
virtual Address GetAddress()
Get the MAC Address.
uint32_t GetTxModeIndex()
Get the Tx mode index (Modulation type).
Abstraction of packet modulation information.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Now()
create an ns3::Time instance which contains the current simulation time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...