2 * ssh-base has base utility functions to connect to hosts via ssh
4 * Copyright 2016, Dario Lombardo
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
16 #include <libssh/libssh.h>
21 #define STDERR_FILENO 2
25 #define STDOUT_FILENO 1
28 #define SSH_BASE_OPTIONS \
29 { "remote-host", required_argument, NULL, OPT_REMOTE_HOST}, \
30 { "remote-port", required_argument, NULL, OPT_REMOTE_PORT}, \
31 { "remote-username", required_argument, NULL, OPT_REMOTE_USERNAME}, \
32 { "remote-password", required_argument, NULL, OPT_REMOTE_PASSWORD}, \
33 { "remote-interface", required_argument, NULL, OPT_REMOTE_INTERFACE}, \
34 { "remote-filter", required_argument, NULL, OPT_REMOTE_FILTER}, \
35 { "remote-count", required_argument, NULL, OPT_REMOTE_COUNT}, \
36 { "sshkey", required_argument, NULL, OPT_SSHKEY}, \
37 { "sshkey-passphrase", required_argument, NULL, OPT_SSHKEY_PASSPHRASE}
39 /* Create a ssh connection using all the possible authentication menthods */
40 ssh_session create_ssh_connection(const char* hostname, const guint16 port, const char* username,
41 const char* password, const char* sshkey_path, const char* sshkey_passphrase, char** err_info);
43 /* Write a formatted message in the channel */
44 int ssh_channel_printf(ssh_channel channel, const char* fmt, ...);
46 /* Clean the current ssh session and channel. */
47 void ssh_cleanup(ssh_session* sshs, ssh_channel* channel);
52 * Editor modelines - https://www.wireshark.org/tools/modelines.html
60 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
61 * :indentSize=8:tabSize=8:noTabs=false: