source: trunk/libtransmission/peer-mgr-private.h @ 7231

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

(libT) re-apply jhujhiti's IPv6 patch. This merges in my tr_port cleanup, so any new bugs are mine :/

  • Property svn:keywords set to Date Rev Author Id
File size: 2.0 KB
Line 
1/*
2 * This file Copyright (C) 2007-2008 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: peer-mgr-private.h 7231 2008-12-02 03:41:58Z charles $
11 */
12
13#ifndef __TRANSMISSION__
14#error only libtransmission should #include this header.
15#endif
16
17#ifndef TR_PEER_MGR_PRIVATE_H
18#define TR_PEER_MGR_PRIVATE_H
19
20#include <inttypes.h> /* uint16_t */
21
22#ifdef WIN32
23 #include <winsock2.h> /* struct in_addr */
24#endif
25
26#include "publish.h" /* tr_publisher_tag */
27
28struct tr_bandwidth;
29struct tr_bitfield;
30struct tr_peerIo;
31struct tr_peermsgs;
32
33enum
34{
35    ENCRYPTION_PREFERENCE_UNKNOWN,
36    ENCRYPTION_PREFERENCE_YES,
37    ENCRYPTION_PREFERENCE_NO
38};
39
40typedef struct tr_peer
41{
42    tr_bool                  peerIsChoked;
43    tr_bool                  peerIsInterested;
44    tr_bool                  clientIsChoked;
45    tr_bool                  clientIsInterested;
46    tr_bool                  doPurge;
47
48    /* number of bad pieces they've contributed to */
49    uint8_t                  strikes;
50
51    uint8_t                  encryption_preference;
52    tr_port                  port;
53    tr_address               addr;
54    struct tr_peerIo       * io;
55
56    struct tr_bitfield     * blame;
57    struct tr_bitfield     * have;
58
59    /** how complete the peer's copy of the torrent is. [0.0...1.0] */
60    float                    progress;
61
62    /* the client name from the `v' string in LTEP's handshake dictionary */
63    char                   * client;
64
65    time_t                   peerSentPieceDataAt;
66    time_t                   chokeChangedAt;
67    time_t                   pieceDataActivityDate;
68
69    struct tr_peermsgs     * msgs;
70    tr_publisher_tag         msgsTag;
71
72    struct tr_bandwidth    * bandwidth;
73}
74tr_peer;
75
76double tr_peerGetPieceSpeed( const tr_peer    * peer,
77                             tr_direction       direction );
78
79#endif
Note: See TracBrowser for help on using the repository browser.