An open and free bittorrent tracker https://erdgeist.org/gitweb/opentracker
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.
 
 
 
 

76 lines
2.6 KiB

  1. /* This software was written by Dirk Engling <erdgeist@erdgeist.org>
  2. It is considered beerware. Prost. Skol. Cheers or whatever.
  3. $id$ */
  4. #ifndef OT_MUTEX_H__
  5. #define OT_MUTEX_H__
  6. #include <sys/uio.h>
  7. void mutex_init( );
  8. void mutex_deinit( );
  9. ot_vector *mutex_bucket_lock( int bucket );
  10. ot_vector *mutex_bucket_lock_by_hash( ot_hash hash );
  11. void mutex_bucket_unlock( int bucket, int delta_torrentcount );
  12. void mutex_bucket_unlock_by_hash( ot_hash hash, int delta_torrentcount );
  13. size_t mutex_get_torrent_count();
  14. typedef enum {
  15. TASK_STATS_CONNS = 0x0001,
  16. TASK_STATS_TCP = 0x0002,
  17. TASK_STATS_UDP = 0x0003,
  18. TASK_STATS_SCRAPE = 0x0004,
  19. TASK_STATS_FULLSCRAPE = 0x0005,
  20. TASK_STATS_TPB = 0x0006,
  21. TASK_STATS_HTTPERRORS = 0x0007,
  22. TASK_STATS_VERSION = 0x0008,
  23. TASK_STATS_BUSY_NETWORKS = 0x0009,
  24. TASK_STATS_RENEW = 0x000a,
  25. TASK_STATS_SYNCS = 0x000b,
  26. TASK_STATS_COMPLETED = 0x000c,
  27. TASK_STATS_NUMWANTS = 0x000d,
  28. TASK_STATS = 0x0100, /* Mask */
  29. TASK_STATS_TORRENTS = 0x0101,
  30. TASK_STATS_PEERS = 0x0102,
  31. TASK_STATS_SLASH24S = 0x0103,
  32. TASK_STATS_TOP10 = 0x0104,
  33. TASK_STATS_TOP100 = 0x0105,
  34. TASK_STATS_EVERYTHING = 0x0106,
  35. TASK_STATS_FULLLOG = 0x0107,
  36. TASK_STATS_WOODPECKERS = 0x0108,
  37. TASK_FULLSCRAPE = 0x0200, /* Default mode */
  38. TASK_FULLSCRAPE_TPB_BINARY = 0x0201,
  39. TASK_FULLSCRAPE_TPB_ASCII = 0x0202,
  40. TASK_FULLSCRAPE_TPB_ASCII_PLUS = 0x0203,
  41. TASK_FULLSCRAPE_TPB_URLENCODED = 0x0204,
  42. TASK_FULLSCRAPE_TRACKERSTATE = 0x0205,
  43. TASK_DMEM = 0x0300,
  44. TASK_DONE = 0x0f00,
  45. TASK_FLAG_GZIP = 0x1000,
  46. TASK_FLAG_BZIP2 = 0x2000,
  47. TASK_TASK_MASK = 0x0fff,
  48. TASK_CLASS_MASK = 0x0f00,
  49. TASK_FLAGS_MASK = 0xf000
  50. } ot_tasktype;
  51. typedef unsigned long ot_taskid;
  52. int mutex_workqueue_pushtask( int64 sock, ot_tasktype tasktype );
  53. void mutex_workqueue_canceltask( int64 sock );
  54. void mutex_workqueue_pushsuccess( ot_taskid taskid );
  55. ot_taskid mutex_workqueue_poptask( ot_tasktype *tasktype );
  56. int mutex_workqueue_pushresult( ot_taskid taskid, int iovec_entries, struct iovec *iovector );
  57. int64 mutex_workqueue_popresult( int *iovec_entries, struct iovec ** iovector );
  58. #endif