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

Wireshark-dev: [Wireshark-dev] how do you get SDP dissector info to use it with a new dissector

Date: Tue, 22 Apr 2008 15:11:48 +0200
Hi everyone,
 
I've been working on a new dissector that I'll hopefully be able to contribute.
 
So far I've used the protocol preferences menu to allow me to "setup" parameters that are usually found in an SDP file or via SDP/SAP or via SDP/RTSP.
 
This can be quite tedious as I'm switching between different RTP streams, each having potentially different setup parameters.
 
Hence I would like to try and reuse the already dissected SDP parameters (if found) and use those automatically i.e.
 
If  SDP -> Media Format (sdp.media.format)  = certain value,
 
then
    Search    SDP -> Media format specific parameters (sdp.fmtp.parameter)
            If found "setup" parameter, "store" the value for that setup parameter and associate it with the associated sdp.media.format type
    End search
End SDP search
 
As I expect the SDP information to contain declarations for multiple RTP streams with different dynamic payload types, each having setup parameters for my dissector, what is the best approach I can take?
 
How do I search for any relevant SDP info?
I've tried to find relevant examples but haven't exactly succeeded and would appreciate a pointer. Wireshark seems extremely powerful but it's rather daunting to a beginner.
I came across tapping, but I'm not sure whether I need to get info from the SDP tap, or whether I need to create a tap for my dissector....or even tap at all?!
 
As for using those parameters:
 
Should I define a structure containing all the relevant setup parameters, define a table containing pointers to that structure, and populate it accordingly for each relevant stream i.e. RTP payload type in SDP having my setup parameters?
 
The idea would then be to search this table for a matching RTP payload type so that my dissector can use the correct setup parameters, extracted automatically from SDP, rather than using the potentially incorrect setup parameters defined in my preferences.
 
Thanks for your help,
 
David