mfontanini / libtins

High-level, multiplatform C++ network packet sniffing and crafting library.
http://libtins.github.io/
BSD 2-Clause "Simplified" License
1.91k stars 377 forks source link

Question about the Sniffer class. #483

Closed gleb-kun closed 2 years ago

gleb-kun commented 2 years ago

If my wireless interface is in access point mode, can I read packets using the Sniffer class? To test, I wrote the following code:

Tins::SnifferConfiguration snifferConfiguration;
Tins::Sniffer* sniffer = new Tins::Sniffer(name, snifferConfiguration);

for (int i = 0; i < 100; i++)
{
    Tins::PDU *currentPduPacket = sniffer->next_packet();
    ...
    //write pdu to file
    ...
}
sniffer->stop_sniff();

Am I doing something wrong, or is it impossible to use Sniffer for this?

gleb-kun commented 2 years ago

Okay, I figured it out, there really was no traffic and packets at the interface in access point mode.