Net::F...r::ETH(3pm)
π Net::Frame::Layer::ETH β the Ethernet/802.3 layer object, bestie edition π
okay so this is Net::Frame::Layer::ETH from the Perl user-contributed docs, and it is literally the module that handles encoding and decoding of your Ethernet/802.3 layer. it's giving packet-crafting main character energy and we're obsessed π¦
β¨ NAME β¨
Net::Frame::Layer::ETH β Ethernet/802.3 layer object π
πΈ SYNOPSIS πΈ
bestie here's the whole vibe, copy-paste ready, no cap:
use Net::Frame::Layer::ETH qw(:consts);
# Build a layer
my $layer = Net::Frame::Layer::ETH->new(
src => '00:00:00:00:00:00',
dst => NF_ETH_ADDR_BROADCAST,
type => NF_ETH_TYPE_IPv4,
);
$layer->pack;
print 'RAW: '.$layer->dump."\n";
# Read a raw layer
my $layer = Net::Frame::Layer::ETH->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, print it β the full lil lifecycle, periodt π
π¦ DESCRIPTION π¦
This module implements the encoding and the decoding of the Ethernet/802.3 layer. that's the whole job, and it does it flawlessly, as it should π
RFC: ftp://ftp.rfc-editor.org/in-notes/rfc894.txt β go read it, iykyk π
Also go look at Net::Frame::Layer for other attributes and methods, because this module inherits a lot from it π«Ά
π ATTRIBUTES π
src,dstβ source and destination MAC addresses, in the classical format (00:11:22:33:44:55). classic for a reason β¨typeβ the encapsulated layer type (IPv4, IPv6 ...) for Ethernet. Values for Ethernet types are greater than 1500. If it's less than 1500, the layer is considered a 802.3 one. Checkhttp://www.iana.org/assignments/ethernet-numbersfor the full tea πlengthβ the length of the payload when this layer is a 802.3 one. This is the same attribute astype, but heads up: you cannot use it when callingnew(you can only use it as an accessor after that). so like, it's the same thing wearing a different outfit π
The following are inherited attributes. See Net::Frame::Layer for more information:
rawpayloadnextLayer
π METHODS π
newnew (hash)β object constructor π you can pass attributes that will overwrite the default ones. See SYNOPSIS for default values, bestie.
The following are inherited methods. Some of them may be overridden in this layer, and some others may not be meaningful in this layer. See Net::Frame::Layer for more information:
layercomputeLengthscomputeChecksumspackunpackencapsulategetLengthgetPayloadLengthprintdump
β CONSTANTS β
Load them like this, don't forget it:
use Net::Frame::Layer::ETH qw(:consts);
NF_ETH_ADDR_BROADCASTβ Ethernet broadcast address. shouting to everyone on the network, iconic π£NF_ETH_TYPE_IPv4,NF_ETH_TYPE_X25,NF_ETH_TYPE_ARP,NF_ETH_TYPE_CGMP,NF_ETH_TYPE_80211,NF_ETH_TYPE_PPPIPCP,NF_ETH_TYPE_RARP,NF_ETH_TYPE_DDP,NF_ETH_TYPE_AARP,NF_ETH_TYPE_PPPCCP,NF_ETH_TYPE_WCP,NF_ETH_TYPE_8021Q,NF_ETH_TYPE_IPX,NF_ETH_TYPE_STP,NF_ETH_TYPE_IPv6,NF_ETH_TYPE_WLCCP,NF_ETH_TYPE_MPLS,NF_ETH_TYPE_PPPoED,NF_ETH_TYPE_PPPoES,NF_ETH_TYPE_8021X,NF_ETH_TYPE_AoE,NF_ETH_TYPE_80211I,NF_ETH_TYPE_LLDP,NF_ETH_TYPE_LLTD,NF_ETH_TYPE_LOOP,NF_ETH_TYPE_VLAN,NF_ETH_TYPE_PPPPAP,NF_ETH_TYPE_PPPCHAPβ various supported Ethernet types. look at this lineup, it's a whole squad π₯
π SEE ALSO π
Net::Frame::Layer
π AUTHOR π
Patrice <GomoR> Auffret π
π 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.
and that's the whole page, bestie!! this was documented as perl v5.36.0, dated 2022-12-04, and it goes out to you with all the love in the world β stay packet-crafting, mwah πβ¨ππ¦πΈπ
π«Ά
π¦ 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