Ethereal-dev: [Ethereal-dev] Filling of columns

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

From: aferen@xxxxxxxxxxxx (Andrew C. Feren)
Date: 30 Oct 2001 14:18:55 -0500
I got a request from a local user for an ethereal modification.
Making the change was pretty straight forward, but it involves some
minor changes outside of my dissector code.  This is something I would
like to avoid unless the changes can be merged back into the
mainline.  (Otherwise I have a maintenance headache on my hands.)

What I would like to do is modify what gets displayed in some columns
other than "Protocol" and "Info".  The problem is that
fill_in_columns(...) gets called after my dissector effectively
clobbering any value that I set.

I didn't see a good way to do this so what I did was as follows.

1) I called fill_in_columns(...) before setting any columns
2) I set the columns I cared about
3) I called col_set_writable(pinfo->fd, FALSE);

To make this work I modified fill_in_columns(...) such that columns
are only filled if they are writable.


Alternatively I could make "writable" a per column (rather than per
row) atrribute.  If col_set_writable(...) were modified to set the
entire row and a new function was added to change the writability of a
specific column I wouldn't need to call fill_in_columns(...).  Based
on a quick look through the source I think everything else would
continue to work as it currently does.


Is this reasonable?  Is there a better approach that I missed?


-- 
-Andrew Feren
 Cetacean Networks, Inc.
 Portsmouth, NH