akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
Nick Gordon | c6a8522 | 2017-01-03 16:54:34 -0600 | [diff] [blame] | 3 | * Copyright (c) 2014-2017, The University of Memphis, |
Vince Lehman | c2e51f6 | 2015-01-20 15:03:11 -0600 | [diff] [blame] | 4 | * Regents of the University of California, |
| 5 | * Arizona Board of Regents. |
akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 6 | * |
| 7 | * This file is part of NLSR (Named-data Link State Routing). |
| 8 | * See AUTHORS.md for complete list of NLSR authors and contributors. |
| 9 | * |
| 10 | * NLSR is free software: you can redistribute it and/or modify it under the terms |
| 11 | * of the GNU General Public License as published by the Free Software Foundation, |
| 12 | * either version 3 of the License, or (at your option) any later version. |
| 13 | * |
| 14 | * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 15 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE. See the GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License along with |
| 19 | * NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
akmhoque | 3d06e79 | 2014-05-27 16:23:20 -0500 | [diff] [blame] | 20 | **/ |
Vince Lehman | c2e51f6 | 2015-01-20 15:03:11 -0600 | [diff] [blame] | 21 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 22 | #ifndef NLSR_LSA_HPP |
| 23 | #define NLSR_LSA_HPP |
| 24 | |
Nick Gordon | 22b5c95 | 2017-08-10 17:48:15 -0500 | [diff] [blame] | 25 | #include "name-prefix-list.hpp" |
| 26 | #include "adjacent.hpp" |
| 27 | #include "adjacency-list.hpp" |
| 28 | |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 29 | #include <boost/cstdint.hpp> |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 30 | #include <ndn-cxx/util/scheduler.hpp> |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 31 | #include <ndn-cxx/util/time.hpp> |
| 32 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 33 | namespace nlsr { |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 34 | |
Vince Lehman | f7eec4f | 2015-05-08 19:02:31 -0500 | [diff] [blame] | 35 | class Nlsr; |
| 36 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 37 | class Lsa |
| 38 | { |
| 39 | public: |
Nick Gordon | 727d483 | 2017-10-13 18:04:25 -0500 | [diff] [blame^] | 40 | enum class Type { |
| 41 | ADJACENCY, |
| 42 | COORDINATE, |
| 43 | NAME, |
| 44 | BASE |
| 45 | }; |
| 46 | |
| 47 | Lsa() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 48 | : m_origRouter() |
| 49 | , m_lsSeqNo() |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 50 | , m_expirationTimePoint() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 51 | , m_expiringEventId() |
| 52 | { |
| 53 | } |
| 54 | |
Nick Gordon | 727d483 | 2017-10-13 18:04:25 -0500 | [diff] [blame^] | 55 | virtual Type |
| 56 | getType() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 57 | { |
Nick Gordon | 727d483 | 2017-10-13 18:04:25 -0500 | [diff] [blame^] | 58 | return Type::BASE; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | void |
| 62 | setLsSeqNo(uint32_t lsn) |
| 63 | { |
| 64 | m_lsSeqNo = lsn; |
| 65 | } |
| 66 | |
| 67 | uint32_t |
| 68 | getLsSeqNo() const |
| 69 | { |
| 70 | return m_lsSeqNo; |
| 71 | } |
| 72 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 73 | const ndn::Name& |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 74 | getOrigRouter() const |
| 75 | { |
| 76 | return m_origRouter; |
| 77 | } |
| 78 | |
| 79 | void |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 80 | setOrigRouter(const ndn::Name& org) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 81 | { |
| 82 | m_origRouter = org; |
| 83 | } |
| 84 | |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 85 | const ndn::time::system_clock::TimePoint& |
| 86 | getExpirationTimePoint() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 87 | { |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 88 | return m_expirationTimePoint; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | void |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 92 | setExpirationTimePoint(const ndn::time::system_clock::TimePoint& lt) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 93 | { |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 94 | m_expirationTimePoint = lt; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 95 | } |
| 96 | |
| 97 | void |
| 98 | setExpiringEventId(const ndn::EventId leei) |
| 99 | { |
| 100 | m_expiringEventId = leei; |
| 101 | } |
| 102 | |
| 103 | ndn::EventId |
| 104 | getExpiringEventId() const |
| 105 | { |
| 106 | return m_expiringEventId; |
| 107 | } |
| 108 | |
| 109 | protected: |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 110 | ndn::Name m_origRouter; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 111 | uint32_t m_lsSeqNo; |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 112 | ndn::time::system_clock::TimePoint m_expirationTimePoint; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 113 | ndn::EventId m_expiringEventId; |
| 114 | }; |
| 115 | |
| 116 | class NameLsa: public Lsa |
| 117 | { |
| 118 | public: |
| 119 | NameLsa() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 120 | { |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 121 | } |
| 122 | |
Ashlesh Gawande | d02c388 | 2015-12-29 16:02:51 -0600 | [diff] [blame] | 123 | NameLsa(const ndn::Name& origR, uint32_t lsn, |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 124 | const ndn::time::system_clock::TimePoint& lt, |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 125 | NamePrefixList& npl); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 126 | |
Nick Gordon | 727d483 | 2017-10-13 18:04:25 -0500 | [diff] [blame^] | 127 | Lsa::Type |
| 128 | getType() const override |
| 129 | { |
| 130 | return Lsa::Type::NAME; |
| 131 | } |
| 132 | |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 133 | NamePrefixList& |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 134 | getNpl() |
| 135 | { |
| 136 | return m_npl; |
| 137 | } |
| 138 | |
Nick Gordon | 56d1fae | 2017-05-26 16:39:25 -0500 | [diff] [blame] | 139 | const NamePrefixList& |
| 140 | getNpl() const |
| 141 | { |
| 142 | return m_npl; |
| 143 | } |
| 144 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 145 | void |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 146 | addName(const ndn::Name& name) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 147 | { |
| 148 | m_npl.insert(name); |
| 149 | } |
| 150 | |
| 151 | void |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 152 | removeName(const ndn::Name& name) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 153 | { |
| 154 | m_npl.remove(name); |
| 155 | } |
| 156 | |
Nick G | 97e3494 | 2016-07-11 14:46:27 -0500 | [diff] [blame] | 157 | /*! \brief Gets the key for this LSA. |
| 158 | |
| 159 | Format is: \<router name\>/\<LSA type>\ |
| 160 | */ |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 161 | const ndn::Name |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 162 | getKey() const; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 163 | |
Nick G | 97e3494 | 2016-07-11 14:46:27 -0500 | [diff] [blame] | 164 | /*! \brief Returns the data that this name LSA has. |
| 165 | |
| 166 | Format is: \<original router |
| 167 | prefix\>|name|\<seq. no.\>|\<exp. time\>|\<prefix 1\>|\<prefix |
| 168 | 2\>|...|\<prefix n\>| |
| 169 | */ |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 170 | std::string |
| 171 | getData(); |
| 172 | |
Nick G | 97e3494 | 2016-07-11 14:46:27 -0500 | [diff] [blame] | 173 | /*! \brief Initializes this LSA object with content's data. |
| 174 | |
| 175 | \param content The data (e.g. name prefixes) to initialize this LSA with. |
| 176 | |
| 177 | This function initializes this object to represent the data |
| 178 | contained in content. The format for this is the same as for |
| 179 | getData(); getData() returns data of this format, in other words. |
| 180 | */ |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 181 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 182 | initializeFromContent(const std::string& content); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 183 | |
Nick Gordon | 56d1fae | 2017-05-26 16:39:25 -0500 | [diff] [blame] | 184 | bool |
| 185 | isEqualContent(const NameLsa& other) const; |
| 186 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 187 | void |
| 188 | writeLog(); |
| 189 | |
| 190 | private: |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 191 | NamePrefixList m_npl; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 192 | }; |
| 193 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 194 | class AdjLsa: public Lsa |
| 195 | { |
| 196 | public: |
alvy | dce3f18 | 2015-04-09 11:23:30 -0500 | [diff] [blame] | 197 | typedef AdjacencyList::const_iterator const_iterator; |
| 198 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 199 | AdjLsa() |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 200 | { |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 201 | } |
| 202 | |
Ashlesh Gawande | d02c388 | 2015-12-29 16:02:51 -0600 | [diff] [blame] | 203 | AdjLsa(const ndn::Name& origR, uint32_t lsn, |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 204 | const ndn::time::system_clock::TimePoint& lt, |
| 205 | uint32_t nl , AdjacencyList& adl); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 206 | |
Nick Gordon | 727d483 | 2017-10-13 18:04:25 -0500 | [diff] [blame^] | 207 | Lsa::Type |
| 208 | getType() const override |
| 209 | { |
| 210 | return Lsa::Type::ADJACENCY; |
| 211 | } |
| 212 | |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 213 | AdjacencyList& |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 214 | getAdl() |
| 215 | { |
| 216 | return m_adl; |
| 217 | } |
| 218 | |
Nick Gordon | 22b5c95 | 2017-08-10 17:48:15 -0500 | [diff] [blame] | 219 | const AdjacencyList& |
| 220 | getAdl() const |
| 221 | { |
| 222 | return m_adl; |
| 223 | } |
| 224 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 225 | void |
| 226 | addAdjacent(Adjacent adj) |
| 227 | { |
| 228 | m_adl.insert(adj); |
| 229 | } |
| 230 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 231 | const ndn::Name |
| 232 | getKey() const; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 233 | |
Nick G | 97e3494 | 2016-07-11 14:46:27 -0500 | [diff] [blame] | 234 | /*! \brief Returns the data this adjacency LSA has. |
| 235 | |
| 236 | The format is: \<original |
| 237 | router\>|adjacency|\<seq. no.\>|\<exp. time\>|\<size\>|\<adjacency prefix |
| 238 | 1\>|\<face uri 1\>|\<cost 1\>|...|\<adjacency prefix n\>|\<face uri |
| 239 | n\>|\<cost n\>| |
| 240 | */ |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 241 | std::string |
| 242 | getData(); |
| 243 | |
Nick G | 97e3494 | 2016-07-11 14:46:27 -0500 | [diff] [blame] | 244 | /*! \brief Initializes this adj. LSA from the supplied content. |
| 245 | |
| 246 | \param content The content that this LSA is to have, formatted |
| 247 | according to getData(). |
| 248 | */ |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 249 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 250 | initializeFromContent(const std::string& content); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 251 | |
| 252 | uint32_t |
| 253 | getNoLink() |
| 254 | { |
| 255 | return m_noLink; |
| 256 | } |
| 257 | |
| 258 | bool |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 259 | isEqualContent(AdjLsa& alsa); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 260 | |
Nick G | 97e3494 | 2016-07-11 14:46:27 -0500 | [diff] [blame] | 261 | /*! \brief Installs this LSA's name prefixes into the NPT. |
| 262 | |
| 263 | \param pnlsr The NLSR top-level whose NPT you want to install the |
| 264 | entries into. |
| 265 | */ |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 266 | void |
| 267 | addNptEntries(Nlsr& pnlsr); |
| 268 | |
| 269 | void |
| 270 | removeNptEntries(Nlsr& pnlsr); |
| 271 | |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 272 | void |
| 273 | writeLog(); |
| 274 | |
alvy | dce3f18 | 2015-04-09 11:23:30 -0500 | [diff] [blame] | 275 | public: |
| 276 | const_iterator |
| 277 | begin() const |
| 278 | { |
| 279 | return m_adl.begin(); |
| 280 | } |
| 281 | |
| 282 | const_iterator |
| 283 | end() const |
| 284 | { |
| 285 | return m_adl.end(); |
| 286 | } |
| 287 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 288 | private: |
| 289 | uint32_t m_noLink; |
akmhoque | c8a10f7 | 2014-04-25 18:42:55 -0500 | [diff] [blame] | 290 | AdjacencyList m_adl; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 291 | }; |
| 292 | |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 293 | class CoordinateLsa: public Lsa |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 294 | { |
| 295 | public: |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 296 | CoordinateLsa() |
Nick Gordon | 727d483 | 2017-10-13 18:04:25 -0500 | [diff] [blame^] | 297 | : m_corRad(0) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 298 | { |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 299 | } |
| 300 | |
Ashlesh Gawande | d02c388 | 2015-12-29 16:02:51 -0600 | [diff] [blame] | 301 | CoordinateLsa(const ndn::Name& origR, uint32_t lsn, |
akmhoque | c7a79b2 | 2014-05-26 08:06:19 -0500 | [diff] [blame] | 302 | const ndn::time::system_clock::TimePoint& lt, |
Muktadir R Chowdhury | b00dc2a | 2016-11-05 10:48:58 -0600 | [diff] [blame] | 303 | double r, std::vector<double> theta); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 304 | |
Nick Gordon | 727d483 | 2017-10-13 18:04:25 -0500 | [diff] [blame^] | 305 | Lsa::Type |
| 306 | getType() const override |
| 307 | { |
| 308 | return Lsa::Type::COORDINATE; |
| 309 | } |
| 310 | |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 311 | const ndn::Name |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 312 | getKey() const; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 313 | |
Nick G | 97e3494 | 2016-07-11 14:46:27 -0500 | [diff] [blame] | 314 | /*! \brief Returns the data that this coordinate LSA represents. |
| 315 | |
| 316 | The format is: \<original |
| 317 | router\>|coordinate|\<seq. no.\>|\<exp. time\>|\<radians\>|\<theta\>| |
| 318 | */ |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 319 | std::string |
| 320 | getData(); |
| 321 | |
Nick G | 97e3494 | 2016-07-11 14:46:27 -0500 | [diff] [blame] | 322 | /*! \brief Initializes this coordinate LSA with the data in content. |
| 323 | |
| 324 | \param content The string content that is used to build the LSA. |
| 325 | |
| 326 | This function initializes this LSA object to represent the data |
| 327 | specified by the parameter. The format that it is expecting is the |
| 328 | same as for getData(); |
| 329 | */ |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 330 | bool |
akmhoque | 31d1d4b | 2014-05-05 22:08:14 -0500 | [diff] [blame] | 331 | initializeFromContent(const std::string& content); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 332 | |
| 333 | double |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 334 | getCorRadius() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 335 | { |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 336 | return m_corRad; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 337 | } |
| 338 | |
| 339 | void |
| 340 | setCorRadius(double cr) |
| 341 | { |
akmhoque | 157b0a4 | 2014-05-13 00:26:37 -0500 | [diff] [blame] | 342 | m_corRad = cr; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 343 | } |
| 344 | |
Muktadir R Chowdhury | b00dc2a | 2016-11-05 10:48:58 -0600 | [diff] [blame] | 345 | const std::vector<double> |
akmhoque | b6450b1 | 2014-04-24 00:01:03 -0500 | [diff] [blame] | 346 | getCorTheta() const |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 347 | { |
Muktadir R Chowdhury | b00dc2a | 2016-11-05 10:48:58 -0600 | [diff] [blame] | 348 | return m_angles; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 349 | } |
| 350 | |
| 351 | void |
Muktadir R Chowdhury | b00dc2a | 2016-11-05 10:48:58 -0600 | [diff] [blame] | 352 | setCorTheta(std::vector<double> ct) |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 353 | { |
Muktadir R Chowdhury | b00dc2a | 2016-11-05 10:48:58 -0600 | [diff] [blame] | 354 | m_angles = ct; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 355 | } |
| 356 | |
| 357 | bool |
akmhoque | fdbddb1 | 2014-05-02 18:35:19 -0500 | [diff] [blame] | 358 | isEqualContent(const CoordinateLsa& clsa); |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 359 | |
akmhoque | 674b0b1 | 2014-05-20 14:33:28 -0500 | [diff] [blame] | 360 | void |
| 361 | writeLog(); |
| 362 | |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 363 | private: |
| 364 | double m_corRad; |
Muktadir R Chowdhury | b00dc2a | 2016-11-05 10:48:58 -0600 | [diff] [blame] | 365 | std::vector<double> m_angles; |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 366 | }; |
| 367 | |
alvy | dce3f18 | 2015-04-09 11:23:30 -0500 | [diff] [blame] | 368 | std::ostream& |
| 369 | operator<<(std::ostream& os, const AdjLsa& adjLsa); |
| 370 | |
Nick Gordon | 727d483 | 2017-10-13 18:04:25 -0500 | [diff] [blame^] | 371 | std::ostream& |
| 372 | operator<<(std::ostream& os, const Lsa::Type& type); |
| 373 | |
| 374 | std::istream& |
| 375 | operator>>(std::istream& is, Lsa::Type& type); |
| 376 | |
Nick Gordon | fad8e25 | 2016-08-11 14:21:38 -0500 | [diff] [blame] | 377 | } // namespace nlsr |
akmhoque | 5335346 | 2014-04-22 08:43:45 -0500 | [diff] [blame] | 378 | |
Nick Gordon | 727d483 | 2017-10-13 18:04:25 -0500 | [diff] [blame^] | 379 | namespace std { |
| 380 | std::string |
| 381 | to_string(const nlsr::Lsa::Type& type); |
| 382 | } // namespace std |
| 383 | |
Nick Gordon | 56d1fae | 2017-05-26 16:39:25 -0500 | [diff] [blame] | 384 | #endif // NLSR_LSA_HPP |