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.

EXPORT

None by default.

AUTHOR

Alexey Klimkin, <klimkin@mail.ru>

SEE ALSO

perl, P2P::pDonkey::Meta.

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/>