opentracker – An open and free bittorrent tracker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.3 KiB

/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
It is considered beerware. Prost. Skol. Cheers or whatever.
16 years ago
$id$ */
#ifndef OT_STATS_H__
#define OT_STATS_H__
8 months ago
#include "trackerlogic.h"
typedef enum {
EVENT_ACCEPT,
EVENT_READ,
8 months ago
EVENT_CONNECT, /* UDP only */
EVENT_ANNOUNCE,
EVENT_COMPLETED,
EVENT_RENEW,
16 years ago
EVENT_SYNC,
EVENT_SCRAPE,
EVENT_FULLSCRAPE_REQUEST,
EVENT_FULLSCRAPE_REQUEST_GZIP,
EVENT_FULLSCRAPE_REQUEST_ZSTD,
8 months ago
EVENT_FULLSCRAPE, /* TCP only */
EVENT_FAILED,
EVENT_BUCKET_LOCKED,
EVENT_WOODPECKER,
EVENT_CONNID_MISSMATCH
} ot_status_event;
enum {
CODE_HTTPERROR_302,
CODE_HTTPERROR_400,
CODE_HTTPERROR_400_PARAM,
CODE_HTTPERROR_400_COMPACT,
CODE_HTTPERROR_402_NOTMODEST,
CODE_HTTPERROR_402_PAYMENT_REQUIRED,
CODE_HTTPERROR_403_IP,
CODE_HTTPERROR_404,
CODE_HTTPERROR_500,
16 years ago
CODE_HTTPERROR_COUNT
};
8 months ago
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(void);
size_t return_stats_for_tracker(char *reply, int mode, int format);
size_t stats_return_tracker_version(char *reply);
void stats_init(void);
void stats_deinit(void);
#endif