NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
p
q
r
s
t
u
v
w
+
Typedefs
a
b
c
d
e
f
h
i
k
l
n
o
p
q
r
s
t
u
v
+
Enumerations
a
b
c
d
f
i
k
l
n
p
q
r
s
t
u
+
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
~
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
+
Enumerations
_
a
c
e
i
r
s
t
v
+
Enumerator
a
c
d
e
f
i
k
l
m
n
p
r
s
u
v
w
+
Related Functions
b
c
d
e
f
g
i
k
l
m
n
o
p
s
v
+
Files
File List
+
File Members
+
All
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
+
Functions
c
f
h
m
r
s
u
w
+
Variables
a
c
d
f
g
i
k
l
m
n
p
r
s
t
Typedefs
+
Macros
a
d
e
f
i
l
m
n
o
p
r
s
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
ndn-app-link-service.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20
#include "
ndn-app-link-service.hpp
"
21
22
#include "ns3/log.h"
23
#include "ns3/packet.h"
24
#include "ns3/node.h"
25
#include "ns3/assert.h"
26
#include "ns3/simulator.h"
27
28
#include "
apps/ndn-app.hpp
"
29
30
NS_LOG_COMPONENT_DEFINE(
"ndn.AppLinkService"
);
31
32
namespace
ns3
{
33
namespace
ndn
{
34
35
AppLinkService::AppLinkService
(Ptr<App> app)
36
: m_node(app->GetNode())
37
, m_app(app)
38
{
39
NS_LOG_FUNCTION(
this
<< app);
40
41
NS_ASSERT(m_app != 0);
42
}
43
44
AppLinkService::~AppLinkService
()
45
{
46
NS_LOG_FUNCTION_NOARGS();
47
}
48
49
void
50
AppLinkService::doSendInterest(
const
Interest
& interest)
51
{
52
NS_LOG_FUNCTION(
this
<< &interest);
53
54
// to decouple callbacks
55
Simulator::ScheduleNow(&
App::OnInterest
, m_app, interest.shared_from_this());
56
}
57
58
void
59
AppLinkService::doSendData(
const
Data
& data)
60
{
61
NS_LOG_FUNCTION(
this
<< &data);
62
63
// to decouple callbacks
64
Simulator::ScheduleNow(&
App::OnData
, m_app, data.shared_from_this());
65
}
66
67
void
68
AppLinkService::doSendNack(
const
lp::Nack
& nack)
69
{
70
NS_LOG_FUNCTION(
this
<< &nack);
71
72
// to decouple callbacks
73
Simulator::ScheduleNow(&
App::OnNack
, m_app, make_shared<lp::Nack>(nack));
74
}
75
76
//
77
78
void
79
AppLinkService::onReceiveInterest
(
const
Interest
& interest)
80
{
81
this->
receiveInterest
(interest);
82
}
83
84
void
85
AppLinkService::onReceiveData
(
const
Data
& data)
86
{
87
this->
receiveData
(data);
88
}
89
90
void
91
AppLinkService::onReceiveNack
(
const
lp::Nack
& nack)
92
{
93
this->
receiveNack
(nack);
94
}
95
96
}
// namespace ndn
97
}
// namespace ns3
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ns3::ndn::AppLinkService::onReceiveInterest
void onReceiveInterest(const Interest &interest)
Definition:
ndn-app-link-service.cpp:79
ns3::ndn::AppLinkService::onReceiveData
void onReceiveData(const Data &data)
Definition:
ndn-app-link-service.cpp:85
ndn::lp::Nack
represents a Network Nack
Definition:
nack.hpp:38
ndn-app-link-service.hpp
ndn-app.hpp
ns3::ndn::AppLinkService::AppLinkService
AppLinkService(Ptr< App > app)
Default constructor.
Definition:
ndn-app-link-service.cpp:35
ns3::ndn::App::OnInterest
virtual void OnInterest(shared_ptr< const Interest > interest)
Method that will be called every time new Interest arrives.
Definition:
ndn-app.cpp:114
ns3::ndn::App::OnNack
virtual void OnNack(shared_ptr< const lp::Nack > nack)
Method that will be called every time new Nack arrives.
Definition:
ndn-app.cpp:128
ns3::ndn::AppLinkService::onReceiveNack
void onReceiveNack(const lp::Nack &nack)
Definition:
ndn-app-link-service.cpp:91
nfd::face::LinkService::receiveNack
void receiveNack(const lp::Nack &nack)
delivers received Nack to forwarding
Definition:
link-service.cpp:114
ns3
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
content-store-impl.cpp:38
ndn::tlv::Data
Definition:
tlv.hpp:63
ndn::tlv::Interest
Definition:
tlv.hpp:62
nfd::face::LinkService::receiveData
void receiveData(const Data &data)
delivers received Data to forwarding
Definition:
link-service.cpp:104
ns3::ndn::App::OnData
virtual void OnData(shared_ptr< const Data > data)
Method that will be called every time new Data arrives.
Definition:
ndn-app.cpp:121
nfd::face::LinkService::receiveInterest
void receiveInterest(const Interest &interest)
delivers received Interest to forwarding
Definition:
link-service.cpp:94
ns3::ndn::AppLinkService::~AppLinkService
virtual ~AppLinkService()
Definition:
ndn-app-link-service.cpp:44
ndnSIM
model
ndn-app-link-service.cpp
Generated on Sun Feb 24 2019 22:16:05 for ndnSIM by
1.8.15