The fetch_oui() will use this cache if it exists. load_cache( )ĭownloads the current list of all OUIs, parses it with parse_oui(), and stores it in $Cached anonymous hash keyed by the OUIs (i.e. With no arguments, it returns an empty anonymous array. It discards the first line, strips the leading information from the second line, and strips the leading whitespace from all of the lines. Takes a string that looks like 00-03-93 (hex) Apple Computer, Inc.Īnd turns it into an array of lines. This could mean unexpected input or a change in format. Returns false if it could not extract the information. The HTML is the search results page of the IEEE ouisearch lookup. Gets rid of the HTML around the OUI information.
MAC VENDOR LOOKUP LIST MAC
If it doesn't find the MAC in the cache, it returns nothing. To avoid multiple calls on the network, use load_cache to preload the entire OUI space into an in-memory cache. The normalize_mac() function explains the possible formats for MAC. Looks up the OUI information in the cached OUI information (see load_cache). The normalize_mac() function explains the possible formants for MAC. Pass it the result of normalize_mac() and you should be fine. Looks up the OUI information on the IEEE website. This can take a long time over a slow network, thoug the file is about 60,000 lines.
Looks up the OUI information on the IEEE website, or uses a cached version of it. :d:93 # missing all leading zeros fetch_oui( MAC ) We only need the first three bytes 00:0d:93:29:f6:c2 # usual form They can omit leading 0's (which might make things look odd). The input string can be a separated by colons or hyphens. Takes a MAC address and turns it into the form I need to send to the IEEE lookup, which is the first six bytes in hex separated by hyphens. Different records may have different numbers of lines, although the first two should be consistent. The first element is the OUI, the second element is the vendor name, and the remaining elements are the address lines. Given the MAC address, return an anonymous array with the vendor information. If the cache is fully loaded (perhaps using load_cache), it may not even use the network at all. This method does try to use a cache of OUI to cut down on the times it has to access the network. I can pass it a list of MAC addresses and run() processes each one of them. It takes the MAC addresses and prints the registered vendor information for each address. If I call this module as a script, this class method automatically runs. I need to come up with a way to let the user set that location. So far, the module looks in the current working directory for a file named mac_oui.db to find the cache. You can preload this cache with the load_cache() function. If it cannot load DBM::Deep, it uses a normal hash (which is lost when the process finishes). This module tries to persistently cache with DBM::Deep the OUI information so it can avoid using the network. You can use this as a module as its individual functions, or call it as a script with a list of MAC addresses as arguments. With vendor information, you can often guess at what what you are looking at (e.g. You can, for instance, scan a network, collect MAC addresses, and turn those addresses into vendors. This module allows you to take a MAC address and turn it into the OUI and vendor information. Each interface has a Media Access Control (MAC) address of six bytes. The Institute of Electrical and Electronics Engineers (IEEE) assigns an Organizational Unique Identifier (OUI) to manufacturers of network interfaces. The module realizes it is a script, looks up the information for each MAC, and outputs it. You can also run this as a script with as many arguments as you like.
My $array = Net::MAC::Vendor::lookup( $mac ) Net::MAC::Vendor - look up the vendor for a MAC SYNOPSIS use Net::MAC::Vendor