Net::Arping - Ping remote host by ARP packets


Net-Arping documentation  | view source Contained in the Net-Arping distribution.

Index


NAME

Top

Net::Arping - Ping remote host by ARP packets

SYNOPSIS

Top

  use Net::Arping;

  $q=Net::Arping->new();
  $result=$q->arping($host);

  if($result eq "0") {
        print "Sorry , but $host is dead...\n";
  } else {
        print "wow... it is alive... Host MAC address is $result\n";
  }

  You can also specify source interface and timeout. Default timeout
is 1 second.

  $result=$q->arping(Host => $host,Interface => "eth0",Timeout => "4");	
  if($result eq "0") {
	print "Sorry, but $host is dead on device eth0...\n";
  } else {
	print "wow... it is alive... Host MAC address is $result\n";
  }




DESCRIPTION

Top

The module contains function for testing remote host reachability by sending ARP packets.

The program must be run as root or be setuid to root.

For compiling the module you need libnet library (http://www.packetfactory.net/libnet/dist/libnet.tar.gz) and pcap library (http://www.tcpdump.org/daily/libpcap-current.tar.gz).

FUNCTIONS

Top

Net::Arping->new();

Create a new arping object.

$q->arping($host); $q->arping(Host => $host [, Interface => $interface, Timeout => $sec]);

Arping the remote host. Interface and Timeout parameters are optional. Default timeout is 1 second. Default device is selected by libnet_select_device function.

COPYRIGHT

Top

SEE ALSO

Top

pcap(3), libnet(3)

AUTHOR

Top

Oleg Prokopyev, <riiki@gu.net>


Net-Arping documentation  | view source Contained in the Net-Arping distribution.