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
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
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
r
s
t
u
v
w
+
Typedefs
a
b
c
d
e
f
h
i
l
m
n
o
p
q
r
s
t
u
v
Enumerations
+
Enumerator
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
u
v
+
Classes
Class List
Class Index
Class Hierarchy
+
Class 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
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
w
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
+
Enumerator
a
d
e
f
i
k
l
n
p
r
s
u
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
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
u
v
w
+
Functions
c
f
h
m
r
s
u
w
+
Variables
a
c
d
g
k
l
n
p
r
s
Typedefs
+
Macros
b
d
e
f
i
l
m
n
p
r
s
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
l2-tracer.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20
#include "
l2-tracer.hpp
"
21
22
#include "ns3/node.h"
23
#include "ns3/config.h"
24
#include "ns3/names.h"
25
#include "ns3/callback.h"
26
27
#include "ns3/point-to-point-net-device.h"
28
#include "ns3/queue.h"
29
#include <boost/lexical_cast.hpp>
30
31
namespace
ns3
{
32
33
L2Tracer::L2Tracer
(Ptr<Node> node)
34
: m_nodePtr(node)
35
{
36
m_node
= boost::lexical_cast<std::string>(
m_nodePtr
->GetId());
37
38
Connect
();
39
40
std::string
name
= Names::FindName(node);
41
if
(!name.empty()) {
42
m_node
= name;
43
}
44
}
45
46
void
47
L2Tracer::Connect
()
48
{
49
for
(uint32_t devId = 0; devId <
m_nodePtr
->GetNDevices(); devId++) {
50
Ptr<PointToPointNetDevice> p2pnd =
51
DynamicCast<PointToPointNetDevice>(
m_nodePtr
->GetDevice(devId));
52
if
(p2pnd) {
53
p2pnd->GetQueue()->TraceConnectWithoutContext(
"Drop"
, MakeCallback(&
L2Tracer::Drop
,
this
));
54
}
55
}
56
}
57
58
}
// namespace ns3
ns3::L2Tracer::m_nodePtr
Ptr< Node > m_nodePtr
Definition:
l2-tracer.hpp:61
l2-tracer.hpp
ns3::L2Tracer::Connect
void Connect()
Definition:
l2-tracer.cpp:47
ns3::L2Tracer::m_node
std::string m_node
Definition:
l2-tracer.hpp:60
ns3
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
content-store-impl.cpp:38
ns3::L2Tracer::Drop
virtual void Drop(Ptr< const Packet >)=0
ns3::L2Tracer::L2Tracer
L2Tracer(Ptr< Node > node)
Definition:
l2-tracer.cpp:33
ndn::name
Definition:
name-component.cpp:36
ndnSIM
utils
tracers
l2-tracer.cpp
Generated on Wed Jan 11 2017 18:17:16 for ndnSIM by
1.8.13