Repository navigation
Replies: 4 comments 11 replies
|
0 replies
|
I can't attach pcap file here |
1 reply
|
you said : "the code provided is missing the line where the reader is created/file name provided" because i did before : |
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I can write my captures to a file with the CaptureFileWriterDevice class. However, I'm trying to read these .pcap files. I see examples with the CaptureFileReaderDevice class. I tried this, but I got an error:
SharpPcap.PcapException*: 'Unable to open offline adapter: ' on the line
captureFileReader.Open();private static void device_OnPacketArrival(object sender, PacketCapture e)string path = "C:\\Users\\Documents\\Captures.pcap";CaptureFileReaderDevice captureFileReader = new CaptureFileReaderDevice(path);int packetsRead = 0;GetPacketStatus retval;while (packetsRead < packetsToRead){captureFileReader.Open();do{retval = captureFileReader.GetNextPacket(out e);if (retval == GetPacketStatus.PacketRead) packetsRead++;}while (retval == GetPacketStatus.PacketRead);}var endTime = DateTime.Now;Console.WriteLine(endTime);}All reactions