Report connection id missmatch count

dynamic-accesslists
erdgeist 12 years ago
parent 37db5f94fa
commit dc90c8867c

@ -35,7 +35,7 @@ BINDIR?=$(PREFIX)/bin
#FEATURES+=-DWANT_MODEST_FULLSCRAPES #FEATURES+=-DWANT_MODEST_FULLSCRAPES
#FEATURES+=-DWANT_SPOT_WOODPECKER #FEATURES+=-DWANT_SPOT_WOODPECKER
#FEATURES+=-DWANT_SYSLOGS #FEATURES+=-DWANT_SYSLOGS
#FEATURES+=-DWANT_DEV_RANDOM FEATURES+=-DWANT_DEV_RANDOM
FEATURES+=-DWANT_FULLSCRAPE FEATURES+=-DWANT_FULLSCRAPE
#FEATURES+=-D_DEBUG_HTTPERROR #FEATURES+=-D_DEBUG_HTTPERROR

@ -48,6 +48,7 @@ static unsigned long long ot_overall_tcp_successfulannounces = 0;
static unsigned long long ot_overall_udp_successfulannounces = 0; static unsigned long long ot_overall_udp_successfulannounces = 0;
static unsigned long long ot_overall_tcp_successfulscrapes = 0; static unsigned long long ot_overall_tcp_successfulscrapes = 0;
static unsigned long long ot_overall_udp_successfulscrapes = 0; static unsigned long long ot_overall_udp_successfulscrapes = 0;
static unsigned long long ot_overall_udp_connectionidmissmatches = 0;
static unsigned long long ot_overall_tcp_connects = 0; static unsigned long long ot_overall_tcp_connects = 0;
static unsigned long long ot_overall_udp_connects = 0; static unsigned long long ot_overall_udp_connects = 0;
static unsigned long long ot_overall_completed = 0; static unsigned long long ot_overall_completed = 0;
@ -59,7 +60,6 @@ static char * ot_failed_request_names[] = { "302 Redirect", "400 Par
static unsigned long long ot_renewed[OT_PEER_TIMEOUT]; static unsigned long long ot_renewed[OT_PEER_TIMEOUT];
static unsigned long long ot_overall_sync_count; static unsigned long long ot_overall_sync_count;
static unsigned long long ot_overall_stall_count; static unsigned long long ot_overall_stall_count;
static unsigned long long g_stats_connid_missmatches;
static time_t ot_start_time; static time_t ot_start_time;
@ -539,7 +539,7 @@ static size_t stats_return_everything( char * reply ) {
r += sprintf( r, " <completed>\n <count>%llu</count>\n </completed>\n", ot_overall_completed ); r += sprintf( r, " <completed>\n <count>%llu</count>\n </completed>\n", ot_overall_completed );
r += sprintf( r, " <connections>\n" ); r += sprintf( r, " <connections>\n" );
r += sprintf( r, " <tcp>\n <accept>%llu</accept>\n <announce>%llu</announce>\n <scrape>%llu</scrape>\n </tcp>\n", ot_overall_tcp_connections, ot_overall_tcp_successfulannounces, ot_overall_udp_successfulscrapes ); r += sprintf( r, " <tcp>\n <accept>%llu</accept>\n <announce>%llu</announce>\n <scrape>%llu</scrape>\n </tcp>\n", ot_overall_tcp_connections, ot_overall_tcp_successfulannounces, ot_overall_udp_successfulscrapes );
r += sprintf( r, " <udp>\n <overall>%llu</overall>\n <connect>%llu</connect>\n <announce>%llu</announce>\n <scrape>%llu</scrape>\n </udp>\n", ot_overall_udp_connections, ot_overall_udp_connects, ot_overall_udp_successfulannounces, ot_overall_udp_successfulscrapes ); r += sprintf( r, " <udp>\n <overall>%llu</overall>\n <connect>%llu</connect>\n <announce>%llu</announce>\n <scrape>%llu</scrape>\n <missmatch>%llu</missmatch>\n </udp>\n", ot_overall_udp_connections, ot_overall_udp_connects, ot_overall_udp_successfulannounces, ot_overall_udp_successfulscrapes, ot_overall_udp_connectionidmissmatches );
r += sprintf( r, " <livesync>\n <count>%llu</count>\n </livesync>\n", ot_overall_sync_count ); r += sprintf( r, " <livesync>\n <count>%llu</count>\n </livesync>\n", ot_overall_sync_count );
r += sprintf( r, " </connections>\n" ); r += sprintf( r, " </connections>\n" );
r += sprintf( r, " <debug>\n" ); r += sprintf( r, " <debug>\n" );
@ -725,7 +725,7 @@ void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uintptr_t event
break; break;
#endif #endif
case EVENT_CONNID_MISSMATCH: case EVENT_CONNID_MISSMATCH:
++g_stats_connid_missmatches; ++ot_overall_udp_connectionidmissmatches;
default: default:
break; break;
} }

@ -38,7 +38,7 @@ static void udp_generate_rijndael_round_key() {
static void udp_make_connectionid( uint32_t connid[4], const ot_ip6 remoteip ) { static void udp_make_connectionid( uint32_t connid[4], const ot_ip6 remoteip ) {
uint32_t plain[4], crypt[4]; uint32_t plain[4], crypt[4];
int age, i; int age, i;
for( i=0; i<16; ++i ) fprintf( stderr, "%02uX ", (uint8_t)remoteip[i] ); fprintf(stderr, "\n" );
if( g_now_minutes + 60 > g_hour_of_the_key ) { if( g_now_minutes + 60 > g_hour_of_the_key ) {
g_hour_of_the_key = g_now_minutes; g_hour_of_the_key = g_now_minutes;
g_key_of_the_hour[1] = g_key_of_the_hour[0]; g_key_of_the_hour[1] = g_key_of_the_hour[0];

Loading…
Cancel
Save