AMQP 1.0: Refactor to fix parsing of timestamps

Timestamps are currently dissected as integer numbers; two aspects need to
be recatored to correctly dissect timestamps:
 - the add_1_0_proto_item() function
 - protocol fields (hf_xxx) and the get_amqp_1_0_value_formatter()

(1)
The AMQP 1.0 dissector rely on the proto_tree_add_item. There is only one
invocation common for all datatypes (in add_1_0_proto_item), which cannot
pass any type-specific ENC_xxx specifiers and it cannot handle custom
datatypes like AMQP timestamp.

I propose to replace the add_1_0_proto_item() by type-specific dissectors that
will correctly set the ENC_xxx specifiers and handle exceptional cases like
the AMQP timestamp or the zero-length true/false datatypes.

(2)
The get_amqp_1_0_value_formatter implements a table-driven magic to select
alternate hf_xxx field based on the actual datatype. This however
 - defines alternate fields where the standard permits only one datatype
 - does not support fields that can contain any datatype ("*")
 - does not support FT_TIMESTAMP

I propose to make this mechanism less table-driven (more explicit and more
flexible) and allow all alternates permitted by the standard.

Change-Id: Ib2cbda632d4c81ec3e6b81f539fe77bb913afc1c
Reviewed-on: https://code.wireshark.org/review/9528
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Petr Gotthard 2015-07-04 01:19:02 +02:00 committed by Michael Mann
parent 8fa4016347
commit b1d33db258
1 changed files with 497 additions and 830 deletions

File diff suppressed because it is too large Load Diff