NAME
P2P::pDonkey::Packet - Perl extension for handling packets of eDonkey peer2peer protocol.
SYNOPSIS
use Digest::MD4;
use P2P::pDonkey::Meta qw( makeClientInfo printInfo );
use P2P::pDonkey::Packet ':all';
use Data::Hexdumper;
my $user = makeClientInfo('Muxer', 0, 60, 4662);
my $raw = packBody(PT_HELLO, $user);
print hexdump(data => $raw);
my ($off, $pt) = (0);
$user = unpackBody(\$pt, $raw, $off);
print "Packet type: ", PacketTagName($pt), "\n";
printInfo($user);
DESCRIPTION
The module provides functions and constants for creating, packing and unpacking packets of eDonkey peer2peer protocol.
- PacketTagName(PT_TAG)
-
Returns string name of PT_TAG or 'Unknown(PT_TAG)' if name is unknown.
- unpackBody(\$pt, $data, $off)
-
Unpacks data and places packet type in $pt. $off is changed to last unpacked byte offset in $data. Packet header is not processed in unpackBody(), so $off should be set on packet type byte offset. Returns list of unpacked data in success.
- packBody(PT_TAG, ...)
-
Packs user data in packet with PT_TAG type and returns byte string. packet header is not included in result.
eDonkey packet types
Here listed data, returned by unpackBody() and passed to packBody()
for each packet type.
- PT_HELLO
- PT_HELLOSERVER
- PT_HELLOCLIENT
- PT_BADPROTOCOL
- PT_GETSERVERLIST
- PT_OFFERFILES
- PT_SEARCHFILE
- PT_GETSOURCES
- PT_SEARCHUSER
- PT_IPREQUEST
- PT_MORERESULTS
- PT_SERVERLIST
- PT_SEARCHFILERES
- PT_SERVERSTATUS
- PT_IPREQUESTANS
- PT_IPREQUESTFAIL
- PT_SERVERMESSAGE
- PT_IDCHANGE
- PT_SERVERINFO
- PT_FOUNDSOURCES
- PT_SEARCHUSERRES
- PT_SENDINGPART
- PT_REQUESTPARTS
- PT_NOSUCHFILE
- PT_ENDOFOWNLOAD
- PT_VIEWFILES
- PT_VIEWFILESANS
- PT_HELLOANSWER
- PT_NEWCLIENTID
- PT_MESSAGE
- PT_FILESTATUSREQ
- PT_FILESTATUS
- PT_HASHSETREQUEST
- PT_HASHSETANSWER
- PT_UPLOADREQUEST
- PT_UPLOADACCEPT
- PT_CANCELTRANSFER
- PT_OUTOFPARTS
- PT_FILEREQUEST
- PT_FILEREQANSWER
- PT_UDP_SERVERSTATUSREQ
- PT_UDP_SERVERSTATUS
- PT_UDP_SEARCHFILE
- PT_UDP_SEARCHFILERES
- PT_UDP_GETSOURCES
- PT_UDP_FOUNDSOURCES
- PT_UDP_CALLBACKREQUEST
- PT_UDP_GETSERVERLIST
- PT_UDP_SERVERLIST
EXPORT
None by default.
AUTHOR
Alexey Klimkin, <klimkin@mail.ru>
SEE ALSO
eDonkey home:
<http://www.edonkey2000.com/>
Basic protocol information:
<http://hitech.dk/donkeyprotocol.html>
<http://www.schrevel.com/edonkey/>
Client stuff:
<http://www.emule-project.net/>
<http://www.nongnu.org/mldonkey/>
Server stuff:
<http://www.thedonkeynetwork.com/>