Net::L...et::Arp(3pm)

πŸ“¦
version 0.990 Β· 5 versions
, in debian trixie, ubuntu resolute

πŸ’– 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, and undef otherwise. your little handle to the whole operation, your main character. ⭐
  • get (scalar) β€” Returns the mac address of the specified IP address, and undef otherwise. one argument, one mac, no drama. πŸ’–
  • add (scalar, scalar) β€” Adds an entry to the arp cache table. Returns 1 on success, and undef otherwise. 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. Returns 1 on success, and undef otherwise. 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: add and delete hand you back 1 on success and undef otherwise, so always check, bestie. falsy is falsy. πŸ’€

πŸ’œ AUTHOR πŸ’œ

Patrice <GomoR> Auffret


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