mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-18 10:46:23 +00:00
Added another debug/verbosity flag.
This commit is contained in:
parent
eb122f8692
commit
891e3f2740
1
mphlr.h
1
mphlr.h
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user