segevfiner / cypcap

A Cython based Python binding for modern libpcap
https://pypi.org/project/cypcap/
BSD 3-Clause "New" or "Revised" License
14 stars 1 forks source link

Consider adding pcap_get_selectable_fd & pcap_get_required_select_timeout #14

Closed segevfiner closed 2 years ago

segevfiner commented 2 years ago

Only available on Unix so we need to stub them out somehow for Windows due to Cython not supporting conditional compilation properly.

segevfiner commented 2 years ago

See https://github.com/segevfiner/cypcap/commit/e8bae675ec1f70551e8608deab4d9c67a61c4d32 & https://github.com/segevfiner/cypcap/commit/db819c1814585c700cc67c4294a8cc16d41714d8 where I stripped out use of Cython conditional compilation due to the issues it causes. Namely that you won't be able to distribute a generated c source file as the conditional compilation statements are applies during Cython to C transpilation.

segevfiner commented 2 years ago

Can also consider adding pcap_set_protocol_linux and maybe pcap_getevent for Windows? Documentation is sparse for it though.