blob: 532410f528ed6bba6ea24a0861e249c4af27acbf [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
akmhoque674b0b12014-05-20 14:33:28 -050031 writeLog();
32
33 void
akmhoque53353462014-04-22 08:43:45 -050034 print();
35
36private:
37 void
akmhoque31d1d4b2014-05-05 22:08:14 -050038 addEntry(const ndn::Name& name, RoutingTableEntry& rte);
akmhoque53353462014-04-22 08:43:45 -050039
40 void
akmhoque31d1d4b2014-05-05 22:08:14 -050041 removeEntry(const ndn::Name& name, RoutingTableEntry& rte);
akmhoque53353462014-04-22 08:43:45 -050042
43private:
akmhoque31d1d4b2014-05-05 22:08:14 -050044 Nlsr& m_nlsr;
akmhoquefdbddb12014-05-02 18:35:19 -050045 std::list<NamePrefixTableEntry> m_table;
akmhoque53353462014-04-22 08:43:45 -050046};
47
48}//namespace nlsr
49
akmhoquefdbddb12014-05-02 18:35:19 -050050#endif //NLSR_NAME_PREFIX_TABLE_HPP