Net::F...r::ARP(3pm)
β¨ Net::Frame::Layer::ARP π (that's the Net::F...r::ARP(3pm) page bestie, welcome)
okay so you want to speak ARP. Address Resolution Protocol. The thing that goes "hey who has this IP" and everyone in the room turns around. This module is the ARP layer object from Net::Frame, and it does encoding and decoding, which is giving bilingual icon behaviour ngl π
πΈ NAME πΈ
Net::Frame::Layer::ARP β the Address Resolution Protocol layer object. yes she's a whole class, and yes she's slaying π
β¨ SYNOPSIS β¨
here's the whole vibe, copy-paste ready:
use Net::Frame::Layer::ARP qw(:consts);
# Build a layer
my $layer = Net::Frame::Layer::ARP->new(
hType => NF_ARP_HTYPE_ETH,
pType => NF_ARP_PTYPE_IPv4,
hSize => NF_ARP_HSIZE_ETH,
pSize => NF_ARP_PSIZE_IPv4,
opCode => NF_ARP_OPCODE_REQUEST,
src => '00:00:00:00:00:00',
dst => NF_ARP_ADDR_BROADCAST,
srcIp => '127.0.0.1',
dstIp => '127.0.0.1',
);
$layer->pack;
print 'RAW: '.$layer->dump."\n";
# Read a raw layer
my $layer = Net::Frame::Layer::ARP->new(raw => $raw);
print $layer->print."\n";
print 'PAYLOAD: '.unpack('H*', $layer->payload)."\n"
if $layer->payload;
first half = you building a packet from scratch, main character energy. second half = you reading one that already showed up. both are valid, both eat π«Ά
π¦ DESCRIPTION π¦
this module implements the encoding and decoding of the ARP layer. that's the whole job description, and she does it flawlessly no cap.
RFC: ftp://ftp.rfc-editor.org/in-notes/rfc826.txt β go read it, it's the blueprint, the lore, the origin story π
also peep Net::Frame::Layer for other attributes and methods, because a lot of the good stuff is inherited from there.
π ATTRIBUTES π
hType,pTypeβ hardware and protocol address types. the "what kind of addresses are we even talking about" fields.hSize,pSizeβ hardware and protocol address sizes, in bytes. yes, bytes, keep up bestie.opCodeβ the operation code number to perform. the actual "what am I doing here" of the packet.src,dstβ source and destination hardware addresses.srcIp,dstIpβ source and destination IP addresses.
okay and the following are inherited attributes. head to Net::Frame::Layer if you want the full tea:
rawpayloadnextLayer
π METHODS π
newnew (hash)β the object constructor. you can pass attributes in and they'll overwrite the default ones. wanna know what the defaults are? go look at SYNOPSIS, it's all laid out up there β¬οΈgetKeygetKeyReverseβ these two are basically there to make things faster when you use therecvmethod fromNet::Frame::Simple. usually you write them when you need to write amatchmethod. iykyk πmatch (Net::Frame::Layer::ARP object)β mostly used internally, ngl. you hand it aNet::Frame::Layer::ARPlayer as a parameter, and it returns true if this is a response corresponding for the request, or false if it's not. a yes/no girlie, we respect it π
and 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:
layercomputeLengthscomputeChecksumspackunpackencapsulategetLengthgetPayloadLengthprintdump
π CONSTANTS π
load them like this, don't forget the :consts:
use Net::Frame::Layer::ARP qw(:consts);
NF_ARP_HTYPE_ETHβ hardware address types.NF_ARP_PTYPE_IPv4NF_ARP_PTYPE_IPv6β protocol address types.NF_ARP_HSIZE_ETHβ hardware address sizes.NF_ARP_PSIZE_IPv4NF_ARP_PSIZE_IPv6β protocol address sizes.NF_ARP_OPCODE_REQUESTNF_ARP_OPCODE_REPLYβ operation code numbers.NF_ARP_ADDR_BROADCASTβ broadcast address for thesrcordstattributes. she's shouting, and honestly? valid π£
π SEE ALSO π
Net::Frame::Layer
π AUTHOR π
Patrice <GomoR> Auffret β legend behaviour, 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 LICENSE.Artistic file in the source distribution archive.
and that's the whole page bestie, go forth and ARP responsibly π¦
made with perl v5.36.0 and dated 2022-12-04 β mwah, xoxo, happy packet crafting π β¨
π¦ 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