Added another debug/verbosity flag.

This commit is contained in:
gardners 2012-01-10 16:29:50 +10:30
parent eb122f8692
commit 891e3f2740
4 changed files with 13 additions and 6 deletions

View File

@ -892,5 +892,6 @@ int rhizome_server_poll();
#define DEBUG_OVERLAYROUTING 32768
#define DEBUG_SECURITY 65536
#define DEBUG_RHIZOME 131072
#define DEBUG_OVERLAYROUTEMONITOR 262144
int serval_packetvisualise(FILE *f,char *message,unsigned char *packet,int plen);

View File

@ -264,8 +264,11 @@ int overlay_abbreviate_address(unsigned char *in,unsigned char *out,int *ofs)
for(i=0;i<2;i++)
if (abbrs->byfirstbyte[in[0]][i])
{
if (0) { if (!overlay_abbreviate_try_byindex(in,out,ofs,abbrs->byfirstbyte[in[0]][i]))
return 0; } else WHY("Abbreviation by index temporarily disabled to simplify development");
if (0) { if (!overlay_abbreviate_try_byindex(in,out,ofs,abbrs->byfirstbyte[in[0]][i])) return 0; }
else {
if (debug&DEBUG_OVERLAYABBREVIATIONS)
WHY("Abbreviation by index temporarily disabled to simplify development");
}
}
else break;

View File

@ -34,20 +34,20 @@ int op_append_type(overlay_buffer *headers,overlay_frame *p)
{
case OF_TYPE_FLAG_NORMAL:
c[0]=p->type|p->modifiers;
if (debug>3) fprintf(stderr,"type resolves to %02x\n",c[0]);
if (debug&DEBUG_PACKETFORMATS) fprintf(stderr,"type resolves to %02x\n",c[0]);
if (ob_append_bytes(headers,c,1)) return -1;
break;
case OF_TYPE_FLAG_E12:
c[0]=(p->type&OF_MODIFIER_BITS)|OF_TYPE_EXTENDED12;
c[1]=(p->type>>4)&0xff;
if (debug>3) fprintf(stderr,"type resolves to %02x%02x\n",c[0],c[1]);
if (debug&DEBUG_PACKETFORMATS) fprintf(stderr,"type resolves to %02x%02x\n",c[0],c[1]);
if (ob_append_bytes(headers,c,2)) return -1;
break;
case OF_TYPE_FLAG_E20:
c[0]=(p->type&OF_MODIFIER_BITS)|OF_TYPE_EXTENDED20;
c[1]=(p->type>>4)&0xff;
c[2]=(p->type>>12)&0xff;
if (debug>3) fprintf(stderr,"type resolves to %02x%02x%02x\n",c[0],c[1],c[2]);
if (debug&DEBUG_PACKETFORMATS) fprintf(stderr,"type resolves to %02x%02x%02x\n",c[0],c[1],c[2]);
if (ob_append_bytes(headers,c,3)) return -1;
break;
default:

View File

@ -802,7 +802,10 @@ int overlay_route_recalc_node_metrics(overlay_node *n,long long now)
if it goes down, we probably don't need to say anything at all.
*/
int diff=best_score-n->best_link_score;
if (diff>0) overlay_route_please_advertise(n);
if (diff>0) {
overlay_route_please_advertise(n);
if (debug&DEBUG_OVERLAYROUTEMONITOR) overlay_route_dump();
}
/* Remember new reachability information */
n->best_link_score=best_score;