Information Technology Solutions, Answers and Experts
Write an Article Ask a Question

jpcap

Damien Legrand
P: n/a
Damien Legrand
i use jpcap classe for captured packet but i don't arrive to save the
packets in a file with the method jpcapwriter...

how help me?

thanks.

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());
}
}
Jul 17 '05 #1

Post your reply

Sign in to post your reply or Sign up for a free account.



Didn't find the answer to your question? Post your Java question on Bytes

You can also browse similar questions: Java jpcap setfilter

Get Java Help

Get Java help from a network of professionals.

Post your Question » Over 331,217 Members | 3373 Online