blob: 0b0e664e83021523ae76cb32e15aafaf126e7346 [file] [log] [blame]
akmhoquebd7c8e62014-02-01 14:57:40 -06001#ifndef NLSR_LSDB_HPP
2#define NLSR_LSDB_HPP
3
4#include "nlsr_lsa.hpp"
5
6using namespace std;
7
8class nlsr;
9
10class Lsdb{
11public:
12 Lsdb()
13 {
14 }
15
16
17 bool doesLsaExist(string key, int lsType);
18 // function related to Name LSDB
akmhoque3c6bd922014-02-01 17:10:17 -060019 bool buildAndInstallOwnNameLsa(nlsr& pnlsr);
akmhoquebd7c8e62014-02-01 14:57:40 -060020 NameLsa& getNameLsa(string key);
21 bool installNameLsa(NameLsa &nlsa);
22 bool removeNameLsa(string& key);
23 void printNameLsdb(); //debugging
24
25 //function related to Cor LSDB
akmhoque3c6bd922014-02-01 17:10:17 -060026 bool buildAndInstallOwnCorLsa(nlsr& pnlsr);
akmhoquebd7c8e62014-02-01 14:57:40 -060027 CorLsa& getCorLsa(string key);
akmhoque3c6bd922014-02-01 17:10:17 -060028 bool installCorLsa(CorLsa &clsa);
akmhoquebd7c8e62014-02-01 14:57:40 -060029 bool removeCorLsa(string& key);
30 void printCorLsdb(); //debugging
31
32private:
33 bool addNameLsa(NameLsa &nlsa);
akmhoque3c6bd922014-02-01 17:10:17 -060034 bool addCorLsa(CorLsa& clsa);
akmhoquebd7c8e62014-02-01 14:57:40 -060035 bool doesNameLsaExist(string key);
36 bool doesAdjLsaExist(string key);
37 bool doesCorLsaExist(string key);
38
39private:
40 std::list<NameLsa> nameLsdb;
41 std::list<AdjLsa> adjLsdb;
42 std::list<CorLsa> corLsdb;
43
44};
45
46#endif