A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
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
64
struct
QKDKMSQueueEntry
65
{
66
std::string
ksid
;
67
Ptr<Socket>
socket
;
68
HTTPMessage
httpMessage
;
69
Ptr<Packet>
packet
;
70
};
71
76
static
TypeId
GetTypeId
(
void
);
77
83
QKDKMSQueueLogic
();
84
88
~QKDKMSQueueLogic
();
89
95
bool
Enqueue
(
QKDKMSQueueEntry
item);
96
101
QKDKMSQueueLogic::QKDKMSQueueEntry
Dequeue
(
void
);
102
103
private
:
104
105
TracedCallback<const HTTPMessage >
m_traceEnqueue
;
106
TracedCallback<const HTTPMessage >
m_traceDequeue
;
107
TracedCallback<const HTTPMessage >
m_traceDroped
;
108
109
TracedValue<uint32_t>
m_nPackets
;
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 */
ns3::HTTPMessage
The basic class to represent both HTTP requests and responses.
Definition:
http.h:78
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr< Socket >
ns3::QKDKMSQueueLogic
Linux pfifo_fast is the default priority queue enabled on Linux systems.
Definition:
qkd-kms-queue-logic.h:58
ns3::QKDKMSQueueLogic::QKDKMSQueueLogic
QKDKMSQueueLogic()
Constructor.
Definition:
qkd-kms-queue-logic.cc:63
ns3::QKDKMSQueueLogic::m_traceDequeue
TracedCallback< const HTTPMessage > m_traceDequeue
A trace for the dequeue packet.
Definition:
qkd-kms-queue-logic.h:106
ns3::QKDKMSQueueLogic::m_nPackets
TracedValue< uint32_t > m_nPackets
The number of packets in the queue.
Definition:
qkd-kms-queue-logic.h:109
ns3::QKDKMSQueueLogic::m_traceDroped
TracedCallback< const HTTPMessage > m_traceDroped
A trace for the dropped packet.
Definition:
qkd-kms-queue-logic.h:107
ns3::QKDKMSQueueLogic::Enqueue
bool Enqueue(QKDKMSQueueEntry item)
Add the element to the queue.
Definition:
qkd-kms-queue-logic.cc:79
ns3::QKDKMSQueueLogic::m_maxSize
uint32_t m_maxSize
The queue size.
Definition:
qkd-kms-queue-logic.h:111
ns3::QKDKMSQueueLogic::m_queues
std::vector< std::vector< QKDKMSQueueEntry > > m_queues
A list of queues.
Definition:
qkd-kms-queue-logic.h:114
ns3::QKDKMSQueueLogic::Dequeue
QKDKMSQueueLogic::QKDKMSQueueEntry Dequeue(void)
Pop the element from the queue.
Definition:
qkd-kms-queue-logic.cc:124
ns3::QKDKMSQueueLogic::m_numberOfQueues
uint32_t m_numberOfQueues
The number of queues.
Definition:
qkd-kms-queue-logic.h:112
ns3::QKDKMSQueueLogic::~QKDKMSQueueLogic
~QKDKMSQueueLogic()
Destructor.
Definition:
qkd-kms-queue-logic.cc:73
ns3::QKDKMSQueueLogic::m_traceEnqueue
TracedCallback< const HTTPMessage > m_traceEnqueue
A trace for the enqueued packet.
Definition:
qkd-kms-queue-logic.h:105
ns3::QKDKMSQueueLogic::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
qkd-kms-queue-logic.cc:34
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition:
traced-callback.h:54
ns3::TracedValue< uint32_t >
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::QKDKMSQueueLogic::QKDKMSQueueEntry
The KMS Queue elements.
Definition:
qkd-kms-queue-logic.h:65
ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::ksid
std::string ksid
Definition:
qkd-kms-queue-logic.h:66
ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::socket
Ptr< Socket > socket
Definition:
qkd-kms-queue-logic.h:67
ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::packet
Ptr< Packet > packet
Definition:
qkd-kms-queue-logic.h:69
ns3::QKDKMSQueueLogic::QKDKMSQueueEntry::httpMessage
HTTPMessage httpMessage
Definition:
qkd-kms-queue-logic.h:68
src
applications
model
qkd-kms-queue-logic.h
Generated on Sun Mar 3 2024 17:10:54 for ns-3 by
1.9.1