#include <stdint.h>
Go to the source code of this file.
|
| char * | get_args_as_string (int argc, char **argv, int optindex) |
| | Concatenate command-line arguments into a single space-separated string.
|
| |
| void | compute_timestamp_diff (int *diffsec, int *diffusec, uint32_t sec1, uint32_t usec1, uint32_t sec2, uint32_t usec2) |
| | Compute the difference between two seconds/microseconds timestamps.
|
| |
| const char * | get_conn_cfilter (void) |
| | Build a capture filter string matching the current remote connection.
|
| |
| bool | display_is_remote (void) |
| | Determine whether the current session is remote.
|
| |
| const char * | get_last_open_dir (void) |
| | Return the most recently used file-open directory.
|
| |
| void | set_last_open_dir (const char *dirname) |
| | Set the most recently used file-open directory.
|
| |
| const char * | get_open_dialog_initial_dir (void) |
| | Return the initial directory to present in file-open dialogs.
|
| |
Utility definitions
Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs
SPDX-License-Identifier: GPL-2.0-or-later
◆ compute_timestamp_diff()
| void compute_timestamp_diff |
( |
int * |
diffsec, |
|
|
int * |
diffusec, |
|
|
uint32_t |
sec1, |
|
|
uint32_t |
usec1, |
|
|
uint32_t |
sec2, |
|
|
uint32_t |
usec2 |
|
) |
| |
Compute the difference between two seconds/microseconds timestamps.
- Parameters
-
| diffsec | Receives the seconds component of the difference. |
| diffusec | Receives the microseconds component of the difference. |
| sec1 | Seconds of the first (later) timestamp. |
| usec1 | Microseconds of the first (later) timestamp. |
| sec2 | Seconds of the second (earlier) timestamp. |
| usec2 | Microseconds of the second (earlier) timestamp. |
◆ display_is_remote()
| bool display_is_remote |
( |
void |
| ) |
|
Determine whether the current session is remote.
- Returns
- true if a remote connection is detected (see get_conn_cfilter()), false if the session is local.
◆ get_args_as_string()
| char * get_args_as_string |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
int |
optindex |
|
) |
| |
Concatenate command-line arguments into a single space-separated string.
- Parameters
-
| argc | The total argument count (as passed to main()). |
| argv | The argument vector (as passed to main()). |
| optindex | Index of the first argument to include; typically the value of optind after option parsing is complete. |
- Returns
- A newly allocated string containing the joined arguments, or NULL if no arguments remain.
◆ get_conn_cfilter()
| const char * get_conn_cfilter |
( |
void |
| ) |
|
Build a capture filter string matching the current remote connection.
SSH_CONNECTION (ssh): <remote IP> <remote port> <local IP> <local port>
SSH_CLIENT (ssh): <remote IP> <remote port> <local port>
REMOTEHOST (tcsh, others): <remote name>
DISPLAY (X11): [<remote name>]:<display num>
CLIENTNAME (Terminal Server): <remote name>
- Returns
- A capture filter string for the detected connection, or NULL if no remote session is detected.
◆ get_last_open_dir()
| const char * get_last_open_dir |
( |
void |
| ) |
|
|
extern |
Return the most recently used file-open directory.
- Returns
- The path of the last directory in which a file was opened, or NULL if no file has been opened yet.
Get the latest opened directory.
- Returns
- the dirname
◆ get_open_dialog_initial_dir()
| const char * get_open_dialog_initial_dir |
( |
void |
| ) |
|
|
extern |
Return the initial directory to present in file-open dialogs.
- Returns
- The initial directory path for file-open dialogs.
◆ set_last_open_dir()
| void set_last_open_dir |
( |
const char * |
dirname | ) |
|
|
extern |
Set the most recently used file-open directory.
- Parameters
-
| dirname | The directory path to record as the last opened. |