NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
fib-entry.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#ifndef NDN_MGMT_NFD_FIB_ENTRY_HPP
23
#define NDN_MGMT_NFD_FIB_ENTRY_HPP
24
25
#include "../../encoding/block.hpp"
26
#include "../../name.hpp"
27
#include <list>
28
29
namespace
ndn
{
30
namespace
nfd
{
31
34
class
NextHopRecord
35
{
36
public
:
37
class
Error
:
public
tlv::Error
38
{
39
public
:
40
explicit
41
Error
(
const
std::string& what)
42
: tlv::
Error
(what)
43
{
44
}
45
};
46
47
NextHopRecord
();
48
49
explicit
50
NextHopRecord
(
const
Block
& block);
51
52
uint64_t
53
getFaceId
()
const
54
{
55
return
m_faceId;
56
}
57
58
NextHopRecord
&
59
setFaceId
(uint64_t faceId);
60
61
uint64_t
62
getCost
()
const
63
{
64
return
m_cost;
65
}
66
67
NextHopRecord
&
68
setCost
(uint64_t cost);
69
70
template
<encoding::Tag TAG>
71
size_t
72
wireEncode
(
EncodingImpl<TAG>
& block)
const
;
73
74
const
Block
&
75
wireEncode
()
const
;
76
77
void
78
wireDecode
(
const
Block
& wire);
79
80
private
:
81
uint64_t m_faceId;
82
uint64_t m_cost;
83
84
mutable
Block
m_wire;
85
};
86
89
class
FibEntry
90
{
91
public
:
92
class
Error
:
public
tlv::Error
93
{
94
public
:
95
explicit
96
Error
(
const
std::string& what)
97
: tlv::
Error
(what)
98
{
99
}
100
};
101
102
FibEntry
();
103
104
explicit
105
FibEntry
(
const
Block
& block);
106
107
const
Name
&
108
getPrefix
()
const
109
{
110
return
m_prefix;
111
}
112
113
FibEntry
&
114
setPrefix(
const
Name
& prefix);
115
116
const
std::list<NextHopRecord>&
117
getNextHopRecords
()
const
118
{
119
return
m_nextHopRecords;
120
}
121
122
FibEntry
&
123
addNextHopRecord(
const
NextHopRecord
& nextHopRecord);
124
125
template
<
typename
T>
126
FibEntry
&
127
setNextHopRecords
(
const
T& begin,
const
T& end)
128
{
129
m_nextHopRecords.clear();
130
m_nextHopRecords.assign(begin, end);
131
m_wire.reset();
132
return
*
this
;
133
}
134
135
template
<encoding::Tag TAG>
136
size_t
137
wireEncode
(
EncodingImpl<TAG>
& block)
const
;
138
139
const
Block
&
140
wireEncode
()
const
;
141
142
void
143
wireDecode
(
const
Block
& wire);
144
145
private
:
146
Name
m_prefix;
147
std::list<NextHopRecord> m_nextHopRecords;
148
149
mutable
Block
m_wire;
150
};
151
152
}
// namespace nfd
153
}
// namespace ndn
154
155
#endif // NDN_MGMT_NFD_FIB_ENTRY_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::nfd::FibEntry::getNextHopRecords
const std::list< NextHopRecord > & getNextHopRecords() const
Definition:
fib-entry.hpp:117
ndn::nfd::NextHopRecord::setFaceId
NextHopRecord & setFaceId(uint64_t faceId)
Definition:
fib-entry.cpp:59
ndn::nfd::NextHopRecord::Error
Definition:
fib-entry.hpp:37
ndn::nfd::NextHopRecord
Definition:
fib-entry.hpp:34
ndn::Block
Class representing a wire element of NDN-TLV packet format.
Definition:
block.hpp:43
ndn::nfd::NextHopRecord::getCost
uint64_t getCost() const
Definition:
fib-entry.hpp:62
ndn::nfd::NextHopRecord::wireDecode
void wireDecode(const Block &wire)
Definition:
fib-entry.cpp:116
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
ndn::nfd::FibEntry::Error
Definition:
fib-entry.hpp:92
ndn::nfd::NextHopRecord::Error::Error
Error(const std::string &what)
Definition:
fib-entry.hpp:41
ndn::nfd::NextHopRecord::setCost
NextHopRecord & setCost(uint64_t cost)
Definition:
fib-entry.cpp:67
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
ndn::encoding::EncodingImpl
Definition:
encoding-buffer-fwd.hpp:45
ndn::nfd::NextHopRecord::NextHopRecord
NextHopRecord()
Definition:
fib-entry.cpp:47
ndn::nfd::FibEntry
Definition:
fib-entry.hpp:89
ndn::tlv::nfd::FibEntry
Definition:
tlv-nfd.hpp:84
ndn::nfd::FibEntry::Error::Error
Error(const std::string &what)
Definition:
fib-entry.hpp:96
ndn::nfd::FibEntry::getPrefix
const Name & getPrefix() const
Definition:
fib-entry.hpp:108
ndn::nfd::NextHopRecord::getFaceId
uint64_t getFaceId() const
Definition:
fib-entry.hpp:53
ndn::nfd::FibEntry::setNextHopRecords
FibEntry & setNextHopRecords(const T &begin, const T &end)
Definition:
fib-entry.hpp:127
ndn::tlv::Error
represents an error in TLV encoding or decoding
Definition:
tlv.hpp:50
ndn::nfd::NextHopRecord::wireEncode
const Block & wireEncode() const
Definition:
fib-entry.cpp:99
ndnSIM
ndn-cxx
src
mgmt
nfd
fib-entry.hpp
Generated on Wed Jan 11 2017 18:17:15 for ndnSIM by
1.8.13