Upstream tarball 10184
[amule.git] / src / include / protocol / ed2k / Constants.h
blobd286b808d7a956678ad5ac329da76168f33fd693
1 //
2 // This file is part of the aMule Project.
3 //
4 // Copyright (c) 2003-2008 aMule Team ( admin@amule.org / http://www.amule.org )
5 // Copyright (c) 2002-2008 Merkur ( devs@emule-project.net / http://www.emule-project.net )
6 //
7 // Any parts of this program derived from the xMule, lMule or eMule project,
8 // or contributed by third-party developers are copyrighted by their
9 // respective authors.
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2 of the License, or
14 // (at your option) any later version.
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #ifndef ED2KCONSTANTS_H
27 #define ED2KCONSTANTS_H
29 #include <common/Macros.h>
31 // MOD Note: Do not change this part - Merkur
33 // Timeouts & Reask times
34 #define CONNECTION_TIMEOUT 40000 // set this lower if you want less connections at once, set it higher if you have enough sockets (edonkey has its own timout too, so a very high value won't effect this)
35 #define FILEREASKTIME 1300000 // 1300000 <- original value ***
36 #define SERVERREASKTIME 800000 // don't set this too low, it wont speed up anything, but it could kill amule or your internetconnection
37 #define UDPSERVERREASKTIME 1300000 // 1300000 <- original value ***
38 #define SOURCECLIENTREASKS MIN2MS(40) //40 mins
39 #define SOURCECLIENTREASKF MIN2MS(5) //5 mins
40 #define UDPSERVERSTATTIME SEC2MS(5) //5 secs
41 #define UDPSERVSTATREASKTIME HR2MS(4.5) //4 hours - eMule uses HR2S, we are based on GetTickCount, hence MS
42 #define UDPSERVSTATMINREASKTIME MIN2MS(20) //minimum time between two pings even when trying to force a premature ping for a new UDP key
43 #define MINCOMMONPENALTY 4 // For file sources reask
45 #define ED2KREPUBLISHTIME MIN2MS(1) //1 min
47 #define UDPMAXQUEUETIME SEC2MS(30) //30 Seconds
49 #define RSAKEYSIZE 384 //384 bits
51 #define MAX_SOURCES_FILE_SOFT 500
52 #define MAX_SOURCES_FILE_UDP 50
54 #define MAXFILECOMMENTLEN 50
56 #define MIN_UP_CLIENTS_ALLOWED 2 // min. clients allowed to download regardless UPLOAD_CLIENT_DATARATE or any other factors. Don't set this too high
58 #define SOURCEEXCHANGE2_VERSION 4 // replaces the version sent in MISC_OPTIONS flag from SX1
60 // MOD Note: end
62 #define MAXCONPER5SEC 20
63 #define MAX_UP_CLIENTS_ALLOWED 250 // max. clients allowed regardless UPLOAD_CLIENT_DATARATE or any other factors. Don't set this too low, use DATARATE to adjust uploadspeed per client
64 #define DOWNLOADTIMEOUT 100000
65 #define CONSERVTIMEOUT 25000 // agelimit for pending connection attempts
66 #define RARE_FILE 50
67 #define MIN_REQUESTTIME 590000
68 #define MAX_PURGEQUEUETIME HR2MS(1)
69 #define PURGESOURCESWAPSTOP MIN2MS(15) // How long forbid swapping a source to a certain file (NNP,...)
70 #define CONNECTION_LATENCY 22050 // latency for responces
71 #define CLIENTBANTIME HR2MS(2) // 2h
72 #define TRACKED_CLEANUP_TIME HR2MS(1)
73 #define KEEPTRACK_TIME HR2MS(2) // how long to keep track of clients which were once in the uploadqueue
74 #define CLIENTLIST_CLEANUP_TIME MIN2MS(34) // 34 min
76 // (4294967295/PARTSIZE)*PARTSIZE = ~4GB
77 #define OLD_MAX_FILE_SIZE 4290048000ull
79 // = 2^38 = 256GB
80 #define MAX_FILE_SIZE 0x4000000000ull
82 const uint64 PARTSIZE = 9728000ull;
83 const uint32 BLOCKSIZE = 184320u;
84 const uint32 EMBLOCKSIZE = 184320u;
86 #define INV_SERV_DESC_LEN 0xF0FF // Used as an 'invalid' string len for OP_SERVER_DESC_REQ/RES
88 // This 'identifier' is used for referencing shared part (incomplete) files with the OP_ASKSHAREDDIRS and related opcodes
89 // it was introduced with eDonkeyHybrid and is considered as part of the protocol.
90 #define OP_INCOMPLETE_SHARED_FILES wxT("!Incomplete Files")
92 // ed2k search expression comparison operators
93 // kad operators used to be different, but are the same since eMule 0.47a
94 enum ed2k_search_compare {
95 ED2K_SEARCH_OP_EQUAL = 0, // eserver 16.45+
96 ED2K_SEARCH_OP_GREATER, // dserver
97 ED2K_SEARCH_OP_LESS, // dserver
98 ED2K_SEARCH_OP_GREATER_EQUAL, // eserver 16.45+
99 ED2K_SEARCH_OP_LESS_EQUAL, // eserver 16.45+
100 ED2K_SEARCH_OP_NOTEQUAL
103 #endif // ED2KCONSTANTS_H