13#include "ns3/pointer.h"
14#include "ns3/object-factory.h"
15#include "ns3/drop-tail-queue.h"
29 .AddAttribute(
"MaxSize",
"The maximum number of packets accepted by this queue disc.",
33 .AddAttribute(
"NumberOfQueues",
"The number of priority queues used.",
37 .AddTraceSource(
"EnqueueKMS",
"Enqueue a packet in the queue disc",
39 "ns3::QueueItem::TracedCallback")
40 .AddTraceSource(
"DequeueKMS",
"Dequeue a packet from the queue disc",
42 "ns3::QueueItem::TracedCallback")
43 .AddTraceSource(
"DropKMS",
"Drop a packet from the queue disc",
45 "ns3::QueueItem::TracedCallback")
46 .AddTraceSource(
"PacketsInQueue",
"Number of packets currently stored in the queue disc",
48 "ns3::TracedValueCallback::Uint32")
58 std::vector<QKDKMSQueueEntry>
nv;
76 NS_LOG_LOGIC(
"Queue disc limit exceeded -- dropping packet");
80 std::string
payload =
item.httpMessage.GetMessageBodyString();
A base class which provides memory management and object aggregation.
QKDKMSQueueLogic()
QKDKMSQueueLogic constructor.
TracedCallback< const HTTPMessage > m_traceDequeue
Traced callback: fired when a packet is dequeued.
TracedValue< uint32_t > m_nPackets
Number of packets in the queue.
~QKDKMSQueueLogic() override
TracedCallback< const HTTPMessage > m_traceDroped
Traced callback: fired when a packet is dropped.
bool Enqueue(QKDKMSQueueEntry item)
QKDKMSQueueLogic::QKDKMSQueueEntry Dequeue()
std::vector< std::vector< QKDKMSQueueEntry > > m_queues
static TypeId GetTypeId()
Get the type ID.
uint32_t m_numberOfQueues
TracedCallback< const HTTPMessage > m_traceEnqueue
Traced callback: fired when a packet is enqueued.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)