~ubuntu-branches/ubuntu/natty/transmission/natty

« back to all changes in this revision

Viewing changes to libtransmission/peer-mgr.h

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda
  • Date: 2009-12-08 10:49:11 UTC
  • mfrom: (1.1.29 upstream) (2.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20091208104911-06gio45n2nla3vpg
Tags: 1.80~b1-0ubuntu1
* New upstream release (LP: #460620), rebased on debian unstable
  remaining changes:
  - debian/control:
    + Added replaces & provides clutch (now included as part of transmission).
      Can be removed in lucid+1
    + Added quilt, liblaunchpad-integration-dev and lsb-release to Build-Depends
  - debian/rules:
    + create a po template during package build.
  - debian/patches/01_lpi.patch:
    + integrate transmission with launchpad
  - debian/patches/20_add_x-ubuntu-gettext-domain.diff:
    + add x-ubuntu-gettext-domain to .desktop file.
  - debian/transmission-daemon.default:
    - remove --auth from OPTIONS
* Fixes bugs:
  - tray menu shows wrong status for "main window" when started minimized
    (LP: #451415)
* Refreshed patches:
  - dont_build_libevent.patch
  - 99_autoreconf.patch
* Removed patches:
  - 21_onPortTested.diff, 23_tr_torrentNext.diff and
    24_tr_torrentDeleteLocalData_do_move.diff
* debian/patches/21_fix_inhibition.patch:
  - The right value for suspend inhibition is 4
* debian/control:
  - Build-Depend on libgconf2-dev to enable magnet link registration and on
    libcanberra-gtk-dev for notification sound.
* debian/watch:
  - make it detect beta versions, to be removed after 1.80 is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * This file Copyright (C) 2007-2009 Charles Kerr <charles@transmissionbt.com>
 
2
 * This file Copyright (C) 2007-2009 Mnemosyne LLC
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)
7
7
 * This exemption does not extend to derived works not owned by
8
8
 * the Transmission project.
9
9
 *
10
 
 * $Id: peer-mgr.h 9086 2009-09-10 02:21:03Z charles $
 
10
 * $Id: peer-mgr.h 9671 2009-12-05 02:19:24Z charles $
11
11
 */
12
12
 
13
13
#ifndef __TRANSMISSION__
24
24
#endif
25
25
 
26
26
#include "bitfield.h"
 
27
#include "bitset.h"
27
28
#include "net.h"
 
29
#include "peer-common.h" /* struct peer_request */
28
30
#include "publish.h" /* tr_publisher_tag */
29
31
#include "utils.h"
30
32
 
87
89
    uint8_t                  strikes;
88
90
 
89
91
    uint8_t                  encryption_preference;
90
 
    tr_port                  port;
91
92
    tr_port                  dht_port;
92
 
    tr_address               addr;
93
93
    struct tr_peerIo       * io;
94
94
    struct peer_atom       * atom;
95
95
 
96
96
    struct tr_bitfield     * blame;
97
 
    struct tr_bitfield     * have;
 
97
    struct tr_bitset         have;
98
98
 
99
99
    /** how complete the peer's copy of the torrent is. [0.0...1.0] */
100
100
    float                    progress;
109
109
}
110
110
tr_peer;
111
111
 
 
112
const tr_address * tr_peerAddress( const tr_peer * );
112
113
 
113
114
int tr_pexCompare( const void * a, const void * b );
114
115
 
119
120
tr_bool tr_peerMgrPeerIsSeed( const tr_torrent * tor,
120
121
                              const tr_address * addr );
121
122
 
 
123
void tr_peerMgrGetNextRequests( tr_torrent          * torrent,
 
124
                                tr_peer             * peer,
 
125
                                int                   numwant,
 
126
                                tr_block_index_t    * setme,
 
127
                                int                 * numgot );
 
128
 
 
129
tr_bool tr_peerMgrDidPeerRequest( const tr_torrent  * torrent,
 
130
                                  const tr_peer     * peer,
 
131
                                  tr_block_index_t    block );
 
132
 
 
133
void tr_peerMgrRebuildRequests( tr_torrent * torrent );
 
134
 
122
135
void tr_peerMgrAddIncoming( tr_peerMgr  * manager,
123
136
                            tr_address  * addr,
124
137
                            tr_port       port,
148
161
                         tr_piece_index_t    pieceIndex,
149
162
                         int                 success );
150
163
 
 
164
enum 
 
165
{
 
166
    TR_PEERS_CONNECTED,
 
167
    TR_PEERS_ALL
 
168
};
 
169
 
151
170
int  tr_peerMgrGetPeers( tr_torrent      * tor,
152
171
                         tr_pex         ** setme_pex,
153
 
                         uint8_t           af,
154
 
                         int               maxPeerCount );
 
172
                         uint8_t           address_type,
 
173
                         uint8_t           peer_list_mode,
 
174
                         int               max_peer_count );
155
175
 
156
176
void tr_peerMgrStartTorrent( tr_torrent * tor );
157
177