Kerberos: add kerberos_inject_longterm_key() helper function
[wireshark-sm.git] / ui / util.h
blob8cf18c2b719dc1e84d6448c1c9c9e731fd3dcf61
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 #include <stdint.h>
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
21 /* Collect command-line arguments as a string consisting of the arguments,
22 * separated by spaces.
24 char *get_args_as_string(int argc, char **argv, int optindex);
26 /* Compute the difference between two seconds/microseconds time stamps.
27 * Beware: we're using nanosecond resolution now and function is currently unused
29 void compute_timestamp_diff(int *diffsec, int *diffusec,
30 uint32_t sec1, uint32_t usec1, uint32_t sec2, uint32_t usec2);
32 /* Try to figure out if we're remotely connected, e.g. via ssh or
33 Terminal Server, and create a capture filter that matches aspects of the
34 connection. We match the following environment variables:
36 SSH_CONNECTION (ssh): <remote IP> <remote port> <local IP> <local port>
37 SSH_CLIENT (ssh): <remote IP> <remote port> <local port>
38 REMOTEHOST (tcsh, others?): <remote name>
39 DISPLAY (x11): [remote name]:<display num>
40 CLIENTNAME (terminal server): <remote name>
42 const char *get_conn_cfilter(void);
44 /** Check if we're running on a remote connection.
45 * @return true if we're running remotely, false if local.
47 bool display_is_remote(void);
49 /** Get the latest directory in which a file has been opened.
51 * @return the dirname
53 extern const char *get_last_open_dir(void);
55 /** Set the latest directory in which a file has been opened.
57 * @param dirname the dirname
59 extern void set_last_open_dir(const char *dirname);
61 /** Get the initial directory to use in file open dialogs.
63 * @return the dirname
65 extern const char *get_open_dialog_initial_dir(void);
67 #ifdef __cplusplus
69 #endif /* __cplusplus */
71 #endif /* __UTIL_H__ */