Net-MAC-Vendor
view release on metacpan or search on metacpan
lib/Net/MAC/Vendor.pm view on Meta::CPAN
package Net::MAC::Vendor; # git description: v1.267-2-g8373c47
# ABSTRACT: Look up the vendor for a MAC
use strict;
use warnings;
use 5.010;
use IO::Socket::SSL ();
use Net::SSLeay;
#pod =head1 SYNOPSIS
#pod
#pod use Net::MAC::Vendor;
#pod
#pod my $mac = "00:0d:93:29:f6:c2";
#pod
#pod my $array = Net::MAC::Vendor::lookup( $mac );
#pod
#pod You can also run this as a script with as many arguments as you
#pod like. The module realizes it is a script, looks up the information
#pod for each MAC, and outputs it.
#pod
#pod perl Net/MAC/Vendor.pm 00:0d:93:29:f6:c2 00:0d:93:29:f6:c5
#pod
#pod =head1 DESCRIPTION
#pod
#pod The Institute of Electrical and Electronics Engineers (IEEE) assigns
#pod an Organizational Unique Identifier (OUI) to manufacturers of network
#pod interfaces. Each interface has a Media Access Control (MAC) address
#pod of six bytes. The first three bytes are the OUI.
#pod
#pod This module allows you to take a MAC address and turn it into the OUI
#pod and vendor information. You can, for instance, scan a network,
#pod collect MAC addresses, and turn those addresses into vendors. With
#pod vendor information, you can often guess at what what you are looking
#pod at (I<e.g.> an Apple product).
#pod
#pod You can use this as a module as its individual functions, or call it
#pod as a script with a list of MAC addresses as arguments. The module can
#pod figure it out.
#pod
#pod The IEEE moves the location of its OUI file. If they do that again, you
#pod can set the C<NET_MAC_VENDOR_OUI_URL> environment variable to get the new
#pod URL without updating the code.
#pod
#pod Here are some of the old URLs, which also flip-flop schemes:
#pod
#pod http://standards.ieee.org/regauth/oui/oui.txt
#pod https://standards.ieee.org/regauth/oui/oui.txt
#pod http://standards-oui.ieee.org/oui.txt
#pod http://standards-oui.ieee.org/oui/oui.txt
#pod
#pod There are older copies of the OUI file in the GitHub repository.
#pod
#pod These files are large (about 4MB), so you might want to cache a copy.
#pod
#pod A different source of information is linuxnet.ca that publishes sanitized
#pod and compressed versions of the list, such as:
#pod
#pod http://linuxnet.ca/ieee/oui.txt.bz2
#pod
#pod The module can read and decompress compressed versions (as long as the url
#pod reflects the compression type in the filename as the linuxnet.ca links do).
#pod
#pod =head2 Functions
#pod
#pod =over 4
#pod
( run in 1.338 second using v1.01-cache-2.11-cpan-0d23b851a93 )