blob: 83731b9a79a1fdb269179f2e592186384d59808b [file] [log] [blame]
akmhoque3d06e792014-05-27 16:23:20 -05001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
Ashlesh Gawande0db4d4d2020-02-05 20:30:02 -08003 * Copyright (c) 2014-2020, The University of Memphis,
Nick Gordonf8b5bcd2016-08-11 15:06:50 -05004 * Regents of the University of California
akmhoque3d06e792014-05-27 16:23:20 -05005 *
6 * This file is part of NLSR (Named-data Link State Routing).
7 * See AUTHORS.md for complete list of NLSR authors and contributors.
8 *
9 * NLSR is free software: you can redistribute it and/or modify it under the terms
10 * of the GNU General Public License as published by the Free Software Foundation,
11 * either version 3 of the License, or (at your option) any later version.
12 *
13 * NLSR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
14 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * NLSR, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
19 *
akmhoque3d06e792014-05-27 16:23:20 -050020 **/
Nick Gordond0a7df32017-05-30 16:44:34 -050021
akmhoquefdbddb12014-05-02 18:35:19 -050022#ifndef NLSR_ROUTING_TABLE_ENTRY_HPP
23#define NLSR_ROUTING_TABLE_ENTRY_HPP
akmhoque53353462014-04-22 08:43:45 -050024
Nick Gordond0a7df32017-05-30 16:44:34 -050025#include "nexthop-list.hpp"
26
akmhoque31d1d4b2014-05-05 22:08:14 -050027#include <ndn-cxx/name.hpp>
akmhoque53353462014-04-22 08:43:45 -050028
29namespace nlsr {
30
31class RoutingTableEntry
32{
33public:
34 RoutingTableEntry()
akmhoque53353462014-04-22 08:43:45 -050035 {
36 }
37
38 ~RoutingTableEntry()
39 {
40 }
41
akmhoque31d1d4b2014-05-05 22:08:14 -050042 RoutingTableEntry(const ndn::Name& dest)
akmhoque53353462014-04-22 08:43:45 -050043 {
44 m_destination = dest;
45 }
46
akmhoque31d1d4b2014-05-05 22:08:14 -050047 const ndn::Name&
48 getDestination() const
akmhoque53353462014-04-22 08:43:45 -050049 {
50 return m_destination;
51 }
52
akmhoquec8a10f72014-04-25 18:42:55 -050053 NexthopList&
akmhoquefdbddb12014-05-02 18:35:19 -050054 getNexthopList()
akmhoque53353462014-04-22 08:43:45 -050055 {
akmhoquefdbddb12014-05-02 18:35:19 -050056 return m_nexthopList;
akmhoque53353462014-04-22 08:43:45 -050057 }
58
Nick Gordonb50e51b2016-07-22 16:05:57 -050059 const NexthopList&
60 getNexthopList() const
61 {
62 return m_nexthopList;
63 }
64
65 inline bool
66 operator==(RoutingTableEntry& rhs)
67 {
Ashlesh Gawande6b388fc2019-09-30 10:14:41 -050068 return ((*this).getDestination() == rhs.getDestination() &&
69 (*this).getNexthopList() == rhs.getNexthopList());
Nick Gordonb50e51b2016-07-22 16:05:57 -050070 }
71
72protected:
akmhoque31d1d4b2014-05-05 22:08:14 -050073 ndn::Name m_destination;
akmhoquefdbddb12014-05-02 18:35:19 -050074 NexthopList m_nexthopList;
akmhoque53353462014-04-22 08:43:45 -050075};
76
Nick Gordonb50e51b2016-07-22 16:05:57 -050077std::ostream&
78operator<<(std::ostream& os, const RoutingTableEntry& rte);
79
Nick Gordonfad8e252016-08-11 14:21:38 -050080} // namespace nlsr
akmhoque53353462014-04-22 08:43:45 -050081
dmcoomes9f936662017-03-02 10:33:09 -060082#endif // NLSR_ROUTING_TABLE_ENTRY_HPP