On Fri, Jul 19, 2002 at 05:39:11PM +0200, Fabien Salvi wrote:
> But, I would like to export the contents to a file which support colors,
> html seems to be the best choice.
>
> I have a look at source code and I've seen that when you "follow tcp
> stream", a temporary file is created (/tmp/followXXXX...).
>
> This file contains ascii data (if the stream is readable) plus binary
> data.
>
> I wonder if there is a way to transform it or reuse it to transform the
> contents in html or something like that.
It's a temporary file, and its internal format may differ from Ethereal
release to Ethereal release, so there's no supported way of doing
anything with that file except from inside Ethereal.
> Maybe the best choice is to write a little perl script for transform the
> contents of packets in html format with color.
If you want to do that, you're on your own - you'd have to read the code
to determine the file format, and update the Perl script if the format
changes.
Another possibility might be to support, within Ethereal, saving it as
HTML rather than text. You'd add an "option menu" to the "Save TCP
Follow Stream As" dialog box, to select either "Text" or "HTML" and,
based on the setting of that option, just dump the stuff as text, or
dump it as HTML.
(Note, of course, that the text from the stream might *itself* be HTML,
and you wouldn't want tags in the text to confuse an HTML parser, so
you'd have to convert "<" and ">" to "<" and "&rt;", and convert "&"
to "&".)