NAME

Net::Frame::ICMPv4::AddressMask - ICMPv4 AddressMask type object

SYNOPSIS

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

DESCRIPTION

This 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

type
code

Type and code fields. See CONSTANTS.

checksum

The checksum of ICMPv4 header.

identifier

Identification number.

sequenceNumber

Sequence number.

originateTimestamp
receiveTimestamp
transmitTimestamp

Three timestamps used by the NP_ICMPv4_TYPE_TIMESTAMP_REQUEST message.

addressMask

Used by the NP_ICMPv4_TYPE_ADDRESS_MASK_REQUEST message.

gateway

Used by the NP_ICMPv4_TYPE_REDIRECT message.

unused

Zero value field used in various ICMP messages.

error

A pointer to a Net::Packet::Frame object, usually set when an ICMP error message has been returned.

data

Additionnal data can be added to an ICMP message, traditionnaly used in NP_ICMPv4_TYPE_ECHO_REQUEST.

METHODS

new
pack
unpack
getLength
getPayloadLength
print

CONSTANTS

Load them: use Net::Packet::Consts qw(:icmpv4);

NP_ICMPv4_CODE_ZERO

ICMP code zero, used by various ICMP messages.

NP_ICMPv4_TYPE_DESTINATION_UNREACHABLE
NP_ICMPv4_CODE_NETWORK
NP_ICMPv4_CODE_HOST
NP_ICMPv4_CODE_PROTOCOL
NP_ICMPv4_CODE_PORT
NP_ICMPv4_CODE_FRAGMENTATION_NEEDED
NP_ICMPv4_CODE_SOURCE_ROUTE_FAILED

Destination unreachable type, with possible code numbers.

NP_ICMPv4_TYPE_REDIRECT
NP_ICMPv4_CODE_FOR_NETWORK
NP_ICMPv4_CODE_FOR_HOST
NP_ICMPv4_CODE_FOR_TOS_AND_NETWORK
NP_ICMPv4_CODE_FOR_TOS_AND_HOST

Redirect type message, with possible code numbers.

NP_ICMPv4_TYPE_TIME_EXCEEDED
NP_ICMPv4_CODE_TTL_IN_TRANSIT
NP_ICMPv4_CODE_FRAGMENT_REASSEMBLY

Time exceeded message, with possible code numbers.

NP_ICMPv4_TYPE_ECHO_REQUEST
NP_ICMPv4_TYPE_ECHO_REPLY
NP_ICMPv4_TYPE_TIMESTAMP_REQUEST
NP_ICMPv4_TYPE_TIMESTAMP_REPLY
NP_ICMPv4_TYPE_INFORMATION_REQUEST
NP_ICMPv4_TYPE_INFORMATION_REPLY
NP_ICMPv4_TYPE_ADDRESS_MASK_REQUEST
NP_ICMPv4_TYPE_ADDRESS_MASK_REPLY

Other request/reply ICMP messages types.

AUTHOR

Patrice <GomoR> Auffret

COPYRIGHT AND LICENSE

Copyright (c) 2006, Patrice <GomoR> Auffret

You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.