NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
nack-header.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013-2017 Regents of the University of California.
4
*
5
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6
*
7
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
8
* terms of the GNU Lesser General Public License as published by the Free Software
9
* Foundation, either version 3 of the License, or (at your option) any later version.
10
*
11
* ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
*
15
* You should have received copies of the GNU General Public License and GNU Lesser
16
* General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17
* <http://www.gnu.org/licenses/>.
18
*
19
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20
*
21
* @author Eric Newberry <enewberry@email.arizona.edu>
22
*/
23
24
#ifndef NDN_CXX_LP_NACK_HEADER_HPP
25
#define NDN_CXX_LP_NACK_HEADER_HPP
26
27
#include "../common.hpp"
28
#include "../encoding/encoding-buffer.hpp"
29
#include "../encoding/block-helpers.hpp"
30
31
#include "
tlv.hpp
"
32
33
namespace
ndn
{
34
namespace
lp
{
35
39
enum class
NackReason
{
40
NONE
= 0,
41
CONGESTION
= 50,
42
DUPLICATE
= 100,
43
NO_ROUTE
= 150
44
};
45
46
std::ostream&
47
operator<<
(std::ostream& os,
NackReason
reason);
48
53
bool
54
isLessSevere
(
lp::NackReason
x,
lp::NackReason
y);
55
59
class
NackHeader
60
{
61
public
:
62
NackHeader
();
63
64
explicit
65
NackHeader
(
const
Block
& block);
66
67
template
<encoding::Tag TAG>
68
size_t
69
wireEncode
(
EncodingImpl<TAG>
& encoder)
const
;
70
71
const
Block
&
72
wireEncode
()
const
;
73
74
void
75
wireDecode
(
const
Block
& wire);
76
77
public
:
// reason
82
NackReason
83
getReason
()
const
;
84
89
NackHeader
&
90
setReason
(
NackReason
reason);
91
92
private
:
93
NackReason
m_reason;
94
mutable
Block
m_wire;
95
};
96
97
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
(
NackHeader
);
98
99
}
// namespace lp
100
}
// namespace ndn
101
102
#endif // NDN_CXX_LP_NACK_HEADER_HPP
ndn::lp::NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(CachePolicy)
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::lp::NackHeader::setReason
NackHeader & setReason(NackReason reason)
set reason code
Definition:
nack-header.cpp:140
ndn::lp::NackHeader::wireEncode
const Block & wireEncode() const
Definition:
nack-header.cpp:86
ndn::lp::NackReason::NO_ROUTE
ndn::Block
Represents a TLV element of NDN packet format.
Definition:
block.hpp:42
ndn::lp::NackHeader::wireDecode
void wireDecode(const Block &wire)
Definition:
nack-header.cpp:104
ndn::lp::NackReason
NackReason
indicates the reason type of a network NACK
Definition:
nack-header.hpp:39
ndn::lp::NackHeader::getReason
NackReason getReason() const
Definition:
nack-header.cpp:127
tlv.hpp
ndn::encoding::EncodingImpl
Definition:
encoding-buffer-fwd.hpp:36
ndn::lp::NackHeader::NackHeader
NackHeader()
Definition:
nack-header.cpp:62
ndn::lp::NackReason::NONE
ndn::lp::NackReason::DUPLICATE
ndn::lp::operator<<
std::ostream & operator<<(std::ostream &os, CachePolicyType policy)
Definition:
cache-policy.cpp:31
ndn::lp
Definition:
cache-policy.cpp:28
ndn::lp::isLessSevere
bool isLessSevere(lp::NackReason x, lp::NackReason y)
compare NackReason for severity
Definition:
nack-header.cpp:50
ndn::lp::NackReason::CONGESTION
ndn::lp::NackHeader
represents a Network NACK header
Definition:
nack-header.hpp:59
ndnSIM
ndn-cxx
src
lp
nack-header.hpp
Generated on Tue Aug 7 2018 16:19:16 for ndnSIM by
1.8.14