Wireshark-dev: Re: [Wireshark-dev] Protocol Parser Compiler

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Thu, 18 Oct 2007 03:48:09 -0700
Graham Bloice wrote:
Might be interesting for some:

binpac: A yacc for Writing Application Protocol Parsers
http://lambda-the-ultimate.org/node/2496

Sebastien Tandel mentioned that back in May - I didn't get around to replying back then; thanks for reminding me of this and getting me to reply. Apologies to Sebastien for not replying then....

Yes, something such as this would, I suspect, be a Very Good Thing. It'd be interesting to see how many handwritten dissectors could be replaced by dissectors written in binpac - and whether we could do an interpreted version of binpac, so that users could write dissectors without having to build them as plugins. (I'd also be curious whether such an interpreter could be small enough to fit in an L2 cache, or even an L1 cache, and, if so, whether that would reduce the code cache footprint enough to make it a performance win.)

It would make it easier to write dissectors - and easier to write safe dissectors. It might also mean that the generated code could automatically handle the "just construct the summary line" vs. "build the protocol tree" decision (and also make sure expert information is added regardless of whether a protocol tree is being built or not.