diff --git a/Makefile b/Makefile
index 94d2529..de1f4c7 100644
--- a/Makefile
+++ b/Makefile
@@ -6,8 +6,8 @@
 
 all: $(PROGRAMS)
 
-nlsr: nlsr.c nlsr_adl.c nlsr_lsdb.c nlsr_ndn.c utility.c
-	$(CC) $(CFLAGS) nlsr.c nlsr_adl.c nlsr_lsdb.c nlsr_ndn.c utility.c -o nlsr $(LIBS)
+nlsr: nlsr.c nlsr_ndn.c nlsr_lsdb.c nlsr_adl.c utility.c
+	$(CC) $(CFLAGS) nlsr.c nlsr_ndn.c nlsr_lsdb.c nlsr_adl.c utility.c -o nlsr $(LIBS)
 
 clean:
 	rm -f *.o
diff --git a/nlsr.c b/nlsr.c
index 1576bc4..9d7438e 100644
--- a/nlsr.c
+++ b/nlsr.c
@@ -19,9 +19,9 @@
 
 #include "nlsr.h"
 #include "nlsr_ndn.h"
-#include "utility.h"
-#include "nlsr_adl.h"
 #include "nlsr_lsdb.h"
+#include "nlsr_adl.h"
+#include "utility.h"
 
 
 struct option longopts[] =
@@ -90,9 +90,11 @@
 		printf(" Wrong Command Format ( router-name /router/name )\n");
 		return;
 	}
-	nlsr->router_name=(char *)malloc(strlen(rtr_name)+1);
-	memcpy(nlsr->router_name,rtr_name,strlen(rtr_name)+1);	
-	printf("Router Name: %s\n",nlsr->router_name);
+	
+	nlsr->router_name->name=(char *)malloc(strlen(rtr_name)+1);
+	memcpy(nlsr->router_name->name,rtr_name,strlen(rtr_name)+1);
+	nlsr->router_name->length=strlen(rtr_name)+1;
+
 }
 
 void 
@@ -106,28 +108,25 @@
 	}
 	char *rem;
 	const char *sep=" \t\n";
-	char *name_prefix;
-	name_prefix=strtok_r(command,sep,&rem);
-	if(name_prefix==NULL)
+	char *name;
+	name=strtok_r(command,sep,&rem);
+	if(name==NULL)
 	{
 		printf(" Wrong Command Format ( ccnname /name/prefix/ )\n");
 		return;
 	}
 
-	printf("Name Prefix: %s \n",name_prefix);
+	printf("Name Prefix: %s \n",name);
 
-	struct name_prefix *np=(struct name_prefix *)malloc(sizeof(struct name_prefix *));
-	np->name=(char *)malloc(strlen(name_prefix)+1);
-	memcpy(np->name,name_prefix,strlen(name_prefix)+1);
-	np->length=strlen(name_prefix)+1;
-
+	struct name_prefix *np=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+	np->name=(char *)malloc(strlen(name)+1);
+	memcpy(np->name,name,strlen(name)+1);
+	np->length=strlen(name)+1;
+	
 	add_name_prefix_to_npl(np);
-	/* Debugging Purpose */
-	print_name_prefix_from_npl();
 
-	free(np->name);
 	free(np);
-
+	
 		
 }
 
@@ -168,22 +167,14 @@
 		return;
 	}
 
-	struct ndn_neighbor *nbr=(struct ndn_neighbor *)malloc(sizeof(struct ndn_neighbor*));
-	nbr->neighbor=ccn_charbuf_create();
-	ccn_charbuf_append_string(nbr->neighbor,rtr_name);
-	nbr->face=face_id;
-	nbr->status=NBR_DOWN;	
+	struct name_prefix *np=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+	np->name=(char *)malloc(strlen(rtr_name)+1);
+	memcpy(np->name,rtr_name,strlen(rtr_name)+1);
+	np->length=strlen(rtr_name)+1;
 
-	
+	add_adjacent_to_adl(np,face_id);
 
-	add_adjacent_to_adl(nbr);
-	print_adjacent_from_adl();
-
-	//free(nbr->neighbor->name);
-	ccn_charbuf_destroy(&nbr->neighbor);
-	free(nbr->neighbor);
-	free(nbr);
-
+	free(np);
 }
 
 void 
@@ -340,22 +331,22 @@
 	printf("\nadd_name_prefix called\n");
 	printf("Name Prefix: %s and length: %d \n",np->name,np->length);
 
-	struct name_prefix *hnp=(struct name_prefix *)malloc(sizeof(struct name_prefix *));
+	struct name_prefix *hnp=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
 
 	struct hashtb_enumerator ee;
     	struct hashtb_enumerator *e = &ee; 	
     	int res;
 
    	hashtb_start(nlsr->npl, e);
-    	res = hashtb_seek(e, np->name, strlen(np->name), 0);
+    	res = hashtb_seek(e, np->name, np->length, 0);
 
 	if(res == HT_NEW_ENTRY)
 	{   
 
 		hnp = e->data;
-		hnp->name=(char *)malloc(np->length);
-    		memcpy(hnp->name,np->name,np->length);
 		hnp->length=np->length;
+		hnp->name=(char *)malloc(np->length);
+		memcpy(hnp->name,np->name,np->length);
 	}
     	
 	hashtb_end(e);
@@ -395,53 +386,82 @@
 nlsr_destroy( void )
 {
 
+	printf("Freeing Allocated Memory....\n");	
 	/* Destroying every hash table attached to each neighbor in ADL before destorying ADL */	
 
 	int i, element;
-	struct ndn_neighbor *nbr;
-
 	struct hashtb_enumerator ee;
     	struct hashtb_enumerator *e = &ee;
     	
-    	hashtb_start(nlsr->adl, e);
+	/*destroying NAME LSDB */
+	struct nlsr *name_lsa;
+	hashtb_start(nlsr->lsdb->name_lsdb, e);
+	element=hashtb_n(nlsr->lsdb->name_lsdb);
+
+	for(i=0;i<element;i++)
+	{
+		name_lsa=e->data;
+		free(name_lsa);	
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);    	
+	hashtb_destroy(&nlsr->lsdb->name_lsdb);
+
+
+	/*destroying ADJ LSDB */
+	struct alsr *adj_lsa;
+	hashtb_start(nlsr->lsdb->adj_lsdb, e);
+	element=hashtb_n(nlsr->lsdb->adj_lsdb);
+
+	for(i=0;i<element;i++)
+	{
+		adj_lsa=e->data;
+		free(adj_lsa);	
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+	
+
+	hashtb_destroy(&nlsr->lsdb->adj_lsdb);
+
+	/* Destroying NPL */
+	struct ccn_charbuf *np;
+	hashtb_start(nlsr->npl, e);
+	element=hashtb_n(nlsr->npl);
+
+	for(i=0;i<element;i++)
+	{
+		np=e->data;	
+		free(np);
+		hashtb_next(e);		
+	}
+	hashtb_end(e);
+	hashtb_destroy(&nlsr->npl);
+
+	/* Destroying ADL */
+	struct ndn_neighbor *nbr;
+	hashtb_start(nlsr->adl, e);
 	element=hashtb_n(nlsr->adl);
 
 	for(i=0;i<element;i++)
 	{
 		nbr=e->data;
-		hashtb_destroy(&nbr->lsa_update_queue);	
-		ccn_charbuf_destroy(&nbr->neighbor);
+		free(nbr);	
 		hashtb_next(e);		
 	}
 	hashtb_end(e);
 	hashtb_destroy(&nlsr->adl);
 
-	/* Destroying every element in Name LSDB Hash Table */
-	hashtb_start(nlsr->adl, e);
-	element=hashtb_n(nlsr->lsdb->name_lsdb);
 
-	struct nlsa *name_lsa;
-
-	for(i=0;i<element;i++)
-	{
-		name_lsa=e->data;	
-		ccn_charbuf_destroy(&name_lsa->name_prefix);
-		ccn_charbuf_destroy(&name_lsa->header->orig_router);
-		free(name_lsa->header);
-		free(name_lsa);
-		hashtb_next(e);		
-	}
-	hashtb_end(e);
-
-	hashtb_destroy(&nlsr->lsdb->name_lsdb);
-
-	hashtb_destroy(&nlsr->lsdb->adj_lsdb);
-
-	hashtb_destroy(&nlsr->npl);
+	
 	ccn_schedule_destroy(&nlsr->sched);
 	ccn_destroy(&nlsr->ccn);
 	free(nlsr);
 
+	printf("Finished freeing allocated memory\n");
+
 }
 
 void
@@ -456,20 +476,29 @@
 	nlsr=(struct nlsr *)malloc(sizeof(struct nlsr));
 
 	nlsr->adl=hashtb_create(sizeof(struct ndn_neighbor), &param_adl);
-	nlsr->npl = hashtb_create(sizeof(struct name_prefix), &param_npl);
+	nlsr->npl = hashtb_create(sizeof(struct name_prefix ), &param_npl);
+	
 	nlsr->in_interest.p = &incoming_interest;
 	nlsr->in_content.p = &incoming_content;
 
-	nlsr->lsdb=(struct linkStateDatabase *)malloc(sizeof(struct linkStateDatabase *));
-	nlsr->lsdb->version=0;
+	nlsr->lsdb=(struct linkStateDatabase *)malloc(sizeof(struct linkStateDatabase ));
+	char *time_stamp=get_current_timestamp_micro();
+	nlsr->lsdb->version=(char *)malloc(strlen(time_stamp)+1);
+	memcpy(nlsr->lsdb->version,time_stamp,strlen(time_stamp)+1);
+	memset(nlsr->lsdb->version,'0',strlen(time_stamp));
+	
 
 	nlsr->lsdb->adj_lsdb = hashtb_create(sizeof(struct alsa), &param_adj_lsdb);
 	nlsr->lsdb->name_lsdb = hashtb_create(sizeof(struct nlsa), &param_name_lsdb);
 
+	nlsr->router_name=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+
 	nlsr->is_synch_init=1;
 	nlsr->nlsa_id=0;
 	nlsr->adj_build_flag=0;
-	nlsr->adj_build_count=0;	
+	nlsr->adj_build_count=0;
+	nlsr->is_build_adj_lsa_sheduled=0;
+	nlsr->is_send_lsdb_interest_scheduled=0;	
 
 	nlsr->lsdb_synch_interval = LSDB_SYNCH_INTERVAL;
 	nlsr->interest_retry = INTEREST_RETRY;
@@ -486,7 +515,7 @@
     	int res;
     	char *config_file;
 	//int daemon_mode;
-	struct ccn_charbuf *router_prefix;	
+		
 
 	init_nlsr();
     	
@@ -513,17 +542,18 @@
 		{
 			fprintf(stderr,"Could not connect to ccnd\n");
 			exit(1);
-		}	
-	router_prefix=ccn_charbuf_create();	
-	res=ccn_name_from_uri(router_prefix,nlsr->router_name);		
+		}
+	struct ccn_charbuf *router_prefix;	
+	router_prefix=ccn_charbuf_create();
+	res=ccn_name_from_uri(router_prefix,nlsr->router_name->name);		
 	if(res<0)
 		{
-			fprintf(stderr, "Bad ccn URI: %s\n",nlsr->router_name);
+			fprintf(stderr, "Bad ccn URI: %s\n",nlsr->router_name->name);
 			exit(1);
 		}
 
 	ccn_name_append_str(router_prefix,"nlsr");
-	nlsr->in_interest.data=nlsr->router_name;
+	nlsr->in_interest.data=nlsr->router_name->name;
 	res=ccn_set_interest_filter(nlsr->ccn,router_prefix,&nlsr->in_interest);
 	if ( res < 0 )
 		{
@@ -531,16 +561,28 @@
 			exit(1);
 		}
 
-	nlsr->sched = ccn_schedule_create(nlsr, &ndn_rtr_ticker);
-
-	nlsr->event_build_name_lsa = ccn_schedule_event(nlsr->sched, 100, &initial_build_name_lsa, NULL, 0);
-	nlsr->event_send_info_interest = ccn_schedule_event(nlsr->sched, 1000000, &send_info_interest, NULL, 0);
+	/* Debugging purpose */	
+	print_name_prefix_from_npl();
+	print_adjacent_from_adl();
 	
+	printf("\n");
+	printf("Router Name: %s\n",nlsr->router_name->name);
+	printf("Time in MicroSec: %s \n",get_current_timestamp_micro());
+	printf("LSDB Version: %s\n",nlsr->lsdb->version);
+	printf("\n");
+
+	build_and_install_name_lsas();
+	print_name_lsdb();	
+
+	nlsr->sched = ccn_schedule_create(nlsr, &ndn_rtr_ticker);
+	nlsr->event_send_info_interest = ccn_schedule_event(nlsr->sched, 500, &send_info_interest, NULL, 0);	
+
+
 
 	while(1)
 	{
-		if(nlsr->semaphor !=1)
-		{
+		if(nlsr->semaphor == 0)
+		{	
 			ccn_schedule_run(nlsr->sched);
         		res = ccn_run(nlsr->ccn, 500);
 		}
diff --git a/nlsr.conf b/nlsr.conf
index dbbaf9c..ced844f 100644
--- a/nlsr.conf
+++ b/nlsr.conf
@@ -1,11 +1,10 @@
 router-name /ndn/memphis.edu/netlab/macbook
-ccnneighbor /ndn/memphis.edu/netlab/maia face2 10
+ccnneighbor /ndn/memphis.edu/netlab/pollux face2 10
 ccnneighbor /ndn/memphis.edu/netlab/castor face3 8
-ccnneighbor /ndn/memphis.edu/netlab/pollux face4 15
 ccnname /ndn/memphis.edu/netlab/macbook/name1
 ccnname /ndn/memphis.edu/netlab/macbook/test
-lsdb-synch-interval 300
-interest-retry 2
-interest-resend-time 15
+lsdb-synch-interval 310
+interest-retry 4
+interest-resend-time 5
 
 
diff --git a/nlsr.h b/nlsr.h
index 144742c..fdde154 100644
--- a/nlsr.h
+++ b/nlsr.h
@@ -7,6 +7,9 @@
 #define INTEREST_RETRY 3
 #define INTEREST_RESEND_TIME 15
 
+#define NBR_DOWN 0
+#define NBR_ACTIVE 1
+
 struct name_prefix
 {
 	char *name;
@@ -15,17 +18,20 @@
 
 struct ndn_neighbor
 {
-	struct ccn_charbuf *neighbor;
+	struct name_prefix *neighbor;
 	int face;
 	int status;
-	long int last_lsdb_version;
+	char * last_lsdb_version;
 	int info_interest_timed_out;
-	struct hashtb *lsa_update_queue;
+	long int lsdb_synch_interval;
+	long int last_lsdb_requested;
+	int is_lsdb_send_interest_scheduled;
+	int metric;
 };
 
 struct linkStateDatabase
 {
-	long int version;
+	char  * version;
 	struct hashtb *adj_lsdb;
 	struct hashtb *name_lsdb;
 };
@@ -46,7 +52,7 @@
 	struct hashtb *npl;
 
 	struct ccn *ccn;
-	char *router_name;
+	struct name_prefix *router_name;
 
 	struct linkStateDatabase *lsdb;
 
@@ -54,6 +60,8 @@
 	long int nlsa_id;
 	int adj_build_flag;
 	long int adj_build_count;
+	int is_build_adj_lsa_sheduled;
+	int is_send_lsdb_interest_scheduled;
 
 	long int lsdb_synch_interval;
 	int interest_retry;
@@ -77,7 +85,7 @@
 void process_conf_command(char *command);
 int readConfigFile(const char *filename);
 
-void add_name_prefix_to_npl(struct name_prefix *name_prefix);
+void add_name_prefix_to_npl(struct name_prefix *np);
 void print_name_prefix_from_npl(void);
 
 void my_lock(void);
diff --git a/nlsr_adl.c b/nlsr_adl.c
index de6ad07..7ebc8af 100644
--- a/nlsr_adl.c
+++ b/nlsr_adl.c
@@ -23,46 +23,75 @@
 #include "nlsr_adl.h"
 
 void
-add_adjacent_to_adl(struct ndn_neighbor *nbr)
+add_adjacent_to_adl(struct name_prefix *np, int face)
 {
 	printf("\nadd_adjacent_to_adl called\n");
-	printf("Neighbor: %s Length: %d Face: %d Status: %d\n",ccn_charbuf_as_string(nbr->neighbor),(int)nbr->neighbor->length,nbr->face, nbr->status);
-
-	struct ndn_neighbor *hnbr=(struct ndn_neighbor *)malloc(sizeof(struct ndn_neighbor*));
+	printf("Neighbor: %s Length: %d Face:%d\n",np->name,np->length,face);
 	
+	struct ndn_neighbor *nbr=(struct ndn_neighbor *)malloc(sizeof(struct ndn_neighbor));
+
 	struct hashtb_enumerator ee;
     	struct hashtb_enumerator *e = &ee; 	
     	int res;
 
    	hashtb_start(nlsr->adl, e);
-    	res = hashtb_seek(e, nbr->neighbor->buf , nbr->neighbor->length, 0);
+    	res = hashtb_seek(e, np->name, np->length, 0);
 
 	if(res == HT_NEW_ENTRY )
 	{
    
-		hnbr = e->data;
-		hnbr->neighbor=ccn_charbuf_create();
-		ccn_charbuf_append_string(hnbr->neighbor,ccn_charbuf_as_string(nbr->neighbor));
+		nbr = e->data;
 
-		hnbr->face=nbr->face;
-		hnbr->status=nbr->status;
-		hnbr->last_lsdb_version=0;
-		hnbr->info_interest_timed_out=0;
+		nbr->neighbor=(struct name_prefix *)malloc(sizeof( struct name_prefix ));
+		nbr->neighbor->name=(char *)malloc(np->length);
+		memcpy(nbr->neighbor->name,np->name,np->length);
+		nbr->neighbor->length=np->length;
+		nbr->face=face;
+		nbr->status=NBR_DOWN;
+		nbr->info_interest_timed_out=0;
+		nbr->lsdb_synch_interval=300;
+		nbr->metric=10;
+		nbr->is_lsdb_send_interest_scheduled=0;
+		
+		
 
-		struct hashtb_param param_luq = {0};
-		hnbr->lsa_update_queue=hashtb_create(200, &param_luq);
+		char *time_stamp=get_current_timestamp_micro();
+		nbr->last_lsdb_version=(char *)malloc(strlen(time_stamp)+1);
+		memcpy(nbr->last_lsdb_version,time_stamp,strlen(time_stamp)+1);
+		memset(nbr->last_lsdb_version,'0',strlen(time_stamp));
+
+		nbr->last_lsdb_requested=0;
+
+		//nbr->last_lsdb_requested=(char *)malloc(strlen(time_stamp)+1);
+		//memcpy(nbr->last_lsdb_requested,time_stamp,strlen(time_stamp)+1);
+		//memset(nbr->last_lsdb_requested,'0',strlen(time_stamp));
+
 	}
-	
+
     	hashtb_end(e);
+}
 
-	printf("\n");
-
+void 
+print_adjacent(struct ndn_neighbor *nbr)
+{
+	printf("\nprint_adjacent called\n");
+	printf("--------Neighbor---------------------------\n");
+	printf("	Neighbor: %s \n",nbr->neighbor->name);
+	printf("	Length  : %d \n",nbr->neighbor->length);
+	printf("	Face    : %d \n",nbr->face);
+	printf("	Metric    : %d \n",nbr->metric);
+	printf("	Status  : %d \n",nbr->status);
+	printf("	LSDB Version: %s \n",nbr->last_lsdb_version);
+	printf("	Info Interest Timed Out : %d \n",nbr->info_interest_timed_out);
+	printf("	LSDB Synch Interval     : %ld \n",nbr->lsdb_synch_interval);
+	printf("	Las Time LSDB Requested: %ld \n",nbr->last_lsdb_requested);
 
 }
 
 void
 print_adjacent_from_adl(void)
 {
+
 	printf("print_adjacent_from_adl called \n");	
 	int i, adl_element;
 	struct ndn_neighbor *nbr;
@@ -76,20 +105,19 @@
 	for(i=0;i<adl_element;i++)
 	{
 		nbr=e->data;
-		printf("Neighbor: %s Length: %d Face: %d Status: %d LSDB Version: %ld Interest Timed Out: %d\n",ccn_charbuf_as_string(nbr->neighbor),(int)nbr->neighbor->length,nbr->face, nbr->status, nbr->last_lsdb_version,nbr->info_interest_timed_out);	
+		print_adjacent(nbr);	
 		hashtb_next(e);		
 	}
 
 	hashtb_end(e);
 
-	printf("\n");
 }
 
 void 
-update_adjacent_status_to_adl(struct ccn_charbuf *nbr, int status)
+update_adjacent_status_to_adl(struct name_prefix *nbr, int status)
 {
 	printf("update_adjacent_status_to_adl called \n");
-
+	//int ret;
 	int res;
 	struct ndn_neighbor *nnbr;
 
@@ -97,8 +125,8 @@
     	struct hashtb_enumerator *e = &ee;
 
 	hashtb_start(nlsr->adl, e);
-   	res = hashtb_seek(e, nbr->buf, nbr->length, 0);
-	
+   	res = hashtb_seek(e, nbr->name, nbr->length, 0);
+
 
 	if (res == HT_OLD_ENTRY)
 	{
@@ -113,15 +141,14 @@
 	{
 		hashtb_delete(e);
 	}
-	
+
 	hashtb_end(e);
 }
 
-
 void 
-update_adjacent_lsdb_version_to_adl(struct ccn_charbuf *nbr, long int version)
+update_lsdb_synch_interval_to_adl(struct name_prefix *nbr, long int interval)
 {
-	printf("update_adjacent_status_to_adl called \n");
+	printf("uupdate_lsdb_synch_interval_to_adl called \n");
 
 	int res;
 	struct ndn_neighbor *nnbr;
@@ -130,24 +157,31 @@
     	struct hashtb_enumerator *e = &ee;
 
 	hashtb_start(nlsr->adl, e);
-	res = hashtb_seek(e, nbr->buf, nbr->length, 0);
+   	res = hashtb_seek(e, nbr->name, nbr->length, 0);
 
-	if( res == HT_OLD_ENTRY )
+
+	if (res == HT_OLD_ENTRY)
 	{
 		nnbr=e->data;
-		nnbr->last_lsdb_version = version;
-		//memcpy(nnbr->last_lsdb_version,version,strlen(version)+1);
+		if ( nnbr->lsdb_synch_interval!= interval )
+		{
+			nnbr->lsdb_synch_interval=interval;
+			
+		}
 	}
 	else if(res == HT_NEW_ENTRY)
 	{
 		hashtb_delete(e);
 	}
-	
+
 	hashtb_end(e);
+	
+	
 }
 
+
 void 
-update_adjacent_timed_out_to_adl(struct ccn_charbuf *nbr, int increment)
+update_adjacent_timed_out_to_adl(struct name_prefix *nbr, int increment)
 {
 	printf("update_adjacent_timed_out_to_adl called \n");
 
@@ -158,7 +192,7 @@
     	struct hashtb_enumerator *e = &ee;
 
 	hashtb_start(nlsr->adl, e);
-	res = hashtb_seek(e, nbr->buf, nbr->length, 0);
+	res = hashtb_seek(e, nbr->name, nbr->length, 0);
 
 	if( res == HT_OLD_ENTRY )
 	{
@@ -169,14 +203,13 @@
 	{
 		hashtb_delete(e);
 	}
-	
+
 	hashtb_end(e);
 }
 
 void 
-update_adjacent_timed_out_zero_to_adl(struct ccn_charbuf *nbr)
+update_adjacent_timed_out_zero_to_adl(struct name_prefix *nbr)
 {
-
 	printf("update_adjacent_timed_out_zero_to_adl called \n");
 	int time_out_number=get_timed_out_number(nbr);
 	update_adjacent_timed_out_to_adl(nbr,-time_out_number);
@@ -184,10 +217,40 @@
 }
 
 
-int 
-get_timed_out_number(struct ccn_charbuf *nbr)
+void 
+update_adjacent_lsdb_version_to_adl(struct name_prefix *nbr, char *version)
 {
+	printf("update_adjacent_timed_out_to_adl called \n");
 
+	int res;
+	struct ndn_neighbor *nnbr;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+
+	hashtb_start(nlsr->adl, e);
+	res = hashtb_seek(e, nbr->name, nbr->length, 0);
+
+	if( res == HT_OLD_ENTRY )
+	{
+		nnbr=e->data;
+		free(nnbr->last_lsdb_version);
+		nnbr->last_lsdb_version=(char *)malloc(strlen(version)+1);
+		memset(nnbr->last_lsdb_version,0,strlen(version)+1);
+		memcpy(nnbr->last_lsdb_version,version,strlen(version)+1);
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+
+}
+
+int 
+get_timed_out_number(struct name_prefix *nbr)
+{
 	printf("get_timed_out_number called \n");
 
 	int res,ret=-1;
@@ -197,7 +260,7 @@
     	struct hashtb_enumerator *e = &ee;
 
 	hashtb_start(nlsr->adl, e);
-	res = hashtb_seek(e, nbr->buf, nbr->length, 0);
+	res = hashtb_seek(e, nbr->name, nbr->length, 0);
 
 	if( res == HT_OLD_ENTRY )
 	{
@@ -208,9 +271,423 @@
 	{
 		hashtb_delete(e);
 	}
-	
+
 	hashtb_end(e);
 
 	return ret;
-	
+
+	return 0;	
 }
+
+int
+is_adj_lsa_build(void)
+{
+	int ret=0;
+
+	int nbr_count=0;	
+
+	int i, adl_element;
+	struct ndn_neighbor *nbr;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->adl, e);
+	adl_element=hashtb_n(nlsr->adl);
+
+	for(i=0;i<adl_element;i++)
+	{
+		nbr=e->data;
+		if(nbr->status	== 1 )
+		{
+			nbr_count++;
+		}
+		else if (nbr->info_interest_timed_out >= nlsr->interest_retry)
+		{
+			nbr_count++;
+		}
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+	if(nbr_count == adl_element)
+		ret=1;
+	
+	return ret;
+}
+
+int 
+no_active_nbr(void)
+{
+	int i, adl_element;
+	int no_link=0;
+	struct ndn_neighbor *nbr;
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	hashtb_start(nlsr->adl, e);
+	adl_element=hashtb_n(nlsr->adl);
+
+	for(i=0;i<adl_element;i++)
+	{
+		nbr=e->data;
+		if( nbr->status	== 1 )
+			no_link++;
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+
+	return no_link;
+
+}
+
+long int 
+len_active_nbr_data(void)
+{
+	int i, adl_element;
+	int no_link=0;
+	long int len=0;
+	struct ndn_neighbor *nbr;
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	hashtb_start(nlsr->adl, e);
+	adl_element=hashtb_n(nlsr->adl);
+
+	for(i=0;i<adl_element;i++)
+	{
+		nbr=e->data;
+		if( nbr->status	== 1 )
+		{
+			char *temp_face=(char *)malloc(20);
+			char *temp_metric=(char *)malloc(20);
+			char *temp_length=(char *)malloc(20);
+			
+			len+=strlen(nbr->neighbor->name);
+
+			memset(	temp_face,0,20);
+			sprintf(temp_face,"%d",nbr->face);
+			len+=strlen(temp_face);	
+
+			memset(	temp_metric,0,20);
+			sprintf(temp_face,"%d",nbr->metric);
+			len+=strlen(temp_metric);
+
+			memset(	temp_length,0,20);
+			sprintf(temp_length,"%d",nbr->neighbor->length);
+			len+=strlen(temp_length);
+		
+			no_link++;
+
+			free(temp_face);
+			free(temp_metric);
+			free(temp_length);
+
+		}
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+
+	len=len+ no_link*4+1;
+
+	return len;
+
+}
+
+void 
+get_active_nbr_adj_data(struct ccn_charbuf *c)
+{
+
+	int i, adl_element;
+	struct ndn_neighbor *nbr;
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	hashtb_start(nlsr->adl, e);
+	adl_element=hashtb_n(nlsr->adl);
+
+	for(i=0;i<adl_element;i++)
+	{
+		nbr=e->data;
+		if( nbr->status	== 1 )
+		{
+			ccn_charbuf_append_string(c,nbr->neighbor->name);
+			ccn_charbuf_append_string(c,"|");
+			
+			char *temp_length=(char *)malloc(20);
+			memset(temp_length,0,20);
+			sprintf(temp_length,"%d",nbr->neighbor->length);
+			ccn_charbuf_append_string(c,temp_length);
+			free(temp_length);
+			ccn_charbuf_append_string(c,"|");
+
+			char *temp_face=(char *)malloc(20);
+			memset(temp_face,0,20);
+			sprintf(temp_face,"%d",nbr->face);
+			ccn_charbuf_append_string(c,temp_face);
+			free(temp_face);
+			ccn_charbuf_append_string(c,"|");
+
+			char *temp_metric=(char *)malloc(20);
+			memset(temp_metric,0,20);
+			sprintf(temp_metric,"%d",nbr->metric);
+			ccn_charbuf_append_string(c,temp_metric);
+			free(temp_metric);
+			ccn_charbuf_append_string(c,"|");
+
+		}
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+}
+
+char *
+get_nbr_lsdb_version(char *nbr)
+{
+	printf("get_timed_out_number called \n");
+
+	char *version=NULL;
+
+	int res;
+	struct ndn_neighbor *nnbr;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+
+	hashtb_start(nlsr->adl, e);
+	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
+	
+	if (res == HT_OLD_ENTRY)
+	{
+		nnbr=e->data;
+		version=(char *)malloc(strlen(nnbr->last_lsdb_version)+1);
+		memset(version,0,strlen(nnbr->last_lsdb_version)+1);
+		memcpy(version,nnbr->last_lsdb_version,strlen(nnbr->last_lsdb_version)+1);
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+
+	return version;
+}
+
+void 
+update_adjacent_last_lsdb_requested_to_adl(char *nbr, long int timestamp)
+{
+	printf("update_adjacent_last_lsdb_requested_to_adl called \n");
+
+	int res;
+	struct ndn_neighbor *nnbr;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+
+	hashtb_start(nlsr->adl, e);
+	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
+
+	if( res == HT_OLD_ENTRY )
+	{
+		nnbr=e->data;
+		nnbr->last_lsdb_requested=timestamp;
+		
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+
+}
+
+void 
+adjust_adjacent_last_lsdb_requested_to_adl(char *nbr, long int sec)
+{
+	printf("update_adjacent_last_lsdb_requested_to_adl called \n");
+
+	int res;
+	struct ndn_neighbor *nnbr;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+
+	hashtb_start(nlsr->adl, e);
+	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
+
+	if( res == HT_OLD_ENTRY )
+	{
+		nnbr=e->data;
+		nnbr->last_lsdb_requested=nnbr->last_lsdb_requested-sec;
+		
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+
+}
+
+
+long int 
+get_nbr_last_lsdb_requested(char *nbr)
+{
+	printf("get_timed_out_number called \n");
+
+	long int last_lsdb_requested=0;
+
+	int res;
+	struct ndn_neighbor *nnbr;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+
+	hashtb_start(nlsr->adl, e);
+	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
+	
+	if (res == HT_OLD_ENTRY)
+	{
+		nnbr=e->data;
+		last_lsdb_requested=nnbr->last_lsdb_requested;
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+
+	return last_lsdb_requested;
+}
+
+long int
+get_nbr_time_diff_lsdb_req(char *nbr)
+{
+	printf("get_nbr_time_diff_lsdb_req called \n");
+
+	long int time_diff=get_lsdb_synch_interval(nbr)+1;	
+	int res;
+	struct ndn_neighbor *nnbr;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+
+	hashtb_start(nlsr->adl, e);
+	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
+	
+	if (res == HT_OLD_ENTRY)
+	{
+		nnbr=e->data;
+		
+		if (nnbr->last_lsdb_requested == 0)
+			time_diff=get_lsdb_synch_interval(nbr)+1;
+		else time_diff=get_current_time_sec() - get_nbr_last_lsdb_requested(nbr);
+		
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+
+	return time_diff;
+}
+
+long int 
+get_lsdb_synch_interval(char *nbr)
+{
+	printf("get_lsdb_synch_interval called \n");
+
+	long int lsdb_synch_interval=300;	
+	
+
+	int res;
+	struct ndn_neighbor *nnbr;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+
+	hashtb_start(nlsr->adl, e);
+	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
+	
+	if (res == HT_OLD_ENTRY)
+	{
+		nnbr=e->data;
+		lsdb_synch_interval=nnbr->lsdb_synch_interval;
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+
+	return lsdb_synch_interval;
+
+}
+
+void 
+set_is_lsdb_send_interest_scheduled_to_zero(char *nbr)
+{
+	printf("set_is_lsdb_send_interest_scheduled_to_zero called \n");
+
+	int res;
+	struct ndn_neighbor *nnbr;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+
+	hashtb_start(nlsr->adl, e);
+	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
+
+	if (res == HT_OLD_ENTRY)
+	{
+		nnbr=e->data;
+		nnbr->is_lsdb_send_interest_scheduled=0;
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+
+}
+
+
+int 
+get_adjacent_status(struct name_prefix *nbr)
+{
+	printf("get_adjacent_status called \n");
+
+	int res;
+	int status=-1;
+	struct ndn_neighbor *nnbr;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+
+	hashtb_start(nlsr->adl, e);
+	res = hashtb_seek(e, nbr->name, nbr->length, 0);
+
+	if (res == HT_OLD_ENTRY)
+	{
+		nnbr=e->data;
+		status=nnbr->status;
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+
+	return status;
+
+}
+
diff --git a/nlsr_adl.h b/nlsr_adl.h
index 1bcb381..7879aa8 100644
--- a/nlsr_adl.h
+++ b/nlsr_adl.h
@@ -4,13 +4,31 @@
 #define NBR_ACTIVE 1
 #define NBR_DOWN 0
 
-void add_adjacent_to_adl(struct ndn_neighbor *nbr);
+void add_adjacent_to_adl(struct name_prefix *np, int face);
+void print_adjacent(struct ndn_neighbor *nbr);
 void print_adjacent_from_adl(void);
-void update_adjacent_status_to_adl(struct ccn_charbuf *nbr, int status);
-void update_adjacent_lsdb_version_to_adl(struct ccn_charbuf *nbr, long int version);
+void update_adjacent_status_to_adl(struct name_prefix *nbr, int status);
+int get_adjacent_status(struct name_prefix *nbr);
+void update_adjacent_lsdb_version_to_adl(struct name_prefix *nbr, char * version);
+void update_lsdb_synch_interval_to_adl(struct name_prefix *nbr, long int interval);
 
-int get_timed_out_number(struct ccn_charbuf *nbr);
-void update_adjacent_timed_out_to_adl(struct ccn_charbuf *nbr, int increment);
-void update_adjacent_timed_out_zero_to_adl(struct ccn_charbuf *nbr);
+int get_timed_out_number(struct name_prefix *nbr);
+void update_adjacent_timed_out_to_adl(struct name_prefix *nbr, int increment);
+void update_adjacent_timed_out_zero_to_adl(struct name_prefix *nbr);
+
+int is_adj_lsa_build(void);
+int no_active_nbr(void);
+long int len_active_nbr_data(void);
+void get_active_nbr_adj_data(struct ccn_charbuf *c);
+char * get_nbr_lsdb_version(char *nbr);
+void update_adjacent_last_lsdb_requested_to_adl(char *nbr, long int timestamp);
+long int get_nbr_last_lsdb_requested(char *nbr);
+long int get_nbr_time_diff_lsdb_req(char *nbr);
+long int get_lsdb_synch_interval(char *nbr);
+void set_is_lsdb_send_interest_scheduled_to_zero(char *nbr);
+
+void adjust_adjacent_last_lsdb_requested_to_adl(char *nbr, long int sec);
+//long int get_lsdb_synch_interval(char *nbr);
+
 
 #endif
diff --git a/nlsr_lsdb.c b/nlsr_lsdb.c
index b6b115e..39a0322 100644
--- a/nlsr_lsdb.c
+++ b/nlsr_lsdb.c
@@ -21,110 +21,27 @@
 #include "nlsr_lsdb.h"
 #include "utility.h"
 #include "nlsr_ndn.h"
+#include "nlsr_adl.h"
 
 void
-make_name_lsa_key(struct ccn_charbuf *key, struct ccn_charbuf *orig_router, unsigned int ls_type, long int nlsa_id, long int orig_time)
+set_new_lsdb_version(void)
 {
-	printf("make_name_lsa_key called \n");	
-	ccn_charbuf_append_string(key,ccn_charbuf_as_string(orig_router));
-
-	struct ccn_charbuf *c=ccn_charbuf_create();
-	ccn_charbuf_reset(c);
-	ccn_charbuf_putf(c, "%d", ls_type);
-	ccn_charbuf_append_string(key,ccn_charbuf_as_string(c));
 	
-	ccn_charbuf_reset(c);
-	ccn_charbuf_putf(c, "%ld", nlsa_id);
-	ccn_charbuf_append_string(key,ccn_charbuf_as_string(c));
+	char *time_stamp=get_current_timestamp_micro();
 	
-	ccn_charbuf_reset(c);
-	ccn_charbuf_putf(c, "%ld", orig_time);
-	ccn_charbuf_append_string(key,ccn_charbuf_as_string(c));
-	//ccn_charbuf_append_string(key,orig_time);	
-
-	ccn_charbuf_destroy(&c);
-
-	printf("Key: %s length: %d\n",ccn_charbuf_as_string(key),(int)key->length);
-
+	free(nlsr->lsdb->version);
+	nlsr->lsdb->version=(char *)malloc(strlen(time_stamp)+1);
+	memset(nlsr->lsdb->version,0,strlen(time_stamp)+1);
+	memcpy(nlsr->lsdb->version,time_stamp,strlen(time_stamp)+1);
+	
 }
 
+
 void 
-install_name_lsa(struct nlsa *new_name_lsa)
+build_and_install_name_lsas(void)
 {
-	printf("install_name_lsa called \n");
-	struct ccn_charbuf *key=ccn_charbuf_create();
-	make_name_lsa_key(key,new_name_lsa->header->orig_router,new_name_lsa->header->ls_type,new_name_lsa->header->ls_id,new_name_lsa->header->orig_time);
+	printf("build_and_install_name_lsas called \n");
 
-	struct nlsa *name_lsa=(struct nlsa*)malloc(sizeof(struct nlsa *));
-	
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee; 	
-    	int res;
-
-   	hashtb_start(nlsr->lsdb->name_lsdb, e);
-    	res = hashtb_seek(e, key->buf , key->length, 0);
-
-	if(res == HT_NEW_ENTRY )
-	{
-   		printf("New Name LSA. Added...\n");
-		name_lsa = e->data;
-
-		name_lsa->header=(struct nlsa_header *)malloc(sizeof(struct nlsa_header *));
-	
-	
-		name_lsa->header->ls_type=new_name_lsa->header->ls_type;
-		name_lsa->header->orig_time=new_name_lsa->header->orig_time;
-		name_lsa->header->ls_id=new_name_lsa->header->ls_id;
-		
-		name_lsa->header->orig_router=ccn_charbuf_create();
-		ccn_charbuf_append_string(name_lsa->header->orig_router,ccn_charbuf_as_string(new_name_lsa->header->orig_router));	
-		name_lsa->header->isValid=new_name_lsa->header->isValid;
-
-		name_lsa->name_prefix=ccn_charbuf_create();	
-		ccn_charbuf_append_string(name_lsa->name_prefix,ccn_charbuf_as_string(new_name_lsa->name_prefix));
-		//ccn_charbuf_append_charbuf(name_lsa->name_prefix,new_name_lsa->name_prefix);
-	}
-	else if(res == HT_OLD_ENTRY)
-	{
-		printf("Duplicate Name LSA. Discarded...\n");
-	
-	}
-	
-    	hashtb_end(e);
-
-	ccn_charbuf_destroy(&key);
-	
-}
-
-void 
-build_name_lsa(struct nlsa *name_lsa, struct ccn_charbuf *name_prefix)
-{
-	printf("build_name_lsa called \n");
-	//struct nlsa *name_lsa=(struct nlsa*)malloc(sizeof(struct nlsa *));
-
-	//name_lsa->header=(struct nlsa_header *)malloc(sizeof(struct nlsa_header *));
-	//name_lsa->header->orig_router=ccn_charbuf_create();
-	
-	name_lsa->header->ls_type=LS_TYPE_NAME;
-	name_lsa->header->orig_time=get_current_time_microsec();
-	//name_lsa->header->orig_time=(char *)malloc(strlen(get_current_time_microsec())+1);
-	//memcpy(name_lsa->header->orig_time,get_current_time_microsec(),strlen(get_current_time_microsec())+1);
-	name_lsa->header->ls_id=++nlsr->nlsa_id;
-	ccn_charbuf_append_string(name_lsa->header->orig_router,nlsr->router_name);	
-	name_lsa->header->isValid=1;
-
-	//name_lsa->name_prefix=ccn_charbuf_create();	
-	ccn_charbuf_append_string(name_lsa->name_prefix,ccn_charbuf_as_string(name_prefix));
-	//ccn_charbuf_append_charbuf(name_lsa->name_prefix,name_prefix);
-
-	//return name_lsa;
-}
-
-int 
-initial_build_name_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
-{
-	my_lock();	
-	printf("initial_build_name_lsa called \n");	
 	int i, npl_element;
 	struct name_prefix *np;
 
@@ -137,92 +54,894 @@
 	for(i=0;i<npl_element;i++)
 	{
 		np=e->data;
-
-		struct nlsa *name_lsa=(struct nlsa*)malloc(sizeof(struct nlsa *));
-		name_lsa->header=(struct nlsa_header *)malloc(sizeof(struct nlsa_header *));
-		name_lsa->header->orig_router=ccn_charbuf_create();
-		name_lsa->name_prefix=ccn_charbuf_create();
-
-		struct ccn_charbuf *name;
-		name=ccn_charbuf_create();
-		
-		ccn_charbuf_append_string(name,np->name);
-		build_name_lsa(name_lsa,name);
+		struct nlsa *name_lsa=(struct nlsa *)malloc(sizeof( struct nlsa ));
+		build_name_lsa(name_lsa,np);
+		print_name_lsa(name_lsa);
 		install_name_lsa(name_lsa);
-
-		//ccn_charbuf_destroy(&name_lsa->header->orig_router);
-		//free(name_lsa->header);
-		//ccn_charbuf_destroy(&name_lsa->name_prefix);
 		free(name_lsa);
-		ccn_charbuf_destroy(&name);
-	
 		hashtb_next(e);		
 	}
 
-	hashtb_end(e);
+	hashtb_end(e);	
 
-	print_name_lsdb();
-	
-	my_unlock();
-	//nlsr->event_send_info_interest = ccn_schedule_event(nlsr->sched, 1, &send_info_interest, NULL, 0);
-	return 0;
 }
 
+void
+build_and_install_others_name_lsa(char *orig_router,int ls_type,long int ls_id,int isValid,char *np)
+{
+	printf("build_and_install_others_name_lsa called \n");
+
+	struct nlsa *name_lsa=(struct nlsa *)malloc(sizeof( struct nlsa ));
+	build_others_name_lsa(name_lsa,orig_router,ls_type,ls_id,isValid,np);
+	print_name_lsa(name_lsa);
+	install_name_lsa(name_lsa);
+	print_name_lsdb();
+	free(name_lsa);
+}
+
+void
+build_others_name_lsa(struct nlsa *name_lsa, char *orig_router,int ls_type,long int ls_id,int isValid,char *np)
+{
+	printf("build_others_name_lsa called \n");
+
+	name_lsa->header=(struct nlsa_header *)malloc(sizeof(struct nlsa_header ));
+	name_lsa->header->ls_type=LS_TYPE_NAME;
+
+	char *time_stamp=get_current_timestamp_micro();
+
+	name_lsa->header->orig_time=(char *)malloc(strlen(time_stamp)+1);
+	memset(name_lsa->header->orig_time,0,strlen(time_stamp)+1);
+	memcpy(name_lsa->header->orig_time,time_stamp,strlen(time_stamp)+1);
+
+	name_lsa->header->ls_id=ls_id;
+	name_lsa->header->orig_router=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+	name_lsa->header->orig_router->name=(char *)malloc(strlen(orig_router)+1);
+	memset(name_lsa->header->orig_router->name,0,strlen(orig_router)+1);
+	memcpy(name_lsa->header->orig_router->name,orig_router,strlen(orig_router)+1);
+	name_lsa->header->orig_router->length=strlen(orig_router)+1;
+	name_lsa->header->isValid=isValid;
+
+	name_lsa->name_prefix=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+	name_lsa->name_prefix->name=(char *)malloc(strlen(np)+1);
+	memset(name_lsa->name_prefix->name,0,strlen(np)+1);
+	memcpy(name_lsa->name_prefix->name,np,strlen(np)+1);
+	name_lsa->name_prefix->length=strlen(np)+1;
+	
+	
+}
+
+void 
+build_name_lsa(struct nlsa *name_lsa, struct name_prefix *np)
+{
+	printf("build_name_lsa called \n");
+
+	name_lsa->header=(struct nlsa_header *)malloc(sizeof(struct nlsa_header ));
+	name_lsa->header->ls_type=LS_TYPE_NAME;
+
+	char *time_stamp=get_current_timestamp_micro();
+
+	name_lsa->header->orig_time=(char *)malloc(strlen(time_stamp)+1);
+	memset(name_lsa->header->orig_time,0,strlen(time_stamp)+1);
+	memcpy(name_lsa->header->orig_time,time_stamp,strlen(time_stamp)+1);
+	name_lsa->header->orig_time[strlen(name_lsa->header->orig_time)]='\0';
+
+	printf("Orig Time: %s\n",name_lsa->header->orig_time);
+
+	name_lsa->header->ls_id=++nlsr->nlsa_id;
+	name_lsa->header->orig_router=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+	name_lsa->header->orig_router->name=(char *)malloc(nlsr->router_name->length);
+	memcpy(name_lsa->header->orig_router->name,nlsr->router_name->name,nlsr->router_name->length);
+	name_lsa->header->orig_router->length=nlsr->router_name->length;
+	name_lsa->header->isValid=1;
+
+	
+	name_lsa->name_prefix=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+	name_lsa->name_prefix->name=(char *)malloc(np->length);
+	memcpy(name_lsa->name_prefix->name,np->name,np->length);
+	name_lsa->name_prefix->length=np->length;
+
+}
+
+
 void 
 print_name_lsa(struct nlsa *name_lsa)
 {
 	printf("print_name_lsa called \n");
-	printf("-----------Name LSA---------------\n");
-	printf("	Origination Router       :	%s\n",ccn_charbuf_as_string(name_lsa->header->orig_router));
-	printf("	Origination Router Length:	%d\n",(int)name_lsa->header->orig_router->length);
+	
+	printf("-----------Name LSA Content---------------\n");
+	printf("	Origination Router       :	%s\n",name_lsa->header->orig_router->name);
+	printf("	Origination Router Length:	%d\n",name_lsa->header->orig_router->length);
 	printf("	LS Type			 :	%d\n",name_lsa->header->ls_type);
 	printf("	LS Id			 :	%ld\n",name_lsa->header->ls_id);
-	printf("	Origination Time	 :	%ld\n",name_lsa->header->orig_time);
+	printf("	Origination Time	 :	%s\n",name_lsa->header->orig_time);
 	printf("	Is Valid 		 :	%d\n",name_lsa->header->isValid);
-
 	printf("	LSA Data			\n");
-	printf("		Name Prefix:	 	:	%s\n",ccn_charbuf_as_string(name_lsa->name_prefix));
-	printf("		Name Prefix Length	:	%d\n",(int)name_lsa->name_prefix->length);
+	printf("		Name Prefix:	 	:	%s\n",name_lsa->name_prefix->name);
+	printf("		Name Prefix Length	:	%d\n",name_lsa->name_prefix->length);
 
-	printf("\n");
+	printf("\n");	
+}
 
+void 
+install_name_lsa(struct nlsa *name_lsa)
+{
+	printf("install_name_lsa called \n");
+	
+	print_name_lsa(name_lsa);
+
+	char *key=make_name_lsa_key(name_lsa->header->orig_router->name,name_lsa->header->ls_type,name_lsa->header->ls_id);	
+	printf("Key:%s Length:%d\n",key,(int)strlen(key));
+
+	struct nlsa *new_name_lsa=(struct nlsa*)malloc(sizeof(struct nlsa ));
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee; 	
+    	int res;
+
+   	hashtb_start(nlsr->lsdb->name_lsdb, e);
+    	res = hashtb_seek(e, key, strlen(key), 0);
+
+	if(res == HT_NEW_ENTRY )
+	{
+		printf("New Name LSA... Adding to LSDB\n");
+		new_name_lsa = e->data;
+
+		new_name_lsa->header=(struct nlsa_header *)malloc(sizeof(struct nlsa_header ));
+		new_name_lsa->header->ls_type=name_lsa->header->ls_type;
+
+		new_name_lsa->header->orig_time=(char *)malloc(strlen(name_lsa->header->orig_time)+1);
+		memcpy(new_name_lsa->header->orig_time,name_lsa->header->orig_time,strlen(name_lsa->header->orig_time)+1);
+
+		printf("Orig Time: %s\n",new_name_lsa->header->orig_time);
+
+		new_name_lsa->header->ls_id=name_lsa->header->ls_id;
+		new_name_lsa->header->orig_router=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+		new_name_lsa->header->orig_router->name=(char *)malloc(name_lsa->header->orig_router->length);
+		memcpy(new_name_lsa->header->orig_router->name,name_lsa->header->orig_router->name,name_lsa->header->orig_router->length);
+		new_name_lsa->header->orig_router->length=name_lsa->header->orig_router->length;
+		new_name_lsa->header->isValid=name_lsa->header->isValid;
+
+	
+		new_name_lsa->name_prefix=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+		new_name_lsa->name_prefix->name=(char *)malloc(name_lsa->name_prefix->length);
+		memcpy(new_name_lsa->name_prefix->name,name_lsa->name_prefix->name,name_lsa->name_prefix->length);
+		new_name_lsa->name_prefix->length=name_lsa->name_prefix->length;
+
+		printf("New Name LSA Added....\n");	
+
+		printf("Old Version Number of LSDB: %s \n",nlsr->lsdb->version);
+		set_new_lsdb_version();	
+		printf("New Version Number of LSDB: %s \n",nlsr->lsdb->version);		
+
+	}
+	else if(res == HT_OLD_ENTRY)
+	{
+		printf("Duplicate Name LSA. Discarded...\n");
+
+	}
+
+    	hashtb_end(e);
+}
+
+
+char *
+make_name_lsa_key(char *orig_router, int ls_type, long int ls_id)
+{
+	
+	
+	printf("Orig Router: %s LS Type: %d LS Id: %ld\n",orig_router,ls_type,ls_id);
+
+	char lst[2];
+	memset(lst,0,2);
+	sprintf(lst,"%d",ls_type);	
+
+	char lsid[10];
+	memset(lsid,0,10);
+	sprintf(lsid,"%ld",ls_id);
+	
+	
+	char *key=(char *)malloc(strlen(orig_router)+1+strlen(lst)+1+strlen(lsid)+1);
+	memset(key,0,strlen(orig_router)+1+strlen(lst)+1+strlen(lsid)+1);
+	memcpy(key+strlen(key),orig_router,strlen(orig_router));
+	memcpy(key+strlen(key),"/",1);
+	memcpy(key+strlen(key),lst,strlen(lst));
+	memcpy(key+strlen(key),"/",1);
+	memcpy(key+strlen(key),lsid,strlen(lsid));
+
+	printf("Key: %s\n",key);
+
+	return key;
+	
 }
 
 void
 print_name_lsdb(void)
 {
 	printf("print_name_lsdb called \n");	
-	int i, lsdb_element;
+	int i, name_lsdb_element;
 	struct nlsa *name_lsa;
 
 	struct hashtb_enumerator ee;
     	struct hashtb_enumerator *e = &ee;
     	
     	hashtb_start(nlsr->lsdb->name_lsdb, e);
-	lsdb_element=hashtb_n(nlsr->lsdb->name_lsdb);
+	name_lsdb_element=hashtb_n(nlsr->lsdb->name_lsdb);
 
-	for(i=0;i<lsdb_element;i++)
+	for(i=0;i<name_lsdb_element;i++)
 	{
+		printf("-----------Name LSA (%d)---------------\n",i+1);
 		name_lsa=e->data;
-		print_name_lsa(name_lsa);		
+		print_name_lsa(name_lsa);	
 		hashtb_next(e);		
 	}
 
 	hashtb_end(e);
 
+	printf("\n");
+}
+
+int
+build_and_install_adj_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
+{
+	printf("build_and_install_adj_lsa called \n");
+	my_lock();
+
+	printf("adj_build_flag = %d \n",nlsr->adj_build_flag);
+
+	if(nlsr->adj_build_flag > 0)
+	{
+		printf("is_adj_lsa_build = %d \n",is_adj_lsa_build());
+		if ( is_adj_lsa_build()> 0)
+		{
+			struct alsa *adj_lsa=(struct alsa *)malloc(sizeof( struct alsa ));
+			build_adj_lsa(adj_lsa);
+			print_adj_lsa(adj_lsa);
+			install_adj_lsa(adj_lsa);
+			free(adj_lsa);
+			nlsr->adj_build_flag=0;	
+			print_adj_lsdb();		
+		}
+		else
+		{
+			printf("Can not build adj LSA now\n");
+		}
+	}
+	nlsr->is_build_adj_lsa_sheduled=0;
+	my_unlock();
+	return 0;
+}
+
+void 
+build_and_install_others_adj_lsa(char *orig_router,int ls_type,char *orig_time, int no_link,char *data)
+{
+	printf("build_and_install_others_adj_lsa called \n");	
+	struct alsa *adj_lsa=(struct alsa *)malloc(sizeof( struct alsa ));
+	build_others_adj_lsa(adj_lsa,orig_router,ls_type,orig_time,no_link,data);
+	print_adj_lsa(adj_lsa);
+	install_adj_lsa(adj_lsa);
+	free(adj_lsa);
+	print_adj_lsdb();
+
+}
+
+void 
+build_others_adj_lsa(struct alsa *adj_lsa,char *orig_router,int ls_type,char *orig_time,int no_link,char *data)
+{
+	printf("build_others_adj_lsa called \n");
+
+	/*Filling Up Header Data */
+	adj_lsa->header=(struct alsa_header *)malloc(sizeof(struct alsa_header ));
+	adj_lsa->header->orig_router=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+	adj_lsa->header->orig_router->name=(char *)malloc(strlen(orig_router)+1);
+	memset(adj_lsa->header->orig_router->name,0,strlen(orig_router)+1);
+	memcpy(adj_lsa->header->orig_router->name,orig_router,strlen(orig_router)+1);
+
+	adj_lsa->header->orig_router->length=strlen(orig_router)+1;
+	
+
+	adj_lsa->header->ls_type=(unsigned)LS_TYPE_ADJ;	
+
+	adj_lsa->header->orig_time=(char *)malloc(strlen(orig_time)+1);
+	memset(adj_lsa->header->orig_time,0,strlen(orig_time)+1);
+	memcpy(adj_lsa->header->orig_time,orig_time,strlen(orig_time)+1);
+
+	adj_lsa->no_link=no_link;
+
+	adj_lsa->body=(char *)malloc(strlen(data)+1);
+	memset(adj_lsa->body,0,strlen(data)+1);
+	memcpy(adj_lsa->body,(char *)data,strlen(data)+1);
+	
+}
+
+void
+build_adj_lsa(struct alsa * adj_lsa)
+{
+	printf("build_adj_lsa called \n");
+	
+	int no_link=no_active_nbr();
+	printf("Number of link in Adjacent LSA: %d\n",no_link);
+	
+	/*Filling Up Header Data */
+	adj_lsa->header=(struct alsa_header *)malloc(sizeof(struct alsa_header ));
+	adj_lsa->header->ls_type=(unsigned)LS_TYPE_ADJ;	
+
+	char *time_stamp=get_current_timestamp_micro();
+	adj_lsa->header->orig_time=(char *)malloc(strlen(time_stamp)+1);
+	memset(adj_lsa->header->orig_time,0,strlen(time_stamp)+1);
+	memcpy(adj_lsa->header->orig_time,time_stamp,strlen(time_stamp)+1);
+	adj_lsa->header->orig_time[strlen(adj_lsa->header->orig_time)]='\0';
+
+	printf("Router Name: %s Length: %d \n",nlsr->router_name->name,nlsr->router_name->length);
+
+	char *temp_r=(char *)malloc(nlsr->router_name->length);
+	memset(temp_r,0,nlsr->router_name->length);
+	sprintf(temp_r,"%s",nlsr->router_name->name);
+	printf("Router Name: %s Length: %d \n",temp_r,(int)strlen(temp_r)+1);
+	
+	adj_lsa->header->orig_router=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+	adj_lsa->header->orig_router->name=(char *)malloc(strlen(temp_r)+1);
+	memset(adj_lsa->header->orig_router->name,0,strlen(temp_r)+1);
+	memcpy(adj_lsa->header->orig_router->name,temp_r,strlen(temp_r)+1);
+
+	adj_lsa->header->orig_router->length=strlen(temp_r)+1;
+	printf("Router Name: %s Length: %d \n",nlsr->router_name->name,nlsr->router_name->length);
+
+	/* Filling Up Body Data */
+
+	adj_lsa->no_link=no_link;
+
+
+	struct ccn_charbuf *c=ccn_charbuf_create();
+	get_active_nbr_adj_data(c);
+	char *data=ccn_charbuf_as_string(c);
+	printf("Adjacent data: %s \n",data);
+
+	adj_lsa->body=(char *)malloc(strlen(data)+1);
+	memset(adj_lsa->body,0,strlen(data)+1);
+	memcpy(adj_lsa->body,(char *)data,strlen(data)+1);
+	
+
+	ccn_charbuf_destroy(&c);
+
+	if( !nlsr->is_send_lsdb_interest_scheduled )
+	{	
+		nlsr->event_send_lsdb_interest= ccn_schedule_event(nlsr->sched, 1000, &send_lsdb_interest, NULL, 0);
+		nlsr->is_send_lsdb_interest_scheduled=1;
+	}
+	nlsr->adj_build_count++;
+	
+	
+	free(temp_r);
 }
 
 
-int 
-install_adj_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
+void 
+make_adj_lsa_key(char *key,struct alsa *adj_lsa)
 {
-	my_lock();
-		
+	memcpy(key+strlen(key),adj_lsa->header->orig_router->name,adj_lsa->header->orig_router->length);
+	memcpy(key+strlen(key),"/",1);
+	char ls_type[2];
+	sprintf(ls_type,"%d",adj_lsa->header->ls_type);
+	memcpy(key+strlen(key),ls_type,strlen(ls_type));
+	key[strlen(key)]='\0';
+}
+
+void
+install_adj_lsa(struct alsa * adj_lsa)
+{
 	printf("install_adj_lsa called \n");
 
-	ev = ccn_schedule_event(nlsr->sched, 1000000, &install_adj_lsa, NULL, 0);
-
-	my_unlock();
-	return 0;
+	char *key=(char *)malloc(adj_lsa->header->orig_router->length+2+2);
+	memset(key,0,adj_lsa->header->orig_router->length+2);
+	make_adj_lsa_key(key,adj_lsa);
+	printf("Adjacent LSA key: %s \n",key);
 	
+	struct alsa *new_adj_lsa=(struct alsa*)malloc(sizeof(struct alsa ));
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee; 	
+    	int res;
+
+   	hashtb_start(nlsr->lsdb->adj_lsdb, e);
+    	res = hashtb_seek(e, key, strlen(key), 0);
+
+	
+
+	if(res == HT_NEW_ENTRY )
+	{
+		printf("New ADJ LSA... Adding to LSDB\n");
+		new_adj_lsa = e->data;
+
+		new_adj_lsa->header=(struct alsa_header *)malloc(sizeof(struct alsa_header ));
+		new_adj_lsa->header->ls_type=adj_lsa->header->ls_type;
+		new_adj_lsa->header->orig_time=(char *)malloc(strlen(adj_lsa->header->orig_time)+1);
+		memcpy(new_adj_lsa->header->orig_time,adj_lsa->header->orig_time,strlen(adj_lsa->header->orig_time)+1);		
+
+		new_adj_lsa->header->orig_router=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+		new_adj_lsa->header->orig_router->name=(char *)malloc(adj_lsa->header->orig_router->length);
+		memcpy(new_adj_lsa->header->orig_router->name,adj_lsa->header->orig_router->name,adj_lsa->header->orig_router->length);
+		new_adj_lsa->header->orig_router->length=adj_lsa->header->orig_router->length;
+	
+		new_adj_lsa->no_link=adj_lsa->no_link;
+
+		new_adj_lsa->body=(char *)malloc(strlen(adj_lsa->body)+1);
+		memset(new_adj_lsa->body,0,strlen(adj_lsa->body)+1);
+		memcpy(new_adj_lsa->body,adj_lsa->body,strlen(adj_lsa->body)+1);
+
+		printf("Old Version Number of LSDB: %s \n",nlsr->lsdb->version);
+		set_new_lsdb_version();	
+		printf("New Version Number of LSDB: %s \n",nlsr->lsdb->version);
+		
+
+	}
+	else if(res == HT_OLD_ENTRY)
+	{
+		new_adj_lsa = e->data;
+		if(strcmp(adj_lsa->header->orig_time,new_adj_lsa->header->orig_time)<=0)
+		{
+			printf("Older/Duplicate Adj LSA. Discarded...\n");
+		}
+		else
+		{
+			new_adj_lsa = e->data;
+
+			free(new_adj_lsa->header->orig_time);
+			new_adj_lsa->header->orig_time=(char *)malloc(strlen(adj_lsa->header->orig_time)+1);
+			memcpy(new_adj_lsa->header->orig_time,adj_lsa->header->orig_time,strlen(adj_lsa->header->orig_time)+1);
+			
+			new_adj_lsa->no_link=adj_lsa->no_link;
+
+			free(new_adj_lsa->body);
+			new_adj_lsa->body=(char *)malloc(strlen(adj_lsa->body)+1);
+			memset(new_adj_lsa->body,0,strlen(adj_lsa->body)+1);
+			memcpy(new_adj_lsa->body,adj_lsa->body,strlen(adj_lsa->body)+1);
+
+			printf("Old Version Number of LSDB: %s \n",nlsr->lsdb->version);
+			set_new_lsdb_version();	
+			printf("New Version Number of LSDB: %s \n",nlsr->lsdb->version);
+
+		}
+
+	}
+
+    	hashtb_end(e);
+	
+	free(key);
+}
+
+void 
+print_adj_lsa_body(const char *body, int no_link)
+{
+	int i=0;
+	char *lsa_data=(char *)malloc(strlen(body)+1);
+	memset(	lsa_data,0,strlen(body)+1);
+	memcpy(lsa_data,body,strlen(body)+1);
+	char *sep="|";
+	char *rem;
+	char *rtr_id;
+	char *length;
+	char *face;
+	char *metric;
+
+	printf("	Lsa Data:\n");
+	printf("		No of Link	: %d\n",no_link);
+
+	if(no_link >0 )
+	{
+		rtr_id=strtok_r(lsa_data,sep,&rem);
+		length=strtok_r(NULL,sep,&rem);
+		face=strtok_r(NULL,sep,&rem);
+		metric=strtok_r(NULL,sep,&rem);
+
+		printf("		Link %d	 	\n",i+1);
+		printf("		Neighbor		 : %s	\n",rtr_id);
+		printf("		Neighbor Length		 : %s	\n",length);
+		printf("		Connecting Face		 : %s	\n",face);
+		printf("		Metric			 : %s	\n",metric);
+		
+
+		for(i=1;i<no_link;i++)
+		{
+			rtr_id=strtok_r(NULL,sep,&rem);
+			length=strtok_r(NULL,sep,&rem);
+			face=strtok_r(NULL,sep,&rem);
+			metric=strtok_r(NULL,sep,&rem);
+			printf("		Link %d	 	\n",i+1);
+			printf("		Neighbor		 : %s	\n",rtr_id);
+			printf("		Neighbor Length		 : %s	\n",length);
+			printf("		Connecting Face		 : %s	\n",face);
+			printf("		Metric			 : %s	\n",metric);
+
+		}
+	}
+
+	free(lsa_data);
+}
+
+void
+print_adj_lsa(struct alsa * adj_lsa)
+{
+	
+	printf("print_adj_lsa called \n");
+	
+	printf("-----------ADJ LSA Content---------------\n");
+	printf("	Origination Router       :	%s\n",adj_lsa->header->orig_router->name);
+	printf("	Origination Router Length:	%d\n",adj_lsa->header->orig_router->length);
+	printf("	LS Type			 :	%d\n",adj_lsa->header->ls_type);
+	printf("	Origination Time	 :	%s\n",adj_lsa->header->orig_time);
+
+	print_adj_lsa_body(adj_lsa->body,adj_lsa->no_link);
+	
+
+	printf("\n");
+
+}
+
+void
+print_adj_lsdb(void)
+{
+	printf("print_name_lsdb called \n");	
+	int i, adj_lsdb_element;
+	struct alsa *adj_lsa;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->lsdb->adj_lsdb, e);
+	adj_lsdb_element=hashtb_n(nlsr->lsdb->adj_lsdb);
+
+	for(i=0;i<adj_lsdb_element;i++)
+	{
+		printf("-----------Adj LSA (%d)---------------\n",i+1);
+		adj_lsa=e->data;
+		print_adj_lsa(adj_lsa);	
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+
+	printf("\n");
+
+}
+
+char * 
+get_name_lsdb_summary()
+{
+	printf("get_name_lsdb_summary called \n");	
+	int i, name_lsdb_element;
+
+	long int len=0;
+
+	struct nlsa *name_lsa;
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->lsdb->name_lsdb, e);
+	name_lsdb_element=hashtb_n(nlsr->lsdb->name_lsdb);
+
+	for(i=0;i<name_lsdb_element;i++)
+	{
+		name_lsa=e->data;
+		
+		//ccn_charbuf_append_string(sum_data,name_lsa->header->orig_router->name);
+		len+=strlen(name_lsa->header->orig_router->name);
+		//ccn_charbuf_append_string(sum_data,"|");
+		len++;
+
+		char *temp=(char *)malloc(20);
+		memset(temp,0,20);
+		sprintf(temp,"%d",name_lsa->header->ls_type);
+		len+=strlen(temp);
+		//ccn_charbuf_append_string(sum_data,temp);
+		free(temp);
+		//ccn_charbuf_append_string(sum_data,"|");
+		len++;
+
+		char *temp1=(char *)malloc(20);
+		memset(temp1,0,20);
+		sprintf(temp1,"%ld",name_lsa->header->ls_id);
+		//ccn_charbuf_append_string(sum_data,temp1);
+		len+=strlen(temp1);
+		free(temp1);
+		//ccn_charbuf_append_string(sum_data,"|");
+		len++;
+			
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+
+	len++;
+
+	char *sum_data=malloc(len);
+	memset(sum_data,0,len);
+
+	hashtb_start(nlsr->lsdb->name_lsdb, e);
+	for(i=0;i<name_lsdb_element;i++)
+	{
+		name_lsa=e->data;
+		
+		//ccn_charbuf_append_string(sum_data,name_lsa->header->orig_router->name);
+		memcpy(sum_data+strlen(sum_data),name_lsa->header->orig_router->name,strlen(name_lsa->header->orig_router->name));
+		//len+=strlen(name_lsa->header->orig_router->name);
+		//ccn_charbuf_append_string(sum_data,"|");
+		memcpy(sum_data+strlen(sum_data),"|",1);
+		//len++;
+
+		char *tempstr=(char *)malloc(20);
+		memset(tempstr,0,20);
+		sprintf(tempstr,"%d",name_lsa->header->ls_type);
+		//len+=strlen(tempstr);
+		//ccn_charbuf_append_string(sum_data,temp);
+		memcpy(sum_data+strlen(sum_data),tempstr,strlen(tempstr));
+		free(tempstr);
+		//ccn_charbuf_append_string(sum_data,"|");
+		memcpy(sum_data+strlen(sum_data),"|",1);
+		//len++;
+
+		char *temp1str=(char *)malloc(20);
+		memset(temp1str,0,20);
+		sprintf(temp1str,"%ld",name_lsa->header->ls_id);
+		//ccn_charbuf_append_string(sum_data,temp1);
+		memcpy(sum_data+strlen(sum_data),temp1str,strlen(temp1str));
+		//len+=strlen(temp1str);
+		free(temp1str);
+		//ccn_charbuf_append_string(sum_data,"|");
+		memcpy(sum_data+strlen(sum_data),"|",1);
+		//len++;
+			
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+
+	printf("Summary Name LSDB: %s\n",sum_data);
+	
+	return sum_data;
+}
+
+char * 
+get_adj_lsdb_summary(void)
+{
+	printf("get_adj_lsdb_summary called \n");	
+	int i, adj_lsdb_element;
+	struct alsa *adj_lsa;
+
+	long int len=0;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->lsdb->adj_lsdb, e);
+	adj_lsdb_element=hashtb_n(nlsr->lsdb->adj_lsdb);
+
+	for(i=0;i<adj_lsdb_element;i++)
+	{
+		adj_lsa=e->data;
+		
+		//ccn_charbuf_append_string(sum_data,adj_lsa->header->orig_router->name);
+		len+=strlen(adj_lsa->header->orig_router->name);
+		//ccn_charbuf_append_string(sum_data,"|");
+		len++;
+
+		char *temp=(char *)malloc(20);
+		memset(temp,0,20);
+		sprintf(temp,"%d",adj_lsa->header->ls_type);
+		len+=strlen(temp);
+		//ccn_charbuf_append_string(sum_data,temp);
+		free(temp);
+		//ccn_charbuf_append_string(sum_data,"|");
+		len++;
+
+		//ccn_charbuf_append_string(sum_data,adj_lsa->header->orig_time);
+		len+=strlen(adj_lsa->header->orig_time);
+		//ccn_charbuf_append_string(sum_data,"|");
+		len++;
+			
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+	len++;	
+
+	char *sum_data=(char *)malloc(len);
+	memset(sum_data,0,len);
+
+	hashtb_start(nlsr->lsdb->adj_lsdb, e);
+	for(i=0;i<adj_lsdb_element;i++)
+	{
+		adj_lsa=e->data;
+		
+		//ccn_charbuf_append_string(sum_data,adj_lsa->header->orig_router->name);
+		memcpy(sum_data+strlen(sum_data),adj_lsa->header->orig_router->name,strlen(adj_lsa->header->orig_router->name));
+		//len+=strlen(adj_lsa->header->orig_router->name);
+		//ccn_charbuf_append_string(sum_data,"|");
+		memcpy(sum_data+strlen(sum_data),"|",1);
+		//len++;
+
+		char *temp1=(char *)malloc(20);
+		memset(temp1,0,20);
+		sprintf(temp1,"%d",adj_lsa->header->ls_type);
+		//len+=strlen(temp);
+		//ccn_charbuf_append_string(sum_data,temp);
+		memcpy(sum_data+strlen(sum_data),temp1,strlen(temp1));
+		free(temp1);
+		//ccn_charbuf_append_string(sum_data,"|");
+		memcpy(sum_data+strlen(sum_data),"|",1);
+		//len++;
+
+		//ccn_charbuf_append_string(sum_data,adj_lsa->header->orig_time);
+		memcpy(sum_data+strlen(sum_data),adj_lsa->header->orig_time,strlen(adj_lsa->header->orig_time));
+		//len+=strlen(adj_lsa->header->orig_time);
+		//ccn_charbuf_append_string(sum_data,"|");
+		memcpy(sum_data+strlen(sum_data),"|",1);
+		//len++;
+			
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+	
+	printf("Summary ADJ LSDB: %s\n",sum_data);
+
+	return sum_data;
+}
+
+void 
+get_name_lsa_data(struct ccn_charbuf *lsa_data,struct name_prefix *lsaId)
+{
+	printf("get_name_lsa_data called \n");
+
+	struct nlsa *name_lsa=(struct nlsa*)malloc(sizeof(struct nlsa ));
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee; 	
+    	int res;
+
+   	hashtb_start(nlsr->lsdb->name_lsdb, e);
+    	res = hashtb_seek(e, lsaId->name, lsaId->length-1, 0);
+
+	if( res == HT_OLD_ENTRY )
+	{
+		name_lsa=e->data;
+		printf("NAME LSA found\n");
+		
+		ccn_charbuf_append_string(lsa_data,name_lsa->header->orig_router->name);
+		ccn_charbuf_append_string(lsa_data,"|");
+
+		char *temp_length=(char *)malloc(20);
+		memset(temp_length,0,20);
+		sprintf(temp_length,"%d",name_lsa->header->orig_router->length);
+		ccn_charbuf_append_string(lsa_data,temp_length);
+		free(temp_length);
+		ccn_charbuf_append_string(lsa_data,"|");
+
+		char *temp_ltype=(char *)malloc(20);
+		memset(temp_ltype,0,20);
+		sprintf(temp_ltype,"%d",name_lsa->header->ls_type);
+		ccn_charbuf_append_string(lsa_data,temp_ltype);
+		free(temp_ltype);
+		ccn_charbuf_append_string(lsa_data,"|");
+
+		char *temp_lsid=(char *)malloc(20);
+		memset(temp_lsid,0,20);
+		sprintf(temp_lsid,"%ld",name_lsa->header->ls_id);
+		ccn_charbuf_append_string(lsa_data,temp_lsid);
+		free(temp_lsid);
+		ccn_charbuf_append_string(lsa_data,"|");
+
+		char *temp_valid=(char *)malloc(20);
+		memset(temp_valid,0,20);
+		sprintf(temp_valid,"%d",name_lsa->header->isValid);
+		ccn_charbuf_append_string(lsa_data,temp_valid);
+		free(temp_valid);
+		ccn_charbuf_append_string(lsa_data,"|");
+
+		ccn_charbuf_append_string(lsa_data,name_lsa->name_prefix->name);
+		ccn_charbuf_append_string(lsa_data,"|");
+
+		char *temp_npl=(char *)malloc(20);
+		memset(temp_npl,0,20);
+		sprintf(temp_npl,"%d",name_lsa->name_prefix->length);
+		ccn_charbuf_append_string(lsa_data,temp_npl);
+		free(temp_npl);
+		ccn_charbuf_append_string(lsa_data,"|");
+		
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+}
+
+void 
+get_adj_lsa_data(struct ccn_charbuf *lsa_data,struct name_prefix *lsaId)
+{
+	printf("get_adj_lsa_data called \n");
+
+	struct alsa *adj_lsa=(struct alsa*)malloc(sizeof(struct alsa ));
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee; 	
+    	int res;
+
+   	hashtb_start(nlsr->lsdb->adj_lsdb, e);
+    	res = hashtb_seek(e, lsaId->name, lsaId->length-1, 0);
+
+	if( res == HT_OLD_ENTRY )
+	{
+		adj_lsa=e->data;
+		printf("NAME LSA found\n");
+		
+		ccn_charbuf_append_string(lsa_data,adj_lsa->header->orig_router->name);
+		ccn_charbuf_append_string(lsa_data,"|");
+
+		char *temp_length=(char *)malloc(20);
+		memset(temp_length,0,20);
+		sprintf(temp_length,"%d",adj_lsa->header->orig_router->length);
+		ccn_charbuf_append_string(lsa_data,temp_length);
+		free(temp_length);
+		ccn_charbuf_append_string(lsa_data,"|");
+
+		char *temp_ltype=(char *)malloc(20);
+		memset(temp_ltype,0,20);
+		sprintf(temp_ltype,"%d",adj_lsa->header->ls_type);
+		ccn_charbuf_append_string(lsa_data,temp_ltype);
+		free(temp_ltype);
+		ccn_charbuf_append_string(lsa_data,"|");
+
+		ccn_charbuf_append_string(lsa_data,adj_lsa->header->orig_time);
+		ccn_charbuf_append_string(lsa_data,"|");
+
+		char *temp_nl=(char *)malloc(20);
+		memset(temp_nl,0,20);
+		sprintf(temp_nl,"%d",adj_lsa->no_link);
+		ccn_charbuf_append_string(lsa_data,temp_nl);
+		free(temp_nl);
+		ccn_charbuf_append_string(lsa_data,"|");
+
+		ccn_charbuf_append_string(lsa_data,adj_lsa->body);
+
+		
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+}
+
+long int
+get_name_lsdb_num_element(void)
+{
+	long int num_element;
+
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->lsdb->name_lsdb, e);
+	num_element=hashtb_n(nlsr->lsdb->name_lsdb);
+	hashtb_end(e);
+
+	return num_element; 
+}
+
+long int
+get_adj_lsdb_num_element(void)
+{
+	long int num_element;
+
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->lsdb->adj_lsdb, e);
+	num_element=hashtb_n(nlsr->lsdb->adj_lsdb);
+	hashtb_end(e);
+
+	return num_element; 
 }
diff --git a/nlsr_lsdb.h b/nlsr_lsdb.h
index c71a84d..5b37c60 100644
--- a/nlsr_lsdb.h
+++ b/nlsr_lsdb.h
@@ -7,7 +7,7 @@
 
 struct link
 {
-	struct ccn_charbuf *nbr;
+	struct name_prefix *nbr;
 	int face;
 	int metric;
 };
@@ -16,23 +16,24 @@
 struct alsa_header 
 {
 	unsigned int ls_type;
-	long int orig_time;
-	struct ccn_charbuf *orig_router;
+	char *orig_time;
+	struct name_prefix *orig_router;
+	
 };
 
 struct alsa
 {
 	struct alsa_header *header;	
 	int no_link;
-	struct link *links;
+	char *body;
 };
 
 struct nlsa_header
 {
 	unsigned int ls_type;
-	long int orig_time;
+	char *orig_time;
 	long int ls_id;
-	struct ccn_charbuf *orig_router;
+	struct name_prefix *orig_router;
 	unsigned int isValid;
 
 };
@@ -40,18 +41,36 @@
 struct nlsa
 {
 	struct nlsa_header *header;
-	struct ccn_charbuf *name_prefix;
+	struct name_prefix *name_prefix;
 };
 
+void set_new_lsdb_version(void);
 
-int initial_build_name_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags);
-void build_name_lsa(struct nlsa *name_lsa, struct ccn_charbuf *name_prefix);
-void install_name_lsa(struct nlsa *new_name_lsa);
-void make_name_lsa_key(struct ccn_charbuf *key, struct ccn_charbuf *orig_router, unsigned int ls_type, long int nlsa_id, long int orig_time);
-void print_name_lsdb(void);
+void build_and_install_name_lsas(void);
+void build_and_install_others_name_lsa(char *orig_router,int ls_type,long int ls_id,int isValid,char *np);
+void build_name_lsa(struct nlsa *name_lsa, struct name_prefix *np);
+void build_others_name_lsa(struct nlsa *name_lsa, char *orig_router,int ls_type,long int ls_id,int isValid,char *np);
 void print_name_lsa(struct nlsa *name_lsa);
+void install_name_lsa(struct nlsa *name_lsa);
+char * make_name_lsa_key(char *orig_router, int ls_type, long int ls_id);
+void print_name_lsdb(void);
 
+int build_and_install_adj_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags);
+void build_and_install_others_adj_lsa(char *orig_router,int ls_type,char *orig_time, int no_link,char *data);
+void build_adj_lsa(struct alsa * adj_lsa);
+void build_others_adj_lsa(struct alsa *adj_lsa,char *orig_router,int ls_type,char *orig_time,int no_link,char *data);
+void install_adj_lsa(struct alsa * adj_lsa);
+void make_adj_lsa_key(char *key,struct alsa *adj_lsa);
+void print_adj_lsa_body(const char *body, int no_link);
+void print_adj_lsa(struct alsa * adj_lsa);
+void print_adj_lsdb(void);
 
-int install_adj_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags);
+char * get_name_lsdb_summary(void);
+char * get_adj_lsdb_summary(void);
+void get_name_lsa_data(struct ccn_charbuf *lsa_data,struct name_prefix *lsaId);
+void get_adj_lsa_data(struct ccn_charbuf *lsa_data,struct name_prefix *lsaId);
+
+long int get_name_lsdb_num_element(void);
+long int get_adj_lsdb_num_element(void);
 
 #endif
diff --git a/nlsr_ndn.c b/nlsr_ndn.c
index af79e3a..d67cd1d 100644
--- a/nlsr_ndn.c
+++ b/nlsr_ndn.c
@@ -20,9 +20,10 @@
 
 #include "nlsr.h"
 #include "nlsr_ndn.h"
-#include "utility.h"
 #include "nlsr_adl.h"
 #include "nlsr_lsdb.h"
+#include "utility.h"
+
 
 int
 appendLifetime(struct ccn_charbuf *cb, int lifetime) 
@@ -41,399 +42,152 @@
 	return res;
 }
 
+
+void 
+get_nbr(struct name_prefix *nbr,struct ccn_closure *selfp, struct ccn_upcall_info *info)
+{
+
+	printf("get_nbr called\n");
+	int res,i;
+	int nlsr_position=0;
+	int name_comps=(int)info->interest_comps->n;
+	int len=0;
+
+	for(i=0;i<name_comps;i++)
+	{
+		res=ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,i,"nlsr");
+		if( res == 0)
+		{
+			nlsr_position=i;
+			break;
+		}	
+	}
+
+
+	const unsigned char *comp_ptr1;
+	size_t comp_size;
+	for(i=0;i<nlsr_position;i++)
+	{
+		res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,i,&comp_ptr1, &comp_size);
+		len+=1;
+		len+=(int)comp_size;	
+	}
+	len++;
+
+	char *neighbor=(char *)malloc(len);
+	memset(neighbor,0,len);
+
+	for(i=0; i<nlsr_position;i++)
+	{
+		res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,i,&comp_ptr1, &comp_size);
+		memcpy(neighbor+strlen(neighbor),"/",1);
+		memcpy(neighbor+strlen(neighbor),(char *)comp_ptr1,strlen((char *)comp_ptr1));
+
+	}
+	
+	//neighbor[strlen(neighbor)]='\0';
+
+	nbr->name=(char *)malloc(strlen(neighbor)+1);
+	memcpy(nbr->name,neighbor,strlen(neighbor)+1);
+	nbr->length=strlen(neighbor)+1;
+
+	printf("Neighbor: %s Length: %d\n",nbr->name,nbr->length);
+	
+
+}
+
+void 
+get_lsa_identifier(struct name_prefix *lsaId,struct ccn_closure *selfp, struct ccn_upcall_info *info)
+{
+
+	printf("get_nbr called\n");
+	int res,i;
+	int nlsr_position=0;
+	int name_comps=(int)info->interest_comps->n;
+	int len=0;
+
+	for(i=0;i<name_comps;i++)
+	{
+		res=ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,i,"nlsr");
+		if( res == 0)
+		{
+			nlsr_position=i;
+			break;
+		}	
+	}
+
+
+	const unsigned char *comp_ptr1;
+	size_t comp_size;
+	for(i=nlsr_position+2;i<info->interest_comps->n-2;i++)
+	{
+		res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,i,&comp_ptr1, &comp_size);
+		len+=1;
+		len+=(int)comp_size;	
+	}
+	len++;
+
+	char *neighbor=(char *)malloc(len);
+	memset(neighbor,0,len);
+
+	for(i=nlsr_position+2; i<info->interest_comps->n-2;i++)
+	{
+		res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,i,&comp_ptr1, &comp_size);
+		memcpy(neighbor+strlen(neighbor),"/",1);
+		memcpy(neighbor+strlen(neighbor),(char *)comp_ptr1,strlen((char *)comp_ptr1));
+
+	}
+	
+	//neighbor[strlen(neighbor)]='\0';
+
+	lsaId->name=(char *)malloc(strlen(neighbor)+1);
+	memset(lsaId->name,0,strlen(neighbor)+1);
+	memcpy(lsaId->name,neighbor,strlen(neighbor)+1);
+	lsaId->length=strlen(neighbor)+1;
+
+	printf("LSA Identifier: %s Length: %d\n",lsaId->name,lsaId->length-1);
+	
+
+}
+
 enum ccn_upcall_res 
 incoming_interest(struct ccn_closure *selfp,
         enum ccn_upcall_kind kind, struct ccn_upcall_info *info)
 {
-	my_lock();
-    
+    	my_lock();
     switch (kind) {
         case CCN_UPCALL_FINAL:
             break;
         case CCN_UPCALL_INTEREST:
-		// printing the name prefix for which it received interest
-            	printf("Interest Received for name: "); 
-	    	struct ccn_charbuf*c;
-		c=ccn_charbuf_create();
-		ccn_uri_append(c,info->interest_ccnb,info->pi->offset[CCN_PI_E_Name]-info->pi->offset[CCN_PI_B_Name],0);
-		ccn_uri_append(c,info->interest_ccnb,info->pi->offset[CCN_PI_E_Name],0);
-		//ccn_name_chop(c,NULL,-1);
-		printf("%s\n",ccn_charbuf_as_string(c));
-		ccn_charbuf_destroy(&c);
-
+            	printf("Interest Received \n"); 
 		process_incoming_interest(selfp, info);
-		
-		/* 
-	    	struct ccn_charbuf *data=ccn_charbuf_create();
-	    	struct ccn_charbuf *name=ccn_charbuf_create();
-	    	struct ccn_signing_params sp=CCN_SIGNING_PARAMS_INIT;
-	   
-		 ccn_charbuf_append(name, info->interest_ccnb + info->pi->offset[CCN_PI_B_Name],
-            info->pi->offset[CCN_PI_E_Name] - info->pi->offset[CCN_PI_B_Name]); 
-
-		sp.template_ccnb=ccn_charbuf_create();
-		ccn_charbuf_append_tt(sp.template_ccnb,CCN_DTAG_SignedInfo, CCN_DTAG);
-		ccnb_tagged_putf(sp.template_ccnb, CCN_DTAG_FreshnessSeconds, "%ld", 1010);
-                sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;
-        	ccn_charbuf_append_closer(sp.template_ccnb);		   
-
-		res= ccn_sign_content(ospfndn->ccn, data, name, &sp, "hello", strlen("hello")); 
-	    	res=ccn_put(ospfndn->ccn,data->buf,data->length);
-            	ccn_charbuf_destroy(&data);  
-
-		*/
 		break;
-
         default:
             break;
     }
-
 	my_unlock();
     return CCN_UPCALL_RESULT_OK;
 }
 
 
-enum ccn_upcall_res incoming_content(struct ccn_closure* selfp,
-        enum ccn_upcall_kind kind, struct ccn_upcall_info* info)
-{
-
-	my_lock();
-
-    switch(kind) {
-        case CCN_UPCALL_FINAL:
-            break;
-        case CCN_UPCALL_CONTENT:
-            	printf("Content Received for name: ");  
-		struct ccn_charbuf*c;
-		c=ccn_charbuf_create();
-		ccn_uri_append(c,info->interest_ccnb,info->pi->offset[CCN_PI_E],0);
-		printf("%s\n",ccn_charbuf_as_string(c));
-		ccn_charbuf_destroy(&c);
-	
-		process_incoming_content(selfp, info);
-
-	    break;
-        case CCN_UPCALL_INTEREST_TIMED_OUT:
-          	printf("Interest timed out \n"); 
-		struct ccn_charbuf*ic;
-		ic=ccn_charbuf_create();
-		ccn_uri_append(ic,info->interest_ccnb,info->pi->offset[CCN_PI_E_Name],0);
-		printf("%s\n",ccn_charbuf_as_string(ic));
-		ccn_charbuf_destroy(&ic);	    
-		process_incoming_timed_out_interest(selfp,info);
-
-	    break;
-        default:
-            fprintf(stderr, "Unexpected response of kind %d\n", kind);
-            return CCN_UPCALL_RESULT_ERR;
-    }
-
-	my_unlock();
-    return CCN_UPCALL_RESULT_OK;
-}
-
-
-void 
-process_incoming_content(struct ccn_closure* selfp, struct ccn_upcall_info* info)
-{
-	printf("process_incoming_content called \n");
-
-	struct ccn_charbuf*c;
-	c=ccn_charbuf_create();
-	//ccn_uri_append(c,info->interest_ccnb,info->pi->offset[CCN_PI_E_Name]-info->pi->offset[CCN_PI_B_Name],0);
-	ccn_uri_append(c,info->interest_ccnb,info->pi->offset[CCN_PI_E_Name],0);
-	printf("%s\n",ccn_charbuf_as_string(c));
-	ccn_charbuf_destroy(&c);
-
-	const unsigned char *comp_ptr1;
-	size_t comp_size;
-	int res,i;
-	int nlsr_position=0;
-	int name_comps=(int)info->interest_comps->n;
-	
-	for(i=0;i<name_comps;i++)
-	{
-		res=ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,i,"nlsr");
-		if( res == 0)
-		{
-			nlsr_position=i;
-			break;
-		}	
-	}
-
-	res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,nlsr_position+1,&comp_ptr1, &comp_size);
-
-
-	printf("Det= %s \n",comp_ptr1);
-
-	if(!strcmp((char *)comp_ptr1,"lsdb"))
-	{
-		process_incoming_content_lsdb(selfp,info);
-	}
-	if(!strcmp((char *)comp_ptr1,"info"))
-	{
-		process_incoming_content_info(selfp,info);
-	}
-
-}
-
-
-void 
-process_incoming_content_lsdb(struct ccn_closure* selfp, struct ccn_upcall_info* info)
-{
-	printf("process_incoming_content_lsdb called \n");
-
-	const unsigned char *content_data;
-	size_t length;
-	ccn_content_get_value(info->content_ccnb, info->pco->offset[CCN_PCO_E_Content]-info->pco->offset[CCN_PCO_B_Content], info->pco, &content_data, &length);
-
-
-	if ( !strcmp((char *)content_data,"NACK"))
-	{
-		printf("NACK received for LSDB request. Do nothing \n");
-	}
-	else
-	{
-		// Do the LSDB processing here 
-
-		const unsigned char *comp_ptr1;
-		size_t comp_size;
-		int res;
-
-		res=ccn_name_comp_get(info->content_ccnb, info->content_comps,info->interest_comps->n-1,&comp_ptr1, &comp_size);
-		if ( res >=0)
-		printf("Received Database Version: %s \n",(char *)comp_ptr1);
-
-	}
-
-	
-
-}
-
-
-
-void 
-process_incoming_content_info(struct ccn_closure* selfp, struct ccn_upcall_info* info)
-{
-	printf("process_incoming_content_info called \n");
-
-	const unsigned char *content_data;
-	size_t length;
-	ccn_content_get_value(info->content_ccnb, info->pco->offset[CCN_PCO_E_Content]-info->pco->offset[CCN_PCO_B_Content], info->pco, &content_data, &length);
-
-	printf("Info Value: %s \n",(char *)content_data);
-
-
-	int res,i;
-	int nlsr_position=0;
-	int name_comps=(int)info->interest_comps->n;
-
-	for(i=0;i<name_comps;i++)
-	{
-		res=ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,i,"nlsr");
-		if( res == 0)
-		{
-			nlsr_position=i;
-			break;
-		}	
-	}
-	
-	struct ccn_charbuf *nbr;
-	nbr=ccn_charbuf_create();
-
-	
-	const unsigned char *comp_ptr1;
-	size_t comp_size;
-	for(i=0;i<nlsr_position;i++)
-	{
-		res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,i,&comp_ptr1, &comp_size);
-		//printf("%s \n",comp_ptr1);
-		ccn_charbuf_append_string(nbr,"/");
-		ccn_charbuf_append_string(nbr,(const char *)comp_ptr1);	
-	}
-
-	ccn_charbuf_append_string(nbr,"\0");	
-	printf("Info Content received for Neighbor: %s\n",ccn_charbuf_as_string(nbr));
-	
-	update_adjacent_timed_out_zero_to_adl(nbr);
-	update_adjacent_status_to_adl(nbr,NBR_ACTIVE);
-
-	print_adjacent_from_adl();
-
-	nlsr->event_build_adj_lsa = ccn_schedule_event(nlsr->sched, 1, &install_adj_lsa, NULL, 0);
-
-	ccn_charbuf_destroy(&nbr);	
-	
-
-}
-
-void 
-process_incoming_timed_out_interest(struct ccn_closure* selfp, struct ccn_upcall_info* info)
-{
-	printf("process_incoming_timed_out_interest called \n");
-
-	struct ccn_charbuf*c;
-	c=ccn_charbuf_create();
-	//ccn_uri_append(c,info->interest_ccnb,info->pi->offset[CCN_PI_E_Name]-info->pi->offset[CCN_PI_B_Name],0);
-	ccn_uri_append(c,info->interest_ccnb,info->pi->offset[CCN_PI_E_Name],0);
-	printf("%s\n",ccn_charbuf_as_string(c));
-	ccn_charbuf_destroy(&c);
-
-	//const unsigned char *comp_ptr1;
-	//size_t comp_size;
-	int res,i;
-	int nlsr_position=0;
-	int name_comps=(int)info->interest_comps->n;
-	
-	for(i=0;i<name_comps;i++)
-	{
-		res=ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,i,"nlsr");
-		if( res == 0)
-		{
-			nlsr_position=i;
-			break;
-		}	
-	}
-
-	//res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,nlsr_position+1,&comp_ptr1, &comp_size);
-
-
-	//printf("Det= %s \n",comp_ptr1);
-
-	//if(!strcmp((char *)comp_ptr1,"lsdb"))
-	if(ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,nlsr_position+1,"lsdb") == 0)
-	{
-		process_incoming_timed_out_interest_lsdb(selfp,info);
-	}
-	else if(ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,nlsr_position+1,"info") == 0)
-	{
-		process_incoming_timed_out_interest_info(selfp,info);
-	}
-}
-
-
-void 
-process_incoming_timed_out_interest_lsdb(struct ccn_closure* selfp, struct ccn_upcall_info* info)
-{
-	printf("process_incoming_timed_out_interest_lsdb called \n");
-
-		
-	int res,i;
-	int nlsr_position=0;
-	int name_comps=(int)info->interest_comps->n;
-
-	//const unsigned char *comp_ptr1;
-	//size_t comp_size;
-	
-	for(i=0;i<name_comps;i++)
-	{
-		res=ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,i,"nlsr");
-		if( res == 0)
-		{
-			nlsr_position=i;
-			break;
-		}	
-	}	
-
-
-	struct ccn_charbuf *nbr;
-	nbr=ccn_charbuf_create();
-
-	
-	const unsigned char *comp_ptr1;
-	size_t comp_size;
-	for(i=0;i<nlsr_position;i++)
-	{
-		res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,i,&comp_ptr1, &comp_size);
-		//printf("%s \n",comp_ptr1);
-		ccn_charbuf_append_string(nbr,"/");
-		ccn_charbuf_append_string(nbr,(const char *)comp_ptr1);	
-	}
-
-	ccn_charbuf_append_string(nbr,"\0");	
-	printf("Interest Timed out for Neighbor: %s\n",ccn_charbuf_as_string(nbr));
-
-	//update_adjacent_status_to_adl(nbr,1);
-
-	ccn_charbuf_destroy(&nbr);	
-}
-
-void 
-process_incoming_timed_out_interest_info(struct ccn_closure* selfp, struct ccn_upcall_info* info)
-{
-
-	printf("process_incoming_timed_out_interest_info called \n");
-
-	int res,i;
-	int nlsr_position=0;
-	int name_comps=(int)info->interest_comps->n;
-
-	for(i=0;i<name_comps;i++)
-	{
-		res=ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,i,"nlsr");
-		if( res == 0)
-		{
-			nlsr_position=i;
-			break;
-		}	
-	}
-	
-	struct ccn_charbuf *nbr;
-	nbr=ccn_charbuf_create();
-
-	
-	const unsigned char *comp_ptr1;
-	size_t comp_size;
-	for(i=0;i<nlsr_position;i++)
-	{
-		res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,i,&comp_ptr1, &comp_size);
-		//printf("%s \n",comp_ptr1);
-		ccn_charbuf_append_string(nbr,"/");
-		ccn_charbuf_append_string(nbr,(const char *)comp_ptr1);	
-	}
-
-	ccn_charbuf_append_string(nbr,"\0");	
-	printf("Info Interest Timed out for Neighbor: %s\n",ccn_charbuf_as_string(nbr));
-
-	update_adjacent_timed_out_to_adl(nbr,1);
-
-	print_adjacent_from_adl();	
-
-	int timed_out=get_timed_out_number(nbr);
-	if(timed_out<nlsr->interest_retry && timed_out>0) // use configured variables 
-	{
-		printf("Neighbor: %s Info Interest Timed Out: %d times\n",ccn_charbuf_as_string(nbr),timed_out);
-		send_info_interest_to_neighbor(nbr);
-	}
-	else
-	{
-		printf("Neighbor: %s Info Interest Timed Out: %d times\n",ccn_charbuf_as_string(nbr),timed_out);
-		nlsr->event_build_adj_lsa = ccn_schedule_event(nlsr->sched, 1, &install_adj_lsa, NULL, 0);
-	}
-
-	ccn_charbuf_destroy(&nbr);
-}
-
-
 void 
 process_incoming_interest(struct ccn_closure *selfp, struct ccn_upcall_info *info)
 {
 	printf("process_incoming_interest called \n");
 
-
+	/*
 	struct ccn_charbuf*c;
 	c=ccn_charbuf_create();
-	//ccn_uri_append(c,info->interest_ccnb,info->pi->offset[CCN_PI_E_Name]-info->pi->offset[CCN_PI_B_Name],0);
-	ccn_uri_append(c,info->interest_ccnb,info->pi->offset[CCN_PI_E_Name],0);
+	ccn_uri_append(c,info->interest_ccnb,info->pi->offset[CCN_PI_E_Name]-info->pi->offset[CCN_PI_B_Name],0);	
 	printf("%s\n",ccn_charbuf_as_string(c));
 	ccn_charbuf_destroy(&c);
-
+	*/
 	const unsigned char *comp_ptr1;
 	size_t comp_size;
 	int res,i;
 	int nlsr_position=0;
 	int name_comps=(int)info->interest_comps->n;
-	
+
 	for(i=0;i<name_comps;i++)
 	{
 		res=ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,i,"nlsr");
@@ -445,17 +199,82 @@
 	}
 
 	res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,nlsr_position+1,&comp_ptr1, &comp_size);
-	
+
 	printf("Det= %s \n",comp_ptr1);
 
-	if(!strcmp((char *)comp_ptr1,"lsdb"))
-	{
-		process_incoming_interest_lsdb(selfp,info);
-	}
 	if(!strcmp((char *)comp_ptr1,"info"))
 	{
 		process_incoming_interest_info(selfp,info);
 	}
+	if(!strcmp((char *)comp_ptr1,"lsdb"))
+	{
+		process_incoming_interest_lsdb(selfp,info);
+	}
+	if(!strcmp((char *)comp_ptr1,"lsa"))
+	{
+		process_incoming_interest_lsa(selfp,info);
+	}
+	
+}
+
+void 
+process_incoming_interest_info(struct ccn_closure *selfp, struct ccn_upcall_info *info)
+{
+	printf("process_incoming_interest_info called \n");
+	
+
+	printf("Sending info Content Back ...\n");
+	int res;
+	struct ccn_charbuf *data=ccn_charbuf_create();
+    	struct ccn_charbuf *name=ccn_charbuf_create();
+    	struct ccn_signing_params sp=CCN_SIGNING_PARAMS_INIT;
+	
+	res=ccn_charbuf_append(name, info->interest_ccnb + info->pi->offset[CCN_PI_B_Name],info->pi->offset[CCN_PI_E_Name] - info->pi->offset[CCN_PI_B_Name]);
+	if (res >= 0)
+	{
+		sp.template_ccnb=ccn_charbuf_create();
+		ccn_charbuf_append_tt(sp.template_ccnb,CCN_DTAG_SignedInfo, CCN_DTAG);
+		ccnb_tagged_putf(sp.template_ccnb, CCN_DTAG_FreshnessSeconds, "%ld", 10);
+       	 	sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;
+		ccn_charbuf_append_closer(sp.template_ccnb);
+
+
+		char *raw_data=(char *)malloc(16);
+		memset(raw_data,0,16);
+		sprintf(raw_data,"%ld", nlsr->lsdb_synch_interval);	
+
+		res= ccn_sign_content(nlsr->ccn, data, name, &sp, raw_data,strlen(raw_data)); 
+		if(res >= 0)
+			printf("Signing Content is successful \n");
+
+    		res=ccn_put(nlsr->ccn,data->buf,data->length);		
+		if(res >= 0)
+		printf("Sending Info Content is successful \n");
+
+		printf("Info Content sending done....\n");
+
+
+		struct name_prefix *nbr=(struct name_prefix * )malloc(sizeof(struct name_prefix *));
+		get_lsa_identifier(nbr,selfp,info);
+		printf("Neighbor : %s Length : %d Status : %d\n",nbr->name,nbr->length,get_adjacent_status(nbr));
+	
+
+		if( get_adjacent_status(nbr) == 0 && get_timed_out_number(nbr)>=nlsr->interest_retry )
+		{
+			send_info_interest_to_neighbor(nbr);
+		}
+
+		free(nbr);
+		free(raw_data);
+		ccn_charbuf_destroy(&sp.template_ccnb);
+	}
+	
+	ccn_charbuf_destroy(&data);
+	ccn_charbuf_destroy(&name);	
+
+	
+
+		
 }
 
 
@@ -463,14 +282,14 @@
 process_incoming_interest_lsdb(struct ccn_closure *selfp, struct ccn_upcall_info *info)
 {
 	printf("process_incoming_interest_lsdb called \n");
-	
-	int l, res;
+
+	int l,res;
 	const unsigned char *exclbase;
 	size_t size;
 	struct ccn_buf_decoder decoder;
 	struct ccn_buf_decoder *d;
-	const unsigned char *comp;	
-
+	const unsigned char *comp;
+	int dbcmp=0;
 
 	l = info->pi->offset[CCN_PI_E_Exclude] - info->pi->offset[CCN_PI_B_Exclude];
 	if (l > 0) 
@@ -489,345 +308,930 @@
 				ccn_buf_advance(d);
 				ccn_buf_match_blob(d, &comp, &size);
 				ccn_buf_check_close(d);			
-				
-				
+
+
 			}
 			ccn_buf_check_close(d);
 		}
-		//if (d->decoder.state < 0)
-			//printf("Parse Failed\n");
 		if (comp != NULL)
-			printf("Number in Exclusion Filter is %s\n",comp);
-			
+		{
+			printf("LSDB Version in Exclusion Filter is %s\n",comp);
+			dbcmp=strcmp(nlsr->lsdb->version,(char *)comp);
+		}
 		/* Now comp points to the start of your potential number, and size is its length */
 	}
-
-	int excl_db_version=atoi((char *)comp);
-	int dbcmp=nlsr->lsdb->version-excl_db_version;
-	//int dbcmp=strncmp(nlsr->lsdb->version,(char *)comp,16);
-
-	
-
-	printf (" dbcmp = %d \n",dbcmp);	
-
-	if(dbcmp > 0)
+	else
 	{
-		printf("Has Updated database (Older: %s New: %ld)\n",comp,nlsr->lsdb->version);
-	}
-	else 
-	{
-		printf("Data base is not updated than the older one (Older: %s New: %ld)\n",comp,nlsr->lsdb->version);
-		printf("Sending NACK Content back.....\n");
-
-		struct ccn_charbuf *data=ccn_charbuf_create();
-	    	struct ccn_charbuf *name=ccn_charbuf_create();
-	    	struct ccn_signing_params sp=CCN_SIGNING_PARAMS_INIT;
-
-		ccn_charbuf_append(name, info->interest_ccnb + info->pi->offset[CCN_PI_B_Name],info->pi->offset[CCN_PI_E_Name] - info->pi->offset[CCN_PI_B_Name]); 
-		
-		sp.template_ccnb=ccn_charbuf_create();
-		ccn_charbuf_append_tt(sp.template_ccnb,CCN_DTAG_SignedInfo, CCN_DTAG);
-		ccnb_tagged_putf(sp.template_ccnb, CCN_DTAG_FreshnessSeconds, "%ld", 10);
-                sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;
-        	ccn_charbuf_append_closer(sp.template_ccnb);		   
-
-		res= ccn_sign_content(nlsr->ccn, data, name, &sp, "NACK", strlen("NACK")); 
-		if(res >= 0)
-			printf("Signing Content is successful \n");
-
-	    	res=ccn_put(nlsr->ccn,data->buf,data->length);
-		
-		if(res >= 0)
-			printf("Sending NACK Content is successful \n");
-
-            	ccn_charbuf_destroy(&data);
-		ccn_charbuf_destroy(&name);
-		ccn_charbuf_destroy(&sp.template_ccnb);		
+		printf("LSDB Version in Exclusion Filter is: None Added\n");
+		dbcmp=1;		
 
 	}
 
-}
-
-
-void 
-process_incoming_interest_info(struct ccn_closure *selfp, struct ccn_upcall_info *info)
-{
-	printf("process_incoming_interest_info called \n");
-	int res;
-
-	printf("Sending Info Content back.....\n");
-
 	struct ccn_charbuf *data=ccn_charbuf_create();
-    	struct ccn_charbuf *name=ccn_charbuf_create();
-    	struct ccn_signing_params sp=CCN_SIGNING_PARAMS_INIT;
-
-	ccn_charbuf_append(name, info->interest_ccnb + info->pi->offset[CCN_PI_B_Name],info->pi->offset[CCN_PI_E_Name] - info->pi->offset[CCN_PI_B_Name]);	
+	struct ccn_charbuf *name=ccn_charbuf_create();
+	struct ccn_signing_params sp=CCN_SIGNING_PARAMS_INIT;
+	
+	ccn_charbuf_append(name, info->interest_ccnb + info->pi->offset[CCN_PI_B_Name],info->pi->offset[CCN_PI_E_Name] - info->pi->offset[CCN_PI_B_Name]); 
 
 	sp.template_ccnb=ccn_charbuf_create();
 	ccn_charbuf_append_tt(sp.template_ccnb,CCN_DTAG_SignedInfo, CCN_DTAG);
 	ccnb_tagged_putf(sp.template_ccnb, CCN_DTAG_FreshnessSeconds, "%ld", 10);
-	sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;
-	ccn_charbuf_append_closer(sp.template_ccnb);	
+        sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;
+        ccn_charbuf_append_closer(sp.template_ccnb);
 
-	res= ccn_sign_content(nlsr->ccn, data, name, &sp,"info",strlen("info") ); 
-	if(res >= 0)
-		printf("Signing Content is successful \n");
 
-    	res=ccn_put(nlsr->ccn,data->buf,data->length);		
-	if(res >= 0)
-		printf("Sending Info Content is successful \n");
+	if(dbcmp>0)
+	{
+		printf("Has Updated Database than Neighbor\n");
+		printf("Sending LSDB Summary of Updated LSDB Content...\n");	
+		/*
+		ccn_charbuf_append(name, info->interest_ccnb + info->pi->offset[CCN_PI_B_Name],info->pi->offset[CCN_PI_E_Name] - info->pi->offset[CCN_PI_B_Name]); 
+
+		ccn_charbuf_append_tt(sp.template_ccnb,CCN_DTAG_SignedInfo, CCN_DTAG);
+		ccnb_tagged_putf(sp.template_ccnb, CCN_DTAG_FreshnessSeconds, "%ld", 10);
+                sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;
+        	ccn_charbuf_append_closer(sp.template_ccnb);
+		*/	
+
+		//ccn_charbuf_append_string(name,nlsr->lsdb->version);
+
+
+		
+		long int num_lsa=get_name_lsdb_num_element() + get_adj_lsdb_num_element();
+		char *num_element=(char *)malloc(15);
+		memset(num_element,0,15);
+		sprintf(num_element,"%ld|",num_lsa);
+
+		char *name_lsdb_summary=get_name_lsdb_summary();
+		char *adj_lsdb_summary=get_adj_lsdb_summary();
+
+		char *raw_data=(char *)malloc(strlen(num_element) + strlen(name_lsdb_summary)+strlen(adj_lsdb_summary)+1);
+		memset(raw_data,0,strlen(num_element) + strlen(name_lsdb_summary)+strlen(adj_lsdb_summary)+1);
+
+		memcpy(raw_data+strlen(raw_data),num_element,strlen(num_element)+1);
+
+		if( strlen(name_lsdb_summary) >0 )
+		{
+			memcpy(raw_data+strlen(raw_data),name_lsdb_summary,strlen(name_lsdb_summary)+1);
+		}
+		if( strlen(adj_lsdb_summary) >0 )
+		{
+			memcpy(raw_data+strlen(raw_data),adj_lsdb_summary,strlen(adj_lsdb_summary)+1);
+		}
+
+		printf("Content Data to be sent: %s \n",raw_data);		
+
+		if(nlsr->adj_build_count == 0 && nlsr->is_build_adj_lsa_sheduled == 1)
+		{
+			 res= ccn_sign_content(nlsr->ccn, data, name, &sp, "WAIT" , strlen("WAIT"));
+		}
+		else
+		{
+			res= ccn_sign_content(nlsr->ccn, data, name, &sp, raw_data , strlen(raw_data));
+		}
+		if(res >= 0)
+			printf("Signing LSDB Summary of Updated LSDB Content is successful \n");
+
+	    	res=ccn_put(nlsr->ccn,data->buf,data->length);
+
+		if(res >= 0)
+			printf("Sending LSDB Summary of Updated LSDB Content is successful \n");
+
+		//ccn_charbuf_destroy(&nlsd);
+		//ccn_charbuf_destroy(&alsd);
+		free(num_element);
+	}
+	else
+	{
+		printf("Does not have Updated Database than Neighbor\n");
+		
+		printf("Sending NACK Content.....\n");	
+		//ccn_charbuf_append(name, info->interest_ccnb + info->pi->offset[CCN_PI_B_Name],info->pi->offset[CCN_PI_E_Name] - info->pi->offset[CCN_PI_B_Name]); 
+
+		/*
+		ccn_charbuf_append_tt(sp.template_ccnb,CCN_DTAG_SignedInfo, CCN_DTAG);
+		ccnb_tagged_putf(sp.template_ccnb, CCN_DTAG_FreshnessSeconds, "%ld", 10);
+                sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;
+        	ccn_charbuf_append_closer(sp.template_ccnb);		   
+		*/
+		res= ccn_sign_content(nlsr->ccn, data, name, &sp, "NACK", strlen("NACK")); 
+		if(res >= 0)
+			printf("Signing NACK Content is successful \n");
+
+	    	res=ccn_put(nlsr->ccn,data->buf,data->length);
+
+		if(res >= 0)
+			printf("Sending NACK Content is successful \n");
+
+		
+	}
 
 	ccn_charbuf_destroy(&data);
 	ccn_charbuf_destroy(&name);
-	//ccn_charbuf_destroy(&c);
 	ccn_charbuf_destroy(&sp.template_ccnb);
 
 }
 
-int
-send_lsdb_interest(struct ccn_schedule *sched, void *clienth,
-        struct ccn_scheduled_event *ev, int flags)
+void 
+process_incoming_interest_lsa(struct ccn_closure *selfp, struct ccn_upcall_info *info)
 {
-	my_lock();
-	struct ccn_charbuf *name;
-	long int rnum;
-	char rnumstr[20];
-	char lsdb_str[5];
-	char nlsr_str[5];
+	printf("process_incoming_interest_lsa called \n");
 
-	int res,i;
-	int adl_element;
+	/*
+	struct ccn_charbuf*c;
+	c=ccn_charbuf_create();
+	ccn_uri_append(c,info->interest_ccnb,info->pi->offset[CCN_PI_E_Name]-info->pi->offset[CCN_PI_B_Name],0);	
+	printf("%s\n",ccn_charbuf_as_string(c));
+	ccn_charbuf_destroy(&c);
+	*/
+	int res;
 
-	rnum=random();
-	memset(&rnumstr,0,20);
-	sprintf(rnumstr,"%ld",rnum);
-	memset(&nlsr_str,0,5);
-	sprintf(nlsr_str,"nlsr");
-	memset(&lsdb_str,0,5);
-	sprintf(lsdb_str,"lsdb");
-	
+	struct name_prefix *lsaId=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+	get_lsa_identifier(lsaId,selfp,info);
 
-	struct ndn_neighbor *nbr;
+	printf("LSA Identifier: %s Length: %d\n",lsaId->name,lsaId->length-1);
+	printf("Router Name   : %s Length: %d\n",nlsr->router_name->name,nlsr->router_name->length);		
 
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-    	
-    	hashtb_start(nlsr->adl, e);
-	adl_element=hashtb_n(nlsr->adl);
-	//int mynumber=15;
+	char lsa_type=lsaId->name[nlsr->router_name->length];
+	printf("LSA Type: %c\n",lsa_type);
+	int ls_type=atoi(&lsa_type);
 
-	for(i=0;i<adl_element;i++)
+	struct ccn_charbuf *lsa_data=ccn_charbuf_create();
+
+	if ( ls_type == LSA_NAME_TYPE )
 	{
-		nbr=e->data;
-		printf("Sending interest for name prefix:%s/%s/%s\n",ccn_charbuf_as_string(nbr->neighbor),nlsr_str,lsdb_str);	
-		name=ccn_charbuf_create();
-		res=ccn_name_from_uri(name,ccn_charbuf_as_string(nbr->neighbor));
-		ccn_name_append_str(name,nlsr_str);
-		ccn_name_append_str(name,lsdb_str);
-		//ccn_name_append_str(name,rnumstr);
-
-		/* adding Exclusion filter */
-		
-		struct ccn_charbuf *templ;
-		templ = ccn_charbuf_create();
-
-		struct ccn_charbuf *c;
-		c = ccn_charbuf_create();
-
-
-		ccn_charbuf_append_tt(templ, CCN_DTAG_Interest, CCN_DTAG);
-		ccn_charbuf_append_tt(templ, CCN_DTAG_Name, CCN_DTAG);
-		ccn_charbuf_append_closer(templ); /* </Name> */
-		ccn_charbuf_append_tt(templ, CCN_DTAG_Exclude, CCN_DTAG);
-		ccnb_tagged_putf(templ, CCN_DTAG_Any, "");
-		ccn_charbuf_reset(c);
-		//ccn_charbuf_putf(c, "%u", (unsigned)mynumber);
-		//ccn_charbuf_putf(c, "%s", nbr->last_lsdb_version);
-		ccn_charbuf_putf(c, "%u", (unsigned)nbr->last_lsdb_version);
-		ccnb_append_tagged_blob(templ, CCN_DTAG_Component, c->buf, c->length);
-		ccn_charbuf_append_closer(templ); /* </Exclude> */
-		ccn_charbuf_append_closer(templ); /* </Interest> */
-
-	
-		/* Adding Exclusion filter done */
-				
-		res=ccn_express_interest(nlsr->ccn,name,&(nlsr->in_content),templ);
-			
-		if ( res >= 0 )
-			printf("Interest sending Successfull .... \n");	
-		ccn_charbuf_destroy(&c);
-		ccn_charbuf_destroy(&templ);
-		ccn_charbuf_destroy(&name);
-	
-		hashtb_next(e);		
+		printf("Interest Received for NAME LSA\n");
+		get_name_lsa_data(lsa_data,lsaId);
+	}
+	else if ( ls_type == LSA_ADJ_TYPE )
+	{
+		printf("Interest Received for ADJ LSA\n");
+		get_adj_lsa_data(lsa_data,lsaId);
 	}
 
-	hashtb_end(e);
+	char *rdata=ccn_charbuf_as_string(lsa_data);
+	char *raw_data=(char *)malloc(strlen(rdata)+1);
+	memset(raw_data,0,strlen(rdata)+1);
+	memcpy(raw_data,(char *)rdata,strlen(rdata)+1);
+	printf("Content Data to be sent: %s\n",raw_data);
 
-	nlsr->event_send_lsdb_interest = ccn_schedule_event(nlsr->sched, 60000000, &send_lsdb_interest, NULL, 0);
+	struct ccn_charbuf *data=ccn_charbuf_create();
+	struct ccn_charbuf *name=ccn_charbuf_create();
+	struct ccn_signing_params sp=CCN_SIGNING_PARAMS_INIT;
+	
+	ccn_charbuf_append(name, info->interest_ccnb + info->pi->offset[CCN_PI_B_Name],info->pi->offset[CCN_PI_E_Name] - info->pi->offset[CCN_PI_B_Name]); 
 
-	my_unlock();
-	return 0;
+	sp.template_ccnb=ccn_charbuf_create();
+	ccn_charbuf_append_tt(sp.template_ccnb,CCN_DTAG_SignedInfo, CCN_DTAG);
+	ccnb_tagged_putf(sp.template_ccnb, CCN_DTAG_FreshnessSeconds, "%ld", 10);
+        sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;
+        ccn_charbuf_append_closer(sp.template_ccnb);
 
+	res= ccn_sign_content(nlsr->ccn, data, name, &sp, raw_data , strlen(raw_data)); 
+	if(res >= 0)
+		printf("Signing LSA Content is successful \n");
+
+	res=ccn_put(nlsr->ccn,data->buf,data->length);
+	if(res >= 0)
+		printf("Sending LSA Content is successful \n");
+
+	
+	
+	ccn_charbuf_destroy(&data);
+	ccn_charbuf_destroy(&name);
+	ccn_charbuf_destroy(&sp.template_ccnb);
+	ccn_charbuf_destroy(&lsa_data);
+
+	free(raw_data);
+	free(lsaId);
 }
 
-
-int
-send_info_interest(struct ccn_schedule *sched, void *clienth,
-        struct ccn_scheduled_event *ev, int flags)
+enum ccn_upcall_res incoming_content(struct ccn_closure* selfp,
+        enum ccn_upcall_kind kind, struct ccn_upcall_info* info)
 {
 
 	my_lock();
-	struct ccn_charbuf *name;
-	long int rnum;
-	char rnumstr[20];
-	char info_str[5];
-	char nlsr_str[5];
-
-	int res,i;
-	int adl_element;
-	int scope = 2;  //no further than the next host
-
-	rnum=random();
-	memset(&rnumstr,0,20);
-	sprintf(rnumstr,"%ld",rnum);
-	memset(&nlsr_str,0,5);
-	sprintf(nlsr_str,"nlsr");
-	memset(&info_str,0,5);
-	sprintf(info_str,"info");
-	
-
-	struct ndn_neighbor *nbr;
-
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-    	
-    	hashtb_start(nlsr->adl, e);
-	adl_element=hashtb_n(nlsr->adl);
-	//int mynumber=15;
-
-	for(i=0;i<adl_element;i++)
-	{
-		nbr=e->data;
-		printf("Sending interest for name prefix:%s/%s/%s\n",ccn_charbuf_as_string(nbr->neighbor),nlsr_str,info_str);	
-		name=ccn_charbuf_create();
-		res=ccn_name_from_uri(name,ccn_charbuf_as_string(nbr->neighbor));
-		ccn_name_append_str(name,nlsr_str);
-		ccn_name_append_str(name,info_str);
-		//ccn_name_append_str(name,rnumstr);
-
-		/* adding Exclusion filter */
+    switch(kind) {
+        case CCN_UPCALL_FINAL:
+            break;
+        case CCN_UPCALL_CONTENT:
+            	printf("Content Received \n");  
 		
-		struct ccn_charbuf *templ;
-		templ = ccn_charbuf_create();
+		process_incoming_content(selfp, info);
 
-//		struct ccn_charbuf *c;
-//		c = ccn_charbuf_create();
+	    break;
+        case CCN_UPCALL_INTEREST_TIMED_OUT:
+          	printf("Interest timed out \n"); 	    
+		process_incoming_timed_out_interest(selfp,info);
 
-
-		ccn_charbuf_append_tt(templ, CCN_DTAG_Interest, CCN_DTAG);
-		ccn_charbuf_append_tt(templ, CCN_DTAG_Name, CCN_DTAG);
-		ccn_charbuf_append_closer(templ); /* </Name> */
-//		ccn_charbuf_append_tt(templ, CCN_DTAG_Exclude, CCN_DTAG);
-//		ccnb_tagged_putf(templ, CCN_DTAG_Any, "");
-//		ccn_charbuf_reset(c);
-//		//ccn_charbuf_putf(c, "%u", (unsigned)mynumber);
-//		//ccn_charbuf_putf(c, "%s", nbr->last_lsdb_version);
-//		ccn_charbuf_putf(c, "%u", (unsigned)nbr->last_lsdb_version);
-//		ccnb_append_tagged_blob(templ, CCN_DTAG_Component, c->buf, c->length);
-//		ccn_charbuf_append_closer(templ); /* </Exclude> */
-		ccnb_tagged_putf(templ, CCN_DTAG_Scope, "%d", scope);
-		appendLifetime(templ,nlsr->interest_resend_time);
-		ccn_charbuf_append_closer(templ); /* </Interest> */
-
-
-		/* Adding Exclusion filter done */
-				
-		res=ccn_express_interest(nlsr->ccn,name,&(nlsr->in_content),templ);
-			
-		if ( res >= 0 )
-			printf("Interest sending Successfull .... \n");	
-//		ccn_charbuf_destroy(&c);
-		ccn_charbuf_destroy(&templ);
-		ccn_charbuf_destroy(&name);
-	
-		hashtb_next(e);		
-	}
-
-	hashtb_end(e);
-
-	//nlsr->event_send_info_interest = ccn_schedule_event(nlsr->sched, 20000000, &send_info_interest, NULL, 0);
+	    break;
+        default:
+            fprintf(stderr, "Unexpected response of kind %d\n", kind);
+            //return CCN_UPCALL_RESULT_ERR;
+    }
 
 	my_unlock();
-	return 0;
-
+    return CCN_UPCALL_RESULT_OK;
 }
 
-
 void 
-send_info_interest_to_neighbor(struct ccn_charbuf *nbr)
+process_incoming_content(struct ccn_closure *selfp, struct ccn_upcall_info* info)
 {
+	printf("process_incoming_content called \n");
+	
+	/*	
+	struct ccn_charbuf*c;
+	c=ccn_charbuf_create();
+	ccn_uri_append(c,info->interest_ccnb,info->pi->offset[CCN_PI_E_Name]-info->pi->offset[CCN_PI_B_Name],0);	
+	printf("%s\n",ccn_charbuf_as_string(c));
+	ccn_charbuf_destroy(&c);
+	*/
+
+	const unsigned char *comp_ptr1;
+	size_t comp_size;
+	int res,i;
+	int nlsr_position=0;
+	int name_comps=(int)info->interest_comps->n;
+
+	for(i=0;i<name_comps;i++)
+	{
+		res=ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,i,"nlsr");
+		if( res == 0)
+		{
+			nlsr_position=i;
+			break;
+		}	
+	}
+
+	res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,nlsr_position+1,&comp_ptr1, &comp_size);
+
+	printf("Det= %s \n",comp_ptr1);
+
+	if(!strcmp((char *)comp_ptr1,"info"))
+	{
+		process_incoming_content_info(selfp,info);
+	}
+	if(!strcmp((char *)comp_ptr1,"lsdb"))
+	{
+		process_incoming_content_lsdb(selfp,info);
+	}
+	if(!strcmp((char *)comp_ptr1,"lsa"))
+	{
+		process_incoming_content_lsa(selfp,info);
+	}
+	
+}
+
+void 
+process_incoming_content_info(struct ccn_closure *selfp, struct ccn_upcall_info* info)
+{
+	printf("process_incoming_content_info called \n");
+	
+	struct name_prefix *nbr=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+	get_nbr(nbr,selfp,info);
+	
+	printf("Info Content Received For Neighbor: %s Length:%d\n",nbr->name,nbr->length);
+		
+
+	const unsigned char *ptr;
+	size_t length;
+	ccn_content_get_value(info->content_ccnb, info->pco->offset[CCN_PCO_E_Content]-info->pco->offset[CCN_PCO_B_Content], info->pco, &ptr, &length);
+	printf("Content data: %s\n",ptr);
+
+	long int interval=atoi((char *)ptr);
+
+
+	update_adjacent_timed_out_zero_to_adl(nbr);	
+	update_adjacent_status_to_adl(nbr,NBR_ACTIVE);
+	update_lsdb_synch_interval_to_adl(nbr,interval);
+	print_adjacent_from_adl();
+
+	if(!nlsr->is_build_adj_lsa_sheduled)
+	{
+		printf("Scheduling Build and Install Adj LSA...\n");
+		nlsr->event_build_adj_lsa = ccn_schedule_event(nlsr->sched, 100000, &build_and_install_adj_lsa, NULL, 0);
+		nlsr->is_build_adj_lsa_sheduled=1;		
+	}
+	else
+	{
+		printf("Build and Install Adj LSA already scheduled\n");
+	}
+
+	free(nbr);
+	
+
+}
+
+void 
+process_incoming_content_lsdb(struct ccn_closure *selfp, struct ccn_upcall_info* info)
+{
+	printf("process_incoming_content_lsdb called \n");
+
+	
+	const unsigned char *ptr;
+	size_t length;
+	ccn_content_get_value(info->content_ccnb, info->pco->offset[CCN_PCO_E_Content]-info->pco->offset[CCN_PCO_B_Content], info->pco, &ptr, &length);
+	printf("Content data: %s\n",ptr);
+
+	if( (strcmp("NACK",(char *)ptr) != 0 ) && (strcmp("WAIT",(char *)ptr) != 0 ) )
+	{
+		struct name_prefix *nbr=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+		get_nbr(nbr,selfp,info);
+
+		char *nl;
+		int num_element;
+		int i;
+		char *rem;
+		const char *sep="|";
+		char *orig_router;
+		char *lst;
+		int ls_type;
+		char *lsid;
+		long int ls_id;
+
+		nl=strtok_r((char *)ptr,sep,&rem);
+		num_element=atoi(nl);		
+
+		for(i = 0 ; i < num_element ; i++)
+		{
+			orig_router=strtok_r(NULL,sep,&rem);
+			lst=strtok_r(NULL,sep,&rem);
+			ls_type=atoi(lst);
+			printf("Orig Router: %s ls Type: %d",orig_router,ls_type);			
+
+			if(ls_type == LS_TYPE_NAME)
+			{
+				lsid=strtok_r(NULL,sep,&rem);
+				ls_id=atoi(lsid);
+				printf(" LS Id: %ld\n",ls_id);
+				send_interest_for_name_lsa(nbr,orig_router,lst,lsid);	
+			}
+			else
+			{
+				printf("\n");
+				send_interest_for_adj_lsa(nbr,orig_router,lst);
+			}
+				
+		}
+				
+
+		
+		char *version=get_current_timestamp_micro();
+		printf("Old LSDB Version of Neighbor: %s is :%s\n",nbr->name,get_nbr_lsdb_version(nbr->name));		
+		update_adjacent_lsdb_version_to_adl(nbr,version);
+		printf("New LSDB Version of Neighbor: %s is :%s\n",nbr->name,get_nbr_lsdb_version(nbr->name));
+		
+		
+
+		free(nbr);	
+	}
+	else if (strcmp("WAIT",(char *)ptr) == 0)
+	{
+		struct name_prefix *nbr=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+		get_nbr(nbr,selfp,info);
+		long int interval=get_lsdb_synch_interval(nbr->name);
+		adjust_adjacent_last_lsdb_requested_to_adl(nbr->name,(long int)interval/2);
+		
+
+		free(nbr);
+	}
+	else 
+	{
+		printf("NACK Content Received\n");
+	}
+	
+	
+}
+
+void 
+process_incoming_content_lsa(struct ccn_closure *selfp, struct ccn_upcall_info* info)
+{
+	printf("process_incoming_content_lsa called \n");
+
+	char *sep="|";
+	char *rem;
+	char *orig_router;
+	char *orl;
+	int orig_router_length;
+	char *lst;
+	int ls_type;
+	char *lsid;
+	long int ls_id;
+	char *isvld;
+	int isValid;
+	char *num_link;
+	int no_link;
+	char *np;
+	char *np_length;
+	int name_length;
+	char *data;
+	char *orig_time;
+
+	const unsigned char *ptr;
+	size_t length;
+	ccn_content_get_value(info->content_ccnb, info->pco->offset[CCN_PCO_E_Content]-info->pco->offset[CCN_PCO_B_Content], info->pco, &ptr, &length);
+	printf("Content data Received: %s\n",ptr);
+
+	printf("LSA Data\n");
+
+	if( strlen((char *) ptr ) > 0 )
+	{
+
+		orig_router=strtok_r((char *)ptr,sep,&rem);
+		orl=strtok_r(NULL,sep,&rem);
+		orig_router_length=atoi(orl);
+
+		printf("	Orig Router Name  : %s\n",orig_router);
+		printf("	Orig Router Length: %d\n",orig_router_length);
+
+		lst=strtok_r(NULL,sep,&rem);		
+		ls_type=atoi(lst);
+
+		printf("	LS Type  : %d\n",ls_type);
+
+		if ( ls_type == LSA_NAME_TYPE )
+		{
+			lsid=strtok_r(NULL,sep,&rem);
+			ls_id=atoi(lsid);
+			isvld=strtok_r(NULL,sep,&rem);
+			isValid=atoi(isvld);
+			np=strtok_r(NULL,sep,&rem);
+			np_length=strtok_r(NULL,sep,&rem);
+			name_length=atoi(np_length);
+
+			printf("	LS ID  : %ld\n",ls_id);
+			printf("	isValid  : %d\n",isValid);
+			printf("	Name Prefix : %s\n",np);
+			printf("	Name Prefix length: %d\n",name_length);
+
+			build_and_install_others_name_lsa(orig_router,ls_type,ls_id,isValid,np);
+				
+		}
+		else if ( ls_type == LSA_ADJ_TYPE )
+		{
+			orig_time=strtok_r(NULL,sep,&rem);
+			num_link=strtok_r(NULL,sep,&rem);
+			no_link=atoi(num_link);
+			data=rem;
+
+			printf("	No Link  : %d\n",no_link);
+			printf("	Data  : %s\n",data);
+
+			build_and_install_others_adj_lsa(orig_router,ls_type,orig_time,no_link,data);
+		}
+	
+
+	}
+
+}
+
+void
+process_incoming_timed_out_interest(struct ccn_closure* selfp, struct ccn_upcall_info* info)
+{
+	printf("process_incoming_timed_out_interest called \n");
+
+	/*
+	struct ccn_charbuf*c;
+	c=ccn_charbuf_create();
+	ccn_uri_append(c,info->interest_ccnb,info->pi->offset[CCN_PI_E_Name]-info->pi->offset[CCN_PI_B_Name],0);
+	printf("%s\n",ccn_charbuf_as_string(c));
+	ccn_charbuf_destroy(&c);
+	*/
+
+	int res,i;
+	int nlsr_position=0;
+	int name_comps=(int)info->interest_comps->n;
+
+	for(i=0;i<name_comps;i++)
+	{
+		res=ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,i,"nlsr");
+		if( res == 0)
+		{
+			nlsr_position=i;
+			break;
+		}	
+	}
+
+	if(ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,nlsr_position+1,"info") == 0)
+	{
+		process_incoming_timed_out_interest_info(selfp,info);
+	}
+}
+
+void
+process_incoming_timed_out_interest_info(struct ccn_closure* selfp, struct ccn_upcall_info* info)
+{
+	printf("process_incoming_timed_out_interest_info called \n");
+
+	struct name_prefix *nbr=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+	get_nbr(nbr,selfp,info);
+
+	printf("Info Interest Timed Out for for Neighbor: %s Length:%d\n",nbr->name,nbr->length);
+		
+	
+	update_adjacent_timed_out_to_adl(nbr,1);
+	print_adjacent_from_adl();	
+	int timed_out=get_timed_out_number(nbr);
+	
+
+	if(timed_out<nlsr->interest_retry && timed_out>0) // use configured variables 
+	{
+		printf("Neighbor: %s Info Interest Timed Out: %d times\n",nbr->name,timed_out);
+		send_info_interest_to_neighbor(nbr);
+	}
+	else
+	{
+		printf("Neighbor: %s Info Interest Timed Out: %d times\n",nbr->name,timed_out);		
+		update_adjacent_status_to_adl(nbr,NBR_DOWN);
+		if(!nlsr->is_build_adj_lsa_sheduled)
+		{
+			nlsr->event_build_adj_lsa = ccn_schedule_event(nlsr->sched, 1000, &build_and_install_adj_lsa, NULL, 0);
+			nlsr->is_build_adj_lsa_sheduled=1;		
+		}
+	}
+
+	free(nbr);
+		
+
+}
+
+int 
+send_info_interest(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
+{
+	printf("send_info_interest called \n");
+	printf("\n");
 
 	my_lock();
-	struct ccn_charbuf *name;
-	long int rnum;
-	char rnumstr[20];
-	char info_str[5];
-	char nlsr_str[5];
+
+	int adl_element,i;
+
+	struct ndn_neighbor *nbr;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->adl, e);
+	adl_element=hashtb_n(nlsr->adl);
+
+	for(i=0;i<adl_element;i++)
+	{
+		nbr=e->data;
+		send_info_interest_to_neighbor(nbr->neighbor);
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+
+	my_unlock();
+
+	return 0;
+}
+
+void 
+send_info_interest_to_neighbor(struct name_prefix *nbr)
+{
+	printf("send_info_interest_to_neighbor called \n");
 
 	int res;
-	int scope = 2;  //no further than the next host
+	//int scope = 2;  //no further than the next host
+	
+	char info_str[5];
+	char nlsr_str[5];
+	long int rnum;
+	char rnumstr[20];
 
 	rnum=random();
 	memset(&rnumstr,0,20);
 	sprintf(rnumstr,"%ld",rnum);
+	
 	memset(&nlsr_str,0,5);
 	sprintf(nlsr_str,"nlsr");
 	memset(&info_str,0,5);
 	sprintf(info_str,"info");
 	
-	printf("Sending interest for name prefix:%s/%s/%s\n",ccn_charbuf_as_string(nbr),nlsr_str,info_str);	
+	
+	struct ccn_charbuf *name;	
 	name=ccn_charbuf_create();
-	res=ccn_name_from_uri(name,ccn_charbuf_as_string(nbr));
-	ccn_name_append_str(name,nlsr_str);
-	ccn_name_append_str(name,info_str);
-	//ccn_name_append_str(name,rnumstr);
 
-	/* adding Exclusion filter */
+	char *int_name=(char *)malloc(strlen(nbr->name)+1+strlen(nlsr_str)+1+strlen(info_str)+strlen(nlsr->router_name->name)+1);
+	memset(int_name,0,strlen(nbr->name)+1+strlen(nlsr_str)+1+strlen(info_str)+strlen(nlsr->router_name->name)+1);
+	memcpy(int_name+strlen(int_name),nbr->name,strlen(nbr->name));
+	memcpy(int_name+strlen(int_name),"/",1);
+	memcpy(int_name+strlen(int_name),nlsr_str,strlen(nlsr_str));
+	memcpy(int_name+strlen(int_name),"/",1);
+	memcpy(int_name+strlen(int_name),info_str,strlen(info_str));
+	memcpy(int_name+strlen(int_name),nlsr->router_name->name,strlen(nlsr->router_name->name));
+	
+
+	res=ccn_name_from_uri(name,int_name);
+	if ( res >=0 )
+	{
+		ccn_name_append_str(name,rnumstr);
+
+		/* adding InterestLifeTime and InterestScope filter */
+
+		struct ccn_charbuf *templ;
+		templ = ccn_charbuf_create();
+
+		ccn_charbuf_append_tt(templ, CCN_DTAG_Interest, CCN_DTAG);
+		ccn_charbuf_append_tt(templ, CCN_DTAG_Name, CCN_DTAG);
+		ccn_charbuf_append_closer(templ); /* </Name> */
+		//ccnb_tagged_putf(templ, CCN_DTAG_Scope, "%d", scope);
+		//ccn_charbuf_append_tt(templ, CCN_DTAG_Scope, CCN_DTAG);
+		//ccn_charbuf_append_tt(templ, 1, CCN_UDATA);
+		//ccn_charbuf_append(templ, "2", 1); //scope of interest: 2 (not further than next host)
+		//ccn_charbuf_append_closer(templ); /* </Scope> */
+
+		appendLifetime(templ,nlsr->interest_resend_time);
+		ccn_charbuf_append_closer(templ); /* </Interest> */
+		/* Adding InterestLifeTime and InterestScope filter done */
+	
+		printf("Sending info interest on name prefix : %s \n",int_name);
+
+		res=ccn_express_interest(nlsr->ccn,name,&(nlsr->in_content),templ);
+
+		if ( res >= 0 )
+			printf("Info interest sending Successfull .... \n");	
+		ccn_charbuf_destroy(&templ);
+	}
+	ccn_charbuf_destroy(&name);
+	free(int_name);
+
+}
+
+
+int 
+send_lsdb_interest(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
+{
+	printf("send_lsdb_interest called \n");	
+
+	my_lock();
+
+	int i, adl_element;
+	struct ndn_neighbor *nbr;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->adl, e);
+	adl_element=hashtb_n(nlsr->adl);
+
+	for(i=0;i<adl_element;i++)
+	{
+		nbr=e->data;
+
+		if(nbr->status == NBR_ACTIVE)
+		{	
+			if(nbr->is_lsdb_send_interest_scheduled == 0)
+			{
+				long int time_diff=get_nbr_time_diff_lsdb_req(nbr->neighbor->name);	
+				printf("Time since last time LSDB requested : %ld Seconds for Neighbor: %s \n",time_diff,nbr->neighbor->name);		
+
+				if(time_diff>=get_lsdb_synch_interval(nbr->neighbor->name))
+				{
+					nbr->is_lsdb_send_interest_scheduled=1;
+					send_lsdb_interest_to_nbr(nbr->neighbor);
+				}
+			}
+		}
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+	nlsr->event_send_lsdb_interest= ccn_schedule_event(nlsr->sched, 30000000, &send_lsdb_interest, NULL, 0);
+
+	my_unlock();
+	return 0;
+}
+
+void 
+send_lsdb_interest_to_nbr(struct name_prefix *nbr)
+{
+	printf("send_lsdb_interest_to_nbr called \n");	
+	
+	char *last_lsdb_version=get_nbr_lsdb_version(nbr->name);
+
+	if(last_lsdb_version !=NULL)
+	{
+		printf("Last LSDB Version: %s \n",last_lsdb_version);
+
+
+		struct ccn_charbuf *name;
+		int res;
+		long int rnum;
+		char rnumstr[20];
+		char lsdb_str[5];
+		char nlsr_str[5];
+						
+		rnum=random();
+		memset(&rnumstr,0,20);
+		sprintf(rnumstr,"%ld",rnum);
+		memset(&nlsr_str,0,5);
+		sprintf(nlsr_str,"nlsr");
+		memset(&lsdb_str,0,5);
+		sprintf(lsdb_str,"lsdb");		
+		//make and send interest with exclusion filter as last_lsdb_version
+		printf("Sending interest for name prefix:%s/%s/%s\n",nbr->name,nlsr_str,lsdb_str);	
+		name=ccn_charbuf_create();
+		res=ccn_name_from_uri(name,nbr->name);
+
+		if( res >= 0)
+		{
+			ccn_name_append_str(name,nlsr_str);
+			ccn_name_append_str(name,lsdb_str);
+			ccn_name_append_str(name,rnumstr);
+	
+			/* adding Exclusion filter */
+
+			struct ccn_charbuf *templ;
+			templ = ccn_charbuf_create();
+	
+			struct ccn_charbuf *c;
+			c = ccn_charbuf_create();
+	
+
+			ccn_charbuf_append_tt(templ, CCN_DTAG_Interest, CCN_DTAG);
+			ccn_charbuf_append_tt(templ, CCN_DTAG_Name, CCN_DTAG);
+			ccn_charbuf_append_closer(templ); /* </Name> */
+			ccn_charbuf_append_tt(templ, CCN_DTAG_Exclude, CCN_DTAG);
+			ccnb_tagged_putf(templ, CCN_DTAG_Any, "");
+			ccn_charbuf_reset(c);
+			ccn_charbuf_putf(c, "%s", last_lsdb_version);
+			//ccn_charbuf_putf(c, "%u", (unsigned)nbr->last_lsdb_version);
+			ccnb_append_tagged_blob(templ, CCN_DTAG_Component, c->buf, c->length);
+			ccn_charbuf_append_closer(templ); /* </Exclude> */
+			ccn_charbuf_append_tt(templ, CCN_DTAG_Scope, CCN_DTAG);
+			ccn_charbuf_append_tt(templ, 1, CCN_UDATA);
+			ccn_charbuf_append(templ, "2", 1);
+			ccn_charbuf_append_closer(templ); /* </Scope> */
+	
+			appendLifetime(templ,nlsr->interest_resend_time);
+	
+			ccn_charbuf_append_closer(templ); /* </Interest> */
+	
 		
+			/* Adding Exclusion filter done */
+	
+			res=ccn_express_interest(nlsr->ccn,name,&(nlsr->in_content),templ);
+
+			if ( res >= 0 )
+			{
+				printf("Interest sending Successfull .... \n");	
+				update_adjacent_last_lsdb_requested_to_adl(nbr->name,get_current_time_sec());
+
+			}
+			ccn_charbuf_destroy(&c);
+			ccn_charbuf_destroy(&templ);
+		}
+		ccn_charbuf_destroy(&name);
+	}	
+	set_is_lsdb_send_interest_scheduled_to_zero(nbr->name);
+
+}
+
+void 
+send_interest_for_name_lsa(struct name_prefix *nbr, char *orig_router, char *ls_type, char *ls_id)
+{
+	printf("send_interest_for_name_lsa called\n");
+
+	int res;
+	long int rnum;
+	char rnumstr[20];
+	char lsa_str[5];
+	char nlsr_str[5];
+
+						
+	rnum=random();
+	memset(&rnumstr,0,20);
+	sprintf(rnumstr,"%ld",rnum);
+	memset(&nlsr_str,0,5);
+	sprintf(nlsr_str,"nlsr");
+	memset(&lsa_str,0,5);
+	sprintf(lsa_str,"lsa");
+
+	char *int_name=(char *)malloc(nbr->length + strlen(orig_router)+strlen(nlsr_str)+strlen(lsa_str)+2);
+	memset(int_name,0,nbr->length + strlen(orig_router)+strlen(nlsr_str)+strlen(lsa_str)+2);
+
+	memcpy(int_name+strlen(int_name),nbr->name,nbr->length);
+	memcpy(int_name+strlen(int_name),"/",1);
+	memcpy(int_name+strlen(int_name),nlsr_str,strlen(nlsr_str));
+	memcpy(int_name+strlen(int_name),"/",1);
+	memcpy(int_name+strlen(int_name),lsa_str,strlen(lsa_str));
+	memcpy(int_name+strlen(int_name),orig_router,strlen(orig_router));	
+
+	
+	struct ccn_charbuf *name;	
+	name=ccn_charbuf_create();
+
+
+	res=ccn_name_from_uri(name,int_name);
+	ccn_name_append_str(name,ls_type);
+	ccn_name_append_str(name,ls_id);
+	ccn_name_append_str(name,rnumstr);
+
+
+	/* adding InterestLifeTime and InterestScope filter */
+
 	struct ccn_charbuf *templ;
 	templ = ccn_charbuf_create();
 
-//	struct ccn_charbuf *c;
-//	c = ccn_charbuf_create();
-
-
 	ccn_charbuf_append_tt(templ, CCN_DTAG_Interest, CCN_DTAG);
 	ccn_charbuf_append_tt(templ, CCN_DTAG_Name, CCN_DTAG);
 	ccn_charbuf_append_closer(templ); /* </Name> */
-//	ccn_charbuf_append_tt(templ, CCN_DTAG_Exclude, CCN_DTAG);
-//	ccnb_tagged_putf(templ, CCN_DTAG_Any, "");
-//	ccn_charbuf_reset(c);
-//	//ccn_charbuf_putf(c, "%u", (unsigned)mynumber);
-//	//ccn_charbuf_putf(c, "%s", nbr->last_lsdb_version);
-//	ccn_charbuf_putf(c, "%u", (unsigned)nbr->last_lsdb_version);
-//	ccnb_append_tagged_blob(templ, CCN_DTAG_Component, c->buf, c->length);
-//	ccn_charbuf_append_closer(templ); /* </Exclude> */
-	ccnb_tagged_putf(templ, CCN_DTAG_Scope, "%d", scope);
-	appendLifetime(templ,15);
+	//ccnb_tagged_putf(templ, CCN_DTAG_Scope, "%d", scope);
+	ccn_charbuf_append_tt(templ, CCN_DTAG_Scope, CCN_DTAG);
+	ccn_charbuf_append_tt(templ, 1, CCN_UDATA);
+	ccn_charbuf_append(templ, "2", 1); //scope of interest: 2 (not further than next host)
+	ccn_charbuf_append_closer(templ); /* </Scope> */
+
+	appendLifetime(templ,nlsr->interest_resend_time);
 	ccn_charbuf_append_closer(templ); /* </Interest> */
+	/* Adding InterestLifeTime and InterestScope filter done */
+	
+	printf("Sending NAME LSA interest on name prefix : %s/%s/%s\n",int_name,ls_type,ls_id);
 
-
-	/* Adding Exclusion filter done */
-				
 	res=ccn_express_interest(nlsr->ccn,name,&(nlsr->in_content),templ);
-			
+
 	if ( res >= 0 )
-		printf("Interest sending Successfull .... \n");	
-//	ccn_charbuf_destroy(&c);
+		printf("NAME LSA interest sending Successfull .... \n");	
+	
+	//free(lsa_orig_router);	
 	ccn_charbuf_destroy(&templ);
 	ccn_charbuf_destroy(&name);
-
-	my_unlock();
-
+	free(int_name);
+	
+	
 }
+
+void 
+send_interest_for_adj_lsa(struct name_prefix *nbr, char *orig_router, char *ls_type)
+{
+	printf("send_interest_for_adj_lsa called\n");
+
+	int res;
+	long int rnum;
+	char rnumstr[20];
+	char lsa_str[5];
+	char nlsr_str[5];
+
+						
+	rnum=random();
+	memset(&rnumstr,0,20);
+	sprintf(rnumstr,"%ld",rnum);
+	memset(&nlsr_str,0,5);
+	sprintf(nlsr_str,"nlsr");
+	memset(&lsa_str,0,5);
+	sprintf(lsa_str,"lsa");
+
+	char *int_name=(char *)malloc(nbr->length + strlen(orig_router)+strlen(nlsr_str)+strlen(lsa_str)+2);
+	memset(int_name,0,nbr->length + strlen(orig_router)+strlen(nlsr_str)+strlen(lsa_str)+2);
+
+	memcpy(int_name+strlen(int_name),nbr->name,nbr->length);
+	memcpy(int_name+strlen(int_name),"/",1);
+	memcpy(int_name+strlen(int_name),nlsr_str,strlen(nlsr_str));
+	memcpy(int_name+strlen(int_name),"/",1);
+	memcpy(int_name+strlen(int_name),lsa_str,strlen(lsa_str));
+	memcpy(int_name+strlen(int_name),orig_router,strlen(orig_router));
+
+	
+	struct ccn_charbuf *name;	
+	name=ccn_charbuf_create();
+	
+
+	ccn_name_from_uri(name,int_name);
+	ccn_name_append_str(name,ls_type);
+	ccn_name_append_str(name,rnumstr);
+
+	/* adding InterestLifeTime and InterestScope filter */
+
+	struct ccn_charbuf *templ;
+	templ = ccn_charbuf_create();
+
+	ccn_charbuf_append_tt(templ, CCN_DTAG_Interest, CCN_DTAG);
+	ccn_charbuf_append_tt(templ, CCN_DTAG_Name, CCN_DTAG);
+	ccn_charbuf_append_closer(templ); /* </Name> */
+	//ccnb_tagged_putf(templ, CCN_DTAG_Scope, "%d", scope);
+	ccn_charbuf_append_tt(templ, CCN_DTAG_Scope, CCN_DTAG);
+	ccn_charbuf_append_tt(templ, 1, CCN_UDATA);
+	ccn_charbuf_append(templ, "2", 1); //scope of interest: 2 (not further than next host)
+	ccn_charbuf_append_closer(templ); /* </Scope> */
+
+	appendLifetime(templ,nlsr->interest_resend_time);
+	ccn_charbuf_append_closer(templ); /* </Interest> */
+	/* Adding InterestLifeTime and InterestScope filter done */
+	
+	printf("Sending ADJ LSA interest on name prefix : %s/%s/%s%s/%s/\n",nbr->name,nlsr_str,lsa_str,orig_router,ls_type);
+
+	res=ccn_express_interest(nlsr->ccn,name,&(nlsr->in_content),templ);
+
+	if ( res >= 0 )
+		printf("ADJ LSA interest sending Successfull .... \n");	
+	
+	//free(lsa_orig_router);	
+	ccn_charbuf_destroy(&templ);
+	ccn_charbuf_destroy(&name);
+	free(int_name);
+
+	
+}
+
diff --git a/nlsr_ndn.h b/nlsr_ndn.h
index 4c2a79c..0b6b14c 100644
--- a/nlsr_ndn.h
+++ b/nlsr_ndn.h
@@ -2,27 +2,33 @@
 #define _NLSR_NDN_H_
 
 int appendLifetime(struct ccn_charbuf *cb, int lifetime);
-
-int send_lsdb_interest(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags);
-
+void get_nbr(struct name_prefix * nbr, struct ccn_closure *selfp, struct ccn_upcall_info *info);
+void get_lsa_identifier(struct name_prefix *lsaId,struct ccn_closure *selfp, struct ccn_upcall_info *info);
 enum ccn_upcall_res incoming_interest(struct ccn_closure *selfp, enum ccn_upcall_kind kind, struct ccn_upcall_info *info);
 void process_incoming_interest(struct ccn_closure *selfp, struct ccn_upcall_info *info);
-void process_incoming_interest_lsdb(struct ccn_closure *selfp, struct ccn_upcall_info *info);
 void process_incoming_interest_info(struct ccn_closure *selfp, struct ccn_upcall_info *info);
+void process_incoming_interest_lsdb(struct ccn_closure *selfp, struct ccn_upcall_info *info);
+void process_incoming_interest_lsa(struct ccn_closure *selfp, struct ccn_upcall_info *info);
+
+enum ccn_upcall_res incoming_content(struct ccn_closure* selfp, enum ccn_upcall_kind kind, struct ccn_upcall_info* info);
+
+void process_incoming_content(struct ccn_closure *selfp, struct ccn_upcall_info* info);
+void process_incoming_content_info(struct ccn_closure *selfp, struct ccn_upcall_info* info);
+void process_incoming_content_lsdb(struct ccn_closure *selfp, struct ccn_upcall_info* info);
+void process_incoming_content_lsa(struct ccn_closure *selfp, struct ccn_upcall_info* info);
 
 void process_incoming_timed_out_interest(struct ccn_closure* selfp, struct ccn_upcall_info* info);
-void process_incoming_timed_out_interest_lsdb(struct ccn_closure* selfp, struct ccn_upcall_info* info);
 void process_incoming_timed_out_interest_info(struct ccn_closure* selfp, struct ccn_upcall_info* info);
 
 
-enum ccn_upcall_res incoming_content(struct ccn_closure* selfp, enum ccn_upcall_kind kind, struct ccn_upcall_info* info);
-void process_incoming_content(struct ccn_closure* selfp, struct ccn_upcall_info* info);
-void process_incoming_content_lsdb(struct ccn_closure* selfp, struct ccn_upcall_info* info);
-void process_incoming_content_info(struct ccn_closure* selfp, struct ccn_upcall_info* info);
-
-
 int send_info_interest(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags);
-void send_info_interest_to_neighbor(struct ccn_charbuf *nbr);
+void send_info_interest_to_neighbor(struct name_prefix *nbr);
+
+int send_lsdb_interest(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags);
+void send_lsdb_interest_to_nbr(struct name_prefix *nbr);
+
+void send_interest_for_name_lsa(struct name_prefix *nbr, char *orig_router, char *ls_type, char *ls_id);
+void send_interest_for_adj_lsa(struct name_prefix *nbr, char *orig_router, char *ls_type);
 
 #endif
 
diff --git a/utility.c b/utility.c
index 283376d..7ebc72d 100644
--- a/utility.c
+++ b/utility.c
@@ -10,6 +10,13 @@
 #include <config.h>
 #endif
 
+#include <ccn/ccn.h>
+#include <ccn/uri.h>
+#include <ccn/keystore.h>
+#include <ccn/signing.h>
+#include <ccn/schedule.h>
+#include <ccn/hashtb.h>
+
 #include "utility.h"
 
 
@@ -81,3 +88,18 @@
 	return microSec;
 
 }
+
+char *
+get_current_timestamp_micro(void)
+{
+	struct timeval now; 
+	gettimeofday(&now, NULL);
+
+	char *microSec=(char *)malloc(20);
+	sprintf(microSec,"%ld%06ld",now.tv_sec,(long int)now.tv_usec);
+	microSec[strlen(microSec)]='\0';
+
+	return microSec;
+
+}
+
diff --git a/utility.h b/utility.h
index b068d1a..4b67bbd 100644
--- a/utility.h
+++ b/utility.h
@@ -7,4 +7,6 @@
 long int get_current_time_sec(void);
 long int get_current_time_microsec(void);
 
+char * get_current_timestamp_micro(void);
+
 #endif
