Net::W...Layer4(3pm)

πŸ“¦
version 1.10 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Net::Write::Layer4 ✨

okay bestie, gather round πŸ’– this is Net::Write::Layer4 from the User Contributed Perl Documentation, and it's giving transport layer descriptor energy. layer 4. the big leagues. we're sending raw data over the network and we're doing it with our whole chest 🫢


🌸 NAME 🌸

Net::Write::Layer4 β€” it's an object for a transport layer (layer 4) descriptor. that's it, that's the whole vibe.


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole thing in action, copy it exactly, no cap:

use Net::Write::Layer qw(:constants);
use Net::Write::Layer4;

my $desc = Net::Write::Layer4->new(
   dst      => '192.168.0.1',
   protocol => NW_IPPROTO_TCP,
   family   => NW_AF_INET,
);

$desc->open;
$desc->send('G'x666);
$desc->close;

look at her. open, send, close. a whole little lifecycle arc 😭✨ iconic.


πŸ’… DESCRIPTION πŸ’…

so basically: this is the class for creating a layer 4 descriptor. that's the tea. that's what she does. periodt.


πŸ¦‹ ATTRIBUTES πŸ¦‹

  • dst β€” the target IPv4 or IPv6 address that we're gonna send frames to. like, where the packets are going, bestie πŸ“¬
  • family β€” the address family. for the full list of options, go peek at the CONSTANTS section of Net::Write::Layer.
  • protocol β€” which transport layer protocol we're using. again, the CONSTANTS section of Net::Write::Layer has the whole menu πŸ“

⭐ METHODS ⭐

  • new β€” the object constructor, obviously πŸ’…. you MUST pass a valid dst attribute, no skipping that, she will not work without it. the default values are:
    • protocol: NW_IPPROTO_TCP
    • family: NW_AF_INET

and if something goes wrong? it returns undef on error. sad girl hours 😭

  • open β€” opens the interface. returns undef on error.
  • send (scalar) β€” sends raw data to the network. this is the main character moment honestly πŸ”₯
  • close β€” closes the descriptor. bye bestie πŸ‘‹

πŸ’€ CAVEATS πŸ’€

okay this one's important. it does not work at all under Win32 systems. like, not even a little. ngl it's because they can't send frames at layer 4. that's just the situation, we don't make the rules πŸ™ˆ

🌈 SEE ALSO 🌈

  • Net::Write::Layer β€” go read that one too, it's the family πŸ’œ

πŸ‘‘ AUTHOR πŸ‘‘

Patrice <GomoR> Auffret. an absolute legend, fr fr 🫢


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 for the full deets ✨


<aqua>and that's the whole page babes</aqua> πŸ¦‹ this was perl v5.36.0, dated 2022-10-13, and it's the Net::Write::Layer4 page from the User Contributed Perl Documentation. stan a layer 4 girlie. slay, stay safe, and always close your descriptors πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from