diff --git a/Makefile b/Makefile
index de1f4c7..abfca2b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,14 @@
 CC = cc
-CFLAGS = -g -Wall -Wpointer-arith -Wreturn-type -Wstrict-prototypes
+CFLAGS = -g -Wall 
+#-Wpointer-arith -Wreturn-type -Wstrict-prototypes
 LIBS = -lccn -lcrypto
 
 PROGRAMS = nlsr
 
 all: $(PROGRAMS)
 
-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)
+nlsr: nlsr.c nlsr_ndn.c nlsr_npl.c  nlsr_adl.c nlsr_lsdb.c utility.c
+	$(CC) $(CFLAGS) nlsr.c nlsr_ndn.c nlsr_npl.c nlsr_adl.c nlsr_lsdb.c utility.c -o nlsr $(LIBS)
 
 clean:
 	rm -f *.o
diff --git a/macbook.conf b/macbook.conf
index 0bab6de..7dc397b 100644
--- a/macbook.conf
+++ b/macbook.conf
@@ -1,6 +1,7 @@
 router-name /ndn/memphis.edu/netlab/macbook
 ccnneighbor /ndn/memphis.edu/netlab/pollux face2 10
 ccnneighbor /ndn/memphis.edu/netlab/castor face3 8
+ccnneighbor /ndn/memphis.edu/netlab/maia face4 15
 ccnname /ndn/memphis.edu/netlab/macbook/name1
 ccnname /ndn/memphis.edu/netlab/macbook/test
 lsdb-synch-interval 310
diff --git a/nlsr.c b/nlsr.c
index 9d7438e..266a901 100644
--- a/nlsr.c
+++ b/nlsr.c
@@ -8,6 +8,9 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
+#include <sys/types.h>
+#include <signal.h>
+
 
 
 #include <ccn/ccn.h>
@@ -20,9 +23,9 @@
 #include "nlsr.h"
 #include "nlsr_ndn.h"
 #include "nlsr_lsdb.h"
-#include "nlsr_adl.h"
 #include "utility.h"
-
+#include "nlsr_npl.h"
+#include "nlsr_adl.h"
 
 struct option longopts[] =
 {
@@ -60,74 +63,13 @@
     NULL
 };
 
-void
-my_lock(void)
-{
-	nlsr->semaphor=1;
-}
 
 void 
-my_unlock(void)
+nlsr_stop_signal_handler(int sig)
 {
-	nlsr->semaphor=0;
-}
-
-void 
-process_command_router_name(char *command)
-{
-	if(command==NULL)
-	{
-		printf(" Wrong Command Format ( router-name /router/name )\n");
-		return;
-	}
-	char *rem;
-	const char *sep=" \t\n";
-	char *rtr_name;
-
-	rtr_name=strtok_r(command,sep,&rem);
-	if(rtr_name==NULL)
-	{
-		printf(" Wrong Command Format ( router-name /router/name )\n");
-		return;
-	}
-	
-	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 
-process_command_ccnname(char *command)
-{
-
-	if(command==NULL)
-	{
-		printf(" Wrong Command Format ( ccnname /name/prefix)\n");
-		return;
-	}
-	char *rem;
-	const char *sep=" \t\n";
-	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);
-
-	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);
-
-	free(np);
-	
-		
+	signal(sig, SIG_IGN);
+ 	nlsr_destroy();	
+	exit(0);
 }
 
 void 
@@ -167,16 +109,79 @@
 		return;
 	}
 
+	struct name_prefix *nbr=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+	nbr->name=(char *)malloc(strlen(rtr_name)+1);
+	memset(nbr->name,0,strlen(rtr_name)+1);
+	memcpy(nbr->name,rtr_name,strlen(rtr_name)+1);
+	nbr->length=strlen(rtr_name)+1;
+
+	add_nbr_to_adl(nbr,face_id);
+
+	free(nbr->name);
+	free(nbr);
+}
+
+void 
+process_command_ccnname(char *command)
+{
+
+	if(command==NULL)
+	{
+		printf(" Wrong Command Format ( ccnname /name/prefix)\n");
+		return;
+	}
+	char *rem;
+	const char *sep=" \t\n";
+	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);
+
 	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;
+	np->name=(char *)malloc(strlen(name)+1);
+	memset(np->name,0,strlen(name)+1);
+	memcpy(np->name,name,strlen(name)+1);
+	np->length=strlen(name)+1;
 
-	add_adjacent_to_adl(np,face_id);
+	add_name_to_npl(np);
 
+	free(np->name);
 	free(np);
 }
 
+
+void 
+process_command_router_name(char *command)
+{
+	if(command==NULL)
+	{
+		printf(" Wrong Command Format ( router-name /router/name )\n");
+		return;
+	}
+	char *rem;
+	const char *sep=" \t\n";
+	char *rtr_name;
+
+	rtr_name=strtok_r(command,sep,&rem);
+	if(rtr_name==NULL)
+	{
+		printf(" Wrong Command Format ( router-name /router/name )\n");
+		return;
+	}
+	
+
+	nlsr->router_name=(char *)malloc(strlen(rtr_name)+1);
+	memset(nlsr->router_name,0,strlen(rtr_name)+1);
+	memcpy(nlsr->router_name,rtr_name,strlen(rtr_name)+1);
+
+
+}
+
 void 
 process_command_lsdb_synch_interval(char *command)
 {
@@ -253,6 +258,8 @@
 
 }
 
+
+
 void 
 process_conf_command(char *command)
 {
@@ -295,6 +302,7 @@
 	}
 }
 
+
 int 
 readConfigFile(const char *filename)
 {
@@ -323,175 +331,74 @@
 	return 0;
 }
 
-void
-add_name_prefix_to_npl(struct name_prefix *np)
-{
-
-	
-	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 hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee; 	
-    	int res;
-
-   	hashtb_start(nlsr->npl, e);
-    	res = hashtb_seek(e, np->name, np->length, 0);
-
-	if(res == HT_NEW_ENTRY)
-	{   
-
-		hnp = e->data;
-		hnp->length=np->length;
-		hnp->name=(char *)malloc(np->length);
-		memcpy(hnp->name,np->name,np->length);
-	}
-    	
-	hashtb_end(e);
-
-
-	printf("\n");
-
-}
-
-void
-print_name_prefix_from_npl(void)
-{
-	printf("print_name_prefix_from_npl called \n");	
-	int i, npl_element;
-	struct name_prefix *np;
-
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-    	
-    	hashtb_start(nlsr->npl, e);
-	npl_element=hashtb_n(nlsr->npl);
-
-	for(i=0;i<npl_element;i++)
-	{
-		np=e->data;
-		printf("Name Prefix: %s and Length: %d \n",np->name,np->length);	
-		hashtb_next(e);		
-	}
-
-	hashtb_end(e);
-
-	printf("\n");
-}
-
-
 void 
 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 hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee;
-    	
-	/*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;
-		free(nbr);	
-		hashtb_next(e);		
-	}
-	hashtb_end(e);
-	hashtb_destroy(&nlsr->adl);
-
-
+	hashtb_destroy(&nlsr->adl);	
+	hashtb_destroy(&nlsr->lsdb->name_lsdb);
+	hashtb_destroy(&nlsr->lsdb->adj_lsdb);
+	
 	
 	ccn_schedule_destroy(&nlsr->sched);
 	ccn_destroy(&nlsr->ccn);
+
+	free(nlsr->lsdb->lsdb_version);
+	free(nlsr->lsdb);
+	free(nlsr->router_name);
 	free(nlsr);
 
 	printf("Finished freeing allocated memory\n");
 
 }
 
+
 void
 init_nlsr(void)
 {
-	struct hashtb_param param_adl = {0};
-	struct hashtb_param param_npl = {0};
+	if (signal(SIGQUIT, nlsr_stop_signal_handler ) == SIG_ERR) 
+	{
+		perror("SIGQUIT install error\n");
+		exit(1);
+	}
+	if (signal(SIGTERM, nlsr_stop_signal_handler ) == SIG_ERR) 
+	{
+		perror("SIGTERM install error\n");
+		exit(1);
+    	}
+ 	if (signal(SIGINT, nlsr_stop_signal_handler ) == SIG_ERR)
+	{
+		perror("SIGTERM install error\n");
+		exit(1);
+	}
 
-	struct hashtb_param param_adj_lsdb = {0};
-	struct hashtb_param param_name_lsdb = {0};
-	
 	nlsr=(struct nlsr *)malloc(sizeof(struct nlsr));
-
+	
+	struct hashtb_param param_adl = {0};
 	nlsr->adl=hashtb_create(sizeof(struct ndn_neighbor), &param_adl);
-	nlsr->npl = hashtb_create(sizeof(struct name_prefix ), &param_npl);
+	struct hashtb_param param_npl = {0};
+	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 ));
-	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=(struct linkStateDatabase *)malloc(sizeof(struct linkStateDatabase));
 
+	char *time_stamp=(char *)malloc(20);
+	memset(time_stamp,0,20);
+	get_current_timestamp_micro(time_stamp);
+	nlsr->lsdb->lsdb_version=(char *)malloc(strlen(time_stamp)+1);
+	memset(nlsr->lsdb->lsdb_version,'0',strlen(time_stamp));
+	free(time_stamp);
+	
+	struct hashtb_param param_adj_lsdb = {0};
 	nlsr->lsdb->adj_lsdb = hashtb_create(sizeof(struct alsa), &param_adj_lsdb);
+	struct hashtb_param param_name_lsdb = {0};
 	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;
@@ -505,19 +412,17 @@
 	nlsr->interest_resend_time = INTEREST_RESEND_TIME;
 
 	nlsr->semaphor=0;
-	
-
 }
 
+
 int 
 main(int argc, char *argv[])
 {
     	int res;
     	char *config_file;
 	//int daemon_mode;
-		
 
-	init_nlsr();
+	init_nlsr();	
     	
 	while ((res = getopt_long(argc, argv, "df:h", longopts, 0)) != -1) 
 	{
@@ -539,58 +444,49 @@
 
 	nlsr->ccn=ccn_create();
 	if(ccn_connect(nlsr->ccn, NULL) == -1)
-		{
-			fprintf(stderr,"Could not connect to ccnd\n");
-			exit(1);
-		}
+	{
+		fprintf(stderr,"Could not connect to ccnd\n");
+		exit(1);
+	}
 	struct ccn_charbuf *router_prefix;	
-	router_prefix=ccn_charbuf_create();
-	res=ccn_name_from_uri(router_prefix,nlsr->router_name->name);		
+	router_prefix=ccn_charbuf_create(); 
+	res=ccn_name_from_uri(router_prefix,nlsr->router_name);		
 	if(res<0)
-		{
-			fprintf(stderr, "Bad ccn URI: %s\n",nlsr->router_name->name);
-			exit(1);
-		}
+	{
+		fprintf(stderr, "Bad ccn URI: %s\n",nlsr->router_name);
+		exit(1);
+	}
 
 	ccn_name_append_str(router_prefix,"nlsr");
-	nlsr->in_interest.data=nlsr->router_name->name;
+	nlsr->in_interest.data=nlsr->router_name;
 	res=ccn_set_interest_filter(nlsr->ccn,router_prefix,&nlsr->in_interest);
 	if ( res < 0 )
-		{
-			fprintf(stderr,"Failed to register interest for router\n");
-			exit(1);
-		}
+	{
+		fprintf(stderr,"Failed to register interest for router\n");
+		exit(1);
+	}
+	ccn_charbuf_destroy(&router_prefix);
+	
+	printf("Router Name : %s\n",nlsr->router_name);
+	printf("lsdb_version: %s\n",nlsr->lsdb->lsdb_version);
 
-	/* 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);	
-
-
+	nlsr->event_send_info_interest = ccn_schedule_event(nlsr->sched, 1, &send_info_interest, NULL, 0);
 
 	while(1)
-	{
-		if(nlsr->semaphor == 0)
-		{	
-			ccn_schedule_run(nlsr->sched);
-        		res = ccn_run(nlsr->ccn, 500);
-		}
+	{	
+		ccn_schedule_run(nlsr->sched);
+        	res = ccn_run(nlsr->ccn, 500);
 
 	}
-	
-	nlsr_destroy();
 
+
+	nlsr_destroy();
 	return 0;
 }
 
diff --git a/nlsr.h b/nlsr.h
index fdde154..27b4adc 100644
--- a/nlsr.h
+++ b/nlsr.h
@@ -1,39 +1,22 @@
 #ifndef _NLSR_H_
 #define _NLSR_H_
 
-#define LSA_ADJ_TYPE 1
-#define LSA_NAME_TYPE 2
+
 #define LSDB_SYNCH_INTERVAL 300
 #define INTEREST_RETRY 3
 #define INTEREST_RESEND_TIME 15
 
-#define NBR_DOWN 0
-#define NBR_ACTIVE 1
-
 struct name_prefix
 {
 	char *name;
 	int length;
 };
 
-struct ndn_neighbor
-{
-	struct name_prefix *neighbor;
-	int face;
-	int status;
-	char * last_lsdb_version;
-	int info_interest_timed_out;
-	long int lsdb_synch_interval;
-	long int last_lsdb_requested;
-	int is_lsdb_send_interest_scheduled;
-	int metric;
-};
-
 struct linkStateDatabase
 {
-	char  * version;
-	struct hashtb *adj_lsdb;
 	struct hashtb *name_lsdb;
+	struct hashtb *adj_lsdb;
+	char *lsdb_version;
 };
 
 struct nlsr
@@ -51,11 +34,13 @@
 	struct hashtb *adl;
 	struct hashtb *npl;
 
-	struct ccn *ccn;
-	struct name_prefix *router_name;
-
 	struct linkStateDatabase *lsdb;
 
+	struct ccn *ccn;
+	char *router_name;
+
+	
+
 	int is_synch_init;
 	long int nlsa_id;
 	int adj_build_flag;
@@ -73,26 +58,16 @@
 
 struct nlsr *nlsr;
 
-void init_nlsr(void);
-
-void ndn_rtr_gettime(const struct ccn_gettime *self, struct ccn_timeval *result);
-void process_command_router_name(char *command);
-void process_command_ccnname(char *command);
 void process_command_ccnneighbor(char *command);
+void process_command_ccnname(char *command);
 void process_command_lsdb_synch_interval(char *command);
 void process_command_interest_retry(char *command);
 void process_command_interest_resend_time(char *command);
 void process_conf_command(char *command);
 int readConfigFile(const char *filename);
 
-void add_name_prefix_to_npl(struct name_prefix *np);
-void print_name_prefix_from_npl(void);
-
-void my_lock(void);
-void my_unlock(void);
-
-
-
+void init_nlsr(void);
 void nlsr_destroy( void );
+void nlsr_stop_signal_handler(int sig);
 
 #endif
diff --git a/nlsr_adl.c b/nlsr_adl.c
index 7ebc8af..c04aeda 100644
--- a/nlsr_adl.c
+++ b/nlsr_adl.c
@@ -18,34 +18,31 @@
 #include <ccn/hashtb.h>
 
 #include "nlsr.h"
-#include "nlsr_ndn.h"
-#include "utility.h"
+#include "nlsr_npl.h"
 #include "nlsr_adl.h"
+#include "utility.h"
 
-void
-add_adjacent_to_adl(struct name_prefix *np, int face)
+void 
+add_nbr_to_adl(struct name_prefix *new_nbr,int face)
 {
-	printf("\nadd_adjacent_to_adl called\n");
-	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 ndn_neighbor *nbr=(struct ndn_neighbor *)malloc(sizeof(struct ndn_neighbor )); //free
 
 	struct hashtb_enumerator ee;
     	struct hashtb_enumerator *e = &ee; 	
     	int res;
 
    	hashtb_start(nlsr->adl, e);
-    	res = hashtb_seek(e, np->name, np->length, 0);
+    	res = hashtb_seek(e, new_nbr->name, new_nbr->length, 0);
 
 	if(res == HT_NEW_ENTRY )
 	{
    
 		nbr = e->data;
 
-		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->neighbor=(struct name_prefix *)malloc(sizeof( struct name_prefix )); //free
+		nbr->neighbor->name=(char *)malloc(new_nbr->length);
+		memcpy(nbr->neighbor->name,new_nbr->name,new_nbr->length);
+		nbr->neighbor->length=new_nbr->length;
 		nbr->face=face;
 		nbr->status=NBR_DOWN;
 		nbr->info_interest_timed_out=0;
@@ -53,28 +50,28 @@
 		nbr->metric=10;
 		nbr->is_lsdb_send_interest_scheduled=0;
 		
-		
 
-		char *time_stamp=get_current_timestamp_micro();
-		nbr->last_lsdb_version=(char *)malloc(strlen(time_stamp)+1);
+		char *time_stamp=(char *)malloc(20);
+		get_current_timestamp_micro(time_stamp);
+		nbr->last_lsdb_version=(char *)malloc(strlen(time_stamp)+1); //free
 		memcpy(nbr->last_lsdb_version,time_stamp,strlen(time_stamp)+1);
 		memset(nbr->last_lsdb_version,'0',strlen(time_stamp));
+		nbr->last_info_version=(char *)malloc(strlen(time_stamp)+1); //free
+		memcpy(nbr->last_info_version,time_stamp,strlen(time_stamp)+1);
+		memset(nbr->last_info_version,'0',strlen(time_stamp));
+		free(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);
 }
 
+
 void 
 print_adjacent(struct ndn_neighbor *nbr)
 {
-	printf("\nprint_adjacent called\n");
+	printf("print_adjacent called\n");
 	printf("--------Neighbor---------------------------\n");
 	printf("	Neighbor: %s \n",nbr->neighbor->name);
 	printf("	Length  : %d \n",nbr->neighbor->length);
@@ -82,9 +79,13 @@
 	printf("	Metric    : %d \n",nbr->metric);
 	printf("	Status  : %d \n",nbr->status);
 	printf("	LSDB Version: %s \n",nbr->last_lsdb_version);
+	printf("	Info Version: %s \n",nbr->last_info_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);
+	printf("	IS_lsdb_send_interest_scheduled : %d \n",nbr->is_lsdb_send_interest_scheduled);
+
+	printf("\n");
 
 }
 
@@ -113,11 +114,108 @@
 
 }
 
+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;
+
+}
+
+int 
+get_timed_out_number(struct name_prefix *nbr)
+{
+	printf("get_timed_out_number called \n");
+
+	int res,ret=-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;
+		ret=nnbr->info_interest_timed_out;
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+
+	return ret;	
+}
+
+
+void 
+update_adjacent_timed_out_to_adl(struct name_prefix *nbr, int increment)
+{
+	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;
+		nnbr->info_interest_timed_out += increment;
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+}
+
+void 
+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);
+
+}
+
 void 
 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;
 
@@ -166,7 +264,7 @@
 		if ( nnbr->lsdb_synch_interval!= interval )
 		{
 			nnbr->lsdb_synch_interval=interval;
-			
+
 		}
 	}
 	else if(res == HT_NEW_ENTRY)
@@ -175,108 +273,32 @@
 	}
 
 	hashtb_end(e);
-	
-	
 }
 
 
-void 
-update_adjacent_timed_out_to_adl(struct name_prefix *nbr, int increment)
-{
-	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;
-		nnbr->info_interest_timed_out += increment;
-	}
-	else if(res == HT_NEW_ENTRY)
-	{
-		hashtb_delete(e);
-	}
-
-	hashtb_end(e);
-}
-
-void 
-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);
-
-}
-
-
-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)
+no_active_nbr(void)
 {
-	printf("get_timed_out_number called \n");
-
-	int res,ret=-1;
-	struct ndn_neighbor *nnbr;
-
+	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);
 
-	hashtb_start(nlsr->adl, e);
-	res = hashtb_seek(e, nbr->name, nbr->length, 0);
-
-	if( res == HT_OLD_ENTRY )
+	for(i=0;i<adl_element;i++)
 	{
-		nnbr=e->data;
-		ret=nnbr->info_interest_timed_out;
-	}
-	else if(res == HT_NEW_ENTRY)
-	{
-		hashtb_delete(e);
+		nbr=e->data;
+		if( nbr->status	== 1 )
+			no_link++;
+		hashtb_next(e);		
 	}
 
 	hashtb_end(e);
 
-	return ret;
+	return no_link;
 
-	return 0;	
 }
 
 int
@@ -312,87 +334,10 @@
 	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)
@@ -412,7 +357,7 @@
 		{
 			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);
@@ -441,6 +386,104 @@
 	hashtb_end(e);
 }
 
+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_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_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;
+
+}
+
 char *
 get_nbr_lsdb_version(char *nbr)
 {
@@ -456,7 +499,7 @@
 
 	hashtb_start(nlsr->adl, e);
 	res = hashtb_seek(e, nbr, strlen(nbr)+1, 0);
-	
+
 	if (res == HT_OLD_ENTRY)
 	{
 		nnbr=e->data;
@@ -492,7 +535,64 @@
 	{
 		nnbr=e->data;
 		nnbr->last_lsdb_requested=timestamp;
-		
+
+	}
+	else if(res == HT_NEW_ENTRY)
+	{
+		hashtb_delete(e);
+	}
+
+	hashtb_end(e);
+}
+
+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);
+}
+
+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)
 	{
@@ -521,7 +621,7 @@
 	{
 		nnbr=e->data;
 		nnbr->last_lsdb_requested=nnbr->last_lsdb_requested-sec;
-		
+
 	}
 	else if(res == HT_NEW_ENTRY)
 	{
@@ -533,161 +633,3 @@
 }
 
 
-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 7879aa8..64d19d6 100644
--- a/nlsr_adl.h
+++ b/nlsr_adl.h
@@ -1,34 +1,42 @@
 #ifndef _NLSR_ADL_H_
 #define _NLSR_ADL_H_
 
-#define NBR_ACTIVE 1
 #define NBR_DOWN 0
+#define NBR_ACTIVE 1
 
-void add_adjacent_to_adl(struct name_prefix *np, int face);
+struct ndn_neighbor
+{
+	struct name_prefix *neighbor;
+	int face;
+	int status;
+	char * last_lsdb_version;
+	char * last_info_version;
+	int info_interest_timed_out;
+	long int lsdb_synch_interval;
+	long int last_lsdb_requested;
+	int is_lsdb_send_interest_scheduled;
+	int metric;
+};
+
+void add_nbr_to_adl(struct name_prefix *new_nbr,int face);
 void print_adjacent(struct ndn_neighbor *nbr);
 void print_adjacent_from_adl(void);
-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 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);
+void update_adjacent_status_to_adl(struct name_prefix *nbr, int status);
+void update_lsdb_synch_interval_to_adl(struct name_prefix *nbr, long int interval);
 int no_active_nbr(void);
-long int len_active_nbr_data(void);
+int is_adj_lsa_build(void);
 void get_active_nbr_adj_data(struct ccn_charbuf *c);
+long int get_nbr_time_diff_lsdb_req(char *nbr);
+long int get_nbr_last_lsdb_requested(char *nbr);
+long int get_nbr_last_lsdb_requested(char *nbr);
+long int get_lsdb_synch_interval(char *nbr);
 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 update_adjacent_lsdb_version_to_adl(struct name_prefix *nbr, char *version);
 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 39a0322..29c7440 100644
--- a/nlsr_lsdb.c
+++ b/nlsr_lsdb.c
@@ -18,24 +18,53 @@
 #include <ccn/hashtb.h>
 
 #include "nlsr.h"
+#include "nlsr_ndn.h"
 #include "nlsr_lsdb.h"
 #include "utility.h"
-#include "nlsr_ndn.h"
+#include "nlsr_npl.h"
 #include "nlsr_adl.h"
 
 void
 set_new_lsdb_version(void)
 {
 	
-	char *time_stamp=get_current_timestamp_micro();
+	char *time_stamp=(char *)malloc(20);
+	memset(time_stamp,0,20);
+	get_current_timestamp_micro(time_stamp);
 	
-	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);
+	free(nlsr->lsdb->lsdb_version);
+	nlsr->lsdb->lsdb_version=(char *)malloc(strlen(time_stamp)+1);
+	memset(nlsr->lsdb->lsdb_version,0,strlen(time_stamp)+1);
+	memcpy(nlsr->lsdb->lsdb_version,time_stamp,strlen(time_stamp)+1);
+
+	free(time_stamp);
 	
 }
 
+void 
+make_name_lsa_key(char *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);
+	
+	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);
+	
+}
 
 void 
 build_and_install_name_lsas(void)
@@ -56,8 +85,13 @@
 		np=e->data;
 		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);
+		free(name_lsa->header->orig_router->name);
+		free(name_lsa->header->orig_router);
+		free(name_lsa->header);
+		free(name_lsa->name_prefix->name);
+		free(name_lsa->name_prefix);
 		free(name_lsa);
 		hashtb_next(e);		
 	}
@@ -66,72 +100,28 @@
 
 }
 
-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();
+	char *time_stamp=(char *)malloc(20);
+	memset(time_stamp,0,20);
+	get_current_timestamp_micro(time_stamp);
 
-	name_lsa->header->orig_time=(char *)malloc(strlen(time_stamp)+1);
+	name_lsa->header->orig_time=(char *)malloc(strlen(time_stamp)+1); //free 
 	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);
+	
+	free(time_stamp);
 
 	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->orig_router->name=(char *)malloc(strlen(nlsr->router_name)+1);
+	memset(name_lsa->header->orig_router->name,0,strlen(nlsr->router_name)+1);
+	memcpy(name_lsa->header->orig_router->name,nlsr->router_name,strlen(nlsr->router_name)+1);
+	name_lsa->header->orig_router->length=strlen(nlsr->router_name)+1;
 	name_lsa->header->isValid=1;
 
 	
@@ -142,37 +132,27 @@
 
 }
 
-
-void 
-print_name_lsa(struct nlsa *name_lsa)
-{
-	printf("print_name_lsa called \n");
-	
-	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	 :	%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",name_lsa->name_prefix->name);
-	printf("		Name Prefix Length	:	%d\n",name_lsa->name_prefix->length);
-
-	printf("\n");	
-}
-
 void 
 install_name_lsa(struct nlsa *name_lsa)
 {
-	printf("install_name_lsa called \n");
 	
-	print_name_lsa(name_lsa);
+	char lst[2];
+	memset(lst,0,2);
+	sprintf(lst,"%d",name_lsa->header->ls_type);	
 
-	char *key=make_name_lsa_key(name_lsa->header->orig_router->name,name_lsa->header->ls_type,name_lsa->header->ls_id);	
+	char lsid[10];
+	memset(lsid,0,10);
+	sprintf(lsid,"%ld",name_lsa->header->ls_id);
+	
+	
+	char *key=(char *)malloc(strlen(name_lsa->header->orig_router->name)+1+strlen(lst)+1+strlen(lsid)+1);
+	memset(key,0,strlen(name_lsa->header->orig_router->name)+1+strlen(lst)+1+strlen(lsid)+1);
+
+
+	make_name_lsa_key(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 nlsa *new_name_lsa=(struct nlsa*)malloc(sizeof(struct nlsa )); //free
 
 	struct hashtb_enumerator ee;
     	struct hashtb_enumerator *e = &ee; 	
@@ -186,32 +166,31 @@
 		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=(struct nlsa_header *)malloc(sizeof(struct nlsa_header )); //free
 		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);
+		memset(new_name_lsa->header->orig_time,0,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=(struct name_prefix *)malloc(sizeof(struct name_prefix )); //free
 		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=(struct name_prefix *)malloc(sizeof(struct name_prefix )); //free
 		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);
+		printf("Old Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
 		set_new_lsdb_version();	
-		printf("New Version Number of LSDB: %s \n",nlsr->lsdb->version);		
+		printf("New Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);		
 
 	}
 	else if(res == HT_OLD_ENTRY)
@@ -221,37 +200,27 @@
 	}
 
     	hashtb_end(e);
+
+	free(key);
 }
 
 
-char *
-make_name_lsa_key(char *orig_router, int ls_type, long int ls_id)
+void 
+print_name_lsa(struct nlsa *name_lsa)
 {
 	
-	
-	printf("Orig Router: %s LS Type: %d LS Id: %ld\n",orig_router,ls_type,ls_id);
+	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	 :	%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",name_lsa->name_prefix->name);
+	printf("		Name Prefix Length	:	%d\n",name_lsa->name_prefix->length);
 
-	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;
-	
+	printf("\n");	
 }
 
 void
@@ -280,138 +249,53 @@
 	printf("\n");
 }
 
-int
-build_and_install_adj_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
+
+void
+build_and_install_others_name_lsa(char *orig_router,int ls_type,long int ls_id,char *orig_time, int isValid,char *np)
 {
-	printf("build_and_install_adj_lsa called \n");
-	my_lock();
+	printf("build_and_install_others_name_lsa called \n");
 
-	printf("adj_build_flag = %d \n",nlsr->adj_build_flag);
+	struct nlsa *name_lsa=(struct nlsa *)malloc(sizeof( struct nlsa ));
+	build_others_name_lsa(name_lsa,orig_router,ls_type,ls_id,orig_time, isValid,np);
+	print_name_lsa(name_lsa);
+	install_name_lsa(name_lsa);
+	print_name_lsdb();
 
-	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);
+	free(name_lsa->header->orig_router->name);
+	free(name_lsa->header->orig_router);
+	free(name_lsa->header);
+	free(name_lsa->name_prefix->name);
+	free(name_lsa->name_prefix);
+	free(name_lsa);
 	
 }
 
 void
-build_adj_lsa(struct alsa * adj_lsa)
+build_others_name_lsa(struct nlsa *name_lsa, char *orig_router,int ls_type,long int ls_id,char *orig_time, int isValid,char *np)
 {
-	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;	
+	printf("build_others_name_lsa called \n");
 
-	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';
+	name_lsa->header=(struct nlsa_header *)malloc(sizeof(struct nlsa_header ));
+	name_lsa->header->ls_type=LS_TYPE_NAME;
 
-	printf("Router Name: %s Length: %d \n",nlsr->router_name->name,nlsr->router_name->length);
+	name_lsa->header->orig_time=(char *)malloc(strlen(orig_time)+1);
+	memset(name_lsa->header->orig_time,0,strlen(orig_time)+1);
+	memcpy(name_lsa->header->orig_time,orig_time,strlen(orig_time)+1);
 
-	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);
+	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;
 
-	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);
+	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;
 }
 
 
@@ -426,6 +310,131 @@
 	key[strlen(key)]='\0';
 }
 
+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");
+
+	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);
+			install_adj_lsa(adj_lsa);
+
+			free(adj_lsa->header->orig_router->name);
+			free(adj_lsa->header->orig_router);
+			free(adj_lsa->header->orig_time);
+			free(adj_lsa->header);
+			free(adj_lsa->body);
+			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;
+	return 0;
+}
+
+
+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->orig_router=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
+	adj_lsa->header->orig_router->name=(char *)malloc(strlen(nlsr->router_name)+1);
+	memset(adj_lsa->header->orig_router->name,0,strlen(nlsr->router_name)+1);
+	memcpy(adj_lsa->header->orig_router->name,nlsr->router_name,strlen(nlsr->router_name)+1);
+	adj_lsa->header->orig_router->length=strlen(nlsr->router_name)+1;
+
+	adj_lsa->header->ls_type=(unsigned)LS_TYPE_ADJ;	
+
+	char *time_stamp=(char *)malloc(20);
+	memset(time_stamp,0,20);
+	get_current_timestamp_micro(time_stamp);
+
+	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);	
+	free(time_stamp);
+
+
+	/* Filling Up Body Data */
+
+	adj_lsa->no_link=no_link;
+/*
+	struct link *templ=(struct link *)malloc(2*sizeof(struct link));
+	adj_lsa->links=templ;
+
+	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 )
+		{
+			struct link *temp=(struct link *)malloc(sizeof(struct link));
+			temp->nbr=(struct name_prefix *)malloc(sizeof(struct name_prefix));
+			temp->nbr->name=(char *)malloc(nbr->neighbor->length);
+			memset(temp->nbr->name,0,nbr->neighbor->length);		
+			memcpy(temp->nbr->name,nbr->neighbor->name,nbr->neighbor->length);
+
+			temp->nbr->length=nbr->neighbor->length;
+			temp->face=nbr->face;
+			temp->metric=nbr->metric;
+
+			templ=temp;
+			templ++;
+		}	
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+*/
+
+
+	struct ccn_charbuf *c=ccn_charbuf_create();
+	get_active_nbr_adj_data(c);
+	char *data=ccn_charbuf_as_string(c);
+
+	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++;
+
+
+}
+
+
 void
 install_adj_lsa(struct alsa * adj_lsa)
 {
@@ -435,7 +444,7 @@
 	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;
@@ -445,7 +454,7 @@
    	hashtb_start(nlsr->lsdb->adj_lsdb, e);
     	res = hashtb_seek(e, key, strlen(key), 0);
 
-	
+
 
 	if(res == HT_NEW_ENTRY )
 	{
@@ -461,17 +470,17 @@
 		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->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);
+		printf("Old Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
 		set_new_lsdb_version();	
-		printf("New Version Number of LSDB: %s \n",nlsr->lsdb->version);
-		
+		printf("New Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
+
 
 	}
 	else if(res == HT_OLD_ENTRY)
@@ -488,24 +497,23 @@
 			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->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);
+			printf("Old Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
 			set_new_lsdb_version();	
-			printf("New Version Number of LSDB: %s \n",nlsr->lsdb->version);
+			printf("New Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
 
 		}
 
 	}
 
     	hashtb_end(e);
-	
+
 	free(key);
 }
 
@@ -523,9 +531,6 @@
 	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);
@@ -538,7 +543,7 @@
 		printf("		Neighbor Length		 : %s	\n",length);
 		printf("		Connecting Face		 : %s	\n",face);
 		printf("		Metric			 : %s	\n",metric);
-		
+
 
 		for(i=1;i<no_link;i++)
 		{
@@ -561,18 +566,34 @@
 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);
+	printf("	Lsa Data:\n");
+	printf("		No of Link	: %d\n",adj_lsa->no_link);
 
 	print_adj_lsa_body(adj_lsa->body,adj_lsa->no_link);
-	
 
+/*
+	struct link *templ=adj_lsa->links;
+	int i;
+	
+	for(i=0 ; i< adj_lsa->no_link ; i++)
+	{
+		printf("		Link %d	 	\n",i+1);
+		printf("		Neighbor		 : %s	\n",templ->nbr->name);
+		printf("		Neighbor Length		 : %d	\n",templ->nbr->length);
+		printf("		Connecting Face		 : %d	\n",templ->face);
+		printf("		Metric			 : %d	\n",templ->metric);		
+
+		templ++;
+	}
+*/
 	printf("\n");
 
 }
@@ -601,319 +622,60 @@
 	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)
+build_and_install_others_adj_lsa(char *orig_router,int ls_type,char *orig_time, int no_link,char *data)
 {
-	printf("get_name_lsa_data called \n");
+	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);
+	
 
-	struct nlsa *name_lsa=(struct nlsa*)malloc(sizeof(struct nlsa ));
+	free(adj_lsa->header->orig_router->name);
+	free(adj_lsa->header->orig_router);
+	free(adj_lsa->header->orig_time);
+	free(adj_lsa->header);
+	free(adj_lsa->body);
+	free(adj_lsa);
 
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee; 	
-    	int res;
+	print_adj_lsdb();
 
-   	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)
+build_others_adj_lsa(struct alsa *adj_lsa,char *orig_router,int ls_type,char *orig_time,int no_link,char *data)
 {
-	printf("get_adj_lsa_data called \n");
+	printf("build_others_adj_lsa called \n");
 
-	struct alsa *adj_lsa=(struct alsa*)malloc(sizeof(struct alsa ));
+	/*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);
 
-	struct hashtb_enumerator ee;
-    	struct hashtb_enumerator *e = &ee; 	
-    	int res;
+	adj_lsa->header->orig_router->length=strlen(orig_router)+1;
 
-   	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,"|");
+	adj_lsa->header->ls_type=(unsigned)LS_TYPE_ADJ;	
 
-		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,"|");
+	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);
 
-		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,"|");
+	adj_lsa->no_link=no_link;
 
-		ccn_charbuf_append_string(lsa_data,adj_lsa->header->orig_time);
-		ccn_charbuf_append_string(lsa_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);
 
-		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)
 {
@@ -945,3 +707,332 @@
 
 	return num_element; 
 }
+
+void 
+get_name_lsdb_summary(struct ccn_charbuf *name_lsdb_data)
+{
+	printf("get_name_lsdb_summary called \n");	
+	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);
+	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(name_lsdb_data,name_lsa->header->orig_router->name);
+		ccn_charbuf_append_string(name_lsdb_data,"|");
+
+		char *lst=(char *)malloc(20);
+		memset(lst,0,20);
+		sprintf(lst,"%d",name_lsa->header->ls_type);
+		ccn_charbuf_append_string(name_lsdb_data,lst);
+		free(lst);
+		ccn_charbuf_append_string(name_lsdb_data,"|");
+
+		char *lsid=(char *)malloc(20);
+		memset(lsid,0,20);
+		sprintf(lsid,"%ld",name_lsa->header->ls_id);
+		ccn_charbuf_append_string(name_lsdb_data,lsid);
+		free(lsid);
+		ccn_charbuf_append_string(name_lsdb_data,"|");
+
+		ccn_charbuf_append_string(name_lsdb_data,name_lsa->header->orig_time);
+		ccn_charbuf_append_string(name_lsdb_data,"|");
+
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+
+}
+
+
+void 
+get_adj_lsdb_summary(struct ccn_charbuf *adj_lsdb_data)
+{
+	printf("get_adj_lsdb_summary 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++)
+	{
+		adj_lsa=e->data;
+
+		ccn_charbuf_append_string(adj_lsdb_data,adj_lsa->header->orig_router->name);
+		ccn_charbuf_append_string(adj_lsdb_data,"|");
+		
+		char *lst=(char *)malloc(20);
+		memset(lst,0,20);
+		sprintf(lst,"%d",adj_lsa->header->ls_type);
+		ccn_charbuf_append_string(adj_lsdb_data,lst);
+		free(lst);
+		ccn_charbuf_append_string(adj_lsdb_data,"|");
+
+		ccn_charbuf_append_string(adj_lsdb_data,adj_lsa->header->orig_time);
+		ccn_charbuf_append_string(adj_lsdb_data,"|");
+
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+}
+
+
+void 
+get_lsdb_summary(struct ccn_charbuf *lsdb_data)
+{
+	struct ccn_charbuf *name_lsdb_data=ccn_charbuf_create();
+	struct ccn_charbuf *adj_lsdb_data=ccn_charbuf_create();
+
+	get_name_lsdb_summary(name_lsdb_data);
+	get_adj_lsdb_summary(adj_lsdb_data);
+
+	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);
+
+	if( num_lsa > 0)
+	{
+		ccn_charbuf_append_string(lsdb_data,num_element);
+		ccn_charbuf_append_string(lsdb_data,"|");
+	}
+	if(name_lsdb_data->length>0)
+	{
+		char *data1=ccn_charbuf_as_string(name_lsdb_data);
+		ccn_charbuf_append_string(lsdb_data,(char *)data1);
+	}
+	if(adj_lsdb_data->length>0)
+	{
+		char *data2=ccn_charbuf_as_string(adj_lsdb_data);
+		ccn_charbuf_append_string(lsdb_data,(char *)data2);
+	}
+	ccn_charbuf_destroy(&name_lsdb_data);
+	ccn_charbuf_destroy(&adj_lsdb_data);
+	free(num_element);
+
+}
+
+int 
+check_is_new_name_lsa(char *orig_router,char *lst,char *lsid,char *orig_time)
+{
+	int ret=0;
+	struct ccn_charbuf *key=ccn_charbuf_create();
+	ccn_charbuf_append_string(key,orig_router);
+	ccn_charbuf_append_string(key,"/");
+	ccn_charbuf_append_string(key,lst);
+	ccn_charbuf_append_string(key,"/");
+	ccn_charbuf_append_string(key,lsid);
+
+	int res;
+	struct nlsa *name_lsa;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+
+	hashtb_start(nlsr->lsdb->name_lsdb, e);
+	res = hashtb_seek(e, ccn_charbuf_as_string(key), key->length, 0);
+
+	if( res == HT_NEW_ENTRY )
+	{
+		hashtb_delete(e);
+		ret=1;
+
+	}
+	else if(res == HT_OLD_ENTRY)
+	{
+		name_lsa=e->data;
+		if( strcmp ( orig_time , name_lsa->header->orig_time ) > 0 )
+		{
+			ret=1;
+		}
+	}
+
+	hashtb_end(e);
+
+	ccn_charbuf_destroy(&key);
+	
+	return ret;
+}
+
+int 
+check_is_new_adj_lsa(char *orig_router,char *lst,char *orig_time)
+{
+	int ret=0;
+	struct ccn_charbuf *key=ccn_charbuf_create();
+	ccn_charbuf_append_string(key,orig_router);
+	ccn_charbuf_append_string(key,"/");
+	ccn_charbuf_append_string(key,lst);
+
+	int res;
+	struct alsa *adj_lsa;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+
+	hashtb_start(nlsr->lsdb->adj_lsdb, e);
+	res = hashtb_seek(e, ccn_charbuf_as_string(key), key->length, 0);
+
+	if( res == HT_NEW_ENTRY )
+	{
+		hashtb_delete(e);
+		ret=1;
+
+	}
+	else if(res == HT_OLD_ENTRY)
+	{
+		adj_lsa=e->data;
+		if( strcmp ( orig_time , adj_lsa->header->orig_time ) > 0 )
+		{
+			ret=1;
+		}
+	}
+
+	hashtb_end(e);
+	
+	ccn_charbuf_destroy(&key);
+
+	return ret;
+}
+
+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,"|");
+
+		ccn_charbuf_append_string(lsa_data,name_lsa->header->orig_time);
+		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);
+}
diff --git a/nlsr_lsdb.h b/nlsr_lsdb.h
index 5b37c60..87c4013 100644
--- a/nlsr_lsdb.h
+++ b/nlsr_lsdb.h
@@ -1,7 +1,6 @@
 #ifndef _NLSR_LSDB_H_
 #define _NLSR_LSDB_H_
 
-
 #define LS_TYPE_ADJ 1
 #define LS_TYPE_NAME 2
 
@@ -25,7 +24,8 @@
 {
 	struct alsa_header *header;	
 	int no_link;
-	char *body;
+	struct link *links;
+	char * body;
 };
 
 struct nlsa_header
@@ -44,33 +44,38 @@
 	struct name_prefix *name_prefix;
 };
 
-void set_new_lsdb_version(void);
 
+void set_new_lsdb_version(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_lsa(struct nlsa *name_lsa);
 void print_name_lsdb(void);
+void build_and_install_others_name_lsa(char *orig_router,int ls_type,long int ls_id,char *orig_time, int isValid,char *np);
+void build_others_name_lsa(struct nlsa *name_lsa, char *orig_router,int ls_type,long int ls_id, char *orig_time, int isValid, char *np);
+void make_name_lsa_key(char *key, char *orig_router, int ls_type, long int ls_id);
 
 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);
-
-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);
+void make_adj_lsa_key(char *key,struct alsa *adj_lsa);
+void build_and_install_others_adj_lsa(char *orig_router,int ls_type,char *orig_time, int no_link,char *data);
+void build_others_adj_lsa(struct alsa *adj_lsa,char *orig_router,int ls_type,char *orig_time,int no_link,char *data);
 
 long int get_name_lsdb_num_element(void);
 long int get_adj_lsdb_num_element(void);
 
+void get_name_lsdb_summary(struct ccn_charbuf *name_lsdb_data);
+void get_adj_lsdb_summary(struct ccn_charbuf *adj_lsdb_data);
+void get_lsdb_summary(struct ccn_charbuf *lsdb_data);
+
+int check_is_new_name_lsa(char *orig_router,char *lst,char *lsid,char *orig_time);
+int check_is_new_adj_lsa(char *orig_router,char *lst,char *orig_time);
+
+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);
+
 #endif
diff --git a/nlsr_ndn.c b/nlsr_ndn.c
index d67cd1d..f4a80cf 100644
--- a/nlsr_ndn.c
+++ b/nlsr_ndn.c
@@ -16,15 +16,14 @@
 #include <ccn/signing.h>
 #include <ccn/schedule.h>
 #include <ccn/hashtb.h>
-#include <ccn/bloom.h>
 
 #include "nlsr.h"
 #include "nlsr_ndn.h"
+#include "nlsr_npl.h"
 #include "nlsr_adl.h"
 #include "nlsr_lsdb.h"
 #include "utility.h"
 
-
 int
 appendLifetime(struct ccn_charbuf *cb, int lifetime) 
 {
@@ -84,8 +83,6 @@
 		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);
@@ -97,10 +94,10 @@
 }
 
 void 
-get_lsa_identifier(struct name_prefix *lsaId,struct ccn_closure *selfp, struct ccn_upcall_info *info)
+get_lsa_identifier(struct name_prefix *lsaId,struct ccn_closure *selfp, struct ccn_upcall_info *info, int offset)
 {
 
-	printf("get_nbr called\n");
+	printf("get_lsa_identifier called\n");
 	int res,i;
 	int nlsr_position=0;
 	int name_comps=(int)info->interest_comps->n;
@@ -119,7 +116,7 @@
 
 	const unsigned char *comp_ptr1;
 	size_t comp_size;
-	for(i=nlsr_position+2;i<info->interest_comps->n-2;i++)
+	for(i=nlsr_position+3+offset;i<info->interest_comps->n-1;i++)
 	{
 		res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,i,&comp_ptr1, &comp_size);
 		len+=1;
@@ -130,15 +127,13 @@
 	char *neighbor=(char *)malloc(len);
 	memset(neighbor,0,len);
 
-	for(i=nlsr_position+2; i<info->interest_comps->n-2;i++)
+	for(i=nlsr_position+3+offset; i<info->interest_comps->n-1;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);
@@ -146,42 +141,87 @@
 	lsaId->length=strlen(neighbor)+1;
 
 	printf("LSA Identifier: %s Length: %d\n",lsaId->name,lsaId->length-1);
-	
+
 
 }
 
+int 
+get_ls_type(struct ccn_closure *selfp, struct ccn_upcall_info *info)
+{
+	int res,i;
+	int nlsr_position=0;
+	int name_comps=(int)info->interest_comps->n;
+
+	int ret=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;
+	res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,nlsr_position+2,&comp_ptr1, &comp_size);
+
+	ret=atoi((char *)comp_ptr1);
+
+	return ret;	
+
+}
+
+void 
+get_lsdb_version(char *lsdb_version,struct ccn_closure *selfp, struct ccn_upcall_info *info )
+{
+	const unsigned char *comp_ptr1;
+	size_t comp_size;
+	ccn_name_comp_get(info->content_ccnb, info->content_comps,info->content_comps->n-2,&comp_ptr1, &comp_size);
+	memcpy(lsdb_version,(char *)comp_ptr1,(int)comp_size);
+
+}
+
+
+/* Call back function registered in ccnd to get all interest coming to NLSR application */
+
 enum ccn_upcall_res 
 incoming_interest(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_INTEREST:
-            	printf("Interest Received \n"); 
+		// 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],0);
+		printf("%s\n",ccn_charbuf_as_string(c));
+		ccn_charbuf_destroy(&c);
+
 		process_incoming_interest(selfp, info);
+		
 		break;
+
         default:
             break;
     }
-	my_unlock();
+
     return CCN_UPCALL_RESULT_OK;
 }
 
+/* Function for processing incoming interest and reply with content/NACK content */
 
 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);	
-	printf("%s\n",ccn_charbuf_as_string(c));
-	ccn_charbuf_destroy(&c);
-	*/
 	const unsigned char *comp_ptr1;
 	size_t comp_size;
 	int res,i;
@@ -214,21 +254,19 @@
 	{
 		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");
+	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)
 	{
@@ -255,9 +293,9 @@
 
 
 		struct name_prefix *nbr=(struct name_prefix * )malloc(sizeof(struct name_prefix *));
-		get_lsa_identifier(nbr,selfp,info);
+		get_lsa_identifier(nbr,selfp,info,-1);
 		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 )
 		{
@@ -268,13 +306,10 @@
 		free(raw_data);
 		ccn_charbuf_destroy(&sp.template_ccnb);
 	}
-	
+
 	ccn_charbuf_destroy(&data);
-	ccn_charbuf_destroy(&name);	
+	ccn_charbuf_destroy(&name);
 
-	
-
-		
 }
 
 
@@ -316,7 +351,8 @@
 		if (comp != NULL)
 		{
 			printf("LSDB Version in Exclusion Filter is %s\n",comp);
-			dbcmp=strcmp(nlsr->lsdb->version,(char *)comp);
+			printf("LSDB Version of own NLSR is: %s \n",nlsr->lsdb->lsdb_version);
+			dbcmp=strcmp(nlsr->lsdb->lsdb_version,(char *)comp);
 		}
 		/* Now comp points to the start of your potential number, and size is its length */
 	}
@@ -331,7 +367,7 @@
 	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]); 
+	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);
@@ -343,45 +379,18 @@
 	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]); 
+		printf("Sending LSDB Summary of Updated LSDB Content...\n");			
 
-		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_name_append_str(name,nlsr->lsdb->lsdb_version);
 
-		//ccn_charbuf_append_string(name,nlsr->lsdb->version);
+		struct ccn_charbuf *lsdb_data=ccn_charbuf_create();
+		get_lsdb_summary(lsdb_data);
 
+		char *raw_data=ccn_charbuf_as_string(lsdb_data);
 
-		
-		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);
+		//printf("Content Data to be sent: %s \n",raw_data);		
 
-		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)
+		if( nlsr->adj_build_count == 0 || nlsr->is_build_adj_lsa_sheduled == 1 || strlen((char *)raw_data) == 0 )
 		{
 			 res= ccn_sign_content(nlsr->ccn, data, name, &sp, "WAIT" , strlen("WAIT"));
 		}
@@ -396,24 +405,14 @@
 
 		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);
+		
+		ccn_charbuf_destroy(&lsdb_data);
 	}
 	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");
@@ -430,40 +429,31 @@
 	ccn_charbuf_destroy(&name);
 	ccn_charbuf_destroy(&sp.template_ccnb);
 
+
 }
 
+
 void 
 process_incoming_interest_lsa(struct ccn_closure *selfp, struct ccn_upcall_info *info)
 {
 	printf("process_incoming_interest_lsa 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;
 
 	struct name_prefix *lsaId=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
-	get_lsa_identifier(lsaId,selfp,info);
+	get_lsa_identifier(lsaId,selfp,info,0);
 
-	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);		
-
-	char lsa_type=lsaId->name[nlsr->router_name->length];
-	printf("LSA Type: %c\n",lsa_type);
-	int ls_type=atoi(&lsa_type);
+	printf("LSA Identifier: %s Length: %d\n",lsaId->name,lsaId->length);
+	int ls_type=get_ls_type(selfp, info);
 
 	struct ccn_charbuf *lsa_data=ccn_charbuf_create();
 
-	if ( ls_type == LSA_NAME_TYPE )
+	if ( ls_type == LS_TYPE_NAME )
 	{
 		printf("Interest Received for NAME LSA\n");
 		get_name_lsa_data(lsa_data,lsaId);
 	}
-	else if ( ls_type == LSA_ADJ_TYPE )
+	else if ( ls_type == LS_TYPE_ADJ )
 	{
 		printf("Interest Received for ADJ LSA\n");
 		get_adj_lsa_data(lsa_data,lsaId);
@@ -473,12 +463,12 @@
 	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);
+	//printf("Content Data to be sent: %s\n",raw_data);
 
 	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();
@@ -495,8 +485,8 @@
 	if(res >= 0)
 		printf("Sending LSA Content is successful \n");
 
-	
-	
+
+
 	ccn_charbuf_destroy(&data);
 	ccn_charbuf_destroy(&name);
 	ccn_charbuf_destroy(&sp.template_ccnb);
@@ -506,46 +496,52 @@
 	free(lsaId);
 }
 
+/* Call back function registered in ccnd to get all content coming to NLSR application */
+
 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 \n");  
-		
-		process_incoming_content(selfp, info);
+            	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"); 	    
+		printf("Interest Timed Out Received for Name: ");
+		
+		struct ccn_charbuf*ito;
+		ito=ccn_charbuf_create();
+		ccn_uri_append(ito,info->interest_ccnb,info->pi->offset[CCN_PI_E],0);
+		printf("%s\n",ccn_charbuf_as_string(ito));
+		ccn_charbuf_destroy(&ito);
+
 		process_incoming_timed_out_interest(selfp,info);
 
 	    break;
         default:
             fprintf(stderr, "Unexpected response of kind %d\n", kind);
-            //return CCN_UPCALL_RESULT_ERR;
+            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);	
-	printf("%s\n",ccn_charbuf_as_string(c));
-	ccn_charbuf_destroy(&c);
-	*/
 
 	const unsigned char *comp_ptr1;
 	size_t comp_size;
@@ -579,33 +575,37 @@
 	{
 		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);
+	//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");
@@ -617,21 +617,22 @@
 		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);
+	//printf("Content data: %s\n",ptr);
 
 	if( (strcmp("NACK",(char *)ptr) != 0 ) && (strcmp("WAIT",(char *)ptr) != 0 ) )
 	{
@@ -648,6 +649,7 @@
 		int ls_type;
 		char *lsid;
 		long int ls_id;
+		char *orig_time;
 
 		nl=strtok_r((char *)ptr,sep,&rem);
 		num_element=atoi(nl);		
@@ -663,26 +665,47 @@
 			{
 				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);	
+				orig_time=strtok_r(NULL,sep,&rem);
+				printf(" LS Id: %ld  Orig Time: %s\n",ls_id ,orig_time);
+				int is_new_name_lsa=check_is_new_name_lsa(orig_router,lst,lsid,orig_time);
+				if ( is_new_name_lsa == 1 )
+				{
+					printf("New NAME LSA.....\n");
+					send_interest_for_name_lsa(nbr,orig_router,lst,lsid);	
+				}
+				else 
+				{
+					printf("Name LSA already exists in LSDB\n");
+				}
 			}
 			else
 			{
-				printf("\n");
-				send_interest_for_adj_lsa(nbr,orig_router,lst);
+				orig_time=strtok_r(NULL,sep,&rem);
+				printf(" Orig Time: %s\n",orig_time);
+				int is_new_adj_lsa=check_is_new_adj_lsa(orig_router,lst,orig_time);
+				if ( is_new_adj_lsa == 1 )
+				{
+					printf("New ADJ LSA.....\n");
+					send_interest_for_adj_lsa(nbr,orig_router,lst);
+				}
+				else
+				{
+					printf("ADJ LSA already exists in LSDB\n");
+				}
 			}
-				
+
 		}
-				
 
-		
-		char *version=get_current_timestamp_micro();
+		char *lsdb_version=(char *)malloc(20);
+		memset(lsdb_version,0,20);
+		get_lsdb_version(lsdb_version,selfp,info);
+
 		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);
+		update_adjacent_lsdb_version_to_adl(nbr,lsdb_version);
 		printf("New LSDB Version of Neighbor: %s is :%s\n",nbr->name,get_nbr_lsdb_version(nbr->name));
-		
-		
 
+
+		free(lsdb_version);
 		free(nbr);	
 	}
 	else if (strcmp("WAIT",(char *)ptr) == 0)
@@ -691,7 +714,7 @@
 		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);
 	}
@@ -699,10 +722,9 @@
 	{
 		printf("NACK Content Received\n");
 	}
-	
-	
 }
 
+
 void 
 process_incoming_content_lsa(struct ccn_closure *selfp, struct ccn_upcall_info* info)
 {
@@ -730,7 +752,7 @@
 	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("Content data Received: %s\n",ptr);
 
 	printf("LSA Data\n");
 
@@ -749,25 +771,26 @@
 
 		printf("	LS Type  : %d\n",ls_type);
 
-		if ( ls_type == LSA_NAME_TYPE )
+		if ( ls_type == LS_TYPE_NAME )
 		{
 			lsid=strtok_r(NULL,sep,&rem);
 			ls_id=atoi(lsid);
+			orig_time=strtok_r(NULL,sep,&rem);
 			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("	Orig Time   : %s\n",orig_time);
 			printf("	Name Prefix length: %d\n",name_length);
 
-			build_and_install_others_name_lsa(orig_router,ls_type,ls_id,isValid,np);
-				
+			build_and_install_others_name_lsa(orig_router,ls_type,ls_id,orig_time,isValid,np);
+
 		}
-		else if ( ls_type == LSA_ADJ_TYPE )
+		else if ( ls_type == LS_TYPE_ADJ )
 		{
 			orig_time=strtok_r(NULL,sep,&rem);
 			num_link=strtok_r(NULL,sep,&rem);
@@ -779,25 +802,14 @@
 
 			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;
@@ -827,12 +839,12 @@
 	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 
 	{
@@ -851,20 +863,17 @@
 	}
 
 	free(nbr);
-		
+
 
 }
 
-int 
+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();
-
 	int adl_element,i;
-
 	struct ndn_neighbor *nbr;
 
 	struct hashtb_enumerator ee;
@@ -879,11 +888,8 @@
 		send_info_interest_to_neighbor(nbr->neighbor);
 		hashtb_next(e);		
 	}
-
 	hashtb_end(e);
 
-	my_unlock();
-
 	return 0;
 }
 
@@ -893,16 +899,8 @@
 	printf("send_info_interest_to_neighbor called \n");
 
 	int res;
-	//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");
@@ -913,21 +911,19 @@
 	struct ccn_charbuf *name;	
 	name=ccn_charbuf_create();
 
-	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);
+	char *int_name=(char *)malloc(strlen(nbr->name)+1+strlen(nlsr_str)+1+strlen(info_str)+strlen(nlsr->router_name)+1);
+	memset(int_name,0,strlen(nbr->name)+1+strlen(nlsr_str)+1+strlen(info_str)+strlen(nlsr->router_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));
+	memcpy(int_name+strlen(int_name),nlsr->router_name,strlen(nlsr->router_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;
@@ -936,11 +932,10 @@
 		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> */
+		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> */
@@ -965,8 +960,6 @@
 {
 	printf("send_lsdb_interest called \n");	
 
-	my_lock();
-
 	int i, adl_element;
 	struct ndn_neighbor *nbr;
 
@@ -1000,7 +993,6 @@
 	hashtb_end(e);
 	nlsr->event_send_lsdb_interest= ccn_schedule_event(nlsr->sched, 30000000, &send_lsdb_interest, NULL, 0);
 
-	my_unlock();
 	return 0;
 }
 
@@ -1008,7 +1000,7 @@
 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)
@@ -1018,14 +1010,9 @@
 
 		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);
@@ -1039,16 +1026,14 @@
 		{
 			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);
@@ -1057,21 +1042,21 @@
 			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 )
@@ -1086,7 +1071,6 @@
 		ccn_charbuf_destroy(&name);
 	}	
 	set_is_lsdb_send_interest_scheduled_to_zero(nbr->name);
-
 }
 
 void 
@@ -1095,31 +1079,27 @@
 	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);
+	char *int_name=(char *)malloc(nbr->length + strlen(ls_type)+strlen(orig_router)+strlen(nlsr_str)+strlen(lsa_str)+3);
+	memset(int_name,0,nbr->length +strlen(ls_type)+ strlen(orig_router)+strlen(nlsr_str)+strlen(lsa_str)+3);
 
 	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));	
+	memcpy(int_name+strlen(int_name),"/",1);
+	memcpy(int_name+strlen(int_name),ls_type,strlen(ls_type));
+	memcpy(int_name+strlen(int_name),orig_router,strlen(orig_router));
 
-	
+
 	struct ccn_charbuf *name;	
 	name=ccn_charbuf_create();
 
@@ -1127,7 +1107,6 @@
 	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 */
@@ -1147,7 +1126,7 @@
 	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);
 
 	res=ccn_express_interest(nlsr->ccn,name,&(nlsr->in_content),templ);
@@ -1155,12 +1134,11 @@
 	if ( res >= 0 )
 		printf("NAME LSA interest sending Successfull .... \n");	
 	
-	//free(lsa_orig_router);	
 	ccn_charbuf_destroy(&templ);
 	ccn_charbuf_destroy(&name);
 	free(int_name);
-	
-	
+
+
 }
 
 void 
@@ -1169,38 +1147,34 @@
 	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);
+	char *int_name=(char *)malloc(nbr->length + strlen(ls_type)+strlen(orig_router)+strlen(nlsr_str)+strlen(lsa_str)+3);
+	memset(int_name,0,nbr->length +strlen(ls_type)+ strlen(orig_router)+strlen(nlsr_str)+strlen(lsa_str)+3);
 
 	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),"/",1);
+	memcpy(int_name+strlen(int_name),ls_type,strlen(ls_type));
 	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 */
 
@@ -1210,7 +1184,6 @@
 	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)
@@ -1219,7 +1192,7 @@
 	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);
@@ -1227,11 +1200,9 @@
 	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 0b6b14c..4932fb6 100644
--- a/nlsr_ndn.h
+++ b/nlsr_ndn.h
@@ -2,16 +2,20 @@
 #define _NLSR_NDN_H_
 
 int appendLifetime(struct ccn_charbuf *cb, int lifetime);
-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);
+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,int offset);
+void get_lsdb_version(char *lsdb_version,struct ccn_closure *selfp, struct ccn_upcall_info *info );
+int get_ls_type(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_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);
 
+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);
@@ -20,15 +24,12 @@
 void process_incoming_timed_out_interest(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);
 
-
 int send_info_interest(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags);
 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/nlsr_npl.c b/nlsr_npl.c
new file mode 100644
index 0000000..62101d4
--- /dev/null
+++ b/nlsr_npl.c
@@ -0,0 +1,74 @@
+#include<stdio.h>
+#include<string.h>
+#include<stdlib.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <sys/time.h>
+#include <assert.h>
+#ifdef HAVE_CONFIG_H
+#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 "nlsr.h"
+#include "nlsr_npl.h"
+
+
+void 
+add_name_to_npl(struct name_prefix *np)
+{
+	struct name_prefix *hnp=(struct name_prefix *)malloc(sizeof(struct name_prefix )); //free
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee; 	
+    	int res;
+
+   	hashtb_start(nlsr->npl, e);
+    	res = hashtb_seek(e, np->name, np->length, 0);
+
+	if(res == HT_NEW_ENTRY)
+	{   
+
+		hnp = e->data;
+		hnp->length=np->length;
+		hnp->name=(char *)malloc(np->length); //free
+		memcpy(hnp->name,np->name,np->length);
+	}
+    	
+	hashtb_end(e);
+
+}
+
+
+void
+print_name_prefix_from_npl(void)
+{
+	printf("print_name_prefix_from_npl called \n");	
+	int i, npl_element;
+	struct name_prefix *np;
+
+	struct hashtb_enumerator ee;
+    	struct hashtb_enumerator *e = &ee;
+    	
+    	hashtb_start(nlsr->npl, e);
+	npl_element=hashtb_n(nlsr->npl);
+
+	for(i=0;i<npl_element;i++)
+	{
+		np=e->data;
+		printf("Name Prefix: %s and Length: %d \n",np->name,np->length);	
+		hashtb_next(e);		
+	}
+
+	hashtb_end(e);
+
+	printf("\n");
+}
+
diff --git a/nlsr_npl.h b/nlsr_npl.h
new file mode 100644
index 0000000..3c22f8e
--- /dev/null
+++ b/nlsr_npl.h
@@ -0,0 +1,7 @@
+#ifndef _NLSR_NPL_H_
+#define _NLSR_NPL_H_
+
+void add_name_to_npl(struct name_prefix *np);
+void print_name_prefix_from_npl(void);
+
+#endif
diff --git a/utility.c b/utility.c
index 7ebc72d..33f3b2e 100644
--- a/utility.c
+++ b/utility.c
@@ -49,26 +49,7 @@
 }
 
 
-char * 
-nth_named_component(const char *name_prefix, int n)
-{
 
-	int i;
-	char * seps="/";
-	char *rem=NULL;
-	char *component;
-
-	char *prefix=(char *)malloc(strlen(name_prefix)+1);
-	memcpy(prefix,name_prefix,strlen(name_prefix)+1);
-
-	component=strtok_r(prefix,seps,&rem);
-
-	for(i=1;i<n;i++)
-		component=strtok_r(NULL,seps,&rem);
-
-	return component;
-
-}
 
 long int 
 get_current_time_sec(void)
@@ -79,27 +60,16 @@
 }
 
 
-long int 
-get_current_time_microsec(void)
-{
-	struct timeval now; 
-	gettimeofday(&now, NULL);
-	long int microSec=1000000*now.tv_sec+now.tv_usec;
-	return microSec;
-
-}
-
-char *
-get_current_timestamp_micro(void)
+void
+get_current_timestamp_micro(char * microSec)
 {
 	struct timeval now; 
 	gettimeofday(&now, NULL);
 
-	char *microSec=(char *)malloc(20);
+	//char *microSec=(char *)malloc(20);
 	sprintf(microSec,"%ld%06ld",now.tv_sec,(long int)now.tv_usec);
-	microSec[strlen(microSec)]='\0';
-
-	return microSec;
+	//microSec[strlen(microSec)]='\0';
+	//return microSec;
 
 }
 
diff --git a/utility.h b/utility.h
index 4b67bbd..fb699d6 100644
--- a/utility.h
+++ b/utility.h
@@ -3,10 +3,7 @@
 
 char * getLocalTimeStamp(void);
 char * getGmTimeStamp(void);
-char * nth_named_component(const char *name_prefix, int n);
 long int get_current_time_sec(void);
-long int get_current_time_microsec(void);
-
-char * get_current_timestamp_micro(void);
+void get_current_timestamp_micro(char * microSec);
 
 #endif
