-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibrary.h
executable file
·120 lines (103 loc) · 2.37 KB
/
library.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// Information about the status of a torrent
struct status_structure {
long long total_done;
long long total_wanted_done;
long long total_wanted;
long long total_download;
long long total_upload;
long long total_payload_download;
long long total_payload_upload;
long long all_time_payload_download;
long long all_time_payload_upload;
float download_rate;
float upload_rate;
float download_payload_rate;
float upload_payload_rate;
int num_peers;
int num_uploads;
int num_seeds;
int num_connections;
int state;
float progress;
int paused;
int finished;
int valid;
int auto_managed;
int seeding_time;
int active_time;
CString error;
CString current_tracker;
int num_complete;
int num_incomplete;
long long total_failed_bytes;
};
// Information about a tracker or web seed, like the URL
struct announce_structure {
CString url;
int tier;
};
// Information about a torrent
struct torrent_structure {
CString sha1;
long long total_size;
int piece_length;
std::vector<announce_structure> trackers;
std::vector<announce_structure> seeds;
CString created_by;
CString comment;
};
// Holds libtorrent settings
struct settings_structure {
int max_upload_bandwidth;
int max_download_bandwidth;
int listen_start_port;
int listen_end_port;
float seed_ratio_limit;
float seed_time_ratio_limit;
int seed_time_limit;
int active_downloads_limit;
int active_seeds_limit;
int active_limit;
int alert_mask;
CString listen_interface;
};
// Information about a file in a torrent
struct file_structure {
int index;
CString path;
long long size;
long long total_done;
int priority;
};
// Information about a libtorrent alert message it has given us
struct alert_structure {
int category;
CString sha1;
CString message;
bool has_data;
libtorrent::entry *resume_data;
alert_structure() {
category = -1;
has_data = 0;
resume_data = NULL;
}
};
// Information about a peer in a torrent's swarm
struct peer_structure {
int status_flags;
CString peer_id;
CString ip;
int source;
float up_speed;
float down_speed;
float payload_up_speed;
float payload_down_speed;
float progress;
CString country;
CString client_name;
};
// A torrent's striped pattern of pieces and their status
struct pieces_structure {
int completed;
CString pieces;
};