Cleaning NLSR (nlsr_ndn, nlsr_lsdb)
diff --git a/nlsr-sync-0.0/nlsr_adl.c b/nlsr-sync-0.0/nlsr_adl.c
index 3f271a1..042466a 100755
--- a/nlsr-sync-0.0/nlsr_adl.c
+++ b/nlsr-sync-0.0/nlsr_adl.c
@@ -318,23 +318,17 @@
hashtb_start(nlsr->adl, e);
- //printf("Neighbor: %s , Length: %d \n",nbr->name, nbr->length);
-
res = hashtb_seek(e, nbr->name, nbr->length, 0);
if( res == HT_OLD_ENTRY )
{
- //printf("Old Neighbor\n");
nnbr=e->data;
nnbr->lsdb_interest_timed_out += increment;
- //printf("lsdb_interest_timed_out: %d \n",nnbr->lsdb_interest_timed_out);
}
else if(res == HT_NEW_ENTRY)
{
hashtb_delete(e);
- }
-
- //print_adjacent_from_adl();
+ }
hashtb_end(e);
}
diff --git a/nlsr-sync-0.0/nlsr_lsdb.c b/nlsr-sync-0.0/nlsr_lsdb.c
index 70c6111..d7a3068 100755
--- a/nlsr-sync-0.0/nlsr_lsdb.c
+++ b/nlsr-sync-0.0/nlsr_lsdb.c
@@ -30,7 +30,6 @@
void
set_new_lsdb_version(void)
{
-//Obaid: this method needs to be modified, no need to free and allocate memory again
char *time_stamp=(char *)malloc(20);
memset(time_stamp,0,20);
get_current_timestamp_micro(time_stamp);
@@ -95,7 +94,6 @@
writeLogg(__FILE__,__FUNCTION__,__LINE__,"build_and_install_name_lsas called\n");
int i, npl_element;
- //struct name_prefix *np;
struct name_prefix_list_entry *npe;
struct hashtb_enumerator ee;
@@ -467,7 +465,6 @@
int check=add_npt_entry(new_name_lsa->header->orig_router->name,new_name_lsa->name_prefix->name,next_hop,faces,route_costs);
if ( check == HT_NEW_ENTRY )
{
- //printf("Added in npt \n");
if ( nlsr->debugging )
printf("Added in npt \n");
if ( nlsr->detailed_logging )
@@ -728,9 +725,6 @@
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);
@@ -749,9 +743,6 @@
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;
@@ -764,14 +755,6 @@
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++;
@@ -791,15 +774,11 @@
char *time_stamp=(char *)malloc(20);
memset(time_stamp,0,20);
get_current_timestamp_micro(time_stamp);
- //long int lsa_life_time=get_time_diff(time_stamp,adj_lsa->header->orig_time);
-
- //printf("time difference: %ld \n",lsa_life_time);
char *key=(char *)malloc(adj_lsa->header->orig_router->length+2+2);
memset(key,0,adj_lsa->header->orig_router->length+2);
make_adj_lsa_key(key,adj_lsa);
- //printf("Adjacent LSA key: %s \n",key);
struct alsa *new_adj_lsa=(struct alsa*)malloc(sizeof(struct alsa ));
@@ -879,8 +858,6 @@
if ( adj_lsa->no_link > 0)
{
- //new_adj_lsa = e->data;
-
writeLogg(__FILE__,__FUNCTION__,__LINE__," Adj-LSA\n");
writeLogg(__FILE__,__FUNCTION__,__LINE__," Deleting adj lsa\n");
write_log_for_adj_lsa(new_adj_lsa);
@@ -1111,7 +1088,6 @@
writeLogg(__FILE__,__FUNCTION__,__LINE__,"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);
@@ -1130,7 +1106,6 @@
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");
if ( nlsr->debugging )
printf("build_others_adj_lsa called \n");
if ( nlsr->detailed_logging )
@@ -1193,10 +1168,10 @@
return num_element;
}
+/*
void
get_name_lsdb_summary(struct ccn_charbuf *name_lsdb_data)
{
- //printf("get_name_lsdb_summary called \n");
if ( nlsr->debugging )
printf("get_name_lsdb_summary called \n");
if ( nlsr->detailed_logging )
@@ -1241,8 +1216,9 @@
hashtb_end(e);
}
+*/
-
+/*
void
get_adj_lsdb_summary(struct ccn_charbuf *adj_lsdb_data)
{
@@ -1281,8 +1257,9 @@
hashtb_end(e);
}
+*/
-
+/*
void
get_lsdb_summary(struct ccn_charbuf *lsdb_data)
{
@@ -1317,6 +1294,7 @@
free(num_element);
}
+*/
int
check_is_new_name_lsa(char *orig_router,char *lst,char *lsid,char *orig_time)
@@ -1403,7 +1381,6 @@
void
get_name_lsa_data(struct ccn_charbuf *lsa_data, struct name_prefix *lsaId)
{
- //printf("get_name_lsa_data called \n");
if ( nlsr->debugging )
printf("get_name_lsa_data called \n");
if ( nlsr->detailed_logging )
@@ -1619,8 +1596,7 @@
int
delete_name_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
{
- //printf("delete_name_lsa called \n");
-
+
if ( nlsr->debugging )
printf("delete_name_lsa called \n");
if ( nlsr->detailed_logging )
@@ -1680,8 +1656,6 @@
if ( nlsr->detailed_logging )
writeLogg(__FILE__,__FUNCTION__,__LINE__,"New Version Number of LSDB: %s \n",nlsr->lsdb->lsdb_version);
- //print_name_lsdb();
-
nlsr_unlock();
return 0;
@@ -1690,8 +1664,6 @@
int
delete_adj_lsa(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
{
- //printf("delete_adj_lsa called \n");
-
if ( nlsr->debugging )
printf("delete_adj_lsa called \n");
if ( nlsr->detailed_logging )
@@ -1703,8 +1675,6 @@
}
nlsr_lock();
- //printf("LSA Key: %s \n",(char *)ev->evdata);
-
if ( nlsr->debugging )
printf("LSA Key: %s \n",(char *)ev->evdata);
if ( nlsr->detailed_logging )
@@ -1753,8 +1723,6 @@
nlsr->is_route_calculation_scheduled=1;
}
- //print_adj_lsdb();
-
nlsr_unlock();
return 0;
@@ -1763,15 +1731,11 @@
void
refresh_name_lsdb(void)
{
- //printf("refresh_name_lsdb called \n");
-
if ( nlsr->debugging )
printf("refresh_name_lsdb called \n");
if ( nlsr->detailed_logging )
writeLogg(__FILE__,__FUNCTION__,__LINE__,"refresh_name_lsdb called \n");
- //int lsa_change_count=0;
-
char *time_stamp=(char *)malloc(20);
memset(time_stamp,0,20);
get_current_timestamp_micro(time_stamp);
@@ -1846,7 +1810,6 @@
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));
nlsr->event = ccn_schedule_event(nlsr->sched, 10, &delete_name_lsa, (void *)key, 0);
}
@@ -1866,7 +1829,6 @@
print_name_lsdb();
- //lsa_change_count++;
}
}
else
@@ -1892,10 +1854,8 @@
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));
nlsr->event = ccn_schedule_event(nlsr->sched, 10, &delete_name_lsa, (void *)key, 0);
- //lsa_change_count++;
}
}
@@ -1912,7 +1872,6 @@
void
refresh_adj_lsdb(void)
{
- //printf("refresh_adj_lsdb called \n");
if ( nlsr->debugging )
printf("refresh_adj_lsdb called \n");
@@ -1938,8 +1897,7 @@
{
adj_lsa=e->data;
- lsa_life_time=get_time_diff(time_stamp,adj_lsa->header->orig_time);
- //printf("LSA Life Time: %ld \n",lsa_life_time);
+ lsa_life_time=get_time_diff(time_stamp,adj_lsa->header->orig_time);
if ( nlsr->debugging )
printf("LSA Life Time: %ld \n",lsa_life_time);
@@ -1950,7 +1908,6 @@
{
if ( lsa_life_time > nlsr->lsa_refresh_time )
{
- //printf("Own Adj LSA need to be refrshed\n");
if ( nlsr->debugging )
printf("Own Adj LSA need to be refrshed\n");
if ( nlsr->detailed_logging )
@@ -1996,7 +1953,6 @@
{
if ( lsa_life_time > nlsr->router_dead_interval )
{
- //printf("Others Adj LSA need to be deleted\n");
if ( nlsr->debugging )
printf("Others Adj LSA need to be deleted\n");
@@ -2006,7 +1962,7 @@
char *key=(char *)malloc(adj_lsa->header->orig_router->length+2+2);
memset(key,0,adj_lsa->header->orig_router->length+2);
make_adj_lsa_key(key,adj_lsa);
- //printf("Adjacent LSA key: %s \n",key);
+
nlsr->event = ccn_schedule_event(nlsr->sched, 10, &delete_adj_lsa, (void *)key, 0);
}
}
@@ -2031,8 +1987,6 @@
nlsr_lock();
- //printf("refresh_lsdb called \n");
-
if ( nlsr->debugging )
printf("refresh_lsdb called\n");
if ( nlsr->detailed_logging )
diff --git a/nlsr-sync-0.0/nlsr_lsdb.h b/nlsr-sync-0.0/nlsr_lsdb.h
index 32972d9..8944802 100755
--- a/nlsr-sync-0.0/nlsr_lsdb.h
+++ b/nlsr-sync-0.0/nlsr_lsdb.h
@@ -72,10 +72,6 @@
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);
diff --git a/nlsr-sync-0.0/nlsr_ndn.c b/nlsr-sync-0.0/nlsr_ndn.c
index 5e5c082..a98c0aa 100755
--- a/nlsr-sync-0.0/nlsr_ndn.c
+++ b/nlsr-sync-0.0/nlsr_ndn.c
@@ -275,20 +275,12 @@
res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,nlsr_position+1,&comp_ptr1, &comp_size);
- //printf("Det= %s \n",comp_ptr1);
if(!strcmp((char *)comp_ptr1,"info"))
{
process_incoming_interest_info(selfp,info);
}
- if(!strcmp((char *)comp_ptr1,"lsdb"))
- {
- process_incoming_interest_lsdb(selfp,info);
- }
- if(!strcmp((char *)comp_ptr1,"lsa"))
- {
- process_incoming_interest_lsa(selfp,info);
- }
+
}
void
@@ -373,264 +365,6 @@
}
-void
-process_incoming_interest_lsdb(struct ccn_closure *selfp, struct ccn_upcall_info *info)
-{
- //printf("process_incoming_interest_lsdb called \n");
-
- if ( nlsr->debugging )
- printf("process_incoming_interest_lsdb called \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"process_incoming_interest_lsdb called \n");
-
-
- int l,res;
- const unsigned char *exclbase;
- size_t size;
- struct ccn_buf_decoder decoder;
- struct ccn_buf_decoder *d;
- const unsigned char *comp;
- int dbcmp=0;
-
- l = info->pi->offset[CCN_PI_E_Exclude] - info->pi->offset[CCN_PI_B_Exclude];
- if (l > 0)
- {
- comp = NULL;
- size = 0;
- exclbase = info->interest_ccnb + info->pi->offset[CCN_PI_B_Exclude];
- d = ccn_buf_decoder_start(&decoder, exclbase, l);
- if (ccn_buf_match_dtag(d, CCN_DTAG_Exclude))
- {
- ccn_buf_advance(d);
- if (ccn_buf_match_dtag(d, CCN_DTAG_Any))
- ccn_buf_advance_past_element(d);
- if (ccn_buf_match_dtag(d, CCN_DTAG_Component))
- {
- ccn_buf_advance(d);
- ccn_buf_match_blob(d, &comp, &size);
- ccn_buf_check_close(d);
-
-
- }
- ccn_buf_check_close(d);
- }
- if (comp != NULL)
- {
- if ( nlsr->debugging )
- {
- printf("LSDB Version in Exclusion Filter is %s\n",comp);
- printf("LSDB Version of own NLSR is: %s \n",nlsr->lsdb->lsdb_version);
- }
- if ( nlsr->detailed_logging )
- {
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"LSDB Version in Exclusion Filter is %s\n",comp);
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"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 */
- }
- else
- {
- if ( nlsr->debugging )
- printf("LSDB Version in Exclusion Filter is: None Added\n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"LSDB Version in Exclusion Filter is: None Added\n");
- dbcmp=1;
-
- }
-
- struct ccn_charbuf *data=ccn_charbuf_create();
- struct ccn_charbuf *name=ccn_charbuf_create();
- struct ccn_signing_params sp=CCN_SIGNING_PARAMS_INIT;
-
- ccn_charbuf_append(name, info->interest_ccnb + info->pi->offset[CCN_PI_B_Name],info->pi->offset[CCN_PI_E_Name] - info->pi->offset[CCN_PI_B_Name]);
-
- sp.template_ccnb=ccn_charbuf_create();
- ccn_charbuf_append_tt(sp.template_ccnb,CCN_DTAG_SignedInfo, CCN_DTAG);
- ccnb_tagged_putf(sp.template_ccnb, CCN_DTAG_FreshnessSeconds, "%ld", 10);
- sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;
- ccn_charbuf_append_closer(sp.template_ccnb);
-
-
- if(dbcmp>0)
- {
- if ( nlsr->debugging )
- {
- printf("Has Updated Database than Neighbor\n");
- printf("Sending LSDB Summary of Updated LSDB Content...\n");
- }
- if ( nlsr->detailed_logging )
- {
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Has Updated Database than Neighbor\n");
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Sending LSDB Summary of Updated LSDB Content...\n");
- }
- ccn_name_append_str(name,nlsr->lsdb->lsdb_version);
-
- struct ccn_charbuf *lsdb_data=ccn_charbuf_create();
- get_lsdb_summary(lsdb_data);
-
- char *raw_data=ccn_charbuf_as_string(lsdb_data);
-
- //printf("Content Data to be sent: %s \n",raw_data);
-
- if( nlsr->is_build_adj_lsa_sheduled == 1 || strlen((char *)raw_data) == 0 )
- {
- res= ccn_sign_content(nlsr->ccn, data, name, &sp, "WAIT" , strlen("WAIT"));
- }
- else
- {
- res= ccn_sign_content(nlsr->ccn, data, name, &sp, raw_data , strlen(raw_data));
- }
-
- if(res >= 0)
- {
- if ( nlsr->debugging )
- printf("Signing LSDB Summary of Updated LSDB Content is successful \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Signing LSDB Summary of Updated LSDB Content is successful \n");
- }
-
- res=ccn_put(nlsr->ccn,data->buf,data->length);
-
- if(res >= 0)
- {
- if ( nlsr->debugging )
- printf("Sending LSDB Summary of Updated LSDB Content is successful \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Sending LSDB Summary of Updated LSDB Content is successful \n");
- }
-
- ccn_charbuf_destroy(&lsdb_data);
- }
- else
- {
- if ( nlsr->debugging )
- {
- printf("Does not have Updated Database than Neighbor\n");
- printf("Sending NACK Content.....\n");
- }
- if ( nlsr->detailed_logging )
- {
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Does not have Updated Database than Neighbor\n");
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Sending NACK Content.....\n");
- }
-
- res= ccn_sign_content(nlsr->ccn, data, name, &sp, "NACK", strlen("NACK"));
-
- if(res >= 0)
- {
- if ( nlsr->debugging )
- printf("Signing NACK Content is successful \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Signing NACK Content is successful \n");
- }
-
- res=ccn_put(nlsr->ccn,data->buf,data->length);
-
- if(res >= 0)
- {
- if ( nlsr->debugging )
- printf("Sending NACK Content is successful \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Sending NACK Content is successful \n");
- }
-
-
- }
-
- ccn_charbuf_destroy(&data);
- ccn_charbuf_destroy(&name);
- ccn_charbuf_destroy(&sp.template_ccnb);
-
-
-}
-
-
-void
-process_incoming_interest_lsa(struct ccn_closure *selfp, struct ccn_upcall_info *info)
-{
- if ( nlsr->debugging )
- printf("process_incoming_interest_lsa called \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"process_incoming_interest_lsa called \n");
-
- int res;
-
- struct name_prefix *lsaId=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
- get_lsa_identifier(lsaId,selfp,info,0);
-
- //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 == LS_TYPE_NAME )
- {
- if ( nlsr->debugging )
- printf("Interest Received for NAME LSA \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Interest Received for NAME LSA \n");
- get_name_lsa_data(lsa_data,lsaId);
- }
- else if ( ls_type == LS_TYPE_ADJ )
- {
- if ( nlsr->debugging )
- printf("Interest Received for ADJ LSA \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Interest Received for ADJ LSA \n");
- get_adj_lsa_data(lsa_data,lsaId);
- }
-
- char *rdata=ccn_charbuf_as_string(lsa_data);
- char *raw_data=(char *)malloc(strlen(rdata)+1);
- memset(raw_data,0,strlen(rdata)+1);
- memcpy(raw_data,(char *)rdata,strlen(rdata)+1);
- //printf("Content Data to be sent: %s\n",raw_data);
-
- struct ccn_charbuf *data=ccn_charbuf_create();
- struct ccn_charbuf *name=ccn_charbuf_create();
- struct ccn_signing_params sp=CCN_SIGNING_PARAMS_INIT;
-
- ccn_charbuf_append(name, info->interest_ccnb + info->pi->offset[CCN_PI_B_Name],info->pi->offset[CCN_PI_E_Name] - info->pi->offset[CCN_PI_B_Name]);
-
- sp.template_ccnb=ccn_charbuf_create();
- ccn_charbuf_append_tt(sp.template_ccnb,CCN_DTAG_SignedInfo, CCN_DTAG);
- ccnb_tagged_putf(sp.template_ccnb, CCN_DTAG_FreshnessSeconds, "%ld", 10);
- sp.sp_flags |= CCN_SP_TEMPL_FRESHNESS;
- ccn_charbuf_append_closer(sp.template_ccnb);
-
- res= ccn_sign_content(nlsr->ccn, data, name, &sp, raw_data , strlen(raw_data));
-
- if(res >= 0)
- {
- if ( nlsr->debugging )
- printf("Signing LSA Content is successful \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Signing LSA Content is successful \n");
- }
-
- res=ccn_put(nlsr->ccn,data->buf,data->length);
-
- if(res >= 0)
- {
- if ( nlsr->debugging )
- printf("Sending LSA Content is successful \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Sending LSA Content is successful \n");
- }
-
-
-
- ccn_charbuf_destroy(&data);
- ccn_charbuf_destroy(&name);
- ccn_charbuf_destroy(&sp.template_ccnb);
- ccn_charbuf_destroy(&lsa_data);
-
- free(raw_data);
- free(lsaId);
-}
-
/* Call back function registered in ccnd to get all content coming to NLSR application */
enum ccn_upcall_res incoming_content(struct ccn_closure* selfp,
@@ -701,7 +435,6 @@
void
process_incoming_content(struct ccn_closure *selfp, struct ccn_upcall_info* info)
{
- //printf("process_incoming_content called \n");
if ( nlsr->debugging )
printf("process_incoming_content called \n");
if ( nlsr->detailed_logging )
@@ -725,20 +458,11 @@
res=ccn_name_comp_get(info->interest_ccnb, info->interest_comps,nlsr_position+1,&comp_ptr1, &comp_size);
- //printf("Det= %s \n",comp_ptr1);
if(!strcmp((char *)comp_ptr1,"info"))
{
process_incoming_content_info(selfp,info);
}
- /*if(!strcmp((char *)comp_ptr1,"lsdb"))
- {
- process_incoming_content_lsdb(selfp,info);
- }
- if(!strcmp((char *)comp_ptr1,"lsa"))
- {
- process_incoming_content_lsa(selfp,info);
- }*/
}
@@ -746,7 +470,6 @@
void
process_incoming_content_info(struct ccn_closure *selfp, struct ccn_upcall_info* info)
{
- //printf("process_incoming_content_info called \n");
if ( nlsr->debugging )
printf("process_incoming_content_info called \n");
if ( nlsr->detailed_logging )
@@ -764,7 +487,6 @@
const unsigned char *ptr;
size_t length;
ccn_content_get_value(info->content_ccnb, info->pco->offset[CCN_PCO_E_Content]-info->pco->offset[CCN_PCO_B_Content], info->pco, &ptr, &length);
- //printf("Content data: %s\n",ptr);
long int interval=atoi((char *)ptr);
@@ -801,257 +523,6 @@
}
-void
-process_incoming_content_lsdb(struct ccn_closure *selfp, struct ccn_upcall_info* info)
-{
- if ( nlsr->debugging )
- printf("process_incoming_content_lsdb called \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"process_incoming_content_lsdb called \n");
-
- const unsigned char *ptr;
- size_t length;
- ccn_content_get_value(info->content_ccnb, info->pco->offset[CCN_PCO_E_Content]-info->pco->offset[CCN_PCO_B_Content], info->pco, &ptr, &length);
- //printf("Content data: %s\n",ptr);
-
- if( (strcmp("NACK",(char *)ptr) != 0 ) && (strcmp("WAIT",(char *)ptr) != 0 ) )
- {
- struct name_prefix *nbr=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
- get_nbr(nbr,selfp,info);
-
- char *nl;
- int num_element;
- int i;
- char *rem;
- const char *sep="|";
- char *orig_router;
- char *lst;
- int ls_type;
- char *lsid;
- long int ls_id;
- char *orig_time;
-
- nl=strtok_r((char *)ptr,sep,&rem);
- num_element=atoi(nl);
-
- for(i = 0 ; i < num_element ; i++)
- {
- orig_router=strtok_r(NULL,sep,&rem);
- lst=strtok_r(NULL,sep,&rem);
- ls_type=atoi(lst);
-
- if ( nlsr->debugging )
- printf("Orig Router: %s ls Type: %d",orig_router,ls_type);
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Orig Router: %s ls Type: %d",orig_router,ls_type);
-
-
- if(ls_type == LS_TYPE_NAME)
- {
- lsid=strtok_r(NULL,sep,&rem);
- ls_id=atoi(lsid);
- orig_time=strtok_r(NULL,sep,&rem);
-
- if ( nlsr->debugging )
- printf(" LS Id: %ld Orig Time: %s\n",ls_id ,orig_time);
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__," 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 )
- {
- if ( nlsr->debugging )
- printf("New NAME LSA.....\n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"New NAME LSA.....\n");
-
- send_interest_for_name_lsa(nbr,orig_router,lst,lsid);
- }
- else
- {
- if ( nlsr->debugging )
- printf("Name LSA already exists in LSDB\n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Name LSA already exists in LSDB\n");
-
- }
- }
- else
- {
- orig_time=strtok_r(NULL,sep,&rem);
-
- if ( nlsr->debugging )
- printf(" Orig Time: %s\n",orig_time);
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__," 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 )
- {
- if ( nlsr->debugging )
- printf("New Adj LSA.....\n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"New Adj LSA.....\n");
- send_interest_for_adj_lsa(nbr,orig_router,lst);
- }
- else
- {
- if ( nlsr->debugging )
- printf("Adj LSA already exists in LSDB\n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Adj LSA already exists in LSDB\n");
- }
- }
-
- }
-
- char *lsdb_version=(char *)malloc(20);
- memset(lsdb_version,0,20);
- get_lsdb_version(lsdb_version,selfp,info);
-
- if ( nlsr->debugging )
- printf("Old LSDB Version of Neighbor: %s is :%s\n",nbr->name,get_nbr_lsdb_version(nbr->name));
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Old LSDB Version of Neighbor: %s is :%s\n",nbr->name,get_nbr_lsdb_version(nbr->name));
-
- update_adjacent_lsdb_version_to_adl(nbr,lsdb_version);
-
- if ( nlsr->debugging )
- printf("New LSDB Version of Neighbor: %s is :%s\n",nbr->name,get_nbr_lsdb_version(nbr->name));
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"New LSDB Version of Neighbor: %s is :%s\n",nbr->name,get_nbr_lsdb_version(nbr->name));
-
- update_lsdb_interest_timed_out_zero_to_adl(nbr);
-
- free(lsdb_version);
- free(nbr);
- }
- else if (strcmp("WAIT",(char *)ptr) == 0)
- {
- struct name_prefix *nbr=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
- get_nbr(nbr,selfp,info);
- long int interval=get_lsdb_synch_interval(nbr->name);
- adjust_adjacent_last_lsdb_requested_to_adl(nbr->name,(long int)interval/2);
-
- update_lsdb_interest_timed_out_zero_to_adl(nbr);
- free(nbr);
- }
- else
- {
-
- if ( nlsr->debugging )
- printf("NACK Content Received\n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"NACK Content Received\n");
- struct name_prefix *nbr=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
- get_nbr(nbr,selfp,info);
- update_lsdb_interest_timed_out_zero_to_adl(nbr);
- free(nbr);
- }
-}
-
-
-void
-process_incoming_content_lsa(struct ccn_closure *selfp, struct ccn_upcall_info* info)
-{
-
-
- if ( nlsr->debugging )
- printf("process_incoming_content_lsa called \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"process_incoming_content_lsa called \n");
-
- char *sep="|";
- char *rem;
- char *orig_router;
- char *orl;
- int orig_router_length;
- char *lst;
- int ls_type;
- char *lsid;
- long int ls_id;
- char *isvld;
- int isValid;
- char *num_link;
- int no_link;
- char *np;
- char *np_length;
- int name_length;
- char *data;
- char *orig_time;
-
- const unsigned char *ptr;
- size_t length;
- ccn_content_get_value(info->content_ccnb, info->pco->offset[CCN_PCO_E_Content]-info->pco->offset[CCN_PCO_B_Content], info->pco, &ptr, &length);
- //printf("Content data Received: %s\n",ptr);
-
-
-
-
- if ( nlsr->debugging )
- printf("LSA Data \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"LSA Data\n");
-
- if( strlen((char *) ptr ) > 0 )
- {
-
- orig_router=strtok_r((char *)ptr,sep,&rem);
- orl=strtok_r(NULL,sep,&rem);
- orig_router_length=atoi(orl);
-
- if ( nlsr->debugging )
- {
- printf(" Orig Router Name : %s\n",orig_router);
- printf(" Orig Router Length: %d\n",orig_router_length);
- }
-
- lst=strtok_r(NULL,sep,&rem);
- ls_type=atoi(lst);
-
- if ( nlsr->debugging )
- printf(" LS Type : %d\n",ls_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);
- if ( nlsr->debugging )
- {
- 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,orig_time,isValid,np);
-
- }
- else if ( ls_type == LS_TYPE_ADJ )
- {
- orig_time=strtok_r(NULL,sep,&rem);
- num_link=strtok_r(NULL,sep,&rem);
- no_link=atoi(num_link);
- data=rem;
-
- if ( nlsr->debugging )
- {
- printf(" No Link : %d\n",no_link);
- printf(" Data : %s\n",data);
- }
- build_and_install_others_adj_lsa(orig_router,ls_type,orig_time,no_link,data);
- }
- }
-}
void
@@ -1082,14 +553,6 @@
{
process_incoming_timed_out_interest_info(selfp,info);
}
- if(ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,nlsr_position+1,"lsdb") == 0)
- {
- process_incoming_timed_out_interest_lsdb(selfp,info);
- }
- if(ccn_name_comp_strcmp(info->interest_ccnb,info->interest_comps,nlsr_position+1,"lsa") == 0)
- {
- process_incoming_timed_out_interest_lsa(selfp,info);
- }
}
void
@@ -1140,56 +603,6 @@
}
-void
-process_incoming_timed_out_interest_lsdb(struct ccn_closure* selfp, struct ccn_upcall_info* info)
-{
- if ( nlsr->debugging )
- printf("process_incoming_timed_out_interest_lsdb called \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"process_incoming_timed_out_interest_lsdb called \n");
-
- struct name_prefix *nbr=(struct name_prefix *)malloc(sizeof(struct name_prefix ));
- get_nbr(nbr,selfp,info);
-
- if ( nlsr->debugging )
- printf("LSDB Interest Timed Out for for Neighbor: %s Length:%d\n",nbr->name,nbr->length);
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"LSDB Interest Timed Out for for Neighbor: %s Length:%d\n",nbr->name,nbr->length);
-
-
- update_lsdb_interest_timed_out_to_adl(nbr,1);
-
- int interst_timed_out_num=get_lsdb_interest_timed_out_number(nbr);
-
- if ( nlsr->debugging )
- printf("Interest Timed out number : %d Interest Retry: %d \n",interst_timed_out_num,nlsr->interest_retry);
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Interest Timed out number : %d Interest Retry: %d \n",interst_timed_out_num,nlsr->interest_retry);
-
-
-
- if( interst_timed_out_num >= nlsr->interest_retry )
- {
- update_adjacent_status_to_adl(nbr,NBR_DOWN);
- if(!nlsr->is_build_adj_lsa_sheduled)
- {
- nlsr->event_build_adj_lsa = ccn_schedule_event(nlsr->sched, 1000, &build_and_install_adj_lsa, NULL, 0);
- nlsr->is_build_adj_lsa_sheduled=1;
- }
- }
- free(nbr->name);
- free(nbr);
-}
-
-void
-process_incoming_timed_out_interest_lsa(struct ccn_closure* selfp, struct ccn_upcall_info* info)
-{
- if ( nlsr->debugging )
- printf("process_incoming_timed_out_interest_lsa called \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"process_incoming_timed_out_interest_lsa called \n");
-
-}
int
send_info_interest(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
@@ -1308,306 +721,3 @@
free(int_name);
}
-
-
-int
-send_lsdb_interest(struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
-{
- if ( nlsr->debugging )
- printf("send_lsdb_interest called \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"send_lsdb_interest called \n");
-
- if(flags == CCN_SCHEDULE_CANCEL)
- {
- return -1;
- }
-
- nlsr_lock();
-
- int i, adl_element;
- struct ndn_neighbor *nbr;
-
- struct hashtb_enumerator ee;
- struct hashtb_enumerator *e = ⅇ
-
- hashtb_start(nlsr->adl, e);
- adl_element=hashtb_n(nlsr->adl);
-
- for(i=0;i<adl_element;i++)
- {
- nbr=e->data;
-
- if(nbr->status == NBR_ACTIVE)
- {
- if(nbr->is_lsdb_send_interest_scheduled == 0)
- {
- long int time_diff=get_nbr_time_diff_lsdb_req(nbr->neighbor->name);
- if ( nlsr->debugging )
- printf("Time since last time LSDB requested : %ld Seconds for Neighbor: %s \n",time_diff,nbr->neighbor->name);
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Time since last time LSDB requested : %ld Seconds for Neighbor: %s \n",time_diff,nbr->neighbor->name);
-
-
- if( time_diff >= ( get_lsdb_synch_interval(nbr->neighbor->name) + get_nbr_random_time_component(nbr->neighbor->name) ) )
- {
- nbr->is_lsdb_send_interest_scheduled=1;
- send_lsdb_interest_to_nbr(nbr->neighbor);
- }
- }
- }
- hashtb_next(e);
- }
-
- hashtb_end(e);
- nlsr->event_send_lsdb_interest= ccn_schedule_event(nlsr->sched, 30000000, &send_lsdb_interest, NULL, 0);
-
- nlsr_unlock();
-
- return 0;
-}
-
-void
-send_lsdb_interest_to_nbr(struct name_prefix *nbr)
-{
- if ( nlsr->debugging )
- printf("send_lsdb_interest_to_nbr called \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"send_lsdb_interest_to_nbr called \n");
-
- char *last_lsdb_version=get_nbr_lsdb_version(nbr->name);
-
- if(last_lsdb_version !=NULL)
- {
-
-
- if ( nlsr->debugging )
- printf("Last LSDB Version: %s \n",last_lsdb_version);
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Last LSDB Version: %s \n",last_lsdb_version);
-
- struct ccn_charbuf *name;
- int res;
- char lsdb_str[5];
- char nlsr_str[5];
-
- memset(&nlsr_str,0,5);
- sprintf(nlsr_str,"nlsr");
- memset(&lsdb_str,0,5);
- sprintf(lsdb_str,"lsdb");
- //make and send interest with exclusion filter as last_lsdb_version
- if ( nlsr->debugging )
- printf("Sending interest for name prefix:%s/%s/%s\n",nbr->name,nlsr_str,lsdb_str);
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Sending interest for name prefix:%s/%s/%s\n",nbr->name,nlsr_str,lsdb_str);
-
- name=ccn_charbuf_create();
- res=ccn_name_from_uri(name,nbr->name);
-
- if( res >= 0)
- {
- ccn_name_append_str(name,nlsr_str);
- ccn_name_append_str(name,lsdb_str);
- /* adding Exclusion filter */
-
- struct ccn_charbuf *templ;
- templ = ccn_charbuf_create();
-
- struct ccn_charbuf *c;
- c = ccn_charbuf_create();
-
-
- ccn_charbuf_append_tt(templ, CCN_DTAG_Interest, CCN_DTAG);
- ccn_charbuf_append_tt(templ, CCN_DTAG_Name, CCN_DTAG);
- ccn_charbuf_append_closer(templ); /* </Name> */
- ccn_charbuf_append_tt(templ, CCN_DTAG_Exclude, CCN_DTAG);
- ccnb_tagged_putf(templ, CCN_DTAG_Any, "");
- ccn_charbuf_reset(c);
- ccn_charbuf_putf(c, "%s", last_lsdb_version);
-
- 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 )
- {
- if ( nlsr->debugging )
- printf("Interest sending Successfull .... \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Interest sending Successfull .... \n");
- update_adjacent_last_lsdb_requested_to_adl(nbr->name,get_current_time_sec());
-
- }
- ccn_charbuf_destroy(&c);
- ccn_charbuf_destroy(&templ);
- }
- ccn_charbuf_destroy(&name);
- }
- set_is_lsdb_send_interest_scheduled_to_zero(nbr->name);
-}
-
-void
-send_interest_for_name_lsa(struct name_prefix *nbr, char *orig_router, char *ls_type, char *ls_id)
-{
- if ( nlsr->debugging )
- printf("send_interest_for_name_lsa called\n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"send_interest_for_name_lsa called\n");
-
- int res;
- char lsa_str[5];
- char nlsr_str[5];
-
- 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(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();
-
-
- res=ccn_name_from_uri(name,int_name);
- ccn_name_append_str(name,ls_type);
- ccn_name_append_str(name,ls_id);
-
-
- /* adding InterestLifeTime and InterestScope filter */
-
- struct ccn_charbuf *templ;
- templ = ccn_charbuf_create();
-
- ccn_charbuf_append_tt(templ, CCN_DTAG_Interest, CCN_DTAG);
- ccn_charbuf_append_tt(templ, CCN_DTAG_Name, CCN_DTAG);
- ccn_charbuf_append_closer(templ); /* </Name> */
- //ccnb_tagged_putf(templ, CCN_DTAG_Scope, "%d", scope);
- ccn_charbuf_append_tt(templ, CCN_DTAG_Scope, CCN_DTAG);
- ccn_charbuf_append_tt(templ, 1, CCN_UDATA);
- ccn_charbuf_append(templ, "2", 1); //scope of interest: 2 (not further than next host)
- ccn_charbuf_append_closer(templ); /* </Scope> */
-
- appendLifetime(templ,nlsr->interest_resend_time);
- ccn_charbuf_append_closer(templ); /* </Interest> */
- /* Adding InterestLifeTime and InterestScope filter done */
-
- if ( nlsr->debugging )
- printf("Sending NAME LSA interest on name prefix : %s/%s/%s\n",int_name,ls_type,ls_id);
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"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);
-
- if ( res >= 0 )
- {
- if ( nlsr->debugging )
- printf("NAME LSA interest sending Successfull .... \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"NAME LSA interest sending Successfull .... \n");
-
- }
- ccn_charbuf_destroy(&templ);
- ccn_charbuf_destroy(&name);
- free(int_name);
-
-
-}
-
-void
-send_interest_for_adj_lsa(struct name_prefix *nbr, char *orig_router, char *ls_type)
-{
- if ( nlsr->debugging )
- printf("send_interest_for_name_lsa called\n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"send_interest_for_name_lsa called\n");
-
- int res;
- char lsa_str[5];
- char nlsr_str[5];
-
- 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(ls_type)+strlen(orig_router)+strlen(nlsr_str)+strlen(lsa_str)+3+strlen(ls_type)+1);
- memset(int_name,0,nbr->length +strlen(ls_type)+ strlen(orig_router)+strlen(nlsr_str)+strlen(lsa_str)+3+strlen(ls_type)+1);
-
- 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));
- memcpy(int_name+strlen(int_name),"/",1);
- memcpy(int_name+strlen(int_name),ls_type,strlen(ls_type));
-
- struct ccn_charbuf *name;
- name=ccn_charbuf_create();
-
-
- ccn_name_from_uri(name,int_name);
-
- /* adding InterestLifeTime and InterestScope filter */
-
- struct ccn_charbuf *templ;
- templ = ccn_charbuf_create();
-
- ccn_charbuf_append_tt(templ, CCN_DTAG_Interest, CCN_DTAG);
- ccn_charbuf_append_tt(templ, CCN_DTAG_Name, CCN_DTAG);
- ccn_charbuf_append_closer(templ); /* </Name> */
- ccn_charbuf_append_tt(templ, CCN_DTAG_Scope, CCN_DTAG);
- ccn_charbuf_append_tt(templ, 1, CCN_UDATA);
- ccn_charbuf_append(templ, "2", 1); //scope of interest: 2 (not further than next host)
- ccn_charbuf_append_closer(templ); /* </Scope> */
-
- appendLifetime(templ,nlsr->interest_resend_time);
- ccn_charbuf_append_closer(templ); /* </Interest> */
- /* Adding InterestLifeTime and InterestScope filter done */
-
- if ( nlsr->debugging )
- printf("Sending ADJ LSA interest on name prefix : %s\n",int_name);
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"Sending ADJ LSA interest on name prefix : %s\n",int_name);
-
- res=ccn_express_interest(nlsr->ccn,name,&(nlsr->in_content),templ);
-
- if ( res >= 0 )
- {
- if ( nlsr->debugging )
- printf("ADJ LSA interest sending Successfull .... \n");
- if ( nlsr->detailed_logging )
- writeLogg(__FILE__,__FUNCTION__,__LINE__,"ADJ LSA interest sending Successfull .... \n");
- }
-
- ccn_charbuf_destroy(&templ);
- ccn_charbuf_destroy(&name);
- free(int_name);
-}
diff --git a/nlsr-sync-0.0/nlsr_ndn.h b/nlsr-sync-0.0/nlsr_ndn.h
index 1feab1e..1e34284 100755
--- a/nlsr-sync-0.0/nlsr_ndn.h
+++ b/nlsr-sync-0.0/nlsr_ndn.h
@@ -7,31 +7,19 @@
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);
-
+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);
void process_incoming_content(struct ccn_closure *selfp, struct ccn_upcall_info* info);
void process_incoming_content_info(struct ccn_closure *selfp, struct ccn_upcall_info* info);
-void process_incoming_content_lsdb(struct ccn_closure *selfp, struct ccn_upcall_info* info);
-void process_incoming_content_lsa(struct ccn_closure *selfp, struct ccn_upcall_info* info);
void process_incoming_timed_out_interest(struct ccn_closure* selfp, struct ccn_upcall_info* info);
void process_incoming_timed_out_interest_info(struct ccn_closure* selfp, struct ccn_upcall_info* info);
-void process_incoming_timed_out_interest_lsdb(struct ccn_closure* selfp, struct ccn_upcall_info* info);
-void process_incoming_timed_out_interest_lsa(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