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::ADDRESS::ETHERNET (3)

.ds Aq ’

NAME

Net::Address::Ethernet - find hardware ethernet address

CONTENTS

SYNOPSIS



  use Net::Address::Ethernet qw( get_address );
  my $sAddress = get_address;



FUNCTIONS

The following functions will be exported to your namespace if you request :all like so:



  use Net::Address::Ethernet qw( :all );



get_address Returns the 6-byte ethernet address in canonical form. For example, ’1A:2B:3C:4D:5E:6F’.

When called in array context, returns a 6-element list representing the 6 bytes of the address in decimal. For example, (26,43,60,77,94,111).

If any non-zero argument is given, debugging information will be printed to STDERR.

get_addresses Returns an array of hashrefs. Each hashref describes one Ethernet adapter found in the current hardware configuration, with the following entries filled in to the best of our ability to determine:
sEthernet — The MAC address in canonical form.
rasIP — A reference to an array of all the IP addresses on this adapter.
sIP — The ‘‘first’’ IP address on this adapter.
sAdapter — The name of this adapter.
iActive — Whether this adapter is active.

For example:



  {
   sAdapter => Ethernet adapter Local Area Connection,
   sEthernet => 12:34:56:78:9A:BC,
   rasIP => [111.222.33.44,],
   sIP => 111.222.33.44,
   iActive => 1,
  },



If any non-zero argument is given, debugging information will be printed to STDERR.

is_address Returns a true value if its argument looks like an ethernet address.
canonical Given a 6-byte ethernet address, converts it to canonical form. Canonical form is 2-digit uppercase hexadecimal numbers with colon between the bytes. The address to be converted can have any kind of punctuation between the bytes, the bytes can be 1-digit, and the bytes can be lowercase; but the bytes must already be hex.

NOTES

SEE ALSO

arp, ifconfig, ipconfig

BUGS

Please tell the author if you find any! And please show me the output of ‘arp <hostname>‘ or ‘ifconfig‘ or ‘ifconfig -a‘ from your system.

AUTHOR

Martin ’Kingpin’ Thurn, mthurn at cpan.org, <http://tinyurl.com/nn67z>.

LICENSE

This software is released under the same license as Perl itself.

#### This is an example of @ahInfo on MSWin32: (
{
’sAdapter’ => ’Ethernet adapter Local Area Connection’,
’sEthernet’ => ’00-0C-F1-EE-F0-39’,
’sIP’ => ’16.25.10.14’,
’iActive’ => 1,
},
{
’sAdapter’ => ’Ethernet adapter Wireless Network Connection’,
’sEthernet’ => ’00-33-BD-F3-33-E3’,
’sIP’ => ’19.16.20.12’,
’iActive’ => 1,
},
{
’sAdapter’ => ’{gobbledy-gook}’,
’sDesc’ => ’PPP adapter Verizon Online’,
’sEthernet’ => ’00-53-45-00-00-00’,
’sIP’ => ’71.24.23.85’,
’iActive’ => 1,
}, )

#### This is Solaris 8:

> /usr/sbin/arp myhost myhost (14.81.16.10) at 03:33:ba:46:f2:ef permanent published

#### This is Solaris 8:

> /usr/sbin/ifconfig -a lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000 bge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 14.81.16.10 netmask ffffff00 broadcast 14.81.16.255

#### This is Fedora Core 6:

$ /sbin/arp Address HWtype HWaddress Flags Mask Iface 19.16.11.11 ether 03:53:53:e3:43:93 C eth0

#### This is amd64-freebsd:

$ ifconfig fwe0: flags=108802<BROADCAST,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500
options=8<VLAN_MTU>
ether 02:31:38:31:35:35
ch 1 dma -1 vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet6 fe8d::2500:bafd:fecd:cdcd%vr0 prefixlen 64 scopeid 0x2
inet 19.16.12.52 netmask 0xffffff00 broadcast 19.16.12.255
ether 00:53:b3:c3:3d:39
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active nfe0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=8<VLAN_MTU>
inet6 fe8e::21e:31ef:fee1:26eb%nfe0 prefixlen 64 scopeid 0x3
ether 00:13:33:53:23:13
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> mtu 1500 lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
inet 127.0.0.1 netmask 0xff000000
inet 127.0.0.2 netmask 0xffffffff
inet 127.0.0.3 netmask 0xffffffff tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1492
inet 83.173.73.3 --> 233.131.83.3 netmask 0xffffffff
Opened by PID 268

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


perl v5.20.3 NET::ADDRESS::ETHERNET (3) 2015-11-28

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