sharppcap icon indicating copy to clipboard operation
sharppcap copied to clipboard

Example6.DumpTCP.cs System.NotImplementedException:“Protocol of 3584 is not implemented”

Open chenli118 opened this issue 7 years ago • 5 comments

I try winPcap.Open(SharpPcap.WinPcap.OpenFlags.DataTransferUdp | SharpPcap.WinPcap.OpenFlags.NoCaptureLocal, readTimeoutMilliseconds);

in method "device_OnPacketArrival" line:

var tcpPacket = (PacketDotNet.TcpPacket)packet.Extract(typeof(PacketDotNet.TcpPacket));

chenli118 avatar May 28 '19 06:05 chenli118

I'm having this issue as well. The root cause appears to be that the link layer info is missing in the packet passed to the event handler (CaptureEventArgs e).

More specifically, the link layer argument being NULL in the line: var packet = Packet.ParsePacket(e.Packet.LinkLayerType, e.Packet.Data);

Changing this to var packet = Packet.ParsePacket(LinkLayers.Ethernet, e.Packet.Data); works around the issue for me, but is clearly not a good permanent solution.

Maybe someone knows why the LinkLayer info might not be populated in the CaptureEventArgs...?

UPDATE: the same behavior is present event when running the program as Administrator. In my case the system is Win10 running in VMware Workstation.

jehrich avatar May 28 '19 15:05 jehrich

@chenli118, @jehrich are you using Npcap? What adapters are you capturing on? I checked the code flow and the LinkType (linkType internally) is set in PcapDevice.cs when Active is set which occurs when a capture file is opened or a live capture is opened. This code hasn't changed in a while so its unclear why this wouldn't be working unless you are capturing on a device that doesn't provide a link layer, I think a raw capture device might do that.

chmorgan avatar May 29 '19 23:05 chmorgan

I'm using Npcap (v0.995) and the adapter is listed as Intel(R) 82574L Gigabit Network Connection but it's actually a virtualized adapter running in VMware Workstation. LMK if there's any other info I can provide that may help.

jehrich avatar May 30 '19 01:05 jehrich

@jehrich if you could find that location I mentioned in PcapDevice.cs and print out the output there when you open the adapter that could be helpful in confirming the value of the linktype. It would require building sharppcap from source but afaik this is the first the issue has been seen, not sure if its a widespread one or limited.

chmorgan avatar May 30 '19 15:05 chmorgan

Closing as the original poster hasn't responded for a while.

chmorgan avatar Aug 07 '19 00:08 chmorgan