2 // This file is part of the aMule Project.
4 // Copyright (c) 2008-2011 aMule Team ( admin@amule.org / http://www.amule.org )
5 // Copyright (c) 2008-2011 Stu Redman ( sturedman@amule.org )
6 // Copyright (C) 2002-2011 Merkur ( strEmail.Format("%s@%s", "devteam", "emule-project.net") / http://www.emule-project.net )
8 // Any parts of this program derived from the xMule, lMule or eMule project,
9 // or contributed by third-party developers are copyrighted by their
10 // respective authors.
12 // This program is free software; you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation; either version 2 of the License, or
15 // (at your option) any later version.
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #ifndef CORRUPTIONBLACKBOX_H
28 #define CORRUPTIONBLACKBOX_H
34 class CCorruptionBlackBox
38 void TransferredData(uint64 nStartPos
, uint64 nEndPos
, uint32 senderIP
);
39 void VerifiedData(bool ok
, uint16 nPart
, uint32 nRelStartPos
, uint32 nRelEndPos
);
41 void SetPartFileInfo(const wxString
& name
, const wxString
& nr
) { m_fileName
= name
; m_partNumber
= nr
; }
45 // downloaded data for each part
49 CCBBRecord(uint32 nStartPos
, uint32 nEndPos
, uint32 dwIP
);
50 bool Merge(uint32 nStartPos
, uint32 nEndPos
, uint32 dwIP
);
52 // Startpos / Endpos relative to part
58 typedef std::list
<CCBBRecord
> CRecordList
;
59 std::map
<uint16
, CRecordList
> m_Records
;
61 // good/bad data for each client
65 CCBBClient() { m_downloaded
= 0; }
68 typedef std::map
<uint32
, CCBBClient
> CCBBClientMap
;
69 CCBBClientMap m_goodClients
, m_badClients
;
73 wxString m_partNumber
;