.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::Libdnet::Arp 3pm" .TH Net::Libdnet::Arp 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Net::Libdnet::Arp \- high level API to access libdnet arp_* functions .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Net::Libdnet::Arp; \& \& my $h = Net::Libdnet::Arp\->new; \& my $mac = $h\->get(\*(Aq10.0.0.1\*(Aq); \& my $success = $h\->add(\*(Aq10.0.0.1\*(Aq, \*(Aq00:11:22:33:44:55\*(Aq); \& my $success = $h\->delete(\*(Aq10.0.0.1\*(Aq, \*(Aq00:11:22:33:44:55\*(Aq); \& \& my $data; \& $h\->loop(\e&arp_print, \e$data); \& \& sub arp_print { \& my ($e, $data) = @_; \& printf("%s at %s\en", $e\->{arp_pa}, $e\->{arp_ha}); \& } .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This modules is a higher level abstraction for libdnet arp_* functions. .SH METHODS .IX Header "METHODS" .IP "\fBnew\fR ()" 4 .IX Item "new ()" Returns an object to access arp cache table on success, undef otherwise. .IP "\fBget\fR (scalar)" 4 .IX Item "get (scalar)" Returns the mac address of specified IP address, undef otherwise. .IP "\fBadd\fR (scalar, scalar)" 4 .IX Item "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. .IP "\fBdelete\fR (scalar, scalar)" 4 .IX Item "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. .IP "\fBloop\fR (subref, [ scalarref ])" 4 .IX Item "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). .SH AUTHOR .IX Header "AUTHOR" Patrice Auffret .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" You may distribute this module under the terms of the BSD license. See LICENSE file in the source distribution archive. .PP Copyright (c) 2008\-2012, Patrice Auffret