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;
void SetNeedsArp(bool needsArp)
Configure whether the virtual device needs ARP.
Callback< bool, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address &> ReceiveCallback
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
virtual void DoDispose(void)
Destructor implementation.
Forward calls to a chain of Callback.
bool SetMtu(const uint16_t mtu)
Configure the reported MTU for the virtual device.
virtual Address GetBroadcast(void) const
bool Receive(Ptr< Packet > packet, uint16_t protocol, const Address &source, const Address &destination, PacketType packetType)
virtual Ptr< Channel > GetChannel(void) const
a polymophic address class
TracedCallback< Ptr< const Packet > > m_macPromiscRxTrace
virtual bool IsMulticast(void) const
virtual void SetPromiscReceiveCallback(NetDevice::PromiscReceiveCallback cb)
TracedCallback< Ptr< const Packet > > m_snifferTrace
virtual bool SupportsSendFrom() const
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
virtual Ptr< Node > GetNode(void) const
virtual bool IsLinkUp(void) const
virtual void SetAddress(Address address)
Set the address of this interface.
virtual void SetIfIndex(const uint32_t index)
virtual uint16_t GetMtu(void) const
void SetIsPointToPoint(bool isPointToPoint)
Configure whether the virtual device is point-to-point.
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.
virtual bool IsBroadcast(void) const
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)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< bool, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address &, const Address &, enum PacketType > PromiscReceiveCallback
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
TracedCallback< Ptr< const Packet > > m_promiscSnifferTrace
PromiscReceiveCallback m_promiscRxCallback
TracedCallback< Ptr< const Packet > > m_macRxTrace
virtual void AddLinkChangeCallback(Callback< void > callback)
TracedCallback< Ptr< const Packet > > m_macTxTrace
virtual Address GetAddress(void) const
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
virtual bool NeedsArp(void) const
Describes an IPv6 address.
Ipv4 addresses are stored in host order in this class.
Network layer to device interface.
ReceiveCallback m_rxCallback
virtual ~VirtualNetDevice()
static TypeId GetTypeId(void)
PacketType
Packet types are used as they are in Linux.
void SetSendCallback(SendCallback transmitCb)
Set the user callback to be called when a L2 packet is to be transmitted.
a unique identifier for an interface.
virtual uint32_t GetIfIndex(void) const