Wireshark-commits: [Wireshark-commits] master f01190c: Reworked dissection of BGP Extended Communit
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 2 Sep 2016 19:59:53 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=f01190ca90a52eb6da98315d16a5fb6f753f8659
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

f01190c by Peter Palúch (Peter.Paluch@xxxxxxxxxxxx):

    Reworked dissection of BGP Extended Community attributes
    
    This patch contains a partial rewrite of the BGP dissector for Extended
    Communities.  The changes were primarily motivated by my dissatisfaction
    with the generally unreadable way in which the types, names and values of
    BGP Extended Communities were displayed in Wireshark GUI.  The rewrite
    provides a hopefully more readable and eye-pleasing way of displaying the
    extended communities.  I have also corrected numerous other flaws with the
    Extended Community dissector I stumbled across.
    
    In particular, the changes encompass the following:
    
    1.) The Type octet of an Extended Community is now analyzed including its
    Authority and Transitivity bits.  These were not dissected before.
    
    2.) Dissection for EVPN Extended Community was improved.  The original
    implementation blindly assumed that there is just a single subtype and
    decoded the community ignoring the actual subtype.
    
    3.) I have removed the hf_bgp_ext_com_value_unknown16 and ..._unknown32.
    The current code uses a different approach to display values of unrecognized
    communities, and for recognized communities, there are no "unknown"
    subfields.
    
    4.) Removed a couple of variables declared at the
    dissect_bgp_update_ext_com() level.  These stored the result of a
    tvb_get_...() call but the value was used only once.  I have replaced them
    with the direct use of tvb_get_...()
    
    5.) Moved duplicate code to add the Type value into the community_tree from
    each branch in the switch(com_type_high_byte) out of it and placed it before
    the switch().
    
    6.) Reworked the style in which individual communities are displayed.  Each
    community item (collapsed) is now displayed using the following label
    format:
    
    Community name: Values [Generic community type]
    
    Examples:
    
    Route Target: 1:1 [Transitive 2-Octet AS-Specific]
    Unknown subtype 0x01: 0x8081 0x0000 0x2800 [Non-Transitive Opaque]
    Unknown type 0x88 subtype 0x00: 0x0000 0x0000 0x0000 [Unknown community]
    
    6.) To keep the filter names more consistent, changed names of selected filters:
    
    bgp.ext_com.type_high -> bgp.ext_com.type
    bgp.ext_com.type_low -> bgp.ext_com.stype_unknown
    
    In particular, I do not want to call the subtype as bgp.ext_com.type_low
    because that filter applied only to unrecognized subtypes even though its
    name would suggest to users that they can filter any community based on it.
    
    7.) Numerous corrections in text labels, names and labels that have been
    incorrect or incomplete.
    
    Bug: 12794
    Change-Id: I9653dbbc8a8f85d0cd2753dd12fd537f0a604cf3
    Reviewed-on: https://code.wireshark.org/review/17377
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  d68f622   aruba_erm: register dissector by name.
    adds  f01190c   Reworked dissection of BGP Extended Community attributes


Summary of changes:
 epan/dissectors/packet-bgp.c |  524 ++++++++++++++++++++++++++++--------------
 1 file changed, 352 insertions(+), 172 deletions(-)