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

Wireshark-commits: [Wireshark-commits] master 1d2f68b: sdp: refactor session/media level handling o

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Tue, 6 Dec 2016 13:26:32 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=1d2f68b60f003c9ef006465330207d3d65af6dd7
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

1d2f68b by Peter Wu (peter@xxxxxxxxxxxxx):

    sdp: refactor session/media level handling of attributes
    
    The media_count meaning is horrendous. -1 means "none", a count of "0"
    actually means "1". This led to various bugs in the past, so just rip it
    out and use a (wmem) array from which the length can be determined.
    
    That also means that a hard-coded limit on the media can now easily be
    lifted without affecting the size of the transport_info_t structure.
    (This limit, SDP_MAX_RTP_CHANNELS,  is unchanged in this patch though.)
    
    Refactor the SDP dissector such that:
    
     - Media and related attributes are no longer a bunch of fixed array
       fields, but grouped in one structure. This results in the largest
       changes all over the place since "transport_info->media[n]" is now
       transformed into "media_desc->media" where "media_desc" is an element
       of the "transport_info->media_descriptions" wmem array.
     - Simplify protocol (in "m=") parsing (lots of ifs -> array + loop).
     - Remove convert_disposable_media and disposable_media_info_t, parse
       fields (media protocol from "m=", connection address from "c=", etc.)
       while parsing the SDP instead of parsing it at the end.
     - Have two distinct structures for keeping the info for the session and
       media level. Emphasize that new media descriptions are inherited from
       session level attributes (via sdp_new_media_description).
     - Delay creation of dynamic payload type information table until we
       actually create the media description. Create function
       clean_unused_media_descriptions to handle the common of freeing
       unused dynamic pt.
     - Remove SDP_IPv4/SDP_IPv6, these are replaced by checking the type
       member of the address structure.
    
    Changes to MSRP part:
    
     - Move MSRP attributes to the media-level attributes.
     - Remove msrp_transport_address_set attribute, rely on the AT_NONE
       address type for detecting bad addresses.
     - Remove SDP_MSRP_IPv4 check, this never worked as the flag was never
       set. Now it relies on the address family from the host in a=path:.
    
    Tested with these capture files with no change in PDML output nor
    improvements/regressions with memleaks (as reported by ASAN):
    
        capture sip call wireshark 1.8.2.pcap
        NOringback.pcapng
        rtp_not_parsed_by_1_10_1.pcap
        rtsp_interleaved_coreplayer.cap
        SIP_CALL_RTP_G711.pcapng
        srtpincorrectlyselected.pcap
        tdnwifitontwifi_withnatting_clientAbhopati_03082015.pcapng
    
    Change-Id: Ia0dbc63f8bd78cc84dad2e18174540e31b78a80d
    Reviewed-on: https://code.wireshark.org/review/19072
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  104b9fe   rtp: add function to duplicate rtp_dyn_payload_t
    adds  1d2f68b   sdp: refactor session/media level handling of attributes


Summary of changes:
 epan/dissectors/packet-sdp.c |  808 +++++++++++++++++++++---------------------
 1 file changed, 404 insertions(+), 404 deletions(-)