source: trunk/libtransmission/announcer.h @ 9230

Last change on this file since 9230 was 9230, checked in by charles, 11 years ago

(trunk libT) #2471: added/removed trackers aren't applied until restart

File size: 2.6 KB
Line 
1/*
2 * This file Copyright (C) 2009 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:$
11 */
12
13#ifndef __TRANSMISSION__
14#error only libtransmission should #include this header.
15#endif
16
17#ifndef _TR_ANNOUNCER_H_
18#define _TR_ANNOUNCER_H_
19
20#include "transmission.h"
21#include "publish.h"
22
23struct tr_announcer;
24struct tr_torrent_tiers;
25
26/**
27 * ***  Tracker Publish / Subscribe
28 * **/
29
30typedef enum
31{
32    TR_TRACKER_WARNING,
33    TR_TRACKER_ERROR,
34    TR_TRACKER_ERROR_CLEAR,
35    TR_TRACKER_PEERS
36}
37TrackerEventType;
38
39typedef struct
40{
41    /* what type of event this is */
42    TrackerEventType    messageType;
43
44    /* for TR_TRACKER_WARNING and TR_TRACKER_ERROR */
45    const char *  text;
46
47    /* for TR_TRACKER_PEERS */
48    const uint8_t *  compact;
49    int              compactLen;
50    int              allAreSeeds;
51}
52tr_tracker_event;
53
54/**
55***  Session ctor/dtor
56**/
57
58void tr_announcerInit( tr_session * );
59
60void tr_announcerClose( tr_session * );
61
62/**
63***  For torrent customers
64**/
65
66struct tr_torrent_tiers * tr_announcerAddTorrent( struct tr_announcer  *,
67                                                  tr_torrent           * );
68
69void tr_announcerResetTorrent( struct tr_announcer*, tr_torrent* );
70
71tr_publisher_tag tr_announcerSubscribe( struct tr_torrent_tiers  * tiers, 
72                                        tr_delivery_func           func,
73                                        void                     * userData );
74
75void tr_announcerUnsubscribe( struct tr_torrent_tiers  * tiers,
76                              tr_publisher_tag           tag );
77
78void tr_announcerRemoveTorrent( struct tr_announcer * ,
79                                tr_torrent          * );
80
81void tr_announcerChangeMyPort( tr_torrent * );
82
83tr_bool tr_announcerCanManualAnnounce( const tr_torrent * );
84
85void tr_announcerManualAnnounce( tr_torrent * );
86
87void tr_announcerTorrentStarted( tr_torrent * );
88void tr_announcerTorrentStopped( tr_torrent * );
89void tr_announcerTorrentCompleted( tr_torrent * );
90
91time_t tr_announcerNextManualAnnounce( const tr_torrent * );
92
93tr_tracker_stat * tr_announcerStats( const tr_torrent * torrent,
94                                     int              * setmeTrackerCount );
95
96void tr_announcerStatsFree( tr_tracker_stat * trackers,
97                            int               trackerCount );
98
99
100#endif /* _TR_ANNOUNCER_H_ */
Note: See TracBrowser for help on using the repository browser.