aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorStephen Fisher <steve@stephen-fisher.com>2007-03-23 18:08:17 +0000
committerStephen Fisher <steve@stephen-fisher.com>2007-03-23 18:08:17 +0000
commit6d8d2854c8cf998605e041987610986d09375c6a (patch)
tree49c7db39b4c44d02429daa16149f2ba63678af4e /gtk
parent62f88a4a04d8e300ff108f6164e9016e8cdcc9c3 (diff)
From Sake Blok:
Fix for bug #491: Unexpected frame.time_delta behavior This patch ... fixes bug 491. It does this by changing the behaviour of the frame.time_delta field so it reflects the delta time between captured packets (tshark already did this). To keep the delta time between displayed packets, the field frame.time_delta_displayed is created. svn path=/trunk/; revision=21154
Diffstat (limited to 'gtk')
-rw-r--r--gtk/main.c4
-rw-r--r--gtk/menu.c23
-rw-r--r--gtk/packet_list.c10
3 files changed, 32 insertions, 5 deletions
diff --git a/gtk/main.c b/gtk/main.c
index 028a5b619e..f931e6a9a5 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -1263,7 +1263,7 @@ print_usage(gboolean print_ver) {
fprintf(output, "User interface:\n");
fprintf(output, " -g <packet number> go to specified packet number after \"-r\"\n");
fprintf(output, " -m <font> set the font name used for most text\n");
- fprintf(output, " -t ad|a|r|d|e output format of time stamps (def: r: rel. to first)\n");
+ fprintf(output, " -t ad|a|r|d|dd|e output format of time stamps (def: r: rel. to first)\n");
fprintf(output, " -X <key>:<value> eXtension options, see man page for details\n");
fprintf(output, " -z <statistics> show various statistics, see man page for details\n");
@@ -2669,6 +2669,8 @@ main(int argc, char *argv[])
timestamp_set_type(TS_ABSOLUTE_WITH_DATE);
else if (strcmp(optarg, "d") == 0)
timestamp_set_type(TS_DELTA);
+ else if (strcmp(optarg, "dd") == 0)
+ timestamp_set_type(TS_DELTA_DIS);
else if (strcmp(optarg, "e") == 0)
timestamp_set_type(TS_EPOCH);
else {
diff --git a/gtk/menu.c b/gtk/menu.c
index b8c5ee1241..0cbf1075f4 100644
--- a/gtk/menu.c
+++ b/gtk/menu.c
@@ -126,6 +126,7 @@ static void timestamp_absolute_cb(GtkWidget *w _U_, gpointer d _U_);
static void timestamp_absolute_date_cb(GtkWidget *w _U_, gpointer d _U_);
static void timestamp_relative_cb(GtkWidget *w _U_, gpointer d _U_);
static void timestamp_delta_cb(GtkWidget *w _U_, gpointer d _U_);
+static void timestamp_delta_dis_cb(GtkWidget *w _U_, gpointer d _U_);
static void timestamp_epoch_cb(GtkWidget *w _U_, gpointer d _U_);
static void timestamp_auto_cb(GtkWidget *w _U_, gpointer d _U_);
static void timestamp_sec_cb(GtkWidget *w _U_, gpointer d _U_);
@@ -487,7 +488,9 @@ static GtkItemFactoryEntry menu_items[] =
0, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL),
ITEM_FACTORY_ENTRY("/View/Time Display Format/Seconds Since Beginning of Capture: 123.123456", NULL, timestamp_relative_cb,
0, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL),
- ITEM_FACTORY_ENTRY("/View/Time Display Format/Seconds Since Previous Packet: 1.123456", NULL, timestamp_delta_cb,
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/Seconds Since Previous Captured Packet: 1.123456", NULL, timestamp_delta_cb,
+ 0, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL),
+ ITEM_FACTORY_ENTRY("/View/Time Display Format/Seconds Since Previous Displayed Packet: 1.123456", NULL, timestamp_delta_dis_cb,
0, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL),
ITEM_FACTORY_ENTRY("/View/Time Display Format/Seconds Since Epoch (1970-01-01): 1234567890.123456", NULL, timestamp_epoch_cb,
0, "/View/Time Display Format/Date and Time of Day: 1970-01-01 01:02:03.123456", NULL),
@@ -1689,6 +1692,16 @@ timestamp_delta_cb(GtkWidget *w _U_, gpointer d _U_)
}
static void
+timestamp_delta_dis_cb(GtkWidget *w _U_, gpointer d _U_)
+{
+ if (recent.gui_time_format != TS_DELTA_DIS) {
+ timestamp_set_type(TS_DELTA_DIS);
+ recent.gui_time_format = TS_DELTA_DIS;
+ cf_change_time_formats(&cfile);
+ }
+}
+
+static void
timestamp_epoch_cb(GtkWidget *w _U_, gpointer d _U_)
{
if (recent.gui_time_format != TS_EPOCH) {
@@ -1942,7 +1955,13 @@ menu_recent_read_finished(void) {
break;
case(TS_DELTA):
menu = gtk_item_factory_get_widget(main_menu_factory,
- "/View/Time Display Format/Seconds Since Previous Packet: 1.123456");
+ "/View/Time Display Format/Seconds Since Previous Captured Packet: 1.123456");
+ recent.gui_time_format = -1;
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
+ break;
+ case(TS_DELTA_DIS):
+ menu = gtk_item_factory_get_widget(main_menu_factory,
+ "/View/Time Display Format/Seconds Since Previous Displayed Packet: 1.123456");
recent.gui_time_format = -1;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menu), TRUE);
break;
diff --git a/gtk/packet_list.c b/gtk/packet_list.c
index 7a1b5c9ec7..8ee1ad8996 100644
--- a/gtk/packet_list.c
+++ b/gtk/packet_list.c
@@ -170,7 +170,10 @@ packet_list_compare(EthCList *clist, gconstpointer ptr1, gconstpointer ptr2)
return COMPARE_TS(rel_ts);
case TS_DELTA:
- return COMPARE_TS(del_ts);
+ return COMPARE_TS(del_cap_ts);
+
+ case TS_DELTA_DIS:
+ return COMPARE_TS(del_dis_ts);
case TS_NOT_SET:
return 0;
@@ -185,7 +188,10 @@ packet_list_compare(EthCList *clist, gconstpointer ptr1, gconstpointer ptr2)
return COMPARE_TS(rel_ts);
case COL_DELTA_TIME:
- return COMPARE_TS(del_ts);
+ return COMPARE_TS(del_cap_ts);
+
+ case COL_DELTA_TIME_DIS:
+ return COMPARE_TS(del_dis_ts);
case COL_PACKET_LENGTH:
return COMPARE_NUM(pkt_len);