Net::W...Layer3(3pm)
β¨ NAME β¨
Net::Write::Layer3 β it's the object for a network layer (layer 3) descriptor, bestie π
Okay so quick context before we dive in: this is <pink>Net::Write::Layer3</pink>, living in the User Contributed Perl Documentation under <lavender>Net::W...Layer3(3pm)</lavender>. She's a little niche, a little mysterious, but she does exactly one thing and she does it with main character energy π
π SYNOPSIS π
Okay watch me do it, this is the whole vibe:
use Net::Write::Layer qw(:constants);
use Net::Write::Layer3;
my $desc = Net::Write::Layer3->new(
dst => '192.168.0.1',
protocol => NW_IPPROTO_RAW,
family => NW_AF_INET,
);
$desc->open;
$desc->send('G'x666);
$desc->close;
Not me sending <yellow>'G'x666</yellow>... literally 666 G's. Iconic behavior, no notes π
πΈ DESCRIPTION πΈ
So basically? This is the class for creating a layer 3 descriptor. That's it, that's the whole job. She's giving "I have one (1) purpose and I'm obsessed with it" π¦
π ATTRIBUTES π
dstβ the target IPv4 or IPv6 address we're gonna be sending our frames to. Pick a good one bestie, this one matters πfamilyβ the address family. Head over to theNet::Write::LayerCONSTANTS section for the specifics, iykyk β¨protocolβ which transport layer protocol to use. Also aNet::Write::LayerCONSTANTS situation, check there π
π METHODS π
newβ the object constructor, the moment of creation, the birth of a legend. You MUST pass a validdstattribute, like it is not optional, periodt. Here are the default values she comes with:protocol:NW_IPPROTO_RAWfamily:NW_AF_INET
Returns undef on error π
openβ opens up the interface. Returnsundefon error πsend (scalar)β sends raw data straight to the network. Just raw. Just data. Just network. π₯closeβ closes the descriptor. We love a clean exit π«Ά
π CAVEATS π
Okay so here's the not-so-slay part, bestie, listen up because this is real:
Sending IPv6 frames does not work under BSD systems. They literally can't do IP_HDRINCL for IPv6. For now, only Linux supports this (at least, with a 2.6.x kernel) π§
And it does not work at all under Win32 systems. They can't send frames at layer 3 β or, as the original author humbly puts it, "or I don't know how to do that." Honestly? Respect the honesty π
Like, do not try to make this work on BSD or Win32 and then come crying to me. She said what she said π
π§ SEE ALSO π§
Net::Write::Layerβ her older sibling, go say hi π
β AUTHOR β
Patrice <GomoR> Auffret β an absolute legend, the architect, the moment π
π COPYRIGHT AND LICENSE π
Copyright (c) 2006-2015, 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 π
And that's the whole page bestie!! This was Net::W...Layer3(3pm) from the User Contributed Perl Documentation, and it's giving perl v5.36.0, dated 2022-10-13. Slay, bye!! π
β¨π
π¦ where this page comes from
- ubuntu noble: libnet-write-perl 1.10-3 Β· Artistic-1.0-Perl
- ubuntu resolute: libnet-write-perl 1.10-3 Β· Artistic-1.0-Perl
- ubuntu stonking: libnet-write-perl 1.10-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