rust-pcap / pcap

Rust language pcap library
Apache License 2.0
594 stars 138 forks source link

Enable Capture to be used async for both read an write #343

Open Alexei-Kornienko opened 2 months ago

Alexei-Kornienko commented 2 months ago

Currently when you wrap a Capture in async stream you can use it read-only. I would like to be able to use it for both reading packed async and using sendpacket async as well.

My main goal is to write something similar to https://github.com/rodizio1/EZ-WifiBroadcast/ or https://github.com/svpcom/wfb-ng Main idea of that projects is to use Wifi adapter in monitor mode and use this mode to convert it to general purpose radio transmitter/receiver for sending data over the air. I would like to do the same in Rust but for that I need to both send and receive packets on the same capture struct. Currently it's only possible in blocking mode

Wojtek242 commented 2 months ago

PRs welcome :-)