A Discrete-Event Network Simulator
API
qkd-connection-register.h
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 #ifndef QKD_CONNECTION_REGISTER_H
22 #define QKD_CONNECTION_REGISTER_H
23 
24 #include "ns3/event-id.h"
25 #include "ns3/ptr.h"
26 #include "ns3/data-rate.h"
27 #include "ns3/traced-callback.h"
28 #include "ns3/output-stream-wrapper.h"
29 #include "ns3/packet.h"
30 #include "ns3/object.h"
31 #include "ns3/traced-value.h"
32 #include "ns3/trace-source-accessor.h"
33 #include "ns3/node.h"
34 #include "ns3/core-module.h"
35 #include "ns3/log.h"
36 
37 #include "ns3/qkd-key-association-link-entry.h"
38 #include "ns3/qkd-application-entry.h"
39 
40 #include <map>
41 #include <iostream>
42 #include <sstream>
43 
44 namespace ns3 {
45 
46 class QKDKeyAssociationLinkEntry;
47 class QKDApplicationEntry;
48 
61 {
62  public:
63 
68  static TypeId GetTypeId (void);
69 
74  virtual TypeId GetInstanceTypeId (void) const;
75 
80 
86  bool
88 
94  bool
96 
102  bool
104 
110  bool
111  DeleteKeyAssociationLinkEntry (uint32_t dst);
112 
121  bool
123  UUID srcSaeId,
124  UUID dstSaeId,
127  );
128 
135  bool
136  LookupApplication (UUID dstSaeId, QKDApplicationEntry & rt);
137 
144  bool
145  LookupKeyAssociationById (UUID keyAssociationId, QKDKeyAssociationLinkEntry & rt);
146 
152  bool
154 
161  bool
163 
171  bool
173  uint32_t srcNodeId,
174  uint32_t dstNodeId,
176  );
177 
184  bool
186  UUID saeId,
188  );
189 
195  void
196  UpdateQKDApplications(UUID keyAssociationId, UUID saeId);
197 
201  void
203 
208  void
210 
215  uint32_t
217  return m_keyAssociations.size();
218  }
219 
224  uint32_t
226  return m_applications.size();
227  }
228 
239  UUID srcSaeId,
240  UUID dstSaeId,
241  std::string type,
242  uint32_t priority,
244  );
245 
246  private:
247  std::map<uint32_t, QKDKeyAssociationLinkEntry> m_keyAssociations;
248  std::map<UUID, QKDApplicationEntry> m_applications;
249 
250 };
251 
252 
253 
254 } // namespace ns3
255 
256 #endif /* QKD_CONNECTION_REGISTER_H */
257 
A base class which provides memory management and object aggregation.
Definition: object.h:88
Introspection did not find any typical Config paths.
ConnectionType
The connection types.
QKDConnectionRegister is a class used to keep details about distant QKD links and applications.
uint32_t GetNumberOfKeyAssociations()
\briet Get the number of the key associations present in the associations table.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID for the instance.
static TypeId GetTypeId(void)
Get the type ID.
bool LookupKeyAssociationByApplicationId(UUID saeId, QKDKeyAssociationLinkEntry &rt)
Lookup the key association entry with the application identifier (UUID).
void PrintListOfAllKeyAssociations()
Print the key association list.
void Print(Ptr< OutputStreamWrapper > stream) const
Print the location table.
bool AddApplicationEntry(QKDApplicationEntry &r)
Add the QKD application entry if it doesn't yet exist in the table.
uint32_t GetNumberOfApplications()
Get the number of the applications present in the applications table.
bool LookupKeyAssociationByDestinationNodeId(uint32_t srcNodeId, uint32_t dstNodeId, QKDKeyAssociationLinkEntry &rt)
Lookup the key association entry with the source and destination identifiers.
bool LookupKeyAssociationBySaeId(UUID id, QKDKeyAssociationLinkEntry &rt)
Lookup the key association entry with the application identifier (UUID).
std::map< UUID, QKDApplicationEntry > m_applications
The list of applications.
bool SaveKeyAssociation(QKDKeyAssociationLinkEntry &rt)
Store the key association entry.
bool LookupKeyAssociationById(UUID keyAssociationId, QKDKeyAssociationLinkEntry &rt)
Lookup the key association entry with destination node identifier.
bool LookupApplication(UUID dstSaeId, QKDApplicationEntry &rt)
Lookup the application entry with the destination (receiver) application identifier (UUID).
std::map< uint32_t, QKDKeyAssociationLinkEntry > m_keyAssociations
The list of key associations.
bool DeleteKeyAssociationLinkEntry(uint32_t dst)
Delete the key association table entry with a given destination, if it exists.
bool AssignKeyAssociation(UUID srcSaeId, UUID dstSaeId, std::string type, uint32_t priority, QKDKeyAssociationLinkEntry &rt)
Assign the key association.
bool DeleteApplicationEntry(UUID dst)
Delete the application entry, if it exists.
void UpdateQKDApplications(UUID keyAssociationId, UUID saeId)
Update the key association list of QKD applications.
bool LookupApplicationBySaeIDsAndType(UUID srcSaeId, UUID dstSaeId, QKDApplicationEntry::ConnectionType type, QKDApplicationEntry &rt)
Lookup the application entry with the application identifiers and the connection type.
bool AddKeyAssociationEntry(QKDKeyAssociationLinkEntry &r)
Add the key association entry if it doesn't yet exist in the table.
Introspection did not find any typical Config paths.
a unique identifier for an interface.
Definition: type-id.h:59
Universally unique identifier (UUID)
Definition: uuid.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.