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-face.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
25
#ifndef NFD_DAEMON_FACE_TCP_FACE_HPP
26
#define NFD_DAEMON_FACE_TCP_FACE_HPP
27
28
#include "
stream-face.hpp
"
29
30
namespace
nfd
{
31
36
class
TcpFace
:
public
StreamFace
<boost::asio::ip::tcp>
37
{
38
public
:
39
TcpFace
(
const
FaceUri
& remoteUri,
const
FaceUri
& localUri,
40
protocol::socket socket,
bool
isOnDemand);
41
};
42
43
49
class
TcpLocalFace
:
public
StreamFace
<boost::asio::ip::tcp, LocalFace>
50
{
51
public
:
52
TcpLocalFace
(
const
FaceUri
& remoteUri,
const
FaceUri
& localUri,
53
protocol::socket socket,
bool
isOnDemand);
54
};
55
56
59
template
<>
60
struct
StreamFaceValidator
<
TcpLocalFace
::
protocol
,
LocalFace
>
61
{
66
static
void
67
validateSocket
(
const
TcpLocalFace::protocol::socket& socket)
68
{
69
if
(!socket.local_endpoint().address().is_loopback() ||
70
!socket.remote_endpoint().address().is_loopback())
71
{
72
BOOST_THROW_EXCEPTION(
Face::Error
(
"TcpLocalFace can be created only on a loopback "
73
"address"
));
74
}
75
}
76
};
77
78
}
// namespace nfd
79
80
#endif // NFD_DAEMON_FACE_TCP_FACE_HPP
nfd::Face::Error
Face-related error.
Definition:
face.hpp:63
nfd::StreamFace
Definition:
stream-face.hpp:39
nfd::TcpFace::TcpFace
TcpFace(const FaceUri &remoteUri, const FaceUri &localUri, protocol::socket socket, bool isOnDemand)
Definition:
tcp-face.cpp:35
ndn::util::FaceUri
represents the underlying protocol and address used by a Face
Definition:
face-uri.hpp:44
nfd::StreamFaceValidator
Class allowing validation of the StreamFace use.
Definition:
stream-face.hpp:104
nfd::StreamFace< boost::asio::ip::tcp >::protocol
boost::asio::ip::tcp protocol
Definition:
stream-face.hpp:42
nfd::StreamFaceValidator< TcpLocalFace::protocol, LocalFace >::validateSocket
static void validateSocket(const TcpLocalFace::protocol::socket &socket)
Check that local endpoint is loopback.
Definition:
tcp-face.hpp:67
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:38
nfd::TcpLocalFace
TcpLocalFace
Definition:
tcp-face.cpp:31
stream-face.hpp
nfd::LocalFace
represents a face
Definition:
local-face.hpp:40
nfd::TcpLocalFace
Implementation of Face abstraction that uses TCP as underlying transport mechanism and is used for lo...
Definition:
tcp-face.hpp:49
nfd::TcpFace
Implementation of Face abstraction that uses TCP as underlying transport mechanism.
Definition:
tcp-face.hpp:36
ndnSIM
NFD
daemon
face
tcp-face.hpp
Generated on Tue Feb 23 2016 22:18:44 for ndnSIM by
1.8.11