Net::F...:ICMPv6(3pm)

πŸ“¦
version 1.11 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– 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:

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:

  • raw
  • payload
  • nextLayer

πŸ’… 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:

  • layer
  • computeLengths
  • computeChecksums
  • pack
  • unpack
  • encapsulate
  • getLength
  • getPayloadLength
  • print
  • dump

πŸ‘‘ 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_ZERO
  • NF_ICMPv6_TYPE_DESTUNREACH
  • NF_ICMPv6_CODE_NOROUTE
  • NF_ICMPv6_CODE_ADMINPROHIBITED
  • NF_ICMPv6_CODE_NOTASSIGNED
  • NF_ICMPv6_CODE_ADDRESSUNREACH
  • NF_ICMPv6_CODE_PORTUNREACH
  • NF_ICMPv6_CODE_FAILPOLICY
  • NF_ICMPv6_CODE_REJECTROUTE
  • NF_ICMPv6_TYPE_TOOBIG
  • NF_ICMPv6_TYPE_TIMEEXCEED
  • NF_ICMPv6_CODE_HOPLIMITEXCEED
  • NF_ICMPv6_CODE_FRAGREASSEMBLYEXCEEDED
  • NF_ICMPv6_TYPE_PARAMETERPROBLEM
  • NF_ICMPv6_CODE_ERRONEOUSHERDERFIELD
  • NF_ICMPv6_CODE_UNKNOWNNEXTHEADER
  • NF_ICMPv6_CODE_UNKNOWNOPTION
  • NF_ICMPv6_TYPE_ECHO_REQUEST
  • NF_ICMPv6_TYPE_ECHO_REPLY
  • NF_ICMPv6_TYPE_MLDQUERY
  • NF_ICMPv6_TYPE_MLDREPORTv1
  • NF_ICMPv6_TYPE_MLDDONE
  • NF_ICMPv6_TYPE_ROUTERSOLICITATION
  • NF_ICMPv6_TYPE_ROUTERADVERTISEMENT
  • NF_ICMPv6_TYPE_NEIGHBORSOLICITATION
  • NF_ICMPv6_TYPE_NEIGHBORADVERTISEMENT
  • NF_ICMPv6_TYPE_MLDREPORTv2
  • NF_ICMPv6_OPTION_SOURCELINKLAYERADDRESS
  • NF_ICMPv6_OPTION_TARGETLINKLAYERADDRESS
  • NF_ICMPv6_OPTION_PREFIXINFORMATION
  • NF_ICMPv6_OPTION_REDIRECTEDHEADER
  • NF_ICMPv6_OPTION_MTU

and various flags for some ICMPv6 messages. iconic behavior only: πŸŽ€

  • NF_ICMPv6_FLAG_ROUTER
  • NF_ICMPv6_FLAG_SOLICITED
  • NF_ICMPv6_FLAG_OVERRIDE
  • NF_ICMPv6_FLAG_MANAGEDADDRESSCONFIGURATION
  • NF_ICMPv6_FLAG_OTHERCONFIGURATION
  • NF_ICMPv6_FLAG_MOBILEIPv6HOMEAGENT
  • NF_ICMPv6_FLAG_ROUTERSELECTIONPREFHIGH
  • NF_ICMPv6_FLAG_ROUTERSELECTIONPREFMEDIUM
  • NF_ICMPv6_FLAG_ROUTERSELECTIONPREFLOW
  • NF_ICMPv6_FLAG_ROUTERSELECTIONPREFRESERVED
  • NF_ICMPv6_FLAG_NEIGHBORDISCOVERYPROXY

🌸 SEE ALSO 🌸

  • Net::Frame::Layer

🫢 AUTHOR 🫢

Patrice <GomoR> Auffret β€” legend behavior, honestly. πŸ’–


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. βœ¨πŸ‘‘πŸ’