12#include "ns3/address.h"
14#include "ns3/nstime.h"
15#include "ns3/simulator.h"
16#include "ns3/uinteger.h"
17#include "ns3/trace-source-accessor.h"
36 .SetGroupName(
"QKDLocationRegister")
71 if(
m_id ==
rt.GetDestinationKmNodeId() &&
m_id ==
rt.GetNextHopKMNodeId())
74 std::pair<std::map<uint32_t, QKDLocationRegisterEntry>::iterator,
bool> result =
m_locationEntites.insert(
75 std::make_pair(
rt.GetDestinationKmNodeId(),
rt)
127 allRoutes.insert(std::make_pair(
i->first,
i->second));
133 std::map<uint32_t, QKDLocationRegisterEntry> &
unreachable)
139 if(
i->second.GetNextHop() == nextHop)
154 std::vector< std::pair<uint32_t, uint32_t> >
159 std::vector<std::pair<uint32_t, uint32_t> >
dist;
169 dist[start] = std::make_pair(100, start);
173 if(
el.first >
dist.size()){
203 std::pair<uint32_t, uint32_t>,
204 std::vector< std::pair<uint32_t, uint32_t> >,
205 std::greater<std::pair<uint32_t, uint32_t> >
212 std::pair<uint32_t, uint32_t>
pZero = std::make_pair(start,
startZero);
277 el.second->ClearRoutingTable();
280 std::vector<std::pair<uint32_t, uint32_t> >
dist;
290 std::vector<uint32_t> path;
296 if(
el2.first == 0 &&
el2.second == 0) {
324 uint32_t nextHop = path[path.size()-1];
Ipv4 addresses are stored in host order in this class.
uint32_t GetNApplications() const
Ptr< Application > GetApplication(uint32_t index) const
Retrieve the index-th Application associated to this node.
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
QKDNetSim implements Key Management System(KMS) as an application that listens on TCP port 80.
Introspection did not find any typical Config paths.
QKDLocationRegister is a class used to keep details about distant QKD nodes and their connectivity.
void GetListOfDestinationWithNextHop(uint32_t nxtHp, std::map< uint32_t, QKDLocationRegisterEntry > &dstList)
Lookup list of addresses for which nxtHp is the next Hop address.
bool Lookup(uint32_t dstSaeId, QKDLocationRegisterEntry &rt)
Lookup location table entry with destination address dst.
std::map< uint32_t, QKDLocationRegisterEntry > m_locationEntites
std::map< uint32_t, Ptr< QKDControl > > m_controllers
void SetAddress(Ipv4Address addr)
bool AddEntry(QKDLocationRegisterEntry &r)
Add location table entry if it doesn't yet exist in location table.
TypeId GetInstanceTypeId() const override
Get the type ID for the instance.
QKDLocationRegister()
c-tor
bool DeleteEntry(uint32_t dst)
Delete location table entry with destination address dst, if it exists.
std::vector< std::pair< uint32_t, uint32_t > > DijkstraSP(uint32_t start)
std::vector< std::pair< uint32_t, uint32_t > > m_adjList
void PopulateRoutingTables()
void SetNode(Ptr< Node > n)
bool LookupByKms(Ipv4Address dstKmsId, QKDLocationRegisterEntry &rt)
Lookup location table entry with destination address dst KMS Id @Ipv4Address destination KMS Ipv4Addr...
static TypeId GetTypeId()
Get the type ID.
void GetListOfAllEntries(std::map< uint32_t, QKDLocationRegisterEntry > &allRoutes)
Lookup list of all addresses in the location table.
uint32_t GetSize()
Provides the number of routes present in that nodes location table.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.