Update in Route Calculation
diff --git a/nlsr-sync-0.0/nlsr_npt.c b/nlsr-sync-0.0/nlsr_npt.c
index e3c8483..d70c5da 100755
--- a/nlsr-sync-0.0/nlsr_npt.c
+++ b/nlsr-sync-0.0/nlsr_npt.c
@@ -650,16 +650,17 @@
if ( face_list_element <= 0 )
{
if ( nlsr->debugging )
- printf(" Face: No Face \n");
+ printf(" Face: No Face \n");
if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__," Face: No Face \n");
+ writeLogg(__FILE__,__FUNCTION__,__LINE__," Face: No Face \n");
}
else
{
for(j=0;j<face_list_element;j++)
{
fle=ef->data;
- add_face_to_npt_by_face_id(rte->dest_router,fle->next_hop_face,fle->route_cost);
+ if (fle->next_hop_face > 0 )
+ add_face_to_npt_by_face_id(rte->dest_router,fle->next_hop_face,fle->route_cost);
hashtb_next(ef);
}
}
@@ -823,11 +824,6 @@
for (k=0;k<nl_element;k++)
{
nle=enle->data;
-
- //delete all the fib entries here
-
- //printf("Deleting face: Name:%s Face: %d\n",nle->name,fle->next_hop_face);
-
if( is_neighbor(nle->name) == 0 )
{
if ( nlsr->debugging )
@@ -851,7 +847,7 @@
memcpy(evdata+strlen(evdata),"|",1);
memcpy(evdata+strlen(evdata),faceid,strlen(faceid));
- nlsr->event = ccn_schedule_event(nlsr->sched, 1, &delete_old_face_from_npt, (void *)evdata, 0);
+ nlsr->event = ccn_schedule_event(nlsr->sched, 1, &delete_old_face_from_npt, (void *)evdata, 0);
}
diff --git a/nlsr-sync-0.0/nlsr_route.c b/nlsr-sync-0.0/nlsr_route.c
index 50e4532..b963f95 100755
--- a/nlsr-sync-0.0/nlsr_route.c
+++ b/nlsr-sync-0.0/nlsr_route.c
@@ -86,6 +86,7 @@
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 ) )
{
@@ -99,6 +100,7 @@
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);