Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

net::arp(3pm) [debian man page]

ARP(3pm)						User Contributed Perl Documentation						  ARP(3pm)

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 $mac = Net::ARP::get_mac("eth0"); print "$mac "; $mac = Net::ARP::arp_lookup($dev,"192.168.1.1"); print "192.168.1.1 has got mac $mac "; 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. 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() $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. arp_lookup() $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@chaostal.de ] http://www.datenterrorist.de COPYRIGHT AND LICENSE
Copyright (C) 2004-2007 by Bastian Ballmann 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. perl v5.14.2 2009-04-24 ARP(3pm)

Check Out this Related Man Page

learp(8)						      System Manager's Manual							  learp(8)

NAME
learp - Displays the contents of a LAN-Emulation Address Resolution Protocol (LE-ARP) table SYNOPSIS
/usr/sbin/learp [-u unit_number] -a OPTIONS
Specifies a LE-ARP cache. The unit number is the same as is displayed by the netstat -i command. For example: elan0 is unit 0, elan1 is unit 1, and so on. If the -u option is not specified, the default unit number is 0. Displays all entries in the LAN-Emulation Address Resolution Pro- tocol (LE-ARP) table. DESCRIPTION
Each LAN-Emulation Client interface (displayed as elann in netstat output) has an Address Resolution Protocol (LE-ARP) table that contains mappings of 6-byte medium access control (MAC) addresses to 20-byte Asynchronous Transfer Mode (ATM) addresses. The learp command displays the contents of the LE-ARP table. Each LE-ARP table entry contains the following information: Each MAC address that has been or is being contacted through the ATM-emulated LAN. One of the following state values: AP -- LE-ARP is pending. The ATM address associated with the MAC address is not known. DE -- Delete of the LE-ARP cache entry is pending. When there are no more VCs for a LE-ARP entry, it is marked for deletion. After there is no activity for 5 minutes (age periond), the entry is removed for the cache. FD -- Forward Direct. Packets flowing to the destination are using the data-direct VC. FL -- Flush is pending. A new VC has been established with the remote node and the broadcast channel is being flushed so packets flowing on the new VC will not arrive out of order. VP -- Virtual Channel (VC) setup is pending. The ATM address is known, but no VC is established with the remote node. If known, the 20-byte ATM address associated with the MAC address. One of the fol- lowing flags: R -- Remote entry. The MAC address is on a legacy (that is, Ethernet) network on the back side of an ATM edge device. P -- Permanent entry. The LE-ARP entry is permanent. If known, this is the Virtual Path Identifier (VPI) and the Virtual Channel Identifier (VCI) of the data-direct VC used by packets destined to the MAC address. Many MAC addresses may use the same VC. EXAMPLES
The following example shows the output of a learp -a command in which the LE-ARP cache contains five entries: # learp -a le-arp cache con- tains 5 entries. MAC Address State ATM Address Flags VPI/VCI 08-00-2b-01-01-01 (AP) pending 08-00-2b-01-01-02 (VP) 39000000000000000000000000.08002b010102.00 pending 08-00-2b-01-02-02 (FL) 39000000000000000000000000.08002b010203.00 R 0/65 08-00-2b-01-02-03 (FD) 39000000000000000000000000.08002b010203.00 0/65 SEE ALSO
Commands: atmconfig(8), atmelan(8), atmsig(8) learp(8)
Man Page