22 #include "ns3/simulator.h"
23 #include "ns3/channel.h"
25 #include "ns3/packet.h"
39 .AddConstructor<LoopbackNetDevice> ()
57 NS_LOG_FUNCTION (packet <<
" " << protocol <<
" " << to <<
" " << from);
192 NS_LOG_FUNCTION (packet <<
" " << source <<
" " << dest <<
" " << protocolNumber);
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
uint32_t m_ifIndex
interface index
#define NS_LOG_FUNCTION(parameters)
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
Packet addressed to someone else.
virtual Address GetAddress(void) const
bool IsNull(void) const
Check for null implementation.
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
virtual void SetNode(Ptr< Node > node)
bool IsBroadcast(void) const
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Mac48Address m_address
NetDevice MAC address.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
NetDevice::ReceiveCallback m_rxCallback
The callback used to notify higher layers that a packet has been received.
virtual bool SupportsSendFrom(void) const
a polymophic address class
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
static Mac48Address GetMulticast(Ipv4Address address)
virtual bool IsBroadcast(void) const
NetDevice::PromiscReceiveCallback m_promiscCallback
The callback used to notify higher layers that a packet has been received in promiscuous mode...
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
virtual bool IsLinkUp(void) const
virtual uint16_t GetMtu(void) const
static void ScheduleWithContext(uint32_t context, Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event with the given context.
static Mac48Address ConvertFrom(const Address &address)
virtual uint32_t GetIfIndex(void) const
virtual bool SetMtu(const uint16_t mtu)
virtual Address GetBroadcast(void) const
#define NS_ASSERT_MSG(condition, message)
Describes an IPv6 address.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Ipv4 addresses are stored in host order in this class.
NS_LOG_COMPONENT_DEFINE("LoopbackNetDevice")
virtual Ptr< Channel > GetChannel(void) const
uint32_t GetId(void) const
Network layer to device interface.
virtual void SetIfIndex(const uint32_t index)
virtual bool NeedsArp(void) const
Ptr< Node > m_node
the node this NetDevice is associated with
virtual bool IsMulticast(void) const
void Receive(Ptr< Packet > packet, uint16_t protocol, Mac48Address to, Mac48Address from)
Receive a packet from tge Loopback NetDevice.
virtual Ptr< Node > GetNode(void) const
PacketType
Packet types are used as they are in Linux.
Packet addressed to multicast group.
static TypeId GetTypeId(void)
Get the type ID.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
virtual void SetAddress(Address address)
Set the address of this interface.
virtual void AddLinkChangeCallback(Callback< void > callback)