From d8f541c89b94ae0fe6233bd93dbd0d910a65ccdd Mon Sep 17 00:00:00 2001 From: Dario Lombardo Date: Tue, 1 Mar 2016 14:13:41 +0100 Subject: extcap: move ssh common functions to ssh-base. Change-Id: Ic06882a4f914b4f89d936d5d942b50552ae4abb3 Reviewed-on: https://code.wireshark.org/review/14264 Petri-Dish: Roland Knall Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall --- extcap/ssh-base.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 extcap/ssh-base.h (limited to 'extcap/ssh-base.h') diff --git a/extcap/ssh-base.h b/extcap/ssh-base.h new file mode 100644 index 0000000000..07c3e3305a --- /dev/null +++ b/extcap/ssh-base.h @@ -0,0 +1,50 @@ +/* ssh-base.h + * ssh-base has base utility functions to connect to hosts via ssh + * + * Copyright 2016, Dario Lombardo + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __SSHBASE_H__ +#define __SSHBASE_H__ + +#include + +/* Create a ssh connection using all the possible authentication menthods */ +ssh_session create_ssh_connection(const char* hostname, const unsigned int port, const char* username, + const char* password, const char* sshkey_path, const char* sshkey_passphrase, char** err_info); + +/* Clean the current ssh session and channel. */ +void ssh_cleanup(ssh_session* sshs, ssh_channel* channel); + +#endif + +/* + * Editor modelines - https://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ \ No newline at end of file -- cgit v1.2.1