News for hackers. Stuff that matters.
Re:Libtins – High-level and multiplatform C++ network packet... by _wmd on Saturday May 27, 2017 @08:06AM (#14429773)
There are plenty of ways they can keep the current API while eventually approaching optimal, for example, a chain of exceptions could incrementally refine the framework's idea of what the callback function expects, which could be turned into a BPF filter.

So for the cost of a few expensive frames at start, afterwards no exceptions get thrown.

Generally speaking though, I'm only replying because I hate people negging on minutia of new projects. If you're going to be critical of something especially when it's a lone wolf effort (or even a small team), try to be constructive, there are real people on the other end of the wire.

Re:Libtins – High-level and multiplatform C++ network packet... by tjoff on Saturday May 27, 2017 @08:25AM (#14429818)
I thought the criticism was quite valid.

If high efficiency wasn't touted as a feature then it would have been fine. But when it turns out that one of the main selling points is performance (with no expressed limitations or restrictions) and regular patterns perform badly, as a consequence of the design, then it is quite valid criticism. (Whether this is the case in practice I don't know but GP brings up a very valid point)

GPs point begs the question - Why was it designed in such as way? Quite possibly the tradeoffs were considered and the current solution was targeted because of several reasons. But the page doesn't convey any of that, it simply states that "In fact, it is one of the fastest packet sniffing and interpretation libraries available.".

While I agree with your point the library isn't exactly marketed as a lone wolf effort either, and that will also affect the criticism it will receive.

Re:Libtins – High-level and multiplatform C++ network packet... by jzwinck on Saturday May 27, 2017 @08:39AM (#14429848)
A more charitable reading of my comment would be that I am recommending the use of "if" instead of C++ exceptions for hot-path control flow in high-performance libraries.

Heuristic construction of a packet filter based on previously seen exceptions is infeasible with the current API because rejection of the first N non-TCP packets does not guarantee rejection of the next one.

Re:Libtins – High-level and multiplatform C++ network packet... by to3m on Saturday May 27, 2017 @04:49PM (#14431901)
There appears to be an alternative API that doesn't throw exceptions: https://github.com/mfontanini/libtins/blob/37c92fcf5c83b034a...

(rfind_pdu uses it internally: https://github.com/mfontanini/libtins/blob/37c92fcf5c83b034a...)