NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
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
#include "
model/ndn-face.hpp
"
24
25
#include "ns3/channel.h"
26
27
namespace
ns3 {
28
namespace
ndn {
29
30
uint32_t GlobalRouter::m_idCounter = 0;
31
32
NS_OBJECT_ENSURE_REGISTERED
(GlobalRouter);
33
34
TypeId
35
GlobalRouter::GetTypeId
()
36
{
37
static
TypeId tid = TypeId(
"ns3::ndn::GlobalRouter"
).SetGroupName(
"Ndn"
).SetParent<Object>();
38
return
tid;
39
}
40
41
GlobalRouter::GlobalRouter
()
42
{
43
m_id = m_idCounter;
44
m_idCounter++;
45
}
46
47
void
48
GlobalRouter::NotifyNewAggregate
()
49
{
50
if
(m_ndn == 0) {
51
m_ndn = GetObject<L3Protocol>();
52
}
53
Object::NotifyNewAggregate();
54
}
55
56
uint32_t
57
GlobalRouter::GetId
()
const
58
{
59
return
m_id;
60
}
61
62
Ptr<L3Protocol>
63
GlobalRouter::GetL3Protocol
()
const
64
{
65
return
m_ndn;
66
}
67
68
void
69
GlobalRouter::AddLocalPrefix
(shared_ptr<Name> prefix)
70
{
71
m_localPrefixes.push_back(prefix);
72
}
73
74
void
75
GlobalRouter::AddIncidency
(shared_ptr<Face> face, Ptr<GlobalRouter> gr)
76
{
77
m_incidencies.push_back(std::make_tuple(
this
, face, gr));
78
}
79
80
GlobalRouter::IncidencyList
&
81
GlobalRouter::GetIncidencies
()
82
{
83
return
m_incidencies;
84
}
85
86
const
GlobalRouter::LocalPrefixList
&
87
GlobalRouter::GetLocalPrefixes
()
const
88
{
89
return
m_localPrefixes;
90
}
91
92
// void
93
// GlobalRouter::AddIncidencyChannel (Ptr< NdnFace > face, Ptr< Channel > channel)
94
// {
95
// m_incidenciesChannel.push_back (make_tuple (face, channel));
96
// }
97
98
}
// namespace ndn
99
}
// namespace ns3
ns3::ndn::GlobalRouter::AddLocalPrefix
void AddLocalPrefix(shared_ptr< Name > prefix)
Add new locally exported prefix.
Definition:
ndn-global-router.cpp:69
ns3::ndn::GlobalRouter::GlobalRouter
GlobalRouter()
Default constructor.
Definition:
ndn-global-router.cpp:41
ns3::ndn::GlobalRouter::LocalPrefixList
std::list< shared_ptr< Name > > LocalPrefixList
List of locally exported prefixes.
Definition:
ndn-global-router.hpp:57
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:75
ns3::ndn::GlobalRouter::NotifyNewAggregate
virtual void NotifyNewAggregate()
Notify when the object is aggregated to another object (e.g., Node)
Definition:
ndn-global-router.cpp:48
ns3::ndn::GlobalRouter::GetId
uint32_t GetId() const
Get numeric ID of the node (internally assigned)
Definition:
ndn-global-router.cpp:57
ns3::ndn::GlobalRouter::IncidencyList
std::list< Incidency > IncidencyList
List of graph edges.
Definition:
ndn-global-router.hpp:53
ns3::ndn::GlobalRouter::GetIncidencies
IncidencyList & GetIncidencies()
Get list of edges that are connected to this node.
Definition:
ndn-global-router.cpp:81
ns3::ndn::GlobalRouter::GetTypeId
static TypeId GetTypeId()
Interface ID.
Definition:
ndn-global-router.cpp:35
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:63
ndn-face.hpp
ns3::ndn::GlobalRouter::GetLocalPrefixes
const LocalPrefixList & GetLocalPrefixes() const
Get list of locally exported prefixes.
Definition:
ndn-global-router.cpp:87
ndn-l3-protocol.hpp
ndnSIM
model
ndn-global-router.cpp
Generated on Wed Feb 18 2015 16:31:16 for ndnSIM by
1.8.7