mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-07 03:29:15 +00:00
removed debugging
This commit is contained in:
parent
6472ff29c1
commit
b675e8eefd
@ -814,8 +814,6 @@ int overlay_tick_interface(int i, long long now)
|
|||||||
#define MAX_FRAME_PAX 1024
|
#define MAX_FRAME_PAX 1024
|
||||||
overlay_frame *pax[MAX_FRAME_PAX];
|
overlay_frame *pax[MAX_FRAME_PAX];
|
||||||
|
|
||||||
TIMING_CHECK();
|
|
||||||
|
|
||||||
if (overlay_interfaces[i].bits_per_second<1) {
|
if (overlay_interfaces[i].bits_per_second<1) {
|
||||||
/* An interface with no speed budget is for listening only, so doesn't get ticked */
|
/* An interface with no speed budget is for listening only, so doesn't get ticked */
|
||||||
return 0;
|
return 0;
|
||||||
@ -852,7 +850,6 @@ int overlay_tick_interface(int i, long long now)
|
|||||||
Give priority to newly observed nodes so that good news travels quickly to help roaming.
|
Give priority to newly observed nodes so that good news travels quickly to help roaming.
|
||||||
XXX - Don't forget about PONGing reachability reports to allow use of monodirectional links.
|
XXX - Don't forget about PONGing reachability reports to allow use of monodirectional links.
|
||||||
*/
|
*/
|
||||||
TIMING_CHECK();
|
|
||||||
overlay_stuff_packet_from_queue(i,e,OQ_MESH_MANAGEMENT,now,pax,&frame_pax,MAX_FRAME_PAX);
|
overlay_stuff_packet_from_queue(i,e,OQ_MESH_MANAGEMENT,now,pax,&frame_pax,MAX_FRAME_PAX);
|
||||||
|
|
||||||
/* We previously limited manifest space to 3/4 of MTU, but that causes problems for
|
/* We previously limited manifest space to 3/4 of MTU, but that causes problems for
|
||||||
@ -861,30 +858,23 @@ TIMING_CHECK();
|
|||||||
#warning reduce to <= mtu*3/4 once we have compacty binary canonical manifest format
|
#warning reduce to <= mtu*3/4 once we have compacty binary canonical manifest format
|
||||||
ob_limitsize(e,overlay_interfaces[i].mtu*4/4);
|
ob_limitsize(e,overlay_interfaces[i].mtu*4/4);
|
||||||
|
|
||||||
TIMING_CHECK();
|
|
||||||
|
|
||||||
/* Add advertisements for ROUTES not Rhizome bundles.
|
/* Add advertisements for ROUTES not Rhizome bundles.
|
||||||
Rhizome bundle advertisements are lower priority */
|
Rhizome bundle advertisements are lower priority */
|
||||||
overlay_route_add_advertisements(i,e);
|
overlay_route_add_advertisements(i,e);
|
||||||
|
|
||||||
ob_limitsize(e,overlay_interfaces[i].mtu);
|
ob_limitsize(e,overlay_interfaces[i].mtu);
|
||||||
|
|
||||||
TIMING_CHECK();
|
|
||||||
|
|
||||||
/* 4. XXX Add lower-priority queued data */
|
/* 4. XXX Add lower-priority queued data */
|
||||||
overlay_stuff_packet_from_queue(i,e,OQ_ISOCHRONOUS_VIDEO,now,pax,&frame_pax,MAX_FRAME_PAX);
|
overlay_stuff_packet_from_queue(i,e,OQ_ISOCHRONOUS_VIDEO,now,pax,&frame_pax,MAX_FRAME_PAX);
|
||||||
overlay_stuff_packet_from_queue(i,e,OQ_ORDINARY,now,pax,&frame_pax,MAX_FRAME_PAX);
|
overlay_stuff_packet_from_queue(i,e,OQ_ORDINARY,now,pax,&frame_pax,MAX_FRAME_PAX);
|
||||||
overlay_stuff_packet_from_queue(i,e,OQ_OPPORTUNISTIC,now,pax,&frame_pax,MAX_FRAME_PAX);
|
overlay_stuff_packet_from_queue(i,e,OQ_OPPORTUNISTIC,now,pax,&frame_pax,MAX_FRAME_PAX);
|
||||||
/* 5. XXX Fill the packet up to a suitable size with anything that seems a good idea */
|
/* 5. XXX Fill the packet up to a suitable size with anything that seems a good idea */
|
||||||
TIMING_CHECK();
|
|
||||||
if (rhizome_enabled())
|
if (rhizome_enabled())
|
||||||
overlay_rhizome_add_advertisements(i,e);
|
overlay_rhizome_add_advertisements(i,e);
|
||||||
|
|
||||||
if (debug&DEBUG_PACKETCONSTRUCTION)
|
if (debug&DEBUG_PACKETCONSTRUCTION)
|
||||||
dump("assembled packet",&e->bytes[0],e->length);
|
dump("assembled packet",&e->bytes[0],e->length);
|
||||||
|
|
||||||
TIMING_CHECK();
|
|
||||||
|
|
||||||
/* Now send the frame. This takes the form of a special DNA packet with a different
|
/* Now send the frame. This takes the form of a special DNA packet with a different
|
||||||
service code, which we setup earlier. */
|
service code, which we setup earlier. */
|
||||||
if (debug&DEBUG_OVERLAYINTERFACES)
|
if (debug&DEBUG_OVERLAYINTERFACES)
|
||||||
@ -970,7 +960,6 @@ TIMING_CHECK();
|
|||||||
if (e) ob_free(e); e=NULL;
|
if (e) ob_free(e); e=NULL;
|
||||||
return WHY("overlay_broadcast_ensemble() failed");
|
return WHY("overlay_broadcast_ensemble() failed");
|
||||||
}
|
}
|
||||||
TIMING_CHECK();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -985,7 +974,6 @@ void overlay_check_ticks(void) {
|
|||||||
If so, trigger a tick on the interface. */
|
If so, trigger a tick on the interface. */
|
||||||
if (debug & DEBUG_OVERLAYINTERFACES) INFOF("Examining %d interfaces.",overlay_interface_count);
|
if (debug & DEBUG_OVERLAYINTERFACES) INFOF("Examining %d interfaces.",overlay_interface_count);
|
||||||
for(i = 0; i < overlay_interface_count; i++) {
|
for(i = 0; i < overlay_interface_count; i++) {
|
||||||
TIMING_CHECK();
|
|
||||||
/* Only tick live interfaces */
|
/* Only tick live interfaces */
|
||||||
if (overlay_interfaces[i].observed > 0) {
|
if (overlay_interfaces[i].observed > 0) {
|
||||||
if (debug & DEBUG_VERBOSE_IO) INFOF("Interface %s ticks every %dms, last at %lld.",
|
if (debug & DEBUG_VERBOSE_IO) INFOF("Interface %s ticks every %dms, last at %lld.",
|
||||||
@ -993,22 +981,19 @@ void overlay_check_ticks(void) {
|
|||||||
overlay_interfaces[i].tick_ms,
|
overlay_interfaces[i].tick_ms,
|
||||||
overlay_interfaces[i].last_tick_ms);
|
overlay_interfaces[i].last_tick_ms);
|
||||||
if (now >= overlay_interfaces[i].last_tick_ms + overlay_interfaces[i].tick_ms) {
|
if (now >= overlay_interfaces[i].last_tick_ms + overlay_interfaces[i].tick_ms) {
|
||||||
TIMING_CHECK();
|
|
||||||
|
|
||||||
/* This interface is due for a tick */
|
/* This interface is due for a tick */
|
||||||
overlay_tick_interface(i, now);
|
overlay_tick_interface(i, now);
|
||||||
TIMING_CHECK();
|
|
||||||
overlay_interfaces[i].last_tick_ms = now;
|
overlay_interfaces[i].last_tick_ms = now;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
if (debug & DEBUG_VERBOSE_IO) INFOF("Interface %s is awol.", overlay_interfaces[i].name);
|
if (debug & DEBUG_VERBOSE_IO) INFOF("Interface %s is awol.", overlay_interfaces[i].name);
|
||||||
TIMING_CHECK();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update interval until next tick */
|
/* Update interval until next tick */
|
||||||
fd_setalarm(overlay_check_ticks,overlay_time_until_next_tick(),500);
|
fd_setalarm(overlay_check_ticks,overlay_time_until_next_tick(),500);
|
||||||
|
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
long long overlay_time_until_next_tick()
|
long long overlay_time_until_next_tick()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user