NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
face-common.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2014-2020, 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_FACE_COMMON_HPP
27
#define NFD_DAEMON_FACE_FACE_COMMON_HPP
28
29
#include "
core/common.hpp
"
30
#include "
common/logger.hpp
"
31
32
#include <
ndn-cxx/encoding/nfd-constants.hpp
>
33
34
#include <boost/logic/tribool.hpp>
35
36
namespace
nfd
{
37
namespace
face {
38
39
class
Face
;
40
class
LinkService
;
41
44
using
FaceId
= uint64_t;
45
47
const
FaceId
INVALID_FACEID
=
ndn::nfd::INVALID_FACE_ID
;
49
const
FaceId
FACEID_INTERNAL_FACE
= 1;
51
const
FaceId
FACEID_CONTENT_STORE
= 254;
53
const
FaceId
FACEID_NULL
= 255;
55
const
FaceId
FACEID_RESERVED_MAX
= 255;
56
61
const
ssize_t
MIN_MTU
= 64;
62
71
using
EndpointId
= uint64_t;
72
78
struct
FaceParams
79
{
80
ndn::nfd::FacePersistency
persistency
=
ndn::nfd::FACE_PERSISTENCY_PERSISTENT
;
81
optional<time::nanoseconds>
baseCongestionMarkingInterval
;
82
optional<uint64_t>
defaultCongestionThreshold
;
83
optional<ssize_t>
mtu
;
84
bool
wantLocalFields
=
false
;
85
bool
wantLpReliability
=
false
;
86
boost::logic::tribool
wantCongestionMarking
= boost::logic::indeterminate;
87
};
88
97
template
<
typename
T>
98
class
FaceLogHelper
99
{
100
public
:
101
explicit
102
FaceLogHelper
(
const
T& obj1) noexcept
103
: obj(obj1)
104
{
105
}
106
107
public
:
108
const
T&
obj
;
109
};
110
111
}
// namespace face
112
113
using
face::EndpointId
;
114
using
face::FaceId
;
115
116
}
// namespace nfd
117
128
// implementation detail
129
#define NFD_LOG_FACE(level, msg) NFD_LOG_##level( \
130
::nfd::face::FaceLogHelper< \
131
typename std::remove_cv< \
132
typename std::remove_reference<decltype(*this)>::type \
133
>::type \
134
>(*this) \
135
<< msg)
136
139
#define NFD_LOG_FACE_TRACE(msg) NFD_LOG_FACE(TRACE, msg)
140
142
#define NFD_LOG_FACE_DEBUG(msg) NFD_LOG_FACE(DEBUG, msg)
143
145
#define NFD_LOG_FACE_INFO(msg) NFD_LOG_FACE(INFO, msg)
146
148
#define NFD_LOG_FACE_WARN(msg) NFD_LOG_FACE(WARN, msg)
149
151
#define NFD_LOG_FACE_ERROR(msg) NFD_LOG_FACE(ERROR, msg)
152
155
#endif // NFD_DAEMON_FACE_FACE_COMMON_HPP
nfd::face::FaceParams::defaultCongestionThreshold
optional< uint64_t > defaultCongestionThreshold
Definition:
face-common.hpp:82
nfd::face::FaceParams::wantCongestionMarking
boost::logic::tribool wantCongestionMarking
Definition:
face-common.hpp:86
nfd::face::LinkService
LinkService
Definition:
link-service.cpp:32
nfd::face::FACEID_INTERNAL_FACE
const FaceId FACEID_INTERNAL_FACE
identifies the InternalFace used in management
Definition:
face-common.hpp:49
nfd::face::FaceParams::persistency
ndn::nfd::FacePersistency persistency
Definition:
face-common.hpp:80
nfd::face::EndpointId
uint64_t EndpointId
Identifies a remote endpoint on the link.
Definition:
face-common.hpp:71
common.hpp
nfd-constants.hpp
ndn::nfd::FacePersistency
FacePersistency
Definition:
nfd-constants.hpp:45
Face
ndn Face
Definition:
face-impl.hpp:42
nfd::face::FaceParams::mtu
optional< ssize_t > mtu
Definition:
face-common.hpp:83
nfd::face::FaceParams::baseCongestionMarkingInterval
optional< time::nanoseconds > baseCongestionMarkingInterval
Definition:
face-common.hpp:81
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:39
nfd::face::FACEID_RESERVED_MAX
const FaceId FACEID_RESERVED_MAX
upper bound of reserved FaceIds
Definition:
face-common.hpp:55
logger.hpp
nfd::face::FaceParams::wantLocalFields
bool wantLocalFields
Definition:
face-common.hpp:84
nfd::face::FaceLogHelper::obj
const T & obj
Definition:
face-common.hpp:108
nfd::face::MIN_MTU
const ssize_t MIN_MTU
Minimum MTU that may be set.
Definition:
face-common.hpp:61
nfd::face::FaceLogHelper
For internal use by FaceLogging macros.
Definition:
face-common.hpp:98
nfd::face::FACEID_NULL
const FaceId FACEID_NULL
identifies the NullFace that drops every packet
Definition:
face-common.hpp:53
nfd::face::FACEID_CONTENT_STORE
const FaceId FACEID_CONTENT_STORE
identifies a packet comes from the ContentStore
Definition:
face-common.hpp:51
nfd::face::FaceId
uint64_t FaceId
Identifies a face.
Definition:
face-common.hpp:44
nfd::face::INVALID_FACEID
const FaceId INVALID_FACEID
indicates an invalid FaceId
Definition:
face-common.hpp:47
nfd::face::FaceLogHelper::FaceLogHelper
FaceLogHelper(const T &obj1) noexcept
Definition:
face-common.hpp:102
ndn::nfd::FACE_PERSISTENCY_PERSISTENT
face is persistent
Definition:
nfd-constants.hpp:47
nfd::face::FaceParams::wantLpReliability
bool wantLpReliability
Definition:
face-common.hpp:85
ndn::nfd::INVALID_FACE_ID
const uint64_t INVALID_FACE_ID
Definition:
nfd-constants.hpp:30
nfd::face::FaceParams
Parameters used to set Transport properties or LinkService options on a newly created face...
Definition:
face-common.hpp:78
ndnSIM
NFD
daemon
face
face-common.hpp
Generated on Fri May 6 2022 12:34:13 for ndnSIM by
1.8.13