Net::F...r::IPv6(3pm)
π 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. wasprotocolin IPv4.protocolβ this is just an alias fornextHeader. 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 bitsdstβ 32 bits β source and destination addresses.
and the following are inherited attributes β go read Net::Frame::Layer for more info:
rawpayloadnextLayer
π₯ METHODS π₯
new
newnew (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:
layercomputeLengthspackunpackencapsulategetLengthprintdump
π 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_ICMPv4NF_IPv6_PROTOCOL_IGMPNF_IPv6_PROTOCOL_IPIPNF_IPv6_PROTOCOL_TCPNF_IPv6_PROTOCOL_EGPNF_IPv6_PROTOCOL_IGRPNF_IPv6_PROTOCOL_CHAOSNF_IPv6_PROTOCOL_UDPNF_IPv6_PROTOCOL_IDPNF_IPv6_PROTOCOL_DCCPNF_IPv6_PROTOCOL_IPv6NF_IPv6_PROTOCOL_IPv6ROUTINGNF_IPv6_PROTOCOL_IPv6FRAGMENTNF_IPv6_PROTOCOL_IDRPNF_IPv6_PROTOCOL_RSVPNF_IPv6_PROTOCOL_GRENF_IPv6_PROTOCOL_ESPNF_IPv6_PROTOCOL_AHNF_IPv6_PROTOCOL_ICMPv6NF_IPv6_PROTOCOL_EIGRPNF_IPv6_PROTOCOL_OSPFNF_IPv6_PROTOCOL_ETHERIPNF_IPv6_PROTOCOL_PIMNF_IPv6_PROTOCOL_VRRPNF_IPv6_PROTOCOL_STPNF_IPv6_PROTOCOL_SCTPNF_IPv6_PROTOCOL_UDPLITENF_IPv6_PROTOCOL_IPv6HOPBYHOPNF_IPv6_PROTOCOL_GGPNF_IPv6_PROTOCOL_STNF_IPv6_PROTOCOL_CBTNF_IPv6_PROTOCOL_PUPNF_IPv6_PROTOCOL_ARGUSNF_IPv6_PROTOCOL_EMCONNF_IPv6_PROTOCOL_XNETNF_IPv6_PROTOCOL_MUXNF_IPv6_PROTOCOL_DCNMEASNF_IPv6_PROTOCOL_HMPNF_IPv6_PROTOCOL_PRMNF_IPv6_PROTOCOL_TRUNK1NF_IPv6_PROTOCOL_TRUNK2NF_IPv6_PROTOCOL_LEAF1NF_IPv6_PROTOCOL_LEAF2NF_IPv6_PROTOCOL_3PCNF_IPv6_PROTOCOL_IDPRNF_IPv6_PROTOCOL_XTPNF_IPv6_PROTOCOL_DDPNF_IPv6_PROTOCOL_IDPRCMTPNF_IPv6_PROTOCOL_TPPLUSPLUSNF_IPv6_PROTOCOL_ILNF_IPv6_PROTOCOL_SDRPNF_IPv6_PROTOCOL_IPv6NONEXTNF_IPv6_PROTOCOL_IPv6DESTINATIONNF_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 AND LICENSE π
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 πππ¦
π¦ where this page comes from
- debian bookworm: libnet-frame-layer-ipv6-perl 1.08-3 Β· Artistic-1.0-Perl
- debian trixie: libnet-frame-layer-ipv6-perl 1.08-3 Β· Artistic-1.0-Perl
- ubuntu noble: libnet-frame-layer-ipv6-perl 1.08-3 Β· Artistic-1.0-Perl
- ubuntu resolute: libnet-frame-layer-ipv6-perl 1.08-3 Β· Artistic-1.0-Perl
- ubuntu stonking: libnet-frame-layer-ipv6-perl 1.08-3 Β· Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms