20 #ifndef SIMPLE_NET_DEVICE_H
21 #define SIMPLE_NET_DEVICE_H
26 #include "ns3/traced-callback.h"
27 #include "ns3/net-device.h"
28 #include "ns3/queue.h"
29 #include "ns3/data-rate.h"
30 #include "ns3/data-rate.h"
31 #include "ns3/event-id.h"
112 virtual void SetIfIndex (
const uint32_t index);
117 virtual bool SetMtu (
const uint16_t mtu);
118 virtual uint16_t
GetMtu (
void)
const;
virtual Address GetAddress(void) const
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
EventId TransmitCompleteEvent
the Tx Complete event
Ptr< Node > m_node
Node this netDevice is associated to.
virtual Ptr< Channel > GetChannel(void) const
TracedCallback m_linkChangeCallbacks
List of callbacks to fire if the link changes state (up or down).
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
void Receive(Ptr< Packet > packet, uint16_t protocol, Mac48Address to, Mac48Address from)
Receive a packet from a connected SimpleChannel.
virtual void SetIfIndex(const uint32_t index)
virtual bool IsBroadcast(void) const
virtual bool NeedsArp(void) const
bool m_pointToPointMode
Flag indicating whether or not the NetDevice is a Point to Point model.
virtual bool IsMulticast(void) const
a polymophic address class
bool m_linkUp
Flag indicating whether or not the link is up.
Class for representing data rates.
virtual void SetNode(Ptr< Node > node)
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
virtual bool SetMtu(const uint16_t mtu)
This device assumes 48-bit mac addressing; there is also the possibility to add an ErrorModel if you ...
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
Mac48Address m_address
MAC address.
Ptr< Queue > m_queue
The Queue for outgoing packets.
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
virtual uint16_t GetMtu(void) const
void SetReceiveErrorModel(Ptr< ErrorModel > em)
Attach a receive ErrorModel to the SimpleNetDevice.
virtual Ptr< Node > GetNode(void) const
NetDevice::PromiscReceiveCallback m_promiscCallback
Promiscuous receive callback.
Describes an IPv6 address.
Ipv4 addresses are stored in host order in this class.
TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
The trace source fired when the phy layer drops a packet it has received due to the error model being...
an identifier for simulation events.
Network layer to device interface.
virtual void AddLinkChangeCallback(Callback< void > callback)
virtual void SetAddress(Address address)
Set the address of this interface.
Ptr< ErrorModel > m_receiveErrorModel
Receive error model.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
NetDevice::ReceiveCallback m_rxCallback
Receive callback.
Ptr< SimpleChannel > m_channel
the channel the device is connected to
void TransmitComplete(void)
The TransmitComplete method is used internally to finish the process of sending a packet out on the c...
void SetQueue(Ptr< Queue > queue)
Attach a queue to the SimpleNetDevice.
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
void SetChannel(Ptr< SimpleChannel > channel)
Attach a channel to this net device.
Ptr< Queue > GetQueue(void) const
Get a copy of the attached Queue.
DataRate m_bps
The device nominal Data rate.
a unique identifier for an interface.
virtual Address GetBroadcast(void) const
virtual uint32_t GetIfIndex(void) const
static TypeId GetTypeId(void)
Get the type ID.
virtual bool SupportsSendFrom(void) const
virtual bool IsLinkUp(void) const
uint32_t m_ifIndex
Interface index.