NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
channel.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2014-2018, Regents of the University of California,
4
* Arizona Board of Regents,
5
* Colorado State University,
6
* University Pierre & Marie Curie, Sorbonne University,
7
* Washington University in St. Louis,
8
* Beijing Institute of Technology,
9
* The University of Memphis.
10
*
11
* This file is part of NFD (Named Data Networking Forwarding Daemon).
12
* See AUTHORS.md for complete list of NFD authors and contributors.
13
*
14
* NFD is free software: you can redistribute it and/or modify it under the terms
15
* of the GNU General Public License as published by the Free Software Foundation,
16
* either version 3 of the License, or (at your option) any later version.
17
*
18
* NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20
* PURPOSE. See the GNU General Public License for more details.
21
*
22
* You should have received a copy of the GNU General Public License along with
23
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
24
*/
25
26
#ifndef NFD_DAEMON_FACE_CHANNEL_HPP
27
#define NFD_DAEMON_FACE_CHANNEL_HPP
28
29
#include "
channel-log.hpp
"
30
#include "
face.hpp
"
31
32
#include <boost/logic/tribool.hpp>
33
34
namespace
nfd
{
35
namespace
face
{
36
40
using
FaceCreatedCallback
= function<void(const shared_ptr<Face>&
face
)>;
41
44
using
FaceCreationFailedCallback
= function<void(uint32_t status, const std::string& reason)>;
45
52
class
Channel
: noncopyable
53
{
54
public
:
55
virtual
56
~Channel
();
57
58
const
FaceUri
&
59
getUri
()
const
60
{
61
return
m_uri;
62
}
63
66
virtual
bool
67
isListening
()
const
= 0;
68
71
virtual
size_t
72
size
()
const
= 0;
73
74
protected
:
75
void
76
setUri
(
const
FaceUri
& uri);
77
78
private
:
79
FaceUri
m_uri;
80
};
81
87
class
FaceParams
88
{
89
public
:
90
// get rid of this constructor and use aggregate init + NSDMIs when we switch to C++14
91
FaceParams
() noexcept
92
:
persistency
(
ndn
::
nfd
::
FACE_PERSISTENCY_PERSISTENT
)
93
,
wantLocalFields
(false)
94
,
wantLpReliability
(false)
95
,
wantCongestionMarking
(
boost
::logic::indeterminate)
96
{
97
}
98
99
public
:
100
ndn::nfd::FacePersistency
persistency
;
101
ndn::optional<time::nanoseconds>
baseCongestionMarkingInterval
;
102
ndn::optional<uint64_t>
defaultCongestionThreshold
;
103
bool
wantLocalFields
;
104
bool
wantLpReliability
;
105
boost::logic::tribool
wantCongestionMarking
;
106
};
107
115
void
116
connectFaceClosedSignal
(
Face
&
face
,
const
std::function<
void
()>& f);
117
118
}
// namespace face
119
}
// namespace nfd
120
121
#endif // NFD_DAEMON_FACE_CHANNEL_HPP
face.hpp
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
nfd::face::Channel::setUri
void setUri(const FaceUri &uri)
Definition:
channel.cpp:34
nfd::face::Channel
represent a channel that communicates on a local endpoint
Definition:
channel.hpp:52
boost
Definition:
ndn-content-store.hpp:209
nfd::face::Face
generalization of a network interface
Definition:
face.hpp:67
nfd::face::FaceCreatedCallback
function< void(const shared_ptr< Face > &face)> FaceCreatedCallback
Prototype for the callback that is invoked when a face is created (in response to an incoming connect...
Definition:
channel.hpp:40
nfd::face::Channel::size
virtual size_t size() const =0
Returns the number of faces in the channel.
nfd::face::FaceParams::wantLocalFields
bool wantLocalFields
Definition:
channel.hpp:103
channel-log.hpp
nfd::face::FaceParams::wantLpReliability
bool wantLpReliability
Definition:
channel.hpp:104
ndn::optional< time::nanoseconds >
nfd::face::FaceCreationFailedCallback
function< void(uint32_t status, const std::string &reason)> FaceCreationFailedCallback
Prototype for the callback that is invoked when a face fails to be created.
Definition:
channel.hpp:44
nfd::face::Channel::~Channel
virtual ~Channel()
nfd::face::connectFaceClosedSignal
void connectFaceClosedSignal(Face &face, const std::function< void()> &f)
invokes a callback when the face is closed
Definition:
channel.cpp:40
nfd::face::Channel::isListening
virtual bool isListening() const =0
Returns whether the channel is listening.
ndn::nfd::FacePersistency
FacePersistency
Definition:
nfd-constants.hpp:45
nfd::face::FaceParams
Parameters used to set Transport properties or LinkService options on a newly created face...
Definition:
channel.hpp:87
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
nfd::face::Channel::getUri
const FaceUri & getUri() const
Definition:
channel.hpp:59
nfd::face::FaceParams::FaceParams
FaceParams() noexcept
Definition:
channel.hpp:91
face
nfd::face::FaceParams::persistency
ndn::nfd::FacePersistency persistency
Definition:
channel.hpp:100
nfd::face::FaceParams::defaultCongestionThreshold
ndn::optional< uint64_t > defaultCongestionThreshold
Definition:
channel.hpp:102
ndn::FaceUri
represents the underlying protocol and address used by a Face
Definition:
face-uri.hpp:44
nfd::face::FaceParams::baseCongestionMarkingInterval
ndn::optional< time::nanoseconds > baseCongestionMarkingInterval
Definition:
channel.hpp:101
nfd::face::FaceParams::wantCongestionMarking
boost::logic::tribool wantCongestionMarking
Definition:
channel.hpp:105
ndn::nfd::FACE_PERSISTENCY_PERSISTENT
face is persistent
Definition:
nfd-constants.hpp:47
ndnSIM
NFD
daemon
face
channel.hpp
Generated on Sun Feb 25 2018 13:27:05 for ndnSIM by
1.8.14