1 (* Copyright 2001, 2002 b52_simon :), b8_bavard, b8_fee_carabine, INRIA *)
3 This file is part of mldonkey.
5 mldonkey is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 mldonkey is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with mldonkey; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 mutable torrent_name
: string;
30 mutable torrent_name_utf8
: string;
31 mutable torrent_filename
: string;
32 mutable torrent_length
: int64
;
33 mutable torrent_announce
: string;
34 mutable torrent_announce_list
: string list
;
35 mutable torrent_piece_size
: int64
;
36 mutable torrent_files
: (string * int64
) list
;
37 mutable torrent_pieces
: Sha1.t array
;
38 mutable torrent_comment
: string;
39 mutable torrent_created_by
: string;
40 mutable torrent_creation_date
: int64
;
41 mutable torrent_modified_by
: string;
42 mutable torrent_encoding
: string;
43 mutable torrent_private
: bool;
45 mutable torrent_nodes : string;
68 | Brand_deadmanwalking
76 | Brand_moonlighttorrent
111 | Brand_electricsheep
134 ( Brand_unknown
, "unknown" , "unk" ) ;
135 ( Brand_abc
, "ABC" , "abc" ) ;
136 ( Brand_arctic
, "Arctic" , "arc" ) ;
137 ( Brand_azureus
, "Azureus" , "azu" ) ;
138 ( Brand_bitbuddy
, "Bitbuddy" , "bud" ) ;
139 ( Brand_bitcomet
, "BitComet" , "com" ) ;
140 ( Brand_bitkitten
, "BitKitten (libTorrent)" , "kit" ) ;
141 ( Brand_bitlord
, "BitLord" , "lor" ) ;
142 ( Brand_bitsonwheels
, "BitsOnWheels" , "bow" ) ;
143 ( Brand_bitspirit
, "BitSpirit" , "spi" ) ;
144 ( Brand_bittornado
, "BitTornado" , "trn" ) ;
145 ( Brand_bittorrentx
, "BitTorrent X" , "btx" ) ;
146 ( Brand_btplus
, "BitTorrent Plus!" , "plu" ) ;
147 ( Brand_bitrocket
, "BitRocket" , "roc" ) ;
148 ( Brand_btslave
, "BTSlave" , "sla" ) ;
149 ( Brand_btugaxp
, "BTugaXP" , "uga" ) ;
150 ( Brand_burst
, "Burst !" , "brs" ) ;
151 ( Brand_ctorrent
, "CTorrent" , "cto" ) ;
152 ( Brand_deadmanwalking
, "Deadman Walking" , "dmw" ) ;
153 ( Brand_exeem
, "eXeem" , "exm" ) ;
154 ( Brand_experimental
, "Experimental" , "exp" ) ;
155 ( Brand_g3torrent
, "G3 Torrent" , "g3t" ) ;
156 ( Brand_libtorrent
, "libTorrent" , "lib" ) ;
157 ( Brand_mainline
, "Mainline" , "mai" ) ;
158 ( Brand_martiniman
, "Martini Man" , "mar" ) ;
159 ( Brand_mldonkey
, "MLdonkey" , "mld" ) ;
160 ( Brand_moonlighttorrent
, "MoonlightTorrent" , "mlt" ) ;
161 ( Brand_plus
, "Plus" , "plu" ) ;
162 ( Brand_shadow
, "Shad0w" , "sdo" ) ;
163 ( Brand_sharenet
, "Sharenet" , "shn" ) ;
164 ( Brand_shareaza
, "Shareaza" , "shz" ) ;
165 ( Brand_simplebt
, "SimpleBT" , "sbt" ) ;
166 ( Brand_snark
, "Snark" , "snk" ) ;
167 ( Brand_swarmscope
, "SwarmScope" , "sws" ) ;
168 ( Brand_swarmy
, "Swarmy" , "swy" ) ;
169 ( Brand_swiftbit
, "SwiftBit" , "swb" ) ;
170 ( Brand_teeweety
, "Teeweety" , "twt" ) ;
171 ( Brand_torrentdotnet
, "Torrent.NET" , "t.n" ) ;
172 ( Brand_torrentstorm
, "TorrentStorm" , "sto" ) ;
173 ( Brand_turbobt
, "TurboBT" , "tbt" ) ;
174 ( Brand_upnp
, "UPNP" , "upn" ) ;
175 ( Brand_xantorrent
, "XanTorrent" , "xat" ) ;
176 ( Brand_xbt
, "XBT" , "xbt" ) ;
177 ( Brand_ziptorrent
, "ZipTorrent" , "zit" ) ;
178 ( Brand_moopolice
, "MooPolice" , "moo" ) ;
179 ( Brand_utorrent_mac
, "uTorrent for Mac" , "uTm" ) ;
180 ( Brand_utorrent
, "uTorrent" , "uTo" ) ;
181 ( Brand_opera
, "Opera" , "opr" ) ;
182 ( Brand_torrenttopia
, "TorrentTopia" , "tt" ) ;
183 ( Brand_greedbt
, "GreedBT" , "gbt" ) ;
184 ( Brand_btgetit
, "BTGetit" , "btg" ) ;
185 ( Brand_ktorrent
, "KTorrent" , "kto" ) ;
186 ( Brand_lphant
, "Lphant" , "lph" ) ;
187 ( Brand_transmission
, "Transmission" , "tra" ) ;
188 ( Brand_hydranode
, "Hydranode" , "hyd" ) ;
189 ( Brand_jvtorrent
, "JVtorrent" , "jvt" ) ;
190 ( Brand_retriever
, "Retriever" , "ret" ) ;
191 ( Brand_osprey
, "Osprey permaseed" , "osp" ) ;
192 ( Brand_rufus
, "Rufus" , "ruf" ) ;
193 ( Brand_tribler
, "Tribler" , "trb" ) ;
194 ( Brand_cachelogic
, "CacheLogic" , "cl" ) ;
195 ( Brand_electricsheep
, "Electric sheep" , "els" ) ;
196 ( Brand_qbittorrent
, "qBittorrent" , "qbt" ) ;
197 ( Brand_qt4
, "QT4" , "qt4" ) ;
198 ( Brand_uleecher
, "uLeecher!" , "ul!" ) ;
199 ( Brand_flashget
, "FlashGet" , "flg" ) ;
200 ( Brand_xtorrent
, "Xtorrent" , "xto" ) ;
201 ( Brand_limewire
, "LimeWire" , "lwi" ) ;
202 ( Brand_btpd
, "BT Protocol Daemon" , "bpd" ) ;
203 ( Brand_btyrant
, "BitTyrant" , "bty" ) ;
204 ( Brand_ares
, "Ares" , "are" ) ;
205 ( Brand_bitpump
, "BitPump" , "bpu" ) ;
206 ( Brand_deluge
, "Deluge" , "del" ) ;
207 ( Brand_btuga
, "BTuga Revolution" , "btr" ) ;
208 ( Brand_tuotu
, "Tuotu" , "tuo" ) ;
209 ( Brand_xunlei
, "XunLei" , "xun" ) ;
210 ( Brand_foxtorrent
, "FoxTorrent" , "fox" ) ;
211 ( Brand_bitflu
, "BitFlu" , "flu" ) ;
212 ( Brand_oneswarm
, "OneSwarm" , "osw" ) ;
213 ( Brand_halite
, "Halite" , "hal" ) ;
214 ( Brand_miro
, "Miro" , "mir" ) ;
215 ( Brand_pando
, "Pando" , "pan" ) ;
218 let brand_count = List.length
brand_list
220 let brand_to_string brand
=
221 find_brand_to_string brand
brand_list false
223 let brand_to_string_short brand
=
224 find_brand_to_string brand
brand_list true
226 let brand_to_int brand
=
227 find_int_of_brand brand
brand_list
229 type tracker_status
=
232 | Disabled_mld
of string
233 | Disabled_failure
of (int * string)
236 [ `Http
of string (* url *)
237 | `Udp
of string * int (* host and port *)
241 client_client
: client
CommonClient.client_impl
;
242 mutable client_file
: file
;
243 mutable client_connection_control
: connection_control
;
244 mutable client_sock
: tcp_connection
;
245 mutable client_host
: Ip.t
* int;
246 mutable client_country_code
: int option;
247 mutable client_chunks
: (int64
* int64
) list
;
248 mutable client_uploader
: CommonSwarming.uploader
option;
249 mutable client_ranges_sent
: (int64
* int64
* CommonSwarming.range
) list
;
250 mutable client_range_waiting
:
251 (int64
* int64
* CommonSwarming.range
) option;
252 mutable client_chunk
: (int * CommonSwarming.uploader_block list
) option;
254 mutable client_received_peer_id
: bool;
255 mutable client_sent_choke
: bool; (* we sent a Choke to the client *)
256 mutable client_choked
: bool; (* we received a Choke from the client *)
257 mutable client_interested
: bool;
258 mutable client_uid
: Sha1.t
;
260 mutable client_brand
: brand
;
261 mutable client_release
: string;
263 mutable client_bitmap
: Bitv.t
option;
264 mutable client_new_chunks
: int list
;
266 mutable client_upload_requests
: (int * int64
* int64
) list
;
267 mutable client_allowed_to_write
: int64
;
268 mutable client_upload_rate
: Rate.t
;
269 mutable client_downloaded_rate
: Rate.t
;
270 mutable client_total_downloaded
: int64
;
271 mutable client_total_uploaded
: int64
;
272 mutable client_session_downloaded
: int64
;
273 mutable client_session_uploaded
: int64
;
274 mutable client_connect_time
: int;
276 mutable client_blocks_sent
: int list
;
277 mutable client_good
: bool;
278 mutable client_num_try
: int;
279 mutable client_alrd_sent_interested
: bool;
280 mutable client_alrd_sent_notinterested
: bool;
281 mutable client_interesting
: bool;
282 mutable client_incoming
: bool;
283 mutable client_registered_bitfield
: bool;
284 mutable client_last_optimist
: int;
286 mutable client_dht
: bool;
287 mutable client_cache_extension
: bool;
288 mutable client_fast_extension
: bool;
289 mutable client_utorrent_extension
: bool;
290 mutable client_azureus_messaging_protocol
: bool;
295 tracker_url
: tracker_url
;
296 mutable tracker_interval
: int;
297 mutable tracker_min_interval
: int;
298 mutable tracker_last_conn
: int;
299 mutable tracker_last_clients_num
: int;
300 mutable tracker_torrent_downloaded
: int;
301 mutable tracker_torrent_complete
: int;
302 mutable tracker_torrent_incomplete
: int;
303 mutable tracker_torrent_total_clients_count
: int;
304 mutable tracker_torrent_last_dl_req
: int;
305 mutable tracker_id
: string;
306 mutable tracker_key
: string;
307 mutable tracker_status
: tracker_status
;
311 file_file
: file
CommonFile.file_impl
;
312 file_piece_size
: int64
;
315 file_comment
: string;
316 file_created_by
: string;
317 file_creation_date
: int64
;
318 file_modified_by
: string;
319 file_encoding
: string;
320 mutable file_swarmer
: CommonSwarming.t
option;
321 mutable file_clients
: ((Ip.t
*int), client
) Hashtbl.t
;
322 mutable file_clients_num
: int ;
323 mutable file_chunks
: Sha1.t array
;
324 mutable file_files
: (string * int64
* string option) list
;
325 mutable file_blocks_downloaded
: int list
;
326 (* vvv probably a network specific value vvv ?what about file_downloaded?*)
327 mutable file_uploaded
: int64
;
328 mutable file_torrent_diskname
: string;
329 mutable file_trackers
: tracker_info list
;
330 mutable file_tracker_connected
: bool;
331 mutable file_completed_hook
: (file
-> unit);
332 mutable file_shared
: file
CommonShared.shared_impl
option;
333 (** session uploaded and downloaded bytes, for statistics reporting *)
334 mutable file_session_uploaded
: int64
;
335 mutable file_session_downloaded
: int64
;
337 mutable file_last_dht_announce
: int;
342 ft_file
: ft
CommonFile.file_impl
;
344 ft_filename
: string;
345 mutable ft_retry
: (ft
-> unit);