Browse Source

Report connection id missmatch count

master
Dirk Engling 10 years ago
parent
commit
9bf6cdb058
  1. 4
      Makefile
  2. 8
      ot_stats.c
  3. 4
      ot_udp.c

4
Makefile

@ -1,4 +1,4 @@
# $Id: Makefile,v 1.70 2012/05/28 15:24:33 erdgeist Exp $
# $Id: Makefile,v 1.71 2012/05/28 19:05:02 erdgeist Exp $
CC?=gcc
@ -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

8
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, " <completed>\n <count>%llu</count>\n </completed>\n", ot_overall_completed );
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, " <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, " </connections>\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;
#endif
case EVENT_CONNID_MISSMATCH:
++g_stats_connid_missmatches;
++ot_overall_udp_connectionidmissmatches;
default:
break;
}
@ -761,4 +761,4 @@ void stats_deinit( ) {
pthread_cancel( thread_id );
}
const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.69 $\n";
const char *g_version_stats_c = "$Source: /home/cvsroot/opentracker/ot_stats.c,v $: $Revision: 1.70 $\n";

4
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];
@ -198,4 +198,4 @@ void udp_init( int64 sock, unsigned int worker_count ) {
pthread_create( &thread_id, NULL, udp_worker, (void *)sock );
}
const char *g_version_udp_c = "$Source: /home/cvsroot/opentracker/ot_udp.c,v $: $Revision: 1.27 $\n";
const char *g_version_udp_c = "$Source: /home/cvsroot/opentracker/ot_udp.c,v $: $Revision: 1.28 $\n";

Loading…
Cancel
Save