This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How to use the existing h264 dissector as a subdissector for a custom one

0

Hi there,

I stuck at a point where I could do with some help of the experts :-) I'm currently writing a dissector for a proprietary protocol which includes h264 data as payload. The dissector for the proprietary protocol elements is working and now I would like to pass the payload to the h264 dissector which is part of wireshark.

Could someone give me a hint on how to manage this?

Thank you!

asked 30 Apr '14, 09:03

AndyHe's gravatar image

AndyHe
11113
accept rate: 0%


One Answer:

1

Hi,

the H.264 dissector can be retrieved thanks to the "h264" string. In your proto_reg_handoff() function, add the following code:

h264_handle = find_dissector("h264");

where h264_handle is defined as:

dissector_handle_t h264_handle;

Then in your code, call the H.264 dissector like this:

call_dissector(h264_handle, h264_tvb, pinfo, tree);

where h264_tvb is a tvb containing your H.264 payload.

answered 01 May '14, 09:48

Pascal%20Quantin's gravatar image

Pascal Quantin
5.5k1060
accept rate: 30%

Pascal,

thousand thanks for your very helpful answer. Your code works fine and it saved my a lot of time!

(02 May '14, 02:29) AndyHe

If an answer has solved your issue, please accept the answer for the benefit of other users by clicking the checkmark icon next to the answer. Please read the FAQ for more information.

(02 May '14, 03:06) grahamb ♦