|
Wireshark 4.7.3
The Wireshark network protocol analyzer
|
Go to the source code of this file.
Classes | |
| struct | _ssh_params |
| Holds the connection parameters required to establish an SSH session for an SSH-based extcap capture. More... | |
Macros | |
| #define | STDERR_FILENO 2 |
| #define | STDOUT_FILENO 1 |
| #define | SSH_BASE_OPTIONS |
| #define | SSH_BASE_OPTIONS_ENUM |
| #define | SSH_BASE_PACKET_OPTIONS |
| #define | SSH_BASE_PACKET_OPTIONS_ENUM |
Typedefs | |
| typedef struct _ssh_params | ssh_params_t |
| Holds the connection parameters required to establish an SSH session for an SSH-based extcap capture. | |
Functions | |
| void | ssh_base_list_config (unsigned *count) |
| Print SSH base server and authentication configuration options. | |
| void | ssh_base_add_help_options (extcap_parameters *extcap_conf) |
| Adds SSH base server and authentication options to the help options. | |
| void | add_libssh_info (extcap_parameters *extcap_conf) |
| Adds information about the libssh library version to the extcap parameters. | |
| ssh_session | create_ssh_connection (const ssh_params_t *ssh_params, char **err_info) |
| Creates an SSH session based on the provided parameters. | |
| int | ssh_channel_printf (ssh_channel channel, const char *fmt,...) |
| Writes a formatted message to an SSH channel. | |
| bool | ssh_base_setup_graceful_shutdown (extcap_parameters *extcap_conf) |
| Sets up ssh_async_loop_read to allow graceful shutdown. | |
| int | ssh_async_loop_read (ssh_session sshs, ssh_channel channel, FILE *fp) |
| Asynchronously reads the output of a single SSH command. | |
| void | ssh_cleanup (ssh_session *sshs, ssh_channel *channel) |
| Cleans up SSH session and channel resources. | |
| ssh_params_t * | ssh_params_new (void) |
| Create a new SSH parameters structure. | |
| void | ssh_params_free (ssh_params_t *ssh_params) |
| Frees the memory allocated for an ssh_params_t structure. | |
| void | ssh_params_set_log_level (ssh_params_t *ssh_params, enum ws_log_level level) |
| Set the log level for SSH parameters. | |
ssh-base has base utility functions to connect to hosts via ssh
Copyright 2016, Dario Lombardo
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
| #define SSH_BASE_OPTIONS |
| #define SSH_BASE_OPTIONS_ENUM |
| #define SSH_BASE_PACKET_OPTIONS |
| #define SSH_BASE_PACKET_OPTIONS_ENUM |
| void add_libssh_info | ( | extcap_parameters * | extcap_conf | ) |
Adds information about the libssh library version to the extcap parameters.
| extcap_conf | Pointer to the extcap parameters structure. |
| ssh_session create_ssh_connection | ( | const ssh_params_t * | ssh_params, |
| char ** | err_info ) |
Creates an SSH session based on the provided parameters.
Create a ssh connection using all the possible authentication methods
| ssh_params | Pointer to the SSH parameters structure containing connection details. |
| err_info | Pointer to a string that will hold error information if the function fails. |
| int ssh_async_loop_read | ( | ssh_session | sshs, |
| ssh_channel | channel, | ||
| FILE * | fp ) |
Asynchronously reads the output of a single SSH command.
Loops to read the output of a single SSH command and write it to an open FILE pointer. Calls ssh_select to wait on the channel and optionally the graceful shutdown indication, if ssh_base_setup_graceful_shutdown was called (non-Windows only). If the SSH channel's stdout reaches EOF, the function then reads the channel's stderr and writes that to the current process's stderr.
| sshs | The SSH session |
| channel | The SSH channel to read |
| fp | The FILE to write the channel's stdout to |
| void ssh_base_add_help_options | ( | extcap_parameters * | extcap_conf | ) |
Adds SSH base server and authentication options to the help options.
| extcap_conf | Pointer to the extcap parameters structure. |
| void ssh_base_list_config | ( | unsigned * | count | ) |
Print SSH base server and authentication configuration options.
| [in,out] | count | The current option count |
| bool ssh_base_setup_graceful_shutdown | ( | extcap_parameters * | extcap_conf | ) |
Sets up ssh_async_loop_read to allow graceful shutdown.
Creates a self-pipe (eventually, on Windows, a SOCKET, but not implemented yet) that allows ssh_async_loop_read to be interrupted when a graceful shutdown is signaled for by the main application. This is useful for, among other things, when SSH has EXEC'd a command like dumpcap and tcpdump that might sit without attempting to read from stdin or write to stdout or stderr indefinitely if, e.g., a capture filter was given that excludes all packets, and thus will not exit unless a SIGHUP is manually issued, such as by ssh_cleanup.
| extcap_conf | Pointer to the extcap parameters structure. |
| int ssh_channel_printf | ( | ssh_channel | channel, |
| const char * | fmt, | ||
| ... ) |
Writes a formatted message to an SSH channel.
| channel | The SSH channel to write to. |
| fmt | The format string for the message. |
| void ssh_cleanup | ( | ssh_session * | sshs, |
| ssh_channel * | channel ) |
Cleans up SSH session and channel resources.
This function is responsible for properly closing and freeing the SSH session and channel resources.
| sshs | Pointer to the SSH session to be cleaned up. |
| channel | Pointer to the SSH channel to be closed. |
| void ssh_params_free | ( | ssh_params_t * | ssh_params | ) |
Frees the memory allocated for an ssh_params_t structure.
| ssh_params | Pointer to the ssh_params_t structure to be freed. |
| ssh_params_t * ssh_params_new | ( | void | ) |
Create a new SSH parameters structure.
| void ssh_params_set_log_level | ( | ssh_params_t * | ssh_params, |
| enum ws_log_level | level ) |
Set the log level for SSH parameters.
| ssh_params | Pointer to the SSH parameters structure. |
| level | The desired log level from the ws_log_level enumeration. |