19 #ifndef SIMPLE_NET_DEVICE_H
20 #define SIMPLE_NET_DEVICE_H
26 #include "ns3/event-id.h"
27 #include "ns3/net-device.h"
28 #include "ns3/traced-callback.h"
111 void SetIfIndex(
const uint32_t index)
override;
116 bool SetMtu(
const uint16_t mtu)
override;
117 uint16_t
GetMtu()
const override;
130 uint16_t protocolNumber)
override;
a polymophic address class
Class for representing data rates.
An identifier for simulation events.
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
Network layer to device interface.
Template class for packet Queues.
This device assumes 48-bit mac addressing; there is also the possibility to add an ErrorModel if you ...
bool NeedsArp() const override
void DoDispose() override
Destructor implementation.
void SetPromiscReceiveCallback(PromiscReceiveCallback cb) override
void SetQueue(Ptr< Queue< Packet >> queue)
Attach a queue to the SimpleNetDevice.
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...
TracedCallback m_linkChangeCallbacks
List of callbacks to fire if the link changes state (up or down).
bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) override
void SetNode(Ptr< Node > node) override
void SetAddress(Address address) override
Set the address of this interface.
void SetIfIndex(const uint32_t index) override
bool SetMtu(const uint16_t mtu) override
NetDevice::ReceiveCallback m_rxCallback
Receive callback.
bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber) override
static TypeId GetTypeId()
Get the type ID.
DataRate m_bps
The device nominal Data rate.
Ptr< Queue< Packet > > m_queue
The Queue for outgoing packets.
bool IsPointToPoint() const override
Return true if the net device is on a point-to-point link.
Ptr< Channel > GetChannel() const override
void SetReceiveErrorModel(Ptr< ErrorModel > em)
Attach a receive ErrorModel to the SimpleNetDevice.
uint16_t GetMtu() const override
EventId FinishTransmissionEvent
the Tx Complete event
bool m_linkUp
Flag indicating whether or not the link is up.
void AddLinkChangeCallback(Callback< void > callback) override
bool m_pointToPointMode
Flag indicating whether or not the NetDevice is a Point to Point model.
Address GetMulticast(Ipv4Address multicastGroup) const override
Make and return a MAC multicast address using the provided multicast group.
void FinishTransmission(Ptr< Packet > packet)
The FinishTransmission method is used internally to finish the process of sending a packet out on the...
uint32_t GetIfIndex() const override
Ptr< ErrorModel > m_receiveErrorModel
Receive error model.
bool IsMulticast() const override
Ptr< SimpleChannel > m_channel
the channel the device is connected to
Ptr< Node > m_node
Node this netDevice is associated to.
uint32_t m_ifIndex
Interface index.
Mac48Address m_address
MAC address.
Ptr< Queue< Packet > > GetQueue() const
Get a copy of the attached Queue.
Ptr< Node > GetNode() const override
bool IsLinkUp() const override
void StartTransmission()
The StartTransmission method is used internally to start the process of sending a packet out on the c...
Address GetBroadcast() const override
NetDevice::PromiscReceiveCallback m_promiscCallback
Promiscuous receive callback.
bool IsBridge() const override
Return true if the net device is acting as a bridge.
bool IsBroadcast() const override
bool SupportsSendFrom() const override
void SetReceiveCallback(NetDevice::ReceiveCallback cb) override
void Receive(Ptr< Packet > packet, uint16_t protocol, Mac48Address to, Mac48Address from)
Receive a packet from a connected SimpleChannel.
void SetChannel(Ptr< SimpleChannel > channel)
Attach a channel to this net device.
Address GetAddress() const override
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.
Forward declaration of template class Queue.