Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
timestamp.h
Go to the documentation of this file.
1
10#pragma once
11#include "ws_symbol_export.h"
12
13#include <wsutil/nstime.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif /* __cplusplus */
18
19/*
20 * Type of time-stamp shown in the summary display.
21 */
22typedef enum {
23 TS_RELATIVE, /* Since first captured frame */
24 TS_RELATIVE_CAP, /* Since start of capture */
25 TS_ABSOLUTE, /* Local absolute time, without date */
26 TS_ABSOLUTE_WITH_YMD, /* Local absolute time, with date in YYYY-MM-DD form */
27 TS_ABSOLUTE_WITH_YDOY, /* Local absolute time, with date in YYYY DOY form */
28 TS_DELTA, /* Since previous captured packet */
29 TS_DELTA_DIS, /* Since previous displayed packet */
30 TS_EPOCH, /* Seconds (and fractions) since epoch */
31 TS_UTC, /* UTC absolute time, without date */
32 TS_UTC_WITH_YMD, /* UTC absolute time, with date in YYYY-MM-DD form */
33 TS_UTC_WITH_YDOY, /* UTC absolute time, with date in YYYY DOY form */
34
35/*
36 * Special value used for the command-line setting in Wireshark, to indicate
37 * that no value has been set from the command line.
38 */
39 TS_NOT_SET
40} ts_type;
41
42typedef enum {
43 TS_PREC_AUTO = -1, /* Use what the capture file specifies */
44 TS_PREC_FIXED_SEC = WS_TSPREC_SEC,
45 TS_PREC_FIXED_100_MSEC = WS_TSPREC_100_MSEC,
46 TS_PREC_FIXED_10_MSEC = WS_TSPREC_10_MSEC,
47 TS_PREC_FIXED_MSEC = WS_TSPREC_MSEC,
48 TS_PREC_FIXED_100_USEC = WS_TSPREC_100_USEC,
49 TS_PREC_FIXED_10_USEC = WS_TSPREC_10_USEC,
50 TS_PREC_FIXED_USEC = WS_TSPREC_USEC,
51 TS_PREC_FIXED_100_NSEC = WS_TSPREC_100_NSEC,
52 TS_PREC_FIXED_10_NSEC = WS_TSPREC_10_NSEC,
53 TS_PREC_FIXED_NSEC = WS_TSPREC_NSEC,
54
55/*
56 * Special value used for the command-line setting in Wireshark, to indicate
57 * that no value has been set from the command line.
58 */
59 TS_PREC_NOT_SET = -2
60} ts_precision;
61
62typedef enum {
63 TS_SECONDS_DEFAULT, /* recent */
64 TS_SECONDS_HOUR_MIN_SEC,/* recent */
65
66/*
67 * Special value used for the command-line setting in Wireshark, to indicate
68 * that no value has been set from the command line.
69 */
70 TS_SECONDS_NOT_SET
71} ts_seconds_type;
72
78WS_DLL_PUBLIC ts_type timestamp_get_type(void);
79
85WS_DLL_PUBLIC void timestamp_set_type(ts_type ts_t);
86
92WS_DLL_PUBLIC int timestamp_get_precision(void);
93
99WS_DLL_PUBLIC void timestamp_set_precision(int tsp);
100
106WS_DLL_PUBLIC ts_seconds_type timestamp_get_seconds_type(void);
107
113WS_DLL_PUBLIC void timestamp_set_seconds_type(ts_seconds_type ts_t);
114
115#ifdef __cplusplus
116}
117#endif /* __cplusplus */
@ WS_TSPREC_USEC
Definition nstime.h:361
@ WS_TSPREC_100_NSEC
Definition nstime.h:362
@ WS_TSPREC_100_MSEC
Definition nstime.h:356
@ WS_TSPREC_100_USEC
Definition nstime.h:359
@ WS_TSPREC_NSEC
Definition nstime.h:364
@ WS_TSPREC_MSEC
Definition nstime.h:358
@ WS_TSPREC_10_MSEC
Definition nstime.h:357
@ WS_TSPREC_10_USEC
Definition nstime.h:360
@ WS_TSPREC_SEC
Definition nstime.h:355
@ WS_TSPREC_10_NSEC
Definition nstime.h:363
WS_DLL_PUBLIC void timestamp_set_type(ts_type ts_t)
Set the timestamp type.
Definition timestamp.c:28
WS_DLL_PUBLIC void timestamp_set_precision(int tsp)
Set the timestamp precision.
Definition timestamp.c:39
WS_DLL_PUBLIC ts_type timestamp_get_type(void)
Get the current timestamp type.
Definition timestamp.c:23
WS_DLL_PUBLIC void timestamp_set_seconds_type(ts_seconds_type ts_t)
Set the timestamp seconds type.
Definition timestamp.c:50
WS_DLL_PUBLIC int timestamp_get_precision(void)
Get the current timestamp precision.
Definition timestamp.c:34
WS_DLL_PUBLIC ts_seconds_type timestamp_get_seconds_type(void)
Get the current timestamp seconds type.
Definition timestamp.c:45