NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-l3-tracer.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20
#include "
ndn-l3-tracer.hpp
"
21
#include "ns3/node.h"
22
#include "ns3/packet.h"
23
#include "ns3/config.h"
24
#include "ns3/names.h"
25
#include "ns3/callback.h"
26
27
#include <boost/lexical_cast.hpp>
28
29
#include "ns3/ndnSIM/model/ndn-l3-protocol.hpp"
30
31
namespace
ns3
{
32
namespace
ndn
{
33
34
L3Tracer::L3Tracer
(Ptr<Node> node)
35
: m_nodePtr(node)
36
{
37
m_node
= boost::lexical_cast<std::string>(
m_nodePtr
->GetId());
38
39
Connect
();
40
41
std::string
name
= Names::FindName(node);
42
if
(!name.empty()) {
43
m_node
= name;
44
}
45
}
46
47
L3Tracer::L3Tracer
(
const
std::string& node)
48
:
m_node
(node)
49
{
50
Connect
();
51
}
52
53
L3Tracer::~L3Tracer
(){};
54
55
void
56
L3Tracer::Connect
()
57
{
58
Ptr<L3Protocol> l3 =
m_nodePtr
->GetObject<
L3Protocol
>();
59
60
l3->TraceConnectWithoutContext(
"OutInterests"
, MakeCallback(&
L3Tracer::OutInterests
,
this
));
61
l3->TraceConnectWithoutContext(
"InInterests"
, MakeCallback(&
L3Tracer::InInterests
,
this
));
62
l3->TraceConnectWithoutContext(
"OutData"
, MakeCallback(&
L3Tracer::OutData
,
this
));
63
l3->TraceConnectWithoutContext(
"InData"
, MakeCallback(&
L3Tracer::InData
,
this
));
64
65
// satisfied/timed out PIs
66
l3->TraceConnectWithoutContext(
"SatisfiedInterests"
,
67
MakeCallback(&
L3Tracer::SatisfiedInterests
,
this
));
68
69
l3->TraceConnectWithoutContext(
"TimedOutInterests"
,
70
MakeCallback(&
L3Tracer::TimedOutInterests
,
this
));
71
}
72
73
}
// namespace ndn
74
}
// namespace ns3
ndn-l3-tracer.hpp
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ns3::ndn::L3Tracer::m_node
std::string m_node
Definition:
ndn-l3-tracer.hpp:103
ns3::ndn::L3Tracer::SatisfiedInterests
virtual void SatisfiedInterests(const nfd::pit::Entry &, const Face &, const Data &)=0
ns3::ndn::L3Tracer::Connect
void Connect()
Definition:
ndn-l3-tracer.cpp:56
ns3::ndn::L3Tracer::~L3Tracer
virtual ~L3Tracer()
Destructor.
Definition:
ndn-l3-tracer.cpp:53
ns3::ndn::L3Tracer::L3Tracer
L3Tracer(Ptr< Node > node)
Trace constructor that attaches to the node using node pointer.
Definition:
ndn-l3-tracer.cpp:34
ns3
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
content-store-impl.cpp:38
ns3::ndn::L3Tracer::OutData
virtual void OutData(const Data &, const Face &)=0
ns3::ndn::L3Tracer::m_nodePtr
Ptr< Node > m_nodePtr
Definition:
ndn-l3-tracer.hpp:104
ns3::ndn::L3Protocol
Implementation network-layer of NDN stack.
Definition:
ndn-l3-protocol.hpp:77
ns3::ndn::L3Tracer::InInterests
virtual void InInterests(const Interest &, const Face &)=0
ns3::ndn::L3Tracer::InData
virtual void InData(const Data &, const Face &)=0
ndn::name
Definition:
name-component.cpp:37
ns3::ndn::L3Tracer::TimedOutInterests
virtual void TimedOutInterests(const nfd::pit::Entry &)=0
ns3::ndn::L3Tracer::OutInterests
virtual void OutInterests(const Interest &, const Face &)=0
ndnSIM
utils
tracers
ndn-l3-tracer.cpp
Generated on Sat Nov 12 2016 16:02:54 for ndnSIM by
1.8.12