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);
 
  120                 const Address &source, 
const Address &destination,
 
  125   virtual void SetIfIndex (
const uint32_t index);
 
  130   virtual uint16_t 
GetMtu (
void) 
const;
 
  139   virtual bool Send (
Ptr<Packet> packet, 
const Address& dest, uint16_t protocolNumber);
 
  140   virtual bool SendFrom (
Ptr<Packet> packet, 
const Address& source, 
const Address& dest, uint16_t protocolNumber);
 
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 
 
Callback< bool, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address & > ReceiveCallback
 
virtual void DoDispose(void)
Destructor implementation. 
 
Forward calls to a chain of Callback. 
 
PacketType
Packet types are used as they are in Linux. 
 
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 
 
TracedCallback< Ptr< const Packet > > m_macPromiscRxTrace
 
virtual bool IsBroadcast(void) const 
 
virtual void SetPromiscReceiveCallback(NetDevice::PromiscReceiveCallback cb)
 
TracedCallback< Ptr< const Packet > > m_snifferTrace
 
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)
Set the address of this interface. 
 
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
Callback the be invoked when the VirtualNetDevice is asked to queue/transmit a packet. 
 
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
 
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 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. 
 
ReceiveCallback m_rxCallback
 
virtual ~VirtualNetDevice()
 
virtual uint32_t GetIfIndex(void) const 
 
static TypeId GetTypeId(void)
 
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.