diff options
author | Guy Harris <guy@alum.mit.edu> | 1999-06-19 01:14:51 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 1999-06-19 01:14:51 +0000 |
commit | 88e94a01867460d7c9bb9fd124daf0e0ee118e7f (patch) | |
tree | 6244acb9dd3df334b8eb9e094912181a00de33e4 /packet.c | |
parent | 6a971ea03c4d73bcf28ade8d63cd6879e662dfeb (diff) |
Added "Capture" and "Display" menus; "Capture" has a "Start" item, which
is the same as "Tools/Capture", and "Display" has an "Options" item,
which pops up a dialog box to let you change the "default" time-stamp
column display format on the fly (the "default" is what the "-t"
command-line option sets), and have the display change when you do that.
Made infrastructure changes to make the immediate display update work.
Removed some unused functions, declared some functions used only in the
file in which they're defined "static", and removed some unnecessary
#includes.
svn path=/trunk/; revision=317
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 28 |
1 files changed, 25 insertions, 3 deletions
@@ -1,7 +1,7 @@ /* packet.c * Routines for packet disassembly * - * $Id: packet.c,v 1.26 1999/06/12 04:21:08 guy Exp $ + * $Id: packet.c,v 1.27 1999/06/19 01:14:51 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -50,6 +50,7 @@ #include "packet.h" #include "file.h" +#include "timestamp.h" extern capture_file cf; @@ -546,15 +547,36 @@ dissect_packet(const u_char *pd, frame_data *fd, proto_tree *tree) time_t then; /* Put in frame header information. */ + if (check_col(fd, COL_CLS_TIME)) { + switch (timestamp_type) { + case ABSOLUTE: + then = fd->abs_secs; + tmp = localtime(&then); + col_add_fstr(fd, COL_CLS_TIME, "%02d:%02d:%02d.%04ld", + tmp->tm_hour, + tmp->tm_min, + tmp->tm_sec, + (long)fd->abs_usecs/100); + break; + + case RELATIVE: + col_add_fstr(fd, COL_CLS_TIME, "%d.%06d", fd->rel_secs, fd->rel_usecs); + break; + + case DELTA: + col_add_fstr(fd, COL_CLS_TIME, "%d.%06d", fd->del_secs, fd->del_usecs); + break; + } + } if (check_col(fd, COL_ABS_TIME)) { then = fd->abs_secs; tmp = localtime(&then); col_add_fstr(fd, COL_ABS_TIME, "%02d:%02d:%02d.%04ld", tmp->tm_hour, - tmp->tm_min, + tmp->tm_min, tmp->tm_sec, (long)fd->abs_usecs/100); - } + } if (check_col(fd, COL_REL_TIME)) { col_add_fstr(fd, COL_REL_TIME, "%d.%06d", fd->rel_secs, fd->rel_usecs); } |