Wireshark-dev: Re: [Wireshark-dev] Call XML and JSON dissectors with new HTTP Content-Type
From: Juan Jose Martin Carrascosa <juanjo@xxxxxxx>
Date: Thu, 17 Dec 2015 15:15:29 +0100
It seems the strings are official and won't change in the specification.


If anyone has a couple of minutes... ;)

Thanks!
Juanjo Martin

On Thu, Dec 17, 2015 at 1:56 PM, Juan Jose Martin Carrascosa <juanjo@xxxxxxx> wrote:
Super nice! Thanks Alexis and Pascal for the prompt replies. It works.

I will commit my changes once they are final in the OMG.

Thanks,
Juanjo Martin

On Thu, Dec 17, 2015 at 1:51 PM, Alexis La Goutte <alexis.lagoutte@xxxxxxxxx> wrote:
Hi,

I will response the same reponse like Pascal
for json if there is a application/dds-web+json, you need to add

dissector_add_string("media_type", "application/dds-web+json", json_handle);
on proto_reg_handoff_json() function from packet-json.c

Cheers

On Thu, Dec 17, 2015 at 1:48 PM, Pascal Quantin <pascal.quantin@xxxxxxxxx> wrote:
Hi Juan,

2015-12-17 13:40 GMT+01:00 Juan Jose Martin Carrascosa <juanjo@xxxxxxx>:
Hi all,

Web Integration Service (http://www.omg.org/spec/DDS-WEB/1.0/Beta2/) is a new service that sends/receives DDS traffic (RTPS) over HTTP. The serialization is not directly RTPS but a conversion handled internally, that can be XML or JSON.

I would like to add support to show the content of the HTTP packets as it is done for XML. The Content-Type is "application/dds-web+xml". If I change it to "application/xml" internally, it works sweet.

How can I make Wireshark apply the XML dissector when receiving "application/dds-web+xml"? I have been inspecting the code but I want some advice since this is an important dissector.

You probably simply need to add an entry in the default_media_types[] array found at the beginning of epan/dissectors/packet-xml.c file.
 

I will implement this for myself, and once it is stable and I make sure it doesn't change, I will push the changes to the community.

Also, knowing how to implement the equivalent for JSON would be awesome.
 
Does it have a specific Content-Type, like "application/dds-web+json"? If yes, you simply need to add it in proto_reg_handoff_json() function.

Pascal.

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe


___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe



--

Juanjo Martin
Applications Engineer
Professional Services Group



--

Juanjo Martin
Applications Engineer
Professional Services Group
Office: +34 958 27 88 62
Mobile: +34 622 73 29 03