|
SourceForge Jpcap | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jpcap.client.CaptureTool
public class CaptureTool
Tool with text console for controlling packet capture.
Field Summary | |
---|---|
protected static String |
MODE_ASCII
|
protected static String |
MODE_OBJECT
|
protected static String |
MODE_RAW
|
protected static String |
MODE_TERSE
|
protected static String |
MODE_TEXT
|
protected static String |
MODE_VERBOSE
|
Constructor Summary | |
---|---|
CaptureTool()
Create a new capture tool. |
Method Summary | |
---|---|
boolean |
activateUi()
Active the graphical packet view. |
protected boolean |
autoDetect()
Attempt to detect and open a capture device. |
CaptureStatistics |
capture(int count)
Capture packets. |
void |
clearHistory()
Clear the capture history. |
int |
dumpHistory()
Dump the capture history buffer contents. |
String |
getDevice()
Fetch the capture device name. |
String |
getFilter()
Fetch the filter expression. |
CaptureHistory |
getHistory()
Fetch a reference to the history buffer. |
int |
getLinkLayerType()
Fetch the link-layer type. |
String |
getMode()
Fetch the capture mode. |
int |
getNetmask()
Fetch the netmask for the current device. |
int |
getNetwork()
Fetch the network number for the current device. |
int |
getSnaplen()
Fetch the snapshot length. |
int |
getTimeout()
Fetch the capture timeout value. |
protected void |
initializeConsole()
Initialize the tool's console. |
protected void |
initializeSystem()
Initialize the packet capture system. |
static boolean |
isModeValid(String pmode)
Check if a proposed mode is valid. |
static void |
main(String[] args)
Packet capture. |
void |
packetArrived(Packet packet)
Callback, called when PacketCapture.capture(int) captures a packet. |
void |
rawPacketArrived(RawPacket rawPacket)
|
boolean |
resetViewFrame()
Reset the capture view frame to clear its contents. |
void |
setDevice(String device)
Set and open the capture device. |
void |
setFilter(String filter)
Set the packet filter expression. |
void |
setMaxHistorySize(int size)
Set the maximum size of the history FIFO. |
void |
setMode(String mode)
Set the capture mode. |
void |
setSnaplen(int snaplen)
Set the snapshot length. |
void |
setTimeout(int timeout)
Set the capture timeout value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String MODE_RAW
protected static final String MODE_OBJECT
protected static final String MODE_VERBOSE
protected static final String MODE_TERSE
protected static final String MODE_ASCII
protected static final String MODE_TEXT
Constructor Detail |
---|
public CaptureTool()
Method Detail |
---|
public void rawPacketArrived(RawPacket rawPacket)
rawPacketArrived
in interface RawPacketListener
public void packetArrived(Packet packet)
PacketListener
PacketCapture.capture(int)
captures a packet.
packetArrived
in interface PacketListener
packet
- Packet that has been captured.Object.clone()
protected void initializeSystem()
protected boolean autoDetect()
protected void initializeConsole()
public boolean resetViewFrame()
public void clearHistory()
public void setMaxHistorySize(int size)
public int dumpHistory()
public boolean activateUi()
public int getNetwork() throws CaptureConfigurationException
CaptureConfigurationException
public int getNetmask() throws CaptureConfigurationException
CaptureConfigurationException
public int getLinkLayerType() throws CaptureConfigurationException, CaptureDeviceOpenException
CaptureConfigurationException
CaptureDeviceOpenException
public void setDevice(String device) throws CaptureDeviceOpenException
CaptureDeviceOpenException
public CaptureStatistics capture(int count) throws CaptureDeviceOpenException, InvalidFilterException, CapturePacketException
CaptureDeviceOpenException
InvalidFilterException
CapturePacketException
public String getDevice()
public void setFilter(String filter) throws InvalidFilterException
InvalidFilterException
public String getFilter()
public void setMode(String mode)
public String getMode()
public static boolean isModeValid(String pmode)
public void setTimeout(int timeout) throws CaptureDeviceOpenException
CaptureDeviceOpenException
public int getTimeout()
public void setSnaplen(int snaplen) throws CaptureDeviceOpenException
CaptureDeviceOpenException
public int getSnaplen()
public CaptureHistory getHistory()
public static void main(String[] args)
|
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 |