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
nfd-fib-entry.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#ifndef NDN_MANAGEMENT_NFD_FIB_ENTRY_HPP
23
#define NDN_MANAGEMENT_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_MANAGEMENT_NFD_FIB_ENTRY_HPP
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::nfd::NextHopRecord::setFaceId
NextHopRecord & setFaceId(uint64_t faceId)
Definition:
nfd-fib-entry.cpp:59
ndn::nfd::NextHopRecord::Error
Definition:
nfd-fib-entry.hpp:37
ndn::nfd::NextHopRecord
Definition:
nfd-fib-entry.hpp:34
ndn::Block
Class representing a wire element of NDN-TLV packet format.
Definition:
block.hpp:43
ndn::nfd::NextHopRecord::wireEncode
const Block & wireEncode() const
Definition:
nfd-fib-entry.cpp:99
ndn::nfd::FibEntry::getPrefix
const Name & getPrefix() const
Definition:
nfd-fib-entry.hpp:108
ndn::nfd::NextHopRecord::wireDecode
void wireDecode(const Block &wire)
Definition:
nfd-fib-entry.cpp:116
ndn::nfd::NextHopRecord::getCost
uint64_t getCost() const
Definition:
nfd-fib-entry.hpp:62
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:38
ndn::nfd::FibEntry::Error
Definition:
nfd-fib-entry.hpp:92
ndn::nfd::NextHopRecord::Error::Error
Error(const std::string &what)
Definition:
nfd-fib-entry.hpp:41
ndn::tlv::nfd::FibEntry
Definition:
tlv-nfd.hpp:81
ndn::nfd::FibEntry::getNextHopRecords
const std::list< NextHopRecord > & getNextHopRecords() const
Definition:
nfd-fib-entry.hpp:117
ndn::nfd::NextHopRecord::setCost
NextHopRecord & setCost(uint64_t cost)
Definition:
nfd-fib-entry.cpp:67
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
ndn::nfd::NextHopRecord::NextHopRecord
NextHopRecord()
Definition:
nfd-fib-entry.cpp:47
ndn::nfd::FibEntry
Definition:
nfd-fib-entry.hpp:89
ndn::nfd::FibEntry::Error::Error
Error(const std::string &what)
Definition:
nfd-fib-entry.hpp:96
ndn::nfd::NextHopRecord::getFaceId
uint64_t getFaceId() const
Definition:
nfd-fib-entry.hpp:53
ndn::nfd::FibEntry::setNextHopRecords
FibEntry & setNextHopRecords(const T &begin, const T &end)
Definition:
nfd-fib-entry.hpp:127
ndn::tlv::Error
represents an error in TLV encoding or decoding
Definition:
tlv.hpp:50
ndnSIM
ndn-cxx
src
management
nfd-fib-entry.hpp
Generated on Tue Feb 23 2016 22:18:43 for ndnSIM by
1.8.11