NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ndn-global-router.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20
#include "
ndn-global-router.hpp
"
21
22
#include "
model/ndn-l3-protocol.hpp
"
23
24
#include "ns3/channel.h"
25
26
namespace
ns3
{
27
namespace
ndn
{
28
29
uint32_t GlobalRouter::m_idCounter = 0;
30
31
NS_OBJECT_ENSURE_REGISTERED
(GlobalRouter);
32
33
TypeId
34
GlobalRouter::GetTypeId
()
35
{
36
static
TypeId tid = TypeId(
"ns3::ndn::GlobalRouter"
).SetGroupName(
"Ndn"
).SetParent<Object>();
37
return
tid;
38
}
39
40
GlobalRouter::GlobalRouter
()
41
{
42
m_id = m_idCounter;
43
m_idCounter++;
44
}
45
46
void
47
GlobalRouter::NotifyNewAggregate
()
48
{
49
if
(m_ndn == 0) {
50
m_ndn = GetObject<L3Protocol>();
51
}
52
Object::NotifyNewAggregate();
53
}
54
55
uint32_t
56
GlobalRouter::GetId
()
const
57
{
58
return
m_id;
59
}
60
61
Ptr<L3Protocol>
62
GlobalRouter::GetL3Protocol
()
const
63
{
64
return
m_ndn;
65
}
66
67
void
68
GlobalRouter::AddLocalPrefix
(shared_ptr<Name> prefix)
69
{
70
m_localPrefixes.push_back(prefix);
71
}
72
73
void
74
GlobalRouter::AddIncidency
(shared_ptr<Face>
face
, Ptr<GlobalRouter> gr)
75
{
76
m_incidencies.push_back(std::make_tuple(
this
, face, gr));
77
}
78
79
GlobalRouter::IncidencyList
&
80
GlobalRouter::GetIncidencies
()
81
{
82
return
m_incidencies;
83
}
84
85
const
GlobalRouter::LocalPrefixList
&
86
GlobalRouter::GetLocalPrefixes
()
const
87
{
88
return
m_localPrefixes;
89
}
90
91
void
92
GlobalRouter::clear
()
93
{
94
m_idCounter = 0;
95
}
96
97
}
// namespace ndn
98
}
// namespace ns3
ns3::ndn::GlobalRouter::AddLocalPrefix
void AddLocalPrefix(shared_ptr< Name > prefix)
Add new locally exported prefix.
Definition:
ndn-global-router.cpp:68
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ns3::ndn::GlobalRouter::GlobalRouter
GlobalRouter()
Default constructor.
Definition:
ndn-global-router.cpp:40
ns3::ndn::GlobalRouter::LocalPrefixList
std::list< shared_ptr< Name > > LocalPrefixList
List of locally exported prefixes.
Definition:
ndn-global-router.hpp:56
ns3::ndn::NS_OBJECT_ENSURE_REGISTERED
NS_OBJECT_ENSURE_REGISTERED(ContentStore)
ndn-global-router.hpp
ns3::ndn::GlobalRouter::AddIncidency
void AddIncidency(shared_ptr< Face > face, Ptr< GlobalRouter > ndn)
Add edge to the node.
Definition:
ndn-global-router.cpp:74
ns3::ndn::GlobalRouter::NotifyNewAggregate
virtual void NotifyNewAggregate()
Notify when the object is aggregated to another object (e.g., Node)
Definition:
ndn-global-router.cpp:47
ns3::ndn::GlobalRouter::GetId
uint32_t GetId() const
Get numeric ID of the node (internally assigned)
Definition:
ndn-global-router.cpp:56
ns3::ndn::GlobalRouter::IncidencyList
std::list< Incidency > IncidencyList
List of graph edges.
Definition:
ndn-global-router.hpp:52
ns3
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
content-store-impl.cpp:38
ns3::ndn::GlobalRouter::GetIncidencies
IncidencyList & GetIncidencies()
Get list of edges that are connected to this node.
Definition:
ndn-global-router.cpp:80
face
ns3::ndn::GlobalRouter::GetTypeId
static TypeId GetTypeId()
Interface ID.
Definition:
ndn-global-router.cpp:34
ns3::ndn::GlobalRouter::GetL3Protocol
Ptr< L3Protocol > GetL3Protocol() const
Helper function to get smart pointer to ndn::L3Protocol object (basically, self)
Definition:
ndn-global-router.cpp:62
ns3::ndn::GlobalRouter::clear
static void clear()
Clear global state.
Definition:
ndn-global-router.cpp:92
ns3::ndn::GlobalRouter::GetLocalPrefixes
const LocalPrefixList & GetLocalPrefixes() const
Get list of locally exported prefixes.
Definition:
ndn-global-router.cpp:86
ndn-l3-protocol.hpp
ndnSIM
model
ndn-global-router.cpp
Generated on Thu Nov 2 2017 03:30:28 for ndnSIM by
1.8.11