diff options
Diffstat (limited to 'trackerlogic.h')
-rw-r--r-- | trackerlogic.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/trackerlogic.h b/trackerlogic.h index 03ed577..ad18cba 100644 --- a/trackerlogic.h +++ b/trackerlogic.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __TRACKERLOGIC_H__ | 1 | #ifndef __TRACKERLOGIC_H__ |
2 | #define __TRACKERLOGIC_H__ | 2 | #define __TRACKERLOGIC_H__ |
3 | 3 | ||
4 | #include <sys/types.h> | ||
5 | |||
4 | /* Should be called BYTE, WORD, DWORD - but some OSs already have that and there's no #iftypedef */ | 6 | /* Should be called BYTE, WORD, DWORD - but some OSs already have that and there's no #iftypedef */ |
5 | /* They mark memory used as data instead of integer or human readable string - | 7 | /* They mark memory used as data instead of integer or human readable string - |
6 | they should be cast before used as integer/text */ | 8 | they should be cast before used as integer/text */ |
@@ -12,8 +14,8 @@ typedef unsigned long ot_time; | |||
12 | typedef ot_byte ot_hash[20]; | 14 | typedef ot_byte ot_hash[20]; |
13 | typedef ot_byte ot_ip[ 4/*0*/ ]; | 15 | typedef ot_byte ot_ip[ 4/*0*/ ]; |
14 | // tunables | 16 | // tunables |
15 | const unsigned long OT_TIMEOUT = 2700; | 17 | static const unsigned long OT_TIMEOUT = 2700; |
16 | const unsigned long OT_HUGE_FILESIZE = 1024*1024*256; // Thats 256MB per file, enough for 204800 peers of 128 bytes | 18 | static const unsigned long OT_HUGE_FILESIZE = 1024*1024*256; // Thats 256MB per file, enough for 204800 peers of 128 bytes |
17 | 19 | ||
18 | // We will not service v6, yes | 20 | // We will not service v6, yes |
19 | #define OT_COMPACT_ONLY | 21 | #define OT_COMPACT_ONLY |
@@ -35,8 +37,8 @@ typedef struct ot_peer { | |||
35 | ot_time death; | 37 | ot_time death; |
36 | ot_byte flags; | 38 | ot_byte flags; |
37 | } *ot_peer; | 39 | } *ot_peer; |
38 | ot_byte PEER_FLAG_SEEDING = 0x80; | 40 | static const ot_byte PEER_FLAG_SEEDING = 0x80; |
39 | ot_byte PEER_IP_LENGTH_MASK = 0x3f; | 41 | static const ot_byte PEER_IP_LENGTH_MASK = 0x3f; |
40 | 42 | ||
41 | typedef struct { | 43 | typedef struct { |
42 | ot_hash hash; | 44 | ot_hash hash; |
@@ -64,8 +66,8 @@ void *binary_search( const void *key, const void *base, | |||
64 | int init_logic( char *chdir_directory ); | 66 | int init_logic( char *chdir_directory ); |
65 | void deinit_logic( ); | 67 | void deinit_logic( ); |
66 | 68 | ||
67 | ot_torrent add_peer_to_torrent( ot_hash hash, ot_peer peer ); | 69 | ot_torrent add_peer_to_torrent( ot_hash *hash, ot_peer peer ); |
68 | void return_peers_for_torrent( ot_torrent torrent, unsigned long amount, char *reply ); | 70 | size_t return_peers_for_torrent( ot_torrent torrent, unsigned long amount, char *reply ); |
69 | void heal_torrent( ot_torrent torrent ); | 71 | void heal_torrent( ot_torrent torrent ); |
70 | 72 | ||
71 | #endif | 73 | #endif |