Update
diff --git a/nlsr_ndn.c b/nlsr_ndn.c
index e336e23..ab43697 100644
--- a/nlsr_ndn.c
+++ b/nlsr_ndn.c
@@ -256,6 +256,7 @@
for(i=0;i<nlsr_position;i++)
{
res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,i,&comp_ptr1, &comp_size);
+ //printf("%s \n",comp_ptr1);
ccn_charbuf_append_string(nbr,"/");
ccn_charbuf_append_string(nbr,(const char *)comp_ptr1);
}
@@ -352,20 +353,17 @@
/* Now comp points to the start of your potential number, and size is its length */
}
- int db_version=atoi((char *)comp);
- int dbcmp=db_version- nlsr->lsdb->version;
-
- //int dbcmp=strncmp(nlsr->lsdb->version,(char *)comp,16);
+ int dbcmp=strncmp(nlsr->lsdb->version,(char *)comp,16);
- //printf (" dbcmp = %d \n",dbcmp);
+ printf (" dbcmp = %d \n",dbcmp);
if(dbcmp > 0)
{
- printf("Has Updated database (Older: %s New: %ld)\n",comp,nlsr->lsdb->version);
+ printf("Has Updated database (Older: %s New: %s)\n",comp,nlsr->lsdb->version);
}
else
{
- printf("Data base is not updated than the older one (Older: %s New: %ld)\n",comp,nlsr->lsdb->version);
+ printf("Data base is not updated than the older one (Older: %s New: %s)\n",comp,nlsr->lsdb->version);
printf("Sending NACK Content back.....\n");
struct ccn_charbuf *data=ccn_charbuf_create();
@@ -432,12 +430,12 @@
for(i=0;i<adl_element;i++)
{
nbr=e->data;
- //printf("Sending interest for name prefix:%s/%s/%s\n",nbr->neighbor->name,nlsr_str,lsdb_str);
+ printf("Sending interest for name prefix:%s/%s/%s/%s\n",nbr->neighbor->name,nlsr_str,lsdb_str,rnumstr);
name=ccn_charbuf_create();
res=ccn_name_from_uri(name,nbr->neighbor->name);
ccn_name_append_str(name,nlsr_str);
ccn_name_append_str(name,lsdb_str);
- printf("Sending interest for name prefix:%s\n",ccn_name_as_string(name));
+ ccn_name_append_str(name,rnumstr);
/* adding Exclusion filter */
@@ -455,8 +453,7 @@
ccnb_tagged_putf(templ, CCN_DTAG_Any, "");
ccn_charbuf_reset(c);
//ccn_charbuf_putf(c, "%u", (unsigned)mynumber);
- //ccn_charbuf_putf(c, "%s", nbr->last_lsdb_version);
- ccn_charbuf_putf(c, "%ld", nbr->last_lsdb_version);
+ ccn_charbuf_putf(c, "%s", nbr->last_lsdb_version);
ccnb_append_tagged_blob(templ, CCN_DTAG_Component, c->buf, c->length);
ccn_charbuf_append_closer(templ); /* </Exclude> */
ccn_charbuf_append_closer(templ); /* </Interest> */