23 #include "ns3/pointer.h"
24 #include "ns3/object-factory.h"
25 #include "ns3/drop-tail-queue.h"
26 #include "ns3/qkd-kms-queue-logic.h"
38 .AddConstructor<QKDKMSQueueLogic> ()
39 .AddAttribute (
"MaxSize",
"The maximum number of packets accepted by this queue disc.",
42 MakeUintegerChecker<uint32_t> ())
43 .AddAttribute (
"NumberOfQueues",
"The number of priority queues used.",
46 MakeUintegerChecker<uint32_t> ())
47 .AddTraceSource (
"EnqueueKMS",
"Enqueue a packet in the queue disc",
49 "ns3::QueueItem::TracedCallback")
50 .AddTraceSource (
"DequeueKMS",
"Dequeue a packet from the queue disc",
52 "ns3::QueueItem::TracedCallback")
53 .AddTraceSource (
"DropKMS",
"Drop a packet from the queue disc",
55 "ns3::QueueItem::TracedCallback")
56 .AddTraceSource (
"PacketsInQueue",
"Number of packets currently stored in the queue disc",
58 "ns3::TracedValueCallback::Uint32")
68 std::vector<QKDKMSQueueEntry> nv;
86 NS_LOG_LOGIC (
"Queue disc limit exceeded -- dropping packet");
93 if(payload.length() > 0){
95 jOpenConnectRequest = nlohmann::json::parse(payload);
101 uint32_t priority = 0;
102 if (jOpenConnectRequest.contains(
"QoS")) {
103 if (jOpenConnectRequest[
"QoS"].contains(
"priority")){
104 priority = jOpenConnectRequest[
"QoS"][
"priority"];
std::string GetMessageBodyString()
A base class which provides memory management and object aggregation.
QKDKMSQueueLogic()
Constructor.
TracedCallback< const HTTPMessage > m_traceDequeue
A trace for the dequeue packet.
TracedValue< uint32_t > m_nPackets
The number of packets in the queue.
TracedCallback< const HTTPMessage > m_traceDroped
A trace for the dropped packet.
bool Enqueue(QKDKMSQueueEntry item)
Add the element to the queue.
uint32_t m_maxSize
The queue size.
std::vector< std::vector< QKDKMSQueueEntry > > m_queues
A list of queues.
QKDKMSQueueLogic::QKDKMSQueueEntry Dequeue(void)
Pop the element from the queue.
uint32_t m_numberOfQueues
The number of queues.
~QKDKMSQueueLogic()
Destructor.
TracedCallback< const HTTPMessage > m_traceEnqueue
A trace for the enqueued packet.
static TypeId GetTypeId(void)
Get the type ID.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#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< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
basic_json<> json
default JSON class
Every class exported by the ns3 library is enclosed in the ns3 namespace.