/* column.c
* Routines for handling column preferences
*
- * $Id: column.c,v 1.46 2004/01/31 04:10:04 guy Exp $
+ * $Id: column.c,v 1.47 2004/03/18 19:04:30 obiot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
return "0000000";
break;
case COL_CLS_TIME:
- if (timestamp_type == TS_ABSOLUTE)
+ if (get_timestamp_setting() == TS_ABSOLUTE)
return "00:00:00.000000";
- else if (timestamp_type == TS_ABSOLUTE_WITH_DATE)
+ else if (get_timestamp_setting() == TS_ABSOLUTE_WITH_DATE)
return "0000-00-00 00:00:00.000000";
else
return "0000.000000";
/* dftest.c.c
*
- * $Id: dftest.c,v 1.8 2004/02/21 22:00:46 guy Exp $
+ * $Id: dftest.c,v 1.9 2004/03/18 19:04:31 obiot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include "register.h"
packet_info pi;
-ts_type timestamp_type = TS_RELATIVE;
int
main(int argc, char **argv)
e_prefs *prefs;
dfilter_t *df;
+ set_timestamp_setting(TS_RELATIVE);
+
/* register all dissectors; we must do this before checking for the
"-g" flag, as the "-g" flag dumps a list of fields registered
by the dissectors, and we must do it before we read the preferences,
# Automake file for the EPAN library
# (Ethereal Protocol ANalyzer Library)
#
-# $Id: Makefile.am,v 1.41 2004/03/17 17:46:40 jmayer Exp $
+# $Id: Makefile.am,v 1.42 2004/03/18 19:04:31 obiot Exp $
#
# Ethereal - Network traffic analyzer
# By Gerald Combs <gerald@ethereal.com>
sna-utils.h \
strutil.c \
strutil.h \
+ timestamp.c \
timestamp.h \
to_str.c \
to_str.h \
## Makefile for building ethereal.exe with Microsoft C and nmake
## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
#
-# $Id: Makefile.nmake,v 1.36 2004/03/06 03:25:10 guy Exp $
+# $Id: Makefile.nmake,v 1.37 2004/03/18 19:04:31 obiot Exp $
include ..\config.nmake
resolv.obj \
sna-utils.obj \
strutil.obj \
+ timestamp.obj \
to_str.obj \
tvbuff.obj \
value_string.obj
/* column-utils.c
* Routines for column utilities.
*
- * $Id: column-utils.c,v 1.46 2004/02/29 08:47:11 guy Exp $
+ * $Id: column-utils.c,v 1.47 2004/03/18 19:04:32 obiot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
void
col_set_cls_time(frame_data *fd, column_info *cinfo, int col)
{
- switch (timestamp_type) {
+ switch (get_timestamp_setting()) {
case TS_ABSOLUTE:
col_set_abs_time(fd, cinfo, col);
break;
/* timestamp.h
* Defines for packet timestamps
*
- * $Id: timestamp.h,v 1.4 2004/01/19 23:03:19 guy Exp $
+ * $Id: timestamp.h,v 1.5 2004/03/18 19:04:32 obiot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
*/
#define TS_NOT_SET ((ts_type)-1)
-extern ts_type timestamp_type;
+extern ts_type get_timestamp_setting(void);
+extern void set_timestamp_setting(ts_type);
#endif /* timestamp.h */
/* globals.h
* Global defines, etc.
*
- * $Id: globals.h,v 1.32 2003/11/01 02:30:14 guy Exp $
+ * $Id: globals.h,v 1.33 2004/03/18 19:04:31 obiot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
extern gboolean auto_scroll_live;
#endif
-extern ts_type timestamp_type;
-
#endif
/* main.c
*
- * $Id: main.c,v 1.416 2004/03/17 08:59:28 guy Exp $
+ * $Id: main.c,v 1.417 2004/03/18 19:04:32 obiot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include "packet_list.h"
#include "recent.h"
#include "follow_dlg.h"
+#include <epan/timestamp.h>
#ifdef WIN32
#include "capture-wpcap.h"
gchar *last_open_dir = NULL;
static gboolean updated_last_open_dir = FALSE;
-/* init with an invalid value, so that "recent" can detect this and */
-/* distinguish it from a command line value */
-ts_type timestamp_type = TS_NOT_SET;
-
#if GTK_MAJOR_VERSION < 2
GtkStyle *item_style;
#endif
break;
case 't': /* Time stamp type */
if (strcmp(optarg, "r") == 0)
- timestamp_type = TS_RELATIVE;
+ set_timestamp_setting(TS_RELATIVE);
else if (strcmp(optarg, "a") == 0)
- timestamp_type = TS_ABSOLUTE;
+ set_timestamp_setting(TS_ABSOLUTE);
else if (strcmp(optarg, "ad") == 0)
- timestamp_type = TS_ABSOLUTE_WITH_DATE;
+ set_timestamp_setting(TS_ABSOLUTE_WITH_DATE);
else if (strcmp(optarg, "d") == 0)
- timestamp_type = TS_DELTA;
+ set_timestamp_setting(TS_DELTA);
else {
fprintf(stderr, "ethereal: Invalid time stamp type \"%s\"\n",
optarg);
/* menu.c
* Menu routines
*
- * $Id: menu.c,v 1.177 2004/03/13 17:50:23 ulfl Exp $
+ * $Id: menu.c,v 1.178 2004/03/18 19:04:33 obiot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include "../ui_util.h"
#include "proto_draw.h"
#include "simple_dialog.h"
+#include <epan/timestamp.h>
GtkWidget *popup_menu_object;
timestamp_absolute_cb(GtkWidget *w _U_, gpointer d _U_)
{
if (recent.gui_time_format != TS_ABSOLUTE) {
- timestamp_type = TS_ABSOLUTE;
- recent.gui_time_format = timestamp_type;
+ set_timestamp_setting(TS_ABSOLUTE);
+ recent.gui_time_format = TS_ABSOLUTE;
change_time_formats(&cfile);
}
}
timestamp_absolute_date_cb(GtkWidget *w _U_, gpointer d _U_)
{
if (recent.gui_time_format != TS_ABSOLUTE_WITH_DATE) {
- timestamp_type = TS_ABSOLUTE_WITH_DATE;
- recent.gui_time_format = timestamp_type;
+ set_timestamp_setting(TS_ABSOLUTE_WITH_DATE);
+ recent.gui_time_format = TS_ABSOLUTE_WITH_DATE;
change_time_formats(&cfile);
}
}
timestamp_relative_cb(GtkWidget *w _U_, gpointer d _U_)
{
if (recent.gui_time_format != TS_RELATIVE) {
- timestamp_type = TS_RELATIVE;
- recent.gui_time_format = timestamp_type;
+ set_timestamp_setting(TS_RELATIVE);
+ recent.gui_time_format = TS_RELATIVE;
change_time_formats(&cfile);
}
}
timestamp_delta_cb(GtkWidget *w _U_, gpointer d _U_)
{
if (recent.gui_time_format != TS_DELTA) {
- timestamp_type = TS_DELTA;
- recent.gui_time_format = timestamp_type;
+ set_timestamp_setting(TS_DELTA);
+ recent.gui_time_format = TS_DELTA;
change_time_formats(&cfile);
}
}
main_widgets_rearrange();
/* don't change the time format, if we had a command line value */
- if (timestamp_type != TS_NOT_SET) {
- recent.gui_time_format = timestamp_type;
+ if (get_timestamp_setting() != TS_NOT_SET) {
+ recent.gui_time_format = get_timestamp_setting();
}
switch(recent.gui_time_format) {
/* packet_list.c
* packet list related functions 2002 Olivier Abad
*
- * $Id: packet_list.c,v 1.18 2004/02/06 19:19:10 ulfl Exp $
+ * $Id: packet_list.c,v 1.19 2004/03/18 19:04:33 obiot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include "file_dlg.h"
#include "packet_list.h"
#include "keys.h"
+#include <epan/timestamp.h>
#include "image/clist_ascend.xpm"
#include "image/clist_descend.xpm"
return COMPARE_FRAME_NUM();
case COL_CLS_TIME:
- switch (timestamp_type) {
+ switch (get_timestamp_setting()) {
case TS_ABSOLUTE:
case TS_ABSOLUTE_WITH_DATE:
/* tethereal.c
*
- * $Id: tethereal.c,v 1.231 2004/02/23 16:12:51 gerald Exp $
+ * $Id: tethereal.c,v 1.232 2004/03/18 19:04:31 obiot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
#include <epan/epan_dissect.h>
#include "tap.h"
#include "report_err.h"
+#include <epan/timestamp.h>
#ifdef HAVE_LIBPCAP
#include <wiretap/wtap-capture.h>
#endif
capture_file cfile;
-ts_type timestamp_type = TS_RELATIVE;
#ifdef HAVE_LIBPCAP
typedef struct {
int snaplen; /* Maximum captured packet length */
char badopt;
ethereal_tap_list *tli;
+ set_timestamp_setting(TS_RELATIVE);
+
/* Register all dissectors; we must do this before checking for the
"-G" flag, as the "-G" flag dumps information registered by the
dissectors, and we must do it before we read the preferences, in
break;
case 't': /* Time stamp type */
if (strcmp(optarg, "r") == 0)
- timestamp_type = TS_RELATIVE;
+ set_timestamp_setting(TS_RELATIVE);
else if (strcmp(optarg, "a") == 0)
- timestamp_type = TS_ABSOLUTE;
+ set_timestamp_setting(TS_ABSOLUTE);
else if (strcmp(optarg, "ad") == 0)
- timestamp_type = TS_ABSOLUTE_WITH_DATE;
+ set_timestamp_setting(TS_ABSOLUTE_WITH_DATE);
else if (strcmp(optarg, "d") == 0)
- timestamp_type = TS_DELTA;
+ set_timestamp_setting(TS_DELTA);
else {
fprintf(stderr, "tethereal: Invalid time stamp type \"%s\"\n",
optarg);