Last change
on this file since 7404 was
7404,
checked in by charles, 12 years ago
|
updated email address
|
-
Property svn:keywords set to
Date Rev Author Id
|
File size:
1.6 KB
|
Line | |
---|
1 | /* |
---|
2 | * This file Copyright (C) 2008 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: peer-common.h 7404 2008-12-16 00:20:44Z charles $ |
---|
11 | */ |
---|
12 | |
---|
13 | #ifndef __TRANSMISSION__ |
---|
14 | #error only libtransmission should #include this header. |
---|
15 | #endif |
---|
16 | |
---|
17 | #ifndef TR_PEER_H |
---|
18 | #define TR_PEER_H |
---|
19 | |
---|
20 | /** |
---|
21 | *** Fields common to webseed and bittorrent peers |
---|
22 | **/ |
---|
23 | |
---|
24 | #include "transmission.h" |
---|
25 | |
---|
26 | typedef enum |
---|
27 | { |
---|
28 | TR_ADDREQ_OK = 0, |
---|
29 | TR_ADDREQ_FULL, |
---|
30 | TR_ADDREQ_DUPLICATE, |
---|
31 | TR_ADDREQ_MISSING, |
---|
32 | TR_ADDREQ_CLIENT_CHOKED |
---|
33 | } |
---|
34 | tr_addreq_t; |
---|
35 | |
---|
36 | /** |
---|
37 | *** Peer Publish / Subscribe |
---|
38 | **/ |
---|
39 | |
---|
40 | typedef enum |
---|
41 | { |
---|
42 | TR_PEER_CLIENT_GOT_BLOCK, |
---|
43 | TR_PEER_CLIENT_GOT_DATA, |
---|
44 | TR_PEER_CLIENT_GOT_ALLOWED_FAST, |
---|
45 | TR_PEER_CLIENT_GOT_SUGGEST, |
---|
46 | TR_PEER_PEER_GOT_DATA, |
---|
47 | TR_PEER_PEER_PROGRESS, |
---|
48 | TR_PEER_ERROR, |
---|
49 | TR_PEER_CANCEL, |
---|
50 | TR_PEER_UPLOAD_ONLY, |
---|
51 | TR_PEER_NEED_REQ |
---|
52 | } |
---|
53 | PeerEventType; |
---|
54 | |
---|
55 | typedef struct |
---|
56 | { |
---|
57 | PeerEventType eventType; |
---|
58 | uint32_t pieceIndex; /* for GOT_BLOCK, CANCEL, ALLOWED, SUGGEST */ |
---|
59 | uint32_t offset; /* for GOT_BLOCK */ |
---|
60 | uint32_t length; /* for GOT_BLOCK + GOT_DATA */ |
---|
61 | float progress; /* for PEER_PROGRESS */ |
---|
62 | int err; /* errno for GOT_ERROR */ |
---|
63 | int wasPieceData; /* for GOT_DATA */ |
---|
64 | tr_bool uploadOnly; /* for UPLOAD_ONLY */ |
---|
65 | } |
---|
66 | tr_peer_event; |
---|
67 | |
---|
68 | #ifdef WIN32 |
---|
69 | #define EMSGSIZE WSAEMSGSIZE |
---|
70 | #endif |
---|
71 | |
---|
72 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.