Routing Table Calculation and Fib Manipulation Complete
diff --git a/nlsr_adl.c b/nlsr_adl.c
index c04aeda..a22ecde 100644
--- a/nlsr_adl.c
+++ b/nlsr_adl.c
@@ -21,6 +21,7 @@
#include "nlsr_npl.h"
#include "nlsr_adl.h"
#include "utility.h"
+#include "nlsr_npt.h"
void
add_nbr_to_adl(struct name_prefix *new_nbr,int face)
@@ -632,4 +633,32 @@
}
+int
+get_next_hop_face_from_adl(char *nbr)
+{
+ int res;
+ int connecting_face=NO_FACE;
+ struct ndn_neighbor *nnbr;
+
+ struct hashtb_enumerator ee;
+ struct hashtb_enumerator *e = ⅇ
+
+ hashtb_start(nlsr->adl, e);
+ res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
+
+ if( res == HT_OLD_ENTRY )
+ {
+ nnbr=e->data;
+ connecting_face=nnbr->face;
+
+ }
+ else if(res == HT_NEW_ENTRY)
+ {
+ hashtb_delete(e);
+ }
+
+ hashtb_end(e);
+ return connecting_face;
+}
+