~ubuntu-branches/ubuntu/precise/transmission/precise

« back to all changes in this revision

Viewing changes to libtransmission/tracker.h

  • Committer: Bazaar Package Importer
  • Author(s): Leo Costela
  • Date: 2009-05-17 19:39:51 UTC
  • mto: (1.3.4 upstream) (2.2.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: james.westby@ubuntu.com-20090517193951-k8x15sqoxzf7cuyx
ImportĀ upstreamĀ versionĀ 1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * This file Copyright (C) 2007-2008 Charles Kerr <charles@rebelbase.com>
 
2
 * This file Copyright (C) 2007-2009 Charles Kerr <charles@transmissionbt.com>
3
3
 *
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.
9
9
 *
10
 
 * $Id: tracker.h 5647 2008-04-19 15:07:59Z charles $
 
10
 * $Id: tracker.h 7824 2009-02-04 16:58:52Z charles $
11
11
 */
12
12
 
 
13
#ifndef __TRANSMISSION__
 
14
#error only libtransmission should #include this header.
 
15
#endif
 
16
 
13
17
#ifndef _TR_TRACKER_H_
14
18
#define _TR_TRACKER_H_
15
19
 
25
29
 
26
30
tr_tracker * tr_trackerNew( const tr_torrent * );
27
31
 
28
 
void  tr_trackerFree ( tr_tracker * );
29
 
 
30
 
void  tr_trackerShuttingDown( tr_handle * );
 
32
void         tr_trackerFree( tr_tracker * );
 
33
 
 
34
/**
 
35
***
 
36
**/
 
37
 
 
38
void         tr_trackerSessionInit( tr_session * );
 
39
 
 
40
void         tr_trackerSessionClose( tr_session * );
31
41
 
32
42
/**
33
43
***  Tracker Publish / Subscribe
45
55
typedef struct
46
56
{
47
57
    /* what type of event this is */
48
 
    TrackerEventType messageType;
49
 
 
50
 
    /* the torrent's 20-character sha1 hash */
51
 
    const uint8_t * hash;
 
58
    TrackerEventType    messageType;
52
59
 
53
60
    /* for TR_TRACKER_WARNING and TR_TRACKER_ERROR */
54
 
    const char * text;
 
61
    const char *  text;
55
62
 
56
63
    /* for TR_TRACKER_PEERS */
57
 
    const uint8_t * compact;
58
 
    int compactLen;
59
 
    int allAreSeeds;
 
64
    const uint8_t *  compact;
 
65
    int              compactLen;
 
66
    int              allAreSeeds;
60
67
}
61
68
tr_tracker_event;
62
69
 
63
 
tr_publisher_tag  tr_trackerSubscribe       ( struct tr_tracker * tag,
64
 
                                              tr_delivery_func      func,
65
 
                                              void                * user );
 
70
tr_publisher_tag        tr_trackerSubscribe( struct tr_tracker * tag,
 
71
                                             tr_delivery_func    func,
 
72
                                             void *              user );
66
73
 
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 );
69
76
 
70
77
/***
71
78
****
72
79
***/
73
80
 
74
 
void tr_trackerStat                         ( const tr_tracker       * tracker,
75
 
                                              struct tr_tracker_stat * setme);
76
 
 
77
 
void tr_trackerStart                        ( struct tr_tracker * );
78
 
 
79
 
void tr_trackerCompleted                    ( struct tr_tracker * );
80
 
 
81
 
void tr_trackerStop                         ( struct tr_tracker * );
82
 
 
83
 
void tr_trackerReannounce                   ( struct tr_tracker * );
84
 
 
85
 
void tr_trackerChangeMyPort                 ( struct tr_tracker * );
86
 
 
87
 
const tr_tracker_info * tr_trackerGetAddress( const struct tr_tracker * );
88
 
 
89
 
int  tr_trackerCanManualAnnounce            ( const struct tr_tracker * );
90
 
 
91
 
time_t tr_trackerGetManualAnnounceTime      ( const struct tr_tracker * );
92
 
 
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 );
 
83
 
 
84
void                    tr_trackerStart( struct tr_tracker * );
 
85
 
 
86
void                    tr_trackerCompleted( struct tr_tracker * );
 
87
 
 
88
void                    tr_trackerStop( struct tr_tracker * );
 
89
 
 
90
void                    tr_trackerReannounce( struct tr_tracker * );
 
91
 
 
92
void                    tr_trackerChangeMyPort( struct tr_tracker * );
 
93
 
 
94
const tr_tracker_info * tr_trackerGetAddress( struct tr_tracker *, const tr_torrent * tor );
 
95
 
 
96
int                     tr_trackerCanManualAnnounce( const struct tr_tracker * );
 
97
 
 
98
time_t                  tr_trackerGetManualAnnounceTime( const struct tr_tracker * );
 
99
 
 
100
void                    tr_trackerGetCounts( const struct tr_tracker *,
 
101
                                             int * setme_completedCount,
 
102
                                             int * setme_leecherCount,
 
103
                                             int * setme_seederCount,
 
104
                                             int * setme_downloaderCount );
97
105
 
98
106
#endif