mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-18 02:39:44 +00:00
Added more debugging to no open path messages.
Added hook for reading rhizome advertisements.
This commit is contained in:
parent
25458d0e2b
commit
1240c49a92
1
mphlr.h
1
mphlr.h
@ -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();
|
||||
|
@ -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");
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user