NAME
ARP - Perl extension for creating ARP packets
SYNOPSIS
use Net::ARP;
Net::ARP::send_packet('lo', # Device
'127.0.0.1', # Source IP
'127.0.0.1', # Destination IP
'aa:bb:cc:aa:bb:cc', # Source MAC
'aa:bb:cc:aa:bb:cc', # Destinaton MAC
'reply'); # ARP operation
Net::ARP::get_mac("eth0",$mac); print "$mac\n";
Net::ARP::arp_lookup($dev,"192.168.1.1",$mac); print "192.168.1.1 has got mac $mac\n";
DESCRIPTION
This module can be used to create and send ARP packets and to get the mac address of an ethernet interface or ip address.
- send_packet()
-
Net::ARP::send_packet('lo', # Device '127.0.0.1', # Source IP '127.0.0.1', # Destination IP 'aa:bb:cc:aa:bb:cc', # Source MAC 'aa:bb:cc:aa:bb:cc', # Destinaton MAC 'reply'); # ARP operation I think this is self documentating. ARP operation can be one of the following values: request, reply, revrequest, revreply, invrequest, invreply. The default ARP operation is reply.
- get_mac()
-
Net::ARP::get_mac("eth0",$mac); This gets the MAC address of the eth0 interface and stores it in the variable $mac. The return value is "unknown" if the mac cannot be looked up.
- arp_lookup()
-
Net::ARP::arp_lookup($dev,"192.168.1.1",$mac); This looks up the MAC address for the ip address 192.168.1.1 and stores it in the variable $mac. The return value is "unknown" if the mac cannot be looked up.
SEE ALSO
man -a arp
AUTHOR
Bastian Ballmann [ Crazydj@chaostal.de ]
http://www.datenterrorist.de
COPYRIGHT AND LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.1 or, at your option, any later version of Perl 5 you may have available.
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 79:
'=item' outside of any '=over'
- Around line 109:
You forgot a '=back' before '=head1'