Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2011 University of California, Los Angeles |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | * |
| 18 | * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
| 19 | */ |
| 20 | |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 21 | #ifndef _NDN_FIB_ENTRY_H_ |
| 22 | #define _NDN_FIB_ENTRY_H_ |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 23 | |
| 24 | #include "ns3/ptr.h" |
| 25 | #include "ns3/nstime.h" |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 26 | #include "ns3/ndn-face.h" |
Alexander Afanasyev | cfdc14f | 2013-03-15 14:38:44 -0700 | [diff] [blame] | 27 | #include "ns3/ndn-name.h" |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 28 | #include "ns3/ndn-limits.h" |
Alexander Afanasyev | e6dc0ac | 2013-02-21 14:00:48 -0800 | [diff] [blame] | 29 | #include "ns3/traced-value.h" |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 30 | |
| 31 | #include <boost/multi_index_container.hpp> |
| 32 | #include <boost/multi_index/tag.hpp> |
| 33 | #include <boost/multi_index/ordered_index.hpp> |
| 34 | #include <boost/multi_index/composite_key.hpp> |
| 35 | #include <boost/multi_index/hashed_index.hpp> |
| 36 | #include <boost/multi_index/random_access_index.hpp> |
| 37 | #include <boost/multi_index/member.hpp> |
| 38 | #include <boost/multi_index/mem_fun.hpp> |
| 39 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 40 | namespace ns3 { |
| 41 | namespace ndn { |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 42 | |
Alexander Afanasyev | cfdc14f | 2013-03-15 14:38:44 -0700 | [diff] [blame] | 43 | class Name; |
Alexander Afanasyev | 73f06f6 | 2013-03-15 15:41:38 -0700 | [diff] [blame] | 44 | typedef Name NameComponents; |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 45 | |
Alexander Afanasyev | ff0d9ca | 2013-04-14 23:13:46 -0700 | [diff] [blame] | 46 | class Fib; |
| 47 | |
Alexander Afanasyev | 7920651 | 2013-07-27 16:49:12 -0700 | [diff] [blame] | 48 | /** |
| 49 | * @ingroup ndn-fib |
| 50 | * @brief Namespace for FIB operations |
| 51 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 52 | namespace fib { |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 53 | |
| 54 | /** |
Alexander Afanasyev | 7920651 | 2013-07-27 16:49:12 -0700 | [diff] [blame] | 55 | * @ingroup ndn-fib |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 56 | * \brief Structure holding various parameters associated with a (FibEntry, Face) tuple |
| 57 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 58 | class FaceMetric |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 59 | { |
| 60 | public: |
| 61 | /** |
| 62 | * @brief Color codes for FIB face status |
| 63 | */ |
| 64 | enum Status { NDN_FIB_GREEN = 1, |
| 65 | NDN_FIB_YELLOW = 2, |
| 66 | NDN_FIB_RED = 3 }; |
| 67 | public: |
| 68 | /** |
| 69 | * \brief Metric constructor |
| 70 | * |
| 71 | * \param face Face for which metric |
| 72 | * \param cost Initial value for routing cost |
| 73 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 74 | FaceMetric (Ptr<Face> face, int32_t cost) |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 75 | : m_face (face) |
| 76 | , m_status (NDN_FIB_YELLOW) |
| 77 | , m_routingCost (cost) |
| 78 | , m_sRtt (Seconds (0)) |
| 79 | , m_rttVar (Seconds (0)) |
Alexander Afanasyev | 6b0c88f | 2012-12-01 12:24:27 -0800 | [diff] [blame] | 80 | , m_realDelay (Seconds (0)) |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 81 | { } |
| 82 | |
| 83 | /** |
| 84 | * \brief Comparison operator used by boost::multi_index::identity<> |
| 85 | */ |
| 86 | bool |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 87 | operator< (const FaceMetric &fm) const { return *m_face < *fm.m_face; } // return identity of the face |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 88 | |
| 89 | /** |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 90 | * @brief Comparison between FaceMetric and Face |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 91 | */ |
| 92 | bool |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 93 | operator< (const Ptr<Face> &face) const { return *m_face < *face; } |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 94 | |
| 95 | /** |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 96 | * @brief Return Face associated with FaceMetric |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 97 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 98 | Ptr<Face> |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 99 | GetFace () const { return m_face; } |
| 100 | |
| 101 | /** |
| 102 | * \brief Recalculate smoothed RTT and RTT variation |
| 103 | * \param rttSample RTT sample |
| 104 | */ |
| 105 | void |
| 106 | UpdateRtt (const Time &rttSample); |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 107 | |
| 108 | /** |
| 109 | * @brief Get current status of FIB entry |
| 110 | */ |
| 111 | Status |
| 112 | GetStatus () const |
| 113 | { |
| 114 | return m_status; |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * @brief Set current status of FIB entry |
| 119 | */ |
| 120 | void |
| 121 | SetStatus (Status status) |
| 122 | { |
Alexander Afanasyev | e6dc0ac | 2013-02-21 14:00:48 -0800 | [diff] [blame] | 123 | m_status.Set (status); |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | /** |
| 127 | * @brief Get current routing cost |
| 128 | */ |
| 129 | int32_t |
| 130 | GetRoutingCost () const |
| 131 | { |
| 132 | return m_routingCost; |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * @brief Set routing cost |
| 137 | */ |
| 138 | void |
| 139 | SetRoutingCost (int32_t routingCost) |
| 140 | { |
| 141 | m_routingCost = routingCost; |
| 142 | } |
| 143 | |
| 144 | /** |
Alexander Afanasyev | 51c9f9b | 2013-08-30 09:44:17 -0700 | [diff] [blame] | 145 | * @brief Get current estimate for smoothed RTT value |
| 146 | */ |
| 147 | Time |
| 148 | GetSRtt () const |
| 149 | { |
| 150 | return m_sRtt; |
| 151 | } |
| 152 | |
| 153 | /** |
| 154 | * @brief Get current estimate for the RTT variation |
| 155 | */ |
| 156 | Time |
| 157 | GetRttVar () const |
| 158 | { |
| 159 | return m_rttVar; |
| 160 | } |
| 161 | |
| 162 | /** |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 163 | * @brief Get real propagation delay to the producer, calculated based on NS-3 p2p link delays |
| 164 | */ |
| 165 | Time |
| 166 | GetRealDelay () const |
| 167 | { |
| 168 | return m_realDelay; |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * @brief Set real propagation delay to the producer, calculated based on NS-3 p2p link delays |
| 173 | */ |
| 174 | void |
| 175 | SetRealDelay (Time realDelay) |
| 176 | { |
| 177 | m_realDelay = realDelay; |
| 178 | } |
| 179 | |
Alexander Afanasyev | e6dc0ac | 2013-02-21 14:00:48 -0800 | [diff] [blame] | 180 | /** |
| 181 | * @brief Get direct access to status trace |
| 182 | */ |
| 183 | TracedValue<Status> & |
| 184 | GetStatusTrace () |
| 185 | { |
| 186 | return m_status; |
| 187 | } |
| 188 | |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 189 | private: |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 190 | friend std::ostream& operator<< (std::ostream& os, const FaceMetric &metric); |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 191 | |
| 192 | private: |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 193 | Ptr<Face> m_face; ///< Face |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 194 | |
Alexander Afanasyev | e6dc0ac | 2013-02-21 14:00:48 -0800 | [diff] [blame] | 195 | TracedValue<Status> m_status; ///< \brief Status of the next hop: |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 196 | ///< - NDN_FIB_GREEN |
| 197 | ///< - NDN_FIB_YELLOW |
| 198 | ///< - NDN_FIB_RED |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 199 | |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 200 | int32_t m_routingCost; ///< \brief routing protocol cost (interpretation of the value depends on the underlying routing protocol) |
| 201 | |
| 202 | Time m_sRtt; ///< \brief smoothed round-trip time |
| 203 | Time m_rttVar; ///< \brief round-trip time variation |
Alexander Afanasyev | 6b0c88f | 2012-12-01 12:24:27 -0800 | [diff] [blame] | 204 | |
| 205 | Time m_realDelay; ///< \brief real propagation delay to the producer, calculated based on NS-3 p2p link delays |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 206 | }; |
| 207 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 208 | /// @cond include_hidden |
| 209 | class i_face {}; |
| 210 | class i_metric {}; |
| 211 | class i_nth {}; |
| 212 | /// @endcond |
| 213 | |
| 214 | |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 215 | /** |
Alexander Afanasyev | 7920651 | 2013-07-27 16:49:12 -0700 | [diff] [blame] | 216 | * @ingroup ndn-fib |
| 217 | * @brief Typedef for indexed face container of Entry |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 218 | * |
| 219 | * Currently, there are 2 indexes: |
| 220 | * - by face (used to find record and update metric) |
| 221 | * - by metric (face ranking) |
| 222 | * - random access index (for fast lookup on nth face). Order is |
| 223 | * maintained manually to be equal to the 'by metric' order |
| 224 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 225 | struct FaceMetricContainer |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 226 | { |
| 227 | /// @cond include_hidden |
| 228 | typedef boost::multi_index::multi_index_container< |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 229 | FaceMetric, |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 230 | boost::multi_index::indexed_by< |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 231 | // For fast access to elements using Face |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 232 | boost::multi_index::ordered_unique< |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 233 | boost::multi_index::tag<i_face>, |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 234 | boost::multi_index::const_mem_fun<FaceMetric,Ptr<Face>,&FaceMetric::GetFace> |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 235 | >, |
| 236 | |
| 237 | // List of available faces ordered by (status, m_routingCost) |
| 238 | boost::multi_index::ordered_non_unique< |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 239 | boost::multi_index::tag<i_metric>, |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 240 | boost::multi_index::composite_key< |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 241 | FaceMetric, |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 242 | boost::multi_index::const_mem_fun<FaceMetric,FaceMetric::Status,&FaceMetric::GetStatus>, |
| 243 | boost::multi_index::const_mem_fun<FaceMetric,int32_t,&FaceMetric::GetRoutingCost> |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 244 | > |
| 245 | >, |
| 246 | |
| 247 | // To optimize nth candidate selection (sacrifice a little bit space to gain speed) |
| 248 | boost::multi_index::random_access< |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 249 | boost::multi_index::tag<i_nth> |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 250 | > |
| 251 | > |
| 252 | > type; |
| 253 | /// @endcond |
| 254 | }; |
| 255 | |
| 256 | /** |
Alexander Afanasyev | 7920651 | 2013-07-27 16:49:12 -0700 | [diff] [blame] | 257 | * @ingroup ndn-fib |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 258 | * \brief Structure for FIB table entry, holding indexed list of |
| 259 | * available faces and their respective metrics |
| 260 | */ |
Alexander Afanasyev | f5c0774 | 2012-10-31 13:13:05 -0700 | [diff] [blame] | 261 | class Entry : public Object |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 262 | { |
| 263 | public: |
Alexander Afanasyev | 8566f45 | 2012-12-10 15:21:51 -0800 | [diff] [blame] | 264 | typedef Entry base_type; |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 265 | |
Alexander Afanasyev | 8566f45 | 2012-12-10 15:21:51 -0800 | [diff] [blame] | 266 | public: |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 267 | class NoFaces {}; ///< @brief Exception class for the case when FIB entry is not found |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 268 | |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 269 | /** |
| 270 | * \brief Constructor |
| 271 | * \param prefix smart pointer to the prefix for the FIB entry |
| 272 | */ |
Alexander Afanasyev | ff0d9ca | 2013-04-14 23:13:46 -0700 | [diff] [blame] | 273 | Entry (Ptr<Fib> fib, const Ptr<const Name> &prefix) |
| 274 | : m_fib (fib) |
| 275 | , m_prefix (prefix) |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 276 | , m_needsProbing (false) |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 277 | { |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 278 | } |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 279 | |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 280 | /** |
| 281 | * \brief Update status of FIB next hop |
| 282 | * \param status Status to set on the FIB entry |
| 283 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 284 | void UpdateStatus (Ptr<Face> face, FaceMetric::Status status); |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 285 | |
| 286 | /** |
| 287 | * \brief Add or update routing metric of FIB next hop |
| 288 | * |
| 289 | * Initial status of the next hop is set to YELLOW |
| 290 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 291 | void AddOrUpdateRoutingMetric (Ptr<Face> face, int32_t metric); |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 292 | |
| 293 | /** |
Alexander Afanasyev | 6b0c88f | 2012-12-01 12:24:27 -0800 | [diff] [blame] | 294 | * \brief Set real delay to the producer |
| 295 | */ |
| 296 | void |
| 297 | SetRealDelayToProducer (Ptr<Face> face, Time delay); |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 298 | |
Alexander Afanasyev | 6b0c88f | 2012-12-01 12:24:27 -0800 | [diff] [blame] | 299 | /** |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 300 | * @brief Invalidate face |
| 301 | * |
| 302 | * Set routing metric on all faces to max and status to RED |
| 303 | */ |
| 304 | void |
| 305 | Invalidate (); |
| 306 | |
| 307 | /** |
| 308 | * @brief Update RTT averages for the face |
| 309 | */ |
| 310 | void |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 311 | UpdateFaceRtt (Ptr<Face> face, const Time &sample); |
Alexander Afanasyev | 06dba7c | 2013-02-21 11:36:26 -0800 | [diff] [blame] | 312 | |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 313 | /** |
| 314 | * \brief Get prefix for the FIB entry |
| 315 | */ |
Alexander Afanasyev | cfdc14f | 2013-03-15 14:38:44 -0700 | [diff] [blame] | 316 | const Name& |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 317 | GetPrefix () const { return *m_prefix; } |
| 318 | |
| 319 | /** |
| 320 | * \brief Find "best route" candidate, skipping `skip' first candidates (modulo # of faces) |
| 321 | * |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 322 | * throws Entry::NoFaces if m_faces.size()==0 |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 323 | */ |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 324 | const FaceMetric & |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 325 | FindBestCandidate (uint32_t skip = 0) const; |
| 326 | |
| 327 | /** |
| 328 | * @brief Remove record associated with `face` |
| 329 | */ |
| 330 | void |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 331 | RemoveFace (const Ptr<Face> &face) |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 332 | { |
| 333 | m_faces.erase (face); |
| 334 | } |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 335 | |
Alexander Afanasyev | ff0d9ca | 2013-04-14 23:13:46 -0700 | [diff] [blame] | 336 | /** |
| 337 | * @brief Get pointer to access FIB, to which this entry is added |
| 338 | */ |
| 339 | Ptr<Fib> |
| 340 | GetFib (); |
| 341 | |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 342 | private: |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 343 | friend std::ostream& operator<< (std::ostream& os, const Entry &entry); |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 344 | |
| 345 | public: |
Alexander Afanasyev | ff0d9ca | 2013-04-14 23:13:46 -0700 | [diff] [blame] | 346 | Ptr<Fib> m_fib; ///< \brief FIB to which entry is added |
| 347 | |
Alexander Afanasyev | cfdc14f | 2013-03-15 14:38:44 -0700 | [diff] [blame] | 348 | Ptr<const Name> m_prefix; ///< \brief Prefix of the FIB entry |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 349 | FaceMetricContainer::type m_faces; ///< \brief Indexed list of faces |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 350 | |
Alexander Afanasyev | ea9b3e6 | 2012-08-13 19:02:54 -0700 | [diff] [blame] | 351 | bool m_needsProbing; ///< \brief flag indicating that probing should be performed |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 352 | }; |
| 353 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 354 | std::ostream& operator<< (std::ostream& os, const Entry &entry); |
| 355 | std::ostream& operator<< (std::ostream& os, const FaceMetric &metric); |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 356 | |
Alexander Afanasyev | 2b4c947 | 2012-08-09 15:00:38 -0700 | [diff] [blame] | 357 | } // namespace fib |
| 358 | } // namespace ndn |
| 359 | } // namespace ns3 |
Alexander Afanasyev | 78057c3 | 2012-07-06 15:18:46 -0700 | [diff] [blame] | 360 | |
Alexander Afanasyev | 4aac557 | 2012-08-09 10:49:55 -0700 | [diff] [blame] | 361 | #endif // _NDN_FIB_ENTRY_H_ |