#ifndef cED2K_h #define cED2K_h #include "cVerify.h" class cED2K: public cVerify { private: eHASH Type; size_t file_size; unsigned char top[16]; unsigned char *nodes; unsigned char *status; public: cED2K (int fd); // Hash an Compleate file cED2K (int fd, int part, bool check); // Load from part.met virtual ~cED2K (); virtual bool Store (int fd); // Write it to part.met with its tags virtual int Verify (int fd, size_t *von, size_t *bis); // 1 mean Range is OK // 0 mean Range is defekt, but with request more hashes it can be defined smaller // -1 mean Range is defekt, this hash can not define it finer // -2 mean Range need more hash to be verified // -3 mean Range with this smal amount can not be verified // Range is modified to the first defekt virtual bool RequestHash (class cSocket *, size_t von, size_t bis); // Request Hash list that at least can check this range // and can be verified against the top hash virtual bool SendHash (class cSocket *, size_t von, size_t bis, size_t level); // Transmit the hashes that cover this range virtual bool SendInfo (class cSocket *, tRange_Map *); // Send info wich file Data is avail (verified) virtual tRange_Map* RequestInfo (class cSocket *); // Return the part list avail for this source }; #endif