28
28
#define TR_NAME "Transmission"
32
#define UNUSED __attribute__((unused))
32
#define UNUSED __attribute__ ( ( unused ) )
38
39
typedef enum { TR_NET_OK, TR_NET_ERROR, TR_NET_WAIT } tr_tristate_t;
40
uint8_t* tr_peerIdNew( void );
41
uint8_t* tr_peerIdNew( void );
42
43
const uint8_t* tr_getPeerId( void );
44
45
struct tr_metainfo_lookup
46
char hashString[2*SHA_DIGEST_LENGTH+1];
47
char hashString[2 * SHA_DIGEST_LENGTH + 1];
51
struct tr_ratecontrol;
52
55
unsigned int isPortSet : 1;
57
60
unsigned int isClosed : 1;
58
61
unsigned int useUploadLimit : 1;
59
62
unsigned int useDownloadLimit : 1;
63
unsigned int useLazyBitfield : 1;
61
65
tr_encryption_mode encryptionMode;
63
struct tr_event_handle * events;
67
struct tr_event_handle * events;
69
tr_torrent * torrentList;
73
tr_torrent * torrentList;
78
82
tr_proxy_type proxyType;
83
struct tr_ratecontrol * upload;
84
struct tr_ratecontrol * download;
86
struct tr_list * blocklists;
87
struct tr_peerMgr * peerMgr;
88
struct tr_shared * shared;
90
struct tr_lock * lock;
94
struct tr_rpc_server * rpcServer;
90
struct tr_list * blocklists;
91
struct tr_peerMgr * peerMgr;
92
struct tr_shared * shared;
94
struct tr_lock * lock;
98
struct tr_rpc_server * rpcServer;
95
99
tr_rpc_func rpc_func;
96
void * rpc_func_user_data;
98
struct tr_stats_handle * sessionStats;
99
struct tr_tracker_handle * tracker;
101
struct tr_metainfo_lookup * metainfoLookup;
100
void * rpc_func_user_data;
102
struct tr_stats_handle * sessionStats;
103
struct tr_tracker_handle * tracker;
105
struct tr_metainfo_lookup * metainfoLookup;
102
106
int metainfoLookupCount;
108
/* the rate at which pieces are being transferred between client and peer.
109
* protocol overhead is NOT included; this is only the piece data */
110
struct tr_ratecontrol * pieceSpeed[2];
112
/* the rate at which bytes are being transferred between client and peer. */
113
struct tr_ratecontrol * rawSpeed[2];
105
116
const char * tr_sessionFindTorrentFile( const tr_session * session,
106
const char * hashString );
117
const char * hashString );
108
void tr_sessionSetTorrentFile( tr_session * session,
109
const char * hashString,
110
const char * filename );
119
void tr_sessionSetTorrentFile( tr_session * session,
120
const char * hashString,
121
const char * filename );
114
int tr_sessionIsAddressBlocked( const tr_session * session,
115
const struct in_addr * addr );
118
void tr_globalLock ( tr_session * );
119
void tr_globalUnlock ( tr_session * );
120
int tr_globalIsLocked ( const tr_session * );
123
#define TR_ERROR_IS_IO(e) (TR_ERROR_IO_PARENT<=(e) && (e)<=TR_ERROR_IO_OTHER)
124
#define TR_ERROR_IS_TC(e) (TR_ERROR_TC_ERROR<=(e) && (e)<=TR_ERROR_TC_WARNING)
125
int tr_sessionIsAddressBlocked( const tr_session * session,
126
const struct in_addr * addr );
129
void tr_globalLock( tr_session * );
131
void tr_globalUnlock( tr_session * );
133
int tr_globalIsLocked( const tr_session * );