A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
qkd-location-register-entry.cc
Go to the documentation of this file.
1
/*
2
* Copyright(c) 2020 DOTFEESA www.tk.etf.unsa.ba
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
*
7
*
8
* Author: Emir Dervisevic <emir.dervisevic@etf.unsa.ba>
9
* Miralem Mehic <miralem.mehic@ieee.org>
10
*/
11
#include "ns3/log.h"
12
#include "ns3/address.h"
13
#include "ns3/node.h"
14
#include "ns3/nstime.h"
15
#include "ns3/simulator.h"
16
#include "ns3/uinteger.h"
17
#include "ns3/trace-source-accessor.h"
18
#include <iostream>
19
#include <fstream>
20
#include <string>
21
22
#include "
qkd-location-register-entry.h
"
23
24
namespace
ns3
{
25
26
NS_LOG_COMPONENT_DEFINE
(
"QKDLocationRegisterEntry"
);
27
28
NS_OBJECT_ENSURE_REGISTERED
(QKDLocationRegisterEntry);
29
30
TypeId
31
QKDLocationRegisterEntry::GetTypeId
()
32
{
33
static
TypeId
tid =
TypeId
(
"ns3::QKDLocationRegisterEntry"
)
34
.
SetParent
<
Object
>()
35
.SetGroupName(
"QKDLocationRegisterEntry"
)
36
.AddConstructor<
QKDLocationRegisterEntry
>()
37
;
38
return
tid;
39
}
40
41
TypeId
42
QKDLocationRegisterEntry::GetInstanceTypeId
()
const
43
{
44
return
GetTypeId
();
45
}
46
47
QKDLocationRegisterEntry::QKDLocationRegisterEntry
(){
48
49
}
50
51
QKDLocationRegisterEntry::QKDLocationRegisterEntry
(
52
uint32_t
nextHopKmNodeId
,
53
Ipv4Address
nextHopKmNodeAddress
,
54
uint32_t
hops
,
55
uint32_t
dstKmNodeId
,
56
Ipv4Address
dstKmAddress
,
57
std::string
dstKmId
58
)
59
: m_nextHop(
nextHopKmNodeId
),
60
m_nextHopAddress(
nextHopKmNodeAddress
),
61
m_hops(
hops
),
62
m_dstKmNodeId(
dstKmNodeId
),
63
m_dstAddress(
dstKmAddress
),
64
m_dstKmId(
dstKmId
)
65
{
66
NS_LOG_FUNCTION
(
this
<<
nextHopKmNodeId
<<
hops
<<
dstKmNodeId
);
67
}
68
69
std::string
70
QKDLocationRegisterEntry::GetKmId
()
71
{
72
return
m_dstKmId
;
73
}
74
75
QKDLocationRegisterEntry::~QKDLocationRegisterEntry
()
76
{
77
}
78
79
void
80
QKDLocationRegisterEntry::PrintRegistryInfo
()
81
{
82
NS_LOG_FUNCTION
(
this
<<
m_srcAppId
<<
m_dstAppId
<<
m_nextHop
<<
m_hops
<<
m_dstKmNodeId
<<
m_dstAddress
);
83
}
84
85
void
86
QKDLocationRegisterEntry::Print
(
Ptr<OutputStreamWrapper>
stream)
const
87
{
88
*stream->GetStream() <<
GetSourceAppId
() <<
"\t\t"
89
<<
GetRemoteAppId
() <<
"\t\t"
90
<<
GetNextHop
() <<
"\n"
;
91
}
92
93
}
// namespace ns3
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition
ipv4-address.h:31
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:66
ns3::QKDLocationRegisterEntry
Introspection did not find any typical Config paths.
Definition
qkd-location-register-entry.h:48
ns3::QKDLocationRegisterEntry::m_dstAddress
Ipv4Address m_dstAddress
Definition
qkd-location-register-entry.h:172
ns3::QKDLocationRegisterEntry::m_srcAppId
std::string m_srcAppId
Definition
qkd-location-register-entry.h:166
ns3::QKDLocationRegisterEntry::QKDLocationRegisterEntry
QKDLocationRegisterEntry()
Definition
qkd-location-register-entry.cc:47
ns3::QKDLocationRegisterEntry::GetSourceAppId
std::string GetSourceAppId() const
Definition
qkd-location-register-entry.h:83
ns3::QKDLocationRegisterEntry::~QKDLocationRegisterEntry
~QKDLocationRegisterEntry() override
Definition
qkd-location-register-entry.cc:75
ns3::QKDLocationRegisterEntry::Print
void Print(Ptr< OutputStreamWrapper > stream) const
Print routing table entry.
Definition
qkd-location-register-entry.cc:86
ns3::QKDLocationRegisterEntry::m_dstKmNodeId
uint32_t m_dstKmNodeId
Definition
qkd-location-register-entry.h:171
ns3::QKDLocationRegisterEntry::m_dstAppId
std::string m_dstAppId
Definition
qkd-location-register-entry.h:167
ns3::QKDLocationRegisterEntry::GetNextHop
uint32_t GetNextHop() const
Get next hop.
Definition
qkd-location-register-entry.h:122
ns3::QKDLocationRegisterEntry::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
qkd-location-register-entry.cc:31
ns3::QKDLocationRegisterEntry::PrintRegistryInfo
void PrintRegistryInfo()
Print registry info.
Definition
qkd-location-register-entry.cc:80
ns3::QKDLocationRegisterEntry::GetKmId
std::string GetKmId()
Definition
qkd-location-register-entry.cc:70
ns3::QKDLocationRegisterEntry::m_dstKmId
std::string m_dstKmId
Definition
qkd-location-register-entry.h:173
ns3::QKDLocationRegisterEntry::GetRemoteAppId
std::string GetRemoteAppId() const
Definition
qkd-location-register-entry.h:77
ns3::QKDLocationRegisterEntry::m_nextHop
uint32_t m_nextHop
Definition
qkd-location-register-entry.h:168
ns3::QKDLocationRegisterEntry::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the type ID for the instance.
Definition
qkd-location-register-entry.cc:42
ns3::QKDLocationRegisterEntry::m_hops
uint32_t m_hops
Definition
qkd-location-register-entry.h:170
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
uint32_t
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
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:229
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition
object-base.h:35
ns3::Create
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition
ptr.h:436
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
qkd-location-register-entry.h
src
qkd
model
qkd-location-register-entry.cc
Generated on Mon Dec 15 2025 15:22:03 for ns-3 by
1.9.8