|
SourceForge Jpcap | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.jpcap.capture.CaptureDevice
public class CaptureDevice
Encapsulates a capture-capable device.
NB there is no support for supplying the MAC address of a capture device. In Java 6, you can get it this way:
NetworkInterface nwif = NetworkInterface.getByInetAddress(captureDevice.getAddresses()[0].getAddress());
byte[] macAddress = nwif.getHardwareAddress();
| Nested Class Summary | |
|---|---|
static class |
CaptureDevice.Address
The Address class encapsulates addressing information for a CaptureDevice. |
| Field Summary | |
|---|---|
static int |
PCAP_IF_LOOPBACK
Loopback bitmask. |
| Constructor Summary | |
|---|---|
protected |
CaptureDevice(String name,
String description,
int network,
int netmask,
int flags,
CaptureDevice.Address[] addresses)
Construct a new instance of CaptureDevice. |
| Method Summary | |
|---|---|
boolean |
equals(Object other)
|
CaptureDevice.Address[] |
getAddresses()
Return the address information for the device. |
String |
getDescription()
Get the device description. |
String |
getName()
Get the device name. |
int |
hashCode()
|
boolean |
isLoopback()
Return true if the device is a loopback device. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int PCAP_IF_LOOPBACK
| Constructor Detail |
|---|
protected CaptureDevice(String name,
String description,
int network,
int netmask,
int flags,
CaptureDevice.Address[] addresses)
name - Device name.description - Device description if available, or null.network - Network, from pcap_lookupnet(), corrected to host byte ordernetmask - Netmask, from pcap_lookupnet(), corrected to host byte orderflags - pcap_if_t.flags.addresses - Addresses of this interface| Method Detail |
|---|
public String toString()
toString in class Objectpublic String getName()
PacketCaptureCapable.open(java.lang.String, boolean).
public String getDescription()
public boolean isLoopback()
public CaptureDevice.Address[] getAddresses()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object other)
equals in class Object
|
Copyright © Patrick Charles & Jonas Lehmann, 2001; Esmond Pitt, 2008. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||