22#ifndef NLSR_NAME_PREFIX_TABLE_HPP
23#define NLSR_NAME_PREFIX_TABLE_HPP
33#include <unordered_map>
41 std::unordered_map<ndn::Name, std::shared_ptr<RoutingTablePoolEntry>>;
42 using NptEntryList = std::list<std::shared_ptr<NamePrefixTableEntry>>;
63 const std::list<nlsr::PrefixInfo>& namesToAdd,
64 const std::list<nlsr::PrefixInfo>& namesToRemove);
81 addEntry(
const ndn::Name& name,
const ndn::Name& destRouter, uint64_t routeFlags = ndn::nfd::ROUTE_FLAG_CAPTURE);
95 removeEntry(
const ndn::Name& name,
const ndn::Name& destRouter);
117 std::shared_ptr<RoutingTablePoolEntry>
146 const ndn::Name& m_ownRouterName;
149 ndn::signal::Connection m_afterRoutingChangeConnection;
150 ndn::signal::Connection m_afterLsdbModified;
151 std::map<std::tuple<ndn::Name, ndn::Name>,
double> m_nexthopCost;
157 return m_table.begin();
163 return m_table.end();
Maps names to lists of next hops, and exports this information to NFD.
ndn::signal::Signal< Lsdb, std::shared_ptr< Lsa >, LsdbUpdate, std::list< nlsr::PrefixInfo >, std::list< nlsr::PrefixInfo > > AfterLsdbModified
std::shared_ptr< RoutingTablePoolEntry > addRtpeToPool(RoutingTablePoolEntry &rtpe)
Adds a pool entry to the pool.
void addEntry(const ndn::Name &name, const ndn::Name &destRouter, uint64_t routeFlags=ndn::nfd::ROUTE_FLAG_CAPTURE)
Adds a destination to the specified name prefix.
void removeEntry(const ndn::Name &name, const ndn::Name &destRouter)
Removes a destination from a name prefix table entry.
NptEntryList::const_iterator const_iterator
void updateFromLsdb(std::shared_ptr< Lsa > lsa, LsdbUpdate updateType, const std::list< nlsr::PrefixInfo > &namesToAdd, const std::list< nlsr::PrefixInfo > &namesToRemove)
Add, update, or remove Names according to the Lsdb update.
void updateWithNewRoute(const std::list< RoutingTableEntry > &entries)
Updates all routing information in the NPT.
std::list< std::shared_ptr< NamePrefixTableEntry > > NptEntryList
std::tuple< ndn::Name, ndn::Name > DestNameKey
NexthopList adjustNexthopCosts(const NexthopList &nhlist, const ndn::Name &nameToCheck, const ndn::Name &destRouterName)
std::unordered_map< ndn::Name, std::shared_ptr< RoutingTablePoolEntry > > RoutingTableEntryPool
const_iterator end() const
void deleteRtpeFromPool(std::shared_ptr< RoutingTablePoolEntry > rtpePtr)
Removes a pool entry from the pool.
const_iterator begin() const
Copyright (c) 2014-2020, The University of Memphis, Regents of the University of California.
std::ostream & operator<<(std::ostream &os, const Adjacent &adjacent)
ndn::signal::Signal< RoutingTable, std::list< RoutingTableEntry > > AfterRoutingChange
#define PUBLIC_WITH_TESTS_ELSE_PRIVATE