|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jpcap.client.CaptureTool
Tool with text console for controlling packet capture.
Field Summary | |
protected static java.lang.String |
MODE_ASCII
|
protected static java.lang.String |
MODE_OBJECT
|
protected static java.lang.String |
MODE_RAW
|
protected static java.lang.String |
MODE_TERSE
|
protected static java.lang.String |
MODE_TEXT
|
protected static java.lang.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. |
java.lang.String |
getDevice()
Fetch the capture device name. |
java.lang.String |
getFilter()
Fetch the filter expression. |
CaptureHistory |
getHistory()
Fetch a reference to the history buffer. |
int |
getLinkLayerType()
Fetch the link-layer type. |
java.lang.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(java.lang.String pmode)
Check if a proposed mode is valid. |
static void |
main(java.lang.String[] args)
Packet capture. |
void |
packetArrived(Packet packet)
|
void |
rawPacketArrived(RawPacket rawPacket)
|
boolean |
resetViewFrame()
Reset the capture view frame to clear its contents. |
void |
setDevice(java.lang.String device)
Set and open the capture device. |
void |
setFilter(java.lang.String filter)
Set the packet filter expression. |
void |
setMaxHistorySize(int size)
Set the maximum size of the history FIFO. |
void |
setMode(java.lang.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 java.lang.String MODE_RAW
protected static final java.lang.String MODE_OBJECT
protected static final java.lang.String MODE_VERBOSE
protected static final java.lang.String MODE_TERSE
protected static final java.lang.String MODE_ASCII
protected static final java.lang.String MODE_TEXT
Constructor Detail |
public CaptureTool()
Method Detail |
public void rawPacketArrived(RawPacket rawPacket)
rawPacketArrived
in interface RawPacketListener
public void packetArrived(Packet packet)
packetArrived
in interface PacketListener
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(java.lang.String device) throws CaptureDeviceOpenException
CaptureDeviceOpenException
public CaptureStatistics capture(int count) throws CaptureDeviceOpenException, InvalidFilterException, CapturePacketException
CaptureDeviceOpenException
InvalidFilterException
CapturePacketException
public java.lang.String getDevice()
public void setFilter(java.lang.String filter) throws InvalidFilterException
InvalidFilterException
public java.lang.String getFilter()
public void setMode(java.lang.String mode)
public java.lang.String getMode()
public static boolean isModeValid(java.lang.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(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |