blob: b87216165cefc3e3eae9dc770afe8aaaa1696248 [file] [log] [blame]
akmhoquefdbddb12014-05-02 18:35:19 -05001#ifndef NLSR_NAME_PREFIX_TABLE_HPP
2#define NLSR_NAME_PREFIX_TABLE_HPP
akmhoque53353462014-04-22 08:43:45 -05003
4#include <list>
akmhoquefdbddb12014-05-02 18:35:19 -05005#include <boost/cstdint.hpp>
6
akmhoquec8a10f72014-04-25 18:42:55 -05007#include "name-prefix-table-entry.hpp"
akmhoque53353462014-04-22 08:43:45 -05008#include "routing-table-entry.hpp"
9
10namespace nlsr {
11class Nlsr;
12
akmhoquec8a10f72014-04-25 18:42:55 -050013class NamePrefixTable
akmhoque53353462014-04-22 08:43:45 -050014{
15public:
akmhoque31d1d4b2014-05-05 22:08:14 -050016 NamePrefixTable(Nlsr& nlsr)
17 : m_nlsr(nlsr)
akmhoque53353462014-04-22 08:43:45 -050018 {
19 }
akmhoque53353462014-04-22 08:43:45 -050020
21 void
akmhoque31d1d4b2014-05-05 22:08:14 -050022 addEntry(const ndn::Name& name, const ndn::Name& destRouter);
akmhoquefdbddb12014-05-02 18:35:19 -050023
24 void
akmhoque31d1d4b2014-05-05 22:08:14 -050025 removeEntry(const ndn::Name& name, const ndn::Name& destRouter);
akmhoque53353462014-04-22 08:43:45 -050026
27 void
akmhoque31d1d4b2014-05-05 22:08:14 -050028 updateWithNewRoute();
akmhoque53353462014-04-22 08:43:45 -050029
30 void
31 print();
32
33private:
34 void
akmhoque31d1d4b2014-05-05 22:08:14 -050035 addEntry(const ndn::Name& name, RoutingTableEntry& rte);
akmhoque53353462014-04-22 08:43:45 -050036
37 void
akmhoque31d1d4b2014-05-05 22:08:14 -050038 removeEntry(const ndn::Name& name, RoutingTableEntry& rte);
akmhoque53353462014-04-22 08:43:45 -050039
40private:
akmhoque31d1d4b2014-05-05 22:08:14 -050041 Nlsr& m_nlsr;
akmhoquefdbddb12014-05-02 18:35:19 -050042 std::list<NamePrefixTableEntry> m_table;
akmhoque53353462014-04-22 08:43:45 -050043};
44
45}//namespace nlsr
46
akmhoquefdbddb12014-05-02 18:35:19 -050047#endif //NLSR_NAME_PREFIX_TABLE_HPP