Added more debugging to no open path messages.

Added hook for reading rhizome advertisements.
This commit is contained in:
gardners 2012-01-09 09:17:54 +10:30
parent 25458d0e2b
commit 1240c49a92
4 changed files with 16 additions and 1 deletions

View File

@ -860,6 +860,7 @@ extern int overlay_bin_bytes;
extern overlay_node **overlay_nodes;
int overlay_route_saw_advertisements(int i,overlay_frame *f, long long now);
int overlay_rhizome_saw_advertisements(int i,overlay_frame *f, long long now);
int overlay_route_please_advertise(overlay_node *n);
int rhizome_server_get_fds(struct pollfd *fds,int *fdcount,int fdmax);
int rhizome_server_poll();

View File

@ -272,6 +272,8 @@ int overlay_frame_process(int interface,overlay_frame *f)
case OF_TYPE_NODEANNOUNCE:
overlay_route_saw_advertisements(interface,f,now);
break;
case OF_TYPE_RHIZOME_ADVERT:
overlay_rhizome_saw_advertisements(interface,f,now);
default:
fprintf(stderr,"Unsupported f->type=0x%x\n",f->type);
return WHY("Support for that f->type not yet implemented");

View File

@ -373,7 +373,15 @@ int overlay_get_nexthop(unsigned char *d,unsigned char *nexthop,int *nexthoplen,
for(i=1;i<OVERLAY_MAX_INTERFACES;i++) {
if (neh->scores[i]>neh->scores[*interface]) *interface=i;
}
if (neh->scores[*interface]<1) return WHY("No open path to node");
if (neh->scores[*interface]<1) {
if (debug>2) {
int i;
fprintf(stderr,"No open path to ");
for(i=0;i<SID_SIZE;i++) fprintf(stderr,"%02x",neh->node->sid[i]);
fprintf(stderr,"\n");
}
return WHY("No open path to node");
}
return 0;
} else {
/* Is not a direct neighbour */

View File

@ -1486,3 +1486,7 @@ int overlay_rhizome_add_advertisements(int interface_number,overlay_buffer *e)
return 0;
}
int overlay_rhizome_saw_advertisements(int i,overlay_frame *f, long long now)
{
return WHY("Not implemented.");
}