21 #ifndef BT_PEERPROTOCOLEXTENSION_H
22 #define BT_PEERPROTOCOLEXTENSION_H
24 #include <ktorrent_export.h>
25 #include <util/constants.h>
31 const Uint32 UT_PEX_ID = 1;
32 const Uint32 UT_METADATA_ID = 2;
37 class KTORRENT_EXPORT PeerProtocolExtension
40 PeerProtocolExtension(bt::Uint32
id,Peer* peer);
41 virtual ~PeerProtocolExtension();
44 virtual void update();
47 virtual bool needsUpdate()
const {
return false;}
50 virtual void handlePacket(
const bt::Uint8* packet, Uint32 size) = 0;
53 void sendPacket(
const QByteArray & data);
56 void changeID(Uint32
id);
65 #endif // BT_PEERPROTOCOLEXTENSION_H