akmhoque | bd7c8e6 | 2014-02-01 14:57:40 -0600 | [diff] [blame^] | 1 | #ifndef NLSR_LSDB_HPP |
| 2 | #define NLSR_LSDB_HPP |
| 3 | |
| 4 | #include "nlsr_lsa.hpp" |
| 5 | |
| 6 | using namespace std; |
| 7 | |
| 8 | class nlsr; |
| 9 | |
| 10 | class Lsdb{ |
| 11 | public: |
| 12 | Lsdb() |
| 13 | { |
| 14 | } |
| 15 | |
| 16 | |
| 17 | bool doesLsaExist(string key, int lsType); |
| 18 | // function related to Name LSDB |
| 19 | bool buildAndInstallOwnNameLsa(nlsr& nlsr); |
| 20 | 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 |
| 26 | bool buildAndInstallOwnCorLsa(nlsr& nlsr); |
| 27 | CorLsa& getCorLsa(string key); |
| 28 | bool installCorLsa(CorLsa &nlsa); |
| 29 | bool removeCorLsa(string& key); |
| 30 | void printCorLsdb(); //debugging |
| 31 | |
| 32 | private: |
| 33 | bool addNameLsa(NameLsa &nlsa); |
| 34 | bool doesNameLsaExist(string key); |
| 35 | bool doesAdjLsaExist(string key); |
| 36 | bool doesCorLsaExist(string key); |
| 37 | |
| 38 | private: |
| 39 | std::list<NameLsa> nameLsdb; |
| 40 | std::list<AdjLsa> adjLsdb; |
| 41 | std::list<CorLsa> corLsdb; |
| 42 | |
| 43 | }; |
| 44 | |
| 45 | #endif |