summaryrefslogtreecommitdiff
path: root/epan/time_fmt.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-02-27 19:01:27 +0000
committerGuy Harris <guy@alum.mit.edu>2010-02-27 19:01:27 +0000
commit500eb99cd9ae9503344998b811e4856a2bb6bfb2 (patch)
treef1ed4387361e37904198aac2f5e80833d74011b0 /epan/time_fmt.h
parent9dd11bb90eb4bca3f03f0f547da9be901a56f996 (diff)
downloadwireshark-500eb99cd9ae9503344998b811e4856a2bb6bfb2.tar.gz
Add a third date format, ABSOLUTE_TIME_DOY_UTC, to show UTC with the
date as YYYY/DDD, where DDD is a 1-origin day of year. Move the formats to a "time_fmt.h" file, included by the headers that use it. Have abs_time_to_str() and abs_time_secs_to_str() take the date format value, rather than a Boolean "show this as UTC" flag, as an argument. Document the ABSOLUTE_TIME_ formats a bit better. Use that format in the CCSDS and VCDU dissectors, rather than having those dissectors do the formatting themselves. svn path=/trunk/; revision=32034
Diffstat (limited to 'epan/time_fmt.h')
-rw-r--r--epan/time_fmt.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/epan/time_fmt.h b/epan/time_fmt.h
new file mode 100644
index 0000000000..a7b1d57d09
--- /dev/null
+++ b/epan/time_fmt.h
@@ -0,0 +1,49 @@
+/* time_fmt.h
+ * Definitions for various time display formats.
+ *
+ * $Id: to_str.h 31967 2010-02-23 19:28:38Z etxrab $
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __TIME_FMT_H__
+#define __TIME_FMT_H__
+
+/*
+ * Resolution of a time stamp.
+ */
+typedef enum {
+ TO_STR_TIME_RES_T_SECS, /* seconds */
+ TO_STR_TIME_RES_T_DSECS, /* deciseconds */
+ TO_STR_TIME_RES_T_CSECS, /* centiseconds */
+ TO_STR_TIME_RES_T_MSECS, /* milliseconds */
+ TO_STR_TIME_RES_T_USECS, /* microseconds */
+ TO_STR_TIME_RES_T_NSECS /* nanoseconds */
+} to_str_time_res_t;
+
+/*
+ * Display format of an absolute-time time stamp.
+ */
+typedef enum {
+ ABSOLUTE_TIME_LOCAL, /* local time in our time zone, with month and day */
+ ABSOLUTE_TIME_UTC, /* UTC, with month and day */
+ ABSOLUTE_TIME_DOY_UTC /* UTC, with 1-origin day-of-year */
+} absolute_time_display_e;
+
+#endif /* __TIME_FMT_H__ */