opentracker/ot_stats.h

50 lines
1.1 KiB
C
Raw Normal View History

/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
2007-12-20 05:59:34 +00:00
It is considered beerware. Prost. Skol. Cheers or whatever.
2008-10-28 01:27:21 +00:00
2007-12-20 05:59:34 +00:00
$id$ */
#ifndef __OT_STATS_H__
#define __OT_STATS_H__
typedef enum {
EVENT_ACCEPT,
EVENT_READ,
EVENT_CONNECT, /* UDP only */
EVENT_ANNOUNCE,
EVENT_COMPLETED,
EVENT_RENEW,
2008-12-03 20:36:16 +00:00
EVENT_SYNC,
EVENT_SCRAPE,
EVENT_FULLSCRAPE_REQUEST,
EVENT_FULLSCRAPE_REQUEST_GZIP,
EVENT_FULLSCRAPE, /* TCP only */
EVENT_FAILED,
EVENT_BUCKET_LOCKED,
2012-05-28 15:15:32 +00:00
EVENT_WOODPECKER,
EVENT_CONNID_MISSMATCH
} ot_status_event;
2007-12-04 23:57:29 +00:00
enum {
2007-12-05 01:40:24 +00:00
CODE_HTTPERROR_302,
2007-12-04 23:57:29 +00:00
CODE_HTTPERROR_400,
CODE_HTTPERROR_400_PARAM,
CODE_HTTPERROR_400_COMPACT,
CODE_HTTPERROR_402_NOTMODEST,
CODE_HTTPERROR_402_PAYMENT_REQUIRED,
2007-12-04 23:57:29 +00:00
CODE_HTTPERROR_403_IP,
CODE_HTTPERROR_404,
CODE_HTTPERROR_500,
2008-10-28 01:27:21 +00:00
2007-12-04 23:57:29 +00:00
CODE_HTTPERROR_COUNT
};
2009-01-13 22:41:16 +00:00
void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uintptr_t event_data );
void stats_deliver( int64 sock, int tasktype );
void stats_cleanup();
size_t return_stats_for_tracker( char *reply, int mode, int format );
2007-12-20 05:59:34 +00:00
size_t stats_return_tracker_version( char *reply );
void stats_init( );
void stats_deinit( );
#endif