Ethereal-dev: Re: [Ethereal-dev] Media dissection

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Tue, 13 Jan 2004 15:24:46 -0800

On Jan 13, 2004, at 1:10 AM, Biot Olivier wrote:

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.

Which, of course, requires that Ethereal be capable of doing that, which it really isn't now (it can handle 8-bit character sets that match the character set of the current font, for GTK+ 1.2[.x], and UTF-8, for GTK+ 1.3[.x] and 2.x, and it can handle the ASCII subset of 16-bit Unicode, but that's about it) - but that's another matter. (It needs to be able to handle UTF-8, and 16-bit Unicode, and various ISO 8859/x character sets, and probably various EUC character sets and Shift-JIS and KOI-8, and various Windows code pages, and various Mac character sets, and various flavors of EBCDIC, and....)

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

I'd vote for that one, unless there's some reason why it's not easy to set "pinfo->match_string"; we already set pinfo->match_string in "dissector_try_string()", so that'd make the dissectors, such as the HTTP dissector, that use "dissector_get_string_handle()" act the same way dissectors that use "dissector_try_string()" work, letting dissectors called through that table rely on "pinfo->match_string" being set.