/* column.c
* Routines for handling column preferences
*
- * $Id: column.c,v 1.28 2000/08/11 13:34:48 deniel Exp $
+ * $Id: column.c,v 1.29 2000/11/01 08:31:33 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
string */
gchar *
col_format_to_string(gint fmt) {
- gchar *slist[] = { "%m", "%t", "%Rt", "%At", "%Tt", "%s", "%rs", "%us",
- "%hs", "%rhs", "%uhs", "%ns", "%rns", "%uns", "%d",
+ gchar *slist[] = { "%m", "%t", "%Rt", "%At", "%Yt", "%Tt", "%s", "%rs",
+ "%us","%hs", "%rhs", "%uhs", "%ns", "%rns", "%uns", "%d",
"%rd", "%ud", "%hd", "%rhd", "%uhd", "%nd", "%rnd",
"%und", "%S", "%rS", "%uS", "%D", "%rD", "%uD", "%p",
"%i", "%L" };
gchar *
col_format_desc(gint fmt) {
gchar *dlist[] = { "Number", "Time (command line specified)",
- "Relative time", "Absolute time", "Delta time",
+ "Relative time", "Absolute time",
+ "Absolute date and time", "Delta time",
"Source address", "Src addr (resolved)",
"Src addr (unresolved)", "Hardware src addr",
"Hw src addr (resolved)", "Hw src addr (unresolved)",
case COL_CLS_TIME:
if (timestamp_type == ABSOLUTE)
return "00:00:00.000000";
+ else if (timestamp_type == ABSOLUTE_WITH_DATE)
+ return "0000-00-00 00:00:00.000000";
else
return "0000.000000";
break;
case COL_ABS_TIME:
return "00:00:00.000000";
break;
+ case COL_ABS_DATE_TIME:
+ return "0000-00-00 00:00:00.000000";
+ break;
case COL_REL_TIME:
case COL_DELTA_TIME:
return "0000.000000";
case COL_NUMBER:
case COL_CLS_TIME:
case COL_ABS_TIME:
+ case COL_ABS_DATE_TIME:
case COL_REL_TIME:
case COL_DELTA_TIME:
case COL_DEF_SRC_PORT:
}
}
-#define TIME_DEF 0
-#define TIME_REL 1
-#define TIME_ABS 2
-#define TIME_DEL 3
+#define TIME_DEF 0
+#define TIME_REL 1
+#define TIME_ABS 2
+#define DATE_TIME_ABS 3
+#define TIME_DEL 4
#define RES_DEF 0
#define RES_DO 1
case 'A':
time_off = TIME_ABS;
break;
+ case 'Y':
+ time_off = DATE_TIME_ABS;
+ break;
case 'T':
time_off = TIME_DEL;
break;
=item -t
Sets the format of the packet timestamp displayed in the packet list
-window. The format can be one of 'r' (relative), 'a' (absolute), or 'd'
-(delta). The relative time is the time elapsed between the first packet
-and the current packet. The absolute time is the actual date and time the
-packet was captured. The delta time is the time since the previous packet
-was captured. The default is relative.
+window. The format can be one of 'r' (relative), 'a' (absolute), 'ad'
+(absolute with date), or 'd' (delta). The relative time is the time
+elapsed between the first packet and the current packet. The absolute
+time is the actual time the packet was captured, with no date displayed;
+the absolute date and time is the actual time and date the packet was
+captured. The delta time is the time since the previous packet was
+captured. The default is relative.
=item -v
=item Display:Options
Allows you to sets the format of the packet timestamp displayed in the
-packet list window to relative, absolute, or delta, to enable or disable
-the automatic scrolling of the packet list while a live capture is in
-progress or to enable or disable translation of addresses to names in the
-display.
+packet list window to relative, absolute, absolute date and time, or
+delta, to enable or disable the automatic scrolling of the packet list
+while a live capture is in progress or to enable or disable translation
+of addresses to names in the display.
=item Display:Match Selected
=item Display Options
-The I<Display Options> dialog lets you specify the format of the time stamp
-in the packet list. You can select "Time of day" for absolute time stamps,
-"Seconds since beginning of capture" for relative time stamps, or
+The I<Display Options> dialog lets you specify the format of the time
+stamp in the packet list. You can select "Time of day" for absolute
+time stamps, "Date and time of day" for absolute time stamps with the
+date, "Seconds since beginning of capture" for relative time stamps, or
"Seconds since previous frame" for delta time stamps. You can also
specify whether, when the display is updated as packets are captured,
the list should automatically scroll to show the most recently captured
-packets or not and whether addresses should be translated to names in the
-display.
+packets or not and whether addresses should be translated to names in
+the display.
=item Plugins
=item -t
-Sets the format of the packet timestamp printed in summary lines.
-The format can be one of 'r' (relative), 'a' (absolute), or 'd'
-(delta). The relative time is the time elapsed between the first packet
-and the current packet. The absolute time is the actual date and time the
-packet was captured. The delta time is the time since the previous packet
-was captured. The default is relative.
+Sets the format of the packet timestamp printed in summary lines. The
+format can be one of 'r' (relative), 'a' (absolute), 'ad' (absolute with
+date), or 'd' (delta). The relative time is the time elapsed between
+the first packet and the current packet. The absolute time is the
+actual time the packet was captured, with no date displayed; the
+absolute date and time is the actual time and date the packet was
+captured. The delta time is the time since the previous packet was
+captured. The default is relative.
=item -v
/* packet.c
* Routines for packet disassembly
*
- * $Id: packet.c,v 1.2 2000/10/06 10:11:15 gram Exp $
+ * $Id: packet.c,v 1.3 2000/11/01 08:31:35 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
(long)fd->abs_usecs/100);
}
+static void
+col_set_abs_date_time(frame_data *fd, int col)
+{
+ struct tm *tmp;
+ time_t then;
+
+ then = fd->abs_secs;
+ tmp = localtime(&then);
+ snprintf(fd->cinfo->col_data[col], COL_MAX_LEN,
+ "%04d-%02d-%02d %02d:%02d:%02d.%04ld",
+ tmp->tm_year + 1900,
+ tmp->tm_mon + 1,
+ tmp->tm_mday,
+ tmp->tm_hour,
+ tmp->tm_min,
+ tmp->tm_sec,
+ (long)fd->abs_usecs/100);
+}
+
static void
col_set_rel_time(frame_data *fd, int col)
{
col_set_abs_time(fd, col);
break;
+ case ABSOLUTE_WITH_DATE:
+ col_set_abs_date_time(fd, col);
+ break;
+
case RELATIVE:
col_set_rel_time(fd, col);
break;
col_set_abs_time(fd, i);
break;
+ case COL_ABS_DATE_TIME:
+ col_set_abs_date_time(fd, i);
+ break;
+
case COL_REL_TIME:
col_set_rel_time(fd, i);
break;
/* packet.h
* Definitions for packet disassembly structures and routines
*
- * $Id: packet.h,v 1.2 2000/10/06 10:11:17 gram Exp $
+ * $Id: packet.h,v 1.3 2000/11/01 08:31:35 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
COL_CLS_TIME, /* Command line-specified time (default relative) */
COL_REL_TIME, /* Relative time */
COL_ABS_TIME, /* Absolute time */
+ COL_ABS_DATE_TIME, /* Absolute date and time */
COL_DELTA_TIME, /* Delta time */
COL_DEF_SRC, /* Source address */
COL_RES_SRC, /* Resolved source */
/* display_opts.c
* Routines for packet display windows
*
- * $Id: display_opts.c,v 1.17 2000/10/19 22:59:24 guy Exp $
+ * $Id: display_opts.c,v 1.18 2000/11/01 08:31:35 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
/* Display callback data keys */
#define E_DISPLAY_TIME_ABS_KEY "display_time_abs"
+#define E_DISPLAY_DATE_TIME_ABS_KEY "display_date_time_abs"
#define E_DISPLAY_TIME_REL_KEY "display_time_rel"
#define E_DISPLAY_TIME_DELTA_KEY "display_time_delta"
#define E_DISPLAY_AUTO_SCROLL_KEY "display_auto_scroll"
gtk_widget_show(button);
+ button = dlg_radio_button_new_with_label_with_mnemonic(
+ gtk_radio_button_group(GTK_RADIO_BUTTON(button)),
+ "_Date and time of day", accel_group);
+ gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(button),
+ (timestamp_type == ABSOLUTE_WITH_DATE));
+ gtk_object_set_data(GTK_OBJECT(display_opt_w), E_DISPLAY_DATE_TIME_ABS_KEY,
+ button);
+ gtk_box_pack_start(GTK_BOX(main_vb), button, TRUE, TRUE, 0);
+ gtk_widget_show(button);
+
button = dlg_radio_button_new_with_label_with_mnemonic(
gtk_radio_button_group(GTK_RADIO_BUTTON(button)),
"Seconds since _beginning of capture", accel_group);
if (GTK_TOGGLE_BUTTON (button)->active)
timestamp_type = ABSOLUTE;
+ button = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(parent_w),
+ E_DISPLAY_DATE_TIME_ABS_KEY);
+ if (GTK_TOGGLE_BUTTON (button)->active)
+ timestamp_type = ABSOLUTE_WITH_DATE;
+
button = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(parent_w),
E_DISPLAY_TIME_REL_KEY);
if (GTK_TOGGLE_BUTTON (button)->active)
/* main.c
*
- * $Id: main.c,v 1.162 2000/10/27 17:19:23 gram Exp $
+ * $Id: main.c,v 1.163 2000/11/01 08:31:36 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
timestamp_type = RELATIVE;
else if (strcmp(optarg, "a") == 0)
timestamp_type = ABSOLUTE;
+ else if (strcmp(optarg, "ad") == 0)
+ timestamp_type = ABSOLUTE_WITH_DATE;
else if (strcmp(optarg, "d") == 0)
timestamp_type = DELTA;
else {
fprintf(stderr, "ethereal: Invalid time stamp type \"%s\"\n",
optarg);
fprintf(stderr, "It must be \"r\" for relative, \"a\" for absolute,\n");
- fprintf(stderr, "or \"d\" for delta.\n");
+ fprintf(stderr, "\"ad\" for absolute with date, or \"d\" for delta.\n");
exit(1);
}
break;
/* tethereal.c
*
- * $Id: tethereal.c,v 1.53 2000/11/01 07:38:54 guy Exp $
+ * $Id: tethereal.c,v 1.54 2000/11/01 08:31:33 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
timestamp_type = RELATIVE;
else if (strcmp(optarg, "a") == 0)
timestamp_type = ABSOLUTE;
+ else if (strcmp(optarg, "ad") == 0)
+ timestamp_type = ABSOLUTE_WITH_DATE;
else if (strcmp(optarg, "d") == 0)
timestamp_type = DELTA;
else {
fprintf(stderr, "tethereal: Invalid time stamp type \"%s\"\n",
optarg);
fprintf(stderr, "It must be \"r\" for relative, \"a\" for absolute,\n");
- fprintf(stderr, "or \"d\" for delta.\n");
+ fprintf(stderr, "\"ad\" for absolute with date, or \"d\" for delta.\n");
exit(1);
}
break;
/* timestamp.h
* Defines for packet timestamps
*
- * $Id: timestamp.h,v 1.2 1999/07/13 02:52:59 gram Exp $
+ * $Id: timestamp.h,v 1.3 2000/11/01 08:31:33 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
typedef enum {
RELATIVE,
ABSOLUTE,
+ ABSOLUTE_WITH_DATE,
DELTA
} ts_type;