Net::Frame::Layer::ICMPv6 - Internet Control Message Protocol v6 layer object
Contents
Attributes
typecode
Type and code fields. See CONSTANTS.
checksum
The checksum of ICMPv6 header.
The following are inherited attributes. See Net::Frame::Layer for more information.
rawpayloadnextLayerConstants
Load them: use Net::Frame::Layer::ICMPv6 qw(:consts);
Various types and codes for ICMPv6 header.
NF_ICMPv6_CODE_ZERONF_ICMPv6_TYPE_DESTUNREACHNF_ICMPv6_CODE_NOROUTENF_ICMPv6_CODE_ADMINPROHIBITEDNF_ICMPv6_CODE_NOTASSIGNEDNF_ICMPv6_CODE_ADDRESSUNREACHNF_ICMPv6_CODE_PORTUNREACHNF_ICMPv6_CODE_FAILPOLICYNF_ICMPv6_CODE_REJECTROUTENF_ICMPv6_TYPE_TOOBIGNF_ICMPv6_TYPE_TIMEEXCEEDNF_ICMPv6_CODE_HOPLIMITEXCEEDNF_ICMPv6_CODE_FRAGREASSEMBLYEXCEEDEDNF_ICMPv6_TYPE_PARAMETERPROBLEMNF_ICMPv6_CODE_ERRONEOUSHERDERFIELDNF_ICMPv6_CODE_UNKNOWNNEXTHEADERNF_ICMPv6_CODE_UNKNOWNOPTIONNF_ICMPv6_TYPE_ECHO_REQUESTNF_ICMPv6_TYPE_ECHO_REPLYNF_ICMPv6_TYPE_MLDQUERYNF_ICMPv6_TYPE_MLDREPORTv1NF_ICMPv6_TYPE_MLDDONENF_ICMPv6_TYPE_ROUTERSOLICITATIONNF_ICMPv6_TYPE_ROUTERADVERTISEMENTNF_ICMPv6_TYPE_NEIGHBORSOLICITATIONNF_ICMPv6_TYPE_NEIGHBORADVERTISEMENTNF_ICMPv6_TYPE_MLDREPORTv2NF_ICMPv6_OPTION_SOURCELINKLAYERADDRESSNF_ICMPv6_OPTION_TARGETLINKLAYERADDRESSNF_ICMPv6_OPTION_PREFIXINFORMATIONNF_ICMPv6_OPTION_REDIRECTEDHEADERNF_ICMPv6_OPTION_MTU
Various flags for some ICMPv6 messages.
NF_ICMPv6_FLAG_ROUTERNF_ICMPv6_FLAG_SOLICITEDNF_ICMPv6_FLAG_OVERRIDENF_ICMPv6_FLAG_MANAGEDADDRESSCONFIGURATIONNF_ICMPv6_FLAG_OTHERCONFIGURATIONNF_ICMPv6_FLAG_MOBILEIPv6HOMEAGENTNF_ICMPv6_FLAG_ROUTERSELECTIONPREFHIGHNF_ICMPv6_FLAG_ROUTERSELECTIONPREFMEDIUMNF_ICMPv6_FLAG_ROUTERSELECTIONPREFLOWNF_ICMPv6_FLAG_ROUTERSELECTIONPREFRESERVEDNF_ICMPv6_FLAG_NEIGHBORDISCOVERYPROXYCopyright And License
Copyright (c) 2006-2019, Patrice <GomoR> Auffret
You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the
source distribution archive.
perl v5.30.0 2019-12-26 Net::Frame::Layer::ICMPv6(3pm)
Description
This modules implements the encoding and decoding of the ICMPv6 layer.
RFC: http://www.rfc-editor.org/rfc/rfc4861.txt
RFC: http://www.rfc-editor.org/rfc/rfc4389.txt
RFC: http://www.rfc-editor.org/rfc/rfc4191.txt
RFC: http://www.rfc-editor.org/rfc/rfc3775.txt
RFC: http://www.rfc-editor.org/rfc/rfc2463.txt
RFC: http://www.rfc-editor.org/rfc/rfc2461.txt
RFC: http://www.rfc-editor.org/rfc/rfc2460.txt
See also Net::Frame::Layer for other attributes and methods.
Methods
newnew (hash)
Object constructor. You can pass attributes that will overwrite default ones. See SYNOPSIS for
default values.
computeChecksums
Computes the ICMPv6 checksum.
getKeygetKeyReverse
These two methods are basically used to increase the speed when using recv method from
Net::Frame::Simple. Usually, you write them when you need to write match method.
match (Net::Frame::Layer::ICMPv6 object)
This method is mostly used internally. You pass a Net::Frame::Layer::ICMPv6 layer as a parameter, and
it returns true if this is a response corresponding for the request, or returns false if not.
The following are inherited methods. Some of them may be overridden in this layer, and some others may
not be meaningful in this layer. See Net::Frame::Layer for more information.
layercomputeLengthscomputeChecksumspackunpackencapsulategetLengthgetPayloadLengthprintdumpName
Net::Frame::Layer::ICMPv6 - Internet Control Message Protocol v6 layer object
See Also
Net::Frame::Layer
Synopsis
use Net::Frame::Simple;
use Net::Frame::Layer::ICMPv6 qw(:consts);
my $icmp = Net::Frame::Layer::ICMPv6->new(
type => NF_ICMPv6_TYPE_ECHO_REQUEST,
code => NF_ICMPv6_CODE_ZERO,
checksum => 0,
);
# Build an ICMPv6 echo-request
use Net::Frame::Layer::ICMPv6::Echo;
my $echo = Net::Frame::Layer::ICMPv6::Echo->new(payload => 'echo');
my $echoReq = Net::Frame::Simple->new(layers => [ $icmp, $echo ]);
print $echoReq->print."\n";
# Build an ICMPv6 neighbor-solicitation
use Net::Frame::Layer::ICMPv6::NeighborSolicitation;
my $solicit = Net::Frame::Layer::ICMPv6::NeighborSolicitation->new(
targetAddress => $targetIpv6Address,
);
$icmp->type(NF_ICMPv6_TYPE_NEIGHBORSOLICITATION);
my $nsReq = Net::Frame::Simple->new(layers => [ $icmp, $solicit ]);
print $nsReq->print."\n";
#
# Read a raw layer
#
my $layer = Net::Frame::Layer::ICMPv6->new(raw => $raw);
print $layer->print."\n";
print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n"
if $layer->payload;
