source: trunk/libtransmission/tracker.h @ 3284

Last change on this file since 3284 was 3284, checked in by charles, 15 years ago

Simplify the tracker/pause/close/recheck/start code.

  • Property svn:keywords set to Date Rev Author Id
File size: 2.3 KB
Line 
1/*
2 * This file Copyright (C) 2007 Charles Kerr <charles@rebelbase.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 3284 2007-10-04 19:58:30Z charles $
11 */
12
13#ifndef _TR_TRACKER_H_
14#define _TR_TRACKER_H_
15
16#include <inttypes.h> /* for uint8_t */
17#include "transmission.h"
18#include "publish.h"
19
20/**
21***  Locating a tracker
22**/
23
24struct tr_tracker * tr_trackerNew( tr_torrent * );
25
26void  tr_trackerFree ( struct tr_tracker * );
27
28/**
29***  Tracker Publish / Subscribe
30**/
31
32typedef enum
33{
34    TR_TRACKER_WARNING,
35    TR_TRACKER_ERROR,
36    TR_TRACKER_ERROR_CLEAR,
37    TR_TRACKER_PEERS
38}
39TrackerEventType;
40
41typedef struct
42{
43    /* what type of event this is */
44    TrackerEventType messageType;
45
46    /* the torrent's 20-character sha1 hash */
47    const uint8_t * hash;
48
49    /* for TR_TRACKER_WARNING and TR_TRACKER_ERROR */
50    const char * text;
51
52    /* for TR_TRACKER_PEERS */
53    const uint8_t * peerCompact;
54    int peerCount;
55}
56tr_tracker_event_t;
57
58tr_publisher_tag  tr_trackerSubscribe       ( struct tr_tracker * tag,
59                                              tr_delivery_func      func,
60                                              void                * user );
61
62void              tr_trackerUnsubscribe     ( struct tr_tracker * tracker,
63                                              tr_publisher_tag      tag );
64
65/***
66****
67***/
68
69void tr_trackerStart                        ( struct tr_tracker * );
70
71void tr_trackerCompleted                    ( struct tr_tracker * );
72
73void tr_trackerStop                         ( struct tr_tracker * );
74
75void tr_trackerReannounce                   ( struct tr_tracker * );
76
77void tr_trackerChangeMyPort                 ( struct tr_tracker * );
78
79const tr_tracker_info * tr_trackerGetAddress( const struct tr_tracker * );
80
81int  tr_trackerCanManualAnnounce            ( const struct tr_tracker * );
82
83void tr_trackerGetCounts                    ( const struct tr_tracker *,
84                                              int * setme_completedCount,
85                                              int * setme_leecherCount,
86                                              int * setme_seederCount );
87
88#endif
Note: See TracBrowser for help on using the repository browser.