|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface LiveCapture
A network packet cature on a live network interface. To obtain an instance
of a class implementing this interface, use one of the CaptureFactory.openLive()
methods which open up a network interface live capture.
LiveCapture capture = CaptureFactory.openLive();
while (capture.hasNext()) {
CapturePacket packet = capture.next();
// Do something with the packet now
}
| Nested Class Summary | |
|---|---|
static class |
LiveCapture.Option
Options which can be set on open captures. |
| Field Summary | |
|---|---|
static LiveCapture.Option |
DEFAULT_CAPTURE_OPTION
The default option when none are specified by the user. |
| Method Summary | |
|---|---|
CaptureInterface[] |
interfaceSnapshot()
Takes a snapshot of all the CaptureInterface configurations currently open for live capture. |
CaptureInterface[] |
interfaceSnapshot(CaptureInterface... currentInterface)
Takes a snapshot of supplied CaptureInterface configurations currently open for live capture. |
CaptureInterface |
setFilter(Filter filter,
CaptureInterface currentInterface)
Sets a new filter for currently open CaptureInterface. |
| Methods inherited from interface jnetpcap.capture.Capture |
|---|
close, getFilter, getMutableCapture, getRemoteSession, isCaptureMutable, isCaptureRemote, setFilter |
| Field Detail |
|---|
static final LiveCapture.Option DEFAULT_CAPTURE_OPTION
| Method Detail |
|---|
CaptureInterface setFilter(Filter filter,
CaptureInterface currentInterface)
throws java.io.IOException
Sets a new filter for currently open CaptureInterface. CaptureInterfaces, once opened for live network capture are frozen and made immutable. This allows previously captured packets that reference a CaptureInterface they were captured on, to contain exact configuration state as the time the packet was captured. In order to apply a new filter, a copy is made of the currentInterface and the new user filter applied to the clone of the currentInterface. From this time on, any new packets captured on this interface, will reference the new CaptureInterface object with new filter and any new interface config changes such as well.
Note that no changes to the config of the supplied currentInterface object are made. All changes are made to the new instance of CaptureInterface returned.
filter - new filter to appy to the current interfacecurrentInterface - current interface the filter should be applied to
java.io.IOException
CaptureInterface[] interfaceSnapshot()
throws java.io.IOException
java.io.IOException - any IO errors
CaptureInterface[] interfaceSnapshot(CaptureInterface... currentInterface)
throws java.io.IOException
currentInterface - current open capture interfaces active in this capture session
java.io.IOException - any IO errors or if any of the specified CaptureInterfaces do not exist
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||