Wireshark  4.3.0
The Wireshark network protocol analyzer
timestamp.h
Go to the documentation of this file.
1 
11 #ifndef __TIMESTAMP_H__
12 #define __TIMESTAMP_H__
13 
14 #include "ws_symbol_export.h"
15 
16 #include <wsutil/nstime.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
21 
22 /*
23  * Type of time-stamp shown in the summary display.
24  */
25 typedef enum {
26  TS_RELATIVE, /* Since start of capture */
27  TS_ABSOLUTE, /* Local absolute time, without date */
28  TS_ABSOLUTE_WITH_YMD, /* Local absolute time, with date in YYYY-MM-DD form */
29  TS_ABSOLUTE_WITH_YDOY, /* Local absolute time, with date in YYYY DOY form */
30  TS_DELTA, /* Since previous captured packet */
31  TS_DELTA_DIS, /* Since previous displayed packet */
32  TS_EPOCH, /* Seconds (and fractions) since epoch */
33  TS_UTC, /* UTC absolute time, without date */
34  TS_UTC_WITH_YMD, /* UTC absolute time, with date in YYYY-MM-DD form */
35  TS_UTC_WITH_YDOY, /* UTC absolute time, with date in YYYY DOY form */
36 
37 /*
38  * Special value used for the command-line setting in Wireshark, to indicate
39  * that no value has been set from the command line.
40  */
41  TS_NOT_SET
42 } ts_type;
43 
44 typedef enum {
45  TS_PREC_AUTO = -1, /* Use what the capture file specifies */
46  TS_PREC_FIXED_SEC = WS_TSPREC_SEC,
47  TS_PREC_FIXED_100_MSEC = WS_TSPREC_100_MSEC,
48  TS_PREC_FIXED_10_MSEC = WS_TSPREC_10_MSEC,
49  TS_PREC_FIXED_MSEC = WS_TSPREC_MSEC,
50  TS_PREC_FIXED_100_USEC = WS_TSPREC_100_USEC,
51  TS_PREC_FIXED_10_USEC = WS_TSPREC_10_USEC,
52  TS_PREC_FIXED_USEC = WS_TSPREC_USEC,
53  TS_PREC_FIXED_100_NSEC = WS_TSPREC_100_NSEC,
54  TS_PREC_FIXED_10_NSEC = WS_TSPREC_10_NSEC,
55  TS_PREC_FIXED_NSEC = WS_TSPREC_NSEC,
56 
57 /*
58  * Special value used for the command-line setting in Wireshark, to indicate
59  * that no value has been set from the command line.
60  */
61  TS_PREC_NOT_SET = -2
62 } ts_precision;
63 
64 typedef enum {
65  TS_SECONDS_DEFAULT, /* recent */
66  TS_SECONDS_HOUR_MIN_SEC,/* recent */
67 
68 /*
69  * Special value used for the command-line setting in Wireshark, to indicate
70  * that no value has been set from the command line.
71  */
72  TS_SECONDS_NOT_SET
73 } ts_seconds_type;
74 
75 WS_DLL_PUBLIC ts_type timestamp_get_type(void);
76 WS_DLL_PUBLIC void timestamp_set_type(ts_type);
77 
78 WS_DLL_PUBLIC int timestamp_get_precision(void);
79 WS_DLL_PUBLIC void timestamp_set_precision(int tsp);
80 
81 WS_DLL_PUBLIC ts_seconds_type timestamp_get_seconds_type(void);
82 WS_DLL_PUBLIC void timestamp_set_seconds_type(ts_seconds_type);
83 
84 #ifdef __cplusplus
85 }
86 #endif /* __cplusplus */
87 
88 #endif /* timestamp.h */