Hello everyone
I need to read some winpcap file using jnetpcap. I captured my desired traffic by wireshark and i need to read them. can you tell me which classes does support that?
yours
jNetPcap can read "offline" files, you do not need jNetStream for that purpose. The process for reading offline files is nearly identical to this example. The only difference is that your code needs to use Pcap.openOffline method, instead of Pcap.openLive.
I should add, that since you are reading a file, you can also skip the step in the example where it discovers the "list of devices" which are only needed for Pcap.openLive method.
You need specify a full path to the file. If you go into "windows exlorere" under windows, copy/paste the path from the window as your path into Pcap.openOffline.
Sorry I can not understand what you mean. I specified the whole path. I dont know what you mean by copy/paste the windows explorer into openoffline.
Can you please guide me.
Regards
that is exactly C:\
then i replaced my file there
C:\myfile.pcap
then i provide this address Pcap pcap = Pcap.openOffline("C:\myfile.pcap",errbuf);
but it says doesnt exist such directory/file
Guys
Do I need JnetStream for reading offline captured file? or can I use jNetPcap?
Hi and welcome.
jNetPcap can read "offline" files, you do not need jNetStream for that purpose. The process for reading offline files is nearly identical to this example. The only difference is that your code needs to use
Pcap.openOfflinemethod, instead ofPcap.openLive.Sly Technologies, Inc.
R&D
I should add, that since you are reading a file, you can also skip the step in the example where it discovers the "list of devices" which are only needed for
Pcap.openLivemethod.Sly Technologies, Inc.
R&D
Thanks Mark.
But in Windows do I need anything to be able to open a file?
Here is your code:
String fname = "myfile.pcap";
Pcap pcap = Pcap.openOffline(fname, errbuf);
Where my file should be located? I wrote Pcap pcap = Pcap.openOffline("C:\myfile.pcap", errbuf);
but it can not find it.
Do I need to call any extra method for Windows?
You need specify a full path to the file. If you go into "windows exlorere" under windows, copy/paste the path from the window as your path into
Pcap.openOffline.Sly Technologies, Inc.
R&D
Sorry I can not understand what you mean. I specified the whole path. I dont know what you mean by copy/paste the windows explorer into openoffline.
Can you please guide me.
Regards
that is exactly C:\
then i replaced my file there
C:\myfile.pcap
then i provide this address Pcap pcap = Pcap.openOffline("C:\myfile.pcap",errbuf);
but it says doesnt exist such directory/file
A backslash to java is an escape sequence. You need to provide a '\\' so it comes out in the end as a single \.
Sly Technologies, Inc.
R&D