2 // This file is part of the aMule Project.
4 // Copyright (c) 2008-2009 aMule Team ( admin@amule.org / http://www.amule.org )
5 // Copyright (c) 2008-2009 Stu Redman ( sturedman@amule.org )
6 // Copyright (C) 2002-2008 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
46 CCBBRecord(uint64 nStartPos
= 0, uint64 nEndPos
= 0, uint32 dwIP
= 0, EBBRStatus BBRStatus
= BBR_NONE
);
47 CCBBRecord(const CCBBRecord
& cv
) { *this = cv
; }
48 CCBBRecord
& operator=(const CCBBRecord
& cv
);
50 bool Merge(uint64 nStartPos
, uint64 nEndPos
, uint32 dwIP
, EBBRStatus BBRStatus
= BBR_NONE
);
51 bool CanMerge(uint64 nStartPos
, uint64 nEndPos
, uint32 dwIP
, EBBRStatus BBRStatus
= BBR_NONE
);
56 EBBRStatus m_BBRStatus
;
59 typedef std::vector
<CCBBRecord
> CRecordArray
;
62 class CCorruptionBlackBox
65 CCorruptionBlackBox() {}
66 ~CCorruptionBlackBox() {}
67 void Init(uint64 nFileSize
);
69 void TransferredData(uint64 nStartPos
, uint64 nEndPos
, const CUpDownClient
* pSender
);
70 void VerifiedData(uint64 nStartPos
, uint64 nEndPos
);
71 void CorruptedData(uint64 nStartPos
, uint64 nEndPos
);
72 void EvaluateData(uint16 nPart
);
76 std::vector
<CRecordArray
> m_aaRecords
;