NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
tcp-factory.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_DAEMON_FACE_TCP_FACTORY_HPP
27
#define NFD_DAEMON_FACE_TCP_FACTORY_HPP
28
29
#include "
protocol-factory.hpp
"
30
#include "
tcp-channel.hpp
"
31
32
namespace
nfd
{
33
34
class
TcpFactory
:
public
ProtocolFactory
35
{
36
public
:
40
class
Error
:
public
ProtocolFactory::Error
41
{
42
public
:
43
explicit
44
Error
(
const
std::string& what)
45
:
ProtocolFactory
::
Error
(what)
46
{
47
}
48
};
49
67
shared_ptr<TcpChannel>
68
createChannel
(
const
tcp::Endpoint
& localEndpoint);
69
78
shared_ptr<TcpChannel>
79
createChannel
(
const
std::string& localIp,
const
std::string& localPort);
80
81
public
:
// from ProtocolFactory
82
virtual
void
83
createFace
(
const
FaceUri
& uri,
84
ndn::nfd::FacePersistency
persistency,
85
const
FaceCreatedCallback
& onCreated,
86
const
FaceCreationFailedCallback
& onConnectFailed)
DECL_OVERRIDE
;
87
88
virtual
std::vector<shared_ptr<const Channel>>
89
getChannels
()
const
DECL_OVERRIDE
;
90
91
PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
92
void
93
prohibitEndpoint(
const
tcp::Endpoint
& endpoint);
94
95
void
96
prohibitAllIpv4Endpoints(uint16_t port);
97
98
void
99
prohibitAllIpv6Endpoints(uint16_t port);
100
101
private
:
108
shared_ptr<TcpChannel>
109
findChannel(
const
tcp::Endpoint
& localEndpoint)
const
;
110
111
private
:
112
std::map<tcp::Endpoint, shared_ptr<TcpChannel>> m_channels;
113
114
PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
115
std::set<tcp::Endpoint> m_prohibitedEndpoints;
116
};
117
118
}
// namespace nfd
119
120
#endif // NFD_DAEMON_FACE_TCP_FACTORY_HPP
nfd::FaceCreationFailedCallback
function< void(const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when the face fails to be created.
Definition:
channel.hpp:44
nfd::ProtocolFactory::Error
Base class for all exceptions thrown by protocol factories.
Definition:
protocol-factory.hpp:43
ndn::util::FaceUri
represents the underlying protocol and address used by a Face
Definition:
face-uri.hpp:44
nfd::TcpFactory::Error
Exception of TcpFactory.
Definition:
tcp-factory.hpp:40
protocol-factory.hpp
DECL_OVERRIDE
#define DECL_OVERRIDE
expands to 'override' if compiler supports 'override' specifier, otherwise expands to nothing ...
Definition:
common.hpp:50
nfd::TcpFactory::createFace
virtual void createFace(const FaceUri &uri, ndn::nfd::FacePersistency persistency, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onConnectFailed) 1
Try to create Face using the supplied FaceUri.
Definition:
tcp-factory.cpp:100
ndn::nfd::FacePersistency
FacePersistency
Definition:
nfd-constants.hpp:49
nfd::TcpFactory::getChannels
virtual std::vector< shared_ptr< const Channel > > getChannels() const 1
Definition:
tcp-factory.cpp:133
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
nfd::ProtocolFactory
Abstract base class for all protocol factories.
Definition:
protocol-factory.hpp:37
nfd::tcp::Endpoint
boost::asio::ip::tcp::endpoint Endpoint
Definition:
tcp-channel.hpp:35
nfd::TcpFactory
Definition:
tcp-factory.hpp:34
nfd::TcpFactory::Error::Error
Error(const std::string &what)
Definition:
tcp-factory.hpp:44
tcp-channel.hpp
PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:39
nfd::FaceCreatedCallback
function< void(const shared_ptr< Face > &newFace)> FaceCreatedCallback
Prototype for the callback that is invoked when the face is created (as a response to incoming connec...
Definition:
channel.hpp:38
nfd::TcpFactory::createChannel
shared_ptr< TcpChannel > createChannel(const tcp::Endpoint &localEndpoint)
Create TCP-based channel using tcp::Endpoint.
Definition:
tcp-factory.cpp:77
ndnSIM
NFD
daemon
face
tcp-factory.hpp
Generated on Sat Nov 12 2016 16:02:54 for ndnSIM by
1.8.12