9#ifndef ALOHA_NOACK_NET_DEVICE_H
10#define ALOHA_NOACK_NET_DEVICE_H
12#include "ns3/queue-fwd.h"
13#include <ns3/address.h>
14#include <ns3/callback.h>
15#include <ns3/generic-phy.h>
16#include <ns3/mac48-address.h>
17#include <ns3/net-device.h>
19#include <ns3/nstime.h>
20#include <ns3/packet.h>
22#include <ns3/traced-callback.h>
31class SpectrumErrorModel;
140 bool SetMtu(
const uint16_t mtu)
override;
141 uint16_t
GetMtu()
const override;
155 uint16_t protocolNumber)
override;
a polymophic address class
This devices implements the following features:
TracedCallback m_linkChangeCallbacks
List of callbacks to fire if the link changes state (up or down).
void NotifyReceptionEndError()
Notify the MAC that the PHY finished a reception with an error.
TracedCallback< Ptr< const Packet > > m_macRxTrace
Rx trace.
Ptr< Queue< Packet > > m_queue
packet queue
bool IsLinkUp() const override
void AddLinkChangeCallback(Callback< void > callback) override
virtual void SetQueue(Ptr< Queue< Packet > > queue)
set the queue which is going to be used by this device
Mac48Address m_address
MAC address.
Address GetAddress() const override
bool m_linkUp
true if the link is up
NetDevice::ReceiveCallback m_rxCallback
Rx callback.
void SetIfIndex(const uint32_t index) override
void StartTransmission()
start the transmission of a packet by contacting the PHY layer
NetDevice::PromiscReceiveCallback m_promiscRxCallback
Promiscuous Rx callback.
void NotifyReceptionStart()
Notify the MAC that the PHY has started a reception.
Ptr< Object > m_phy
PHY object.
void SetPromiscReceiveCallback(PromiscReceiveCallback cb) override
void SetAddress(Address address) override
Set the address of this interface.
Ptr< Packet > m_currentPkt
Current packet.
Ptr< Channel > m_channel
Channel.
TracedCallback< Ptr< const Packet > > m_macPromiscRxTrace
Promiscuous Rx trace.
void NotifyGuardIntervalEnd()
Notification of Guard Interval end.
Ptr< Node > m_node
Node owning this NetDevice.
Ptr< Channel > GetChannel() const override
void SetGenericPhyTxStartCallback(GenericPhyTxStartCallback c)
set the callback used to instruct the lower layer to start a TX
Address GetBroadcast() const override
Ptr< Object > GetPhy() const
uint16_t GetMtu() const override
uint32_t GetIfIndex() const override
GenericPhyTxStartCallback m_phyMacTxStartCallback
Tx Start callback.
bool SupportsSendFrom() const override
bool IsPointToPoint() const override
Return true if the net device is on a point-to-point link.
static TypeId GetTypeId()
Get the type ID.
void NotifyTransmissionEnd(Ptr< const Packet >)
Notify the MAC that the PHY has finished a previously started transmission.
void SetChannel(Ptr< Channel > c)
This class doesn't talk directly with the underlying channel (a dedicated PHY class is expected to do...
bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) override
Address GetMulticast(Ipv4Address addr) const override
Make and return a MAC multicast address using the provided multicast group.
bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber) override
State m_state
State of the NetDevice.
void SetNode(Ptr< Node > node) override
bool IsMulticast() const override
bool NeedsArp() const override
uint32_t m_ifIndex
Interface index.
void DoDispose() override
Destructor implementation.
bool IsBroadcast() const override
uint32_t m_mtu
NetDevice MTU.
~AlohaNoackNetDevice() override
void SetPhy(Ptr< Object > phy)
Set the Phy object which is attached to this device.
TracedCallback< Ptr< const Packet > > m_macTxTrace
Tx trace.
void SetReceiveCallback(NetDevice::ReceiveCallback cb) override
void NotifyReceptionEndOk(Ptr< Packet > p)
Notify the MAC that the PHY finished a reception successfully.
TracedCallback< Ptr< const Packet > > m_macTxDropTrace
Tx Drop trace.
State
State of the NetDevice.
bool SetMtu(const uint16_t mtu) override
Ptr< Node > GetNode() const override
bool IsBridge() const override
Return true if the net device is acting as a bridge.
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
Network layer to device interface.
Smart pointer class similar to boost::intrusive_ptr.
Template class for packet Queues.
Forward calls to a chain of Callback.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.