Ethereal-dev: [Ethereal-dev] Media dissection

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Biot Olivier <Olivier.Biot@xxxxxxxxxxx>
Date: Tue, 13 Jan 2004 10:10:53 +0100
Hi list,

I'd like to provide as generic as possible media dissection to Ethereal.

What we have now, is a string dissector table called "media" in which we
register media types (the stuff in the Content-Type header of many
protocols). However, many media types require additional parameters in order
to be unambiguously qualified. Consider for instance the text media types
for which one needs to define the character set as this is the way the data
bytes will be mapped to glyphs that we humans can read. Or the multipart
media type which requires a boundary string to be defined as a media type
parameter in order to correctly dissect it and find the embedded parts.

When registering a media type to Ethereal, we need some conventions. I
propose the following approaches:

1. set pinfo->match_string to the (lowercase) media type without parameters
   set pinfo->private_data to the parameter list of the media type

2. set pinfo->private_data to point to a struct containing two strings,
   the media type and its optional parameters. Define this struct in a
   header file that protocol dissectors can include.

3. add media-specific fields (maybe a union) to the packet_info struct

There are probably other possibilities. My private version of the multipart
dissector currently implements solution 2, but this can easily be done
differently.

I'd like to have the opinion of the list on this :)

Regards,

Olivier