20 #ifndef MOCK_NET_DEVICE_H
21 #define MOCK_NET_DEVICE_H
26 #include "ns3/traced-callback.h"
27 #include "ns3/net-device.h"
72 virtual void SetIfIndex (
const uint32_t index);
77 virtual bool SetMtu (
const uint16_t mtu);
78 virtual uint16_t
GetMtu (
void)
const;
a polymophic address class
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
This device assumes 48-bit mac addressing; there is also the possibility to add an ErrorModel if you ...
Ptr< Node > m_node
Node this netDevice is associated to.
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)
uint32_t m_ifIndex
Interface index.
virtual bool NeedsArp(void) const
virtual void SetAddress(Address address)
Set the address of this interface.
void SetSendCallback(PromiscReceiveCallback cb)
Add a callback to be invoked when the MockNetDevice has a packet to "send".
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
virtual bool SupportsSendFrom(void) const
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
void Receive(Ptr< Packet > packet, uint16_t protocol, Address to, Address from, NetDevice::PacketType packetType)
Pretend that a packet has been received from a connected Channel.
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
virtual void SetIfIndex(const uint32_t index)
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
virtual Ptr< Channel > GetChannel(void) const
virtual uint32_t GetIfIndex(void) const
virtual bool IsMulticast(void) const
NetDevice::PromiscReceiveCallback m_sendCallback
Send callback.
virtual uint16_t GetMtu(void) const
virtual Address GetBroadcast(void) const
virtual Address GetAddress(void) const
virtual void DoDispose(void)
Destructor implementation.
virtual bool IsBroadcast(void) const
static TypeId GetTypeId(void)
Get the type ID.
TracedCallback m_linkChangeCallbacks
List of callbacks to fire if the link changes state (up or down).
bool m_pointToPointMode
Enabling this will disable Broadcast and Arp.
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
Address m_address
MAC address.
bool m_linkUp
Flag indicating whether or not the link is up.
virtual bool SetMtu(const uint16_t mtu)
virtual void SetNode(Ptr< Node > node)
NetDevice::PromiscReceiveCallback m_promiscCallback
Promiscuous receive callback.
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
virtual void AddLinkChangeCallback(Callback< void > callback)
virtual bool IsLinkUp(void) const
NetDevice::ReceiveCallback m_rxCallback
Receive callback.
virtual Ptr< Node > GetNode(void) const
Network layer to device interface.
PacketType
Packet types are used as they are in Linux.
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.