blob: b6ba60522ee7f536d24e90936591afeb0eb8a6da [file] [log] [blame]
akmhoquefd1dd0a2014-02-01 01:11:35 -06001#include<string>
2#include<iostream>
3#include<algorithm>
4
5#include "nlsr_lsa.hpp"
6
7using namespace std;
8
9string
10Lsa::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
18string
19NameLsa::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