![]() |
![]()
| ![]() |
![]()
NAMENet::Packet::ICMPv4 - Internet Control Message Protocol v4 layer 4 object SYNOPSISuse Net::Packet::Consts qw(:icmpv4); require Net::Packet::ICMPv4; # Build echo-request header my $echo = Net::Packet::ICMPv4->new(data => '0123456789'); # Build information-request header my $info = Net::Packet::ICMPv4->new( type => NP_ICMPv4_TYPE_INFORMATION_REQUEST, data => '0123456789', ); # Build address-mask request header my $mask = Net::Packet::ICMPv4->new( type => NP_ICMPv4_TYPE_ADDRESS_MASK_REQUEST, data => '0123456789', ); # Build timestamp request header my $timestamp = Net::Packet::ICMPv4->new( type => NP_ICMPv4_TYPE_TIMESTAMP_REQUEST, data => '0123456789', ); $timestamp->pack; print 'RAW: '.unpack('H*', $timestamp->raw)."\n"; # Read a raw layer my $layer = Net::Packet::ICMPv4->new(raw => $raw); print $layer->print."\n"; print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n" if $layer->payload; DESCRIPTIONThis modules implements the encoding and decoding of the ICMPv4 layer. RFC: ftp://ftp.rfc-editor.org/in-notes/rfc792.txt See also Net::Packet::Layer and Net::Packet::Layer4 for other attributes a nd methods. ATTRIBUTES
METHODS
CONSTANTSLoad them: use Net::Packet::Consts qw(:icmpv4);
AUTHORPatrice <GomoR> Auffret COPYRIGHT AND LICENSECopyright (c) 2004-2009, Patrice <GomoR> Auffret You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive. RELATED MODULESNetPacket, Net::RawIP, Net::RawSock
|