net.sourceforge.jpcap.net
Class MACAddress

java.lang.Object
  extended bynet.sourceforge.jpcap.net.MACAddress

public class MACAddress
extends java.lang.Object

MAC address.

This class doesn't yet store MAC addresses. Only a utility method to extract a MAC address from a big-endian byte array is implemented.


Field Summary
static int WIDTH
          The width in bytes of a MAC address.
 
Constructor Summary
MACAddress()
           
 
Method Summary
static java.lang.String extract(int offset, byte[] bytes)
          Extract a MAC address from an array of bytes.
static long random()
          Generate a random MAC address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WIDTH

public static final int WIDTH
The width in bytes of a MAC address.

See Also:
Constant Field Values
Constructor Detail

MACAddress

public MACAddress()
Method Detail

extract

public static java.lang.String extract(int offset,
                                       byte[] bytes)
Extract a MAC address from an array of bytes.

Parameters:
offset - the offset of the address data from the start of the packet.
bytes - an array of bytes containing at least one MAC address.

random

public static long random()
Generate a random MAC address.