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