jpcap
From: Damien Legrand (damien.legrand_at_ch-cesame-angers.fr)
Date: 01/20/04
- Next message: Fereshteh Shojaei: "How can you move the cursor authomatically among different GUI components in a JFrame"
- Previous message: nos: "Re: Weird problem - commenting out doesn't work..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 20 Jan 2004 07:10:24 -0800
i use jpcap classe for captured packet but i don't arrive to save the
packets in a file with the method jpcapwriter...
i dont know java. help me !
thanks.
class jpcapwriter doc :
http://netresearch.ics.uci.edu/kfujii/jpcap/doc/javadoc/jpcap/package-summary.html
my code is that :
import jpcap.*;
class Tcpdump implements JpcapHandler
{
public void handlePacket(Packet packet){
System.out.println(packet);
}
public static void main(String[] args) throws
java.io.IOException{
String[] lists=Jpcap.getDeviceDescription();
System.out.println("Start capturing on "+lists[0]);
Jpcap jpcap=Jpcap.openDevice(Jpcap.getDeviceList()[0],1000,false,20);
//jpcap.setFilter("host 132.147.47.98",true);
jpcap.loopPacket(-1,new Tcpdump());
}
}
- Next message: Fereshteh Shojaei: "How can you move the cursor authomatically among different GUI components in a JFrame"
- Previous message: nos: "Re: Weird problem - commenting out doesn't work..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|