Net::F...:ICMPv6(3pm)
π Net::Frame::Layer::ICMPv6 β the vibe π
okay bestie, gather round, because today we're building Internet Control Message Protocol v6 layer objects and honestly? it's giving networking royalty. π This page lives in the User Contributed Perl Documentation section, and yes, that manual name up top is Net::Frame::Layer::ICMPv6(3pm) β say it with your chest. π«Ά
β¨ NAME β¨
Net::Frame::Layer::ICMPv6 β the Internet Control Message Protocol v6 layer object, aka your new fave little packet-builder. πΈ
π¦ SYNOPSIS π¦
no thoughts, just code. copy it, run it, slay. π
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;
π DESCRIPTION π
so basically, this module handles the encoding and decoding of the ICMPv6 layer. that's it, that's the whole job, and it does it beautifully. β¨
and because the RFCs are the blueprint of our lives, here they all are, fr fr:
- 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
also, peep Net::Frame::Layer for other attributes and methods β it's the parent, the blueprint, the blueprint's blueprint. π§
π ATTRIBUTES π
type
code
type and code fields, bestie. the dynamic duo. go look at CONSTANTS for all the values you can throw at them. π
checksum
the checksum of the ICMPv6 header. the lil integrity check that keeps everything honest. π«Ά
the following ones are inherited attributes β they didn't come from this module, they were born into it. check Net::Frame::Layer for more info:
rawpayloadnextLayer
π METHODS π
new
new (hash)
the object constructor, aka the birth of your layer. π± you can pass in attributes and they'll overwrite the default ones. peep the SYNOPSIS for what the default values look like.
computeChecksums
computes the ICMPv6 checksum. the math is mathing. π₯
getKey
getKeyReverse
these two are basically here to make stuff fast when you're using the recv method from Net::Frame::Simple. usually you write these when you need to write a match method. lowkey a speedrun strat. β
match (Net::Frame::Layer::ICMPv6 object)
mostly an internal-use situation. you hand it a Net::Frame::Layer::ICMPv6 layer as a parameter, and it comes back true if this is a response corresponding for the request β or false if it's not. vibe check: passed or failed. π
and these are the inherited methods. some of them might be overridden in this layer, and some of them might not even be meaningful here β no shade. check Net::Frame::Layer for more info:
layercomputeLengthscomputeChecksumspackunpackencapsulategetLengthgetPayloadLengthprintdump
π CONSTANTS π
load them like this, bestie:
use Net::Frame::Layer::ICMPv6 qw(:consts);
various types and codes for the ICMPv6 header. here's the full roster, no one left behind: π
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
and various flags for some ICMPv6 messages. iconic behavior only: π
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_NEIGHBORDISCOVERYPROXY
πΈ SEE ALSO πΈ
Net::Frame::Layer
π«Ά AUTHOR π«Ά
Patrice <GomoR> Auffret β legend behavior, honestly. π
π COPYRIGHT AND LICENSE π
Copyright (c) 2006-2019, Patrice <GomoR> Auffret
you may distribute this module under the terms of the Artistic license. see the LICENSE.Artistic file in the source distribution archive for the deets. π
and that's the whole page, bestie!! π¦ this one's riding with perl v5.30.0, dated 2019-12-26, and it's filed under Net::F...:ICMPv6(3pm) in the User Contributed Perl Documentation. go build some packets, you absolute main character. β¨ππ
π¦ where this page comes from
- debian bookworm: libnet-frame-layer-icmpv6-perl 1.11-1 Β· Artistic-1.0-Perl
- debian trixie: libnet-frame-layer-icmpv6-perl 1.11-1 Β· Artistic-1.0-Perl
- ubuntu jammy: libnet-frame-layer-icmpv6-perl 1.11-1 Β· Artistic-1.0-Perl
- ubuntu noble: libnet-frame-layer-icmpv6-perl 1.11-1 Β· Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms