NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
33
namespace
nfd
{
34
35
class
TcpFactory
:
public
ProtocolFactory
36
{
37
public
:
41
struct
Error
:
public
ProtocolFactory::Error
42
{
43
Error
(
const
std::string& what) :
ProtocolFactory
::
Error
(what) {}
44
};
45
46
explicit
47
TcpFactory
(
const
std::string& defaultPort =
"6363"
);
48
66
shared_ptr<TcpChannel>
67
createChannel
(
const
tcp::Endpoint
& localEndpoint);
68
77
shared_ptr<TcpChannel>
78
createChannel
(
const
std::string& localIp,
const
std::string& localPort);
79
80
// from ProtocolFactory
81
82
virtual
void
83
createFace
(
const
FaceUri
& uri,
84
ndn::nfd::FacePersistency
persistency,
85
const
FaceCreatedCallback
& onCreated,
86
const
FaceConnectFailedCallback
& onConnectFailed)
DECL_OVERRIDE
;
87
88
virtual
std::list<shared_ptr<const Channel> >
89
getChannels
()
const
;
90
91
PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
92
93
void
94
prohibitEndpoint(
const
tcp::Endpoint
& endpoint);
95
96
void
97
prohibitAllIpv4Endpoints(
const
uint16_t port);
98
99
void
100
prohibitAllIpv6Endpoints(
const
uint16_t port);
101
110
shared_ptr<TcpChannel>
111
findChannel(
const
tcp::Endpoint
& localEndpoint);
112
113
PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
114
typedef
std::map< tcp::Endpoint, shared_ptr<TcpChannel> > ChannelMap;
115
ChannelMap m_channels;
116
117
std::string m_defaultPort;
118
119
std::set<tcp::Endpoint> m_prohibitedEndpoints;
120
};
121
122
}
// namespace nfd
123
124
#endif // NFD_DAEMON_FACE_TCP_FACTORY_HPP
nfd::FaceConnectFailedCallback
function< void(const std::string &reason)> FaceConnectFailedCallback
Prototype for the callback that is called when face is failed to get created.
Definition:
protocol-factory.hpp:47
ndn::util::FaceUri
represents the underlying protocol and address used by a Face
Definition:
face-uri.hpp:44
protocol-factory.hpp
nfd::TcpFactory::Error
Exception of TcpFactory.
Definition:
tcp-factory.hpp:41
DECL_OVERRIDE
#define DECL_OVERRIDE
expands to 'override' if compiler supports this feature, otherwise expands to nothing ...
Definition:
common.hpp:49
nfd::TcpFactory::TcpFactory
TcpFactory(const std::string &defaultPort="6363")
Definition:
tcp-factory.cpp:41
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:38
nfd::ProtocolFactory
Definition:
protocol-factory.hpp:50
nfd::tcp::Endpoint
boost::asio::ip::tcp::endpoint Endpoint
Definition:
tcp-channel.hpp:35
nfd::ProtocolFactory::Error
Base class for all exceptions thrown by channel factories.
Definition:
protocol-factory.hpp:56
ndn::nfd::FacePersistency
FacePersistency
Definition:
nfd-constants.hpp:48
nfd::TcpFactory
Definition:
tcp-factory.hpp:35
nfd::TcpFactory::getChannels
virtual std::list< shared_ptr< const Channel > > getChannels() const
Definition:
tcp-factory.cpp:166
tcp-channel.hpp
nfd::TcpFactory::Error::Error
Error(const std::string &what)
Definition:
tcp-factory.hpp:43
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 called when face is created (as a response to incoming connection or after...
Definition:
protocol-factory.hpp:34
nfd::TcpFactory::createChannel
shared_ptr< TcpChannel > createChannel(const tcp::Endpoint &localEndpoint)
Create TCP-based channel using tcp::Endpoint.
Definition:
tcp-factory.cpp:96
nfd::TcpFactory::createFace
virtual void createFace(const FaceUri &uri, ndn::nfd::FacePersistency persistency, const FaceCreatedCallback &onCreated, const FaceConnectFailedCallback &onConnectFailed) 1
Try to create Face using the supplied FaceUri.
Definition:
tcp-factory.cpp:129
ndnSIM
NFD
daemon
face
tcp-factory.hpp
Generated on Tue Feb 23 2016 22:18:44 for ndnSIM by
1.8.11