|
SourceForge Jpcap | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.jpcap.capture.CaptureTest
net.sourceforge.jpcap.capture.JWinPcapTest
public class JWinPcapTest
Class to exercise JWinPcap.
Testing of JWinPcap could easily be implemented in the same class's main method, but since the tester is a client and must implement the listener interface, seems clearer to decouple the two.
| Field Summary | |
|---|---|
protected static String |
NAME
|
| Fields inherited from class net.sourceforge.jpcap.capture.CaptureTest |
|---|
Filter, TEST_COUNT |
| Constructor Summary | |
|---|---|
JWinPcapTest()
Create a new tester. |
|
| Method Summary | |
|---|---|
static void |
main(String[] args)
Simple test to exercise JWinPcap. |
void |
packetArrived(Packet packet)
Callback, called when PacketCapture.capture(int) captures a packet. |
void |
rawPacketArrived(RawPacket rawPacket)
|
void |
runTest()
Execute the test. |
void |
statisticsArrived(StatisticsEvent event)
Handle a statistics event. |
void |
testDump()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static String NAME
| Constructor Detail |
|---|
public JWinPcapTest()
| Method Detail |
|---|
public void packetArrived(Packet packet)
PacketListenerPacketCapture.capture(int) captures a packet.
packetArrived in interface PacketListenerpacketArrived in class CaptureTestpacket - Packet that has been captured.Object.clone()public void rawPacketArrived(RawPacket rawPacket)
rawPacketArrived in interface RawPacketListenerrawPacketArrived in class CaptureTestpublic void statisticsArrived(StatisticsEvent event)
StatisticsListener
statisticsArrived in interface StatisticsListenerevent - StatisticsEventpublic void runTest()
runTest in class CaptureTest
public void testDump()
throws Exception
testDump in class CaptureTestException
public static void main(String[] args)
throws IOException
IOException
|
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 | |||||||||