7 const std::string &dst,
8 const std::string &qos,
9 const unsigned short &metric,
13 neig[qos][addr] = metric;
22 myEntry->
links[dst] = metric;
33 const std::string &dst,
34 const std::string &qos,
37 neig[qos].erase(addr);
39 if(
neig[qos].size() <= 0)
52 myEntry->
links.erase(dst);
64 Enter_Method_Silent();
69 scheduleAt(simTime() +
updateTimeout,
new cMessage(
"Time2Update"));
83 std::string qos = qosIt->first;
88 ret[
qosPaddr(qos, (*it)->addr)] = (*it)->addr;
97 if (ret[tIt->first] == tIt->second){
98 ret.erase(tIt->first);
115 std::string qos = qosIt->first;
120 ret[
qosPaddr(qos, (*it)->addr)] = (*it)->addr;
138 for(
linksIt it = links->begin(); it !=links->end(); it++)
140 waiting[it->first] =
psT(&t, it->second);
143 while(!waiting.empty())
145 unsigned short min = UINT16_MAX;
148 for (
wMapIt it = waiting.begin(); it != waiting.end(); it++)
150 if(it->second.metric < min)
152 min = it->second.metric;
155 if(it->second.metric == min)
157 mins.push_back(it->first);
163 std::string addr = mins.back();
166 psT ps = waiting[addr];
170 ps.
p->
chl.insert(nt);
174 links = &(ls[addr].links);
176 for(
linksIt it = links->begin(); it !=links->end(); it++)
178 std::string daddr = it->first;
180 if(added.find(daddr) == added.end())
182 wMapIt eI = waiting.find(daddr);
184 if(eI == waiting.end())
186 waiting[daddr] =
psT(nt, ps.
metric + it->second);
189 else if(eI->second.metric > ps.
metric + it->second)
191 eI->second.metric = ps.
metric + it->second;
203 const std::string &qos,
204 const std::string &next,
TreeNode * t)
208 ret[
qosPaddr(qos, (*it)->addr)] = next;
217 std::string qos = up->
getQoS();
228 std::string node = it->first;
230 if((*st)[node].sId < it->second.sId){
231 (*st)[node] = it->second;
248 myAddr = par(
"myAddr").stdstringValue();
266 if(msg->isSelfMessage())
277 it2 != it->second.end();
302 for(
addrSetIt it = set->begin(); it != set->end(); it++)
315 EV <<
"I'm "<<
myAddr<<endl;
322 EV <<
" QoS " << qosIt->first<<endl;
335 EV<<
" " << t->
addr <<
" -> "<<next <<
" ("<<t->
metric<<
") "
336 <<
" c: "<< t->
chl.size() << endl;
std::map< std::string, linksU > linksSt
neighMetric::iterator neighMetricIt
virtual void insertFlow(const Address &addr, const std::string &dst, const std::string &qos, const unsigned short &metric, bool sendUpdate)
linksSt getChangedEntries(const std::string &qos)
virtual void removeFlow(const Address &addr, const std::string &dst, const std::string &qos, bool sendUpdate)
const APN & getIpcAddress() const
Getter of IPC Process address which should be unambiguous within DIF.
entries2Next getChanges()
std::map< std::string, psT > wMap
std::vector< std::string > addrList
qosNeighMetric::iterator qosNeighMetricIt
void handleMessage(cMessage *msg)
void addRecursive(entries2Next &ret, const std::string &qos, const std::string &next, TreeNode *t)
unsigned int updateTimeout
std::set< std::string > addrSet
linksStCol::iterator linksStColIt
std::set< TreeNode * > chl
std::map< qosPaddr, std::string > entries2Next
addrSet::iterator addrSetIt
bool processUpdate(IntRoutingUpdate *update)
std::map< std::string, unsigned short >::iterator linksIt
virtual void scheduleUpdate()
std::pair< std::string, linksU > linksStEntry
std::map< std::string, unsigned short > aMap
std::map< std::string, unsigned short > links
void printTreeNode(TreeNode *t, const std::string &next)
std::set< TreeNode * >::iterator TreeNodeIt
entries2Next::iterator entries2NextIt
void sendUpdate(IntRoutingUpdate *update)
std::pair< std::string, std::string > qosPaddr
const std::string & getName() const
Gets APN string name representation.
linksSt::iterator linksStIt
Register_Class(PortsLoadLS)
Address class holds IPC Process identification.
TreeNode constructTree(linksSt &ls)