Net::F...r::SLL(3pm)
π NAME π
Net::Frame::Layer::SLL β bestie, it's the Linux cooked capture layer object π no cap, that's literally what it is
β¨ SYNOPSIS β¨
okay so first you gotta pull it in, and grab those consts while you're at it:
use Net::Frame::Layer::SLL qw(:consts);
Building a layer from scratch β main character energy, you're constructing it:
# Build a layer
my $layer = Net::Frame::Layer::SLL->new(
packetType => NF_SLL_PACKET_TYPE_SENT_BY_US,
addressType => NF_SLL_ADDRESS_TYPE_512,
addressLength => 0,
source => 0,
protocol => NF_SLL_PROTOCOL_IPv4,
);
$layer->pack;
print 'RAW: '.$layer->dump."\n";
Reading a raw layer β the way you just feed it the raw bytes and it gets it:
# Read a raw layer
my $layer = Net::Frame::Layer::SLL->new(raw => $raw);
print $layer->print."\n";
print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n"
if $layer->payload;
πΈ DESCRIPTION πΈ
So this module is the one that does the encoding and decoding of the Linux cooked capture layer. That's its whole job, and it does it flawlessly π
Also, if you wanna know about the other attributes and methods floating around, go peek at Net::Frame::Layer. It's giving extended family.
π ATTRIBUTES π
packetTypeβ stores the packet type bestie (like unicast to us, sent by us, etc. β you get the vibe)addressTypeβ the address type, exactly thataddressLengthβ how long that address you just specified actually issourceβ the source address πprotocolβ the encapsulated protocol
and then these cuties are inherited attributes, so for the full tea go read Net::Frame::Layer:
rawpayloadnextLayer
π₯ METHODS π₯
new
new (hash)
Object constructor, periodt. You can pass in attributes and they'll overwrite the defaults. Wanna know what the defaults are? Go look at SYNOPSIS, it's all right there for you π«Ά
And these are the inherited methods β some might get overridden in this layer, and ngl some of them may not even mean anything in this layer. Either way, Net::Frame::Layer has the details:
layercomputeLengthscomputeChecksumspackunpackencapsulategetLengthgetPayloadLengthprintdump
π CONSTANTS π
Load them up like this, babe:
use Net::Frame::Layer::SLL qw(:consts);
Packet types β the various possible ones:
NF_SLL_PACKET_TYPE_SENT_BY_USNF_SLL_PACKET_TYPE_UNICAST_TO_US
Encapsulated layer types β every single one that's supported, we're not skipping anybody:
NF_SLL_PROTOCOL_IPv4NF_SLL_PROTOCOL_X25NF_SLL_PROTOCOL_ARPNF_SLL_PROTOCOL_CGMPNF_SLL_PROTOCOL_80211NF_SLL_PROTOCOL_PPPIPCPNF_SLL_PROTOCOL_RARPNF_SLL_PROTOCOL_DDPNF_SLL_PROTOCOL_AARPNF_SLL_PROTOCOL_PPPCCPNF_SLL_PROTOCOL_WCPNF_SLL_PROTOCOL_8021QNF_SLL_PROTOCOL_IPXNF_SLL_PROTOCOL_STPNF_SLL_PROTOCOL_IPv6NF_SLL_PROTOCOL_WLCCPNF_SLL_PROTOCOL_MPLSNF_SLL_PROTOCOL_PPPoEDNF_SLL_PROTOCOL_PPPoESNF_SLL_PROTOCOL_8021XNF_SLL_PROTOCOL_AoENF_SLL_PROTOCOL_80211INF_SLL_PROTOCOL_LLDPNF_SLL_PROTOCOL_LLTDNF_SLL_PROTOCOL_LOOPNF_SLL_PROTOCOL_VLANNF_SLL_PROTOCOL_PPPPAPNF_SLL_PROTOCOL_PPPCHAP
And one more lil guy, all by itself:
NF_SLL_ADDRESS_TYPE_512
π SEE ALSO π
Net::Frame::Layer
π AUTHOR π
Patrice <GomoR> Auffret β we stan π«Ά
π¦ COPYRIGHT AND LICENSE π¦
Copyright (c) 2006-2019, 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. (yes that's the actual license name, go read it, it's short, iykyk)
okay bestie that's the whole page π this one's running on perl v5.36.0, dated 2022-12-04, and it's Net::F...r::SLL(3pm) from the User Contributed Perl Documentation collection. go forth and capture those packets, you absolute icon β¨π
π
π¦ where this page comes from
- debian bookworm: libnet-frame-perl 1.21-2 Β· Artistic-1.0-Perl
- debian trixie: libnet-frame-perl 1.21-2 Β· Artistic-1.0-Perl
- ubuntu noble: libnet-frame-perl 1.21-2 Β· Artistic-1.0-Perl
- ubuntu resolute: libnet-frame-perl 1.21-2 Β· Artistic-1.0-Perl
- ubuntu stonking: libnet-frame-perl 1.21-2 Β· Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms