P2P::pDonkey::Packet - Perl extension for handling packets of eDonkey peer2peer protocol.
use P2P::pDonkey::Meta qw( makeClientInfo printInfo ); use P2P::pDonkey::Packet ':all'; use Data::Hexdumper; my $user = makeClientInfo(0, 4662, 'Muxer', 60); 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);
The module provides functions and constants for creating, packing and unpacking packets of eDonkey peer2peer protocol.
Returns string name of PT_TAG or 'Unknown(PT_TAG)' if name is unknown.
Unpacks data and places packet type in $pt. $offset is changed to last unpacked byte offset in $data. Packet header is not processed in unpackBody(), so $offset should be set on packet type byte offset. Returns list of unpacked data in success.
Packs user data in packet with PT_TAG type and returns byte string. packet header is not included in result.
Returns 1 if data starts with PT_HEADER byte.
Returns packed PT_HEADER byte.
Unpacks header and returns length of the following packet body.
Returns packed header.
Here listed data, returned by unpackBody() and passed to packBody() for each packet type.
None by default.
Alexey Klimkin, <klimkin@mail.ru>
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/>
To install P2P::pDonkey::Met, copy and paste the appropriate command in to your terminal.
cpanm
cpanm P2P::pDonkey::Met
CPAN shell
perl -MCPAN -e shell install P2P::pDonkey::Met
For more information on module installation, please visit the detailed CPAN module installation guide.