28 #include "ns3/callback.h"
29 #include "ns3/object.h"
32 #include "ns3/ipv4-address.h"
33 #include "ns3/ipv6-address.h"
104 virtual void Print (std::ostream &os)
const;
171 virtual void Start (
void);
177 virtual void Stop (
void);
184 virtual void Wake (
void);
418 virtual void SetIfIndex (
const uint32_t index) = 0;
451 virtual bool SetMtu (
const uint16_t mtu) = 0;
458 virtual uint16_t
GetMtu (
void)
const = 0;
462 virtual bool IsLinkUp (
void)
const = 0;
538 virtual bool IsBridge (
void)
const = 0;
596 virtual bool NeedsArp (
void)
const = 0;
652 typedef Callback< bool, Ptr<NetDevice>, Ptr<const Packet>, uint16_t,
virtual void SetIfIndex(const uint32_t index)=0
Base class to represent items of packet Queues.
virtual Address GetBroadcast(void) const =0
uint8_t GetNTxQueues(void) const
Get the number of device transmission queues.
virtual Address GetMulticast(Ipv4Address multicastGroup) const =0
Make and return a MAC multicast address using the provided multicast group.
QueueItem()
Default constructor.
Callback< bool, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address & > ReceiveCallback
bool m_stoppedByDevice
True if the queue has been stopped by the device.
void NotifyQueuedBytes(uint32_t bytes)
Called by the netdevice to report the number of bytes queued to the device queue. ...
bool m_stoppedByQueueLimits
True if the queue has been stopped by a queue limits object.
Forward calls to a chain of Callback.
virtual void SetNode(Ptr< Node > node)=0
PacketType
Packet types are used as they are in Linux.
virtual Ptr< Node > GetNode(void) const =0
WakeCallback m_wakeCallback
Wake callback.
Ptr< Packet > m_packet
The packet contained in the queue item.
void SetSelectQueueCallback(SelectQueueCallback cb)
Set the select queue callback.
Packet addressed to multicast group.
virtual bool IsBroadcast(void) const =0
a polymophic address class
virtual void SetPromiscReceiveCallback(PromiscReceiveCallback cb)=0
Callback< void > WakeCallback
Callback invoked by netdevices to wake upper layers.
virtual void SetReceiveCallback(ReceiveCallback cb)=0
Callback< uint8_t, Ptr< QueueItem > > SelectQueueCallback
Callback invoked to determine the tx queue selected for a given packet.
virtual void Start(void)
Called by the device to start this device transmission queue.
virtual bool SupportsSendFrom(void) const =0
bool IsStopped(void) const
Get the status of the device transmission queue.
virtual uint16_t GetMtu(void) const =0
virtual bool IsMulticast(void) const =0
virtual uint32_t GetPacketSize(void) const
Use this method (instead of GetPacket ()->GetSize ()) to get the packet size.
static TypeId GetTypeId(void)
Get the type ID.
void(* LinkChangeTracedCallback)(void)
TracedCallback signature for link changed event.
SelectQueueCallback GetSelectQueueCallback(void) const
Get the select queue callback.
static TypeId GetTypeId(void)
Get the type ID.
SelectQueueCallback m_selectQueueCallback
Select queue callback.
Network device transmission queue interface.
uint8_t m_numTxQueues
Number of transmission queues to create.
virtual bool IsBridge(void) const =0
Return true if the net device is acting as a bridge.
virtual bool NeedsArp(void) const =0
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
void ResetQueueLimits()
Reset queue limits state.
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 void Stop(void)
Called by the device to stop this device transmission queue.
Packet addressed to someone else.
std::vector< Ptr< NetDeviceQueue > > m_txQueuesVector
Device transmission queues.
virtual bool GetUint8Value(Uint8Values field, uint8_t &value) const
Retrieve the value of a given field from the packet, if present.
virtual void DoDispose(void)
Dispose of the object.
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)=0
void SetQueueLimits(Ptr< QueueLimits > ql)
Set queue limits to this queue.
virtual Ptr< Channel > GetChannel(void) const =0
QueueItem & operator=(const QueueItem &)
Assignment operator.
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)=0
void NotifyTransmittedBytes(uint32_t bytes)
Called by the netdevice to report the number of bytes it is going to transmit.
Uint8Values
1-byte fields of the packet whose value can be retrieved, if present
virtual uint32_t GetIfIndex(void) const =0
virtual void Print(std::ostream &os) const
Print the item contents.
Ptr< QueueLimits > m_queueLimits
Queue limits object.
Describes an IPv6 address.
Ipv4 addresses are stored in host order in this class.
NetDeviceQueueInterface()
Constructor.
virtual void Wake(void)
Called by the device to wake the queue disc associated with this device transmission queue...
Network layer to device interface.
virtual bool IsPointToPoint(void) const =0
Return true if the net device is on a point-to-point link.
Ptr< NetDeviceQueue > GetTxQueue(uint8_t i) const
Get the i-th transmission queue of the device.
void CreateTxQueues(void)
Create the device transmission queues.
Ptr< QueueLimits > GetQueueLimits()
Get queue limits to this queue.
virtual void SetWakeCallback(WakeCallback cb)
Set the wake callback.
virtual ~NetDeviceQueueInterface()
A base class which provides memory management and object aggregation.
virtual void SetAddress(Address address)=0
Set the address of this interface.
virtual void AddLinkChangeCallback(Callback< void > callback)=0
virtual ~NetDeviceQueue()
virtual bool IsLinkUp(void) const =0
virtual bool SetMtu(const uint16_t mtu)=0
Network device transmission queue.
A template-based reference counting class.
a unique identifier for an interface.
virtual Address GetAddress(void) const =0
void SetTxQueuesN(uint8_t numTxQueues)
Set the number of device transmission queues to create.
Ptr< Packet > GetPacket(void) const