Multi Path Routing Complete
diff --git a/macbook.conf b/macbook.conf
index e780f00..58d76b4 100644
--- a/macbook.conf
+++ b/macbook.conf
@@ -1,9 +1,9 @@
#----configuration file for macbook----------
#
router-name /ndn/memphis.edu/netlab/macbook/
-ccnneighbor /ndn/memphis.edu/dunhall/castor face14
+ccnneighbor /ndn/memphis.edu/dunhall/castor face10
ccnneighbor /ndn/memphis.edu/joneshall/mira/ face11
-ccnneighbor /ndn/memphis.edu/netlab/pollux face30
+ccnneighbor /ndn/memphis.edu/netlab/pollux face12
ccnname /ndn/memphis.edu/patterson
ccnname /ndn/memphis.edu/houston/
#------lsdb-synch-interval-----
@@ -12,3 +12,4 @@
interest-resend-time 5
lsa-refresh-time 600
router-dead-interval 900
+multi-path-face-num 2
diff --git a/nlsr_npt.c b/nlsr_npt.c
index d5ce2cc..5116b4d 100644
--- a/nlsr_npt.c
+++ b/nlsr_npt.c
@@ -233,6 +233,7 @@
{
if( is_neighbor(nle->name) == 0 )
{
+ 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]);
}
}
@@ -240,6 +241,7 @@
{
if ( num_face-nlsr->multi_path_face_num > 0 && is_neighbor(orig_router) == 0 )
{
+ 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]);
}
}
@@ -337,6 +339,7 @@
{
if( is_neighbor(nle->name) == 0 )
{
+ printf("Deleting face: Name:%s Face: %d\n",nle->name,faces[j]);
add_delete_ccn_face_by_face_id(nlsr->ccn, (const char *)nle->name, OP_UNREG, faces[j]);
}
}
@@ -344,6 +347,7 @@
{
if ( num_face-nlsr->multi_path_face_num > 0 && is_neighbor(orig_router) == 0 )
{
+ printf("Deleting face: Name:%s Face: %d\n",nle->name,faces[j]);
add_delete_ccn_face_by_face_id(nlsr->ccn, (const char *)nle->name, OP_UNREG, faces[j]);
}
}
@@ -727,6 +731,7 @@
//delete all the fib entries here
if( is_neighbor(nle->name) == 0 )
{
+ printf("Deleting face: Name:%s Face: %d\n",nle->name,fle->next_hop_face);
add_delete_ccn_face_by_face_id(nlsr->ccn, (const char *)nle->name, OP_UNREG, fle->next_hop_face);
}
@@ -925,6 +930,7 @@
{
if( is_neighbor(nle->name) == 0 )
{
+ printf("Deleting face: Name:%s Face: %d\n",nle->name,faces[j]);
add_delete_ccn_face_by_face_id(nlsr->ccn, (const char *)nle->name, OP_UNREG, faces[j]);
}
}
@@ -932,6 +938,7 @@
{
if ( num_face-nlsr->multi_path_face_num > 0 && is_neighbor(orig_router) == 0 )
{
+ printf("Deleting face: Name:%s Face: %d\n",nle->name,faces[j]);
add_delete_ccn_face_by_face_id(nlsr->ccn, (const char *)nle->name, OP_UNREG, faces[j]);
}
}
diff --git a/nlsr_route.c b/nlsr_route.c
index 17bfafc..2faaf21 100644
--- a/nlsr_route.c
+++ b/nlsr_route.c
@@ -74,14 +74,14 @@
int num_link=get_no_link_from_adj_matrix(adj_matrix, map_element ,source);
- if ( (num_link == 0) || (nlsr->multi_path_face_num == 0 ) )
+ 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);
}
- else if ( (num_link != 0) && (nlsr->multi_path_face_num != 0 ) )
+ else if ( (num_link != 0) && (nlsr->multi_path_face_num >= 1 ) )
{
long int *links=(long int *)malloc(num_link*sizeof(long int));
long int *link_costs=(long int *)malloc(num_link*sizeof(long int));