Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
time_shift.h
1 /* time_shift.h
2  * Submitted by Edwin Groothuis <wireshark@mavetju.org>
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10 
11 #ifndef __TIME_SHIFT_H__
12 #define __TIME_SHIFT_H__
13 
14 #include "cfile.h"
15 #include <wsutil/nstime.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
20 
21 /*
22  * XXX - We might want to move all of this somewhere more accessible to
23  * editcap so that we can make its time adjustments more versatile.
24  */
25 
44 const gchar * time_string_parse(const gchar *time_text, int *year, int *month, int *day, gboolean *negative, int *hour, int *minute, long double *second);
45 
53 const gchar * time_shift_all(capture_file *cf, const gchar *offset_text);
54 
55 /* Set the time for a single packet
56  *
57  * @param cf Capture file to set
58  * @param packet_num Packet to set
59  * @param time_text String representation of the time
60  *
61  * @return NULL on success or an error description on failure.
62  */
63 const gchar * time_shift_settime(capture_file *cf, guint packet_num, const gchar *time_text);
64 
65 /* Set the time for two packets and extrapolate the rest
66  *
67  * @param cf Capture file to set
68  * @param packet1_num First packet to set
69  * @param time1_text String representation of the first packet time
70  * @param packet2_num Second packet to set
71  * @param time2_text String representation of the second packet time
72  *
73  * @return NULL on success or an error description on failure.
74  */
75 const gchar * time_shift_adjtime(capture_file *cf, guint packet1_num, const gchar *time1_text, guint packet2_num, const gchar *time2_text);
76 
77 /* Reset the times for all packets
78  *
79  * @param cf Capture file to set
80  *
81  * @return NULL on success or an error description on failure.
82  */
83 const gchar * time_shift_undo(capture_file *cf);
84 
85 #ifdef __cplusplus
86 }
87 #endif /* __cplusplus */
88 
89 #endif /* __TIME_SHIFT_H__ */
90 
91 /*
92  * Editor modelines - http://www.wireshark.org/tools/modelines.html
93  *
94  * Local variables:
95  * c-basic-offset: 4
96  * tab-width: 8
97  * indent-tabs-mode: nil
98  * End:
99  *
100  * vi: set shiftwidth=4 tabstop=8 expandtab:
101  * :indentSize=4:tabSize=8:noTabs=true:
102  */
Definition: cfile.h:58