- Subject: Re: [Ethereal-users] Anyway to add a new column based on informat ion which user wants from the hex window?
- From: Guy Harris <guy@xxxxxxxxxxxx>
- Date: Thu, 6 Nov 2003 18:57:17 -0800
On Nov 6, 2003, at 2:10 AM, Jasper TAN Aik Jiunn wrote:
How do I do that?
1. Add a new COL_ name for your column to the last enum in
"epan/column_info.h", right before NUM_COL_FMTS (why it says "Should
always be last", it means it - it won't work if that's not last).
2. Add
case COL_XXX: /* currently done by dissectors */
break;
(where "COL_XXX" is the name for your column) to end of the "switch()"
statement in "fill_in_columns()" in "epan/column-utils.c".
3. Pick a letter for your new column name, and add
"%?"
where "?" is your letter, to the end of the "slist[]" list in
"col_format_to_string()" in "column.c".
4. Put a short description of your column (it will appear in the GUI)
at the end of the "dlist[]" array in "column.c".
5. Add to the case statement in "get_column_longest_string()" in
"column.c"
case COL_XXX:
return {string};
where {string} is the longest string you'd expect to have in your
column (or just pick a long string if you don't have a "longest
string".
6. Add to the case statement in 'get_column_resize_type()" in "column.c"
case COL_XXX:
in the appropriate place, depending on whether you would want your
column to dynamically change its size if you're doing an "Update list
of packets in real time" capture.
7. Add to "get_column_format_from_str()" in "column.c"
case '?':
return COL_XXX;
break;
where '?' is the letter from step 3 above.