On Tue, 15 Sep 1998, Gilbert Ramirez Jr. wrote:
> Yes, the best option would be to have configurable columns. Sometimes I
> want packet number, sometimes I want Time, sometimes I want Delta Time from
> previous packet, and sometimes I want all three!
>
> We could still use win_info[] arrays. The Time could be win_info[5], and
> Delta Time could be win_info[6]. The GUI could display only certain
> columns, or all columns.
I haven't finished thinking this through all the way, but how about
something like this:
- Make the number of columns variable, and specify their content
(at least internally) using printf-style specifiers. E.g., '%m'
for source MAC addresses, '%M' for destination MAC addresses, %t
for absolute time, %T for delta time, etc.
- Replace each line that currently copies data into win_info[x] with a
function (pl_printf?) that would go through each column configuration
string and replace the corresponding format specifiers with the
values passed to pl_printf. For instance, a line in packet-eth.c
might look like this:
pl_printf(MAC_DEST_ADDR, ether_to_str((guint8 *)&pd[0]);
The first argument to would be the data type identifier to match
against a particular format specifier, and the rest could be a
printf-compatible variable argument list.
This way, a user could have seventeen columns with the absolute time
stamp in every fifth column if they _really_ wanted it. Or, they could
have one very wide column filled with lots of data.
---------------------------------------------------------------------------
***** ***** Gerald Combs gerald@xxxxxxxxxx
*** *** Cryptographer and #X.(4QLX, http://www.unicom.net
* * Unicom Communications, Inc. (913)327-5309
***** 7223 W. 95th St., Ste 325 (913)327-5376 Fax
*** Overland Park, KS 66212 (913)327-5375 Client Support
*
---------------------------------------------------------------------------