A Discrete-Event Network Simulator
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
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
53  {
54  return GetTypeId ();
55  }
56 
58  m_valid = false;
59  }
60 
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  {
81  m_valid = true;
82  NS_LOG_FUNCTION(this
83  << "CREATE NEW QKD APPLICATION ENTRY!"
84  << m_valid
85  << m_app_id
87  << m_client_app_id
88  << m_server_app_id
89  << m_app_type
94  );
95  }
96 
98  {
99  }
100 
101  void
103  {
104  NS_LOG_FUNCTION(this
105  << m_valid
106  << m_app_id
108  << m_client_app_id
109  << m_server_app_id
110  << m_app_type
111  << m_app_priority
113  << m_kmsSrcAddress
114  << m_kmsDstAddress
115  );
116  }
117 
118  void
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
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
A base class which provides memory management and object aggregation.
Definition: object.h:88
std::ostream * GetStream(void)
Return a pointer to an ostream previously set in the wrapper.
Introspection did not find any typical Config paths.
void PrintRegistryInfo()
Print the registry information.
Ipv4Address m_kmsSrcAddress
ConnectionType
The connection types.
static TypeId GetTypeId(void)
Get the type ID.
double m_expiration_time
uint32_t m_app_priority
bool m_valid
UUID m_backing_qkdl_id
UUID m_app_id
void Print(Ptr< OutputStreamWrapper > stream) const
Print the routing table entry.
Ipv4Address m_kmsDstAddress
UUID m_server_app_id
QKDApplicationEntry::ConnectionType m_app_type
virtual TypeId GetInstanceTypeId(void) const
Get the type ID for the instance.
UUID m_client_app_id
~QKDApplicationEntry()
Destructor.
QKDApplicationEntry()
Empty constructor.
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:922
Universally unique identifier (UUID)
Definition: uuid.h:35
static UUID Random()
Generate random UUID4 (randomly or pseudo-randomly generated version)
Definition: uuid.cc:148
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
#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.
Definition: object-base.h:45
Every class exported by the ns3 library is enclosed in the ns3 namespace.