NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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)
DECL_OVERRIDE
;
63
64
protected
:
65
virtual
void
66
beforeChangePersistency(
ndn::nfd::FacePersistency
newPersistency)
DECL_OVERRIDE
;
67
68
virtual
void
69
doClose()
DECL_OVERRIDE
;
70
71
private
:
72
virtual
void
73
doSend(
Packet
&& packet)
DECL_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)
DECL_OVERRIDE
;
97
98
virtual
void
99
close
() DECL_OVERRIDE
100
{
101
}
102
103
virtual
void
104
pause
() DECL_OVERRIDE
105
{
106
}
107
108
virtual
void
109
resume
() DECL_OVERRIDE
110
{
111
}
112
113
virtual
void
114
send(
const
Block
& wire)
DECL_OVERRIDE
;
115
116
virtual
void
117
send(
const
Block
& header,
const
Block
& payload)
DECL_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
nfd::face::InternalClientTransport::pause
virtual void pause() 1
Definition:
internal-transport.hpp:104
ndn::nfd::LinkType
LinkType
Definition:
nfd-constants.hpp:67
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:71
nfd::face::Transport::Packet
stores a packet along with the remote endpoint
Definition:
transport.hpp:113
NFD_LOG_INCLASS_DECLARE
#define NFD_LOG_INCLASS_DECLARE()
Definition:
logger.hpp:36
ndn::Block
Class representing a wire element of NDN-TLV packet format.
Definition:
block.hpp:43
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
DECL_OVERRIDE
#define DECL_OVERRIDE
expands to 'override' if compiler supports 'override' specifier, otherwise expands to nothing ...
Definition:
common.hpp:50
nfd::face::InternalTransportBase
abstracts a transport that can be paired with another
Definition:
internal-transport.hpp:37
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
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
nfd::face::InternalClientTransport::close
virtual void close() 1
Close the connection.
Definition:
internal-transport.hpp:99
DECLARE_SIGNAL_EMIT
#define DECLARE_SIGNAL_EMIT(signalName)
(implementation detail) declares a 'emit_signalName' method
Definition:
signal-emit.hpp:59
ndn::Transport
Definition:
transport.hpp:39
ndn::nfd::FACE_SCOPE_LOCAL
face is local
Definition:
nfd-constants.hpp:41
transport.hpp
nfd::face::InternalClientTransport::resume
virtual void resume() 1
Definition:
internal-transport.hpp:109
nfd::face::Transport
the lower part of a Face
Definition:
transport.hpp:104
ndnSIM
NFD
daemon
face
internal-transport.hpp
Generated on Sat Nov 12 2016 16:02:53 for ndnSIM by
1.8.12