dotpcap / sharppcap

Official repository - Fully managed, cross platform (Windows, Mac, Linux) .NET library for capturing packets
1.35k stars 267 forks source link

RSSI parse example #361

Open UmmonKRS opened 2 years ago

UmmonKRS commented 2 years ago

Hi! On codeproject page there mentions of supporting of IEEE 802, can't find an example how to get rssi information from PacketCapture. Is this feature supported by library?

chmorgan commented 2 years ago

Hi @UmmonKRS, you'll want to look at https://github.com/dotpcap/packetnet, and it looks like 802 is supported:

grep -ri RSSI

...
Test/PacketType/Ieee80211/PpiFieldsTests.cs:                RssiCombined = 0x3,
Test/PacketType/Ieee80211/PpiFieldsTests.cs:                RssiAntenna0Control = 0x4,
Test/PacketType/Ieee80211/PpiFieldsTests.cs:                RssiAntenna1Control = 0x5,
Test/PacketType/Ieee80211/PpiFieldsTests.cs:                RssiAntenna2Control = 0x6,
Test/PacketType/Ieee80211/PpiFieldsTests.cs:                RssiAntenna3Control = 0x7,
Test/PacketType/Ieee80211/PpiFieldsTests.cs:                RssiAntenna0Ext = 0x8,
Test/PacketType/Ieee80211/PpiFieldsTests.cs:                RssiAntenna1Ext = 0x9,
Test/PacketType/Ieee80211/PpiFieldsTests.cs:                RssiAntenna2Ext = 0xA,
Test/PacketType/Ieee80211/PpiFieldsTests.cs:                RssiAntenna3Ext = 0xB,
Test/PacketType/Ieee80211/PpiFieldsTests.cs:            Assert.AreEqual(0x3, recreatedField.RssiCombined);
Test/PacketType/Ieee80211/PpiFieldsTests.cs:            Assert.AreEqual(0x4, recreatedField.RssiAntenna0Control);
Test/PacketType/Ieee80211/PpiFieldsTests.cs:            Assert.AreEqual(0x5, recreatedField.RssiAntenna1Control);
Test/PacketType/Ieee80211/PpiFieldsTests.cs:            Assert.AreEqual(0x6, recreatedField.RssiAntenna2Control);
Test/PacketType/Ieee80211/PpiFieldsTests.cs:            Assert.AreEqual(0x7, recreatedField.RssiAntenna3Control);
Test/PacketType/Ieee80211/PpiFieldsTests.cs:            Assert.AreEqual(0x8, recreatedField.RssiAntenna0Ext);
Test/PacketType/Ieee80211/PpiFieldsTests.cs:            Assert.AreEqual(0x9, recreatedField.RssiAntenna1Ext);
Test/PacketType/Ieee80211/PpiFieldsTests.cs:            Assert.AreEqual(0xA, recreatedField.RssiAntenna2Ext);
Test/PacketType/Ieee80211/PpiFieldsTests.cs:            Assert.AreEqual(0xB, recreatedField.RssiAntenna3Ext);
Test/PacketType/Ieee80211/PpiFieldsTests.cs:                MaximumRssi = 0xAABB,
Test/PacketType/Ieee80211/PpiFieldsTests.cs:            Assert.AreEqual(0xAABB, recreatedField.MaximumRssi);
...
UmmonKRS commented 2 years ago

Hi Chris! Got it, parse works fine for me, thank you!

But I've stucked in capture packages in monitor mode. Have 2 different AP, Win10, npcap 1.55; using Wireshark and AP in monitor mode - I can see there is packages. I've tried Example03.BasicCap, VS2019 admin mode - there is no events device_OnPacketArrival. Have tried to play with mode/timeout on device.Open(...) with no success. Changing mode to "monitor" via WlanHelper also didn't help.

Could you help, please?

UmmonKRS commented 2 years ago

Hi @chmorgan Have you any ideas how to solve this issue?