Tracking Bug
diff --git a/nlsr-sync-0.0/nlsr_npt.c b/nlsr-sync-0.0/nlsr_npt.c
index e9d9d73..a050f1c 100755
--- a/nlsr-sync-0.0/nlsr_npt.c
+++ b/nlsr-sync-0.0/nlsr_npt.c
@@ -235,11 +235,6 @@
for( j=first_face; j>= last_face; j--)
{
- //printf("Adding face: Name:%s Face: %d\n",nle->name,faces[j]);
- //printf("Orig Router: %s \n",orig_router);
- //printf("Name Prefix: %s \n",nle->name);
- //printf("Is neighbor Orig Router: %d \n",is_neighbor(orig_router));
- //printf("Is neighbor Name Prefix: %d \n",is_neighbor(nle->name));
if ( is_neighbor(orig_router) == 0 )
{
@@ -247,7 +242,6 @@
printf("Adding face: Name:%s Face: %d\n",nle->name,faces[j]);
if ( nlsr->detailed_logging )
writeLogg(__FILE__,__FUNCTION__,__LINE__,"Adding face: Name:%s Face: %d\n",nle->name,faces[j]);
- //printf("Adding face: Name:%s Face: %d\n",nle->name,faces[j]);
add_delete_ccn_face_by_face_id(nlsr->ccn, (const char *)nle->name, OP_REG, faces[j]);
}
else
@@ -258,7 +252,6 @@
printf("Adding face: Name:%s Face: %d\n",nle->name,faces[j]);
if ( nlsr->detailed_logging )
writeLogg(__FILE__,__FUNCTION__,__LINE__,"Adding face: Name:%s Face: %d\n",nle->name,faces[j]);
- //printf("Adding face: Name:%s Face: %d\n",nle->name,faces[j]);
add_delete_ccn_face_by_face_id(nlsr->ccn, (const char *)nle->name, OP_REG, faces[j]);
}
}
@@ -376,10 +369,6 @@
}
-
-
-
- //hashtb_delete(enle); has to delete later
}
hashtb_end(enle);
@@ -431,7 +420,6 @@
printf(" Origination Router: %s \n",ne->orig_router);
if ( nlsr->detailed_logging )
writeLogg(__FILE__,__FUNCTION__,__LINE__," Origination Router: %s \n",ne->orig_router);
- //ne->next_hop_face == NO_FACE ? printf(" Next Hop Face: NO_NEXT_HOP \n") : printf(" Next Hop Face: %d \n", ne->next_hop_face);
int j, nl_element,face_list_element;
struct name_list_entry *nle;
@@ -607,7 +595,6 @@
fle=ef->data;
fle->next_hop_face=face_id;
fle->route_cost=route_cost;
- //hashtb_delete(ef);
}
hashtb_end(ef);
}
@@ -660,8 +647,7 @@
for(j=0;j<face_list_element;j++)
{
fle=ef->data;
- if (fle->next_hop_face > 0 )
- add_face_to_npt_by_face_id(rte->dest_router,fle->next_hop_face,fle->route_cost);
+ add_face_to_npt_by_face_id(rte->dest_router,fle->next_hop_face,fle->route_cost);
hashtb_next(ef);
}
}
@@ -727,7 +713,9 @@
{
return -1;
}
-
+
+ print_npt();
+
nlsr_lock();
if ( nlsr->debugging )
diff --git a/nlsr-sync-0.0/nlsr_route.c b/nlsr-sync-0.0/nlsr_route.c
index b963f95..7fa10ea 100755
--- a/nlsr-sync-0.0/nlsr_route.c
+++ b/nlsr-sync-0.0/nlsr_route.c
@@ -80,13 +80,12 @@
int num_link=get_no_link_from_adj_matrix(adj_matrix, map_element ,source);
- if ( (num_link == 0) || (nlsr->multi_path_face_num <= 1 ) )
+ if ( (num_link == 0) || (nlsr->multi_path_face_num == 1 ) )
{
calculate_path(adj_matrix,parent,dist, map_element, source);
print_all_path_from_source(parent,source);
print_all_next_hop(parent,source);
update_routing_table_with_new_route(parent, dist,source);
- print_routing_table();
}
else if ( (num_link != 0) && (nlsr->multi_path_face_num > 1 ) )
{
@@ -100,18 +99,18 @@
print_all_path_from_source(parent,source);
print_all_next_hop(parent,source);
update_routing_table_with_new_route(parent, dist,source);
- print_routing_table();
}
free(links);
free(link_costs);
}
- update_npt_with_new_route();
-
print_routing_table();
print_npt();
+ //update_npt_with_new_route();
+
+
for(i = 0; i < map_element; i++)
{
free(adj_matrix[i]);
@@ -1136,10 +1135,8 @@
if (orig_router != NULL )
{
int next_hop_router_num=get_next_hop_from_calculation(parent,me->mapping,source);
- //printf(" Next hop router Num: %d ",next_hop_router_num);
if ( next_hop_router_num == NO_NEXT_HOP )
{
- //update_npt_with_new_route(orig_router,NO_FACE);
if ( nlsr->debugging )
printf ("Orig_router: %s Next Hop Face: %d \n",orig_router,NO_FACE);
if ( nlsr->detailed_logging )
@@ -1148,9 +1145,7 @@
else
{
char *next_hop_router=get_router_from_rev_map(next_hop_router_num);
- //printf("Next hop router name: %s \n",next_hop_router);
int next_hop_face=get_next_hop_face_from_adl(next_hop_router);
- //update_npt_with_new_route(orig_router,next_hop_face);
update_routing_table(orig_router,next_hop_face,dist[me->mapping]);
if ( nlsr->debugging )
printf ("Orig_router: %s Next Hop Face: %d \n",orig_router,next_hop_face);