19 #ifndef TRAFFICCONTROLLAYER_H
20 #define TRAFFICCONTROLLAYER_H
22 #include "ns3/object.h"
23 #include "ns3/address.h"
24 #include "ns3/net-device.h"
121 uint16_t protocolType,
180 uint16_t protocol,
const Address &from,
222 typedef std::pair<Ptr<NetDeviceQueueInterface>, QueueDiscVector>
NetDeviceInfo;
244 #endif // TRAFFICCONTROLLAYER_H
virtual void DeleteRootQueueDiscOnDevice(Ptr< NetDevice > device)
This method can be used to remove the root queue disc (and associated filters, classes and queues) in...
Smart pointer class similar to boost::intrusive_ptr.
virtual void SetRootQueueDiscOnDevice(Ptr< NetDevice > device, Ptr< QueueDisc > qDisc)
This method can be used to set the root queue disc installed on a device.
Traffic control layer definition.
ProtocolHandlerList m_handlers
List of upper-layer handlers.
bool promiscuous
true if it is a promiscuous handler
virtual void DoInitialize(void)
Initialize() implementation.
PacketType
Packet types are used as they are in Linux.
virtual void NotifyNewAggregate(void)
Notify all Objects aggregated to this one of a new Object being aggregated.
virtual void Receive(Ptr< NetDevice > device, Ptr< const Packet > p, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType)
Called by NetDevices, incoming packet.
uint16_t protocol
the protocol number
std::pair< Ptr< NetDeviceQueueInterface >, QueueDiscVector > NetDeviceInfo
Typedef for queue disc vector.
uint32_t GetDeviceIndex(Ptr< NetDevice > device)
Lookup a given Ptr in the node's list of devices.
a polymophic address class
void SetNode(Ptr< Node > node)
Set node associated with this stack.
QueueDiscVector m_rootQueueDiscs
This vector stores the root queue discs installed on all the devices of the node. ...
std::vector< Ptr< QueueDisc > > QueueDiscVector
Typedef for queue disc vector.
Ptr< NetDevice > device
the NetDevice
std::vector< struct ProtocolHandlerEntry > ProtocolHandlerList
Typedef for protocol handlers container.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
Get the type ID.
virtual void Send(Ptr< NetDevice > device, Ptr< QueueDiscItem > item)
Called from upper layer to queue a packet for the transmission.
Ptr< Node > m_node
The node this TrafficControlLayer object is aggregated to.
TrafficControlLayer & operator=(TrafficControlLayer const &)
Assignment operator Disable default implementation to avoid misuse.
virtual void SetupDevice(Ptr< NetDevice > device)
Perform the operations that the traffic control layer needs to do when an IPv4/v6 interface is added ...
virtual Ptr< QueueDisc > GetRootQueueDiscOnDevice(Ptr< NetDevice > device)
This method can be used to get the root queue disc installed on a device.
Node::ProtocolHandler handler
the protocol handler
std::map< Ptr< NetDevice >, NetDeviceInfo > m_netDeviceQueueToQueueDiscMap
This map plays the role of the qdisc field of the netdev_queue struct in Linux.
A base class which provides memory management and object aggregation.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID for the instance.
virtual void DoDispose(void)
Destructor implementation.
TrafficControlLayer()
Constructor.
a unique identifier for an interface.
void RegisterProtocolHandler(Node::ProtocolHandler handler, uint16_t protocolType, Ptr< NetDevice > device)
Register an IN handler.