source: trunk/libtransmission/tracker.h @ 7404

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

updated email address

  • Property svn:keywords set to Date Rev Author Id
File size: 2.8 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 7404 2008-12-16 00:20:44Z 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    /* the torrent's 20-character sha1 hash */
55    const uint8_t *  hash;
56
57    /* for TR_TRACKER_WARNING and TR_TRACKER_ERROR */
58    const char *  text;
59
60    /* for TR_TRACKER_PEERS */
61    const uint8_t *  compact;
62    int              compactLen;
63    int              allAreSeeds;
64}
65tr_tracker_event;
66
67tr_publisher_tag        tr_trackerSubscribe( struct tr_tracker * tag,
68                                             tr_delivery_func    func,
69                                             void *              user );
70
71void                    tr_trackerUnsubscribe( struct tr_tracker * tracker,
72                                               tr_publisher_tag    tag );
73
74/***
75****
76***/
77
78void                    tr_trackerStat( const tr_tracker * tracker,
79                                        struct tr_stat *   setme );
80
81void                    tr_trackerStart( struct tr_tracker * );
82
83void                    tr_trackerCompleted( struct tr_tracker * );
84
85void                    tr_trackerStop( struct tr_tracker * );
86
87void                    tr_trackerReannounce( struct tr_tracker * );
88
89void                    tr_trackerChangeMyPort( struct tr_tracker * );
90
91const tr_tracker_info * tr_trackerGetAddress( struct tr_tracker * );
92
93int                     tr_trackerCanManualAnnounce( const struct tr_tracker * );
94
95time_t                  tr_trackerGetManualAnnounceTime( const struct tr_tracker * );
96
97void                    tr_trackerGetCounts( const struct tr_tracker *,
98                                             int * setme_completedCount,
99                                             int * setme_leecherCount,
100                                             int * setme_seederCount,
101                                             int * setme_downloaderCount );
102
103#endif
Note: See TracBrowser for help on using the repository browser.