kerberos: make use of &NT_errors_ext
[wireshark-sm.git] / ui / util.h
blob865909bfba29a8ede1fe5025f32a178c2aca1f94
1 /** @file
3 * Utility definitions
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __UTIL_H__
13 #define __UTIL_H__
15 #ifdef __cplusplus
16 extern "C" {
17 #endif /* __cplusplus */
19 /* Collect command-line arguments as a string consisting of the arguments,
20 * separated by spaces.
22 char *get_args_as_string(int argc, char **argv, int optindex);
24 /* Compute the difference between two seconds/microseconds time stamps.
25 * Beware: we're using nanosecond resolution now and function is currently unused
27 void compute_timestamp_diff(int *diffsec, int *diffusec,
28 uint32_t sec1, uint32_t usec1, uint32_t sec2, uint32_t usec2);
30 /* Try to figure out if we're remotely connected, e.g. via ssh or
31 Terminal Server, and create a capture filter that matches aspects of the
32 connection. We match the following environment variables:
34 SSH_CONNECTION (ssh): <remote IP> <remote port> <local IP> <local port>
35 SSH_CLIENT (ssh): <remote IP> <remote port> <local port>
36 REMOTEHOST (tcsh, others?): <remote name>
37 DISPLAY (x11): [remote name]:<display num>
38 CLIENTNAME (terminal server): <remote name>
40 const char *get_conn_cfilter(void);
42 /** Check if we're running on a remote connection.
43 * @return true if we're running remotely, false if local.
45 bool display_is_remote(void);
47 /** Get the latest directory in which a file has been opened.
49 * @return the dirname
51 extern const char *get_last_open_dir(void);
53 /** Set the latest directory in which a file has been opened.
55 * @param dirname the dirname
57 extern void set_last_open_dir(const char *dirname);
59 /** Get the initial directory to use in file open dialogs.
61 * @return the dirname
63 extern const char *get_open_dialog_initial_dir(void);
65 #ifdef __cplusplus
67 #endif /* __cplusplus */
69 #endif /* __UTIL_H__ */