zisko.multicastor.program.mmrp
Class PcapHandler

java.lang.Object
  extended by zisko.multicastor.program.mmrp.PcapHandler

public class PcapHandler
extends java.lang.Object

Try to get the device by the MAC address which is given by the user


Constructor Summary
PcapHandler()
           
 
Method Summary
static java.lang.String byteMACToString(byte[] mac)
          Convert the MAC address which is an byte array to a string
static boolean compareMACs(byte[] a, byte[] b)
          Compare two MAC addresses
static org.jnetpcap.Pcap getPcapInstance(byte[] deviceMACAddress)
          Return the pcap object of the network device
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PcapHandler

public PcapHandler()
Method Detail

getPcapInstance

public static org.jnetpcap.Pcap getPcapInstance(byte[] deviceMACAddress)
                                         throws java.io.IOException
Return the pcap object of the network device

Parameters:
deviceMACAddress - of the network device
Returns:
The pcap object of the network device
Throws:
java.io.IOException

compareMACs

public static boolean compareMACs(byte[] a,
                                  byte[] b)
Compare two MAC addresses

Parameters:
a - is a MAC address
b - is a MAC address
Returns:
true if the MAC addresses are the same. False if not.

byteMACToString

public static java.lang.String byteMACToString(byte[] mac)
Convert the MAC address which is an byte array to a string

Parameters:
mac - which should be convert to a string
Returns:
the converted string