Net::L...et::Arp(3pm)
π Net::Libdnet::Arp β the whole vibe π
okay so bestie, imagine this: you want to talk to the ARP cache like it's your bestie and not like it's some dusty kernel table. that's literally what this is. it's Net::Libdnet::Arp, a high level API to access libdnet arp_* functions, and it's part of the User Contributed Perl Documentation collection. no cap, it's giving "tiny module, big main character energy." π
β¨ NAME β¨
Net::Libdnet::Arp β high level API to access libdnet arp_* functions π¦
πΈ SYNOPSIS πΈ
here's the whole cute little story in code form, don't skip it:
use Net::Libdnet::Arp;
my $h = Net::Libdnet::Arp->new;
my $mac = $h->get('10.0.0.1');
my $success = $h->add('10.0.0.1', '00:11:22:33:44:55');
my $success = $h->delete('10.0.0.1', '00:11:22:33:44:55');
my $data;
$h->loop(\&arp_print, \$data);
sub arp_print {
my ($e, $data) = @_;
printf("%s at %s\n", $e->{arp_pa}, $e->{arp_ha});
}
look at her go π
you make a handler, you get, you add, you delete, and then you loop through the whole table and print every entry with its arp_pa and arp_ha. iconic behavior, honestly.
π DESCRIPTION π
This module is a higher level abstraction for libdnet arp_* functions. that's it, that's the whole thesis. it wraps the low level stuff so you can just vibe with the arp cache table instead of wrestling raw C bindings. π«Ά
π METHODS π
one bullet per method, all the facts, zero skips:
new ()β Returns an object to access the arp cache table on success, andundefotherwise. your little handle to the whole operation, your main character. βget (scalar)β Returns the mac address of the specified IP address, andundefotherwise. one argument, one mac, no drama. πadd (scalar, scalar)β Adds an entry to the arp cache table. Returns1on success, andundefotherwise. First parameter is the IP address, second is the mac address. you're literally writing to the table, slay. β¨delete (scalar, scalar)β Deletes an entry from the arp cache table. Returns1on success, andundefotherwise. First parameter is the IP address, second is the mac address. bye bestie π (but like, in a permanent way β it's a delete, so be sure you meant it). π₯loop (subref, [ scalarref ])β Calls the specified sub ref for each entry in the arp cache table. The second optional parameter is a scalar ref, to store state information (if any). yes, that[ scalarref ]means optional, so you can absolutely just pass the subref and let it be. π¦
heads up:addanddeletehand you back1on success andundefotherwise, so always check, bestie. falsy is falsy. π
π AUTHOR π
Patrice <GomoR> Auffret
π COPYRIGHT AND LICENSE π
You may distribute this module under the terms of the BSD license. See the LICENSE file in the source distribution archive. π
Copyright (c) 2008-2024, Patrice <GomoR> Auffret
okay that's the whole page, and now the cute sign-off: this little gem is documented as part of perl v5.40.1, dated 2025-03-01 β and yes, the page title is that truncated-looking Net::L...et::Arp(3pm) situation, which is exactly the kind of abbreviation that keeps you guessing. periodt. π β¨π«Ά
π¦ where this page comes from
- debian trixie: libnet-libdnet-perl 0.990-1 Β· BSD-2-Clause
- ubuntu resolute: libnet-libdnet-perl 0.990-1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms