akmhoque | fd1dd0a | 2014-02-01 01:11:35 -0600 | [diff] [blame^] | 1 | #include<string> |
| 2 | #include<iostream> |
| 3 | #include<algorithm> |
| 4 | |
| 5 | #include "nlsr_lsa.hpp" |
| 6 | |
| 7 | using namespace std; |
| 8 | |
| 9 | string |
| 10 | Lsa::getLsaKey() |
| 11 | { |
| 12 | string key; |
| 13 | key=origRouter + "/" + boost::lexical_cast<std::string>(lsType) + "/" |
| 14 | + boost::lexical_cast<std::string>(lsSeqNo); |
| 15 | return key; |
| 16 | } |
| 17 | |
| 18 | string |
| 19 | NameLsa::getNameLsaData() |
| 20 | { |
| 21 | string nameLsaData; |
| 22 | nameLsaData=origRouter + "|" + boost::lexical_cast<std::string>(lsType) + "|" |
| 23 | + boost::lexical_cast<std::string>(lsSeqNo) + "|" |
| 24 | + boost::lexical_cast<std::string>(lifeTime); |
| 25 | nameLsaData+="|"; |
| 26 | nameLsaData+=boost::lexical_cast<std::string>(npl.getNplSize()); |
| 27 | |
| 28 | std::list<string> nl=npl.getNameList(); |
| 29 | for( std::list<string>::iterator it=nl.begin(); it != nl.end(); it++) |
| 30 | { |
| 31 | nameLsaData+="|"; |
| 32 | nameLsaData+=(*it); |
| 33 | } |
| 34 | |
| 35 | return nameLsaData; |
| 36 | } |
| 37 | |