21 #ifndef VIRTUAL_NET_DEVICE_H
22 #define VIRTUAL_NET_DEVICE_H
24 #include "ns3/address.h"
26 #include "ns3/net-device.h"
27 #include "ns3/callback.h"
28 #include "ns3/packet.h"
30 #include "ns3/traced-callback.h"
105 bool SetMtu (
const uint16_t mtu);
125 virtual void SetIfIndex (
const uint32_t index);
130 virtual uint16_t
GetMtu (
void)
const;
a polymophic address class
Ipv4 addresses are stored in host order in this class.
Describes an IPv6 address.
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.
A virtual device, similar to Linux TUN/TAP interfaces.
virtual ~VirtualNetDevice()
TracedCallback< Ptr< const Packet > > m_promiscSnifferTrace
virtual Ptr< Channel > GetChannel(void) const
bool SetMtu(const uint16_t mtu)
Configure the reported MTU for the virtual device.
virtual void SetPromiscReceiveCallback(NetDevice::PromiscReceiveCallback cb)
TracedCallback< Ptr< const Packet > > m_macRxTrace
void SetSupportsSendFrom(bool supportsSendFrom)
Configure whether the virtual device supports SendFrom.
bool Receive(Ptr< Packet > packet, uint16_t protocol, const Address &source, const Address &destination, PacketType packetType)
virtual void SetAddress(Address address)
Set the address of this interface.
TracedCallback< Ptr< const Packet > > m_snifferTrace
void SetNeedsArp(bool needsArp)
Configure whether the virtual device needs ARP.
virtual Ptr< Node > GetNode(void) const
virtual void SetIfIndex(const uint32_t index)
virtual Address GetBroadcast(void) const
virtual void DoDispose(void)
Destructor implementation.
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
virtual Address GetAddress(void) const
static TypeId GetTypeId(void)
virtual uint16_t GetMtu(void) const
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
TracedCallback< Ptr< const Packet > > m_macPromiscRxTrace
virtual bool IsBroadcast(void) const
virtual bool SupportsSendFrom() const
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
void SetIsPointToPoint(bool isPointToPoint)
Configure whether the virtual device is point-to-point.
virtual bool IsLinkUp(void) const
virtual bool IsMulticast(void) const
virtual uint32_t GetIfIndex(void) const
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
virtual void AddLinkChangeCallback(Callback< void > callback)
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
PromiscReceiveCallback m_promiscRxCallback
ReceiveCallback m_rxCallback
virtual bool NeedsArp(void) const
void SetSendCallback(SendCallback transmitCb)
Set the user callback to be called when a L2 packet is to be transmitted.
virtual void SetNode(Ptr< Node > node)
Callback< bool, Ptr< Packet >, const Address &, const Address &, uint16_t > SendCallback
Callback the be invoked when the VirtualNetDevice is asked to queue/transmit a packet.
TracedCallback< Ptr< const Packet > > m_macTxTrace
Every class exported by the ns3 library is enclosed in the ns3 namespace.