Net::F...r::IPv6(3pm)

πŸ“¦
version 1.08 Β· 2 versions
  • 1.08 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.08 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Net::Frame::Layer::IPv6 β€” the IPv6 layer object, bestie edition ✨

okay so real talk: this is the manual page for Net::Frame::Layer::IPv6, living in section 3pm of the User Contributed Perl Documentation. It's a Perl module, it's part of the Net::Frame family, and it is literally the whole Internet Protocol v6 header as a cute little object you can pack, unpack, and poke at. main character energy only. πŸ‘‘


🌸 NAME 🌸

Net::Frame::Layer::IPv6 β€” the Internet Protocol v6 layer object. that's it, that's the vibe.


✨ SYNOPSIS ✨

here's how you actually use it, copy-paste core:

use Net::Frame::Layer::IPv6 qw(:consts);

# Build a layer
my $layer = Net::Frame::Layer::IPv6->new(
   version       => 6,
   trafficClass  => 0,
   flowLabel     => 0,
   nextHeader    => NF_IPv6_PROTOCOL_TCP,
   hopLimit      => 0xff,
   src           => '::1',
   dst           => '::1',
   payloadLength => 0,
);
$layer->pack;

print 'RAW: '.$layer->dump."\n";

# Read a raw layer
my $layer = Net::Frame::Layer::IPv6->new(raw = $raw);

print $layer->print."\n";
print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n"
   if $layer->payload;

like yes, you build a layer, you pack it, you dump the raw bytes, and then you can read one back. it's giving "craft packets in my bedroom at 2am". πŸ¦‹


πŸŽ€ DESCRIPTION πŸŽ€

so this module implements the encoding and decoding of the IPv6 layer. both directions. it's a full bi queen. πŸ’…

RFC, for the girlies who want the receipts: ftp://ftp.rfc-editor.org/in-notes/rfc2460.txt

also, check out Net::Frame::Layer for other attributes and methods, because a lot of the good stuff is inherited from up there.


πŸ‘‘ ATTRIBUTES πŸ‘‘

every single one, no skipping, periodt:

  • version β€” 4 bits β€” the version of the Internet Protocol header.
  • trafficClass β€” 8 bits β€” the traffic class field. this was called Type of Service back in IPv4, if you're feeling nostalgic.
  • flowLabel β€” 20 bits β€” the flow label class field. it was the IP ID in IPv4. glow-up fr fr.
  • nextHeader β€” 8 bits β€” the type of the next header. was protocol in IPv4.
  • protocol β€” this is just an alias for nextHeader. same girl, different name. 🫢
  • payloadLength β€” 16 bits β€” the length in bytes of the encapsulated layers. usually that means layer 4 plus layer 7, iykyk.
  • hopLimit β€” 8 bits β€” was the TTL field in IPv4. it got a rebrand.
  • src β€” 32 bits
  • dst β€” 32 bits β€” source and destination addresses.

and the following are inherited attributes β€” go read Net::Frame::Layer for more info:

  • raw
  • payload
  • nextLayer

πŸ”₯ METHODS πŸ”₯

new

  • new
  • new (hash) β€” object constructor. you can pass attributes and they'll overwrite the default ones. peek at SYNOPSIS for what the default values look like.

computeLengths

  • computeLengths ({ payloadLength => VALUE }) β€” so here's the thing: to compute the length attributes inside the IPv6 header, you gotta hand it, via a hashref, the number of bytes sitting in the IPv6 payload. and that means the sum of all the layers that come after the IPv6 one. no cap.

the following are inherited methods. some of them may be overridden in this layer, and some others may just not be meaningful in this layer at all. see Net::Frame::Layer for more:

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

🌈 CONSTANTS 🌈

load them like this, bestie:

use Net::Frame::Layer::IPv6 qw(:consts);

these are all the constants for the nextHeader attribute β€” all 54 of them, every last one, we do not gatekeep:

  • NF_IPv6_PROTOCOL_ICMPv4
  • NF_IPv6_PROTOCOL_IGMP
  • NF_IPv6_PROTOCOL_IPIP
  • NF_IPv6_PROTOCOL_TCP
  • NF_IPv6_PROTOCOL_EGP
  • NF_IPv6_PROTOCOL_IGRP
  • NF_IPv6_PROTOCOL_CHAOS
  • NF_IPv6_PROTOCOL_UDP
  • NF_IPv6_PROTOCOL_IDP
  • NF_IPv6_PROTOCOL_DCCP
  • NF_IPv6_PROTOCOL_IPv6
  • NF_IPv6_PROTOCOL_IPv6ROUTING
  • NF_IPv6_PROTOCOL_IPv6FRAGMENT
  • NF_IPv6_PROTOCOL_IDRP
  • NF_IPv6_PROTOCOL_RSVP
  • NF_IPv6_PROTOCOL_GRE
  • NF_IPv6_PROTOCOL_ESP
  • NF_IPv6_PROTOCOL_AH
  • NF_IPv6_PROTOCOL_ICMPv6
  • NF_IPv6_PROTOCOL_EIGRP
  • NF_IPv6_PROTOCOL_OSPF
  • NF_IPv6_PROTOCOL_ETHERIP
  • NF_IPv6_PROTOCOL_PIM
  • NF_IPv6_PROTOCOL_VRRP
  • NF_IPv6_PROTOCOL_STP
  • NF_IPv6_PROTOCOL_SCTP
  • NF_IPv6_PROTOCOL_UDPLITE
  • NF_IPv6_PROTOCOL_IPv6HOPBYHOP
  • NF_IPv6_PROTOCOL_GGP
  • NF_IPv6_PROTOCOL_ST
  • NF_IPv6_PROTOCOL_CBT
  • NF_IPv6_PROTOCOL_PUP
  • NF_IPv6_PROTOCOL_ARGUS
  • NF_IPv6_PROTOCOL_EMCON
  • NF_IPv6_PROTOCOL_XNET
  • NF_IPv6_PROTOCOL_MUX
  • NF_IPv6_PROTOCOL_DCNMEAS
  • NF_IPv6_PROTOCOL_HMP
  • NF_IPv6_PROTOCOL_PRM
  • NF_IPv6_PROTOCOL_TRUNK1
  • NF_IPv6_PROTOCOL_TRUNK2
  • NF_IPv6_PROTOCOL_LEAF1
  • NF_IPv6_PROTOCOL_LEAF2
  • NF_IPv6_PROTOCOL_3PC
  • NF_IPv6_PROTOCOL_IDPR
  • NF_IPv6_PROTOCOL_XTP
  • NF_IPv6_PROTOCOL_DDP
  • NF_IPv6_PROTOCOL_IDPRCMTP
  • NF_IPv6_PROTOCOL_TPPLUSPLUS
  • NF_IPv6_PROTOCOL_IL
  • NF_IPv6_PROTOCOL_SDRP
  • NF_IPv6_PROTOCOL_IPv6NONEXT
  • NF_IPv6_PROTOCOL_IPv6DESTINATION
  • NF_IPv6_PROTOCOL_IPv6MOBILITY

🧚 SEE ALSO 🧚

  • Net::Frame::Layer

go read it, it's the parent, respect your elders. πŸ’œ


πŸ“ AUTHOR πŸ“

Patrice <GomoR> Auffret β€” icon behavior. ✨


Copyright (c) 2006-2017, 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.


okay that's the whole page, you ate it up. this one's documented as perl v5.36.0, dated 2022-11-19 β€” so if you're reading this in the group chat later, that's the version and date stamp on this manual page. mwah, bye bestie πŸ’–πŸŽ€πŸ¦‹