Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
util.h
1 /* util.h
2  * Utility definitions
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 __UTIL_H__
12 #define __UTIL_H__
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif /* __cplusplus */
17 
18 /* Collect command-line arguments as a string consisting of the arguments,
19  * separated by spaces.
20  */
21 char *get_args_as_string(int argc, char **argv, int optindex);
22 
23 /* Compute the difference between two seconds/microseconds time stamps.
24  * Beware: we're using nanosecond resolution now and function is currently unused
25  */
26 void compute_timestamp_diff(gint *diffsec, gint *diffusec,
27  guint32 sec1, guint32 usec1, guint32 sec2, guint32 usec2);
28 
29 /* Try to figure out if we're remotely connected, e.g. via ssh or
30  Terminal Server, and create a capture filter that matches aspects of the
31  connection. We match the following environment variables:
32 
33  SSH_CONNECTION (ssh): <remote IP> <remote port> <local IP> <local port>
34  SSH_CLIENT (ssh): <remote IP> <remote port> <local port>
35  REMOTEHOST (tcsh, others?): <remote name>
36  DISPLAY (x11): [remote name]:<display num>
37  CLIENTNAME (terminal server): <remote name>
38  */
39 const char *get_conn_cfilter(void);
40 
44 gboolean display_is_remote(void);
45 
51 extern void set_last_open_dir(const char *dirname);
52 
53 #ifdef __cplusplus
54 }
55 #endif /* __cplusplus */
56 
57 #endif /* __UTIL_H__ */
58 
59 /*
60  * Editor modelines
61  *
62  * Local Variables:
63  * c-basic-offset: 4
64  * tab-width: 8
65  * indent-tabs-mode: nil
66  * End:
67  *
68  * ex: set shiftwidth=4 tabstop=8 expandtab:
69  * :indentSize=4:tabSize=8:noTabs=true:
70  */