source: trunk/libtransmission/tracker.h @ 7533

Last change on this file since 7533 was 7533, checked in by charles, 12 years ago

(trunk libT) use torrent's unique ID as the torrent's lookup key

  • Property svn:keywords set to Date Rev Author Id
File size: 2.7 KB
Line 
1/*
2 * This file Copyright (C) 2007-2008 Charles Kerr <charles@transmissionbt.com>
3 *
4 * This file is licensed by the GPL version 2.  Works owned by the
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.
7 * This exemption does not extend to derived works not owned by
8 * the Transmission project.
9 *
10 * $Id: tracker.h 7533 2008-12-29 21:17:48Z charles $
11 */
12
13#ifndef __TRANSMISSION__
14#error only libtransmission should #include this header.
15#endif
16
17#ifndef _TR_TRACKER_H_
18#define _TR_TRACKER_H_
19
20#include <inttypes.h> /* for uint8_t */
21#include "transmission.h"
22#include "publish.h"
23
24/**
25***  Locating a tracker
26**/
27
28typedef struct tr_tracker tr_tracker;
29
30tr_tracker * tr_trackerNew( const tr_torrent * );
31
32void         tr_trackerFree( tr_tracker * );
33
34void         tr_trackerSessionClose( tr_session * );
35
36/**
37***  Tracker Publish / Subscribe
38**/
39
40typedef enum
41{
42    TR_TRACKER_WARNING,
43    TR_TRACKER_ERROR,
44    TR_TRACKER_ERROR_CLEAR,
45    TR_TRACKER_PEERS
46}
47TrackerEventType;
48
49typedef struct
50{
51    /* what type of event this is */
52    TrackerEventType    messageType;
53
54    /* for TR_TRACKER_WARNING and TR_TRACKER_ERROR */
55    const char *  text;
56
57    /* for TR_TRACKER_PEERS */
58    const uint8_t *  compact;
59    int              compactLen;
60    int              allAreSeeds;
61}
62tr_tracker_event;
63
64tr_publisher_tag        tr_trackerSubscribe( struct tr_tracker * tag,
65                                             tr_delivery_func    func,
66                                             void *              user );
67
68void                    tr_trackerUnsubscribe( struct tr_tracker * tracker,
69                                               tr_publisher_tag    tag );
70
71/***
72****
73***/
74
75void                    tr_trackerStat( const tr_tracker * tracker,
76                                        struct tr_stat *   setme );
77
78void                    tr_trackerStart( struct tr_tracker * );
79
80void                    tr_trackerCompleted( struct tr_tracker * );
81
82void                    tr_trackerStop( struct tr_tracker * );
83
84void                    tr_trackerReannounce( struct tr_tracker * );
85
86void                    tr_trackerChangeMyPort( struct tr_tracker * );
87
88const tr_tracker_info * tr_trackerGetAddress( struct tr_tracker * );
89
90int                     tr_trackerCanManualAnnounce( const struct tr_tracker * );
91
92time_t                  tr_trackerGetManualAnnounceTime( const struct tr_tracker * );
93
94void                    tr_trackerGetCounts( const struct tr_tracker *,
95                                             int * setme_completedCount,
96                                             int * setme_leecherCount,
97                                             int * setme_seederCount,
98                                             int * setme_downloaderCount );
99
100#endif
Note: See TracBrowser for help on using the repository browser.