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