update
diff --git a/nlsr.c b/nlsr.c
index b3d38e9..6655558 100644
--- a/nlsr.c
+++ b/nlsr.c
@@ -249,7 +249,9 @@
hashtb_start(nlsr->npl, e);
res = hashtb_seek(e, np->name, strlen(np->name), 0);
-
+
+ assert(res == HT_NEW_ENTRY);
+
hnp = e->data;
hnp->name=(char *)malloc(np->length);
memcpy(hnp->name,np->name,np->length);
@@ -353,7 +355,7 @@
{
int res;
char *config_file;
- int daemon_mode;
+ //int daemon_mode;
struct ccn_charbuf *router_prefix;
init_nlsr();
@@ -363,7 +365,7 @@
switch (res)
{
case 'd':
- daemon_mode = 1;
+ //daemon_mode = 1;
break;
case 'f':
config_file = optarg;
diff --git a/nlsr_adl.c b/nlsr_adl.c
index 3b0b366..62aff9d 100644
--- a/nlsr_adl.c
+++ b/nlsr_adl.c
@@ -36,6 +36,8 @@
hashtb_start(nlsr->adl, e);
res = hashtb_seek(e, nbr->neighbor->name , nbr->neighbor->length, 0);
+
+ assert (res == HT_NEW_ENTRY);
hnbr = e->data;
@@ -91,7 +93,6 @@
printf("update_adjacent_status_to_adl called \n");
int res;
- char *name=ccn_charbuf_as_string(nbr);
struct ndn_neighbor *nnbr;
struct hashtb_enumerator ee;
@@ -99,11 +100,9 @@
hashtb_start(nlsr->adl, e);
res = hashtb_seek(e, nbr->buf, nbr->length, 0);
-
- //printf("Nbr: %s Length:%d\n",nbr->buf, (int)nbr->length);
- //assert( res == HT_OLD_ENTRY);
+ assert( res == HT_OLD_ENTRY);
nnbr=e->data;
nnbr->status=status;
@@ -118,18 +117,15 @@
printf("update_adjacent_status_to_adl called \n");
int res;
- char *name=ccn_charbuf_as_string(nbr);
struct ndn_neighbor *nnbr;
struct hashtb_enumerator ee;
struct hashtb_enumerator *e = ⅇ
hashtb_start(nlsr->adl, e);
- res = hashtb_seek(e, name,strlen(name) , 0);
+ res = hashtb_seek(e, nbr->buf, nbr->length, 0);
- //printf("Nbr: %s Length:%d\n",nbr->buf, (int)nbr->length);
-
- //assert( res == HT_OLD_ENTRY);
+ assert( res == HT_OLD_ENTRY);
nnbr=e->data;
memcpy(nnbr->last_lsdb_version,version,strlen(version)+1);
diff --git a/nlsr_ndn.c b/nlsr_ndn.c
index ab43697..55da173 100644
--- a/nlsr_ndn.c
+++ b/nlsr_ndn.c
@@ -174,6 +174,7 @@
int res;
res=ccn_name_comp_get(info->content_ccnb, info->content_comps,info->interest_comps->n-1,&comp_ptr1, &comp_size);
+ if ( res >=0)
printf("Received Database Version: %s \n",(char *)comp_ptr1);
}