Changeset View
Changeset View
Standalone View
Standalone View
src/dht/announcereq.h
Show All 28 Lines | 28 | { | |||
---|---|---|---|---|---|
29 | 29 | | |||
30 | /** | 30 | /** | ||
31 | * Announce request in the DHT protocol | 31 | * Announce request in the DHT protocol | ||
32 | */ | 32 | */ | ||
33 | class KTORRENT_EXPORT AnnounceReq : public GetPeersReq | 33 | class KTORRENT_EXPORT AnnounceReq : public GetPeersReq | ||
34 | { | 34 | { | ||
35 | public: | 35 | public: | ||
36 | AnnounceReq(); | 36 | AnnounceReq(); | ||
37 | AnnounceReq(const Key & id,const Key & info_hash,bt::Uint16 port,const Key & token); | 37 | AnnounceReq(const Key & id,const Key & info_hash,bt::Uint16 port,const QByteArray & token); | ||
38 | ~AnnounceReq() override; | 38 | ~AnnounceReq() override; | ||
39 | 39 | | |||
40 | void apply(DHT* dh_table) override; | 40 | void apply(DHT* dh_table) override; | ||
41 | void print() override; | 41 | void print() override; | ||
42 | void encode(QByteArray & arr) const override; | 42 | void encode(QByteArray & arr) const override; | ||
43 | void parse(bt::BDictNode* dict) override; | 43 | void parse(bt::BDictNode* dict) override; | ||
44 | 44 | | |||
45 | const Key & getToken() const {return token;} | 45 | const QByteArray & getToken() const {return token;} | ||
46 | bt::Uint16 getPort() const {return port;} | 46 | bt::Uint16 getPort() const {return port;} | ||
47 | 47 | | |||
48 | typedef QSharedPointer<AnnounceReq> Ptr; | 48 | typedef QSharedPointer<AnnounceReq> Ptr; | ||
49 | private: | 49 | private: | ||
50 | bt::Uint16 port; | 50 | bt::Uint16 port; | ||
51 | Key token; | 51 | QByteArray token; | ||
52 | }; | 52 | }; | ||
53 | 53 | | |||
54 | } | 54 | } | ||
55 | 55 | | |||
56 | #endif // DHT_ANNOUNCEREQ_H | 56 | #endif // DHT_ANNOUNCEREQ_H |