NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: 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
:
52
shared_ptr<TcpChannel>
53
createChannel
(
const
tcp::Endpoint
& localEndpoint);
54
63
shared_ptr<TcpChannel>
64
createChannel
(
const
std::string& localIp,
const
std::string& localPort);
65
66
public
:
// from ProtocolFactory
67
virtual
void
68
createFace
(
const
FaceUri
& uri,
69
ndn::nfd::FacePersistency
persistency,
70
bool
wantLocalFieldsEnabled,
71
const
FaceCreatedCallback
& onCreated,
72
const
FaceCreationFailedCallback
& onFailure)
override
;
73
74
virtual
std::vector<shared_ptr<const Channel>>
75
getChannels
()
const override
;
76
77
PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
78
void
79
prohibitEndpoint(
const
tcp::Endpoint
& endpoint);
80
81
void
82
prohibitAllIpv4Endpoints(uint16_t port);
83
84
void
85
prohibitAllIpv6Endpoints(uint16_t port);
86
87
private
:
94
shared_ptr<TcpChannel>
95
findChannel(
const
tcp::Endpoint
& localEndpoint)
const
;
96
97
private
:
98
std::map<tcp::Endpoint, shared_ptr<TcpChannel>> m_channels;
99
100
PUBLIC_WITH_TESTS_ELSE_PRIVATE
:
101
std::set<tcp::Endpoint> m_prohibitedEndpoints;
102
};
103
104
}
// namespace nfd
105
106
#endif // NFD_DAEMON_FACE_TCP_FACTORY_HPP
PUBLIC_WITH_TESTS_ELSE_PRIVATE
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE
Definition:
common.hpp:40
ndn::util::FaceUri
represents the underlying protocol and address used by a Face
Definition:
face-uri.hpp:44
protocol-factory.hpp
ndn::nfd::FacePersistency
FacePersistency
Definition:
nfd-constants.hpp:49
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::createFace
virtual void createFace(const FaceUri &uri, ndn::nfd::FacePersistency persistency, bool wantLocalFieldsEnabled, const FaceCreatedCallback &onCreated, const FaceCreationFailedCallback &onFailure) override
Try to create Face using the supplied FaceUri.
Definition:
tcp-factory.cpp:100
nfd::TcpFactory
Definition:
tcp-factory.hpp:34
nfd::FaceCreationFailedCallback
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when the face fails to be created.
Definition:
channel.hpp:44
tcp-channel.hpp
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
nfd::TcpFactory::getChannels
virtual std::vector< shared_ptr< const Channel > > getChannels() const override
Definition:
tcp-factory.cpp:150
ndnSIM
NFD
daemon
face
tcp-factory.hpp
Generated on Wed Jan 11 2017 18:17:15 for ndnSIM by
1.8.13