blob: c6499f7dc5979adbe242b647ab82cbf6ef4eceb3 [file] [log] [blame]
akmhoqueba094742014-02-28 11:47:21 -06001#include <iostream>
2#include <cmath>
3#include "nlsr_lsdb.hpp"
4#include "nlsr_rtc.hpp"
5#include "nlsr_map.hpp"
6#include "nlsr_lsa.hpp"
7#include "nlsr_nexthop.hpp"
8#include "nlsr.hpp"
akmhoque05d5fcf2014-04-15 14:58:45 -05009#include "utility/nlsr_logger.hpp"
10
11#define THIS_FILE "nlsr_rtc.cpp"
akmhoqueba094742014-02-28 11:47:21 -060012
13namespace nlsr
14{
15
akmhoque5a44dd42014-03-12 18:11:32 -050016 using namespace std;
akmhoqueba094742014-02-28 11:47:21 -060017
akmhoque5a44dd42014-03-12 18:11:32 -050018 void
19 RoutingTableCalculator::allocateAdjMatrix()
20 {
21 adjMatrix = new double*[numOfRouter];
22 for(int i = 0; i < numOfRouter; ++i)
akmhoqueba094742014-02-28 11:47:21 -060023 {
akmhoque5a44dd42014-03-12 18:11:32 -050024 adjMatrix[i] = new double[numOfRouter];
25 }
26 }
27
28 void
29 RoutingTableCalculator::initMatrix()
30 {
31 for(int i=0; i<numOfRouter; i++)
32 {
33 for(int j=0; j<numOfRouter; j++)
34 adjMatrix[i][j]=0;
35 }
36 }
37
38 void
39 RoutingTableCalculator::makeAdjMatrix(Nlsr& pnlsr, Map pMap)
40 {
41 std::list<AdjLsa> adjLsdb=pnlsr.getLsdb().getAdjLsdb();
42 for( std::list<AdjLsa>::iterator it=adjLsdb.begin();
43 it!= adjLsdb.end() ; it++)
44 {
45 string linkStartRouter=(*it).getOrigRouter();
46 int row=pMap.getMappingNoByRouterName(linkStartRouter);
47 std::list<Adjacent> adl=(*it).getAdl().getAdjList();
48 for( std::list<Adjacent>::iterator itAdl=adl.begin();
49 itAdl!= adl.end() ; itAdl++)
50 {
akmhoque05d5fcf2014-04-15 14:58:45 -050051 string linkEndRouter=(*itAdl).getName();
akmhoque5a44dd42014-03-12 18:11:32 -050052 int col=pMap.getMappingNoByRouterName(linkEndRouter);
53 double cost=(*itAdl).getLinkCost();
54 if ( (row >= 0 && row<numOfRouter) && (col >= 0 && col<numOfRouter) )
akmhoqueba094742014-02-28 11:47:21 -060055 {
akmhoque5a44dd42014-03-12 18:11:32 -050056 adjMatrix[row][col]=cost;
akmhoqueba094742014-02-28 11:47:21 -060057 }
akmhoque5a44dd42014-03-12 18:11:32 -050058 }
akmhoqueba094742014-02-28 11:47:21 -060059 }
akmhoque5a44dd42014-03-12 18:11:32 -050060 }
akmhoqueba094742014-02-28 11:47:21 -060061
akmhoque5a44dd42014-03-12 18:11:32 -050062 void
63 RoutingTableCalculator::printAdjMatrix()
64 {
65 for(int i=0; i<numOfRouter; i++)
akmhoqueba094742014-02-28 11:47:21 -060066 {
akmhoque5a44dd42014-03-12 18:11:32 -050067 for(int j=0; j<numOfRouter; j++)
68 printf("%f ",adjMatrix[i][j]);
69 printf("\n");
akmhoqueba094742014-02-28 11:47:21 -060070 }
akmhoque5a44dd42014-03-12 18:11:32 -050071 }
akmhoqueba094742014-02-28 11:47:21 -060072
akmhoque5a44dd42014-03-12 18:11:32 -050073 void
74 RoutingTableCalculator::adjustAdMatrix(int source, int link, double linkCost)
75 {
76 for ( int i = 0; i < numOfRouter; i++ )
akmhoqueba094742014-02-28 11:47:21 -060077 {
akmhoque5a44dd42014-03-12 18:11:32 -050078 if ( i == link )
79 {
80 adjMatrix[source][i]=linkCost;
81 }
82 else
83 {
84 adjMatrix[source][i]=0;
85 }
akmhoqueba094742014-02-28 11:47:21 -060086 }
akmhoque5a44dd42014-03-12 18:11:32 -050087 }
akmhoqueba094742014-02-28 11:47:21 -060088
akmhoque5a44dd42014-03-12 18:11:32 -050089 int
90 RoutingTableCalculator::getNumOfLinkfromAdjMatrix(int sRouter)
91 {
92 int noLink=0;
93 for(int i=0; i<numOfRouter; i++)
akmhoqueba094742014-02-28 11:47:21 -060094 {
akmhoque5a44dd42014-03-12 18:11:32 -050095 if ( adjMatrix[sRouter][i] > 0 )
96 {
97 noLink++;
98 }
akmhoqueba094742014-02-28 11:47:21 -060099 }
akmhoque5a44dd42014-03-12 18:11:32 -0500100 return noLink;
101 }
akmhoqueba094742014-02-28 11:47:21 -0600102
akmhoque5a44dd42014-03-12 18:11:32 -0500103 void
104 RoutingTableCalculator::getLinksFromAdjMatrix(int *links,
105 double *linkCosts, int source)
106 {
107 int j=0;
108 for (int i=0; i <numOfRouter; i++)
akmhoqueba094742014-02-28 11:47:21 -0600109 {
akmhoque5a44dd42014-03-12 18:11:32 -0500110 if ( adjMatrix[source][i] > 0 )
111 {
112 links[j]=i;
113 linkCosts[j]=adjMatrix[source][i];
114 j++;
115 }
akmhoqueba094742014-02-28 11:47:21 -0600116 }
akmhoque5a44dd42014-03-12 18:11:32 -0500117 }
akmhoqueba094742014-02-28 11:47:21 -0600118
akmhoque5a44dd42014-03-12 18:11:32 -0500119 void
120 RoutingTableCalculator::freeAdjMatrix()
121 {
122 for(int i = 0; i < numOfRouter; ++i)
akmhoqueba094742014-02-28 11:47:21 -0600123 {
akmhoque5a44dd42014-03-12 18:11:32 -0500124 delete [] adjMatrix[i];
akmhoqueba094742014-02-28 11:47:21 -0600125 }
akmhoque5a44dd42014-03-12 18:11:32 -0500126 delete [] adjMatrix;
127 }
akmhoqueba094742014-02-28 11:47:21 -0600128
akmhoque5a44dd42014-03-12 18:11:32 -0500129
130 void
131 RoutingTableCalculator::allocateLinks()
132 {
133 links=new int[vNoLink];
134 }
135
136 void RoutingTableCalculator::allocateLinkCosts()
137 {
138 linkCosts=new double[vNoLink];
139 }
140
141
142 void
143 RoutingTableCalculator::freeLinks()
144 {
145 delete [] links;
146 }
147 void
148 RoutingTableCalculator::freeLinksCosts()
149 {
150 delete [] linkCosts;
151 }
152
153 void
154 LinkStateRoutingTableCalculator::calculatePath(Map& pMap,
155 RoutingTable& rt, Nlsr& pnlsr)
156 {
157 cout<<"LinkStateRoutingTableCalculator::calculatePath Called"<<endl;
158 allocateAdjMatrix();
159 initMatrix();
160 makeAdjMatrix(pnlsr,pMap);
161 cout<<pMap;
162 printAdjMatrix();
163 string routerName=pnlsr.getConfParameter().getRouterPrefix();
164 int sourceRouter=pMap.getMappingNoByRouterName(routerName);
165 int noLink=getNumOfLinkfromAdjMatrix(sourceRouter);
166 allocateParent();
167 allocateDistance();
168 if ( pnlsr.getConfParameter().getMaxFacesPerPrefix() == 1 )
akmhoqueba094742014-02-28 11:47:21 -0600169 {
akmhoque5a44dd42014-03-12 18:11:32 -0500170 // Single Path
171 doDijkstraPathCalculation(sourceRouter);
172 // print all ls path -- debugging purpose
173 printAllLsPath(sourceRouter);
174 // update routing table
175 addAllLsNextHopsToRoutingTable(pnlsr, rt, pMap, sourceRouter);
akmhoqueba094742014-02-28 11:47:21 -0600176 }
akmhoque5a44dd42014-03-12 18:11:32 -0500177 else
akmhoqueba094742014-02-28 11:47:21 -0600178 {
akmhoque5a44dd42014-03-12 18:11:32 -0500179 // Multi Path
180 setNoLink(getNumOfLinkfromAdjMatrix(sourceRouter));
181 allocateLinks();
182 allocateLinkCosts();
183 getLinksFromAdjMatrix(links, linkCosts, sourceRouter);
184 for (int i=0 ; i < vNoLink; i++)
185 {
186 adjustAdMatrix(sourceRouter,links[i], linkCosts[i]);
akmhoqueba094742014-02-28 11:47:21 -0600187 printAdjMatrix();
akmhoque5a44dd42014-03-12 18:11:32 -0500188 doDijkstraPathCalculation(sourceRouter);
189 // print all ls path -- debugging purpose
190 printAllLsPath(sourceRouter);
191 //update routing table
192 addAllLsNextHopsToRoutingTable(pnlsr, rt, pMap, sourceRouter);
193 }
194 freeLinks();
195 freeLinksCosts();
akmhoqueba094742014-02-28 11:47:21 -0600196 }
akmhoque5a44dd42014-03-12 18:11:32 -0500197 freeParent();
198 freeDistance();
199 freeAdjMatrix();
200 }
akmhoqueba094742014-02-28 11:47:21 -0600201
akmhoque5a44dd42014-03-12 18:11:32 -0500202 void
203 LinkStateRoutingTableCalculator::doDijkstraPathCalculation(int sourceRouter)
204 {
205 int i;
206 int v,u;
207 int *Q=new int[numOfRouter];
208 int head=0;
209 /* Initiate the Parent */
210 for (i = 0 ; i < numOfRouter; i++)
akmhoqueba094742014-02-28 11:47:21 -0600211 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500212 m_parent[i]=EMPTY_PARENT;
213 m_distance[i]=INF_DISTANCE;
akmhoque5a44dd42014-03-12 18:11:32 -0500214 Q[i]=i;
akmhoqueba094742014-02-28 11:47:21 -0600215 }
akmhoque5a44dd42014-03-12 18:11:32 -0500216 if ( sourceRouter != NO_MAPPING_NUM )
akmhoqueba094742014-02-28 11:47:21 -0600217 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500218 m_distance[sourceRouter]=0;
219 sortQueueByDistance(Q,m_distance,head,numOfRouter);
akmhoque5a44dd42014-03-12 18:11:32 -0500220 while (head < numOfRouter )
221 {
222 u=Q[head];
akmhoque05d5fcf2014-04-15 14:58:45 -0500223 if(m_distance[u] == INF_DISTANCE)
akmhoque5a44dd42014-03-12 18:11:32 -0500224 {
225 break;
226 }
227 for(v=0 ; v <numOfRouter; v++)
228 {
229 if( adjMatrix[u][v] > 0 )
230 {
231 if ( isNotExplored(Q,v,head+1,numOfRouter) )
232 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500233 if( m_distance[u] + adjMatrix[u][v] < m_distance[v])
akmhoque5a44dd42014-03-12 18:11:32 -0500234 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500235 m_distance[v]=m_distance[u] + adjMatrix[u][v] ;
236 m_parent[v]=u;
akmhoque5a44dd42014-03-12 18:11:32 -0500237 }
238 }
239 }
240 }
241 head++;
akmhoque05d5fcf2014-04-15 14:58:45 -0500242 sortQueueByDistance(Q,m_distance,head,numOfRouter);
akmhoque5a44dd42014-03-12 18:11:32 -0500243 }
244 }
245 delete [] Q;
246 }
247
248 void
249 LinkStateRoutingTableCalculator::addAllLsNextHopsToRoutingTable(Nlsr& pnlsr,
250 RoutingTable& rt, Map& pMap, int sourceRouter)
251 {
252 cout<<"LinkStateRoutingTableCalculator::addAllNextHopsToRoutingTable Called";
253 cout<<endl;
254 for(int i=0; i < numOfRouter ; i++)
255 {
256 if ( i!= sourceRouter )
257 {
258 int nextHopRouter=getLsNextHop(i,sourceRouter);
259 if ( nextHopRouter != NO_NEXT_HOP )
260 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500261 double routeCost=m_distance[i];
akmhoque5a44dd42014-03-12 18:11:32 -0500262 string nextHopRouterName=
263 pMap.getRouterNameByMappingNo(nextHopRouter);
264 int nxtHopFace=
265 pnlsr.getAdl().getAdjacent(nextHopRouterName).getConnectingFace();
266 cout<<"Dest Router: "<<pMap.getRouterNameByMappingNo(i)<<endl;
267 cout<<"Next hop Router: "<<nextHopRouterName<<endl;
268 cout<<"Next hop Face: "<<nxtHopFace<<endl;
269 cout<<"Route Cost: "<<routeCost<<endl;
270 cout<<endl;
271 // Add next hop to routing table
272 NextHop nh(nxtHopFace,routeCost);
273 rt.addNextHop(pMap.getRouterNameByMappingNo(i),nh);
274 }
275 }
276 }
277 }
278
279 int
280 LinkStateRoutingTableCalculator::getLsNextHop(int dest, int source)
281 {
282 int nextHop;
akmhoque05d5fcf2014-04-15 14:58:45 -0500283 while ( m_parent[dest] != EMPTY_PARENT )
akmhoque5a44dd42014-03-12 18:11:32 -0500284 {
285 nextHop=dest;
akmhoque05d5fcf2014-04-15 14:58:45 -0500286 dest=m_parent[dest];
akmhoque5a44dd42014-03-12 18:11:32 -0500287 }
288 if ( dest != source )
289 {
290 nextHop=NO_NEXT_HOP;
291 }
292 return nextHop;
293 }
294
295 void
296 LinkStateRoutingTableCalculator::printAllLsPath(int sourceRouter)
297 {
298 cout<<"LinkStateRoutingTableCalculator::printAllLsPath Called"<<endl;
299 cout<<"Source Router: "<<sourceRouter<<endl;
300 for(int i=0; i < numOfRouter ; i++)
301 {
302 if ( i!= sourceRouter )
303 {
304 printLsPath(i);
akmhoqueba094742014-02-28 11:47:21 -0600305 cout<<endl;
akmhoque5a44dd42014-03-12 18:11:32 -0500306 }
307 }
308 }
309
310 void
311 LinkStateRoutingTableCalculator::printLsPath(int destRouter)
312 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500313 if (m_parent[destRouter] != EMPTY_PARENT )
akmhoque5a44dd42014-03-12 18:11:32 -0500314 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500315 printLsPath(m_parent[destRouter]);
akmhoque5a44dd42014-03-12 18:11:32 -0500316 }
317 cout<<" "<<destRouter;
318 }
319
320 void
321 LinkStateRoutingTableCalculator::sortQueueByDistance(int *Q,
322 double *dist,int start,int element)
323 {
324 for ( int i=start ; i < element ; i ++)
325 {
326 for( int j=i+1; j<element; j ++)
327 {
328 if (dist[Q[j]] < dist[Q[i]])
akmhoqueba094742014-02-28 11:47:21 -0600329 {
akmhoque5a44dd42014-03-12 18:11:32 -0500330 int tempU=Q[j];
331 Q[j]=Q[i];
332 Q[i]=tempU;
akmhoqueba094742014-02-28 11:47:21 -0600333 }
akmhoque5a44dd42014-03-12 18:11:32 -0500334 }
akmhoqueba094742014-02-28 11:47:21 -0600335 }
akmhoque5a44dd42014-03-12 18:11:32 -0500336 }
akmhoqueba094742014-02-28 11:47:21 -0600337
akmhoque5a44dd42014-03-12 18:11:32 -0500338 int
339 LinkStateRoutingTableCalculator::isNotExplored(int *Q,
340 int u,int start, int element)
341 {
342 int ret=0;
343 for(int i=start; i< element; i++)
akmhoqueba094742014-02-28 11:47:21 -0600344 {
akmhoque5a44dd42014-03-12 18:11:32 -0500345 if ( Q[i] == u )
346 {
347 ret=1;
348 break;
349 }
350 }
351 return ret;
352 }
353
354 void
355 LinkStateRoutingTableCalculator::allocateParent()
356 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500357 m_parent=new int[numOfRouter];
akmhoque5a44dd42014-03-12 18:11:32 -0500358 }
359
360 void
361 LinkStateRoutingTableCalculator::allocateDistance()
362 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500363 m_distance= new double[numOfRouter];
akmhoque5a44dd42014-03-12 18:11:32 -0500364 }
365
366 void
367 LinkStateRoutingTableCalculator::freeParent()
368 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500369 delete [] m_parent;
akmhoque5a44dd42014-03-12 18:11:32 -0500370 }
371
372 void LinkStateRoutingTableCalculator::freeDistance()
373 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500374 delete [] m_distance;
akmhoque5a44dd42014-03-12 18:11:32 -0500375 }
376
377
378
379 void
380 HypRoutingTableCalculator::calculatePath(Map& pMap,
381 RoutingTable& rt, Nlsr& pnlsr)
382 {
383 makeAdjMatrix(pnlsr,pMap);
384 string routerName=pnlsr.getConfParameter().getRouterPrefix();
385 int sourceRouter=pMap.getMappingNoByRouterName(routerName);
386 int noLink=getNumOfLinkfromAdjMatrix(sourceRouter);
387 setNoLink(noLink);
388 allocateLinks();
389 allocateLinkCosts();
390 getLinksFromAdjMatrix(links, linkCosts, sourceRouter);
391 for(int i=0 ; i < numOfRouter ; ++i)
392 {
393 int k=0;
394 if ( i != sourceRouter)
395 {
396 allocateLinkFaces();
397 allocateDistanceToNeighbor();
398 allocateDistFromNbrToDest();
399 for(int j=0; j<vNoLink; j++)
akmhoqueba094742014-02-28 11:47:21 -0600400 {
akmhoque5a44dd42014-03-12 18:11:32 -0500401 string nextHopRouterName=pMap.getRouterNameByMappingNo(links[j]);
402 int nextHopFace=
403 pnlsr.getAdl().getAdjacent(nextHopRouterName).getConnectingFace();
404 double distToNbr=getHyperbolicDistance(pnlsr,pMap,
405 sourceRouter,links[j]);
406 double distToDestFromNbr=getHyperbolicDistance(pnlsr,
407 pMap,links[j],i);
408 if ( distToDestFromNbr >= 0 )
409 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500410 m_linkFaces[k] = nextHopFace;
411 m_distanceToNeighbor[k] = distToNbr;
412 m_distFromNbrToDest[k] = distToDestFromNbr;
akmhoque5a44dd42014-03-12 18:11:32 -0500413 k++;
414 }
akmhoqueba094742014-02-28 11:47:21 -0600415 }
akmhoque5a44dd42014-03-12 18:11:32 -0500416 addHypNextHopsToRoutingTable(pnlsr,pMap,rt,k,i);
417 freeLinkFaces();
418 freeDistanceToNeighbor();
419 freeDistFromNbrToDest();
420 }
akmhoqueba094742014-02-28 11:47:21 -0600421 }
akmhoque5a44dd42014-03-12 18:11:32 -0500422 freeLinks();
423 freeLinksCosts();
424 freeAdjMatrix();
425 }
akmhoqueba094742014-02-28 11:47:21 -0600426
akmhoque5a44dd42014-03-12 18:11:32 -0500427 void
428 HypRoutingTableCalculator::addHypNextHopsToRoutingTable(Nlsr& pnlsr,Map& pMap,
429 RoutingTable& rt, int noFaces, int dest)
430 {
431 for(int i=0 ; i < noFaces ; ++i)
akmhoqueba094742014-02-28 11:47:21 -0600432 {
akmhoque5a44dd42014-03-12 18:11:32 -0500433 string destRouter=pMap.getRouterNameByMappingNo(dest);
akmhoque05d5fcf2014-04-15 14:58:45 -0500434 NextHop nh(m_linkFaces[i],m_distFromNbrToDest[i]);
akmhoque5a44dd42014-03-12 18:11:32 -0500435 rt.addNextHop(destRouter,nh);
akmhoque05d5fcf2014-04-15 14:58:45 -0500436 if( m_isDryRun)
akmhoque5a44dd42014-03-12 18:11:32 -0500437 {
438 rt.addNextHopToDryTable(destRouter,nh);
439 }
akmhoqueba094742014-02-28 11:47:21 -0600440 }
akmhoque5a44dd42014-03-12 18:11:32 -0500441 }
akmhoqueba094742014-02-28 11:47:21 -0600442
akmhoque5a44dd42014-03-12 18:11:32 -0500443 double
444 HypRoutingTableCalculator::getHyperbolicDistance(Nlsr& pnlsr,
445 Map& pMap, int src, int dest)
446 {
447 double distance=0.0;
448 string srcRouterKey=pMap.getRouterNameByMappingNo(src)+"/3";
449 string destRouterKey=pMap.getRouterNameByMappingNo(dest)+"/3";
450 double srcRadius=(pnlsr.getLsdb().getCorLsa(srcRouterKey).first).getCorRadius();
451 double srcTheta=(pnlsr.getLsdb().getCorLsa(srcRouterKey).first).getCorTheta();
452 double destRadius=(pnlsr.getLsdb().getCorLsa(
453 destRouterKey).first).getCorRadius();
454 double destTheta=(pnlsr.getLsdb().getCorLsa(destRouterKey).first).getCorTheta();
455 double diffTheta = fabs (srcTheta - destTheta);
456 if (diffTheta > MATH_PI)
akmhoqueba094742014-02-28 11:47:21 -0600457 {
akmhoque5a44dd42014-03-12 18:11:32 -0500458 diffTheta = 2 * MATH_PI - diffTheta;
akmhoqueba094742014-02-28 11:47:21 -0600459 }
akmhoque5a44dd42014-03-12 18:11:32 -0500460 if ( srcRadius != -1 && destRadius != -1 )
akmhoqueba094742014-02-28 11:47:21 -0600461 {
akmhoque5a44dd42014-03-12 18:11:32 -0500462 if (diffTheta == 0)
463 distance = fabs (srcRadius - destRadius);
464 else
465 distance = acosh((cosh(srcRadius)*cosh(destRadius))-
466 (sinh(srcRadius)*sinh(destRadius)*cos(diffTheta)));
akmhoqueba094742014-02-28 11:47:21 -0600467 }
akmhoque5a44dd42014-03-12 18:11:32 -0500468 else
akmhoqueba094742014-02-28 11:47:21 -0600469 {
akmhoque5a44dd42014-03-12 18:11:32 -0500470 distance = -1;
akmhoqueba094742014-02-28 11:47:21 -0600471 }
akmhoque5a44dd42014-03-12 18:11:32 -0500472 return distance;
473 }
akmhoqueba094742014-02-28 11:47:21 -0600474
akmhoque5a44dd42014-03-12 18:11:32 -0500475 void
476 HypRoutingTableCalculator::allocateLinkFaces()
477 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500478 m_linkFaces=new int[vNoLink];
akmhoque5a44dd42014-03-12 18:11:32 -0500479 }
akmhoqueba094742014-02-28 11:47:21 -0600480
akmhoque5a44dd42014-03-12 18:11:32 -0500481 void
482 HypRoutingTableCalculator::allocateDistanceToNeighbor()
483 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500484 m_distanceToNeighbor=new double[vNoLink];
akmhoque5a44dd42014-03-12 18:11:32 -0500485 }
akmhoqueba094742014-02-28 11:47:21 -0600486
akmhoque5a44dd42014-03-12 18:11:32 -0500487 void
488 HypRoutingTableCalculator::allocateDistFromNbrToDest()
489 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500490 m_distFromNbrToDest=new double[vNoLink];
akmhoque5a44dd42014-03-12 18:11:32 -0500491 }
akmhoqueba094742014-02-28 11:47:21 -0600492
akmhoque5a44dd42014-03-12 18:11:32 -0500493 void
494 HypRoutingTableCalculator::freeLinkFaces()
495 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500496 delete [] m_linkFaces;
akmhoque5a44dd42014-03-12 18:11:32 -0500497 }
akmhoqueba094742014-02-28 11:47:21 -0600498
akmhoque5a44dd42014-03-12 18:11:32 -0500499 void
500 HypRoutingTableCalculator::freeDistanceToNeighbor()
501 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500502 delete [] m_distanceToNeighbor;
akmhoque5a44dd42014-03-12 18:11:32 -0500503 }
akmhoqueba094742014-02-28 11:47:21 -0600504
akmhoque5a44dd42014-03-12 18:11:32 -0500505 void
506 HypRoutingTableCalculator::freeDistFromNbrToDest()
507 {
akmhoque05d5fcf2014-04-15 14:58:45 -0500508 delete [] m_distFromNbrToDest;
akmhoque5a44dd42014-03-12 18:11:32 -0500509 }
akmhoqueba094742014-02-28 11:47:21 -0600510
511}//namespace nlsr