/* This Work is under GPL provided with this work. This work is based on the java implementation of the Kademlia protocol. Kademlia: Peer-to-peer routing based on the XOR metric Copyright (C) 2002 Petar Maymounkov [petar@post.harvard.edu] http://kademlia.scs.cs.nyu.edu and This work is bassed on translation from Barry Dunne to C++ Copyright (C)2003 Barry Dunne (http://www.emule-project.net) */ #ifndef cPeer_h #define cPeer_h #include "cygwin.h" #include "cHash.h" class cPeer { private: class cHash hash; class cHash dist; char* name; public: uint32_t version; time_t expires; uint32_t ip; uint16_t udp; uint16_t tcp; uint8_t type; bool madeContact; cPeer (); cPeer (const uint8_t *KEY, uint32_t IP, uint16_t UDP, uint8_t TYPE); cPeer (const uint8_t *KEY, uint32_t IP, uint16_t UDP, uint8_t TYPE, const char *NAME, uint16_t TCP); ~cPeer ( ); void set_Hash(const uint8_t *KEY ); void set_Name(const char *NAME); const class cHash* get_Hash(void) const { return &hash; } const class cHash* get_Dist(void) const { return &dist; } const char* get_Name(void) const { return name; } }; #endif