Wireshark-commits: [Wireshark-commits] master b1d33db: AMQP 1.0: Refactor to fix parsing of timesta

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sun, 16 Aug 2015 13:00:48 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=b1d33db258248d37984028eb3cf06075d8f4154d
Submitter: Michael Mann (mmann78@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

b1d33db by Petr Gotthard (petr.gotthard@xxxxxxxxxxxxx):

    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@xxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Michael Mann <mmann78@xxxxxxxxxxxx>
    

Actions performed:

    from  8fa4016   make-taps.pl: Remove duplicate slash in pathname
    adds  b1d33db   AMQP 1.0: Refactor to fix parsing of timestamps


Summary of changes:
 epan/dissectors/packet-amqp.c | 1327 +++++++++++++++--------------------------
 1 file changed, 497 insertions(+), 830 deletions(-)