/* */ #ifndef _D_HANDSHAKE_MESSAGE_H_ #define _D_HANDSHAKE_MESSAGE_H_ #include "common.h" #include "Util.h" #define PSTR "BitTorrent protocol" #define HANDSHAKE_MESSAGE_LENGTH 68 class HandshakeMessage { public: char pstrlen; string pstr; unsigned char infoHash[20]; char peerId[20]; public: HandshakeMessage() {} ~HandshakeMessage() {} string toString() const { return "handshake peerId="+ Util::urlencode((unsigned char*)peerId, sizeof(peerId)); } }; #endif // _D_HANDSHAKE_MESSAGE_H_