Net::Libdnet::Arp(3pm)

Net::Libdnet::Arp3pm

High level api to access libdnet arp_* functions

Usage

   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});
   }

Overview

This modules is a higher level abstraction for libdnet arp_* functions.

Methods

new ()

Returns an object to access arp cache table on success, undef otherwise.

get (scalar)

Returns the mac address of specified IP address, undef otherwise.

add (scalar, scalar)

Adds an entry to arp cache table. Returns 1 on success, undef otherwise. First parameter is the IP address, second is the mac address.

delete (scalar, scalar)

Deletes an entry from arp cache table. Returns 1 on success, undef otherwise. First parameter is the IP address, second is the mac address.

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).

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 7 times.

  1. 6.0
  2. 7
  3. 8
  4. 9
  5. 10
  6. 11
  7. 12
  8. 13

Author

Patrice <GomoR> Auffret

From libnet-libdnet-perl 0.990-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.