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

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

πŸ’– NAME πŸ’–

Net::Frame::Layer::NULL β€” it's the BSD loopback layer object, bestie. That's the whole vibe. It's a Perl module, it lives in the User Contributed Perl Documentation, and it's here to handle the BSD loopback layer for you. πŸ¦‹


✨ SYNOPSIS ✨

Okay so here's how you actually use it, no cap:

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

# Build a layer
my $layer = Net::Frame::Layer::NULL->new(
   type => NF_NULL_TYPE_IPv4,
);
$layer->pack;

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

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

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

Build it, pack it, dump it, read it back. Iconic behaviour, honestly. πŸ’…


🌸 DESCRIPTION 🌸

So this module is the one that implements the encoding and decoding of the BSD loopback layer. That's its whole job and it ate. πŸ”₯

Also, see Net::Frame::Layer for other attributes and methods β€” that's where the rest of the lore lives. πŸ‘‘


πŸŽ€ ATTRIBUTES πŸŽ€

  • type β€” stores the type of encapsulated layer. That's it, that's the one this layer brings to the table. πŸ’–

The following are inherited attributes. See Net::Frame::Layer for more information:

  • raw
  • payload
  • nextLayer

πŸ’œ METHODS πŸ’œ

new

new (hash)

Object constructor. You can pass attributes that will overwrite default ones β€” yes bestie, you get to customise. See SYNOPSIS for default values. 🫢

The following are inherited methods. Heads up though: some of them may be overridden in this layer, and some others may not be meaningful in this layer (not me warning you in advance 😭). See Net::Frame::Layer for more information.

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

🌈 CONSTANTS 🌈

Load them like this, don't forget:

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

Then you've got the whole squad of supported encapsulated layer types:

  • NF_NULL_TYPE_IPv4
  • NF_NULL_TYPE_ARP
  • NF_NULL_TYPE_CGMP
  • NF_NULL_TYPE_80211
  • NF_NULL_TYPE_DDP
  • NF_NULL_TYPE_AARP
  • NF_NULL_TYPE_WCP
  • NF_NULL_TYPE_8021Q
  • NF_NULL_TYPE_IPX
  • NF_NULL_TYPE_STP
  • NF_NULL_TYPE_IPv6
  • NF_NULL_TYPE_WLCCP
  • NF_NULL_TYPE_PPPoED
  • NF_NULL_TYPE_PPPoES
  • NF_NULL_TYPE_8021X
  • NF_NULL_TYPE_AoE
  • NF_NULL_TYPE_LLDP
  • NF_NULL_TYPE_LOOP
  • NF_NULL_TYPE_VLAN
  • NF_NULL_TYPE_ETH

Various supported encapsulated layer types. Twenty of them. We love a complete list. ✨


πŸ‘€ SEE ALSO πŸ‘€

  • Net::Frame::Layer

πŸ‘‘ AUTHOR πŸ‘‘

Patrice <GomoR> Auffret β€” the legend, the moment, the main character. 🫢


Copyright (c) 2006-2019, Patrice <GomoR> Auffret

You may distribute this module under the terms of the Artistic license. See LICENSE.Artistic file in the source distribution archive.


And that's the whole page, bestie β€” this one's from perl v5.36.0, dated 2022-12-04, and it's the Net::Frame::Layer::NULL(3pm) manpage. Slay. πŸ’…βœ¨πŸŽ€