2
* This file Copyright (C) 2007-2008 Charles Kerr <charles@rebelbase.com>
2
* This file Copyright (C) 2007-2009 Charles Kerr <charles@transmissionbt.com>
4
4
* This file is licensed by the GPL version 2. Works owned by the
5
5
* Transmission project are granted a special exemption to clause 2(b)
6
* so that the bulk of its code can remain under the MIT license.
6
* so that the bulk of its code can remain under the MIT license.
7
7
* This exemption does not extend to derived works not owned by
8
8
* the Transmission project.
10
* $Id: tracker.h 5647 2008-04-19 15:07:59Z charles $
10
* $Id: tracker.h 7824 2009-02-04 16:58:52Z charles $
13
#ifndef __TRANSMISSION__
14
#error only libtransmission should #include this header.
13
17
#ifndef _TR_TRACKER_H_
14
18
#define _TR_TRACKER_H_
26
30
tr_tracker * tr_trackerNew( const tr_torrent * );
28
void tr_trackerFree ( tr_tracker * );
30
void tr_trackerShuttingDown( tr_handle * );
32
void tr_trackerFree( tr_tracker * );
38
void tr_trackerSessionInit( tr_session * );
40
void tr_trackerSessionClose( tr_session * );
33
43
*** Tracker Publish / Subscribe
47
57
/* what type of event this is */
48
TrackerEventType messageType;
50
/* the torrent's 20-character sha1 hash */
58
TrackerEventType messageType;
53
60
/* for TR_TRACKER_WARNING and TR_TRACKER_ERROR */
56
63
/* for TR_TRACKER_PEERS */
57
const uint8_t * compact;
64
const uint8_t * compact;
63
tr_publisher_tag tr_trackerSubscribe ( struct tr_tracker * tag,
64
tr_delivery_func func,
70
tr_publisher_tag tr_trackerSubscribe( struct tr_tracker * tag,
71
tr_delivery_func func,
67
void tr_trackerUnsubscribe ( struct tr_tracker * tracker,
68
tr_publisher_tag tag );
74
void tr_trackerUnsubscribe( struct tr_tracker * tracker,
75
tr_publisher_tag tag );
74
void tr_trackerStat ( const tr_tracker * tracker,
75
struct tr_tracker_stat * setme);
77
void tr_trackerStart ( struct tr_tracker * );
79
void tr_trackerCompleted ( struct tr_tracker * );
81
void tr_trackerStop ( struct tr_tracker * );
83
void tr_trackerReannounce ( struct tr_tracker * );
85
void tr_trackerChangeMyPort ( struct tr_tracker * );
87
const tr_tracker_info * tr_trackerGetAddress( const struct tr_tracker * );
89
int tr_trackerCanManualAnnounce ( const struct tr_tracker * );
91
time_t tr_trackerGetManualAnnounceTime ( const struct tr_tracker * );
93
void tr_trackerGetCounts ( const struct tr_tracker *,
94
int * setme_completedCount,
95
int * setme_leecherCount,
96
int * setme_seederCount );
81
void tr_trackerStat( const tr_tracker * tracker,
82
struct tr_stat * setme );
84
void tr_trackerStart( struct tr_tracker * );
86
void tr_trackerCompleted( struct tr_tracker * );
88
void tr_trackerStop( struct tr_tracker * );
90
void tr_trackerReannounce( struct tr_tracker * );
92
void tr_trackerChangeMyPort( struct tr_tracker * );
94
const tr_tracker_info * tr_trackerGetAddress( struct tr_tracker *, const tr_torrent * tor );
96
int tr_trackerCanManualAnnounce( const struct tr_tracker * );
98
time_t tr_trackerGetManualAnnounceTime( const struct tr_tracker * );
100
void tr_trackerGetCounts( const struct tr_tracker *,
101
int * setme_completedCount,
102
int * setme_leecherCount,
103
int * setme_seederCount,
104
int * setme_downloaderCount );