A Discrete-Event Network Simulator
API
qkd-kms-queue-logic.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2022 DOTFEESA www.tk.etf.unsa.ba
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Miralem Mehic <miralem.mehic@ieee.org>
19  * Emir Dervisevic <emir.dervisevic@etf.unsa.ba>
20  */
21 
22 #ifndef QKD_KMS_QUEUE_LOGIC_H
23 #define QKD_KMS_QUEUE_LOGIC_H
24 
25 #include <queue>
26 #include "ns3/packet.h"
27 #include "ns3/object.h"
28 #include "ns3/http.h"
29 #include "ns3/socket.h"
30 #include "ns3/json.h"
31 
32 namespace ns3 {
33 
34 
58 class QKDKMSQueueLogic: public Object {
59 public:
60 
65  {
66  std::string ksid;
70  };
71 
76  static TypeId GetTypeId (void);
77 
84 
89 
95  bool Enqueue (QKDKMSQueueEntry item);
96 
102 
103 private:
104 
108 
110 
111  uint32_t m_maxSize;
112  uint32_t m_numberOfQueues;
113 
114  std::vector<std::vector<QKDKMSQueueEntry> > m_queues;
115 
116 };
117 
118 } // namespace ns3
119 
120 #endif /* QKD_KMS_QUEUE_LOGIC_H */
The basic class to represent both HTTP requests and responses.
Definition: http.h:78
A base class which provides memory management and object aggregation.
Definition: object.h:89
Linux pfifo_fast is the default priority queue enabled on Linux systems.
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.
TracedCallback< const HTTPMessage > m_traceEnqueue
A trace for the enqueued packet.
static TypeId GetTypeId(void)
Get the type ID.
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
The KMS Queue elements.
std::string ksid
Ptr< Socket > socket
Ptr< Packet > packet
HTTPMessage httpMessage