Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] AMQP dissector - the code to review

From: "ronnie sahlberg" <ronniesahlberg@xxxxxxxxx>
Date: Fri, 23 Mar 2007 21:16:42 +0000
Hi,

1, can you move the hf and ett arrays as well as the
proto_register_... and proto_reg_handoff_...  to the end of the file
instead of the begining to be more consistent with other dissectors.

2, remove the amqp_module variable since it is not yet used.
also remove the if(proto_amqp) { conditional in proto_register_amqp
since this function will only be called exactly once and this
conditional is unnessecary
same goes for the initialized variable in reg_handoff,  remove it
since this function also is only called once.

3, change dissect_amqp function,
to be a new style dissector.
I.e. return a gboolean TRUE/FALSE depending on whether the dissector
accepted the packet or not.
Add these heuristics before spawning off into tcp_dissect_pdus()

4, dissect_amqp_message is 1600 lines long !!!
Please split this one down into manageable smaller functions.
Replacing the body of the case blocks are probably a good place where
you should replace the code with a function call.




On 3/22/07, Martin Sustrik <sustrik@xxxxxxxxxx> wrote:
Ronnie,

Here's the code and a sample capture. Is there anyting else I should do?
What's the process for getting things into the codebase?

Thanks.
Martin

ronnie sahlberg wrote:
> For inclusion into mainline wireshark,
> please send the patch to the list for revies (unless it is very large
> in case a url is better)
>
> also please provide a few example captures that we can use to test the
> dissector with.