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"
67 static TypeId GetTypeId (
void);
105 bool SetMtu (
const uint16_t mtu);
125 virtual void SetIfIndex (
const uint32_t index);
130 virtual uint16_t
GetMtu (
void)
const;
169 bool m_supportsSendFrom;
170 bool m_isPointToPoint;
void SetNeedsArp(bool needsArp)
Configure whether the virtual device needs ARP.
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
virtual bool SupportsSendFrom() const
virtual void DoDispose(void)
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
Callback< bool, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address & > ReceiveCallback
bool SetMtu(const uint16_t mtu)
Configure the reported MTU for the virtual device.
bool Receive(Ptr< Packet > packet, uint16_t protocol, const Address &source, const Address &destination, PacketType packetType)
virtual bool NeedsArp(void) const
a polymophic address class
virtual bool IsBroadcast(void) const
virtual void SetPromiscReceiveCallback(NetDevice::PromiscReceiveCallback cb)
virtual Address GetAddress(void) const
virtual uint16_t GetMtu(void) const
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
virtual bool IsMulticast(void) const
virtual Ptr< Channel > GetChannel(void) const
virtual void SetAddress(Address address)
virtual void SetIfIndex(const uint32_t index)
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
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.
Callback< bool, Ptr< Packet >, const Address &, const Address &, uint16_t > SendCallback
void SetSupportsSendFrom(bool supportsSendFrom)
Configure whether the virtual device supports SendFrom.
virtual void SetNode(Ptr< Node > node)
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
Callback< bool, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address &, const Address &, enum PacketType > PromiscReceiveCallback
virtual void AddLinkChangeCallback(Callback< void > callback)
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
virtual Ptr< Node > GetNode(void) const
Describes an IPv6 address.
Ipv4 addresses are stored in host order in this class.
Network layer to device interface.
A virtual device, similar to Linux TUN/TAP interfaces.
virtual uint32_t GetIfIndex(void) const
virtual bool IsLinkUp(void) const
void SetSendCallback(SendCallback transmitCb)
Set the user callback to be called when a L2 packet is to be transmitted.
virtual Address GetBroadcast(void) const
a unique identifier for an interface.