Remove Printf
diff --git a/nlsr_km.c b/nlsr_km.c
index 81a1787..6ac2817 100644
--- a/nlsr_km.c
+++ b/nlsr_km.c
@@ -254,7 +254,8 @@
check_key_name_hierarchy(const unsigned char *ccnb,
struct ccn_parsed_ContentObject *pco,
int key_type, int content_type){
- printf("check_key_name_hierarchy called\n");
+ if ( nlsr->debugging )
+ printf("check_key_name_hierarchy called\n");
if (key_type == UNKNOWN_KEY ){
return 1;
}
@@ -263,7 +264,8 @@
struct ccn_charbuf *key_uri = ccn_charbuf_create();
ccn_uri_append(key_uri, key_name->buf, key_name->length, 0);
- printf("Key Name: %s\n",ccn_charbuf_as_string(key_uri));
+ if ( nlsr->debugging )
+ printf("Key Name: %s\n",ccn_charbuf_as_string(key_uri));
ccn_charbuf_destroy(&key_uri);
struct ccn_charbuf *content_name=ccn_charbuf_create();
@@ -272,7 +274,8 @@
struct ccn_charbuf *content_uri = ccn_charbuf_create();
ccn_uri_append(content_uri, content_name->buf, content_name->length, 0);
- printf("Content Name: %s\n",ccn_charbuf_as_string(content_uri));
+ if ( nlsr->debugging )
+ printf("Content Name: %s\n",ccn_charbuf_as_string(content_uri));
ccn_charbuf_destroy(&content_uri);
if ( key_type == NLSR_KEY){
@@ -284,8 +287,10 @@
else if ( content_type == 0 ){
orig_router_content_name=get_orig_router_from_info_content_name(content_name);
}
- printf("Orig Router (Key Name):%s\n",orig_router_key_name);
- printf("Orig Router (Content Name):%s\n",orig_router_content_name);
+ if ( nlsr->debugging ){
+ printf("Orig Router (Key Name):%s\n",orig_router_key_name);
+ printf("Orig Router (Content Name):%s\n",orig_router_content_name);
+ }
if (strcmp(orig_router_key_name,orig_router_content_name) == 0 ){
free(orig_router_key_name);
@@ -299,8 +304,10 @@
if ( key_type == ROUTING_KEY){
char *orig_router_key_name=get_orig_router_from_key_name(key_name,1,0);
char *orig_router_content_name=get_orig_router_from_key_name(content_name,1,1);
- printf("Orig Router (Key Name):%s\n",orig_router_key_name);
- printf("Orig Router (Content Name):%s\n",orig_router_content_name);
+ if ( nlsr->debugging ){
+ printf("Orig Router (Key Name):%s\n",orig_router_key_name);
+ printf("Orig Router (Content Name):%s\n",orig_router_content_name);
+ }
if (strcmp(orig_router_key_name,orig_router_content_name) == 0 ){
free(orig_router_key_name);
@@ -316,7 +323,8 @@
ccn_name_split(key_name, key_name_comps);
int last_indx=check_for_tag_component_in_name(key_name,key_name_comps,"O.N.Start");
char *site_key_prefix_key=get_name_segments_from_name(key_name,0,last_indx);
- printf("Site key prefix(key Name):%s\n",site_key_prefix_key);
+ if ( nlsr->debugging )
+ printf("Site key prefix(key Name):%s\n",site_key_prefix_key);
ccn_indexbuf_destroy(&key_name_comps);
struct ccn_indexbuf *content_name_comps;
@@ -324,7 +332,8 @@
ccn_name_split(content_name, content_name_comps);
int last_indx_rtr=check_for_tag_component_in_name(content_name,content_name_comps,"R.N.Start");
char *site_key_prefix_content=get_name_segments_from_name(key_name,0,last_indx_rtr);
- printf("Site key prefix(Content Name):%s\n",site_key_prefix_content);
+ if ( nlsr->debugging )
+ printf("Site key prefix(Content Name):%s\n",site_key_prefix_content);
ccn_indexbuf_destroy(&content_name_comps);
if( strcmp(site_key_prefix_key,site_key_prefix_content) == 0 ){
@@ -343,7 +352,8 @@
ccn_name_split(key_name, key_name_comps);
int last_indx=check_for_tag_component_in_name(key_name,key_name_comps,"M.K");
char *site_key_prefix_key=get_name_segments_from_name(key_name,0,last_indx);
- printf("Site key prefix(key Name):%s\n",site_key_prefix_key);
+ if ( nlsr->debugging )
+ printf("Site key prefix(key Name):%s\n",site_key_prefix_key);
ccn_indexbuf_destroy(&key_name_comps);
struct ccn_indexbuf *content_name_comps;
@@ -351,7 +361,8 @@
ccn_name_split(content_name, content_name_comps);
int last_indx_rtr=check_for_tag_component_in_name(content_name,content_name_comps,"O.N.Start");
char *site_key_prefix_content=get_name_segments_from_name(key_name,0,last_indx_rtr);
- printf("Site key prefix(Content Name):%s\n",site_key_prefix_content);
+ if ( nlsr->debugging )
+ printf("Site key prefix(Content Name):%s\n",site_key_prefix_content);
ccn_indexbuf_destroy(&content_name_comps);
if( strcmp(site_key_prefix_key,site_key_prefix_content) == 0 ){