|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetpcap.util.resolver.AbstractResolver
org.jnetpcap.util.resolver.IEEEOuiPrefixResolver
public class IEEEOuiPrefixResolver
A resolver that resolves the first 3 bytes of a MAC address to a manufacturer code. The resolver loads jNetPcap supplied compressed oui database of manufacturer codes and caches that information. The resolver can also download over the internet, if requested, a raw IEEE OUI database of manufacturer code, parse it and produce a cache file for future use.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jnetpcap.util.resolver.Resolver |
|---|
Resolver.ResolverType |
| Field Summary | |
|---|---|
static java.lang.String |
IEEE_OUI_DATABASE_PATH
Default URI path to IEEE raw oui database of manufacturer codes. |
| Fields inherited from class org.jnetpcap.util.resolver.AbstractResolver |
|---|
INFINITE_TIMEOUT, logger |
| Fields inherited from interface org.jnetpcap.util.resolver.Resolver |
|---|
RESOLVER_SEARCH_PATH_PROPERTY |
| Constructor Summary | |
|---|---|
IEEEOuiPrefixResolver()
Creates an uninitalized Oui prefix resolver. |
|
| Method Summary | |
|---|---|
void |
initializeIfNeeded()
Initializes the resolver by first checking if there are any cached entries, if none, it reads the compressed oui database supplied with jNetPcap in the resource directory . |
int |
loadCache(java.net.URL url)
Download IEEE supplied OUI.txt database of manufacturer prefixes and codes. |
java.lang.String |
resolveToName(byte[] address,
long hash)
Resolves the supplied address to a human readable name. |
protected java.lang.String |
resolveToName(long number,
long hash)
Resolves number to a name. |
long |
toHashCode(byte[] address)
Generates a special hashcode for first 3 bytes of the address that is unique for every address. |
| Methods inherited from class org.jnetpcap.util.resolver.AbstractResolver |
|---|
addToCache, addToCache, canBeResolved, clearCache, finalize, getCacheCapacity, getCacheLoadFactor, getNegativeTimeout, getPositiveTimeout, hasCacheFile, isCached, loadCache, loadCache, propertyChange, resolve, saveCache, saveCache, setCacheCapacity, setCacheLoadFactor, setNegativeTimeout, setPositiveTimeout, toHashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String IEEE_OUI_DATABASE_PATH
| Constructor Detail |
|---|
public IEEEOuiPrefixResolver()
type - | Method Detail |
|---|
public void initializeIfNeeded()
initializeIfNeeded in interface ResolverinitializeIfNeeded in class AbstractResolver
public int loadCache(java.net.URL url)
throws java.io.IOException
loadCache in interface ResolverloadCache in class AbstractResolverurl - The url of the IEEE resource to load. If the url is null, the
default uri is attempted "http://standards.ieee.org/regauth/oui/oui.txt".
java.io.IOException - any IO errors
public java.lang.String resolveToName(byte[] address,
long hash)
resolveToName in class AbstractResolveraddress - address to resolvehash - computed hash code for the address, identifies the address
uniquely
public long toHashCode(byte[] address)
toHashCode in class AbstractResolver
protected java.lang.String resolveToName(long number,
long hash)
AbstractResolver
resolveToName in class AbstractResolvernumber - a number value to resolvehash - computed hash code for the number, identifies the number uniquely
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||