source: branches/1.4x/libtransmission/peer-common.h @ 7176

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

(1.4x libT) backport the bandwidth fixes back to the 1.4x branch, pass #2: most of the bandwidth code, plus autoconf and xcode makefile stuff

  • Property svn:keywords set to Date Rev Author Id
File size: 1.5 KB
Line 
1/*
2 * This file Copyright (C) 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-common.h 7176 2008-11-29 16:44:24Z 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#include "publish.h"
26
27typedef enum
28{
29    TR_ADDREQ_OK = 0,
30    TR_ADDREQ_FULL,
31    TR_ADDREQ_DUPLICATE,
32    TR_ADDREQ_MISSING,
33    TR_ADDREQ_CLIENT_CHOKED
34}
35tr_addreq_t;
36
37/**
38***  Peer Publish / Subscribe
39**/
40
41typedef enum
42{
43    TR_PEER_CLIENT_GOT_BLOCK,
44    TR_PEER_CLIENT_GOT_DATA,
45    TR_PEER_PEER_GOT_DATA,
46    TR_PEER_PEER_PROGRESS,
47    TR_PEER_ERROR,
48    TR_PEER_CANCEL,
49    TR_PEER_NEED_REQ
50}
51PeerEventType;
52
53typedef struct
54{
55    PeerEventType    eventType;
56    uint32_t         pieceIndex;   /* for GOT_BLOCK, CANCEL */
57    uint32_t         offset;       /* for GOT_BLOCK */
58    uint32_t         length;       /* for GOT_BLOCK + GOT_DATA */
59    float            progress;     /* for PEER_PROGRESS */
60    int              err;          /* errno for GOT_ERROR */
61    int              wasPieceData; /* for GOT_DATA */
62}
63tr_peer_event;
64
65#ifdef WIN32
66 #define EMSGSIZE WSAEMSGSIZE
67#endif
68
69#endif
Note: See TracBrowser for help on using the repository browser.