23 #include "ns3/packet.h"
25 #include "ns3/pointer.h"
26 #include "ns3/error-model.h"
27 #include "ns3/trace-source-accessor.h"
41 .AddConstructor<SimpleNetDevice> ()
42 .AddAttribute (
"ReceiveErrorModel",
43 "The receiver error model used to simulate packet loss",
46 MakePointerChecker<ErrorModel> ())
47 .AddTraceSource (
"PhyRxDrop",
48 "Trace source indicating a packet has been dropped by the device during reception",
230 m_channel->Send (packet, protocolNumber, to, from,
this);
virtual Address GetAddress(void) const
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
NS_LOG_COMPONENT_DEFINE("SimpleNetDevice")
#define NS_LOG_FUNCTION(parameters)
Packet addressed to someone else.
virtual Ptr< Channel > GetChannel(void) const
void Receive(Ptr< Packet > packet, uint16_t protocol, Mac48Address to, Mac48Address from)
Receive a packet from a connected SimpleChannel.
bool IsNull(void) const
Check for null implementation.
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
bool IsBroadcast(void) const
virtual void SetIfIndex(const uint32_t index)
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
virtual bool IsBroadcast(void) const
virtual bool NeedsArp(void) const
virtual bool IsMulticast(void) const
a polymophic address class
virtual void SetNode(Ptr< Node > node)
static Mac48Address GetMulticast(Ipv4Address address)
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
virtual bool SetMtu(const uint16_t mtu)
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
static Mac48Address ConvertFrom(const Address &address)
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
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
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...
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
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
Ptr< SimpleChannel > m_channel
PacketType
Packet types are used as they are in Linux.
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.
Packet addressed to multicast group.
a unique identifier for an interface.
virtual Address GetBroadcast(void) const
TypeId SetParent(TypeId tid)
virtual uint32_t GetIfIndex(void) const
static TypeId GetTypeId(void)
virtual bool SupportsSendFrom(void) const
virtual bool IsLinkUp(void) const