A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
qkd-application-entry.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2020 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: Emir Dervisevic <emir.dervisevic@etf.unsa.ba>
19
* Miralem Mehic <miralem.mehic@ieee.org>
20
*/
21
#include "ns3/log.h"
22
#include "ns3/address.h"
23
#include "ns3/node.h"
24
#include "ns3/nstime.h"
25
#include "ns3/simulator.h"
26
#include "ns3/uinteger.h"
27
#include "ns3/trace-source-accessor.h"
28
#include <iostream>
29
#include <fstream>
30
#include <string>
31
32
#include "ns3/qkd-application-entry.h"
33
34
namespace
ns3
{
35
36
NS_LOG_COMPONENT_DEFINE
(
"QKDApplicationEntry"
);
37
38
NS_OBJECT_ENSURE_REGISTERED
(QKDApplicationEntry);
39
40
TypeId
41
QKDApplicationEntry::GetTypeId
(
void
)
42
{
43
static
TypeId
tid =
TypeId
(
"ns3::QKDApplicationEntry"
)
44
.
SetParent
<
Object
> ()
45
.SetGroupName (
"QKDApplicationEntry"
)
46
.AddConstructor<
QKDApplicationEntry
> ()
47
;
48
return
tid;
49
}
50
51
TypeId
52
QKDApplicationEntry::GetInstanceTypeId
(
void
)
const
53
{
54
return
GetTypeId
();
55
}
56
57
QKDApplicationEntry::QKDApplicationEntry
(){
58
m_valid
=
false
;
59
}
60
61
QKDApplicationEntry::QKDApplicationEntry
(
62
UUID
keyAssociationId,
63
UUID
srcSaeId,
64
UUID
dstSaeId,
65
ConnectionType
type,
66
uint32_t priority,
67
double
expirationTime,
68
Ipv4Address
srcKMSAddress,
69
Ipv4Address
dstKMSAddress
70
)
71
: m_app_type (type),
72
m_client_app_id (srcSaeId),
73
m_server_app_id (dstSaeId),
74
m_backing_qkdl_id (keyAssociationId),
75
m_app_priority (priority),
76
m_expiration_time (expirationTime),
77
m_kmsSrcAddress(srcKMSAddress),
78
m_kmsDstAddress(dstKMSAddress)
79
{
80
m_app_id
=
UUID::Random
();
81
m_valid
=
true
;
82
NS_LOG_FUNCTION
(
this
83
<<
"CREATE NEW QKD APPLICATION ENTRY!"
84
<<
m_valid
85
<<
m_app_id
86
<<
m_backing_qkdl_id
87
<<
m_client_app_id
88
<<
m_server_app_id
89
<<
m_app_type
90
<<
m_app_priority
91
<<
m_expiration_time
92
<<
m_kmsSrcAddress
93
<<
m_kmsDstAddress
94
);
95
}
96
97
QKDApplicationEntry::~QKDApplicationEntry
()
98
{
99
}
100
101
void
102
QKDApplicationEntry::PrintRegistryInfo
()
103
{
104
NS_LOG_FUNCTION
(
this
105
<<
m_valid
106
<<
m_app_id
107
<<
m_backing_qkdl_id
108
<<
m_client_app_id
109
<<
m_server_app_id
110
<<
m_app_type
111
<<
m_app_priority
112
<<
m_expiration_time
113
<<
m_kmsSrcAddress
114
<<
m_kmsDstAddress
115
);
116
}
117
118
void
119
QKDApplicationEntry::Print
(
Ptr<OutputStreamWrapper>
stream)
const
120
{
121
*stream->
GetStream
()
122
<<
m_valid
<<
"\t"
123
<<
m_app_id
<<
"\t"
124
<<
m_backing_qkdl_id
<<
"\t"
125
<<
m_client_app_id
<<
"\t"
126
<<
m_server_app_id
<<
"\t"
127
<<
m_app_type
<<
"\t"
128
<<
m_app_priority
<<
"\t"
129
<<
m_expiration_time
<<
"\t"
130
<<
m_kmsSrcAddress
<<
"\t"
131
<<
m_kmsDstAddress
<<
"\n"
132
;
133
}
134
135
}
// namespace ns3
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition:
ipv4-address.h:41
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:88
ns3::OutputStreamWrapper::GetStream
std::ostream * GetStream(void)
Return a pointer to an ostream previously set in the wrapper.
Definition:
output-stream-wrapper.cc:58
ns3::Ptr< OutputStreamWrapper >
ns3::QKDApplicationEntry
Introspection did not find any typical Config paths.
Definition:
qkd-application-entry.h:78
ns3::QKDApplicationEntry::PrintRegistryInfo
void PrintRegistryInfo()
Print the registry information.
Definition:
qkd-application-entry.cc:102
ns3::QKDApplicationEntry::m_kmsSrcAddress
Ipv4Address m_kmsSrcAddress
Definition:
qkd-application-entry.h:236
ns3::QKDApplicationEntry::ConnectionType
ConnectionType
The connection types.
Definition:
qkd-application-entry.h:85
ns3::QKDApplicationEntry::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
qkd-application-entry.cc:41
ns3::QKDApplicationEntry::m_expiration_time
double m_expiration_time
Definition:
qkd-application-entry.h:233
ns3::QKDApplicationEntry::m_app_priority
uint32_t m_app_priority
Definition:
qkd-application-entry.h:231
ns3::QKDApplicationEntry::m_valid
bool m_valid
Definition:
qkd-application-entry.h:235
ns3::QKDApplicationEntry::m_backing_qkdl_id
UUID m_backing_qkdl_id
Definition:
qkd-application-entry.h:228
ns3::QKDApplicationEntry::m_app_id
UUID m_app_id
Definition:
qkd-application-entry.h:218
ns3::QKDApplicationEntry::Print
void Print(Ptr< OutputStreamWrapper > stream) const
Print the routing table entry.
Definition:
qkd-application-entry.cc:119
ns3::QKDApplicationEntry::m_kmsDstAddress
Ipv4Address m_kmsDstAddress
Definition:
qkd-application-entry.h:237
ns3::QKDApplicationEntry::m_server_app_id
UUID m_server_app_id
Definition:
qkd-application-entry.h:227
ns3::QKDApplicationEntry::m_app_type
QKDApplicationEntry::ConnectionType m_app_type
Definition:
qkd-application-entry.h:225
ns3::QKDApplicationEntry::GetInstanceTypeId
virtual TypeId GetInstanceTypeId(void) const
Get the type ID for the instance.
Definition:
qkd-application-entry.cc:52
ns3::QKDApplicationEntry::m_client_app_id
UUID m_client_app_id
Definition:
qkd-application-entry.h:226
ns3::QKDApplicationEntry::~QKDApplicationEntry
~QKDApplicationEntry()
Destructor.
Definition:
qkd-application-entry.cc:97
ns3::QKDApplicationEntry::QKDApplicationEntry
QKDApplicationEntry()
Empty constructor.
Definition:
qkd-application-entry.cc:57
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:922
ns3::UUID
Universally unique identifier (UUID)
Definition:
uuid.h:35
ns3::UUID::Random
static UUID Random()
Generate random UUID4 (randomly or pseudo-randomly generated version)
Definition:
uuid.cc:148
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition:
log.h:205
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition:
log-macros-enabled.h:244
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:45
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
qkd
model
qkd-application-entry.cc
Generated on Tue Feb 6 2024 19:21:26 for ns-3 by
1.9.1