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