From dc90c8867cd39a42c85ee15d711b84c7206677cf Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Mon, 28 May 2012 19:05:02 +0000 Subject: Report connection id missmatch count --- Makefile | 2 +- ot_stats.c | 6 +++--- ot_udp.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index ed258e6..b4bb5d2 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ BINDIR?=$(PREFIX)/bin #FEATURES+=-DWANT_MODEST_FULLSCRAPES #FEATURES+=-DWANT_SPOT_WOODPECKER #FEATURES+=-DWANT_SYSLOGS -#FEATURES+=-DWANT_DEV_RANDOM +FEATURES+=-DWANT_DEV_RANDOM FEATURES+=-DWANT_FULLSCRAPE #FEATURES+=-D_DEBUG_HTTPERROR diff --git a/ot_stats.c b/ot_stats.c index 5e7a9f3..d37424c 100644 --- a/ot_stats.c +++ b/ot_stats.c @@ -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_tcp_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_udp_connects = 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_overall_sync_count; static unsigned long long ot_overall_stall_count; -static unsigned long long g_stats_connid_missmatches; static time_t ot_start_time; @@ -539,7 +539,7 @@ static size_t stats_return_everything( char * reply ) { r += sprintf( r, " \n %llu\n \n", ot_overall_completed ); r += sprintf( r, " \n" ); r += sprintf( r, " \n %llu\n %llu\n %llu\n \n", ot_overall_tcp_connections, ot_overall_tcp_successfulannounces, ot_overall_udp_successfulscrapes ); - r += sprintf( r, " \n %llu\n %llu\n %llu\n %llu\n \n", ot_overall_udp_connections, ot_overall_udp_connects, ot_overall_udp_successfulannounces, ot_overall_udp_successfulscrapes ); + r += sprintf( r, " \n %llu\n %llu\n %llu\n %llu\n %llu\n \n", ot_overall_udp_connections, ot_overall_udp_connects, ot_overall_udp_successfulannounces, ot_overall_udp_successfulscrapes, ot_overall_udp_connectionidmissmatches ); r += sprintf( r, " \n %llu\n \n", ot_overall_sync_count ); r += sprintf( r, " \n" ); r += sprintf( r, " \n" ); @@ -725,7 +725,7 @@ void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uintptr_t event break; #endif case EVENT_CONNID_MISSMATCH: - ++g_stats_connid_missmatches; + ++ot_overall_udp_connectionidmissmatches; default: break; } diff --git a/ot_udp.c b/ot_udp.c index b79bc76..603a4e2 100644 --- a/ot_udp.c +++ b/ot_udp.c @@ -38,7 +38,7 @@ static void udp_generate_rijndael_round_key() { static void udp_make_connectionid( uint32_t connid[4], const ot_ip6 remoteip ) { uint32_t plain[4], crypt[4]; 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 ) { g_hour_of_the_key = g_now_minutes; g_key_of_the_hour[1] = g_key_of_the_hour[0]; -- cgit v1.2.3