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);
+}
