Hello
I am looking at putting the code belowinto a graphical user interface so that when it is run rather than printing to the command line it prints out to a simple text text box in the gui. The code basically put the nic card into promiscuos mode and prints out all the packets it receives -I amlooking to develop it further in the future to add functionalty but i would be grateful if someone could point me in the right direction to get going.
Heres the code so far
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.loopPacket(-1,new Tcpdump());
}
}
many thanks
I am looking at putting the code belowinto a graphical user interface so that when it is run rather than printing to the command line it prints out to a simple text text box in the gui. The code basically put the nic card into promiscuos mode and prints out all the packets it receives -I amlooking to develop it further in the future to add functionalty but i would be grateful if someone could point me in the right direction to get going.
Heres the code so far
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.loopPacket(-1,new Tcpdump());
}
}
many thanks