The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

P2P::pDonkey::Packet - Perl extension for handling packets of eDonkey peer2peer protocol.

SYNOPSIS

    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);

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, $offset)
    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.
    
packBody(PT_TAG, ...)
    Packs user data in packet with PT_TAG type and returns byte string.
    packet header is not included in result.
unpackUDPHeader($data, $offset)
    Returns 1 if data starts with PT_HEADER byte.
    
packUDPHeader()
    Returns packed PT_HEADER byte.
    
unpackTCPHeader($data, $offset)
    Unpacks header and returns length of the following packet body.
    
packTCPHeader($length)
    Returns packed header.
    

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