First, thanks for the amazing work on this library, I was able to outperform my old C# tracing tool by 200%!
Secondly, I was wondering if you could give me some advice here.
I started with this (Windows 10, VS2019):
sniffer.sniff_loop([&](Tins::Packet& packet) { this->process_packet(packet); return true; });
This worked for me, but when using FileSniffer, timestamps were not the ones from the file, but from the moment the file was read (and I really really need those timestamps...).
I saw in sniffer.h a check is present to prevent using invoke_loop_cb when you compile in VS (3478c7b09a746b5e3fbcbbf2e84e606a7291e2a5), which would force me to write a handler for PDU's instead of Packets (which I can't as I need the timestamps). I'm wondering if this could have something to do with it...?
I circumvented my original issue by making two changes:
Removing the VS check
Changing the definition of make_sniffer_handler to accept a callback with Packet& instead of PDU& (One could probably make it generic for both...), as I preferred this over the lambda function.
Would there be a better way to implement this (maybe without my changes)? Any help is welcome!
Hi,
First, thanks for the amazing work on this library, I was able to outperform my old C# tracing tool by 200%!
Secondly, I was wondering if you could give me some advice here. I started with this (Windows 10, VS2019):
sniffer.sniff_loop([&](Tins::Packet& packet) { this->process_packet(packet); return true; });
This worked for me, but when using FileSniffer, timestamps were not the ones from the file, but from the moment the file was read (and I really really need those timestamps...).I saw in sniffer.h a check is present to prevent using
invoke_loop_cb
when you compile in VS (3478c7b09a746b5e3fbcbbf2e84e606a7291e2a5), which would force me to write a handler for PDU's instead of Packets (which I can't as I need the timestamps). I'm wondering if this could have something to do with it...?I circumvented my original issue by making two changes:
make_sniffer_handler
to accept a callback with Packet& instead of PDU& (One could probably make it generic for both...), as I preferred this over the lambda function.Would there be a better way to implement this (maybe without my changes)? Any help is welcome!
Thanks