NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
internal-transport.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_DAEMON_FACE_INTERNAL_TRANSPORT_HPP
27
#define NFD_DAEMON_FACE_INTERNAL_TRANSPORT_HPP
28
29
#include "
transport.hpp
"
30
#include <ndn-cxx/transport/transport.hpp>
31
32
namespace
nfd
{
33
namespace
face
{
34
37
class
InternalTransportBase
38
{
39
public
:
42
virtual
void
43
receiveFromLink
(
const
Block
& packet) = 0;
44
45
signal::Signal<InternalTransportBase, Block>
afterSend
;
46
47
protected
:
48
DECLARE_SIGNAL_EMIT
(afterSend)
49
};
50
53
class
InternalForwarderTransport
:
public
face::Transport
,
public
InternalTransportBase
54
{
55
public
:
56
InternalForwarderTransport
(
const
FaceUri
& localUri =
FaceUri
(
"internal://"
),
57
const
FaceUri
& remoteUri =
FaceUri
(
"internal://"
),
58
ndn::nfd::FaceScope
scope =
ndn::nfd::FACE_SCOPE_LOCAL
,
59
ndn::nfd::LinkType
linkType =
ndn::nfd::LINK_TYPE_POINT_TO_POINT
);
60
61
virtual
void
62
receiveFromLink
(
const
Block
& packet)
override
;
63
64
protected
:
65
virtual
void
66
beforeChangePersistency(
ndn::nfd::FacePersistency
newPersistency)
override
;
67
68
virtual
void
69
doClose()
override
;
70
71
private
:
72
virtual
void
73
doSend(
Packet
&& packet)
override
;
74
75
private
:
76
NFD_LOG_INCLASS_DECLARE
();
77
};
78
81
class
InternalClientTransport
:
public
ndn::Transport
,
public
InternalTransportBase
82
{
83
public
:
92
void
93
connectToForwarder(
InternalForwarderTransport
* forwarderTransport);
94
95
virtual
void
96
receiveFromLink
(
const
Block
& packet)
override
;
97
98
virtual
void
99
close
()
override
100
{
101
}
102
103
virtual
void
104
pause
()
override
105
{
106
}
107
108
virtual
void
109
resume
()
override
110
{
111
}
112
113
virtual
void
114
send(
const
Block
& wire)
override
;
115
116
virtual
void
117
send(
const
Block
& header,
const
Block
& payload)
override
;
118
119
private
:
120
NFD_LOG_INCLASS_DECLARE
();
121
122
signal::ScopedConnection
m_fwToClientTransmitConn;
123
signal::ScopedConnection
m_clientToFwTransmitConn;
124
signal::ScopedConnection
m_fwTransportStateConn;
125
};
126
127
}
// namespace face
128
}
// namespace nfd
129
130
#endif // NFD_DAEMON_FACE_INTERNAL_TRANSPORT_HPP
nfd::face::InternalClientTransport
implements a client-side transport that can be paired with another
Definition:
internal-transport.hpp:81
ndn::nfd::LinkType
LinkType
Definition:
nfd-constants.hpp:75
NFD_LOG_INCLASS_DECLARE
#define NFD_LOG_INCLASS_DECLARE()
Definition:
logger.hpp:36
ndn::util::FaceUri
represents the underlying protocol and address used by a Face
Definition:
face-uri.hpp:44
nfd::face::InternalTransportBase::afterSend
signal::Signal< InternalTransportBase, Block > afterSend
Definition:
internal-transport.hpp:45
ndn::nfd::LINK_TYPE_POINT_TO_POINT
link is point-to-point
Definition:
nfd-constants.hpp:79
nfd::face::Transport::Packet
stores a packet along with the remote endpoint
Definition:
transport.hpp:113
ndn::Block
Class representing a wire element of NDN-TLV packet format.
Definition:
block.hpp:43
nfd::face::InternalForwarderTransport
InternalForwarderTransport
Definition:
internal-transport.cpp:32
nfd::face::InternalTransportBase::receiveFromLink
virtual void receiveFromLink(const Block &packet)=0
causes the transport to receive a link-layer packet
ndn::util::signal::Signal
provides a lightweight signal / event system
Definition:
signal-signal.hpp:50
nfd::face::InternalTransportBase
abstracts a transport that can be paired with another
Definition:
internal-transport.hpp:37
nfd::face::InternalClientTransport::close
virtual void close() override
Close the connection.
Definition:
internal-transport.hpp:99
ndn::nfd::FacePersistency
FacePersistency
Definition:
nfd-constants.hpp:49
ndn::nfd::FaceScope
FaceScope
Definition:
nfd-constants.hpp:34
nfd::face::InternalForwarderTransport
implements a forwarder-side transport that can be paired with another
Definition:
internal-transport.hpp:53
nfd::face::InternalClientTransport::pause
virtual void pause() override
pause the transport
Definition:
internal-transport.hpp:104
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
ndn::util::signal::ScopedConnection
disconnects a Connection automatically upon destruction
Definition:
signal-scoped-connection.hpp:33
face
DECLARE_SIGNAL_EMIT
#define DECLARE_SIGNAL_EMIT(signalName)
(implementation detail) declares a 'emit_signalName' method
Definition:
signal-emit.hpp:59
ndn::Transport
provides TLV-block delivery service
Definition:
transport.hpp:40
nfd::face::InternalClientTransport::resume
virtual void resume() override
resume the transport
Definition:
internal-transport.hpp:109
ndn::nfd::FACE_SCOPE_LOCAL
face is local
Definition:
nfd-constants.hpp:41
transport.hpp
nfd::face::Transport
the lower part of a Face
Definition:
transport.hpp:104
ndnSIM
NFD
daemon
face
internal-transport.hpp
Generated on Wed Jan 11 2017 18:17:15 for ndnSIM by
1.8.13