Removing Warning Messages
diff --git a/nlsr.c b/nlsr.c
index 07b3175..04fb8cf 100644
--- a/nlsr.c
+++ b/nlsr.c
@@ -119,7 +119,7 @@
void
daemonize_nlsr(void)
{
- int ret;
+ //int ret;
pid_t process_id = 0;
pid_t sid = 0;
process_id = fork();
@@ -131,7 +131,7 @@
if (process_id > 0)
{
printf("Process daemonized. Process id: %d \n", process_id);
- ret=process_id;
+ //ret=process_id;
exit(0);
}
diff --git a/nlsr_lsdb.c b/nlsr_lsdb.c
index ac184da..1798700 100644
--- a/nlsr_lsdb.c
+++ b/nlsr_lsdb.c
@@ -949,7 +949,7 @@
char *rem;
char *rtr_id;
char *length;
- char *face;
+ //char *face;
char *metric;
if(no_link >0 )
@@ -970,7 +970,7 @@
{
rtr_id=strtok_r(NULL,sep,&rem);
length=strtok_r(NULL,sep,&rem);
- face=strtok_r(NULL,sep,&rem);
+ //face=strtok_r(NULL,sep,&rem);
metric=strtok_r(NULL,sep,&rem);
writeLogg(__FILE__,__FUNCTION__,__LINE__," Link %d \n",i+1);
writeLogg(__FILE__,__FUNCTION__,__LINE__," Adjacent Router: %s \n",rtr_id);
@@ -1013,7 +1013,7 @@
char *rem;
char *rtr_id;
char *length;
- char *face;
+ //char *face;
char *metric;
if(no_link >0 )
@@ -1035,7 +1035,7 @@
{
rtr_id=strtok_r(NULL,sep,&rem);
length=strtok_r(NULL,sep,&rem);
- face=strtok_r(NULL,sep,&rem);
+ //face=strtok_r(NULL,sep,&rem);
metric=strtok_r(NULL,sep,&rem);
printf(" Link %d \n",i+1);
printf(" Neighbor : %s \n",rtr_id);
diff --git a/nlsr_route.c b/nlsr_route.c
index b4f70a4..6b45ed2 100644
--- a/nlsr_route.c
+++ b/nlsr_route.c
@@ -563,6 +563,10 @@
//face=strtok_r(NULL,sep,&rem);
metric=strtok_r(NULL,sep,&rem);
+ if ( !nlsr->debugging && nlsr->debugging)
+ {
+ printf("Metric: %s Length:%s\n",metric,length);
+ }
add_map_entry(rtr_id);
for(i=1;i<no_link;i++)
@@ -571,6 +575,10 @@
length=strtok_r(NULL,sep,&rem);
//face=strtok_r(NULL,sep,&rem);
metric=strtok_r(NULL,sep,&rem);
+ if ( !nlsr->debugging && nlsr->debugging)
+ {
+ printf("Metric: %s Length:%s\n",metric,length);
+ }
add_map_entry(rtr_id);
@@ -723,6 +731,11 @@
length=strtok_r(NULL,sep,&rem);
//face=strtok_r(NULL,sep,&rem);
metric=strtok_r(NULL,sep,&rem);
+
+ if ( !nlsr->debugging && nlsr->debugging)
+ {
+ printf("Metric: %s Length:%s\n",metric,length);
+ }
mapping_nbr_router=get_mapping_no(rtr_id);
adj_matrix[mapping_orig_router][mapping_nbr_router]=atoi(metric);
@@ -734,6 +747,11 @@
//face=strtok_r(NULL,sep,&rem);
metric=strtok_r(NULL,sep,&rem);
+ if ( !nlsr->debugging && nlsr->debugging)
+ {
+ printf("Metric: %s Length:%s\n",metric,length);
+ }
+
mapping_nbr_router=get_mapping_no(rtr_id);
adj_matrix[mapping_orig_router][mapping_nbr_router]=atoi(metric);
@@ -970,6 +988,10 @@
length=strtok_r(NULL,sep,&rem);
//face=strtok_r(NULL,sep,&rem);
metric=strtok_r(NULL,sep,&rem);
+ if ( !nlsr->debugging && nlsr->debugging)
+ {
+ printf("Metric: %s Length:%s\n",metric,length);
+ }
add_next_hop_router(rtr_id);
@@ -980,6 +1002,10 @@
length=strtok_r(NULL,sep,&rem);
//face=strtok_r(NULL,sep,&rem);
metric=strtok_r(NULL,sep,&rem);
+ if ( !nlsr->debugging && nlsr->debugging)
+ {
+ printf("Metric: %s Length:%s\n",metric,length);
+ }
add_next_hop_router(rtr_id);
diff --git a/nlsr_sync.c b/nlsr_sync.c
index 75c8017..b798b57 100644
--- a/nlsr_sync.c
+++ b/nlsr_sync.c
@@ -164,7 +164,7 @@
- int res,i;
+ int i;
int lsa_position=0;
int len=0;
@@ -183,7 +183,7 @@
size_t comp_size;
for(i=lsa_position+1+offset;i<interest_comps->n-1;i++)
{
- res=ccn_name_comp_get(interest_ccnb->buf, interest_comps,i,&comp_ptr1, &comp_size);
+ ccn_name_comp_get(interest_ccnb->buf, interest_comps,i,&comp_ptr1, &comp_size);
len+=1;
len+=(int)comp_size;
}
@@ -194,7 +194,7 @@
for(i=lsa_position+1+offset; i<interest_comps->n-1;i++)
{
- res=ccn_name_comp_get(interest_ccnb->buf, interest_comps,i,&comp_ptr1, &comp_size);
+ ccn_name_comp_get(interest_ccnb->buf, interest_comps,i,&comp_ptr1, &comp_size);
memcpy(neighbor+strlen(neighbor),"/",1);
memcpy(neighbor+strlen(neighbor),(char *)comp_ptr1,strlen((char *)comp_ptr1));
@@ -457,7 +457,7 @@
process_content_from_sync(struct ccn_charbuf *content_name, struct ccn_indexbuf *components)
{
//int lsa_position;
- int res;
+ //int res;
size_t comp_size;
char *lst;
char *lsid;
@@ -493,20 +493,21 @@
//res=ccn_name_comp_get(content_name->buf, components,lsa_position+1,&lst, &comp_size);
- res=ccn_name_comp_get(content_name->buf, components,components->n-2-1,&second_last_comp, &comp_size);
+ ccn_name_comp_get(content_name->buf, components,components->n-2-1,&second_last_comp, &comp_size);
//ls_type=atoi((char *)lst);
-
- printf("2nd Last Component: %s \n",second_last_comp);
+ if (nlsr->debugging)
+ printf("2nd Last Component: %s \n",second_last_comp);
+
second_comp_type=strtok_r((char *)second_last_comp,sep,&rem);
if ( strcmp( second_comp_type, "lsId" ) == 0 )
{
lsid=rem;
ls_id=atoi(rem);
- res=ccn_name_comp_get(content_name->buf, components,components->n-2-2,&third_last_comp, &comp_size);
+ ccn_name_comp_get(content_name->buf, components,components->n-2-2,&third_last_comp, &comp_size);
lst=strtok_r((char *)third_last_comp,sep,&rem);
lst=rem;
ls_type=atoi(lst);
- res=ccn_name_comp_get(content_name->buf, components,components->n-2,&origtime, &comp_size);
+ ccn_name_comp_get(content_name->buf, components,components->n-2,&origtime, &comp_size);
ccn_name_chop(content_name,components,-3);
get_name_part(orig_router,content_name,components,0);
@@ -549,7 +550,7 @@
lst=rem;
if(ls_type == LS_TYPE_ADJ)
{
- res=ccn_name_comp_get(content_name->buf, components,components->n-2,&origtime, &comp_size);
+ ccn_name_comp_get(content_name->buf, components,components->n-2,&origtime, &comp_size);
ccn_name_chop(content_name,components,-2);
get_name_part(orig_router,content_name,components,0);
@@ -587,7 +588,7 @@
}
else if(ls_type == LS_TYPE_COR)
{
- res=ccn_name_comp_get(content_name->buf, components,components->n-2,&origtime, &comp_size);
+ ccn_name_comp_get(content_name->buf, components,components->n-2,&origtime, &comp_size);
ccn_name_chop(content_name,components,-2);
get_name_part(orig_router,content_name,components,0);