GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::ARP (3)

.ds Aq ’

NAME

ARP - Perl extension for creating ARP packets

CONTENTS

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



$mac = Net::ARP::get_mac(eth0);

print $mac\n;

$mac = Net::ARP::arp_lookup($dev,192.168.1.1);

print 192.168.1.1 has got mac $mac\n;

    IMPORTANT

Version 1.0 will break with the API of PRE-1.0 versions, because the return value of arp_lookup() and get_mac() will no longer be passed as parameter, but returned! I hope this decision is ok as long as we get a cleaner and more perlish API.

    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.
<B>B>send_packet()<B>B>


  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.



<B>B>get_mac()<B>B>


  $mac = Net::ARP::get_mac("eth0");

  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.



<B>B>arp_lookup()<B>B>


  $mac = Net::ARP::arp_lookup($dev,"192.168.1.1");

  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 [ balle@codekid.net ]
 http://www.codekid.net



COPYRIGHT AND LICENSE

Copyright (C) 2004-2013 by Bastian Ballmann

License: GPLv2

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 ARP (3) 2013-06-24

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.