|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface CaptureInterface
Describes the capture device that captured the packet. Individual captured packets maintain a reference to a capture device that captured them. The CaptureInterface differes from java.net.NetworkInterface as it is essentially a snapshot of the current or past state of the interface. The CaptureDevices created are usually not cached by are new instances that contain certain state at the time they were initialized.
For example a capture device was created
and initialized at 8:00am. 5 minutes later the network interface configuration was
altered and another IP addresses alias added to the interface. When the device
was opened at 8:10am a new CaptureInterface created and initialized and now it there
are two instances of CaptureInterface associated with that same interface both containing
slightly different IP addresses for that physical network interface. Another common
way for a new alternate CaptureInterface to be created when a new filter is applied
in a middle of a already open capture. At the time the filter is applied a new
CaptureInterface is created with new filter state and from then on any packets
captured and returned from LiveCapture sessions will reference the new CaptureInterface
with the new filter state, while the old packets (packets already returned prior to
the filter being applied) will maintain a reference to the original CaptureInterface
object. "Nap" (see http://jnetpcap.sf.net?q=napspec) file format stores
all of this information in the capture file. Other formats such as PCAP and SNOOP
can not.
It is important to first check the capabilities of the capture device using the
getCapabilities() method before accessing or setting new
values. The capabilities are of the source of the capture, that is if the packet is
comming from a live network interface, the capabilities are of the network interface
that did the capturing and the operating system on which the capture took place. If the
source of the captured packet is a file, then the information supplied by this interface
is file type specific. File formats such as Snoop and Pcap have limited capabilities to
store information about capturing devices, while Nap file format can store all of this information.
| Nested Class Summary | |
|---|---|
static class |
CaptureInterface.Capability
Enum structure which defines the capabilities of the capturing device such as a network interface and the kernel of this particular OS. |
static class |
CaptureInterface.TimestampResolution
|
| Method Summary | |
|---|---|
java.util.Set<CaptureInterface.Capability> |
getCapabilities()
Returns the capabilities of the capturing device. |
DataEncapsulation |
getDataEncapsulation()
Data encapsulation used by this capture device |
java.lang.String |
getDisplayName()
Gets a more human readable name for the interface if one is available. |
Filter |
getFilter()
Gets the currently assigned filter to this capture device. |
java.util.List<java.net.InetAddress> |
getIpAddresses()
Gets a list of ip addresses that are/were set on the interface. |
MutableCaptureInterface |
getMutableCaptureInterface()
Gets the mutable version of this CaptureInterface interface. |
java.lang.String |
getName()
Gets the name as returned by the operating system of the network interface this CaptureInterface describes. |
java.lang.String |
getOSArchitecture()
Gets the OS architecture as recorded using system property os.architecture |
java.lang.String |
getOSName()
Get the name of the operating system the capture device is on. |
java.lang.String |
getOSVersion()
Get the version of the operating system the capture device is on. |
CaptureInterface.TimestampResolution |
getTimestampResolution()
Returns the resolution that the capturing device is capable of. |
int |
getTimezone()
Gets the timezone as retrieved from the operating system at the time of the packet capture. |
boolean |
isMutable()
Tells if this instance of CaptureInterface is mutable. |
| Method Detail |
|---|
java.util.Set<CaptureInterface.Capability> getCapabilities()
DataEncapsulation getDataEncapsulation()
java.lang.String getDisplayName()
Filter getFilter()
#setFilter
method or at the time the capture device was opened using one of CaptureFactory.openLive(),
CaptureFactory.openLive() or CaptureFactory.Factory.openLive() methods.
java.util.List<java.net.InetAddress> getIpAddresses()
java.lang.String getName()
java.lang.String getOSArchitecture()
os.architecture
java.lang.String getOSName()
java.lang.String getOSVersion()
CaptureInterface.TimestampResolution getTimestampResolution()
int getTimezone()
boolean isMutable()
MutableCaptureInterface getMutableCaptureInterface()
isMutable() prior to calling this method. If this CaptureInterface
is not mutable this method will throw IllegalStateException.
java.lang.IllegalStateException - if you access this method when this instance is immutable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||